simonla / obsidian_waka_box

MIT License
8 stars 3 forks source link

Adding custom API URL #1

Closed F2VILLE closed 10 months ago

F2VILLE commented 11 months ago

Hey, what's up ? I edited your code to add custom Wakapi URL (for self hosted servers). As I am not really confident about how I edited your code, I don't want to make a pull request, but it would be nice if you could check it and add it on the extension. I used the template of your repo, I think you can look at it on my profile. If you want to chat about it, my discord is f2ville

Have a nice day / evening !

simonla commented 11 months ago

Could you please direct me to the documentation for the self-hosted WakaTime API?

F2VILLE commented 10 months ago

Sure : https://wakapi.dev/swagger-ui/swagger-ui/index.html

If you want my edition seems to work, for the baseURL I did like this :

const baseUrl = (apiURL.endsWith("/") ? apiURL.slice(0, -1) : apiURL) + (apiURL.includes("wakatime.com") ? "/users/current/summaries" : "/compat/wakatime/v1/users/current/summaries")

So basically from what I found the endpoint to get summaries from wakapi self-hosted server is /compat/wakatime/v1/users/current/summaries

Wanxp commented 10 months ago

I has pushed a "Pull Request" #2 to support this function: 1694880172041 . Wait @simonla accept this request. If you could not wait for this, please contact me.

simonla commented 10 months ago

Waiting for obsidian review update