Reference / @open-music-sdk/core / tPaginateInit
Interface: tPaginateInit<T>
Defined in: packages/core/src/client.ts:170
What paginate takes: what request takes, for each page it asks for, and how many pages that may be.
Extends
tRequestInit<tPage<T>>
Type Parameters
T
T
Properties
body?
readonly optional body?: unknown;Defined in: packages/core/src/client.ts:145
JSON-encoded, and sent with Content-Type: application/json.
Inherited from
maxPages?
readonly optional maxPages?: number;Defined in: packages/core/src/client.ts:176
The most pages to ask Apple for: a whole number above zero. Default: no limit, so a walk goes on asking for as long as each page names a next one. At the limit the walk ends, whether or not there are more. A page handed over is not counted, since it was not asked for.
method?
readonly optional method?: "POST" | "GET" | "PUT" | "DELETE";Defined in: packages/core/src/client.ts:141
The HTTP method. Default: GET.
Inherited from
onResponse?
readonly optional onResponse?: (res, req, outcome) => void;Defined in: packages/core/src/client.ts:158
Called as the client's own onResponse is, and after it, for this request alone: once per response, when the body has been read and the outcome decided. It is how a caller learns what request does not resolve to, such as the status of the answer or one of its headers. req is the Request as sent, token headers and all, so a hook that logs it logs the tokens.
Parameters
res
Response
req
Request
outcome
Returns
void
Inherited from
params?
readonly optional params?: Readonly<Record<string,
| string
| number
| boolean
| readonly (string | number)[]
| null
| undefined>>;Defined in: packages/core/src/client.ts:143
The query, encoded as tParams says and set on the URL over whatever the path carries.
Inherited from
schema?
readonly optional schema?: tSchemaLike<tPage<T>>;Defined in: packages/core/src/client.ts:149
Validates the parsed body; a failure throws ValidationError.
Inherited from
signal?
readonly optional signal?: AbortSignal;Defined in: packages/core/src/client.ts:151
Aborts the request at any point: before an attempt, in the rate limiter, in fetch, reading the body, or between attempts. Its reason is what the request then rejects with, as it is.
Inherited from
user?
readonly optional user?: boolean;Defined in: packages/core/src/client.ts:147
Send the Music User Token. Default: true under /v1/me.