umami-api-js 0.0.3 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,14 @@
1
- import { API, GenericRequestParameters } from "../index.js";
2
- /** For endpoints listed on: https://umami.is/docs/api/websites-api */
1
+ import { API, GenericRequestParameters, MinimalUser, Website } from "../index.js";
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-api#get-apiwebsites (TODO UNTESTED) */
5
- function getWebsites(this: API, parameters: GenericRequestParameters & {
4
+ /** Returns all user websites: https://umami.is/docs/api/websites#get-apiwebsites (TODO UNTESTED) */
5
+ function get(this: API, parameters: GenericRequestParameters & {
6
6
  includeTeams: boolean;
7
- }): Promise<any[]>;
8
- /** Creates a website: https://umami.is/docs/api/websites-api#post-apiwebsites (TODO UNTESTED) */
9
- function createWebsite(this: API, parameters: {
7
+ }): Promise<(Website & {
8
+ user: MinimalUser;
9
+ })[]>;
10
+ /** Creates a website: https://umami.is/docs/api/websites#post-apiwebsites (TODO UNTESTED) */
11
+ function post(this: API, parameters: {
10
12
  /** The name of the website in Umami */
11
13
  name: string;
12
14
  /** The full domain of the tracked website */
@@ -17,24 +19,24 @@ export declare namespace Websites {
17
19
  teamId?: string;
18
20
  /** Force a UUID assignment to the website */
19
21
  id?: string;
20
- }): Promise<any>;
21
- /** Gets a website by ID: https://umami.is/docs/api/websites-api#get-apiwebsiteswebsiteid (TODO UNTESTED) */
22
- function getWebsite(this: API, websiteId: string): Promise<any>;
23
- /** Updates a website: https://umami.is/docs/api/websites-api#post-apiwebsiteswebsiteid (TODO UNTESTED) */
24
- function updateWebsite(this: API, websiteId: string, parameters: {
22
+ }): Promise<Website>;
23
+ /** Gets a website by ID: https://umami.is/docs/api/websites#get-apiwebsiteswebsiteid (TODO UNTESTED) */
24
+ function get_WEBSITEID(this: API, websiteId: string): Promise<Website>;
25
+ /** Updates a website: https://umami.is/docs/api/websites#post-apiwebsiteswebsiteid (TODO UNTESTED) */
26
+ function post_WEBSITEID(this: API, websiteId: string, parameters: {
25
27
  /** The name of the website in Umami */
26
28
  name: string;
27
29
  /** The full domain of the tracked website */
28
30
  domain: string;
29
31
  /** A unique string to enable a share url. Set `null` to unshare */
30
32
  shareId?: string | null;
31
- }): Promise<any>;
32
- /** Deletes a website: https://umami.is/docs/api/websites-api#delete-apiwebsiteswebsiteid (TODO UNTESTED) */
33
- function deleteWebsite(this: API, websiteId: string): Promise<{
33
+ }): Promise<Website>;
34
+ /** Deletes a website: https://umami.is/docs/api/websites#delete-apiwebsiteswebsiteid (TODO UNTESTED) */
35
+ function delete_WEBSITEID(this: API, websiteId: string): Promise<{
34
36
  ok: boolean;
35
37
  }>;
36
- /** Resets a website by removing all data related to the website: https://umami.is/docs/api/websites-api#post-apiwebsiteswebsiteidreset (TODO UNTESTED) */
37
- function resetWebsite(this: API, websiteId: string): Promise<{
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<{
38
40
  ok: boolean;
39
41
  }>;
40
42
  }
@@ -1,35 +1,35 @@
1
- /** For endpoints listed on: https://umami.is/docs/api/websites-api */
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-api#get-apiwebsites (TODO UNTESTED) */
5
- async function getWebsites(parameters) {
4
+ /** Returns all user websites: https://umami.is/docs/api/websites#get-apiwebsites (TODO UNTESTED) */
5
+ async function get(parameters) {
6
6
  const response = await this.request("get", ["websites"], parameters);
7
7
  return response.data;
8
8
  }
9
- Websites.getWebsites = getWebsites;
10
- /** Creates a website: https://umami.is/docs/api/websites-api#post-apiwebsites (TODO UNTESTED) */
11
- async function createWebsite(parameters) {
9
+ Websites.get = get;
10
+ /** Creates a website: https://umami.is/docs/api/websites#post-apiwebsites (TODO UNTESTED) */
11
+ async function post(parameters) {
12
12
  return await this.request("post", ["websites"], parameters);
13
13
  }
14
- Websites.createWebsite = createWebsite;
15
- /** Gets a website by ID: https://umami.is/docs/api/websites-api#get-apiwebsiteswebsiteid (TODO UNTESTED) */
16
- async function getWebsite(websiteId) {
14
+ Websites.post = post;
15
+ /** Gets a website by ID: https://umami.is/docs/api/websites#get-apiwebsiteswebsiteid (TODO UNTESTED) */
16
+ async function get_WEBSITEID(websiteId) {
17
17
  return await this.request("get", ["websites", websiteId]);
18
18
  }
19
- Websites.getWebsite = getWebsite;
20
- /** Updates a website: https://umami.is/docs/api/websites-api#post-apiwebsiteswebsiteid (TODO UNTESTED) */
21
- async function updateWebsite(websiteId, parameters) {
19
+ Websites.get_WEBSITEID = get_WEBSITEID;
20
+ /** Updates a website: https://umami.is/docs/api/websites#post-apiwebsiteswebsiteid (TODO UNTESTED) */
21
+ async function post_WEBSITEID(websiteId, parameters) {
22
22
  return await this.request("post", ["websites", websiteId], parameters);
23
23
  }
24
- Websites.updateWebsite = updateWebsite;
25
- /** Deletes a website: https://umami.is/docs/api/websites-api#delete-apiwebsiteswebsiteid (TODO UNTESTED) */
26
- async function deleteWebsite(websiteId) {
24
+ Websites.post_WEBSITEID = post_WEBSITEID;
25
+ /** Deletes a website: https://umami.is/docs/api/websites#delete-apiwebsiteswebsiteid (TODO UNTESTED) */
26
+ async function delete_WEBSITEID(websiteId) {
27
27
  return await this.request("delete", ["websites", websiteId]);
28
28
  }
29
- Websites.deleteWebsite = deleteWebsite;
30
- /** Resets a website by removing all data related to the website: https://umami.is/docs/api/websites-api#post-apiwebsiteswebsiteidreset (TODO UNTESTED) */
31
- async function resetWebsite(websiteId) {
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 (TODO UNTESTED) */
31
+ async function post_WEBSITEID_Reset(websiteId) {
32
32
  return await this.request("post", ["websites", websiteId, "reset"]);
33
33
  }
34
- Websites.resetWebsite = resetWebsite;
34
+ Websites.post_WEBSITEID_Reset = post_WEBSITEID_Reset;
35
35
  })(Websites || (Websites = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "umami-api-js",
3
- "version": "0.0.3",
3
+ "version": "0.1.0",
4
4
  "description": "Package to easily access the umami api!",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -19,7 +19,7 @@
19
19
  "type": "git",
20
20
  "url": "https://codeberg.org/Taevas/umami-api-js"
21
21
  },
22
- "homepage": "https://codeberg.org/Taevas/umami-api-js",
22
+ "homepage": "https://umami-api-js.taevas.xyz/",
23
23
  "keywords": [
24
24
  "umami",
25
25
  "api",
@@ -28,9 +28,11 @@
28
28
  ],
29
29
  "license": "Unlicense",
30
30
  "devDependencies": {
31
- "@types/node": "^24.3.1",
32
- "dotenv": "^17.2.2",
31
+ "@types/chai": "^5.2.3",
32
+ "@types/node": "^24.9.2",
33
+ "chai": "^6.2.0",
34
+ "dotenv": "^17.2.3",
33
35
  "typedoc": "^0.28.14",
34
- "typescript": "^5.9.2"
36
+ "typescript": "^5.9.3"
35
37
  }
36
38
  }
@@ -1,33 +0,0 @@
1
- on:
2
- release:
3
- types: [published]
4
-
5
- jobs:
6
- docs:
7
- runs-on: codeberg-tiny-lazy
8
- steps:
9
- - name: Checkout this very app
10
- uses: actions/checkout@v4
11
- - name: Install dependencies
12
- run: npm install
13
- - name: Generate documentation through the command defined in package.json
14
- run: npm run docs
15
- - name: Move the docs up and get rid of the rest (this preserves files that start with a dot)
16
- run: |
17
- mv docs/ ..
18
- rm -rf *
19
- mv ../docs/* .
20
- - name: Add the .domains file
21
- run: echo "umami-api-js.taevas.xyz" > .domains
22
- - name: Configure our git client
23
- run: |
24
- git config user.name "forgejo-actions[bot]"
25
- git config user.email "code@taevas.xyz"
26
- - name: Create or switch to the "pages" branch
27
- run: git switch -C pages
28
- - name: Add and commit the changes
29
- run: |
30
- git add .
31
- git commit -m "Automatically generated documentation"
32
- - name: Send the changes to Codeberg, let Codeberg Pages do its magic~
33
- run: git push