Skip to content

Thing methods: share, unrelate

The Thing Verbs share, unrelate as typed SDK methods, with inputs, result, refusals and an example.

Reference for Thing, one group of Thing methods.

Thing.share

Share grants a person, a Role or a guest Verbs on one record and everything it contains. Verb page.

TypeScript
interface ThingVerbs {
  share(input: ThingShareInput, options?: SB.CallOptions): SB.Call<ThingShareOutput>
}

Emits Thing.shared.

Inputs

InputTypeRequiredDescription
thingThingrequiredThe record to share.
toPartyrequiredWho receives the grant: a person, or a guest who fills only the guest Role.
verbsstring[]requiredThe Verbs granted, such as get and comment.

Returns

OutputTypeRequiredDescription
permissionPermissionrequiredThe grant, scoped to the record and its contents.
thingThingrequiredThe Thing shared.

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 { permission, thing } = await $.Thing.share({ thing: 'thing_8ds0r9vvRl', to: 'party_hmQWaPrAyZ', verbs: ['Example verbs'] })

Thing.unrelate

Unrelate ends a Relationship between two Things; the link stays in history and reads back at any earlier moment. Verb page.

TypeScript
interface ThingVerbs {
  unrelate(input: ThingUnrelateInput, options?: SB.CallOptions): SB.Call<ThingUnrelateOutput>
}

Emits Thing.unrelated.

Inputs

InputTypeRequiredDescription
thingThingrequiredThe source Thing.
predicatestringrequiredThe Relationship as read from the source.
toThingrequiredThe target Thing.

Returns

OutputTypeRequiredDescription
relationshipRelationshiprequiredThe ended Relationship.
thingThingrequiredThe Thing the Relationship started from.

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, thing } = await $.Thing.unrelate({ thing: 'thing_8ds0r9vvRl', predicate: 'Example predicate', to: 'thing_8ds0r9vvRl' })