Skip to content
qubeejs/angular
3.8/API/IRequestStrategy

IRequestStrategy

ArchivedThese are the docs for ng-qubee 3.8. Read the 4.0 docs for @qubeejs/angular.

Defined in: src/lib/interfaces/request-strategy.interface.ts:11

Strategy interface for building request URIs

Each driver implements this interface to produce URIs in the format expected by the corresponding backend.

readonly capabilities: IStrategyCapabilities

Defined in: src/lib/interfaces/request-strategy.interface.ts:20

Capability flags declared by this driver

Read by NgQubeeService to gate feature methods (e.g. addFilter) without hardcoding DriverEnum checks. Each strategy returns a static, immutable capability map.

optional buildPaginationHeaders(state): Record<string, string> | null

Defined in: src/lib/interfaces/request-strategy.interface.ts:47

Compute HTTP request headers carrying pagination metadata

Honoured only by drivers that support header-based pagination (the PostgREST driver configured with PaginationModeEnum.RANGE). All other drivers should return null — which is also the default when a driver does not override this method.

When the method returns a non-null object, NgQubeeService.buildUri is expected to have already omitted URL-level pagination params for that request; the consumer then merges these headers into the HTTP call so the server knows the requested range.

IQueryBuilderState

The current query builder state

Record<string, string> | null

A map of header name → value, or null when not applicable


buildUri(state, options): string

Defined in: src/lib/interfaces/request-strategy.interface.ts:29

Build a URI string from the given query builder state

IQueryBuilderState

The current query builder state

QueryBuilderOptions

The query parameter key name configuration

string

The composed URI string


validateLimit(limit): void

Defined in: src/lib/interfaces/request-strategy.interface.ts:59

Assert that the given limit value is valid for this driver

Validation is driver-scoped because the accepted range differs by backend: nestjs-paginate treats -1 as a “fetch all” sentinel, while other backends (Laravel, Spatie, JSON:API) require a positive integer.

number

The limit value to validate

void

If the value is not accepted by the driver