0.1.2 • Published 6 years ago

tripledoc-solid-helpers v0.1.2

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
6 years ago

tripledoc-solid-helpers

TODO

Installation

npm install tripledoc solid-auth-client tripledoc-solid-helpers

Usage

// TODO

Changelog

See CHANGELOG.

License

MIT © Inrupt

#API

Index

Functions

Functions

fetchCurrentUser

fetchCurrentUser(): Promise‹null | TripleSubject›

Fetch information about the current user.

Returns: Promise‹null | TripleSubject›

A TripleSubject that can be queried for details about the user, or null if the user is not logged in.


fetchDocumentForClass

fetchDocumentForClass(rdfClass: NodeRef): Promise‹TripleDocument | null›

Fetch a Document in which Subjects of a certain type are stored.

If a Document is listed in the user's Public Type Index for the given class, this function will fetch that Document. If it does not exist yet, it will initialise a new one, add it to the Public Type Index, and return the newly initialised Document.

Parameters:

NameTypeDescription
rdfClassNodeRefThe type of Subjects stored in this Document.

Returns: Promise‹TripleDocument | null›

The created Document, or null if the Document could not be found or initialised.


fetchPublicTypeIndex

fetchPublicTypeIndex(): Promise‹null | TripleDocument›

Fetch the current user's Public Type Index.

Returns: Promise‹null | TripleDocument›

A TripleDocument that can be queried for invidiual type registrations, or null if the user is not logged in or has no references to such a Document.


fetchUser

fetchUser(webId: string): Promise‹TripleSubject›

Fetch information about a given user.

Parameters:

NameTypeDescription
webIdstringWebID of the user to fetch

Returns: Promise‹TripleSubject›

A TripleSubject that can be queried for details about the user.