Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Pete Edwards <[email protected]>
  • Loading branch information
NSeydoux and edwardsph authored Dec 19, 2024
1 parent 0ff612c commit 3b9b61c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The following changes are pending, and will be applied on the next major release
Although the two functions behavior is different, they can be used to achieve
similar results.
- The `gConsent` and all of `gConsent/*` submodules are deprecated. The former can
be replaced by a regular import of the library, and the latters can be replaced
be replaced by a regular import of the library, and the latter can be replaced
with the equivalent non-gConsent submodules (e.g. `gConsent/manage` can be replaced
with `manage`). There is no functionality change between the two.

Expand All @@ -24,8 +24,8 @@ The following changes are pending, and will be applied on the next major release
custom fields, and via a set of dedicated getters in the `getters/` module. A generic getter
is introduced, `getCustomFields`, as well as a set of typed helpers, such as `getCustomInteger`.
Typed helpers are available for integers, floats, strings and booleans.
- Support new query endpoint: the new `query` function allows to query for Access Credentials using
the newly introduce ESS endpoint.
- Support new query endpoint: the new `query` function enables querying for Access Credentials using
the newly introduced ESS endpoint.

## [3.1.1](https://github.com/inrupt/solid-client-access-grants-js/releases/tag/v3.1.1) - 2024-10-23

Expand Down
22 changes: 11 additions & 11 deletions src/gConsent/query/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { verifiableCredentialToDataset } from "@inrupt/solid-client-vc";
import type { UrlString } from "@inrupt/solid-client";

/**
* Supported Access Credentials status
* Supported Access Credential statuses
*/
export type CredentialStatus =
| "Pending"
Expand Down Expand Up @@ -58,11 +58,11 @@ export const DURATION = {

export type CredentialFilter = {
/**
* The Access Credential type (e.g. Access Request, Access Grant...)
* The Access Credential type (e.g. Access Request, Access Grant...).
*/
type?: CredentialType;
/**
* The Access Credential status (e.g. Active, Revoked...)
* The Access Credential status (e.g. Active, Revoked...).
*/
status?: CredentialStatus;
/**
Expand All @@ -82,11 +82,11 @@ export type CredentialFilter = {
*/
purpose?: UrlString;
/**
* Interval (expressed using ISO 8601) during which the Credential was issued.
* Period (expressed using ISO 8601) during which the Credential was issued.
*/
issuedWithin?: "P1D" | "P7D" | "P1M" | "P3M";
/**
* Interval (expressed using ISO 8601) during which the Credential was revoked.
* Period (expressed using ISO 8601) during which the Credential was revoked.
*/
revokedWithin?: "P1D" | "P7D" | "P1M" | "P3M";
/**
Expand Down Expand Up @@ -177,7 +177,7 @@ async function toCredentialResult(
const link = parsedLinks.get("rel", rel);
if (link.length > 1) {
throw Error(
`Unexpected response, found more than one ${rel} Link headers.`,
`Unexpected response, found more than one [${rel}] Link headers.`,
);
}
if (link.length === 0) {
Expand Down Expand Up @@ -213,15 +213,15 @@ function toQueryUrl(endpoint: URL, filter: CredentialFilter): URL {
/**
* Query for Access Requests or Access Grants based on a given filter.
*
* @param filter the query filter
* @param options query options
* @param filter The query filter
* @param options Query options
* @returns a paginated set of Access Credential matching the given filter
* @since unreleased
*
* @example
* ```
* // Get the first results page.
* const activeGrantsToday = await query(
* const activeGrantsWithinDay = await query(
* {
* type: "SolidAccessGrant",
* status: "Active",
Expand All @@ -233,8 +233,8 @@ function toQueryUrl(endpoint: URL, filter: CredentialFilter): URL {
* },
* );
* // Get the next results page.
* const activeGrantsToday2 = await query(
* activeGrantsToday.next,
* const activeGrantsWithinDay2 = await query(
* activeGrantsWithinDay.next,
* {
* fetch: session.fetch,
* queryEndpoint: config.queryEndpoint,
Expand Down

0 comments on commit 3b9b61c

Please sign in to comment.