Skip to content

Relationship methods: update, delete

The Relationship Verbs update, delete as typed SDK methods, with inputs, result, refusals and an example.

Reference for Relationship, one group of Relationship methods.

Relationship.update

Changes the given properties of a Relationship. Verb page.

TypeScript
interface RelationshipVerbs {
  update(input: RelationshipUpdateInput, options?: SB.CallOptions): SB.Call<Relationship>
}

Emits Relationship.updated.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Relationship.
predicatestringThe name read from the source, such as makes.
inversestringThe name read from the target, such as madeBy.
provenancestringWho asserted it: Stated, Ratified, Inferred, or Observed.

Returns

OutputTypeRequiredDescription
relationshipRelationshiprequiredThe Relationship.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const relationship = await $.Relationship.update({ id: 'relationship_iUVcHztTJh', provenance: 'Stated' })

Relationship.delete

Deletes a Relationship: a soft delete that keeps its history, undone by Thing.restore. Verb page.

TypeScript
interface RelationshipVerbs {
  delete(input: RelationshipDeleteInput, options?: SB.CallOptions): SB.Call<Relationship>
}

Emits Relationship.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Relationship.

Returns

OutputTypeRequiredDescription
relationshipRelationshiprequiredThe Relationship.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const relationship = await $.Relationship.delete({ id: 'relationship_iUVcHztTJh' })