Skip to main content

Interface: IAuditableItemGraphComponent

Interface describing an auditable item graph contract.

Extends

  • IComponent

Methods

create()

create(vertex): Promise<string>

Create a new graph vertex.

Parameters

vertex

Omit<IAuditableItemGraphVertex, "id">

The vertex to create.

Returns

Promise<string>

The id of the new graph item.


update()

update(vertex): Promise<void>

Update a graph vertex.

Parameters

vertex

IAuditableItemGraphVertex

The vertex to update.

Returns

Promise<void>

Nothing.


get()

get(id, options?): Promise<IAuditableItemGraphVertex>

Get a graph vertex.

Parameters

id

string

The id of the vertex to get.

options?

Additional options for the get operation.

includeDeleted?

boolean

Whether to include deleted aliases, resource, edges, defaults to false.

verifySignatureDepth?

VerifyDepth

How many signatures to verify, defaults to "none".

Returns

Promise<IAuditableItemGraphVertex>

The vertex if found.

Throws

NotFoundError if the vertex is not found.


getChangesets()

getChangesets(id, cursor?, limit?, options?): Promise<{ changesets: IAuditableItemGraphChangesetList; cursor?: string; }>

Get a graph vertex changeset list.

Parameters

id

string

The id of the vertex to get.

cursor?

string

The optional cursor to get next chunk.

limit?

number

Limit the number of entities to return.

options?

Additional options for the get operation.

verifySignatureDepth?

VerifyDepth

How many signatures to verify, defaults to "none".

Returns

Promise<{ changesets: IAuditableItemGraphChangesetList; cursor?: string; }>

The changeset if found.

Throws

NotFoundError if the vertex is not found.


getChangeset()

getChangeset(id, options?): Promise<IAuditableItemGraphChangeset>

Get a graph vertex changeset.

Parameters

id

string

The id of the vertex to get.

options?

Additional options for the get operation.

verifySignatureDepth?

VerifyDepth

How many signatures to verify, defaults to "none".

Returns

Promise<IAuditableItemGraphChangeset>

The changeset if found.

Throws

NotFoundError if the vertex or changeset is not found.


removeVerifiable()

removeVerifiable(id): Promise<void>

Remove the verifiable storage for an item.

Parameters

id

string

The id of the vertex to remove the storage from.

Returns

Promise<void>

Nothing.

Throws

NotFoundError if the vertex is not found.


query()

query(options?, conditions?, orderBy?, orderByDirection?, properties?, cursor?, limit?): Promise<{ entries: IAuditableItemGraphVertexList; cursor?: string; }>

Query the graph for vertices.

Parameters

options?

The query options.

id?

string

The optional id to look for.

idMode?

"id" | "alias" | "both"

Look in id, alias or both, defaults to both.

idExact?

boolean

Find only exact matches, default to false meaning partial matching.

resourceTypes?

string[]

Include vertices with specific resource types.

conditions?

IComparator[]

Conditions to use in the query.

orderBy?

"dateCreated" | "dateModified"

The order for the results, defaults to dateCreated.

orderByDirection?

SortDirection

The direction for the order, defaults to descending.

properties?

keyof IAuditableItemGraphVertex[]

The properties to return, if not provided defaults to id, dateCreated, aliases and object.

cursor?

string

The cursor to request the next chunk of entities.

limit?

number

Limit the number of entities to return.

Returns

Promise<{ entries: IAuditableItemGraphVertexList; cursor?: string; }>

The entities, which can be partial if a limited keys list was provided.