Stores and updates WebID to Account links.

interface WebIdStore {
    create: ((webId: string, accountId: string) => Promise<string>);
    delete: ((linkId: string) => Promise<void>);
    findLinks: ((accountId: string) => Promise<{
        id: string;
        webId: string;
    }[]>);
    get: ((linkId: string) => Promise<undefined | {
        accountId: string;
        webId: string;
    }>);
    isLinked: ((webId: string, accountId: string) => Promise<boolean>);
}

Implemented by

Properties

create: ((webId: string, accountId: string) => Promise<string>)

Creates a new WebID link for the given WebID and account.

Type declaration

    • (webId, accountId): Promise<string>
    • Parameters

      • webId: string

        WebID to link.

      • accountId: string

      Returns Promise<string>

      ID of the link.

delete: ((linkId: string) => Promise<void>)

Deletes the link with the given ID

Type declaration

    • (linkId): Promise<void>
    • Parameters

      • linkId: string

        ID of the link.

      Returns Promise<void>

findLinks: ((accountId: string) => Promise<{
    id: string;
    webId: string;
}[]>)

Finds all links associated with the given account.

Type declaration

    • (accountId): Promise<{
          id: string;
          webId: string;
      }[]>
    • Parameters

      • accountId: string

        ID of the account.

      Returns Promise<{
          id: string;
          webId: string;
      }[]>

get: ((linkId: string) => Promise<undefined | {
    accountId: string;
    webId: string;
}>)

Finds the account and WebID of the link with the given ID.

isLinked: ((webId: string, accountId: string) => Promise<boolean>)

Determines if a WebID is linked to an account.

Type declaration

    • (webId, accountId): Promise<boolean>
    • Parameters

      • webId: string

        WebID to check.

      • accountId: string

        ID of the account.

      Returns Promise<boolean>