SieveResponseStrategy
ArchivedThese are the docs for ng-qubee 3.8. Read the 4.0 docs for @qubeejs/angular.
Defined in: src/lib/strategies/sieve-response.strategy.ts:34
Response strategy for the Sieve (.NET) driver
Sieve itself does not define a response envelope — it returns an
IQueryable that the ASP.NET developer wraps in a paging DTO of their
choosing. This strategy therefore ships a sensible default mapping
for the common hand-rolled PagedResult<T> shape:
{ "data": [{ "id": 1, "title": "Hello" }], "page": 2, "pageSize": 10, "total": 48, "totalPages": 5}Every key path is configurable through IConfig.response (dot
notation supported), so any wrapper shape — { items, meta: {...} },
{ results, pagination: {...} } — can be mapped without subclassing.
Defaults are encoded in SieveResponseOptions. from/to are
computed from page × pageSize by the inherited traversal
algorithm, and the navigation-URL slots resolve to undefined unless
paths are provided.
The dot-notation traversal is inherited from
AbstractDotPathResponseStrategy; this class exists so
DriverEnum.SIEVE resolves to a distinct identity at the DI layer.
https://github.com/Biarity/Sieve
Extends
Section titled “Extends”AbstractDotPathResponseStrategy
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new SieveResponseStrategy():
SieveResponseStrategy
Returns
Section titled “Returns”SieveResponseStrategy
Inherited from
Section titled “Inherited from”AbstractDotPathResponseStrategy.constructor
Methods
Section titled “Methods”paginate()
Section titled “paginate()”paginate<
T>(response,options):PaginatedCollection<T>
Defined in: src/lib/strategies/abstract-dot-path-response.strategy.ts:32
Parse a nested-envelope pagination response into a PaginatedCollection
Type Parameters
Section titled “Type Parameters”T extends IPaginatedObject
Parameters
Section titled “Parameters”response
Section titled “response”Record<string, any>
The raw API response object
options
Section titled “options”The response key name configuration (dot-notation paths supported)
Returns
Section titled “Returns”A typed PaginatedCollection instance
Inherited from
Section titled “Inherited from”AbstractDotPathResponseStrategy.paginate
resolve()
Section titled “resolve()”
protectedresolve(response,path):unknown
Defined in: src/lib/strategies/abstract-dot-path-response.strategy.ts:73
Resolve a value from a response object using a dot-notation path
Supports both flat keys ('data') and nested paths ('meta.totalItems').
Parameters
Section titled “Parameters”response
Section titled “response”Record<string, any>
The raw response object
string
The dot-notation path to resolve
Returns
Section titled “Returns”unknown
The resolved value, or undefined if any segment is missing
Inherited from
Section titled “Inherited from”AbstractDotPathResponseStrategy.resolve
resolveFrom()
Section titled “resolveFrom()”
protectedresolveFrom(response,options,currentPage,perPage?):number|undefined
Defined in: src/lib/strategies/abstract-dot-path-response.strategy.ts:90
Resolve the “from” index value
If options.from resolves to a value in the response, use it.
Otherwise compute (currentPage - 1) * perPage + 1 when both are known.
Parameters
Section titled “Parameters”response
Section titled “response”Record<string, any>
The raw response object
options
Section titled “options”The response key name configuration
currentPage
Section titled “currentPage”number
The current page number
perPage?
Section titled “perPage?”number
The number of items per page
Returns
Section titled “Returns”number | undefined
The “from” index, or undefined when neither path nor inputs suffice
Inherited from
Section titled “Inherited from”AbstractDotPathResponseStrategy.resolveFrom
resolveTo()
Section titled “resolveTo()”
protectedresolveTo(response,options,currentPage,perPage?,total?):number|undefined
Defined in: src/lib/strategies/abstract-dot-path-response.strategy.ts:119
Resolve the “to” index value
If options.to resolves to a value in the response, use it.
Otherwise compute Math.min(currentPage * perPage, total) when all
three are known.
Parameters
Section titled “Parameters”response
Section titled “response”Record<string, any>
The raw response object
options
Section titled “options”The response key name configuration
currentPage
Section titled “currentPage”number
The current page number
perPage?
Section titled “perPage?”number
The number of items per page
total?
Section titled “total?”number
The total number of items
Returns
Section titled “Returns”number | undefined
The “to” index, or undefined when neither path nor inputs suffice
Inherited from
Section titled “Inherited from”AbstractDotPathResponseStrategy.resolveTo