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:

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 gets populated if not provided.

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.

issuer_index number <optional>

Index related to the issuer, must be a valid JavaScript safe integer (less than or equal to 9,007,199,254,740,991).

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 on an existing review. Must be one of 'delete', 'edit', or 'report_abuse'. When present, the subfield must reference an existing review using the urn:maresi: scheme.

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:

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: