Skip to main content
Version: Current

Data Types

  • RecordDataFailure

    Defines an interface that represents a failed "record data" result.

    Members

    • errorCode ("server_error" | "not_supported" | "invalid_record_key" | "unacceptable_request" | "record_not_found" | "not_authorized" | "action_not_supported" | "not_logged_in" | "subscription_limit_reached" | "data_too_large" | "invalid_update_policy" | "invalid_delete_policy")

      The error code for the failure.

    • errorMessage string

      The error message for the failure.

    • errorReason? ("data_too_large" | "data_not_allowed" | "too_many_items")

      The reason for the error.

    • issues? ZodIssue[]

      The issues with the request.

    • reason? DenialReason

      The reason why the request was denied authorization.

    • success false

  • RecordDataResult

    The possible results of a record data request.

    A RecordDataResult can be one of the following values:

  • RecordDataSuccess

    Defines an interface that represents a successful "record data" result.

    Members

    • address string

      The address that the data is stored at.

    • recordName string

      The name of the record that the data was recorded to.

    • success true

  • GetDataFailure

    Defines an interface that repeesents a failed "get data" result.

    Members

    • errorCode ("server_error" | "not_supported" | "invalid_record_key" | "unacceptable_request" | "record_not_found" | "not_authorized" | "action_not_supported" | "not_logged_in" | "subscription_limit_reached" | "data_not_found")

      The error code for the failure.

    • errorMessage string

      The error message for the failure.

    • success false

  • GetDataResult

    The possible results of a get data request.

    A GetDataResult can be one of the following values:

  • GetDataSuccess

    Defines an interface that represents a successful "get data" result.

    Members

    • data any

      The data that was stored.

    • deletePolicy UserPolicy

      The delete policy that the data uses.

    • markers string[]

      The list of markers that have been applied to the data.

    • publisherId string

      The ID of the user that owns the record.

    • recordName string

      The name of the record.

    • subjectId string

      The ID of the user that sent the data.

    • success true

    • updatePolicy UserPolicy

      The update policy that the data uses.

  • EraseDataFailure

    Defines an interface that represents a failed result for an erase data request.

    Members

    • errorCode ("server_error" | "invalid_record_key" | "unacceptable_request" | "record_not_found" | "not_authorized" | "action_not_supported" | "not_logged_in" | "subscription_limit_reached" | "data_not_found")

      The error code for the failure.

    • errorMessage string

      The error message for the failure.

    • success false

  • EraseDataResult

    The possible results of an erase data request.

    A EraseDataResult can be one of the following values:

  • EraseDataSuccess

    Defines an interface that represents a successful result for an erase data request.

    Members

    • address string

      The address of the data that was erased.

    • recordName string

      The name of the record that the data was erased from.

    • success true

  • ListDataFailure

    Defines an interface that represents a failed result for a list data request.

    Members

    • errorCode ("server_error" | "not_supported" | "invalid_record_key" | "unacceptable_request" | "record_not_found" | "not_authorized" | "action_not_supported" | "not_logged_in" | "subscription_limit_reached")

    • errorMessage string

    • success false

  • ListDataResult

    The possible results of a list data request.

    A ListDataResult can be one of the following values:

  • ListDataSuccess

    Defines an interface that represents a successful result for a list data request.

    Members

    • items ListedData[]

      The items that were listed.

    • marker? string

      The marker that was listed. If null, then all markers are listed.

    • recordName string

      The name of the record that the data was listed from.

    • success true

    • totalCount number

      The total number of items in the record.

  • ListedData

    Defines an interface that represents a single item in a list data result.

    Members

    • address string

      The address that the data is stored at.

    • data any

      The data contained in the item.

    • markers string[]

      The markers that have been applied to the data.

  • DataRecordOptions

    The options for data record actions.

    Members

    • deletePolicy? RecordUserPolicyType

      The policy that should be used for deleting the record.

    • endpoint? string

      The HTTP endpoint that the request should interface with.

    • marker? string

      The marker that should be applied to the record.

    • markers? string[]

      The markers that should be applied to the record.

    • updatePolicy? RecordUserPolicyType

      The policy that should be used for updating the record.

  • ListDataOptions

    Defines an interface that represents the options for a list data action.

    Members

    • endpoint? string

      The HTTP endpoint that the request should interface with.

    • sort? ("ascending" | "descending")

      The order that items should be sorted in.

      • "ascending" means that the items should be sorted in alphebatically ascending order by address.
      • "descending" means that the items should be sorted in alphebatically descending order by address.
  • UserPolicy

    Defines a type that represents a policy that indicates which users are allowed to affect a record.

    True indicates that any user can edit the record. An array of strings indicates the list of users that are allowed to edit the record.

    A UserPolicy can be one of the following values:

    • true
    • string[]
    • null