Skip to content

Commit b54ede6

Browse files
committed
docs(kitsu): document 1.0/1.1/Extensions pagination strategies
Documentation for params is just a usage guide and not restricted - any parameter key is valid.
1 parent f231b36 commit b54ede6

1 file changed

Lines changed: 16 additions & 12 deletions

File tree

packages/kitsu/src/index.js

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,14 @@ export default class Kitsu {
117117
*
118118
* @memberof Kitsu
119119
* @param {string} model Model to fetch data from
120-
* @param {Object} [params] JSON-API request queries
121-
* @param {Object} [params.page] [JSON:API Pagination](http://jsonapi.org/format/#fetching-pagination)
122-
* @param {number} [params.page.limit] Number of resources to return in request (Max `20` for Kitsu.io except on `libraryEntries` which has a max of `500`)
123-
* @param {number} [params.page.offset] Number of resources to offset the dataset by
120+
* @param {Object} [params] JSON-API request queries. Any JSON:API query parameter not mentioned below is supported out of the box.
121+
* @param {Object} [params.page] [JSON:API Pagination](http://jsonapi.org/format/#fetching-pagination). All pagination strategies are supported, even if they are not listed below.
122+
* @param {number} [params.page.limit] Number of resources to return in request (Offset-based) - **Note:** For Kitsu.io, max is `20` except on `libraryEntries` which has a max of `500`
123+
* @param {number} [params.page.offset] Number of resources to offset the dataset by (Offset-based)
124+
* @param {number} [params.page.number] Page of resources to return in request (Page-based) - **Note:** Not supported on Kitsu.io
125+
* @param {number} [params.page.size] Number of resources to return in request (Page-based and cursor-based) - **Note:** Not supported on Kitsu.io
126+
* @param {string} [params.page.before] Get the previous page of resources (Cursor-based) - **Note:** Not Supported on Kitsu.io
127+
* @param {string} [params.page.after] Get the next page of resources (Cursor-based) - **Note:** Not Supported on Kitsu.io
124128
* @param {Object} [params.fields] Return a sparse fieldset with only the included attributes/relationships - [JSON:API Sparse Fieldsets](http://jsonapi.org/format/#fetching-sparse-fieldsets)
125129
* @param {Object} [params.filter] Filter dataset by attribute values - [JSON:API Filtering](http://jsonapi.org/format/#fetching-filtering)
126130
* @param {string} [params.sort] Sort dataset by one or more comma separated attributes (prepend `-` for descending order) - [JSON:API Sorting](http://jsonapi.org/format/#fetching-sorting)
@@ -387,14 +391,14 @@ export default class Kitsu {
387391
* @param {string} config.type The resource type
388392
* @param {Object|Object[]} [config.body] Data to send in the request
389393
* @param {string} [config.method] Request method - `GET`, `PATCH`, `POST` or `DELETE` (defaults to `GET`, case-insensitive)
390-
* @param {Object} [config.params] JSON-API request queries
391-
* @param {Object} [config.params.page] [JSON:API Pagination](http://jsonapi.org/format/#fetching-pagination)
392-
* @param {number} [config.params.page.limit] Number of resources to return in request (Max `20` for Kitsu.io except on `libraryEntries` which has a max of `500`)
393-
* @param {number} [config.params.page.offset] Number of resources to offset the dataset by
394-
* @param {Object} [config.params.fields] Return a sparse fieldset with only the included attributes/relationships - [JSON:API Sparse Fieldsets](http://jsonapi.org/format/#fetching-sparse-fieldsets)
395-
* @param {Object} [config.params.filter] Filter dataset by attribute values - [JSON:API Filtering](http://jsonapi.org/format/#fetching-filtering)
396-
* @param {string} [config.params.sort] Sort dataset by one or more comma separated attributes (prepend `-` for descending order) - [JSON:API Sorting](http://jsonapi.org/format/#fetching-sorting)
397-
* @param {string} [config.params.include] Include relationship data - [JSON:API Includes](http://jsonapi.org/format/#fetching-includes)
394+
* @param {Object} [config.params] JSON-API request queries. Any JSON:API query parameter not mentioned below is supported out of the box.
395+
* @param {Object} [config.params.page] [JSON:API Pagination](http://jsonapi.org/format/#fetching-pagination). All pagination strategies are supported, even if they are not listed below.
396+
* @param {number} [config.params.page.limit] Number of resources to return in request (Offset-based) - **Note:** For Kitsu.io, max is `20` except on `libraryEntries` which has a max of `500`
397+
* @param {number} [config.params.page.offset] Number of resources to offset the dataset by (Offset-based)
398+
* @param {number} [config.params.page.number] Page of resources to return in request (Page-based) - **Note:** Not supported on Kitsu.io
399+
* @param {number} [config.params.page.size] Number of resources to return in request (Page-based and cursor-based) - **Note:** Not supported on Kitsu.io
400+
* @param {string} [config.params.page.before] Get the previous page of resources (Cursor-based) - **Note:** Not Supported on Kitsu.io
401+
* @param {string} [config.params.page.after] Get the next page of resources (Cursor-based) - **Note:** Not Supported on Kitsu.io
398402
* @param {Object} [headers] Additional headers to send with the request
399403
* @returns {Object} JSON-parsed response
400404
* @example <caption>Raw GET request</caption>

0 commit comments

Comments
 (0)