Skip to content

Commit f485409

Browse files
💥 BREAKING: Change integrations to classes
1 parent bc99751 commit f485409

10 files changed

+980
-941
lines changed

src/api/clockify.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const getUserId = async () => {
7070
console.log("User ID", data.id);
7171
};
7272

73-
export class Clockify implements Integration {
73+
export default class Clockify implements Integration {
7474
name = "clockify";
7575
cli = { getUserId };
7676
async update() {

src/api/goodreads.ts

+14-10
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,19 @@ const api = goodreads(
1212
config("goodreadsCallbackUrl") || "http://localhost:3000/callback"
1313
);
1414

15-
export const daily = async () => {
16-
for await (const shelf of (await api.getUserInfo(userId)).user_shelves.user_shelf.map((shelf) => shelf.name)) {
17-
try {
18-
const books = await api.getBooksOnUserShelf(userId, shelf);
19-
console.log(books);
20-
} catch (error) {
21-
console.log(error);
15+
export default class Goodreads implements Integration {
16+
name = "goodreads";
17+
cli = {};
18+
async update() {
19+
for await (const shelf of (await api.getUserInfo(userId)).user_shelves.user_shelf.map((shelf) => shelf.name)) {
20+
try {
21+
const books = await api.getBooksOnUserShelf(userId, shelf);
22+
console.log(books);
23+
} catch (error) {
24+
console.log(error);
25+
}
2226
}
2327
}
24-
};
25-
26-
export const summary = async () => {};
28+
async legacy() {}
29+
async summary() {}
30+
}

0 commit comments

Comments
 (0)