Commit a0b77c1b authored by Grant's avatar Grant
Browse files

add capabilities

parent 1675d307
Loading
Loading
Loading
Loading
Loading
+26 −1
Original line number Diff line number Diff line
export const PROVIDERS: IProvider[] = [
  {
    software: "mastodon",
    capabilities: ["SELF_POST"],
    matchers: [
      {
        versions: "*",
@@ -11,6 +12,7 @@ export const PROVIDERS: IProvider[] = [
  },
  {
    software: "iceshrimp",
    capabilities: ["SELF_POST"],
    matchers: [
      {
        versions: "*",
@@ -21,18 +23,20 @@ export const PROVIDERS: IProvider[] = [
  },
  {
    software: "lemmy",
    capabilities: ["COMMUNITY"],
    matchers: [
      {
        versions: "*",
        template: (host, uri) =>
          `https://${host}/search?q=${encodeURIComponent(
            uri
            uri,
          )}&type=All&listingType=All&page=1&sort=TopAll`,
      },
    ],
  },
  {
    software: "elk.zone",
    capabilities: ["SELF_POST"], // mastodon frontend
    matchers: [
      {
        host: /^elk.zone$/i,
@@ -42,6 +46,7 @@ export const PROVIDERS: IProvider[] = [
  },
  {
    software: "misskey",
    capabilities: ["SELF_POST"],
    matchers: [
      {
        versions: "*",
@@ -52,6 +57,7 @@ export const PROVIDERS: IProvider[] = [
  },
  {
    software: "sharkey",
    capabilities: ["SELF_POST"],
    matchers: [
      {
        versions: "*",
@@ -62,6 +68,7 @@ export const PROVIDERS: IProvider[] = [
  },
  {
    software: "peertube",
    capabilities: [],
    matchers: [
      {
        versions: "*",
@@ -72,8 +79,26 @@ export const PROVIDERS: IProvider[] = [
  },
];

/**
 * Current compatibility issues between softwares
 */
type ProviderCapability =
  /**
   * Posts that are posted by individuals
   *
   * As of Lemmy 0.19.19, users cannot make posts as their user to their profile
   */
  | "SELF_POST"
  /**
   * Communities that contain posts from many people
   *
   * As of Mastodon v4.7.0-nightly.2026-07-09, users cannot browse communities
   */
  | "COMMUNITY";

interface IProvider {
  software: string;
  capabilities: ProviderCapability[];
  matchers: (
    | {
        /**