umami-api-js 0.1.0 → 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 +1 -1
- package/dist/index.d.ts +10 -28
- package/dist/index.js +1 -1
- package/dist/namespaces/Admin.d.ts +3 -3
- package/dist/namespaces/Links.d.ts +3 -5
- package/dist/namespaces/Me.d.ts +9 -15
- package/dist/namespaces/Me.js +3 -3
- package/dist/namespaces/Pixels.d.ts +3 -5
- package/dist/namespaces/Reports.d.ts +2 -4
- package/dist/namespaces/Teams.d.ts +8 -12
- package/dist/namespaces/Users.d.ts +23 -16
- package/dist/namespaces/Websites.d.ts +15 -18
- package/dist/namespaces/Websites.js +6 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
A package to interact with [the API of self-hosted instances of Umami v3.0.0](https://umami.is/docs/api). It is a lightweight alternative to [@umami/api-client](https://github.com/umami-software/api-client), forked from [osu-api-v2-js](https://github.com/TTTaevas/osu-api-v2-js).
|
|
2
2
|
|
|
3
|
-
If you are reading this from the [package's documentation](https://umami-api-js.taevas.xyz/), please be aware that the documentation is for **umami-api-js@0.1.
|
|
3
|
+
If you are reading this from the [package's documentation](https://umami-api-js.taevas.xyz/), please be aware that the documentation is for **umami-api-js@0.1.1**, so make sure your package is up to date! Report any bug on [Codeberg](https://codeberg.org/Taevas/umami-api-js/issues).
|
|
4
4
|
|
|
5
5
|
Please note that this package is expected to work with self-hosted instances of **Umami v3.0.0**, and is *not* expected to work with [Umami Cloud](https://umami.is/docs/cloud), the instance of Umami hosted by its creators.
|
package/dist/index.d.ts
CHANGED
|
@@ -11,33 +11,27 @@ import { Users } from "./namespaces/Users.js";
|
|
|
11
11
|
import { Websites } from "./namespaces/Websites.js";
|
|
12
12
|
import { WebsiteStats } from "./namespaces/WebsiteStats.js";
|
|
13
13
|
export { Admin, Events, Links, Me, Pixels, Websites, WebsiteStats, Realtime, Reports, Sessions, Teams, Users };
|
|
14
|
-
export interface ValueAndPrev {
|
|
15
|
-
/** The actual value for the given time period */
|
|
16
|
-
value: number;
|
|
17
|
-
/** The value for the same *timespan* for the time period that ends where the time period for value starts */
|
|
18
|
-
prev: number;
|
|
19
|
-
}
|
|
20
|
-
export interface MinimalUser {
|
|
21
|
-
id: string;
|
|
22
|
-
username: string;
|
|
23
|
-
}
|
|
24
14
|
export interface GenericObject {
|
|
25
15
|
id: string;
|
|
26
16
|
createdAt: Date;
|
|
27
17
|
updatedAt: Date | null;
|
|
28
18
|
deletedAt: Date | null;
|
|
29
19
|
}
|
|
20
|
+
export interface DeletionResult {
|
|
21
|
+
ok: boolean;
|
|
22
|
+
}
|
|
30
23
|
export interface Website extends GenericObject {
|
|
31
24
|
name: string;
|
|
32
25
|
domain: string;
|
|
33
26
|
shareId: string | null;
|
|
34
27
|
resetAt: Date | null;
|
|
35
|
-
|
|
28
|
+
/** @remarks Is null if the website is under a team (has a `teamId`) */
|
|
29
|
+
userId: Users.User["id"] | null;
|
|
36
30
|
teamId: string | null;
|
|
37
|
-
createdBy:
|
|
31
|
+
createdBy: Users.User["id"];
|
|
38
32
|
}
|
|
39
33
|
export interface Report extends Omit<GenericObject, "deletedAt"> {
|
|
40
|
-
userId:
|
|
34
|
+
userId: Users.User["id"];
|
|
41
35
|
websiteId: string;
|
|
42
36
|
type: string;
|
|
43
37
|
name: string;
|
|
@@ -65,6 +59,7 @@ export interface Timestamps {
|
|
|
65
59
|
/** Timestamp of end date */
|
|
66
60
|
endAt: Date | number;
|
|
67
61
|
}
|
|
62
|
+
/** An object with the properties `x`, `t`, and `y`, where they're respectively a name, a date, and an amount */
|
|
68
63
|
export interface XTY {
|
|
69
64
|
/** Event name */
|
|
70
65
|
x: string;
|
|
@@ -107,7 +102,6 @@ export interface Filters {
|
|
|
107
102
|
/** UUID of cohort */
|
|
108
103
|
cohort?: string;
|
|
109
104
|
}
|
|
110
|
-
export type Role = "admin" | "user" | "view-only";
|
|
111
105
|
export type TeamRole = "team-manager" | "team-member" | "team-view-only";
|
|
112
106
|
/** If the {@link API} throws an error, it should always be an {@link APIError}! */
|
|
113
107
|
export declare class APIError extends Error {
|
|
@@ -169,20 +163,8 @@ export declare class API {
|
|
|
169
163
|
});
|
|
170
164
|
private _user;
|
|
171
165
|
/** Information about the account that has been used to log in */
|
|
172
|
-
get user():
|
|
173
|
-
|
|
174
|
-
username: string;
|
|
175
|
-
role: Role;
|
|
176
|
-
createdAt: Date;
|
|
177
|
-
isAdmin: boolean;
|
|
178
|
-
};
|
|
179
|
-
set user(user: {
|
|
180
|
-
id: string;
|
|
181
|
-
username: string;
|
|
182
|
-
role: Role;
|
|
183
|
-
createdAt: Date;
|
|
184
|
-
isAdmin: boolean;
|
|
185
|
-
});
|
|
166
|
+
get user(): Users.User;
|
|
167
|
+
set user(user: Users.User);
|
|
186
168
|
private number_of_requests;
|
|
187
169
|
/** Has {@link API.setNewToken} been called and not yet returned anything? */
|
|
188
170
|
private is_setting_token;
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { API, GenericObject, GenericRequestParameters,
|
|
1
|
+
import { API, GenericObject, GenericRequestParameters, Teams, Users, Website } from "../index.js";
|
|
2
2
|
/** Operations around admin management: https://umami.is/docs/api/admin */
|
|
3
3
|
export declare namespace Admin {
|
|
4
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
|
-
role: Role;
|
|
7
|
+
role: Users.Role;
|
|
8
8
|
logoUrl: string | null;
|
|
9
9
|
displayName: string | null;
|
|
10
10
|
_count: {
|
|
@@ -13,7 +13,7 @@ export declare namespace Admin {
|
|
|
13
13
|
})[]>;
|
|
14
14
|
/** Returns all websites: https://umami.is/docs/api/admin#get-apiadminwebsites */
|
|
15
15
|
function getWebsites(this: API, parameters?: GenericRequestParameters): Promise<(Website & {
|
|
16
|
-
user: MinimalUser;
|
|
16
|
+
user: Users.MinimalUser;
|
|
17
17
|
/** @remarks TODO Documentation says it can be null but doesn't actually say what else it can be, ***presumed* to be string**, check */
|
|
18
18
|
team: string | null;
|
|
19
19
|
})[]>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { API, GenericObject, GenericRequestParameters } from "../index.js";
|
|
1
|
+
import { API, DeletionResult, GenericObject, GenericRequestParameters, Users } from "../index.js";
|
|
2
2
|
/** Operations around Links management: https://umami.is/docs/api/links */
|
|
3
3
|
export declare namespace Links {
|
|
4
4
|
interface Link extends GenericObject {
|
|
5
5
|
name: string;
|
|
6
6
|
url: string;
|
|
7
7
|
slug: string;
|
|
8
|
-
userId:
|
|
8
|
+
userId: Users.User["id"];
|
|
9
9
|
teamid: string | null;
|
|
10
10
|
}
|
|
11
11
|
/** Returns all user links: https://umami.is/docs/api/links#get-apilinks (TODO UNTESTED) */
|
|
@@ -22,7 +22,5 @@ export declare namespace Links {
|
|
|
22
22
|
slug?: string;
|
|
23
23
|
}): Promise<Link>;
|
|
24
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
|
-
}>;
|
|
25
|
+
function delete_LINKID(this: API, linkId: Link["id"]): Promise<DeletionResult>;
|
|
28
26
|
}
|
package/dist/namespaces/Me.d.ts
CHANGED
|
@@ -1,44 +1,38 @@
|
|
|
1
|
-
import { API, GenericObject,
|
|
1
|
+
import { API, GenericObject, TeamRole, Users } from "../index.js";
|
|
2
2
|
/** All information about your session: https://umami.is/docs/api/me */
|
|
3
3
|
export declare namespace Me {
|
|
4
|
-
/** Get information based on your auth token: https://umami.is/docs/api/me#get-apime
|
|
4
|
+
/** Get information based on your auth token: https://umami.is/docs/api/me#get-apime */
|
|
5
5
|
function get(this: API): Promise<{
|
|
6
6
|
token: string;
|
|
7
7
|
authKey: string;
|
|
8
8
|
shareToken: string | null;
|
|
9
|
-
user:
|
|
10
|
-
id: string;
|
|
11
|
-
username: string;
|
|
12
|
-
role: Role;
|
|
13
|
-
createdAt: Date;
|
|
14
|
-
isAdmin: boolean;
|
|
15
|
-
};
|
|
9
|
+
user: Users.User;
|
|
16
10
|
}>;
|
|
17
|
-
/** Get all your teams: https://umami.is/docs/api/me#get-apimeteams
|
|
11
|
+
/** Get all your teams: https://umami.is/docs/api/me#get-apimeteams */
|
|
18
12
|
function getTeams(this: API): Promise<(GenericObject & {
|
|
19
13
|
name: string;
|
|
20
14
|
accessCode: string;
|
|
21
15
|
logoUrl: string | null;
|
|
22
16
|
members: (Omit<GenericObject, "deletedAt"> & {
|
|
23
17
|
teamId: string;
|
|
24
|
-
userId:
|
|
18
|
+
userId: Users.User["id"];
|
|
25
19
|
role: TeamRole;
|
|
26
|
-
user: MinimalUser;
|
|
20
|
+
user: Users.MinimalUser;
|
|
27
21
|
})[];
|
|
28
22
|
_count: {
|
|
29
23
|
websites: number;
|
|
30
24
|
members: number;
|
|
31
25
|
};
|
|
32
26
|
})[]>;
|
|
33
|
-
/** Get all your websites: https://umami.is/docs/api/me#get-apimeteams
|
|
27
|
+
/** Get all your websites: https://umami.is/docs/api/me#get-apimeteams */
|
|
34
28
|
function getWebsites(this: API): Promise<(GenericObject & {
|
|
35
29
|
name: string;
|
|
36
30
|
domain: string;
|
|
37
31
|
shareId: string | null;
|
|
38
32
|
resetAt: Date | null;
|
|
39
|
-
userId:
|
|
33
|
+
userId: Users.User["id"];
|
|
40
34
|
teamId: string | null;
|
|
41
35
|
createdBy: string;
|
|
42
|
-
user: MinimalUser;
|
|
36
|
+
user: Users.MinimalUser;
|
|
43
37
|
})[]>;
|
|
44
38
|
}
|
package/dist/namespaces/Me.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/** All information about your session: https://umami.is/docs/api/me */
|
|
2
2
|
export var Me;
|
|
3
3
|
(function (Me) {
|
|
4
|
-
/** Get information based on your auth token: https://umami.is/docs/api/me#get-apime
|
|
4
|
+
/** Get information based on your auth token: https://umami.is/docs/api/me#get-apime */
|
|
5
5
|
async function get() {
|
|
6
6
|
return await this.request("get", ["me"]);
|
|
7
7
|
}
|
|
8
8
|
Me.get = get;
|
|
9
|
-
/** Get all your teams: https://umami.is/docs/api/me#get-apimeteams
|
|
9
|
+
/** Get all your teams: https://umami.is/docs/api/me#get-apimeteams */
|
|
10
10
|
async function getTeams() {
|
|
11
11
|
const response = await this.request("get", ["me", "teams"]);
|
|
12
12
|
return response.data;
|
|
13
13
|
}
|
|
14
14
|
Me.getTeams = getTeams;
|
|
15
|
-
/** Get all your websites: https://umami.is/docs/api/me#get-apimeteams
|
|
15
|
+
/** Get all your websites: https://umami.is/docs/api/me#get-apimeteams */
|
|
16
16
|
async function getWebsites() {
|
|
17
17
|
const response = await this.request("get", ["me", "websites"]);
|
|
18
18
|
return response.data;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { API, GenericObject, GenericRequestParameters } from "../index.js";
|
|
1
|
+
import { API, DeletionResult, GenericObject, GenericRequestParameters, Users } from "../index.js";
|
|
2
2
|
/** Operations around Pixels management: https://umami.is/docs/api/pixels */
|
|
3
3
|
export declare namespace Pixels {
|
|
4
4
|
interface Pixel extends GenericObject {
|
|
5
5
|
name: string;
|
|
6
6
|
slug: string;
|
|
7
|
-
userId:
|
|
7
|
+
userId: Users.User["id"];
|
|
8
8
|
teamid: string | null;
|
|
9
9
|
}
|
|
10
10
|
/** Returns all user pixels: https://umami.is/docs/api/pixels#get-apipixels (TODO UNTESTED) */
|
|
@@ -19,7 +19,5 @@ export declare namespace Pixels {
|
|
|
19
19
|
slug?: string;
|
|
20
20
|
}): Promise<Pixel>;
|
|
21
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
|
-
}>;
|
|
22
|
+
function delete_PIXELID(this: API, pixelId: Pixel["id"]): Promise<DeletionResult>;
|
|
25
23
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { API, Filters, GenericRequestParameters, NameValue, Report, Timestamps, XTY } from "../index.js";
|
|
1
|
+
import { API, DeletionResult, Filters, GenericRequestParameters, NameValue, Report, Timestamps, XTY } from "../index.js";
|
|
2
2
|
/** Using reports throught the api: https://umami.is/docs/api/reports */
|
|
3
3
|
export declare namespace Reports {
|
|
4
4
|
type ReportType = {
|
|
@@ -31,9 +31,7 @@ export declare namespace Reports {
|
|
|
31
31
|
parameters?: any;
|
|
32
32
|
}): Promise<Report>;
|
|
33
33
|
/** Deletes a report: https://umami.is/docs/api/reports#delete-apireportsreportid (TODO UNTESTED) */
|
|
34
|
-
function delete_REPORTID(this: API, reportId: string): Promise<
|
|
35
|
-
ok: boolean;
|
|
36
|
-
}>;
|
|
34
|
+
function delete_REPORTID(this: API, reportId: string): Promise<DeletionResult>;
|
|
37
35
|
/** See how users engage with your marketing and what drives conversions: https://umami.is/docs/api/reports#post-apireportsattribution (TODO UNTESTED) */
|
|
38
36
|
function postAttribution(this: API, websiteId: string, parameters: ReportType & Filters & Timestamps & {
|
|
39
37
|
/** Attribution model */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { API, GenericObject, GenericRequestParameters, TeamRole } from "../index.js";
|
|
1
|
+
import { API, DeletionResult, GenericObject, GenericRequestParameters, TeamRole, Users } from "../index.js";
|
|
2
2
|
/** Operations around Team management: https://umami.is/docs/api/teams */
|
|
3
3
|
export declare namespace Teams {
|
|
4
4
|
interface GenericTeam extends GenericObject {
|
|
@@ -8,7 +8,7 @@ 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;
|
|
@@ -39,33 +39,29 @@ export declare namespace Teams {
|
|
|
39
39
|
accessCode?: string;
|
|
40
40
|
}): Promise<GenericTeam>;
|
|
41
41
|
/** Delete a team: https://umami.is/docs/api/teams#delete-apiteamsteamid (TODO UNTESTED) */
|
|
42
|
-
function delete_TEAMID(this: API, teamId: string): Promise<
|
|
43
|
-
ok: boolean;
|
|
44
|
-
}>;
|
|
42
|
+
function delete_TEAMID(this: API, teamId: string): Promise<DeletionResult>;
|
|
45
43
|
/** Get all users that belong to a team: https://umami.is/docs/api/teams#get-apiteamsteamidusers (TODO UNTESTED) */
|
|
46
44
|
function get_TEAMID_Users(this: API, teamId: string, parameters: GenericRequestParameters): Promise<TeamMember[]>;
|
|
47
45
|
/** Add a user to a team: https://umami.is/docs/api/teams#post-apiteamsteamidusers (TODO UNTESTED) */
|
|
48
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
52
|
/** Get a user belonging to a team: https://umami.is/docs/api/teams#get-apiteamsteamidusersuserid (TODO UNTESTED) */
|
|
55
|
-
function get_TEAMID_Users_USERID(this: API, teamId: string, userId:
|
|
53
|
+
function get_TEAMID_Users_USERID(this: API, teamId: string, userId: Users.User["id"]): Promise<Omit<TeamMember, "user">>;
|
|
56
54
|
/** Update a user's role on a team: https://umami.is/docs/api/teams#post-apiteamsteamidusersuserid (TODO UNTESTED) */
|
|
57
|
-
function post_TEAMID_Users_USERID(this: API, teamId: string, userId:
|
|
55
|
+
function post_TEAMID_Users_USERID(this: API, teamId: string, userId: Users.User["id"], role: TeamRole): Promise<Omit<TeamMember, "user">>;
|
|
58
56
|
/** Remove a user from a team: https://umami.is/docs/api/teams#delete-apiteamsteamidusersuserid (TODO UNTESTED) */
|
|
59
|
-
function delete_TEAMID_Users_USERID(this: API, teamId: string, userId:
|
|
60
|
-
ok: boolean;
|
|
61
|
-
}>;
|
|
57
|
+
function delete_TEAMID_Users_USERID(this: API, teamId: string, userId: Users.User["id"]): Promise<DeletionResult>;
|
|
62
58
|
/** Get all websites that belong to a team: https://umami.is/docs/api/teams#get-apiteamsteamidwebsites (TODO UNTESTED) */
|
|
63
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: {
|
|
@@ -1,9 +1,22 @@
|
|
|
1
|
-
import { API, GenericObject, GenericRequestParameters,
|
|
1
|
+
import { API, DeletionResult, GenericObject, GenericRequestParameters, TeamRole, Website } from "../index.js";
|
|
2
2
|
/** Operations around User management: https://umami.is/docs/api/users */
|
|
3
3
|
export declare namespace Users {
|
|
4
|
-
|
|
4
|
+
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
|
}
|
|
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
|
+
}
|
|
7
20
|
/** Creates a user: https://umami.is/docs/api/users#post-apiusers */
|
|
8
21
|
function post(this: API, parameters: {
|
|
9
22
|
/** The user's username */
|
|
@@ -14,40 +27,34 @@ export declare namespace Users {
|
|
|
14
27
|
role: Role;
|
|
15
28
|
/** Force a UUID assignment to the user */
|
|
16
29
|
id?: string;
|
|
17
|
-
}): Promise<
|
|
30
|
+
}): Promise<MinimalUserWithRole>;
|
|
18
31
|
/** Gets a user by ID: https://umami.is/docs/api/users#get-apiusersuserid */
|
|
19
|
-
function get_USERID(this: API, userId:
|
|
20
|
-
createdAt: Date;
|
|
21
|
-
}>;
|
|
32
|
+
function get_USERID(this: API, userId: User["id"]): Promise<MinimalUserWithRoleCreatedAt>;
|
|
22
33
|
/** Updates a user: https://umami.is/docs/api/users#post-apiusersuserid */
|
|
23
|
-
function post_USERID(this: API, userId:
|
|
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
|
-
createdAt: Date;
|
|
32
|
-
}>;
|
|
41
|
+
}): Promise<MinimalUserWithRoleCreatedAt>;
|
|
33
42
|
/** Deletes a user: https://umami.is/docs/api/users#delete-apiusersuserid */
|
|
34
|
-
function delete_USERID(this: API, userId:
|
|
35
|
-
ok: boolean;
|
|
36
|
-
}>;
|
|
43
|
+
function delete_USERID(this: API, userId: User["id"]): Promise<DeletionResult>;
|
|
37
44
|
/** Gets all websites that belong to a user: https://umami.is/docs/api/users#get-apiusersuseridwebsites */
|
|
38
|
-
function get_USERID_Websites(this: API, userId:
|
|
45
|
+
function get_USERID_Websites(this: API, userId: User["id"], parameters?: GenericRequestParameters & {
|
|
39
46
|
includeTeams?: boolean;
|
|
40
47
|
}): Promise<(Website & {
|
|
41
48
|
user: MinimalUser;
|
|
42
49
|
})[]>;
|
|
43
50
|
/** Gets all teams that belong to a user: https://umami.is/docs/api/users#get-apiusersuseridteams */
|
|
44
|
-
function get_USERID_Teams(this: API, userId:
|
|
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
59
|
user: MinimalUser;
|
|
53
60
|
}[];
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { API, GenericRequestParameters,
|
|
1
|
+
import { API, DeletionResult, GenericRequestParameters, Users, Website } from "../index.js";
|
|
2
2
|
/** Operations around Website management and statistics: https://umami.is/docs/api/websites */
|
|
3
3
|
export declare namespace Websites {
|
|
4
|
-
/** Returns all user websites: https://umami.is/docs/api/websites#get-apiwebsites
|
|
5
|
-
function get(this: API, parameters
|
|
6
|
-
|
|
4
|
+
/** Returns all user websites: https://umami.is/docs/api/websites#get-apiwebsites */
|
|
5
|
+
function get(this: API, parameters?: GenericRequestParameters & {
|
|
6
|
+
/** Set to true if you want to include websites where you are the team owner */
|
|
7
|
+
includeTeams?: boolean;
|
|
7
8
|
}): Promise<(Website & {
|
|
8
|
-
user: MinimalUser;
|
|
9
|
+
user: Users.MinimalUser;
|
|
9
10
|
})[]>;
|
|
10
|
-
/** Creates a website: https://umami.is/docs/api/websites#post-apiwebsites
|
|
11
|
+
/** Creates a website: https://umami.is/docs/api/websites#post-apiwebsites */
|
|
11
12
|
function post(this: API, parameters: {
|
|
12
13
|
/** The name of the website in Umami */
|
|
13
14
|
name: string;
|
|
@@ -20,23 +21,19 @@ export declare namespace Websites {
|
|
|
20
21
|
/** Force a UUID assignment to the website */
|
|
21
22
|
id?: string;
|
|
22
23
|
}): Promise<Website>;
|
|
23
|
-
/** Gets a website by ID: https://umami.is/docs/api/websites#get-apiwebsiteswebsiteid
|
|
24
|
+
/** Gets a website by ID: https://umami.is/docs/api/websites#get-apiwebsiteswebsiteid */
|
|
24
25
|
function get_WEBSITEID(this: API, websiteId: string): Promise<Website>;
|
|
25
|
-
/** Updates a website: https://umami.is/docs/api/websites#post-apiwebsiteswebsiteid
|
|
26
|
+
/** Updates a website: https://umami.is/docs/api/websites#post-apiwebsiteswebsiteid */
|
|
26
27
|
function post_WEBSITEID(this: API, websiteId: string, parameters: {
|
|
27
28
|
/** The name of the website in Umami */
|
|
28
|
-
name
|
|
29
|
+
name?: string;
|
|
29
30
|
/** The full domain of the tracked website */
|
|
30
|
-
domain
|
|
31
|
+
domain?: string;
|
|
31
32
|
/** A unique string to enable a share url. Set `null` to unshare */
|
|
32
33
|
shareId?: string | null;
|
|
33
34
|
}): Promise<Website>;
|
|
34
|
-
/** Deletes a website: https://umami.is/docs/api/websites#delete-apiwebsiteswebsiteid
|
|
35
|
-
function delete_WEBSITEID(this: API, websiteId: string): Promise<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
/** Resets a website by removing all data related to the website: https://umami.is/docs/api/websites#post-apiwebsiteswebsiteidreset (TODO UNTESTED) */
|
|
39
|
-
function post_WEBSITEID_Reset(this: API, websiteId: string): Promise<{
|
|
40
|
-
ok: boolean;
|
|
41
|
-
}>;
|
|
35
|
+
/** Deletes a website: https://umami.is/docs/api/websites#delete-apiwebsiteswebsiteid */
|
|
36
|
+
function delete_WEBSITEID(this: API, websiteId: string): Promise<DeletionResult>;
|
|
37
|
+
/** Resets a website by removing all data related to the website: https://umami.is/docs/api/websites#post-apiwebsiteswebsiteidreset */
|
|
38
|
+
function post_WEBSITEID_Reset(this: API, websiteId: string): Promise<DeletionResult>;
|
|
42
39
|
}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
/** Operations around Website management and statistics: https://umami.is/docs/api/websites */
|
|
2
2
|
export var Websites;
|
|
3
3
|
(function (Websites) {
|
|
4
|
-
/** Returns all user websites: https://umami.is/docs/api/websites#get-apiwebsites
|
|
4
|
+
/** Returns all user websites: https://umami.is/docs/api/websites#get-apiwebsites */
|
|
5
5
|
async function get(parameters) {
|
|
6
6
|
const response = await this.request("get", ["websites"], parameters);
|
|
7
7
|
return response.data;
|
|
8
8
|
}
|
|
9
9
|
Websites.get = get;
|
|
10
|
-
/** Creates a website: https://umami.is/docs/api/websites#post-apiwebsites
|
|
10
|
+
/** Creates a website: https://umami.is/docs/api/websites#post-apiwebsites */
|
|
11
11
|
async function post(parameters) {
|
|
12
12
|
return await this.request("post", ["websites"], parameters);
|
|
13
13
|
}
|
|
14
14
|
Websites.post = post;
|
|
15
|
-
/** Gets a website by ID: https://umami.is/docs/api/websites#get-apiwebsiteswebsiteid
|
|
15
|
+
/** Gets a website by ID: https://umami.is/docs/api/websites#get-apiwebsiteswebsiteid */
|
|
16
16
|
async function get_WEBSITEID(websiteId) {
|
|
17
17
|
return await this.request("get", ["websites", websiteId]);
|
|
18
18
|
}
|
|
19
19
|
Websites.get_WEBSITEID = get_WEBSITEID;
|
|
20
|
-
/** Updates a website: https://umami.is/docs/api/websites#post-apiwebsiteswebsiteid
|
|
20
|
+
/** Updates a website: https://umami.is/docs/api/websites#post-apiwebsiteswebsiteid */
|
|
21
21
|
async function post_WEBSITEID(websiteId, parameters) {
|
|
22
22
|
return await this.request("post", ["websites", websiteId], parameters);
|
|
23
23
|
}
|
|
24
24
|
Websites.post_WEBSITEID = post_WEBSITEID;
|
|
25
|
-
/** Deletes a website: https://umami.is/docs/api/websites#delete-apiwebsiteswebsiteid
|
|
25
|
+
/** Deletes a website: https://umami.is/docs/api/websites#delete-apiwebsiteswebsiteid */
|
|
26
26
|
async function delete_WEBSITEID(websiteId) {
|
|
27
27
|
return await this.request("delete", ["websites", websiteId]);
|
|
28
28
|
}
|
|
29
29
|
Websites.delete_WEBSITEID = delete_WEBSITEID;
|
|
30
|
-
/** Resets a website by removing all data related to the website: https://umami.is/docs/api/websites#post-apiwebsiteswebsiteidreset
|
|
30
|
+
/** Resets a website by removing all data related to the website: https://umami.is/docs/api/websites#post-apiwebsiteswebsiteidreset */
|
|
31
31
|
async function post_WEBSITEID_Reset(websiteId) {
|
|
32
32
|
return await this.request("post", ["websites", websiteId, "reset"]);
|
|
33
33
|
}
|