Giter VIP home page Giter VIP logo

api-client's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

api-client's Issues

Module '"@umami/api-client"' has no exported member 'client'.

From the compiled types it's impossible to use api-client like the doc said.

No client exported from the lib
Capture d’écran 2023-12-07 à 16 53 44

I have to use getClient

const client = getClient();

to get the client instance (not a problem actually but the doc should be consistent with the real usage)

Return a wrong type getEventDataEvents: object instead of object[]

Hi,
thank you for your work.
I think the types on getEventDataEvents should get Umami.WebsiteEventData[]
instead of Umami.WebsiteEventData to return a right type?

getEventDataEvents(websiteId: string, params: { startAt: number; endAt: number; event?: string; }): Promise<ApiResponse<Umami.WebsiteEventData[]>>;

Malformatted URL for API Client

The API endpoint in the docs should not have a slash at the end.

UMAMI_API_CLIENT_ENDPOINT=https://api.umami.is/v1/

should be

UMAMI_API_CLIENT_ENDPOINT=https://api.umami.is/v1

image

Type error on getWebsiteStats function

It looks like the extra params on the getWebsiteStats and getWebsiteMetrics are not marked as optional.

So in this function

const { data } = await client().getWebsiteStats(websiteId, {
    startAt: 1685566800000,
    endAt: 1686916052440,
    url: '/about'
  });

You get this error

Argument of type '{ startAt: number; endAt: number; url: string; }' is not assignable to parameter of type '{ startAt: number; endAt: number; url: string; referrer: string; title: string; query: string; event: string; os: string; browser: string; device: string; country: string; region: string; city: string; }'.

Website stats endpoint returns 500 error

Making a call to this endpoint getWebsiteStats returns error code 500

const { data } = await client().getWebsiteStats(websiteId, {
    startAt: 1685566800000,
    endAt: 1686916052440,
  });

The same endpoint directly via the REST API works just fine though:

curl --request GET \
  --url https://api.umami.is/v1/websites/<website id>/stats \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --header 'x-umami-api-key: <api key>' \
  --data startAt=1685566800000 \
  --data endAt=1686916052440

I messaged on discord as well, so you can DM me there if you need my exact website ID for debugging!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.