Members
(constant) ORIGINAL_API
The API of the server used for https://mangrove.reviews
(constant) ORIGINAL_API
The API of the server used for https://mangrove.reviews
Methods
batchAggregate(query, apiopt) → {Promise.<(BatchReturn|null)>}
Retrieve aggregates for multiple subjects or issuers.
Parameters:
| Name | Type | Attributes | Default | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
query |
Object | Batch query listing identifiers to use for fetching. Properties
|
||||||||||||||
api |
string |
<optional> |
ORIGINAL_API | API endpoint used to fetch the data. |
Returns:
Batch aggregation data or null if no query params
- Type
- Promise.<(BatchReturn|null)>
batchAggregate(query, apiopt) → {Promise.<(BatchReturn|null)>}
Retrieve aggregates for multiple subjects or issuers.
Parameters:
| Name | Type | Attributes | Default | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
query |
Object | Batch query listing identifiers to use for fetching. Properties
|
||||||||||||||
api |
string |
<optional> |
ORIGINAL_API | API endpoint used to fetch the data. |
Returns:
Batch aggregation data or null if no query params
- Type
- Promise.<(BatchReturn|null)>
(async) deleteReview(keypair, reviewSignature, apiopt) → {Promise.<boolean>}
Delete an existing review.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
keypair |
Keypair | WebCrypto keypair must be the same keypair used for the original review. |
||
reviewSignature |
string | Signature of the review to delete. |
||
api |
string |
<optional> |
ORIGINAL_API | API endpoint used for the submission. |
Returns:
Result of the submission.
- Type
- Promise.<boolean>
(async) deleteReview(keypair, reviewSignature, apiopt) → {Promise.<boolean>}
Delete an existing review.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
keypair |
Keypair | WebCrypto keypair must be the same keypair used for the original review. |
||
reviewSignature |
string | Signature of the review to delete. |
||
api |
string |
<optional> |
ORIGINAL_API | API endpoint used for the submission. |
Returns:
Result of the submission.
- Type
- Promise.<boolean>
(async) editReview(keypair, reviewSignature, updates, apiopt) → {Promise.<boolean>}
Edit an existing review with updated content.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
keypair |
Keypair | WebCrypto keypair must be the same keypair used for the original review. |
||
reviewSignature |
string | Signature of the review to edit. |
||
updates |
Object | Object containing fields to update (rating, opinion, images, metadata). |
||
api |
string |
<optional> |
ORIGINAL_API | API endpoint used for the submission. |
Returns:
Result of the submission.
- Type
- Promise.<boolean>
(async) editReview(keypair, reviewSignature, updates, apiopt) → {Promise.<boolean>}
Edit an existing review with updated content.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
keypair |
Keypair | WebCrypto keypair must be the same keypair used for the original review. |
||
reviewSignature |
string | Signature of the review to edit. |
||
updates |
Object | Object containing fields to update (rating, opinion, images, metadata). |
||
api |
string |
<optional> |
ORIGINAL_API | API endpoint used for the submission. |
Returns:
Result of the submission.
- Type
- Promise.<boolean>
getIssuer(pem, apiopt) → {Promise.<Issuer>}
Get aggregate information about the reviewer.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
pem |
string | Reviewer public key in PEM format. |
||
api |
string |
<optional> |
ORIGINAL_API | API endpoint used to fetch the data. |
Returns:
Issuer data
- Type
- Promise.<Issuer>
getIssuer(pem, apiopt) → {Promise.<Issuer>}
Get aggregate information about the reviewer.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
pem |
string | Reviewer public key in PEM format. |
||
api |
string |
<optional> |
ORIGINAL_API | API endpoint used to fetch the data. |
Returns:
Issuer data
- Type
- Promise.<Issuer>
getReviews(query, apiopt) → {Promise.<Reviews>}
Retrieve reviews which fulfill the query.
Parameters:
| Name | Type | Attributes | Default | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
query |
Object | Query to be passed to API, see the API documentation for examples. Properties
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
api |
string |
<optional> |
ORIGINAL_API | API endpoint used to fetch the data. |
Returns:
Reviews data
- Type
- Promise.<Reviews>
getReviews(query, apiopt) → {Promise.<Reviews>}
Retrieve reviews which fulfill the query.
Parameters:
| Name | Type | Attributes | Default | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
query |
Object | Query to be passed to API, see the API documentation for examples. Properties
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
api |
string |
<optional> |
ORIGINAL_API | API endpoint used to fetch the data. |
Returns:
Reviews data
- Type
- Promise.<Reviews>
getSubject(uri, apiopt) → {Promise.<Subject>}
Get aggregate information about the review subject.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
uri |
string | URI of the review subject. |
||
api |
string |
<optional> |
ORIGINAL_API | API endpoint used to fetch the data. |
Returns:
Subject data
- Type
- Promise.<Subject>
getSubject(uri, apiopt) → {Promise.<Subject>}
Get aggregate information about the review subject.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
uri |
string | URI of the review subject. |
||
api |
string |
<optional> |
ORIGINAL_API | API endpoint used to fetch the data. |
Returns:
Subject data
- Type
- Promise.<Subject>
(async) rateReview(keypair, reviewSignature, rating, opinionopt, apiopt) → {Promise.<boolean>}
Rate an existing review.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
keypair |
Keypair | WebCrypto keypair can be any valid keypair. |
||
reviewSignature |
string | Signature of the review to rate. |
||
rating |
number | Rating value between 0 and 100. |
||
opinion |
string |
<optional> |
Optional opinion text about the review. |
|
api |
string |
<optional> |
ORIGINAL_API | API endpoint used for the submission. |
Returns:
Result of the submission.
- Type
- Promise.<boolean>
(async) rateReview(keypair, reviewSignature, rating, opinionopt, apiopt) → {Promise.<boolean>}
Rate an existing review.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
keypair |
Keypair | WebCrypto keypair can be any valid keypair. |
||
reviewSignature |
string | Signature of the review to rate. |
||
rating |
number | Rating value between 0 and 100. |
||
opinion |
string |
<optional> |
Optional opinion text about the review. |
|
api |
string |
<optional> |
ORIGINAL_API | API endpoint used for the submission. |
Returns:
Result of the submission.
- Type
- Promise.<boolean>
(async) reportAbuseReview(keypair, reviewSignature, reasonopt, apiopt) → {Promise.<boolean>}
Report abuse for an existing review.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
keypair |
Keypair | WebCrypto keypair can be any valid keypair. |
||
reviewSignature |
string | Signature of the review to report. |
||
reason |
string |
<optional> |
Optional reason for the abuse report. |
|
api |
string |
<optional> |
ORIGINAL_API | API endpoint used for the submission. |
Returns:
Result of the submission.
- Type
- Promise.<boolean>
(async) reportAbuseReview(keypair, reviewSignature, reasonopt, apiopt) → {Promise.<boolean>}
Report abuse for an existing review.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
keypair |
Keypair | WebCrypto keypair can be any valid keypair. |
||
reviewSignature |
string | Signature of the review to report. |
||
reason |
string |
<optional> |
Optional reason for the abuse report. |
|
api |
string |
<optional> |
ORIGINAL_API | API endpoint used for the submission. |
Returns:
Result of the submission.
- Type
- Promise.<boolean>
(async) request(url, options)
Parameters:
| Name | Type | Description |
|---|---|---|
url |
string | |
options |
object |
(async) request(url, options)
Parameters:
| Name | Type | Description |
|---|---|---|
url |
string | |
options |
object |
(async) signAndSubmitReview(keypair, payload, apiopt) → {Promise.<boolean>}
Composition of signReview and submitReview.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
keypair |
Keypair | WebCrypto keypair can be generated with |
||
payload |
Payload | Base Payload to be cleaned, it will be mutated. |
||
api |
string |
<optional> |
ORIGINAL_API | API endpoint used to fetch the data. |
Returns:
Result of the submission
- Type
- Promise.<boolean>
(async) signAndSubmitReview(keypair, payload, apiopt) → {Promise.<boolean>}
Composition of signReview and submitReview.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
keypair |
Keypair | WebCrypto keypair can be generated with |
||
payload |
Payload | Base Payload to be cleaned, it will be mutated. |
||
api |
string |
<optional> |
ORIGINAL_API | API endpoint used to fetch the data. |
Returns:
Result of the submission
- Type
- Promise.<boolean>
(async) signReview(keypair, payload) → {Promise.<string>}
Assembles JWT from base payload, mutates the payload as needed.
Parameters:
| Name | Type | Description |
|---|---|---|
keypair |
Keypair | WebCrypto keypair, can be generated with |
payload |
Payload | Base Payload to be cleaned, it will be mutated. |
Returns:
Mangrove Review encoded as JWT.
- Type
- Promise.<string>
(async) signReview(keypair, payload) → {Promise.<string>}
Assembles JWT from base payload, mutates the payload as needed.
Parameters:
| Name | Type | Description |
|---|---|---|
keypair |
Keypair | WebCrypto keypair, can be generated with |
payload |
Payload | Base Payload to be cleaned, it will be mutated. |
Returns:
Mangrove Review encoded as JWT.
- Type
- Promise.<string>
submitReview(jwt, apiopt) → {Promise.<boolean>}
Submit a signed review to be stored in the database.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
jwt |
string | Signed review in JWT format. |
||
api |
string |
<optional> |
ORIGINAL_API | API endpoint used to fetch the data. |
Returns:
Resolves to "true" in case of successful insertion or rejects with errors.
- Type
- Promise.<boolean>
submitReview(jwt, apiopt) → {Promise.<boolean>}
Submit a signed review to be stored in the database.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
jwt |
string | Signed review in JWT format. |
||
api |
string |
<optional> |
ORIGINAL_API | API endpoint used to fetch the data. |
Returns:
Resolves to "true" in case of successful insertion or rejects with errors.
- Type
- Promise.<boolean>