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

A reviewer identity as the reviewer server resolved it.

Type:
  • Object
Properties:
Name Type Attributes 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.

profile Profile <nullable>

The current profile, or null before the identity's first profile.

Source:

Issuer

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

Number of reviews written by this issuer.

credibility number <optional>

Credibility of the reviewer from 0 to 1, from how close their ratings come to those of other reviewers and from the ratings of their reviews.

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.

language string <optional>

Language of the opinion, as a BCP 47 tag such as en or pt-BR.

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 the Mangrove Review Standard allows, see https://open-reviews.net/standard#mangrove-core-metadata-field-standards-macomes. An omitted license means "CC-BY-4.0".

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. 'profile' publishes the reviewer details of the DID given as the subject, in the metadata, with no rating, opinion or images.

iat number <optional>

Unix timestamp of when review was issued, gets filled in automatically if not provided. A given value stays, and may lie at most an hour in the future.

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 description of an image of at most 50 characters, shown as its alt text.

metadata Metadata <optional>

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

Source:

Profile

The latest profile an identity published.

Type:
  • Object
Properties:
Name Type Description
details ProfileDetails

The reviewer details.

iat number

Unix time of the profile.

Source:

ProfileDetails

The reviewer details of a profile.

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

Nickname of the reviewer.

given_name string <optional>

Given name of the reviewer.

family_name string <optional>

Family name of the reviewer.

gender string <optional>

Gender of the reviewer.

birthdate string <optional>

Birth year of the reviewer, four digits. The profile is public, and so is the birth year in it.

picture string <optional>

The https URL of an image of the reviewer, such as a file uploaded to the Mangrove file hoster.

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.

mapcomplete string <nullable>

What the person chose for their MapComplete key on a first OpenStreetMap login: linked, revoked, separate or failed. The signer sets it only when it offered the choice.

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.

rating number | null

Rating of the subject on the 0 to 100 scale of a review's rating, weighted by the credibility of each reviewer. Null until the aggregation scores the subject.

quality number | null

Deprecated: the rating times 100, unrounded, from 0 to 10000. Use rating.

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: