Skip to content

Commit bc99751

Browse files
✨ Add CLI exporter
1 parent 45a291e commit bc99751

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/api/clockify.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const getTimeData = async (date: Date) => {
6363
}
6464
};
6565

66-
export const getUserId = async () => {
66+
const getUserId = async () => {
6767
const { data } = await axios.get(`https://api.clockify.me/api/v1/user`, {
6868
headers: { "X-Api-Key": apiKey },
6969
});
@@ -72,6 +72,7 @@ export const getUserId = async () => {
7272

7373
export class Clockify implements Integration {
7474
name = "clockify";
75+
cli = { getUserId };
7576
async update() {
7677
console.log("Clockify: Starting...");
7778
for await (const day of [0, 1, 2, 3, 4]) {

src/integration.ts

+3
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,7 @@ interface Integration {
44
update: () => Promise<void>;
55
summary: () => Promise<void>;
66
legacy: (date: string | Date) => Promise<void>;
7+
cli: {
8+
[index: string]: (...params: any[]) => Promise<void>;
9+
};
710
}

0 commit comments

Comments
 (0)