BookmarkFactory class that provides factory methods for creating and managing Bookmark instances.

Constructors

Properties

containerUrls: string[] = []
instance: BookmarkFactory

Methods

  • Creates a new Bookmark instance with the given payload. Generates a UUID for the id, sets the url to the first configured containerUrl + id, and saves the new Bookmark instance.

    Parameters

    Returns Promise<undefined | Bookmark>

    The saved Bookmark instance .

  • Retrieves a Bookmark instance by its url.

    Parameters

    • url: string

      The url of the Bookmark to retrieve.

    Returns Promise<undefined | Bookmark>

    The Bookmark instance if found, otherwise throws error.

  • Retrieves all Bookmark instances from the configured containerUrls and instancesUrls.

    Makes a request to each configured containerUrl and instancesUrl to get all Bookmark instances. Combines and flattens the results into a single array.

    Returns the array of Bookmark instances.

    Returns Promise<(Bookmark & SolidModel)[]>

  • Removes a Bookmark instance identified by its url.

    Parameters

    • url: string

      The url of the Bookmark to remove.

    Returns Promise<undefined | Bookmark>

    A Promise resolving to the deleted Bookmark instance if successful, otherwise undefined.

  • Updates an existing Bookmark instance identified by its url.

    Parameters

    • url: string

      The url of the Bookmark to update.

    • payload: IBookmark

      The data to update the Bookmark with.

    Returns Promise<undefined | Bookmark>

    The updated Bookmark instance if successful, otherwise undefined.

  • Gets an instance of the BookmarkFactory class, which provides methods for creating and managing Bookmark instances.

    Checks if an instance already exists and returns it. If not, it creates a new instance by:

    Parameters

    • Optional args: GetInstanceArgs
    • Optional defaultContainerUrl: string

      The default container url to use if none exist.

    Returns Promise<BookmarkFactory>

    a Promise resolving to the BookmarkFactory instance.

Generated using TypeDoc