Can be used to create new pods and find relevant information. Also keeps track of the owners of a pod. The visible parameter indicates if an owner should be publicly exposed or not.

interface PodStore {
    create: ((accountId: string, settings: PodSettings, overwrite: boolean) => Promise<string>);
    findByBaseUrl: ((baseUrl: string) => Promise<undefined | {
        accountId: string;
        id: string;
    }>);
    findPods: ((accountId: string) => Promise<{
        baseUrl: string;
        id: string;
    }[]>);
    get: ((id: string) => Promise<undefined | {
        accountId: string;
        baseUrl: string;
    }>);
    getOwners: ((id: string) => Promise<undefined | {
        visible: boolean;
        webId: string;
    }[]>);
    removeOwner: ((id: string, webId: string) => Promise<void>);
    updateOwner: ((id: string, webId: string, visible: boolean) => Promise<void>);
}

Implemented by

Properties

create: ((accountId: string, settings: PodSettings, overwrite: boolean) => Promise<string>)

Creates a new pod and updates the account accordingly.

Type declaration

    • (accountId, settings, overwrite): Promise<string>
    • Parameters

      • accountId: string

        Identifier of the account that is creating the account.

      • settings: PodSettings

        Settings to create a pod with.

      • overwrite: boolean

        If the pod is allowed to overwrite existing data.

      Returns Promise<string>

      The ID of the new pod resource.

findByBaseUrl: ((baseUrl: string) => Promise<undefined | {
    accountId: string;
    id: string;
}>)

Find the ID of the account that created the given pod.

Type declaration

    • (baseUrl): Promise<undefined | {
          accountId: string;
          id: string;
      }>
    • Parameters

      • baseUrl: string

        The pod base URL.

      Returns Promise<undefined | {
          accountId: string;
          id: string;
      }>

findPods: ((accountId: string) => Promise<{
    baseUrl: string;
    id: string;
}[]>)

Find all the pod resources created by the given account ID.

Type declaration

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

      • accountId: string

        Account ID to find pod resources for.

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

get: ((id: string) => Promise<undefined | {
    accountId: string;
    baseUrl: string;
}>)

Returns the baseURl and account that created the pod for the given pod ID.

Type declaration

    • (id): Promise<undefined | {
          accountId: string;
          baseUrl: string;
      }>
    • Parameters

      • id: string

        ID of the pod.

      Returns Promise<undefined | {
          accountId: string;
          baseUrl: string;
      }>

getOwners: ((id: string) => Promise<undefined | {
    visible: boolean;
    webId: string;
}[]>)

Find all owners for the given pod ID.

Type declaration

    • (id): Promise<undefined | {
          visible: boolean;
          webId: string;
      }[]>
    • Parameters

      • id: string

        ID of the pod.

      Returns Promise<undefined | {
          visible: boolean;
          webId: string;
      }[]>

removeOwner: ((id: string, webId: string) => Promise<void>)

Remove an owner from a pod. This should not remove the last owner as a pod always needs to have at least one owner. https://solidproject.org/TR/2022/protocol-20221231#server-storage-track-owner

Type declaration

    • (id, webId): Promise<void>
    • Parameters

      • id: string

        ID of the pod.

      • webId: string

        WebID of the owner.

      Returns Promise<void>

updateOwner: ((id: string, webId: string, visible: boolean) => Promise<void>)

Add or update an owner of a pod. In case there already is an owner with this WebID, it will be updated, otherwise a new owner will be added.

Type declaration

    • (id, webId, visible): Promise<void>
    • Parameters

      • id: string

        ID of the pod.

      • webId: string

        WebID of the owner.

      • visible: boolean

        Whether the owner wants to be exposed or not.

      Returns Promise<void>