@inrupt/solid-client / acp/acp

Module: acp/acp

Table of contents

Type aliases

Functions

Type aliases

WithAccessibleAcr

Ƭ WithAccessibleAcr: WithAcp & { internal_acp: { acr: Exclude<WithAcp[internal_acp][acr], null> } }

Resources that conform to this type have an Access Control Resource attached. See hasAccessibleAcr.

since 1.6.0

Defined in: src/acp/acp.ts:298


WithAcp

Ƭ WithAcp: object

The Access Control Resource of Resources that conform to this type were attempted to be fetched together with those Resources. This might not have been successful; see hasAccessibleAcr to check.

since 1.6.0

Type declaration:

Name

Type

internal_acp

object

internal_acp.acr

AccessControlResource | null

Defined in: src/acp/acp.ts:289

Functions

getFileWithAccessDatasets

getFileWithAccessDatasets(url: Url | UrlString, options?: Partial<typeof internal_defaultFetchOptions>): Promise<File & WithAcp | WithAcl>

Note

The Web Access Control specification is not yet finalised. As such, this function is still experimental and subject to change, even in a non-major release.

Fetch a File, and:

  • if the Resource is governed by an ACR: its associated Access Control Resource (if available to the current user), and all the Access Control Policies referred to therein, if available to the current user.

  • if the Resource is governed by an ACL: its associated Resource ACL (if available to the current user), or its Fallback ACL if it does not exist.

since 1.6.0

Parameters:

Name

Type

Description

url

Url | UrlString

URL of the File to fetch.

options

Partial<typeof internal_defaultFetchOptions>

Optional parameter options.fetch: An alternative fetch function to make the HTTP request, compatible with the browser-native fetch API.

Returns: Promise<File & WithAcp | WithAcl>

A File and either the ACL access data or the ACR access data, if available to the current user.

Defined in: src/acp/acp.ts:196


getFileWithAcr

getFileWithAcr(url: Url | UrlString, options?: Partial<typeof internal_defaultFetchOptions>): Promise<File & WithAcp>

Note

The Web Access Control specification is not yet finalised. As such, this function is still experimental and subject to change, even in a non-major release.

Fetch a file and its associated Access Control Resource (if available to the current user).

since 1.6.0

Parameters:

Name

Type

Description

url

Url | UrlString

URL of the file to fetch.

options

Partial<typeof internal_defaultFetchOptions>

Optional parameter options.fetch: An alternative fetch function to make the HTTP request, compatible with the browser-native fetch API.

Returns: Promise<File & WithAcp>

A file and the ACR that applies to it, if available to the authenticated user.

Defined in: src/acp/acp.ts:93


getReferencedPolicyUrlAll

getReferencedPolicyUrlAll(withAcr: WithAccessibleAcr): UrlString[]

Note

The Web Access Control specification is not yet finalised. As such, this function is still experimental and subject to change, even in a non-major release.

To make it easy to fetch all the relevant Access Policy Resources, this function returns all referenced Access Policy Resources referenced in an Access Control Resource. In other words, if Access Controls refer to different Policies in the same Access Policy Resource, this function will only return that Access Policy Resource’s URL once.

since 1.6.0

Parameters:

Name

Type

Description

withAcr

WithAccessibleAcr

A Resource with an Access Control Resource attached.

Returns: UrlString[]

List of all unique Access Policy Resources that are referenced in the given Access Control Resource.

Defined in: src/acp/acp.ts:377


getResourceInfoWithAccessDatasets

getResourceInfoWithAccessDatasets(url: Url | UrlString, options?: Partial<typeof internal_defaultFetchOptions>): Promise<WithServerResourceInfo & WithAcp | WithAcl>

Note

The Web Access Control specification is not yet finalised. As such, this function is still experimental and subject to change, even in a non-major release.

Fetch information about a Resource, and:

  • if the Resource is governed by an ACR: its associated Access Control Resource (if available to the current user), and all the Access Control Policies referred to therein, if available to the current user.

  • if the Resource is governed by an ACL: its associated Resource ACL (if available to the current user), or its Fallback ACL if it does not exist.

since 1.6.0

Parameters:

Name

Type

Description

url

Url | UrlString

URL of the Resource information about which to fetch.

options

Partial<typeof internal_defaultFetchOptions>

Optional parameter options.fetch: An alternative fetch function to make the HTTP request, compatible with the browser-native fetch API.

