A PodStore implementation using a PodManager to create pods and a AccountLoginStorage to store the data. Needs to be initialized before it can be used.

Adds the initial WebID as the owner of the pod. By default, this owner is not exposed through a link header. This can be changed by setting the constructor visible parameter to true.

Hierarchy (view full)

Implements

Constructors

Methods

  • Checks whether the input can be handled by this class. If it cannot handle the input, rejects with an error explaining why.

    Parameters

    • input: void

      Input that could potentially be handled.

    Returns Promise<void>

    A promise resolving if the input can be handled, rejecting with an Error if not.

  • Creates a new pod and updates the account accordingly.

    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.

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

    Parameters

    • baseUrl: string

      The pod base URL.

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

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

    Parameters

    • accountId: string

      Account ID to find pod resources for.

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

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

    Parameters

    • id: string

      ID of the pod.

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

  • Helper function that first runs canHandle followed by handle. Throws the error of canHandle if the data cannot be handled, or returns the result of handle otherwise.

    Parameters

    • input: void

      Input data that will be handled if it can be handled.

    Returns Promise<void>

    A promise resolving if the input can be handled, rejecting with an Error if not.

  • 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.

    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>