teknologi-umum / adelite Goto Github PK
View Code? Open in Web Editor NEWA non-invasive release notification aggregator for repositories that you actually care.
License: GNU General Public License v3.0
A non-invasive release notification aggregator for repositories that you actually care.
License: GNU General Public License v3.0
The GitProvider
interface provides a function to call the Gitea API for getting a specific repository's release data. With undici installed and since we're not using any Gitea API SDK (because we only need this single endpoint), implement the getReleases
function to do that.
adelite/src/git/GiteaProvider.ts
Lines 4 to 8 in dff5d23
The NotificationProvider
interface provides a function abstraction to send a notification through a certain provider, for this issue, it's via Telegram. Using grammy, implement message sending to a specific chatId
.
Since there is no constructor, you should create one that bridge the gap between the configuration (in which where we would store the botToken
and chatId
) and what's needed by grammy.
adelite/src/notification/TelegramProvider.ts
Lines 4 to 7 in dff5d23
You can see the configuration for Telegram here:
Lines 21 to 24 in dff5d23
The GitProvider
interface provides a function to call the Github API for getting a specific repository's release data. With undici installed and since we're not using any Github API SDK (because we only need this single endpoint), implement the getReleases
function to do that.
adelite/src/git/GithubProvider.ts
Lines 4 to 9 in dff5d23
The GitProvider
interface provides a function to call the Forgejo API for getting a specific repository's release data. With undici installed and since we're not using any Forgejo API SDK (because we only need this single endpoint), implement the getReleases
function to do that.
As a side note: Yes, I understand that Forgejo and Gitea has similar API. We might benefit from a code reuse, yet I'm seeing a pattern that Forgejo is going to a separate way from Gitea, resulting in a probable API incompatibilities between the two.
adelite/src/git/ForgejoProvider.ts
Lines 4 to 9 in dff5d23
The GitProvider
interface provides a function to call the Gogs API for getting a specific repository's release data. With undici installed and since we're not using any Gogs API SDK (because we only need this single endpoint), implement the getReleases
function to do that.
adelite/src/git/GogsProvider.ts
Lines 4 to 8 in dff5d23
The NotificationProvider
interface provides a function abstraction to send a notification through a certain provider, for this issue, it's via Webhook (you can learn about what is webhook here). Using undici, implement notification through webhook.
Since the class don't have a constructor yet, it's your opportunity to also create the constructor. An extra feature would be to implement a retry mechanism in case the receiving party (the server in which we're hitting on) didn't response with 2xx or 4xx status code. We should retry at most 5 times using exponential backoff -- but again, this retry feature is a nice to have one, it's not required from the start.
adelite/src/notification/WebhookProvider.ts
Lines 4 to 7 in dff5d23
The configuration for webhook provider can be found here, you can add more configuration if you feel like this can be configured more.
Lines 25 to 28 in dff5d23
The GitProvider
interface provides a function to call the Gitlab API for getting a specific repository's release data. With undici installed and since we're not using any Gitlab API SDK (because we only need this single endpoint), implement the getReleases
function to do that.
adelite/src/git/GitlabProvider.ts
Lines 4 to 8 in dff5d23
The NotificationProvider
interface provides a function abstraction to send a notification through a certain provider, for this issue, it's via SMTP (email). Using emailjs, implement mail sending mechanism through SMTP.
If you're not sure about the message content, just send a normal text. I'm sure that we can address the correct and proper email message in a separate issue.
adelite/src/notification/SMTPProvider.ts
Lines 14 to 27 in dff5d23
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.