@inrupt/solid-client-access-grants / resource
Module: resource#
Functions#
getFile#
▸ getFile(resourceUrl
, accessGrant
, options?
): Promise
<Blob
& WithResourceInfo
& {}>
Retrieve a File from a Solid Pod using an Access Grant to prove the caller is authorized to access the target resource.
See
@inrupt/solid-client’s getFile
Since
0.4.0
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The URL of the target resource. |
|
|
The Access Grant VC proving the caller is authorized. |
|
Optional properties to customise the request behaviour. |
Returns#
Promise
<Blob
& WithResourceInfo
& {}>
A promise that resolves to a File if successful, and that rejects otherwise.
Defined in#
getSolidDataset#
▸ getSolidDataset(datasetUrl
, accessGrant
, options?
): Promise
<Readonly
<{}> & WithResourceInfo
& {}>
Retrieve a Dataset from a Solid Pod using an Access Grant to prove the caller is authorized to access the target dataset.
See
@inrupt/solid-client’s getSolidDataset
Since
0.4.0
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The URL of the target dataset. |
|
|
The Access Grant VC proving the caller is authorized. |
|
Optional properties to customise the request behaviour. |
Returns#
Promise
<Readonly
<{}> & WithResourceInfo
& {}>
A promise that resolves to a SolidDataset if successful, and that rejects otherwise.
Defined in#
overwriteFile#
▸ overwriteFile(resourceUrl
, file
, accessGrant
, options?
): Promise
<Object
>
Overwrites the file using an Access Grant to prove the caller is authorized to write to the given resource URL.
Note
This function does not support saving a file if the file does not
yet exist, unlike its @inrupt/solid-client
counterpart. To save a new file
in a container, you should use saveFileInContainer
instead.
See
@inrupt/solid-client’s overwriteFile
Since
1.1.0
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The URL where the file is located. |
|
|
The file to be written. |
|
|
The Access Grant VC proving the caller is authorized. |
|
|
Optional properties to customise the request behaviour, or override the Content-Type of the file. |
Returns#
Promise
<Object
>
A promise that resolves to a File if successful, and that rejects otherwise.
Defined in#
saveFileInContainer#
▸ saveFileInContainer(containerUrl
, file
, accessGrant
, options?
): Promise
<Object
>
Saves a file in the given container URL using an Access Grant to prove the caller is authorized to save a file in the given container.
See
@inrupt/solid-client’s saveFileInContainer
Since
1.1.0
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The container URL where the file is to be saved. |
|
|
The file to be written. |
|
|
The Access Grant VC proving the caller is authorized. |
|
|
Optional properties to customise the request behaviour, or override the Content-Type of the file. |
Returns#
Promise
<Object
>
A promise that resolves to a File if successful, and that rejects otherwise.
Defined in#
saveSolidDatasetAt#
▸ saveSolidDatasetAt<Dataset
>(datasetUrl
, solidDataset
, accessGrant
, options?
): Promise
<Dataset
& WithResourceInfo
& {} & Readonly
<{}> & {}>
Saves a Dataset in a Solid Pod using an Access Grant to prove the caller is authorized to write or append to the dataset at the given dataset URL.
Note
This function does not support saving a dataset if the
dataset does not yet exist, unlike its @inrupt/solid-client
counterpart.
See
@inrupt/solid-client’s saveSolidDatasetAt
Since
0.4.0
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The URL of the dataset to save. |
|
|
- |
|
|
The Access Grant VC proving the caller is authorized. |
|
Optional properties to customise the request behaviour. |
Returns#
Promise
<Dataset
& WithResourceInfo
& {} & Readonly
<{}> & {}>
A promise that resolves to a SolidDataset if successful, and that rejects otherwise.