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.
Properties
Section titled “Properties”capabilities
Section titled “capabilities”
readonlycapabilities: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.
Methods
Section titled “Methods”buildPaginationHeaders()?
Section titled “buildPaginationHeaders()?”
optionalbuildPaginationHeaders(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.
Parameters
Section titled “Parameters”The current query builder state
Returns
Section titled “Returns”Record<string, string> | null
A map of header name → value, or null when not applicable
buildUri()
Section titled “buildUri()”buildUri(
state,options):string
Defined in: src/lib/interfaces/request-strategy.interface.ts:29
Build a URI string from the given query builder state
Parameters
Section titled “Parameters”The current query builder state
options
Section titled “options”The query parameter key name configuration
Returns
Section titled “Returns”string
The composed URI string
validateLimit()
Section titled “validateLimit()”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.
Parameters
Section titled “Parameters”number
The limit value to validate
Returns
Section titled “Returns”void
Throws
Section titled “Throws”If the value is not accepted by the driver