jaspermayone-archive / api Goto Github PK
View Code? Open in Web Editor NEWBasic API, designed and coded for the @Heptagram-Bot-Project
Home Page: http://api.heptagrambotproject.com
License: Eclipse Public License 2.0
Basic API, designed and coded for the @Heptagram-Bot-Project
Home Page: http://api.heptagrambotproject.com
License: Eclipse Public License 2.0
Tracking issue for:
res.send(randomItem);
});
// TODO: add endpoint needs to be locked to admins only
router.post("/add", async (req, res) => {
});
export default router;
Switch the API to completely run using docker.
Tracking issue for:
Tracking issue for:
Tracking issue for:
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
@typescript-eslint/eslint-plugin
, @typescript-eslint/parser
).github/workflows/datree-validation.yml
actions/checkout v3
tj-actions/changed-files v34
.github/workflows/first-interaction.yml
actions/first-interaction v1
.github/workflows/labels.yaml
actions/setup-node v3
.github/workflows/pull-request-automation.yml
andrewmusgrave/automatic-pull-request-review 0.0.5
.github/workflows/take.yml
.github/workflows/todo.yml
alstr/todo-to-issue-action v4.8.1
package.json
@types/mongoose ^5.11.97
@types/swagger-jsdoc ^6.0.1
@types/uuid ^8.3.4
axios ^1.1.2
bcryptjs ^2.4.3
body-parser ^1.20.0
bun-types ^0.2.0
chalk ^5.0.1
colors ^1.4.0
cors ^2.8.5
dotenv ^16.0.3
express ^4.18.2
express-ping ^1.4.0
express-public-ip ^1.0.1
express-rate-limit ^6.6.0
express-validator ^6.14.0
helmet ^6.0.0
ipinfo-express ^1.1.0
jsonwebtoken ^8.5.1
mathjs ^11.0.0
mongoose ^6.7.2
openapi-types ^12.0.2
redis ^4.4.0
source-map-support ^0.5.21
swagger-jsdoc ^6.2.5
swagger-ui-express ^4.3.0
ts-node ^10.7.0
typescript ^4.8.2
uuid ^9.0.0
@types/body-parser 1.19.2
@types/compression 1.7.2
@types/cors 2.8.12
@types/node 18.11.9
@types/swagger-ui-express 4.1.3
@typescript-eslint/eslint-plugin 5.43.0
@typescript-eslint/parser 5.43.0
all-contributors-cli 6.24.0
eslint 8.27.0
eslint-config-prettier 8.5.0
eslint-plugin-import 2.26.0
eslint-plugin-jsdoc 39.6.2
eslint-plugin-prettier 4.2.1
husky 8.0.2
lint-staged 13.0.3
nodemon 2.0.20
prettier 2.7.1
yarn 3.3.0
Tracking issue for:
Tracking issue for:
I will add the joi validation to the user schema
Please assign this issue to me and add the 'hacktoberfest' label to it.
Tracking issue for:
System that allows only a specified group of people to access any /admin endpoints, and any other endpoints specified such as /auth
Tracking issue for:
No response
No response
For implementation, Heptagram already as a key to the api. I am having trouble getting it to work, so am looking for some help.
See Lines 46-77 for the implementation I have so far.
source: "WalshyAPI",
};
}
/* TODO: Check against Google Safe Browsing API (https://developers.google.com/safe-browsing/v4/lookup)
For implementation, Heptagram already as a key to the api. I am having trouble getting it to work, so am looking for some help.
See Lines 46-77 for the implementation I have so far.
*/
/*
const GOOGLE_SAFE_BROWSING_API_KEY = process.env.GOOGLE_SAFE_BROWSING_API_KEY;
const checkGoogleSafeBrowsing = await axios.post(`https://safebrowsing.googleapis.com/v4/threatMatches:find?key=${GOOGLE_SAFE_BROWSING_API_KEY}`,
{
headers: {
Accept: "application/json",
ContentType: "application/json",
},
body: {
"client": {
"clientId": "yourcompanyname",
"clientVersion": "1.5.2"
},
"threatInfo": {
"threatTypes": ["MALWARE", "SOCIAL_ENGINEERING"],
"platformTypes": ["WINDOWS"],
"threatEntryTypes": ["URL"],
"threatEntries": [
{ "url": "http://www.urltocheck1.org/" },
{ "url": "http://www.urltocheck2.org/" },
{ "url": "http://www.urltocheck3.com/" }
]
}
}
}
);
if (checkGoogleSafeBrowsing.data.matches.length > 0) {
return {
scamDetected: true,
source: "GoogleSafeBrowsing",
};
}
*/
return {
scamDetected: false,
source: "",
Mabye we use a tool like https://github.com/mindsdb/mindsdb?
I would love to be able to classify, sort, and predict scam links using some ai.
Tracking issue for:
Simple endpoint that fetches the changelog from our github repo.
For implementation, Heptagram already as a key to the api. I am having trouble getting it to work, so am looking for some help.
See Lines 46-77 for the implementation I have so far.
source: "WalshyAPI",
};
}
/* TODO: Check against Google Safe Browsing API (https://developers.google.com/safe-browsing/v4/lookup)
For implementation, Heptagram already as a key to the api. I am having trouble getting it to work, so am looking for some help.
See Lines 46-77 for the implementation I have so far.
*/
/*
const GOOGLE_SAFE_BROWSING_API_KEY = process.env.GOOGLE_SAFE_BROWSING_API_KEY;
const checkGoogleSafeBrowsing = await axios.post(`https://safebrowsing.googleapis.com/v4/threatMatches:find?key=${GOOGLE_SAFE_BROWSING_API_KEY}`,
{
headers: {
Accept: "application/json",
ContentType: "application/json",
},
body: {
"client": {
"clientId": "yourcompanyname",
"clientVersion": "1.5.2"
},
"threatInfo": {
"threatTypes": ["MALWARE", "SOCIAL_ENGINEERING"],
"platformTypes": ["WINDOWS"],
"threatEntryTypes": ["URL"],
"threatEntries": [
{ "url": "http://www.urltocheck1.org/" },
{ "url": "http://www.urltocheck2.org/" },
{ "url": "http://www.urltocheck3.com/" }
]
}
}
}
);
if (checkGoogleSafeBrowsing.data.matches.length > 0) {
return {
scamDetected: true,
source: "GoogleSafeBrowsing",
};
}
*/
return {
scamDetected: false,
source: "",
Setup some cool Github actions for our project. (see list below).
Tracking issue for:
No response
No response
everything is already in db, and has a schema, just needs to be implemented.
CodeFactor found an issue: ./api/changelog
import should occur before import of ./api/coinflip
It's currently on:
src\routes\api.ts:10
Tracking issue for:
Tracking issue for:
Tracking issue for:
Tracking issue for:
console.log('Try npm run lint/fix!');
const longString =
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut aliquet diam.';
const trailing = 'Semicolon';
const why = 'am I tabbed?';
export function doSomeStuff(
withThis: string,
andThat: string,
andThose: string[]
) {
//function on one line
if (!andThose.length) {
return false;
}
console.log(withThis);
console.log(andThat);
console.dir(andThose);
return;
}
// TODO: more examples
I will add the random number generator route to the api folder
Please assign this issue to me and add the 'hacktoberfest' label to it.
Tracking issue for:
res.send(randomItem);
});
// TODO: add endpoint needs to be locked to admins only
router.post("/add", async (req, res) => {
});
export default router;
Tracking issue for:
When we check if a link is scam, we get a bunch of raw results. We use only relevant info to determine if it is a scam or not... I would like to be able to store all of the raw results in database collections. This should be pretty easy, just don't have the time for it rn. Let me know if whoever takes this has any questions.
Tracking issue for:
Something like https://github.com/chubin/wttr.in...
Add to https://hub.docker.com/_/mongo-express the docker container
Tracking issue for:
import errorLogger from "../logger";
import { MetricsModel } from "../models/Metrics";
import { getLatitudeAndLongidute } from "../utils/getLatitudeAndLongitude";
import { v4 as uuidv4 } from "uuid";
export async function saveUserMetrics(req, res, next) {
if (req.ipinfo.bogon) {
const errorMessage = `Error: Bogon IP!`;
console.log(req.ipinfo.IP);
errorLogger({ message: errorMessage }, uuidv4(), req);
return next();
}
const { ip, city, region, country, timezone, loc } = req.ipinfo;
const metric = new MetricsModel({
id: req.user.userId,
ip: ip,
city: city,
region: region,
country: country,
timezone: timezone,
longitude: getLatitudeAndLongidute(loc).longitude,
latitude: getLatitudeAndLongidute(loc).latitude,
urlAccessed: req.originalUrl,
});
await metric.save(); // TODO: Handle exception
next();
}
For implementation, Heptagram already as a key to the api. I am having trouble getting it to work, so am looking for some help.
See Lines 46-77 for the implementation I have so far.
source: "WalshyAPI",
};
}
/* TODO: Check against Google Safe Browsing API (https://developers.google.com/safe-browsing/v4/lookup)
For implementation, Heptagram already as a key to the api. I am having trouble getting it to work, so am looking for some help.
See Lines 46-77 for the implementation I have so far.
*/
/*
const GOOGLE_SAFE_BROWSING_API_KEY = process.env.GOOGLE_SAFE_BROWSING_API_KEY;
const checkGoogleSafeBrowsing = await axios.post(`https://safebrowsing.googleapis.com/v4/threatMatches:find?key=${GOOGLE_SAFE_BROWSING_API_KEY}`,
{
headers: {
Accept: "application/json",
ContentType: "application/json",
},
body: {
"client": {
"clientId": "yourcompanyname",
"clientVersion": "1.5.2"
},
"threatInfo": {
"threatTypes": ["MALWARE", "SOCIAL_ENGINEERING"],
"platformTypes": ["WINDOWS"],
"threatEntryTypes": ["URL"],
"threatEntries": [
{ "url": "http://www.urltocheck1.org/" },
{ "url": "http://www.urltocheck2.org/" },
{ "url": "http://www.urltocheck3.com/" }
]
}
}
}
);
if (checkGoogleSafeBrowsing.data.matches.length > 0) {
return {
scamDetected: true,
source: "GoogleSafeBrowsing",
};
}
*/
return {
scamDetected: false,
source: "",
For implementation, Heptagram already as a key to the api. I am having trouble getting it to work, so am looking for some help.
See Lines 46-77 for the implementation I have so far.
source: "WalshyAPI",
};
}
/* TODO: Check against Google Safe Browsing API (https://developers.google.com/safe-browsing/v4/lookup)
For implementation, Heptagram already as a key to the api. I am having trouble getting it to work, so am looking for some help.
See Lines 46-77 for the implementation I have so far.
*/
/*
const GOOGLE_SAFE_BROWSING_API_KEY = process.env.GOOGLE_SAFE_BROWSING_API_KEY;
const checkGoogleSafeBrowsing = await axios.post(`https://safebrowsing.googleapis.com/v4/threatMatches:find?key=${GOOGLE_SAFE_BROWSING_API_KEY}`,
{
headers: {
Accept: "application/json",
ContentType: "application/json",
},
body: {
"client": {
"clientId": "yourcompanyname",
"clientVersion": "1.5.2"
},
"threatInfo": {
"threatTypes": ["MALWARE", "SOCIAL_ENGINEERING"],
"platformTypes": ["WINDOWS"],
"threatEntryTypes": ["URL"],
"threatEntries": [
{ "url": "http://www.urltocheck1.org/" },
{ "url": "http://www.urltocheck2.org/" },
{ "url": "http://www.urltocheck3.com/" }
]
}
}
}
);
if (checkGoogleSafeBrowsing.data.matches.length > 0) {
return {
scamDetected: true,
source: "GoogleSafeBrowsing",
};
}
*/
return {
scamDetected: false,
source: "",
Tracking issue for:
I started implementing testing following this guide:
https://japa.dev
I would love for someone to finish it off.
Track things like
ALL METRICS SHOULD ONLY BE ACCESSED BY ADMIN OR THE USER THAT THE DATA CORRESPONDS TO
Tracking issue for:
Tracking issue for:
When a quote doesn't have author data, the response includes a request to email you if someone knows the author. Rather than an email based approach, why not open source the quotes?
The structure of the data is simple enough to be effective in a JSON object, can be hosted directly in the API files, and then you'd be able to accept contributions.
Could also consider this for your jokes data as well.
Tracking issue for:
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.