All Projects → jaebradley → wakatime-client

jaebradley / wakatime-client

Licence: MIT License
🖥 JavaScript Client for https://wakatime.com/developers

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to wakatime-client

react-change-highlight
✨ a react component to highlight changes constantly ⚡️
Stars: ✭ 79 (+172.41%)
Mutual labels:  npm-package
secure-env
Env encryption tool that will help you prevent attacks from npm-malicious-packages.
Stars: ✭ 53 (+82.76%)
Mutual labels:  npm-package
midtrans-node
Unoffficial Midtrans Payment API Client for Node JS | Alternative for Midtrans Official Module | https://midtrans.com
Stars: ✭ 15 (-48.28%)
Mutual labels:  npm-package
babel-plugin-source-map-support
A Babel plugin which automatically makes stack traces source-map aware
Stars: ✭ 41 (+41.38%)
Mutual labels:  npm-package
vogels-promisified
DynamoDB library Vogels promisified
Stars: ✭ 19 (-34.48%)
Mutual labels:  npm-package
komit
An interactive prompt for conventional commit messages that doesn't get in your way. Designed to run as a git hook.
Stars: ✭ 29 (+0%)
Mutual labels:  npm-package
add-module-exports-webpack-plugin
Add `module.exports` for Babel and TypeScript compiled code
Stars: ✭ 36 (+24.14%)
Mutual labels:  npm-package
notifyme
react-notification-timeline is a react based component helps in managing the notification in time-based manner.
Stars: ✭ 94 (+224.14%)
Mutual labels:  npm-package
spiderable-middleware
🤖 Prerendering for JavaScript powered websites. Great solution for PWAs (Progressive Web Apps), SPAs (Single Page Applications), and other websites based on top of front-end JavaScript frameworks
Stars: ✭ 29 (+0%)
Mutual labels:  npm-package
unique-names-generator
Generate unique and memorable name strings
Stars: ✭ 356 (+1127.59%)
Mutual labels:  npm-package
Dynamic-Web-TWAIN
Dynamic Web TWAIN for package managers
Stars: ✭ 35 (+20.69%)
Mutual labels:  npm-package
wakatime-to-toggl
📩 Sync your WakaTime data in Toggl
Stars: ✭ 23 (-20.69%)
Mutual labels:  wakatime
tinder-client
❤️ NodeJS Tinder Client
Stars: ✭ 50 (+72.41%)
Mutual labels:  npm-package
guilyx
Dynamic Profile with github statistics, coding info (time and languages) with WakaTime and music status with the spotify API, leave a ⭐ if you like it
Stars: ✭ 175 (+503.45%)
Mutual labels:  wakatime
beginner-windows-npm-gulp-webdev-tutorial
Beginner guide for users on web development with node.js/npm + gulp terminal commands. You'll learn how to use other terminal commands like git, gulp, bower, yarn, and more!
Stars: ✭ 40 (+37.93%)
Mutual labels:  npm-package
awesome-starless
A curated list of awesome repositories with few stargazers but has a huge users.
Stars: ✭ 38 (+31.03%)
Mutual labels:  npm-package
XToolset
Typed import, and export XLSX spreadsheet to JS / TS. Template-based create, render, and export data into excel files.
Stars: ✭ 110 (+279.31%)
Mutual labels:  npm-package
js-types
List of JavaScript types
Stars: ✭ 74 (+155.17%)
Mutual labels:  npm-package
ngx-interactive-paycard
Interactive Angular payment card library.
Stars: ✭ 71 (+144.83%)
Mutual labels:  npm-package
angular-environment
AngularJS Environment Plugin
Stars: ✭ 78 (+168.97%)
Mutual labels:  npm-package

Wakatime Client npm npm-total-downloads npm bundle size Codecov branch GitHub

wakatime-client

A NodeJS client for the WakaTime API.

Installation

npm install wakatime-client --save

API

Create Instance Using API Key

import { WakaTimeClient } from 'wakatime-client';

const client = new WakaTimeClient('some api key');

Custom Base URLs

import { WakaTimeClient } from 'wakatime-client';

const client = new WakaTimeClient('some api key', 'https://wakapi.dev/api/v1');

getUser

Get details for user

const userDetails = await client.getUser('some user id');

getMe

Get details for user associated with API key

const myUserDetails = await client.getMe();

getTeams

Get teams for user

const teams = await client.getTeams('some user id');

getMyTeams

Get teams for user associated with API key

const myTeams = await client.getMyTeams();

getUserAgents

Get User Agents (or plugins) for user

const userAgents = await client.getUserAgents('some user id');

getMyUserAgents

