···
+
export type AppUrl = `${string}.${string}` | `localhost:${number}`;
+
type AppUrlObject = Record<AppUrl, App>;
+
type AppHandleLinkObject = Record<App, (url: string[]) => string>;
+
export const appList: AppUrlObject = {
+
"localhost:19006": App.Bluesky,
+
"blacksky.community": App.Bluesky,
+
"bsky.app": App.Bluesky,
+
"catsky.social": App.Bluesky,
+
"deer.aylac.top": App.Bluesky,
+
"deer-social-ayla.pages.dev": App.Bluesky,
+
"deer.social": App.Bluesky,
+
"main.bsky.dev": App.Bluesky,
+
"social.daniela.lol": App.Bluesky,
+
"tangled.org": App.Tangled,
+
"whtwnd.com": App.Whitewind,
+
"frontpage.fyi": App.Frontpage,
+
"pinksea.art": App.Pinksea,
+
"linkat.blue": App.Linkat,
+
export const appHandleLink: AppHandleLinkObject = {
+
[App.Bluesky]: (path) => {
+
const baseType = path[0];
+
if (baseType === "profile") {
+
return `at://${user}/app.bsky.feed.post/${rkey}`;
+
} else if (type === "list") {
+
return `at://${user}/app.bsky.graph.list/${rkey}`;
+
} else if (type === "feed") {
+
return `at://${user}/app.bsky.feed.generator/${rkey}`;
+
} else if (type === "follows") {
+
return `at://${user}/app.bsky.graph.follow/${rkey}`;
+
} else if (baseType === "starter-pack") {
+
return `at://${user}/app.bsky.graph.starterpack/${path[2]}`;
+
[App.Tangled]: (path) => {
+
if (path[0] === "strings") {
+
return `at://${path[1]}/sh.tangled.string/${path[2]}`;
+
let query: string | undefined;
+
if (path[path.length - 1].includes("?")) {
+
const split = path[path.length - 1].split("?");
+
path[path.length - 1] = split[0];
+
const user = path[0].replace("@", "");
+
if (path.length === 1) {
+
if (query === "tab=repos") {
+
return `at://${user}/sh.tangled.repo`;
+
} else if (query === "tab=starred") {
+
return `at://${user}/sh.tangled.feed.star`;
+
} else if (query === "tab=strings") {
+
return `at://${user}/sh.tangled.string`;
+
} else if (path.length === 2) {
+
// no way to convert the repo name to an rkey afaik
+
// same reason why there's nothing related to issues in here
+
return `at://${user}/sh.tangled.repo`;
+
[App.Whitewind]: (path) => {
+
if (path.length === 2) {
+
return `at://${path[0]}/com.whtwnd.blog.entry/${path[1]}`;
+
return `at://${path[0]}/com.whtwnd.blog.entry`;
+
[App.Frontpage]: (path) => {
+
if (path.length === 3) {
+
return `at://${path[1]}/fyi.unravel.frontpage.post/${path[2]}`;
+
} else if (path.length === 5) {
+
return `at://${path[3]}/fyi.unravel.frontpage.comment/${path[4]}`;
+
return `at://${path[0]}`;
+
[App.Pinksea]: (path) => {
+
if (path.length === 2) {
+
return `at://${path[0]}/com.shinolabs.pinksea.oekaki/${path[1]}`;
+
return `at://${path[0]}`;
+
[App.Linkat]: (path) => `at://${path[0]}/blue.linkat.board/self`,