Refactor /api/detect/[]
This commit is contained in:
parent
256aa8fbd0
commit
af241cfce9
1 changed files with 28 additions and 39 deletions
|
@ -21,6 +21,13 @@ const mastodonSettings = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const misskeySettings = {
|
||||||
|
publishEndpoint: "share",
|
||||||
|
params: {
|
||||||
|
text: "text",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
const pleromaSettings = {
|
const pleromaSettings = {
|
||||||
publishEndpoint: "share",
|
publishEndpoint: "share",
|
||||||
params: {
|
params: {
|
||||||
|
@ -28,48 +35,30 @@ const pleromaSettings = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const PROJECTS: Map<FediverseProject, FediverseProjectData> = new Map([
|
const PROJECTS: Map<FediverseProject, FediverseProjectData> = new Map()
|
||||||
[FediverseProject.Akkoma, pleromaSettings],
|
.set(FediverseProject.Hometown, mastodonSettings)
|
||||||
[FediverseProject.Mastodon, mastodonSettings],
|
.set(FediverseProject.Mastodon, mastodonSettings)
|
||||||
[FediverseProject.Hometown, mastodonSettings],
|
.set(FediverseProject.Misskey, misskeySettings)
|
||||||
[
|
.set(FediverseProject.Akkoma, pleromaSettings)
|
||||||
FediverseProject.GNUSocial,
|
.set(FediverseProject.Pleroma, pleromaSettings)
|
||||||
{
|
.set(FediverseProject.GNUSocial, {
|
||||||
publishEndpoint: "/notice/new",
|
publishEndpoint: "/notice/new",
|
||||||
params: {
|
params: {
|
||||||
text: "status_textarea",
|
text: "status_textarea",
|
||||||
},
|
|
||||||
},
|
},
|
||||||
],
|
})
|
||||||
[FediverseProject.Pleroma, pleromaSettings],
|
.set(FediverseProject.Friendica, {
|
||||||
[
|
publishEndpoint: "compose",
|
||||||
FediverseProject.Friendica,
|
params: {
|
||||||
{
|
text: "body",
|
||||||
publishEndpoint: "compose",
|
|
||||||
params: {
|
|
||||||
text: "body",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
],
|
})
|
||||||
[
|
.set(FediverseProject.Hubzilla, {
|
||||||
FediverseProject.Hubzilla,
|
publishEndpoint: "rpost",
|
||||||
{
|
params: {
|
||||||
publishEndpoint: "rpost",
|
text: "body",
|
||||||
params: {
|
|
||||||
text: "body",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
],
|
});
|
||||||
[
|
|
||||||
FediverseProject.Misskey,
|
|
||||||
{
|
|
||||||
publishEndpoint: "share",
|
|
||||||
params: {
|
|
||||||
text: "text",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
]);
|
|
||||||
|
|
||||||
interface NodeInfoList {
|
interface NodeInfoList {
|
||||||
links: {
|
links: {
|
||||||
|
|
Reference in a new issue