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.
- package/README.md +3 -2
- package/dist/index.d.ts +183 -70
- package/dist/index.js +162 -68
- package/dist/namespaces/Admin.d.ts +5 -14
- 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 +28 -0
- package/dist/namespaces/Links.js +25 -0
- package/dist/namespaces/Me.d.ts +44 -0
- package/dist/namespaces/Me.js +21 -0
- package/dist/namespaces/Pixels.d.ts +25 -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 +27 -27
- 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 +25 -25
- package/dist/namespaces/Teams.js +37 -37
- package/dist/namespaces/Users.d.ts +15 -18
- 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 +13 -13
- package/dist/namespaces/Websites.js +19 -19
- package/package.json +7 -5
package/README.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
A package to interact with [the API of self-hosted instances of Umami
|
|
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
|
-
|
|
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.0**, 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
|
+
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
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Admin } from "./namespaces/Admin.js";
|
|
2
2
|
import { Events } from "./namespaces/Events.js";
|
|
3
|
+
import { Links } from "./namespaces/Links.js";
|
|
4
|
+
import { Me } from "./namespaces/Me.js";
|
|
5
|
+
import { Pixels } from "./namespaces/Pixels.js";
|
|
3
6
|
import { Realtime } from "./namespaces/Realtime.js";
|
|
4
7
|
import { Reports } from "./namespaces/Reports.js";
|
|
5
8
|
import { Sessions } from "./namespaces/Sessions.js";
|
|
@@ -7,7 +10,7 @@ import { Teams } from "./namespaces/Teams.js";
|
|
|
7
10
|
import { Users } from "./namespaces/Users.js";
|
|
8
11
|
import { Websites } from "./namespaces/Websites.js";
|
|
9
12
|
import { WebsiteStats } from "./namespaces/WebsiteStats.js";
|
|
10
|
-
export { Admin,
|
|
13
|
+
export { Admin, Events, Links, Me, Pixels, Websites, WebsiteStats, Realtime, Reports, Sessions, Teams, Users };
|
|
11
14
|
export interface ValueAndPrev {
|
|
12
15
|
/** The actual value for the given time period */
|
|
13
16
|
value: number;
|
|
@@ -169,14 +172,14 @@ export declare class API {
|
|
|
169
172
|
get user(): {
|
|
170
173
|
id: string;
|
|
171
174
|
username: string;
|
|
172
|
-
role:
|
|
175
|
+
role: Role;
|
|
173
176
|
createdAt: Date;
|
|
174
177
|
isAdmin: boolean;
|
|
175
178
|
};
|
|
176
179
|
set user(user: {
|
|
177
180
|
id: string;
|
|
178
181
|
username: string;
|
|
179
|
-
role:
|
|
182
|
+
role: Role;
|
|
180
183
|
createdAt: Date;
|
|
181
184
|
isAdmin: boolean;
|
|
182
185
|
});
|
|
@@ -271,75 +274,185 @@ export declare class API {
|
|
|
271
274
|
request(method: "get" | "post" | "put" | "delete", endpoint: Array<string | number>, parameters?: {
|
|
272
275
|
[k: string]: any;
|
|
273
276
|
}): Promise<any>;
|
|
274
|
-
/**
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
277
|
+
/**
|
|
278
|
+
* To register an event
|
|
279
|
+
* (TODO UNTESTED)
|
|
280
|
+
* @group Sending stats
|
|
281
|
+
*/
|
|
282
|
+
sendStats(payload: {
|
|
283
|
+
/** Name of host */
|
|
284
|
+
hostname: string;
|
|
285
|
+
/** Screen resolution (ex. "1920x1080") */
|
|
286
|
+
screen: string;
|
|
287
|
+
/** Language of visitor (ex. "en-US") */
|
|
288
|
+
language: string;
|
|
289
|
+
/** Page URL */
|
|
290
|
+
url: string;
|
|
291
|
+
/** Referrer URL */
|
|
292
|
+
referrer: string;
|
|
293
|
+
/** Page title */
|
|
294
|
+
title: string;
|
|
295
|
+
/** Additional tag description */
|
|
296
|
+
tag: string;
|
|
297
|
+
/** Session identifier */
|
|
298
|
+
id: string;
|
|
299
|
+
/** Website ID */
|
|
300
|
+
website: string;
|
|
301
|
+
/** Name of the event */
|
|
302
|
+
name: string;
|
|
303
|
+
/** Additional data for the event */
|
|
304
|
+
data?: {
|
|
305
|
+
[k: string]: any;
|
|
306
|
+
};
|
|
307
|
+
}): Promise<{
|
|
308
|
+
cache: string;
|
|
309
|
+
sessionid: string;
|
|
310
|
+
visitId: string;
|
|
281
311
|
}>;
|
|
312
|
+
/** @group Admin endpoints */
|
|
282
313
|
readonly getUsersAsAdmin: typeof Admin.getUsers;
|
|
314
|
+
/** @group Admin endpoints */
|
|
283
315
|
readonly getWebsitesAsAdmin: typeof Admin.getWebsites;
|
|
316
|
+
/** @group Admin endpoints */
|
|
284
317
|
readonly getTeamsAsAdmin: typeof Admin.getTeams;
|
|
285
|
-
|
|
286
|
-
readonly
|
|
287
|
-
|
|
288
|
-
readonly
|
|
289
|
-
|
|
290
|
-
readonly
|
|
291
|
-
|
|
292
|
-
readonly
|
|
293
|
-
|
|
294
|
-
readonly
|
|
295
|
-
|
|
296
|
-
readonly
|
|
297
|
-
|
|
298
|
-
readonly
|
|
299
|
-
|
|
300
|
-
readonly
|
|
301
|
-
|
|
302
|
-
readonly
|
|
303
|
-
|
|
304
|
-
readonly
|
|
305
|
-
|
|
306
|
-
readonly
|
|
307
|
-
|
|
308
|
-
readonly
|
|
309
|
-
|
|
310
|
-
readonly
|
|
311
|
-
|
|
312
|
-
readonly
|
|
313
|
-
|
|
314
|
-
readonly
|
|
315
|
-
|
|
316
|
-
readonly
|
|
317
|
-
|
|
318
|
-
readonly
|
|
319
|
-
|
|
320
|
-
readonly
|
|
321
|
-
|
|
322
|
-
readonly
|
|
323
|
-
|
|
324
|
-
readonly
|
|
325
|
-
|
|
326
|
-
readonly
|
|
327
|
-
|
|
328
|
-
readonly
|
|
329
|
-
/** @
|
|
330
|
-
readonly
|
|
331
|
-
|
|
332
|
-
readonly
|
|
333
|
-
|
|
334
|
-
readonly
|
|
335
|
-
|
|
336
|
-
readonly
|
|
337
|
-
|
|
338
|
-
readonly
|
|
339
|
-
|
|
340
|
-
readonly
|
|
341
|
-
|
|
342
|
-
readonly
|
|
343
|
-
|
|
344
|
-
readonly
|
|
318
|
+
/** @group Events endpoints */
|
|
319
|
+
readonly getWebsiteEvents: typeof Events.get_WEBSITEID_Events;
|
|
320
|
+
/** @group Events endpoints */
|
|
321
|
+
readonly getWebsiteEventData: typeof Events.get_WEBSITEID_Eventdata_EVENTID;
|
|
322
|
+
/** @group Events endpoints */
|
|
323
|
+
readonly getWebsiteEventsData: typeof Events.get_WEBSITEID_EventdataEvents;
|
|
324
|
+
/** @group Events endpoints */
|
|
325
|
+
readonly getWebsiteEventsDataFields: typeof Events.get_WEBSITEID_EventdataFields;
|
|
326
|
+
/** @group Events endpoints */
|
|
327
|
+
readonly getWebsiteEventsDataProperties: typeof Events.get_WEBSITEID_EventdataProperties;
|
|
328
|
+
/** @group Events endpoints */
|
|
329
|
+
readonly getWebsiteEventsDataValues: typeof Events.get_WEBSITEID_EventdataValues;
|
|
330
|
+
/** @group Events endpoints */
|
|
331
|
+
readonly getWebsiteEventsDataStats: typeof Events.get_WEBSITEID_EventdataStats;
|
|
332
|
+
/** @group Links endpoints */
|
|
333
|
+
readonly getLinks: typeof Links.get;
|
|
334
|
+
/** @group Links endpoints */
|
|
335
|
+
readonly getLink: typeof Links.get_LINKID;
|
|
336
|
+
/** @group Links endpoints */
|
|
337
|
+
readonly updateLink: typeof Links.post_LINKID;
|
|
338
|
+
/** @group Links endpoints */
|
|
339
|
+
readonly deleteLink: typeof Links.delete_LINKID;
|
|
340
|
+
/** @group Me endpoints */
|
|
341
|
+
readonly getMyself: typeof Me.get;
|
|
342
|
+
/** @group Me endpoints */
|
|
343
|
+
readonly getMyTeams: typeof Me.getTeams;
|
|
344
|
+
/** @group Me endpoints */
|
|
345
|
+
readonly getMyWebsites: typeof Me.getWebsites;
|
|
346
|
+
/** @group Links endpoints */
|
|
347
|
+
readonly getPixels: typeof Pixels.get;
|
|
348
|
+
/** @group Links endpoints */
|
|
349
|
+
readonly getPixel: typeof Pixels.get_PIXELID;
|
|
350
|
+
/** @group Links endpoints */
|
|
351
|
+
readonly updatePixel: typeof Pixels.post_PIXELID;
|
|
352
|
+
/** @group Links endpoints */
|
|
353
|
+
readonly deletePixel: typeof Pixels.delete_PIXELID;
|
|
354
|
+
/** @group Websites endpoints */
|
|
355
|
+
readonly getWebsites: typeof Websites.get;
|
|
356
|
+
/** @group Websites endpoints */
|
|
357
|
+
readonly createWebsite: typeof Websites.post;
|
|
358
|
+
/** @group Websites endpoints */
|
|
359
|
+
readonly getWebsite: typeof Websites.get_WEBSITEID;
|
|
360
|
+
/** @group Websites endpoints */
|
|
361
|
+
readonly updateWebsite: typeof Websites.post_WEBSITEID;
|
|
362
|
+
/** @group Websites endpoints */
|
|
363
|
+
readonly deleteWebsite: typeof Websites.delete_WEBSITEID;
|
|
364
|
+
/** @group Websites endpoints */
|
|
365
|
+
readonly resetWebsite: typeof Websites.post_WEBSITEID_Reset;
|
|
366
|
+
/** @group Website stats endpoints */
|
|
367
|
+
readonly getWebsiteActiveVisitors: typeof WebsiteStats.get_WEBSITEID_Active;
|
|
368
|
+
/** @group Website stats endpoints */
|
|
369
|
+
readonly getWebsiteEventsStats: typeof WebsiteStats.get_WEBSITEID_EventsSeries;
|
|
370
|
+
/** @group Website stats endpoints */
|
|
371
|
+
readonly getWebsiteMetrics: typeof WebsiteStats.get_WEBSITEID_Metrics;
|
|
372
|
+
/** @group Website stats endpoints */
|
|
373
|
+
readonly getWebsiteMetricsExpanded: typeof WebsiteStats.get_WEBSITEID_MetricsExpanded;
|
|
374
|
+
/** @group Website stats endpoints */
|
|
375
|
+
readonly getWebsitePageviews: typeof WebsiteStats.get_WEBSITEID_Pageviews;
|
|
376
|
+
/** @group Website stats endpoints */
|
|
377
|
+
readonly getWebsiteStats: typeof WebsiteStats.get_WEBSITEID_Stats;
|
|
378
|
+
/** @group Realtime endpoints */
|
|
379
|
+
readonly getRealtime: typeof Realtime.get_WEBSITEID;
|
|
380
|
+
/** @group Reports endpoints */
|
|
381
|
+
readonly getReports: typeof Reports.get;
|
|
382
|
+
/** @group Reports endpoints */
|
|
383
|
+
readonly createReport: typeof Reports.post;
|
|
384
|
+
/** @group Reports endpoints */
|
|
385
|
+
readonly getReport: typeof Reports.get_REPORTID;
|
|
386
|
+
/** @group Reports endpoints */
|
|
387
|
+
readonly updateReport: typeof Reports.post_REPORTID;
|
|
388
|
+
/** @group Reports endpoints */
|
|
389
|
+
readonly deleteReport: typeof Reports.delete_REPORTID;
|
|
390
|
+
/** @group Reports endpoints */
|
|
391
|
+
readonly getReportsAttribution: typeof Reports.postAttribution;
|
|
392
|
+
/** @group Reports endpoints */
|
|
393
|
+
readonly getReportsBreakdown: typeof Reports.postBreakdown;
|
|
394
|
+
/** @group Reports endpoints */
|
|
395
|
+
readonly getReportsFunnel: typeof Reports.postFunnel;
|
|
396
|
+
/** @group Reports endpoints */
|
|
397
|
+
readonly getReportsGoals: typeof Reports.postGoals;
|
|
398
|
+
/** @group Reports endpoints */
|
|
399
|
+
readonly getReportsJourney: typeof Reports.postJourney;
|
|
400
|
+
/** @group Reports endpoints */
|
|
401
|
+
readonly getReportsRetention: typeof Reports.postRetention;
|
|
402
|
+
/** @group Reports endpoints */
|
|
403
|
+
readonly getReportsRevenue: typeof Reports.postRevenue;
|
|
404
|
+
/** @group Reports endpoints */
|
|
405
|
+
readonly getReportsUTM: typeof Reports.postUTM;
|
|
406
|
+
/** @group Sessions endpoints */
|
|
407
|
+
readonly getWebsiteSessions: typeof Sessions.get_WEBSITEID_Sessions;
|
|
408
|
+
/** @group Sessions endpoints */
|
|
409
|
+
readonly getWebsiteSessionsStats: typeof Sessions.get_WEBSITEID_SessionsStats;
|
|
410
|
+
/** @group Sessions endpoints */
|
|
411
|
+
readonly getWebsiteSessionsWeekly: typeof Sessions.get_WEBSITEID_SessionsWeekly;
|
|
412
|
+
/** @group Sessions endpoints */
|
|
413
|
+
readonly getWebsiteSession: typeof Sessions.get_WEBSITEID_Sessions_SESSIONID;
|
|
414
|
+
/** @group Sessions endpoints */
|
|
415
|
+
readonly getWebsiteSessionActivity: typeof Sessions.get_WEBSITEID_Sessions_SESSIONID_Activity;
|
|
416
|
+
/** @group Sessions endpoints */
|
|
417
|
+
readonly getWebsiteSessionProperties: typeof Sessions.get_WEBSITEID_Sessions_SESSIONID_Properties;
|
|
418
|
+
/** @group Sessions endpoints */
|
|
419
|
+
readonly getWebsiteSessionDataProperties: typeof Sessions.get_WEBSITEID_SessiondataProperties;
|
|
420
|
+
/** @group Sessions endpoints */
|
|
421
|
+
readonly getWebsiteSessionDataValues: typeof Sessions.get_WEBSITEID_SessiondataValues;
|
|
422
|
+
/** @group Teams endpoints */
|
|
423
|
+
readonly getTeams: typeof Teams.get;
|
|
424
|
+
/** @group Teams endpoints */
|
|
425
|
+
readonly createTeam: typeof Teams.post;
|
|
426
|
+
/** @group Teams endpoints */
|
|
427
|
+
readonly joinTeam: typeof Teams.postJoin;
|
|
428
|
+
/** @group Teams endpoints */
|
|
429
|
+
readonly getTeam: typeof Teams.get_TEAMID;
|
|
430
|
+
/** @group Teams endpoints */
|
|
431
|
+
readonly updateTeam: typeof Teams.post_TEAMID;
|
|
432
|
+
/** @group Teams endpoints */
|
|
433
|
+
readonly deleteTeam: typeof Teams.delete_TEAMID;
|
|
434
|
+
/** @group Teams endpoints */
|
|
435
|
+
readonly getTeamUsers: typeof Teams.get_TEAMID_Users;
|
|
436
|
+
/** @group Teams endpoints */
|
|
437
|
+
readonly addTeamUser: typeof Teams.post_TEAMID_Users;
|
|
438
|
+
/** @group Teams endpoints */
|
|
439
|
+
readonly getTeamUser: typeof Teams.get_TEAMID_Users_USERID;
|
|
440
|
+
/** @group Teams endpoints */
|
|
441
|
+
readonly updateTeamUser: typeof Teams.post_TEAMID_Users_USERID;
|
|
442
|
+
/** @group Teams endpoints */
|
|
443
|
+
readonly removeTeamUser: typeof Teams.delete_TEAMID_Users_USERID;
|
|
444
|
+
/** @group Teams endpoints */
|
|
445
|
+
readonly getTeamWebsites: typeof Teams.get_TEAMID_Websites;
|
|
446
|
+
/** @group Users endpoints */
|
|
447
|
+
readonly createUser: typeof Users.post;
|
|
448
|
+
/** @group Users endpoints */
|
|
449
|
+
readonly getUser: typeof Users.get_USERID;
|
|
450
|
+
/** @group Users endpoints */
|
|
451
|
+
readonly updateUser: typeof Users.post_USERID;
|
|
452
|
+
/** @group Users endpoints */
|
|
453
|
+
readonly deleteUser: typeof Users.delete_USERID;
|
|
454
|
+
/** @group Users endpoints */
|
|
455
|
+
readonly getUserTeams: typeof Users.get_USERID_Teams;
|
|
456
|
+
/** @group Users endpoints */
|
|
457
|
+
readonly getUserWebsites: typeof Users.get_USERID_Websites;
|
|
345
458
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Admin } from "./namespaces/Admin.js";
|
|
2
2
|
import { Events } from "./namespaces/Events.js";
|
|
3
|
+
import { Links } from "./namespaces/Links.js";
|
|
4
|
+
import { Me } from "./namespaces/Me.js";
|
|
5
|
+
import { Pixels } from "./namespaces/Pixels.js";
|
|
3
6
|
import { Realtime } from "./namespaces/Realtime.js";
|
|
4
7
|
import { Reports } from "./namespaces/Reports.js";
|
|
5
8
|
import { Sessions } from "./namespaces/Sessions.js";
|
|
@@ -8,7 +11,7 @@ import { Users } from "./namespaces/Users.js";
|
|
|
8
11
|
import { Websites } from "./namespaces/Websites.js";
|
|
9
12
|
import { WebsiteStats } from "./namespaces/WebsiteStats.js";
|
|
10
13
|
import { adaptParametersForGETRequests, correctType } from "./utilities.js";
|
|
11
|
-
export { Admin,
|
|
14
|
+
export { Admin, Events, Links, Me, Pixels, Websites, WebsiteStats, Realtime, Reports, Sessions, Teams, Users };
|
|
12
15
|
/** If the {@link API} throws an error, it should always be an {@link APIError}! */
|
|
13
16
|
export class APIError extends Error {
|
|
14
17
|
message;
|
|
@@ -134,8 +137,8 @@ export class API {
|
|
|
134
137
|
this.log(true, "Unable to obtain a token! Here's what was received from the API:", json);
|
|
135
138
|
reject(new APIError(error_message, this.server, "post", ["auth", "login"], body, response.status));
|
|
136
139
|
}
|
|
137
|
-
this.token_type = json.token_type;
|
|
138
140
|
this.token = json.token;
|
|
141
|
+
this.user = json.user;
|
|
139
142
|
const expiration_date = new Date();
|
|
140
143
|
expiration_date.setDate(expiration_date.getDate() + 1); // Assume 24 hours
|
|
141
144
|
this.expires = expiration_date;
|
|
@@ -378,80 +381,171 @@ export class API {
|
|
|
378
381
|
throw new APIError(`${e?.name} (${e?.message ?? e?.errno ?? e?.type})`, this.server, method, endpoint, parameters, undefined, e);
|
|
379
382
|
}
|
|
380
383
|
}
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
+
// UNCATEGORIZED
|
|
385
|
+
/**
|
|
386
|
+
* To register an event
|
|
387
|
+
* (TODO UNTESTED)
|
|
388
|
+
* @group Sending stats
|
|
389
|
+
*/
|
|
390
|
+
async sendStats(payload) {
|
|
391
|
+
return await this.request("post", ["send"], { payload, type: "event" });
|
|
384
392
|
}
|
|
385
393
|
// ADMIN
|
|
394
|
+
/** @group Admin endpoints */
|
|
386
395
|
getUsersAsAdmin = Admin.getUsers;
|
|
396
|
+
/** @group Admin endpoints */
|
|
387
397
|
getWebsitesAsAdmin = Admin.getWebsites;
|
|
398
|
+
/** @group Admin endpoints */
|
|
388
399
|
getTeamsAsAdmin = Admin.getTeams;
|
|
389
|
-
// USERS
|
|
390
|
-
createUser = Users.createUser;
|
|
391
|
-
getUser = Users.getUser;
|
|
392
|
-
updateUser = Users.updateUser;
|
|
393
|
-
deleteUser = Users.deleteUser;
|
|
394
|
-
getUserTeams = Users.getUserTeams;
|
|
395
|
-
getUserWebsites = Users.getUserWebsites;
|
|
396
|
-
// TEAMS
|
|
397
|
-
getTeams = Teams.getTeams;
|
|
398
|
-
createTeam = Teams.createTeam;
|
|
399
|
-
joinTeam = Teams.joinTeam;
|
|
400
|
-
getTeam = Teams.getTeam;
|
|
401
|
-
updateTeam = Teams.updateTeam;
|
|
402
|
-
deleteTeam = Teams.deleteTeam;
|
|
403
|
-
getTeamUsers = Teams.getTeamUsers;
|
|
404
|
-
addTeamUser = Teams.addTeamUser;
|
|
405
|
-
getTeamUser = Teams.getTeamUser;
|
|
406
|
-
updateTeamUser = Teams.updateTeamUser;
|
|
407
|
-
removeTeamUser = Teams.removeTeamUser;
|
|
408
|
-
getTeamWebsites = Teams.getTeamWebsites;
|
|
409
400
|
// EVENTS
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
401
|
+
/** @group Events endpoints */
|
|
402
|
+
getWebsiteEvents = Events.get_WEBSITEID_Events;
|
|
403
|
+
/** @group Events endpoints */
|
|
404
|
+
getWebsiteEventData = Events.get_WEBSITEID_Eventdata_EVENTID;
|
|
405
|
+
/** @group Events endpoints */
|
|
406
|
+
getWebsiteEventsData = Events.get_WEBSITEID_EventdataEvents;
|
|
407
|
+
/** @group Events endpoints */
|
|
408
|
+
getWebsiteEventsDataFields = Events.get_WEBSITEID_EventdataFields;
|
|
409
|
+
/** @group Events endpoints */
|
|
410
|
+
getWebsiteEventsDataProperties = Events.get_WEBSITEID_EventdataProperties;
|
|
411
|
+
/** @group Events endpoints */
|
|
412
|
+
getWebsiteEventsDataValues = Events.get_WEBSITEID_EventdataValues;
|
|
413
|
+
/** @group Events endpoints */
|
|
414
|
+
getWebsiteEventsDataStats = Events.get_WEBSITEID_EventdataStats;
|
|
415
|
+
// LINKS
|
|
416
|
+
/** @group Links endpoints */
|
|
417
|
+
getLinks = Links.get;
|
|
418
|
+
/** @group Links endpoints */
|
|
419
|
+
getLink = Links.get_LINKID;
|
|
420
|
+
/** @group Links endpoints */
|
|
421
|
+
updateLink = Links.post_LINKID;
|
|
422
|
+
/** @group Links endpoints */
|
|
423
|
+
deleteLink = Links.delete_LINKID;
|
|
424
|
+
// ME
|
|
425
|
+
/** @group Me endpoints */
|
|
426
|
+
getMyself = Me.get;
|
|
427
|
+
/** @group Me endpoints */
|
|
428
|
+
getMyTeams = Me.getTeams;
|
|
429
|
+
/** @group Me endpoints */
|
|
430
|
+
getMyWebsites = Me.getWebsites;
|
|
431
|
+
// PIXELS
|
|
432
|
+
/** @group Links endpoints */
|
|
433
|
+
getPixels = Pixels.get;
|
|
434
|
+
/** @group Links endpoints */
|
|
435
|
+
getPixel = Pixels.get_PIXELID;
|
|
436
|
+
/** @group Links endpoints */
|
|
437
|
+
updatePixel = Pixels.post_PIXELID;
|
|
438
|
+
/** @group Links endpoints */
|
|
439
|
+
deletePixel = Pixels.delete_PIXELID;
|
|
426
440
|
// WEBSITES
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
441
|
+
/** @group Websites endpoints */
|
|
442
|
+
getWebsites = Websites.get;
|
|
443
|
+
/** @group Websites endpoints */
|
|
444
|
+
createWebsite = Websites.post;
|
|
445
|
+
/** @group Websites endpoints */
|
|
446
|
+
getWebsite = Websites.get_WEBSITEID;
|
|
447
|
+
/** @group Websites endpoints */
|
|
448
|
+
updateWebsite = Websites.post_WEBSITEID;
|
|
449
|
+
/** @group Websites endpoints */
|
|
450
|
+
deleteWebsite = Websites.delete_WEBSITEID;
|
|
451
|
+
/** @group Websites endpoints */
|
|
452
|
+
resetWebsite = Websites.post_WEBSITEID_Reset;
|
|
433
453
|
// WEBSITE STATS
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
454
|
+
/** @group Website stats endpoints */
|
|
455
|
+
getWebsiteActiveVisitors = WebsiteStats.get_WEBSITEID_Active;
|
|
456
|
+
/** @group Website stats endpoints */
|
|
457
|
+
getWebsiteEventsStats = WebsiteStats.get_WEBSITEID_EventsSeries;
|
|
458
|
+
/** @group Website stats endpoints */
|
|
459
|
+
getWebsiteMetrics = WebsiteStats.get_WEBSITEID_Metrics;
|
|
460
|
+
/** @group Website stats endpoints */
|
|
461
|
+
getWebsiteMetricsExpanded = WebsiteStats.get_WEBSITEID_MetricsExpanded;
|
|
462
|
+
/** @group Website stats endpoints */
|
|
463
|
+
getWebsitePageviews = WebsiteStats.get_WEBSITEID_Pageviews;
|
|
464
|
+
/** @group Website stats endpoints */
|
|
465
|
+
getWebsiteStats = WebsiteStats.get_WEBSITEID_Stats;
|
|
441
466
|
// REALTIME
|
|
442
|
-
|
|
467
|
+
/** @group Realtime endpoints */
|
|
468
|
+
getRealtime = Realtime.get_WEBSITEID;
|
|
443
469
|
// REPORTS
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
470
|
+
/** @group Reports endpoints */
|
|
471
|
+
getReports = Reports.get;
|
|
472
|
+
/** @group Reports endpoints */
|
|
473
|
+
createReport = Reports.post;
|
|
474
|
+
/** @group Reports endpoints */
|
|
475
|
+
getReport = Reports.get_REPORTID;
|
|
476
|
+
/** @group Reports endpoints */
|
|
477
|
+
updateReport = Reports.post_REPORTID;
|
|
478
|
+
/** @group Reports endpoints */
|
|
479
|
+
deleteReport = Reports.delete_REPORTID;
|
|
480
|
+
/** @group Reports endpoints */
|
|
481
|
+
getReportsAttribution = Reports.postAttribution;
|
|
482
|
+
/** @group Reports endpoints */
|
|
483
|
+
getReportsBreakdown = Reports.postBreakdown;
|
|
484
|
+
/** @group Reports endpoints */
|
|
485
|
+
getReportsFunnel = Reports.postFunnel;
|
|
486
|
+
/** @group Reports endpoints */
|
|
487
|
+
getReportsGoals = Reports.postGoals;
|
|
488
|
+
/** @group Reports endpoints */
|
|
489
|
+
getReportsJourney = Reports.postJourney;
|
|
490
|
+
/** @group Reports endpoints */
|
|
491
|
+
getReportsRetention = Reports.postRetention;
|
|
492
|
+
/** @group Reports endpoints */
|
|
493
|
+
getReportsRevenue = Reports.postRevenue;
|
|
494
|
+
/** @group Reports endpoints */
|
|
495
|
+
getReportsUTM = Reports.postUTM;
|
|
496
|
+
// SESSIONS
|
|
497
|
+
/** @group Sessions endpoints */
|
|
498
|
+
getWebsiteSessions = Sessions.get_WEBSITEID_Sessions;
|
|
499
|
+
/** @group Sessions endpoints */
|
|
500
|
+
getWebsiteSessionsStats = Sessions.get_WEBSITEID_SessionsStats;
|
|
501
|
+
/** @group Sessions endpoints */
|
|
502
|
+
getWebsiteSessionsWeekly = Sessions.get_WEBSITEID_SessionsWeekly;
|
|
503
|
+
/** @group Sessions endpoints */
|
|
504
|
+
getWebsiteSession = Sessions.get_WEBSITEID_Sessions_SESSIONID;
|
|
505
|
+
/** @group Sessions endpoints */
|
|
506
|
+
getWebsiteSessionActivity = Sessions.get_WEBSITEID_Sessions_SESSIONID_Activity;
|
|
507
|
+
/** @group Sessions endpoints */
|
|
508
|
+
getWebsiteSessionProperties = Sessions.get_WEBSITEID_Sessions_SESSIONID_Properties;
|
|
509
|
+
/** @group Sessions endpoints */
|
|
510
|
+
getWebsiteSessionDataProperties = Sessions.get_WEBSITEID_SessiondataProperties;
|
|
511
|
+
/** @group Sessions endpoints */
|
|
512
|
+
getWebsiteSessionDataValues = Sessions.get_WEBSITEID_SessiondataValues;
|
|
513
|
+
// TEAMS
|
|
514
|
+
/** @group Teams endpoints */
|
|
515
|
+
getTeams = Teams.get;
|
|
516
|
+
/** @group Teams endpoints */
|
|
517
|
+
createTeam = Teams.post;
|
|
518
|
+
/** @group Teams endpoints */
|
|
519
|
+
joinTeam = Teams.postJoin;
|
|
520
|
+
/** @group Teams endpoints */
|
|
521
|
+
getTeam = Teams.get_TEAMID;
|
|
522
|
+
/** @group Teams endpoints */
|
|
523
|
+
updateTeam = Teams.post_TEAMID;
|
|
524
|
+
/** @group Teams endpoints */
|
|
525
|
+
deleteTeam = Teams.delete_TEAMID;
|
|
526
|
+
/** @group Teams endpoints */
|
|
527
|
+
getTeamUsers = Teams.get_TEAMID_Users;
|
|
528
|
+
/** @group Teams endpoints */
|
|
529
|
+
addTeamUser = Teams.post_TEAMID_Users;
|
|
530
|
+
/** @group Teams endpoints */
|
|
531
|
+
getTeamUser = Teams.get_TEAMID_Users_USERID;
|
|
532
|
+
/** @group Teams endpoints */
|
|
533
|
+
updateTeamUser = Teams.post_TEAMID_Users_USERID;
|
|
534
|
+
/** @group Teams endpoints */
|
|
535
|
+
removeTeamUser = Teams.delete_TEAMID_Users_USERID;
|
|
536
|
+
/** @group Teams endpoints */
|
|
537
|
+
getTeamWebsites = Teams.get_TEAMID_Websites;
|
|
538
|
+
// USERS
|
|
539
|
+
/** @group Users endpoints */
|
|
540
|
+
createUser = Users.post;
|
|
541
|
+
/** @group Users endpoints */
|
|
542
|
+
getUser = Users.get_USERID;
|
|
543
|
+
/** @group Users endpoints */
|
|
544
|
+
updateUser = Users.post_USERID;
|
|
545
|
+
/** @group Users endpoints */
|
|
546
|
+
deleteUser = Users.delete_USERID;
|
|
547
|
+
/** @group Users endpoints */
|
|
548
|
+
getUserTeams = Users.get_USERID_Teams;
|
|
549
|
+
/** @group Users endpoints */
|
|
550
|
+
getUserWebsites = Users.get_USERID_Websites;
|
|
457
551
|
}
|
|
@@ -1,32 +1,23 @@
|
|
|
1
1
|
import { API, GenericObject, GenericRequestParameters, MinimalUser, Role, Teams, Website } from "../index.js";
|
|
2
|
-
/**
|
|
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
|
-
/** @remarks **UNDOCUMENTED** & seems encrypted (thankfully, lol) */
|
|
8
|
-
password: string;
|
|
9
7
|
role: 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
16
|
user: 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;
|