Refactor /api/detect/[]

This commit is contained in:
Nikita Karamov 2023-08-26 17:09:03 +02:00
parent 256aa8fbd0
commit af241cfce9
No known key found for this signature in database
GPG key ID: 41D6F71EE78E77CD

View file

@ -21,6 +21,13 @@ const mastodonSettings = {
},
};
const misskeySettings = {
publishEndpoint: "share",
params: {
text: "text",
},
};
const pleromaSettings = {
publishEndpoint: "share",
params: {
@ -28,48 +35,30 @@ const pleromaSettings = {
},
};
const PROJECTS: Map<FediverseProject, FediverseProjectData> = new Map([
[FediverseProject.Akkoma, pleromaSettings],
[FediverseProject.Mastodon, mastodonSettings],
[FediverseProject.Hometown, mastodonSettings],
[
FediverseProject.GNUSocial,
{
publishEndpoint: "/notice/new",
params: {
text: "status_textarea",
},
const PROJECTS: Map<FediverseProject, FediverseProjectData> = new Map()
.set(FediverseProject.Hometown, mastodonSettings)
.set(FediverseProject.Mastodon, mastodonSettings)
.set(FediverseProject.Misskey, misskeySettings)
.set(FediverseProject.Akkoma, pleromaSettings)
.set(FediverseProject.Pleroma, pleromaSettings)
.set(FediverseProject.GNUSocial, {
publishEndpoint: "/notice/new",
params: {
text: "status_textarea",
},
],
[FediverseProject.Pleroma, pleromaSettings],
[
FediverseProject.Friendica,
{
publishEndpoint: "compose",
params: {
text: "body",
},
})
.set(FediverseProject.Friendica, {
publishEndpoint: "compose",
params: {
text: "body",
},
],
[
FediverseProject.Hubzilla,
{
publishEndpoint: "rpost",
params: {
text: "body",
},
})
.set(FediverseProject.Hubzilla, {
publishEndpoint: "rpost",
params: {
text: "body",
},
],
[
FediverseProject.Misskey,
{
publishEndpoint: "share",
params: {
text: "text",
},
},
],
]);
});
interface NodeInfoList {
links: {