@pod-os/core / PodOS
Class: PodOS
Defined in: src/index.ts:48
Constructors
Constructor
new PodOS(
__namedParameters?):PodOS
Defined in: src/index.ts:60
Parameters
__namedParameters?
PodOsConfiguration = {}
Returns
PodOS
Properties
store
readonlystore:Store
Defined in: src/index.ts:50
uriService
readonlyuriService:UriService
Defined in: src/index.ts:51
Methods
addNewThing()
addNewThing(
uri,name,type?):Promise\<void>
Defined in: src/index.ts:176
Parameters
uri
string
name
string
type?
string
Returns
Promise\<void>
addPropertyValue()
addPropertyValue(
thing,property,value):Promise\<void>
Defined in: src/index.ts:138
Adds a new value to the property of the given thing
Parameters
thing
property
string
value
string
Returns
Promise\<void>
addRelation()
addRelation(
thing,property,value):Promise\<void>
Defined in: src/index.ts:168
Adds a new relation (link) from the thing to the given uri using the property
Parameters
thing
property
string
value
string
Returns
Promise\<void>
addToLabelIndex()
addToLabelIndex(
thing,labelIndex):Promise\<void>
Defined in: src/index.ts:233
Adds a label of the given thing to the label index, so that it can be found after the search index has been rebuilt
Parameters
thing
The thing to index
labelIndex
The index to update
Returns
Promise\<void>
attachments()
attachments():
AttachmentGateway
Defined in: src/index.ts:267
Provides access to attachment operations such as uploading and linking attachments to things
Returns
An instance of AttachmentGateway that handles attachment operations
Since
0.24.0
buildSearchIndex()
buildSearchIndex():
Promise\<SearchIndex>
Defined in: src/index.ts:207
Build the search index on demand.
While logged in, the index is built from the logged-in user's label indexes and cached, so repeated calls return the same instance.
While logged out, a fresh empty index is returned that is not cached.
Returns
Promise\<SearchIndex>
createDefaultLabelIndex()
createDefaultLabelIndex(
profile):Promise\<LabelIndex>
Defined in: src/index.ts:243
Creates a new label index document at a default location and links it to the user's profile or preferences document
Parameters
profile
The profile for that to create the index
Returns
Promise\<LabelIndex>
the newly created label index
editPropertyValue()
editPropertyValue(
thing,property,oldValue,newValue):Promise\<void>
Defined in: src/index.ts:153
Updates the value of the given property of the given thing to the new value
Parameters
thing
property
string
oldValue
string
newValue
string
Returns
Promise\<void>
fetch()
fetch(
uri):Promise\<void>
Defined in: src/index.ts:107
Parameters
uri
string
Returns
Promise\<void>
fetchAll()
fetchAll(
uris):Promise\<PromiseSettledResult\<void>[]>
Defined in: src/index.ts:111
Parameters
uris
string[]
Returns
Promise\<PromiseSettledResult\<void>[]>
~~fetchFile()~~
fetchFile(
url):Promise\<SolidFile>
Defined in: src/index.ts:120
Parameters
url
string
URL identifying the file
Returns
Promise\<SolidFile>
An object representing the fetched file
Deprecated
Use FileFetcher.fetchFile via PodOS.files instead
fetchProfile()
fetchProfile(
webId):Promise\<WebIdProfile>
Defined in: src/index.ts:195
Fetch the WebId profile and preferences file for the given WebID
Parameters
webId
string
Returns
Promise\<WebIdProfile>
files()
files():
FileFetcher
Defined in: src/index.ts:128
Provides access to file operations such as fetching and updating files in the pod
Returns
An instance of FileFetcher that handles file operations
listKnownTerms()
listKnownTerms():
Term[]
Defined in: src/index.ts:172
Returns
Term[]
loadModule()
loadModule\<
T>(moduleName):Promise\<T>
Defined in: src/index.ts:224
Dynamically loads a module by its name and returns an instance of the module
Type Parameters
T
T
Parameters
moduleName
string
Returns
Promise\<T>
login()
login(
oidcIssuer?):Promise\<void>
Defined in: src/index.ts:216
Parameters
oidcIssuer?
string = "http://localhost:3000"
Returns
Promise\<void>
logout()
logout():
Promise\<void>
Defined in: src/index.ts:211
Returns
Promise\<void>
observeSession()
observeSession():
BehaviorSubject\<SessionInfo>
Defined in: src/index.ts:187
returns a behavior subject that can be used to observe changes in the session state
Returns
BehaviorSubject\<SessionInfo>
proposeAppsFor()
proposeAppsFor(
thing):OpenWithApp[]
Defined in: src/index.ts:276
Propose matching apps to open a thing
Parameters
thing
The thing to open
Returns
An array of apps that can open the thing. The array is empty if no apps are found.
proposeUriForNewThing()
proposeUriForNewThing(
referenceUri,name):string
Defined in: src/index.ts:180
Parameters
referenceUri
string
name
string
Returns
string
uploadAndAddPicture()
uploadAndAddPicture(
thing,pictureFile):ResultAsync\<{url:string; },NetworkProblem|HttpProblem>
Defined in: src/index.ts:255
Uploads a picture file and associates it with a thing. The container is automatically derived from the thing's URI.
Parameters
thing
The thing to add the picture to
pictureFile
File
The picture file to upload
Returns
ResultAsync\<{ url: string; }, NetworkProblem | HttpProblem>
Result with the picture URL or error