Skip to content
Client
Server

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 ​

Type Parameters ​

T ​

T

Properties ​

body? ​

ts
readonly optional body?: unknown;

Defined in: packages/core/src/client.ts:145

JSON-encoded, and sent with Content-Type: application/json.

Inherited from ​

tRequestInit.body


maxPages? ​

ts
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? ​

ts
readonly optional method?: "POST" | "GET" | "PUT" | "DELETE";

Defined in: packages/core/src/client.ts:141

The HTTP method. Default: GET.

Inherited from ​

tRequestInit.method


onResponse? ​

ts
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 ​

tResponseOutcome

Returns ​

void

Inherited from ​

tRequestInit.onResponse


params? ​

ts
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 ​

tRequestInit.params


schema? ​

ts
readonly optional schema?: tSchemaLike<tPage<T>>;

Defined in: packages/core/src/client.ts:149

Validates the parsed body; a failure throws ValidationError.

Inherited from ​

tRequestInit.schema


signal? ​

ts
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 ​

tRequestInit.signal


user? ​

ts
readonly optional user?: boolean;

Defined in: packages/core/src/client.ts:147

Send the Music User Token. Default: true under /v1/me.

Inherited from ​

tRequestInit.user

MIT licensed. Not affiliated with, endorsed by, or sponsored by Apple Inc. Apple Music and MusicKit are trademarks of Apple Inc.