Get User Agents (or plugins) for user associated with API key

const myUserAgents = await client.getMyUserAgents();

getTeamMembers

Get team members for specified user and team

const teamMembers = await client.getTeamMembers({ userId: 'some user id', teamId: 'some team id' });

getMyTeamMembers

Get team members for user associated with API key and specified team

const myTeamMembers = await client.getMyTeamMembers('some team id');

getTeamMemberSummary

Get summary for team member

Required Parameters

const teamMemberSummary = await client.getTeamMemberSummary({
  userId: 'some user id',
  teamId: 'some team id',
  teamMemberId: 'some team member id',
  dateRange: {
    startDate: 'some start date',
    endDate: 'some end date',
  },
});

With Optional Parameters

const teamMemberSummary = await client.getTeamMemberSummary({
  userId: 'some user id',
  teamId: 'some team id',
  teamMemberId: 'some team member id',
  dateRange: {
    startDate: 'some start date',
    endDate: 'some end date',
  },
  projectName: 'some project name',
  branchNames: ['some branch', 'some other branch', 'some other other branch'],
});

getMyTeamMemberSummary

Get summary for team member for user associated with API key

Required Parameters

const myTeamMemberSummary = await client.getMyTeamMemberSummary({
  teamId: 'some team id',
  teamMemberId: 'some team member id',
  dateRange: {
    startDate: 'some start date',
    endDate: 'some end date',
  },
});

With Optional Parameters

const myTeamMemberSummary = await client.getMyTeamMemberSummary({
  teamId: 'some team id',
  teamMemberId: 'some team member id',
  dateRange: {
    startDate: 'some start date',
    endDate: 'some end date',
  },
  projectName: 'some project name',
  branchNames: ['some branch', 'some other branch', 'some other other branch'],
});

getUserSummary

Get summary for user

Required Parameters

const summary = await client.getUserSummary({
  userId: 'some user id',
  dateRange: {
    startDate: 'some start date',
    endDate: 'some end date',
  },
})

With Optional Parameters

const summary = await client.getUserSummary({
  userId: 'some user id',
  dateRange: {
    startDate: 'some start date',
    endDate: 'some end date',
  },
  projectName: 'some project name',
  branchNames: ['some branch', 'some other branch', 'some other other branch'],
})

getMySummary

Get summary for user associated with API key

Required Parameters

const summary = await client.getMySummary({
  dateRange: {
    startDate: 'some start date',
    endDate: 'some end date',
  },
})

With Optional Parameters

const summary = await client.getMySummary({
  dateRange: {
    startDate: 'some start date',
    endDate: 'some end date',
  },
  projectName: 'some project name',
  branchNames: ['some branch', 'some other branch', 'some other other branch'],
})

getUserStats

Get stats for user

Required Parameters

import { RANGE } from 'wakatime-client';

// I assume you have instantiated the client

const stats = await client.getUserStats({
  userId: 'some user id',
  range: RANGE.PAST_7_DAYS,
});

With Optional Parameters

import { RANGE } from 'wakatime-client';

// I assume you have instantiated the client

const stats = await client.getUserStats({
  userId: 'some user id',
  range: RANGE.PAST_7_DAYS,
  timeout: 'some timeout',
  useWritesOnly: true,
  projectName: 'some project name',
});

getMyStats

Get stats for user associated with API key

Required Parameters

import { RANGE } from 'wakatime-client';

// I assume you have instantiated the client

const myStats = await client.getMyStats({ range: RANGE.PAST_7_DAYS });

With Optional Parameters

import { RANGE } from 'wakatime-client';

// I assume you have instantiated the client

const myStats = await client.getMyStats({
  range: RANGE.PAST_7_DAYS,
  timeout: 'some timeout',
  useWritesOnly: true,
  projectName: 'some project name',
});

getProjects

Get projects for user

const projects = await client.getProjects('some user id');

getMyProjects

Get projects for user associated with API key

const myProjects = await client.getMyProjects();

getLeaders

Get Leaders

Leaders, regardless of language

const leaders = await client.getLeaders();

JavaScript Leaders on Page 2

const leaders = await client.getLeaders({ language: 'JavaScript', pageNumber: 2 });

getHeartbeats

Get heartbeats for user on a specified date

const heartbeats = await client.getHeartbeats({ userId: 'some user id', date: 'some date' });

getMyHeartbeats

Get heartbeats for user associated with API key on a specified date

const myHeartbeats = await client.getMyHeartbeats('some date');

getGoals

Get goals for user

const goals = await client.getGoals('some user id');

getMyGoals

Get goals for user associated with API key

