Module: mangrove-types

Types for Mangrove Reviews

Source:

Type Definitions

BatchReturn

Type:
  • Object
Properties:
Name Type Attributes Description
issuers Object.<string, Issuer> | null <optional>

Map of issuer public keys to issuer information.

subjects Object.<string, Subject> | null <optional>

Map of subject identifiers to subject information.

Source:

FediverseHandle

Fediverse account of a subject or reviewer.

Type:
  • Object
Properties:
Name Type Description
handle string

Local part of the account.

acct string

Full account, @handle@domain, to display with a copy button.

actor string

Actor URL, for followUrl.

name string

Display name of the account.

Source:

Identity

The reviewer's identity as the signer holds it.

Type:
  • Object
Properties:
Name Type Attributes Description
reviewer_id string

The reviewer's id at the signer.

did string <nullable>

The identity.

recovery_key string <nullable>

The recovery key as did:key, when set.

Source:

Identity

A reviewer identity as the reviewer server resolved it.

Type:
  • Object
Properties:
Name Type Description
did string

The identity.

document Object

The DID document.

aliases Array.<string>

The alsoKnownAs entries the server verified.

source string

Where the document came from: registry, directory or web.

Source:

IdentityAliases

The aliases an identity document lists.

Type:
  • Object
Properties:
Name Type Description
did string

The identity.

aliases Array.<string>

The alsoKnownAs entries after the change.

Source:

IdentityKeys

The keys an identity document lists.

Type:
  • Object
Properties:
Name Type Description
did string

The identity.

keys Object.<string, string>

Verification methods by name, as did:key; mangrove is the signer's key and mangrove-<n> a key the person added.

Source:

Issuer

Type:
  • Object
Properties:
Name Type Attributes Description
count number

Number of reviews written by this issuer.

credibility number <optional>

Credibility score for this reviewer based on review quality (0 to 1).

Source:

Keypair

WebCrypto keypair

Type:
  • Object
Properties:
Name Type Description
privateKey CryptoKey
publicKey CryptoKey
Source:

Metadata

Type:
  • Object
Properties:
Name Type Attributes Description
client_id string <optional>

The identity of the client used to leave the review. When it is not provided, the origin of the page the review is written on fills it.

nickname string <optional>

Nickname of the reviewer.

given_name string <optional>

User's given name.

family_name string <optional>

User's family name.

age number <optional>

User's age must be 200 or less.

gender string <optional>

User's gender.

experience_context string <optional>

Should be one of common contexts in which the reviewer primarly had experience with the subject: business, family, couple, friends, solo

is_personal_experience boolean <optional>

Please set this flag to true when the reviewer had direct experience with the subject of the review and is not based on a third party account.

is_affiliated boolean <optional>

Please set this flag to true when the review is left by an owner, employee, or other affiliated person.

is_generated boolean <optional>

Please set this flag to true when review was automatically generated by a bot.

data_source string <optional>

Please provide the source of the review if the review does not originate from the author.

openid string <optional>

OpenID identifier.

preferred_username string <optional>

User's preferred username.

birthdate string <optional>

User's birthdate.

reviewer_index number <optional>

Unique index used by the reviewer, usually indicating a ranking in a list. Must be a valid JavaScript safe integer (less than or equal to 9,007,199,254,740,991).

license string <optional>

SPDX license identifier for the review content. Must be one of "CC-BY-4.0" or "CC-BY-SA-4.0". Defaults to "CC-BY-4.0" when not specified.

Source:

Payload

Type:
  • Object
Properties:
Name Type Attributes Description
sub string

URI of the review subject.

rating number <optional>

Rating of a subject between 0 and 100.

opinion string <optional>

Opinion of a subject with at most 500 characters.

action string <optional>

Action to perform. 'delete', 'edit' and 'report_abuse' act on an existing review, which the subfield references using the urn:maresi: scheme. 'equivalence' claims that the subject equals the URI given in the opinion. 'identity' binds the signing key to the DID given as the subject (did:plc or did:web), with no rating, opinion or images.

iat number <optional>

Unix timestamp of when review was issued, gets filled in automatically if not provided.

images Array.<Object> <optional>

Array of up to 5 images to be included.

images[].src string

Public URL of an image.

images[].label string <optional>

Optional label of an image.

metadata Metadata <optional>

Any Metadata relating to the issuer or circumstances of leaving review. See the Mangrove Review Standard for more.

Source:

Review

Type:
  • Object
Properties:
Name Type Description
signature string

JWT signature by the review issuer.

jwt string

Review in JWT format.

kid string

Public key of the reviewer in PEM format.

payload Payload

Primary content of the review.

Source:

Reviews

Type:
  • Object
Properties:
Name Type Attributes Description
reviews Array.<Review>

A list of reviews satisfying the query.

issuers Object.<string, Issuer> | null <optional>

A map from public keys to information about issuers.

maresi_subjects Object.<string, Subject> | null <optional>

A map from Review identifiers (urn:maresi:<signature>) to information about the reviews of that review.

Source:

Session

Session read from the signer callback URL.

Type:
  • Object
Properties:
Name Type Attributes Description
sessionToken string <nullable>

Token for signing calls; null when the login failed.

reviewerId string <nullable>

The reviewer's id at the signer.

did string <nullable>

The reviewer's identity, the same on every login.

state string <nullable>

The value the app passed to loginUrl.

Source:

SignResponse

Answer of the signer to a signing call.

Type:
  • Object
Properties:
Name Type Attributes Description
jwt string

Signed review.

signature string

Identifies the review from now on.

reviewer_id string

The reviewer's id at the signer.

public_key string

PEM of the key the signer uses for the reviewer.

did string <optional>

The reviewer's identity.

Source:

Subject

Type:
  • Object
Properties:
Name Type Description
sub string

URI uniquely identifying the subject.

quality number | null

Aggregate number representing quality of the subject.

count number

Number of reviews given to this subject.

opinion_count number

Number of reviews which included an opinion.

positive_count number

Number of reviews with rating above 50 given to this subject.

confirmed_count number

Number of reviews with rating above 50 and is_personal_experience flag given to this subject.

Source: