typed-mite-api
v0.0.2
Published
A typesafe API for the mite time tracking service written in TypeScript.
Maintainers
Readme
typed-mite-api
A TypeScript wrapper for the mite time tracking service API.
Installation
npm install typed-mite-apiQuick Start
import { MiteClient } from "typed-mite-api";
const mite = new MiteClient("your-account-name", "your-api-key");
async function main() {
const projects = await mite.getProjects();
console.log(projects);
}
main();Configuration
The MiteClient can be initialized with the following options:
// Basic initialization
const mite = new MiteClient("your-account-name", "your-api-key");
// With custom user agent
const mite = new MiteClient(
"your-account-name",
"your-api-key",
"your-user-agent"
);Available Methods
getAccount()- Fetch information about your mite accountgetMyself()- Fetch information about the currently authenticated usergetTimeEntries(filter?: TimeEntryFilter)- Fetch all time entriesgetDailyTimeEntries(filter?: TimeEntryFilter)- Fetch all time entries for the current user for the current daygetTimeEntriesOfProject(projectId: number)- Fetch all time entries for a specific projectgetTimeEntriesOfCustomer(customerId: bumber)- Fetch all time entries for a specific customergetTimeEntry(timeEntryId: number)- Fetch a specific time entry by its IDgetCustomers()- Fetch all customersgetCustomer(customerId: number)- Fetch a specific customer by its IDgetProjects()- Fetch all projectsgetProject(projectId: number)- Fetch a specific project by its IDgetServices()- Fetch all servicesgetService(serviceId: number)- Fetch a specific service by its IDgetUsers()- Fetch all usersgetUser(userId: number)- Fetch a specific user by its ID
Error Handling
try {
const projects = await mite.getProjects();
} catch (error) {
console.error('Failed to fetch projects:', error);
}Documentation
For detailed API documentation, please visit [link to docs if available]
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