const myGoals = await client.getMyGoals();

getDurations

Get durations for user

Required Parameters

const durations = await client.getDurations({ userId: 'some user id', date: 'some date' });

With Optional Parameters

const durations = await client.getDurations({
  userId: 'some user id',
  date: 'some date',
  projectName: 'some project name',
  branchNames: ['some branch', 'some other branch', 'some other other branch'],
});

getMyDurations

Get durations for user associated with API key

Required Parameters

const myDurations = await client.getMyDurations({ date: 'some date' });

With Optional Parameters

const myDurations = await client.getMyDurations({
  date: 'some date',
  projectName: 'some project name',
  branchNames: ['some branch', 'some other branch', 'some other other branch'],
});

getCommits

Get commits for user

Required Parameters

const commits = await client.getCommits({
  userId: 'some user id',
  projectName: 'some project name',
});

With Optional Parameters

const commits = await client.getCommits({
  userId: 'some user id',
  projectName: 'some project name',
  authorName: 'jaebaebae',
  pageNumber: 2,
});

getMyCommits

Get commits for user associated with API key

Required Parameters

const myCommits = await client.getMyCommits({ projectName: 'some project name' });

With Optional Parameters

const myCommits = await client.getMyCommits({
  projectName: 'some project name',
  authorName: 'jaebaebae',
  pageNumber: 2,
});

getMetadata

Get metadata associated with WakaTime service (like IP addresses)

const metadata = await client.getMetadata();

getOrganizations

Get list of organizations for the specified user

const organizations = await client.getOrganizations('some user id');

getMyOrganizations

Get list of organizations for user associated with API key

const myOrganizations = await client.getMyOrganizations();

getOrganizationDashboards

Get list of dashboards for the specified user and organization

const dashboards = await client.getOrganizationDashboards({ 
  userId: 'some user id', 
  organizationId: 'some organization id',
});

getMyOrganizationDashboards

Get list of dashboards for the current user and the specified organization

const dashboards = await client.getMyOrganizationDashboards('some organization id');

getOrganizationDashboardMembers

Get list of dashboard members for the specified user, organization, and dashboard

const members = await client.getOrganizationDashboardMembers({
  userId: 'some user id',
  organizationId: 'some organization id',
  dashboardId: 'some dashboard id',
})

getMyOrganizationDashboardMembers

Get list of dashboard members for the current user and specified organization and dashboard

const members = await client.getMyOrganizationDashboardMembers({
  organizationId: 'some organization id',
  dashboardId: 'some dashboard id',
})

getOrganizationDashboardMemberSummaries

Get list of dashboard member summaries for the specified user, organization, dashboard, and member

const summaries = await client.getOrganizationDashboardMemberSummaries({
  userId: 'some user id',
  organizationId: 'some organization id',
  dashboardId: 'some dashboard id',
  memberId: 'some member id',
})

getMyOrganizationDashboardMemberSummaries

Get list of dashboard member summaries for the current user and specified organization, dashboard, and member

const summaries = await client.getMyOrganizationDashboardMemberSummaries({
  organizationId: 'some organization id',
  dashboardId: 'some dashboard id',
  memberId: 'some member id',
})

getOrganizationDashboardMemberDurations

Get list of dashboard member durations for the specified user, organization, dashboard, and member

const summaries = await client.getOrganizationDashboardMemberDurations({
  userId: 'some user id',
  organizationId: 'some organization id',
  dashboardId: 'some dashboard id',
  memberId: 'some member id',
})

getMyOrganizationDashboardMemberDurations

Get list of dashboard member durations for the current user and specified organization, dashboard, and member

const summaries = await client.getMyOrganizationDashboardMemberDurations({
  organizationId: 'some organization id',
  dashboardId: 'some dashboard id',
  memberId: 'some member id',
})

Local Development

After cloning the repository, use nvm / npm to install dependencies.

To run tests, execute npm run test. This will run both unit and integration tests.

In order to execute local integration tests successfully, you'll need to specify the following environment variables in the .env file as well as in the Secrets section of your fork's Settings page.

  • ACCESS_TOKEN (A WakaTime Access Token)
  • USER_ID (A WakaTime User ID)
  • ORGANIZATION_ID ( A WakaTime Organization ID)
  • DASHBOARD_ID (A WakaTime Dashboard ID)

To build the production bundle, execute npm run build.

Git Hooks

This project uses husky to maintain git hooks.

  • pre-commit - run eslint
  • commit-msg - run commit message linting
  • pre-push - run tests

Commit Linting

This project uses semantic-release and commitlint (specifically the Angular commit convention) to automatically enforce semantic versioning.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].