chore: configure base url (#179)
* chore: set base api url * chore: change config varibales names * chore: rename env var * chore: set base url to match wakatime cli usage
This commit is contained in:
committed by
GitHub
parent
1e9e233066
commit
c2ead5149d
@@ -25,13 +25,14 @@ describe('wakatime config', () => {
|
||||
},
|
||||
},
|
||||
"apiKey": "",
|
||||
"apiUrl": "https://wakatime.com/api/v1",
|
||||
"colors": {
|
||||
"allGood": "",
|
||||
"lightTheme": "white",
|
||||
"notLogging": "gray",
|
||||
"notSignedIn": "red",
|
||||
},
|
||||
"currentUserApiUrl": "https://wakatime.com/api/v1/users/current",
|
||||
"currentUserApiEndPoint": "/users/current",
|
||||
"detectionIntervalInSeconds": 60,
|
||||
"devSites": "https://codepen.io/
|
||||
https://www.codewars.com/
|
||||
@@ -43,7 +44,7 @@ describe('wakatime config', () => {
|
||||
https://stackoverflow.com/
|
||||
https://www.udemy.com/
|
||||
https://www.w3schools.com/",
|
||||
"heartbeatApiUrl": "https://wakatime.com/api/v1/users/current/heartbeats",
|
||||
"heartbeatApiEndPoint": "/users/current/heartbeats",
|
||||
"hostname": "",
|
||||
"loggingEnabled": true,
|
||||
"loggingStyle": "blacklist",
|
||||
@@ -67,7 +68,7 @@ describe('wakatime config', () => {
|
||||
"blacklisted",
|
||||
"whitelisted",
|
||||
],
|
||||
"summariesApiUrl": "https://wakatime.com/api/v1/users/current/summaries",
|
||||
"summariesApiEndPoint": "/users/current/summaries",
|
||||
"theme": "light",
|
||||
"tooltips": {
|
||||
"allGood": "",
|
||||
|
||||
@@ -53,11 +53,12 @@ export interface Config {
|
||||
* API key use to query wakatime api
|
||||
*/
|
||||
apiKey: '';
|
||||
apiUrl: string;
|
||||
colors: Colors;
|
||||
/**
|
||||
* Url from which to detect if the user is logged in
|
||||
*/
|
||||
currentUserApiUrl: string;
|
||||
currentUserApiEndPoint: string;
|
||||
/**
|
||||
* Time for idle state of the browser
|
||||
* The user is considered idle if there was
|
||||
@@ -69,7 +70,7 @@ export interface Config {
|
||||
/**
|
||||
* Url to which to send the heartbeat
|
||||
*/
|
||||
heartbeatApiUrl: string;
|
||||
heartbeatApiEndPoint: string;
|
||||
|
||||
hostname: string;
|
||||
/**
|
||||
@@ -91,7 +92,7 @@ export interface Config {
|
||||
/**
|
||||
* Get stats from the wakatime api
|
||||
*/
|
||||
summariesApiUrl: string;
|
||||
summariesApiEndPoint: string;
|
||||
/**
|
||||
* Options for theme
|
||||
*/
|
||||
@@ -118,6 +119,8 @@ const config: Config = {
|
||||
|
||||
apiKey: '',
|
||||
|
||||
apiUrl: process.env.API_URL ?? 'https://wakatime.com/api/v1',
|
||||
|
||||
colors: {
|
||||
allGood: '',
|
||||
lightTheme: 'white',
|
||||
@@ -125,16 +128,14 @@ const config: Config = {
|
||||
notSignedIn: 'red',
|
||||
},
|
||||
|
||||
currentUserApiUrl:
|
||||
process.env.CURRENT_USER_API_URL ?? 'https://wakatime.com/api/v1/users/current',
|
||||
currentUserApiEndPoint: process.env.CURRENT_USER_API_URL ?? '/users/current',
|
||||
|
||||
detectionIntervalInSeconds: 60,
|
||||
|
||||
devSites:
|
||||
'https://codepen.io/\nhttps://www.codewars.com/\nhttps://dev.to/\nhttps://github.com/\nhttps://www.hackerrank.com/\nhttps://leetcode.com/\nhttps://developer.mozilla.org/en-US/\nhttps://stackoverflow.com/\nhttps://www.udemy.com/\nhttps://www.w3schools.com/',
|
||||
|
||||
heartbeatApiUrl:
|
||||
process.env.HEART_BEAT_API_URL ?? 'https://wakatime.com/api/v1/users/current/heartbeats',
|
||||
heartbeatApiEndPoint: process.env.HEARTBEAT_API_URL ?? '/users/current/heartbeats',
|
||||
|
||||
hostname: '',
|
||||
|
||||
@@ -152,8 +153,7 @@ const config: Config = {
|
||||
|
||||
states: ['allGood', 'notLogging', 'notSignedIn', 'blacklisted', 'whitelisted'],
|
||||
|
||||
summariesApiUrl:
|
||||
process.env.SUMMARIES_API_URL ?? 'https://wakatime.com/api/v1/users/current/summaries',
|
||||
summariesApiEndPoint: process.env.SUMMARIES_API_URL ?? '/users/current/summaries',
|
||||
|
||||
theme: 'light',
|
||||
|
||||
|
||||
Reference in New Issue
Block a user