Returns: Promise<WithServerResourceInfo & WithAcp | WithAcl>

Information about a Resource and either the ACL access data or the ACR access data, if available to the current user.

Defined in: src/acp/acp.ts:235


getResourceInfoWithAcr

getResourceInfoWithAcr(url: Url | UrlString, options?: Partial<typeof internal_defaultFetchOptions>): Promise<WithServerResourceInfo & WithAcp>

Note

The Web Access Control specification is not yet finalised. As such, this function is still experimental and subject to change, even in a non-major release.

Retrieve information about a Resource and its associated Access Control Resource (if available to the current user), without fetching the Resource itself.

since 1.6.0

Parameters:

Name

Type

Description

url

Url | UrlString

URL of the Resource about which to fetch its information.

options

Partial<typeof internal_defaultFetchOptions>

Optional parameter options.fetch: An alternative fetch function to make the HTTP request, compatible with the browser-native fetch API.

Returns: Promise<WithServerResourceInfo & WithAcp>

Metadata describing a Resource, and the ACR that applies to it, if available to the authenticated user.

Defined in: src/acp/acp.ts:123


getSolidDatasetWithAccessDatasets

getSolidDatasetWithAccessDatasets(url: Url | UrlString, options?: Partial<typeof internal_defaultFetchOptions>): Promise<SolidDataset & WithAcp | WithAcl>

Note

The Web Access Control specification is not yet finalised. As such, this function is still experimental and subject to change, even in a non-major release.

Fetch a SolidDataset, and:

  • if the Resource is governed by an ACR: its associated Access Control Resource (if available to the current user), and all the Access Control Policies referred to therein, if available to the current user.

  • if the Resource is governed by an ACL: its associated Resource ACL (if available to the current user), or its Fallback ACL if it does not exist.

since 1.6.0

Parameters:

Name

Type

Description

url

Url | UrlString

URL of the SolidDataset to fetch.

options

Partial<typeof internal_defaultFetchOptions>

Optional parameter options.fetch: An alternative fetch function to make the HTTP request, compatible with the browser-native fetch API.

Returns: Promise<SolidDataset & WithAcp | WithAcl>

A SolidDataset and either the ACL access data or the ACR access data, if available to the current user.

Defined in: src/acp/acp.ts:157


getSolidDatasetWithAcr

getSolidDatasetWithAcr(url: Url | UrlString, options?: Partial<typeof internal_defaultFetchOptions>): Promise<SolidDataset & WithServerResourceInfo & WithAcp>

Note

The Web Access Control specification is not yet finalised. As such, this function is still experimental and subject to change, even in a non-major release.

Fetch a SolidDataset and its associated Access Control Resource (if available to the current user).

since 1.6.0

Parameters:

Name

Type

Description

url

Url | UrlString

URL of the SolidDataset to fetch.

options

Partial<typeof internal_defaultFetchOptions>

Optional parameter options.fetch: An alternative fetch function to make the HTTP request, compatible with the browser-native fetch API.

Returns: Promise<SolidDataset & WithServerResourceInfo & WithAcp>

A SolidDataset and the ACR that applies to it, if available to the authenticated user.

Defined in: src/acp/acp.ts:64


hasAccessibleAcr

hasAccessibleAcr(resource: WithAcp): resource is WithAccessibleAcr

since 1.6.0

Parameters:

Name

Type

Description

resource

WithAcp

Resource of which to check whether it has an Access Control Resource attached.

Returns: resource is WithAccessibleAcr

Boolean representing whether the given Resource has an Access Control Resource attached for use in e.g. getPolicyUrlAll.

Defined in: src/acp/acp.ts:309


saveAcrFor

saveAcrFor<ResourceExt>(resource: ResourceExt, options?: Partial<typeof internal_defaultFetchOptions>): Promise<ResourceExt>

Note

The Web Access Control specification is not yet finalised. As such, this function is still experimental and subject to change, even in a non-major release.

Save a Resource’s Access Control Resource.

since 1.6.0

Type parameters:

Name

Type

ResourceExt

WithAccessibleAcr

Parameters:

Name

Type

Description

resource

ResourceExt

Resource with an Access Control Resource that should be saved.

options

Partial<typeof internal_defaultFetchOptions>

Optional parameter options.fetch: An alternative fetch function to make the HTTP request, compatible with the browser-native fetch API.

Returns: Promise<ResourceExt>

Defined in: src/acp/acp.ts:268