This version (v0.7) has not been published to npm yet.
Skip to content

Reference / @getenginex/sdk/extension / ExtensionPageRequestSpec

ExtensionPageRequestSpec<T> ​

Description of a paginated listing made via ExtensionTransport.requestPage. page and the page size go in the query string; the response becomes a Page.

Example ​

ts
transport.requestPage({
  method: 'GET',
  path: '/casino/games',
  query: { category: input?.category },
  page: input?.page,
  perPage: input?.perPage,
  auth: 'optional',
  item: gameSchema(),
  options,
})

Extends ​

Type Parameters ​

T ​

T

Properties ​

auth? ​

optional auth?: ExtensionAuthMode

Session use. Default: 'none'.

Inherited from ​

Omit.auth


body? ​

optional body?: unknown

Body, in wire format (snake_case), serialized as JSON. A FormData goes as multipart (the runtime sets the Content-Type with the boundary; the hooks receive only the field names and the type and size of the files) — requires core >=0.4.0.

Inherited from ​

Omit.body


idempotent? ​

optional idempotent?: boolean

true sends an Idempotency-Key header: the one from options.idempotencyKey (the app passes it to repeat the operation without duplicating it) or, without it, one generated per call; either way it is reused on the retry after a renewed 401. With false, options.idempotencyKey is ignored. For routes that move money or create resources and that the gateway protects with the idempotency middleware. Default: false.

Inherited from ​

Omit.idempotent


item ​

item: ZodMiniType<T>

Schema of each item in the list.


method ​

method: HttpMethod

HTTP method.

Inherited from ​

Omit.method


options? ​

optional options?: CallOptions

Call options received by the public method (signal, fetchOptions), passed on as they are.

Inherited from ​

Omit.options


page? ​

optional page?: number

Page, starting at 1. Omitted: the gateway uses the first.


path ​

path: string

Path after /api/v1, starting with /, e.g. /casino/games. Segments coming from the app (ids) must go through encodeURIComponent. No query string: use query. A segment that, decoded and trimmed, is . or .. (the URL would normalize it to another route) rejects with INVALID_ARGUMENT (status: 0) before any fetch.

Inherited from ​

Omit.path


perPage? ​

optional perPage?: number

Items per page. Omitted: the gateway default.


perPageParam? ​

optional perPageParam?: "per_page" | "limit"

Name of the size parameter that the gateway handler reads. Default: 'per_page'.


query? ​

optional query?: Record<string, ExtensionQueryValue>

Query string, in wire format (snake_case). undefined/null values are omitted.

Inherited from ​

Omit.query


validation? ​

optional validation?: "strict"

'strict' makes this request throw VALIDATION_ERROR when the response does not match the schema, even with the client on validation: 'warn'. Use it on routes that return tokens, secrets or session URLs (e.g. a game's launch). Without it, the client's validation applies.

Inherited from ​

Omit.validation