From 867503bd8a0ed74391bacf453aa37b6c241bb0a6 Mon Sep 17 00:00:00 2001 From: Liran Cohen Date: Fri, 24 Nov 2023 10:23:22 -0500 Subject: [PATCH] additional documentation --- README.md | 14 ++++++++++++++ packages/api/README.md | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/README.md b/README.md index a324672ff..7498a59a6 100644 --- a/README.md +++ b/README.md @@ -224,6 +224,20 @@ The query `request` contains the following properties: - **`recipient`** - _`string`_ (_optional_): the DID in the `recipient` field of the record. - **`schema`** - _`URI string`_ (_optional_): the URI of the schema bucket in which to query. - **`dataFormat`** - _`Media Type string`_ (_optional_): the IANA string corresponding with the format of the data to filter for. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml + - **`dateSort`** - _`DateSort`_ (_optional_): the `DateSort` value of the date field and direction to sort records by. Defaults to `CreatedAscending`. + - **`pagination`** - _`Pagination`_ (_optional_): the properties used to paginate results. + - **`limit`** - _`number`_ (_optional_): the number of records that should be returned with this query. `undefined` returns all records. + - **`cursor`** - _`messageCid string` (_optional_): the `messageCid` of the records toc continue paginating from. This value is returned as a `cursor` in the response object of a `query` if there are more results beyond the `limit`. + +#### **Response** + +The query `response` contains the following properties: + +- **`status`** - _`ResponseStatus`: the status of the `request`: + - **`code`** - _`number`: the `Response Status` code, following the response code patterns for `HTTP Response Status Codes`. + - **`detail`** _`string`: a detailed message describing the response. +- **`records`** - _`Records array`_ (_optional_): the array of `Records` returned if the request was successful. +- **`cursor`** - _`messageCid string`_ (_optional_): the `messageCid` of the last message returned in the results if there are exist additional records beyond the specified `limit` in the `query`. ### **`web5.dwn.records.create(request)`** diff --git a/packages/api/README.md b/packages/api/README.md index f1921e21f..28db6d465 100644 --- a/packages/api/README.md +++ b/packages/api/README.md @@ -217,6 +217,20 @@ The query `request` contains the following properties: - **`recipient`** - _`string`_ (_optional_): the DID in the `recipient` field of the record. - **`schema`** - _`URI string`_ (_optional_): the URI of the schema bucket in which to query. - **`dataFormat`** - _`Media Type string`_ (_optional_): the IANA string corresponding with the format of the data to filter for. See IANA's Media Type list here: https://www.iana.org/assignments/media-types/media-types.xhtml + - **`dateSort`** - _`DateSort`_ (_optional_): the `DateSort` value of the date field and direction to sort records by. Defaults to `CreatedAscending`. + - **`pagination`** - _`Pagination`_ (_optional_): the properties used to paginate results. + - **`limit`** - _`number`_ (_optional_): the number of records that should be returned with this query. `undefined` returns all records. + - **`cursor`** - _`messageCid string` (_optional_): the `messageCid` of the records toc continue paginating from. This value is returned as a `cursor` in the response object of a `query` if there are more results beyond the `limit`. + +#### **Response** + +The query `response` contains the following properties: + +- **`status`** - _`ResponseStatus`: the status of the `request`: + - **`code`** - _`number`: the `Response Status` code, following the response code patterns for `HTTP Response Status Codes`. + - **`detail`** _`string`: a detailed message describing the response. +- **`records`** - _`Records array`_ (_optional_): the array of `Records` returned if the request was successful. +- **`cursor`** - _`messageCid string`_ (_optional_): the `messageCid` of the last message returned in the results if there are exist additional records beyond the specified `limit` in the `query`. ### **`web5.dwn.records.create(request)`**