ng-qubee 3.5.0 → 3.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"ng-qubee.mjs","sources":["../../../src/lib/errors/key-not-found.error.ts","../../../src/lib/models/paginated-collection.ts","../../../src/lib/enums/driver.enum.ts","../../../src/lib/models/response-options.ts","../../../src/lib/enums/filter-operator.enum.ts","../../../src/lib/enums/sort.enum.ts","../../../src/lib/errors/invalid-filter-operator-value.error.ts","../../../src/lib/errors/unsupported-filter-operator.error.ts","../../../src/lib/errors/invalid-limit.error.ts","../../../src/lib/strategies/abstract-request.strategy.ts","../../../src/lib/strategies/drf-request.strategy.ts","../../../src/lib/strategies/drf-response.strategy.ts","../../../src/lib/errors/unselectable-model.error.ts","../../../src/lib/strategies/json-api-request.strategy.ts","../../../src/lib/strategies/abstract-dot-path-response.strategy.ts","../../../src/lib/strategies/json-api-response.strategy.ts","../../../src/lib/strategies/laravel-request.strategy.ts","../../../src/lib/strategies/abstract-flat-response.strategy.ts","../../../src/lib/strategies/laravel-response.strategy.ts","../../../src/lib/strategies/nestjs-request.strategy.ts","../../../src/lib/strategies/nestjs-response.strategy.ts","../../../src/lib/enums/pagination-mode.enum.ts","../../../src/lib/strategies/postgrest-request.strategy.ts","../../../src/lib/interfaces/header-bag.interface.ts","../../../src/lib/strategies/postgrest-response.strategy.ts","../../../src/lib/strategies/spatie-request.strategy.ts","../../../src/lib/strategies/spatie-response.strategy.ts","../../../src/lib/strategies/strapi-request.strategy.ts","../../../src/lib/strategies/strapi-response.strategy.ts","../../../src/lib/drivers/driver-registry.ts","../../../src/lib/models/query-builder-options.ts","../../../src/lib/errors/invalid-resource-name.error.ts","../../../src/lib/errors/invalid-page-number.error.ts","../../../src/lib/services/nest.service.ts","../../../src/lib/errors/pagination-not-synced.error.ts","../../../src/lib/errors/unsupported-field-selection.error.ts","../../../src/lib/errors/unsupported-filter.error.ts","../../../src/lib/errors/unsupported-includes.error.ts","../../../src/lib/errors/unsupported-search.error.ts","../../../src/lib/errors/unsupported-select.error.ts","../../../src/lib/errors/unsupported-sort.error.ts","../../../src/lib/tokens/ng-qubee.tokens.ts","../../../src/lib/services/ng-qubee.service.ts","../../../src/lib/services/pagination.service.ts","../../../src/lib/provide-ngqubee.ts","../../../src/lib/ng-qubee.module.ts","../../../src/public-api.ts","../../../src/ng-qubee.ts"],"sourcesContent":["export class KeyNotFoundError extends Error {\n constructor(key: string) {\n super(`Cannot find the key ${key} inside the collection item: does it really exists?`);\n }\n}","import { KeyNotFoundError } from \"../errors/key-not-found.error\";\nimport { INormalized } from \"../interfaces/normalized.interface\";\nimport { IPaginatedObject } from \"../interfaces/paginated-object.interface\";\n\nexport class PaginatedCollection<T extends IPaginatedObject> {\n constructor(\n public data: T[],\n public readonly page: number,\n public readonly from?: number,\n public readonly to?: number,\n public readonly total?: number,\n public readonly perPage?: number,\n public readonly prevPageUrl?: string,\n public readonly nextPageUrl?: string,\n public readonly lastPage?: number,\n public readonly firstPageUrl?: string,\n public readonly lastPageUrl?: string\n ) {\n //\n }\n\n /**\n * Normalize the collection to a paginated list of ids for state-managed applications.\n * \n * This method returns a single key object, where the key is the page number and the associated value is\n * an array of ids. Each id is fetched by the collection items, looking up for the \"id\" key. If an id is supplied\n * to this method, it will be used instead of the default \"id\" key.\n * \n * Please note that in case the key doesn't exist in the collection's item, a KeyNotFoundError is thrown\n * \n * @param k A key to use instead of the default \"id\": this will be searched inside each element of the collection\n * @returns []\n * @throws KeyNotFoundItem\n */\n public normalize(id?: string): INormalized {\n return {\n [this.page]: this.data.reduce((ids: number[], value: T) => {\n if (id && id in value) {\n ids.push(value[id]);\n } else if (value.hasOwnProperty('id')) {\n ids.push(value['id']);\n } else {\n throw new KeyNotFoundError(id || 'id');\n }\n\n return ids;\n }, [])\n }\n }\n}","/**\n * Enum representing the available pagination driver types\n *\n * Each driver encapsulates the full format knowledge for both\n * request building (URI generation) and response parsing.\n */\nexport enum DriverEnum {\n DRF = 'drf',\n JSON_API = 'json-api',\n LARAVEL = 'laravel',\n NESTJS = 'nestjs',\n POSTGREST = 'postgrest',\n SPATIE = 'spatie',\n STRAPI = 'strapi'\n}\n","import { IPaginationConfig } from '../interfaces/pagination-config.interface';\n\n/**\n * Resolved response field key names with defaults applied\n *\n * Maps logical pagination concepts to the actual key names\n * used in the API response. Unset values fall back to Laravel defaults.\n *\n * For NestJS responses, use dot-notation paths:\n * ```typescript\n * new ResponseOptions({\n * currentPage: 'meta.currentPage',\n * total: 'meta.totalItems'\n * });\n * ```\n */\nexport class ResponseOptions {\n public readonly currentPage: string;\n public readonly data: string;\n public readonly firstPageUrl: string;\n public readonly from: string;\n public readonly lastPage: string;\n public readonly lastPageUrl: string;\n public readonly nextPageUrl: string;\n public readonly path: string;\n public readonly perPage: string;\n public readonly prevPageUrl: string;\n public readonly to: string;\n public readonly total: string;\n\n constructor(options: IPaginationConfig) {\n this.currentPage = options.currentPage || 'current_page';\n this.data = options.data || 'data';\n this.firstPageUrl = options.firstPageUrl || 'first_page_url';\n this.from = options.from || 'from';\n this.lastPage = options.lastPage || 'last_page';\n this.lastPageUrl = options.lastPageUrl || 'last_page_url';\n this.nextPageUrl = options.nextPageUrl || 'next_page_url';\n this.path = options.path || 'path';\n this.perPage = options.perPage || 'per_page';\n this.prevPageUrl = options.prevPageUrl || 'prev_page_url';\n this.to = options.to || 'to';\n this.total = options.total || 'total';\n }\n}\n\n/**\n * Pre-configured ResponseOptions for the Django REST Framework (DRF) driver\n *\n * DRF's `PageNumberPagination` envelope is `{ count, next, previous,\n * results }`, with no body field naming the current page, per-page, or\n * last-page. The strategy parses those from the `next` / `previous`\n * URLs, so the corresponding key paths default to empty strings; the\n * strategy ignores `options.currentPage`, `options.perPage`,\n * `options.lastPage`, `options.from`, `options.to`, `options.path`,\n * `options.firstPageUrl`, and `options.lastPageUrl`.\n */\nexport class DrfResponseOptions extends ResponseOptions {\n constructor(options: IPaginationConfig) {\n super({\n currentPage: options.currentPage || '',\n data: options.data || 'results',\n firstPageUrl: options.firstPageUrl || '',\n from: options.from || '',\n lastPage: options.lastPage || '',\n lastPageUrl: options.lastPageUrl || '',\n nextPageUrl: options.nextPageUrl || 'next',\n path: options.path || '',\n perPage: options.perPage || '',\n prevPageUrl: options.prevPageUrl || 'previous',\n to: options.to || '',\n total: options.total || 'count'\n });\n }\n}\n\n/**\n * Pre-configured ResponseOptions for the JSON:API driver\n *\n * Uses dot-notation paths to access nested values in the JSON:API response format.\n * JSON:API meta key names vary by implementation; these defaults cover the most\n * common conventions and can be fully customised via `IPaginationConfig`.\n */\nexport class JsonApiResponseOptions extends ResponseOptions {\n constructor(options: IPaginationConfig) {\n super({\n currentPage: options.currentPage || 'meta.current-page',\n data: options.data || 'data',\n firstPageUrl: options.firstPageUrl || 'links.first',\n from: options.from || 'meta.from',\n lastPage: options.lastPage || 'meta.page-count',\n lastPageUrl: options.lastPageUrl || 'links.last',\n nextPageUrl: options.nextPageUrl || 'links.next',\n path: options.path || 'path',\n perPage: options.perPage || 'meta.per-page',\n prevPageUrl: options.prevPageUrl || 'links.prev',\n to: options.to || 'meta.to',\n total: options.total || 'meta.total'\n });\n }\n}\n\n/**\n * Pre-configured ResponseOptions for the NestJS driver\n *\n * Uses dot-notation paths to access nested values in the NestJS response format.\n */\nexport class NestjsResponseOptions extends ResponseOptions {\n constructor(options: IPaginationConfig) {\n super({\n currentPage: options.currentPage || 'meta.currentPage',\n data: options.data || 'data',\n firstPageUrl: options.firstPageUrl || 'links.first',\n from: options.from || 'meta.from',\n lastPage: options.lastPage || 'meta.totalPages',\n lastPageUrl: options.lastPageUrl || 'links.last',\n nextPageUrl: options.nextPageUrl || 'links.next',\n path: options.path || 'path',\n perPage: options.perPage || 'meta.itemsPerPage',\n prevPageUrl: options.prevPageUrl || 'links.previous',\n to: options.to || 'meta.to',\n total: options.total || 'meta.totalItems'\n });\n }\n}\n\n/**\n * Pre-configured ResponseOptions for the Strapi driver\n *\n * Uses dot-notation paths to access the nested `meta.pagination.*` envelope\n * Strapi v4/v5 emits. Strapi does not include navigation links by default,\n * so the URL paths point at locations that will resolve to `undefined`\n * unless the consumer overrides them.\n */\nexport class StrapiResponseOptions extends ResponseOptions {\n constructor(options: IPaginationConfig) {\n super({\n currentPage: options.currentPage || 'meta.pagination.page',\n data: options.data || 'data',\n firstPageUrl: options.firstPageUrl || 'links.first',\n from: options.from || 'meta.pagination.from',\n lastPage: options.lastPage || 'meta.pagination.pageCount',\n lastPageUrl: options.lastPageUrl || 'links.last',\n nextPageUrl: options.nextPageUrl || 'links.next',\n path: options.path || 'path',\n perPage: options.perPage || 'meta.pagination.pageSize',\n prevPageUrl: options.prevPageUrl || 'links.prev',\n to: options.to || 'meta.pagination.to',\n total: options.total || 'meta.pagination.total'\n });\n }\n}\n","/**\n * Enum representing the available filter operators for explicit operator\n * filters\n *\n * NestJS encodes these with the `$` prefix at the wire level\n * (`filter.field=$operator:value`); PostgREST translates them to its own\n * prefix notation (`col=eq.val`, `col=is.null`, etc.). The enum values are\n * intentionally the NestJS form; each driver's request strategy is\n * responsible for mapping them into its own shape.\n *\n * `FTS`, `PLFTS`, `PHFTS`, `WFTS` are PostgREST-native full-text search\n * variants; they throw `UnsupportedFilterOperatorError` on every other\n * driver that does not recognise them.\n *\n * @see https://github.com/ppetzold/nestjs-paginate\n * @see https://postgrest.org/en/stable/api.html#operators\n */\nexport enum FilterOperatorEnum {\n BTW = '$btw',\n CONTAINS = '$contains',\n EQ = '$eq',\n FTS = '$fts',\n GT = '$gt',\n GTE = '$gte',\n ILIKE = '$ilike',\n IN = '$in',\n LT = '$lt',\n LTE = '$lte',\n NOT = '$not',\n NULL = '$null',\n PHFTS = '$phfts',\n PLFTS = '$plfts',\n SW = '$sw',\n WFTS = '$wfts'\n}\n","export enum SortEnum {\n ASC = 'asc',\n DESC = 'desc'\n}","import { FilterOperatorEnum } from '../enums/filter-operator.enum';\n\n/**\n * Thrown when a filter operator receives a value array of the wrong shape\n *\n * Some operators have arity or type constraints that the library enforces\n * at call time so misuse fails loudly instead of silently emitting invalid\n * server requests:\n *\n * - `BTW` requires exactly two values (min, max).\n * - `NULL` requires exactly one boolean value (`true` for `IS NULL`,\n * `false` for `IS NOT NULL`).\n *\n * Operators with looser shape rules leave validation to the server; this\n * error is reserved for cases where the library itself can detect the\n * problem unambiguously from the call site.\n */\nexport class InvalidFilterOperatorValueError extends Error {\n\n /**\n * @param operator - The operator that rejected the values\n * @param reason - Short human-readable explanation of the constraint\n */\n constructor(operator: FilterOperatorEnum, reason: string) {\n super(`Invalid values for filter operator ${operator}: ${reason}`);\n this.name = 'InvalidFilterOperatorValueError';\n }\n}\n","/**\n * Error thrown when filter operators are attempted with a driver that does not support them\n *\n * Filter operators are only supported by the NestJS driver.\n * Use `addFilter()` for Spatie implicit equality filters.\n */\nexport class UnsupportedFilterOperatorError extends Error {\n constructor() {\n super('Filter operators are only supported by the NestJS driver. Use addFilter() for Spatie.');\n this.name = 'UnsupportedFilterOperatorError';\n }\n}\n","/**\n * Thrown when a limit value does not satisfy the active driver's constraints\n *\n * Validation is driver-scoped: most drivers require an integer `>= 1`, while\n * the NestJS driver additionally accepts `-1` as a \"fetch all items\" sentinel\n * (as documented by nestjs-paginate). The message is tailored accordingly so\n * the caller understands which values are permitted.\n */\nexport class InvalidLimitError extends Error {\n\n /**\n * @param limit - The rejected limit value\n * @param allowFetchAll - Whether the active driver accepts `-1` (fetch all)\n */\n constructor(limit: number, allowFetchAll: boolean = false) {\n const allowed = allowFetchAll\n ? 'a positive integer greater than 0, or -1 to fetch all items'\n : 'a positive integer greater than 0';\n\n super(`Invalid limit value: Limit must be ${allowed}. Received: ${limit}`);\n this.name = 'InvalidLimitError';\n }\n}\n","import { InvalidLimitError } from '../errors/invalid-limit.error';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { IRequestStrategy } from '../interfaces/request-strategy.interface';\nimport { IStrategyCapabilities } from '../interfaces/strategy-capabilities.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\n\n/**\n * Base class for request strategies\n *\n * Concentrates the glue every concrete strategy used to copy: the\n * resource-required guard, the `?`/`&` URL composition, and the default\n * positive-integer `validateLimit`. Concrete strategies override only\n * the parts that differ — the per-driver wire format goes into a single\n * `protected parts(state, options): string[]` method that returns the\n * ordered query-string segments the base then joins.\n *\n * Drivers that need a non-default `validateLimit` (e.g. NestJS, which\n * accepts `-1` as a fetch-all sentinel) override that method directly.\n */\nexport abstract class AbstractRequestStrategy implements IRequestStrategy {\n\n /**\n * Capability declaration for this driver\n *\n * Concrete strategies must provide a static, immutable capability map\n * so `NgQubeeService._assertCapability(...)` can read it.\n */\n public abstract readonly capabilities: IStrategyCapabilities;\n\n /**\n * Compose the full request URI from the given state\n *\n * Template method: validates the resource, computes the base path,\n * delegates the per-driver query-string segments to `parts(...)`, and\n * joins them with the conventional `?`/`&` separators.\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @returns The composed URI string\n * @throws Error if the resource is not set\n */\n public buildUri(state: IQueryBuilderState, options: QueryBuilderOptions): string {\n this.assertResource(state);\n\n const segments = this.parts(state, options);\n\n return this.join(this.baseUri(state), segments);\n }\n\n /**\n * Validate that a limit value is acceptable for this driver\n *\n * Default policy: positive integer. Drivers that recognise a sentinel\n * (NestJS treats `-1` as \"fetch all\") override this method.\n *\n * @param limit - The limit value to validate\n * @throws {InvalidLimitError} If the value is not a positive integer\n */\n public validateLimit(limit: number): void {\n if (Number.isInteger(limit) && limit >= 1) {\n return;\n }\n\n throw new InvalidLimitError(limit);\n }\n\n /**\n * Per-driver query-string segments, in emission order\n *\n * Each entry is one `key=value` (or `key=v1&key=v2` for compound\n * params like PostgREST's `BTW`). Empty arrays are valid and produce\n * a URI containing only the resource path.\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @returns Ordered list of query-string fragments\n */\n protected abstract parts(state: IQueryBuilderState, options: QueryBuilderOptions): string[];\n\n /**\n * Throw if the resource is not set on the state\n *\n * Centralises the message that was previously copy-pasted across four\n * of the five concrete strategies.\n *\n * @param state - The current query builder state\n * @throws Error if `state.resource` is empty\n */\n protected assertResource(state: IQueryBuilderState): void {\n if (!state.resource) {\n throw new Error('Set the resource property BEFORE adding filters or calling the url() / get() methods');\n }\n }\n\n /**\n * Compute the base path (no query string)\n *\n * @param state - The current query builder state\n * @returns The base URI without the query separator (e.g. `/users` or `https://api.example.com/users`)\n */\n protected baseUri(state: IQueryBuilderState): string {\n return state.baseUrl ? `${state.baseUrl}/${state.resource}` : `/${state.resource}`;\n }\n\n /**\n * Glue the base URI and the per-driver query-string segments\n *\n * Returns the bare base when no segments were emitted (e.g. PostgREST\n * in RANGE mode with no filters), otherwise joins with `?` + `&`.\n *\n * @param base - The base URI from `_baseUri`\n * @param segments - The query-string fragments from `parts(...)`\n * @returns The full URI\n */\n protected join(base: string, segments: string[]): string {\n return segments.length ? `${base}?${segments.join('&')}` : base;\n }\n}\n","import { FilterOperatorEnum } from '../enums/filter-operator.enum';\nimport { SortEnum } from '../enums/sort.enum';\nimport { InvalidFilterOperatorValueError } from '../errors/invalid-filter-operator-value.error';\nimport { UnsupportedFilterOperatorError } from '../errors/unsupported-filter-operator.error';\nimport { IOperatorFilter } from '../interfaces/operator-filter.interface';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { IStrategyCapabilities } from '../interfaces/strategy-capabilities.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\nimport { AbstractRequestStrategy } from './abstract-request.strategy';\n\n/**\n * Right-hand-side payload of a django-filter `field__lookup=value` segment\n *\n * The lookup suffix (or empty string for the default `exact` match) and\n * the serialized value combine into the flat key=value pair django-filter\n * reads on the server side.\n */\ntype DrfLookupSuffix = string;\n\n/**\n * Request strategy for the Django REST Framework (DRF) driver\n *\n * Generates URIs in DRF's flat query-parameter format, augmented by\n * django-filter's double-underscore lookup convention:\n *\n * - Simple filters: `field=value` (multi-value collapses to `field__in=v1,v2`)\n * - Operator filters: `field__lookup=value` (translated from\n * `FilterOperatorEnum` — `GTE`→`__gte`, `ILIKE`→`__icontains`,\n * `BTW`→`__range`, `NULL`→`__isnull`, etc.)\n * - Ordering: `ordering=-field1,field2` (`-` prefix = DESC)\n * - Search: `search=term` (DRF's SearchFilter)\n * - Pagination: `page=N&page_size=M` (PageNumberPagination)\n *\n * `ordering` and `page_size` are DRF-idiomatic param names and are\n * intentionally not configurable via `QueryBuilderOptions` — same\n * precedent as PostgREST's `order` and `offset`. PostgREST's full-text\n * search operators (`FTS`, `PHFTS`, `PLFTS`, `WFTS`) and the generic\n * `NOT` have no django-filter equivalent and throw\n * `UnsupportedFilterOperatorError`.\n *\n * @see https://www.django-rest-framework.org/api-guide/filtering/\n * @see https://django-filter.readthedocs.io/\n */\nexport class DrfRequestStrategy extends AbstractRequestStrategy {\n\n /**\n * Simple filters, operator filters (django-filter lookups), sorts, and\n * global search — no per-model fields, no relation includes, no flat\n * select (django-restql adds it but is not core DRF)\n */\n public readonly capabilities: IStrategyCapabilities = {\n fields: false,\n filters: true,\n includes: false,\n operatorFilters: true,\n search: true,\n select: false,\n sort: true\n };\n\n /**\n * DRF-native names of the three hardcoded query keys\n *\n * `ordering` and `page_size` are DRF/django-filter conventions and are\n * intentionally not configurable through `QueryBuilderOptions`. `page`\n * matches the default `QueryBuilderOptions.page`, and `search` matches\n * the default `QueryBuilderOptions.search`, so those flow through the\n * shared options object.\n */\n private static readonly _orderingKey = 'ordering';\n private static readonly _pageSizeKey = 'page_size';\n\n /**\n * Emit DRF-format query-string segments in canonical order:\n * filters → operator filters → ordering → search → pagination\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @returns Ordered query-string fragments\n */\n protected parts(state: IQueryBuilderState, options: QueryBuilderOptions): string[] {\n const out: string[] = [];\n\n this._appendFilters(state, out);\n this._appendOperatorFilters(state, out);\n this._appendOrdering(state, out);\n this._appendSearch(state, options, out);\n this._appendPagination(state, options, out);\n\n return out;\n }\n\n /**\n * Append simple filter parameters\n *\n * Single-value filters emit `field=value` (django-filter's default\n * exact match). Multi-value filters collapse to django-filter's\n * `field__in=v1,v2,v3` form, which is the idiomatic way to express\n * \"value in list\" in DRF.\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendFilters(state: IQueryBuilderState, out: string[]): void {\n const keys = Object.keys(state.filters);\n\n if (!keys.length) {\n return;\n }\n\n keys.forEach(key => {\n const values = state.filters[key];\n\n if (!values.length) {\n return;\n }\n\n if (values.length === 1) {\n out.push(`${key}=${values[0]}`);\n return;\n }\n\n out.push(`${key}__in=${values.join(',')}`);\n });\n }\n\n /**\n * Append operator-filter parameters as `field__lookup=value`\n *\n * Maps each `FilterOperatorEnum` value to a django-filter lookup\n * suffix. `BTW` expands to `field__range=min,max`; `NULL` emits\n * `field__isnull=true|false`; the generic `NOT` and PostgREST-only\n * FTS operators are unsupported.\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n * @throws {InvalidFilterOperatorValueError} If `BTW` does not receive\n * exactly two values, or `NULL` does not receive exactly one boolean\n * @throws {UnsupportedFilterOperatorError} If the operator has no\n * django-filter equivalent\n */\n private _appendOperatorFilters(state: IQueryBuilderState, out: string[]): void {\n if (!state.operatorFilters.length) {\n return;\n }\n\n state.operatorFilters.forEach((filter: IOperatorFilter) => {\n const [suffix, value] = this._formatOperatorPayload(filter);\n const key = suffix ? `${filter.field}__${suffix}` : filter.field;\n\n out.push(`${key}=${value}`);\n });\n }\n\n /**\n * Append `ordering=-field1,field2` (django's `-` prefix = DESC)\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendOrdering(state: IQueryBuilderState, out: string[]): void {\n if (!state.sorts.length) {\n return;\n }\n\n const pairs = state.sorts.map(sort =>\n `${sort.order === SortEnum.DESC ? '-' : ''}${sort.field}`\n );\n\n out.push(`${DrfRequestStrategy._orderingKey}=${pairs.join(',')}`);\n }\n\n /**\n * Append `page=N&page_size=M`\n *\n * `page` follows `options.page` (default `page`, matching DRF); the\n * size key is hardcoded to DRF's idiomatic `page_size`.\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendPagination(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n out.push(`${options.page}=${state.page}`);\n out.push(`${DrfRequestStrategy._pageSizeKey}=${state.limit}`);\n }\n\n /**\n * Append `search=term` when a search term is set\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSearch(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n if (!state.search) {\n return;\n }\n\n out.push(`${options.search}=${state.search}`);\n }\n\n /**\n * Translate a `FilterOperatorEnum` operator filter into a\n * `[suffix, serializedValue]` pair\n *\n * The suffix is appended to the field name with a `__` separator on the\n * wire side (`field__gte=18`). The empty string means \"no suffix\" —\n * django-filter's implicit `exact` lookup.\n *\n * Mapping:\n * - `EQ` → `''` (no suffix; default exact match)\n * - `GT`/`GTE`/`LT`/`LTE`/`CONTAINS` → identity (lowercased name)\n * - `ILIKE` → `icontains` (closest case-insensitive analog)\n * - `IN` → `in` with comma-joined values\n * - `SW` → `startswith`\n * - `BTW` → `range` with comma-joined `[min, max]` (arity-checked)\n * - `NULL` → `isnull` with boolean value (arity- and type-checked)\n * - `NOT` → `UnsupportedFilterOperatorError` (no generic negation in\n * django-filter; use `__exclude` on the queryset instead)\n * - `FTS`/`PLFTS`/`PHFTS`/`WFTS` → `UnsupportedFilterOperatorError`\n *\n * @param filter - The operator filter to translate\n * @returns A `[lookupSuffix, serializedValue]` tuple\n * @throws {InvalidFilterOperatorValueError} If `BTW` does not receive\n * exactly two values, or `NULL` does not receive exactly one boolean\n * @throws {UnsupportedFilterOperatorError} If the operator has no\n * django-filter equivalent\n */\n private _formatOperatorPayload(filter: IOperatorFilter): [DrfLookupSuffix, string] {\n const { operator, values } = filter;\n const first = values[0];\n\n switch (operator) {\n case FilterOperatorEnum.EQ: return ['', String(first)];\n case FilterOperatorEnum.GT: return ['gt', String(first)];\n case FilterOperatorEnum.GTE: return ['gte', String(first)];\n case FilterOperatorEnum.LT: return ['lt', String(first)];\n case FilterOperatorEnum.LTE: return ['lte', String(first)];\n case FilterOperatorEnum.CONTAINS: return ['contains', String(first)];\n case FilterOperatorEnum.ILIKE: return ['icontains', String(first)];\n case FilterOperatorEnum.IN: return ['in', values.join(',')];\n case FilterOperatorEnum.SW: return ['startswith', String(first)];\n\n case FilterOperatorEnum.BTW: {\n if (values.length !== 2) {\n throw new InvalidFilterOperatorValueError(\n operator,\n 'BTW requires exactly 2 values (min, max)'\n );\n }\n\n return ['range', values.join(',')];\n }\n\n case FilterOperatorEnum.NULL: {\n if (values.length !== 1 || typeof first !== 'boolean') {\n throw new InvalidFilterOperatorValueError(\n operator,\n 'NULL requires exactly 1 boolean value (true → IS NULL, false → IS NOT NULL)'\n );\n }\n\n return ['isnull', String(first)];\n }\n\n case FilterOperatorEnum.NOT:\n case FilterOperatorEnum.FTS:\n case FilterOperatorEnum.PHFTS:\n case FilterOperatorEnum.PLFTS:\n case FilterOperatorEnum.WFTS:\n throw new UnsupportedFilterOperatorError();\n }\n }\n}\n","import { IPaginatedObject } from '../interfaces/paginated-object.interface';\nimport { IResponseStrategy } from '../interfaces/response-strategy.interface';\nimport { PaginatedCollection } from '../models/paginated-collection';\nimport { ResponseOptions } from '../models/response-options';\n\n/**\n * Response strategy for the Django REST Framework (DRF) driver\n *\n * Parses DRF `PageNumberPagination` responses:\n *\n * ```json\n * {\n * \"count\": 100,\n * \"next\": \"http://api.example.com/items/?page=3\",\n * \"previous\": \"http://api.example.com/items/?page=1\",\n * \"results\": [...]\n * }\n * ```\n *\n * DRF emits no `current_page` field in the body, so this strategy\n * **derives** the current page (and the page size) by inspecting the\n * `next` / `previous` URLs:\n *\n * - `previous === null` → current page is **1**.\n * - `previous` set but has no `?page=N` param → DRF omits `page=1` from\n * URLs when the previous page is the first, so we infer **2**.\n * - `previous` has `?page=N` → current page is **N + 1**.\n *\n * Similarly, `perPage` is parsed from any `?page_size=N` query param on\n * `next` or `previous`, and `lastPage` is computed as\n * `ceil(count / perPage)`. When `perPage` cannot be discovered (e.g. on a\n * single-page response that emits both URLs as `null`), `perPage` and\n * `lastPage` are left undefined.\n *\n * Key paths are resolved through `DrfResponseOptions`, which defaults\n * `data → 'results'`, `total → 'count'`, `nextPageUrl → 'next'`,\n * `prevPageUrl → 'previous'`. The current-page / per-page / last-page\n * paths default to empty strings — the strategy ignores `options` for\n * those slots and uses URL inspection instead.\n *\n * @see https://www.django-rest-framework.org/api-guide/pagination/#pagenumberpagination\n */\nexport class DrfResponseStrategy implements IResponseStrategy {\n\n /**\n * Parse a DRF pagination response into a PaginatedCollection\n *\n * @param response - The raw API response body\n * @param options - The response key name configuration\n * @returns A typed PaginatedCollection instance\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public paginate<T extends IPaginatedObject>(response: Record<string, any>, options: ResponseOptions): PaginatedCollection<T> {\n const data = response[options.data] as T[];\n const total = response[options.total] as number | undefined;\n const prevPageUrl = (response[options.prevPageUrl] ?? null) as string | null;\n const nextPageUrl = (response[options.nextPageUrl] ?? null) as string | null;\n\n const currentPage = this._deriveCurrentPage(prevPageUrl);\n const perPage = this._derivePerPage(nextPageUrl, prevPageUrl);\n const lastPage = this._deriveLastPage(total, perPage);\n\n const from = this._deriveFrom(currentPage, perPage);\n const to = this._deriveTo(currentPage, perPage, total);\n\n return new PaginatedCollection(\n data,\n currentPage,\n from,\n to,\n total,\n perPage,\n prevPageUrl ?? undefined,\n nextPageUrl ?? undefined,\n lastPage,\n undefined,\n undefined\n );\n }\n\n /**\n * Derive the current page number from the `previous` URL\n *\n * - `null` → page 1\n * - URL without `?page=N` → page 2 (DRF omits `page=1` from URLs)\n * - URL with `?page=N` → N + 1\n *\n * @param prevPageUrl - The `previous` link from the DRF response, or null\n * @returns The current page number\n */\n private _deriveCurrentPage(prevPageUrl: string | null): number {\n if (prevPageUrl === null) {\n return 1;\n }\n\n const prevPage = this._extractPageParam(prevPageUrl);\n\n return prevPage === undefined ? 2 : prevPage + 1;\n }\n\n /**\n * Derive `from` as the 1-indexed offset of the first item on this page\n *\n * @param currentPage - The current page number\n * @param perPage - The page size (may be undefined)\n * @returns The 1-indexed `from` index, or undefined when perPage is unknown\n */\n private _deriveFrom(currentPage: number, perPage?: number): number | undefined {\n if (!perPage) {\n return undefined;\n }\n\n return (currentPage - 1) * perPage + 1;\n }\n\n /**\n * Derive the last page number as `ceil(total / perPage)`\n *\n * Both inputs must be defined; an empty result set (`total === 0`)\n * yields `lastPage = 0` which the caller treats as \"no useful info\"\n * and skips the sync to `NestService.lastPage`.\n *\n * @param total - The total item count\n * @param perPage - The page size\n * @returns The last page number, or undefined when either input is missing\n */\n private _deriveLastPage(total?: number, perPage?: number): number | undefined {\n if (total === undefined || perPage === undefined || perPage <= 0) {\n return undefined;\n }\n\n return Math.ceil(total / perPage);\n }\n\n /**\n * Derive `perPage` by parsing `?page_size=N` from any available URL\n *\n * Tries `next` first (page 1 always has a `next` URL with `page_size`\n * if any non-default size was requested), then falls back to\n * `previous`. Returns undefined when neither URL contains the param —\n * the consumer is then on a single-page result with the server's\n * default page size, which is not introspectable from the body alone.\n *\n * @param nextPageUrl - The `next` link from the response, or null\n * @param prevPageUrl - The `previous` link from the response, or null\n * @returns The page size, or undefined\n */\n private _derivePerPage(nextPageUrl: string | null, prevPageUrl: string | null): number | undefined {\n return this._extractPageSizeParam(nextPageUrl) ?? this._extractPageSizeParam(prevPageUrl);\n }\n\n /**\n * Derive `to` as the 1-indexed offset of the last item on this page\n *\n * Clamped to `total` so the last page does not report past the end.\n *\n * @param currentPage - The current page number\n * @param perPage - The page size (may be undefined)\n * @param total - The total item count (may be undefined)\n * @returns The 1-indexed `to` index, or undefined when inputs insufficient\n */\n private _deriveTo(currentPage: number, perPage?: number, total?: number): number | undefined {\n if (perPage === undefined || total === undefined) {\n return undefined;\n }\n\n return Math.min(currentPage * perPage, total);\n }\n\n /**\n * Extract the `page` query parameter from a DRF pagination URL\n *\n * Returns the integer value of `?page=N`, or undefined when the URL is\n * malformed or has no `page` param (which, by DRF convention, means\n * page 1 — the caller infers the semantics).\n *\n * @param url - The URL to parse\n * @returns The integer page value, or undefined\n */\n private _extractPageParam(url: string): number | undefined {\n const raw = this._extractQueryParam(url, 'page');\n\n if (raw === undefined) {\n return undefined;\n }\n\n const parsed = Number.parseInt(raw, 10);\n\n return Number.isNaN(parsed) ? undefined : parsed;\n }\n\n /**\n * Extract the `page_size` query parameter from a DRF pagination URL\n *\n * @param url - The URL to parse (or null)\n * @returns The integer page-size value, or undefined\n */\n private _extractPageSizeParam(url: string | null): number | undefined {\n if (url === null) {\n return undefined;\n }\n\n const raw = this._extractQueryParam(url, 'page_size');\n\n if (raw === undefined) {\n return undefined;\n }\n\n const parsed = Number.parseInt(raw, 10);\n\n return Number.isNaN(parsed) ? undefined : parsed;\n }\n\n /**\n * Extract a single query parameter from a URL via the WHATWG URL parser\n *\n * Returns undefined when the URL is unparseable (relative URL without a\n * base, or malformed) or when the parameter is absent.\n *\n * @param url - The URL to parse\n * @param name - The query-parameter name to look up\n * @returns The raw string value of the parameter, or undefined\n */\n private _extractQueryParam(url: string, name: string): string | undefined {\n try {\n const parsed = new URL(url);\n const value = parsed.searchParams.get(name);\n\n return value === null ? undefined : value;\n } catch {\n return undefined;\n }\n }\n}\n","export class UnselectableModelError extends Error {\n constructor(model: string) {\n super(`Unselectable Model: the selected model (${model}) is not present neither in the \"model\" property, nor in the includes object.`);\n }\n}","import * as qs from 'qs';\n\nimport { SortEnum } from '../enums/sort.enum';\nimport { UnselectableModelError } from '../errors/unselectable-model.error';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { IStrategyCapabilities } from '../interfaces/strategy-capabilities.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\nimport { AbstractRequestStrategy } from './abstract-request.strategy';\n\n/**\n * Request strategy for the JSON:API driver\n *\n * Generates URIs in the JSON:API format:\n * - Fields: `fields[articles]=title,body&fields[people]=name`\n * - Filters: `filter[status]=active`\n * - Includes: `include=author,comments.author`\n * - Pagination: `page[number]=1&page[size]=15`\n * - Sort: `sort=-created_at,name` (- prefix = DESC)\n *\n * @see https://jsonapi.org/format/\n */\nexport class JsonApiRequestStrategy extends AbstractRequestStrategy {\n\n /**\n * Filters, sorts, includes, per-model fields — same shape as Spatie\n * but with bracket-style pagination\n */\n public readonly capabilities: IStrategyCapabilities = {\n fields: true,\n filters: true,\n includes: true,\n operatorFilters: false,\n search: false,\n select: false,\n sort: true\n };\n\n /**\n * Emit JSON:API-format query-string segments in canonical order:\n * include → fields → filters → pagination → sort\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @returns Ordered query-string fragments\n */\n protected parts(state: IQueryBuilderState, options: QueryBuilderOptions): string[] {\n const out: string[] = [];\n\n this._appendIncludes(state, options, out);\n this._appendFields(state, options, out);\n this._appendFilters(state, options, out);\n this._appendPagination(state, options, out);\n this._appendSort(state, options, out);\n\n return out;\n }\n\n /**\n * Append per-type field selection in bracket notation\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n * @throws Error if the resource is missing from the fields object\n * @throws UnselectableModelError if a field type is not the resource or in includes\n */\n private _appendFields(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n if (!Object.keys(state.fields).length) {\n return;\n }\n\n if (!(state.resource in state.fields)) {\n throw new Error(`Key ${state.resource} is missing in the fields object`);\n }\n\n const grouped: Record<string, string> = {};\n\n for (const type in state.fields) {\n if (!state.fields.hasOwnProperty(type)) {\n continue;\n }\n\n if (type !== state.resource && !state.includes.includes(type)) {\n throw new UnselectableModelError(type);\n }\n\n grouped[`${options.fields}[${type}]`] = state.fields[type].join(',');\n }\n\n out.push(qs.stringify(grouped, { encode: false }));\n }\n\n /**\n * Append filter parameters in bracket notation: `filter[key]=value`\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendFilters(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n const keys = Object.keys(state.filters);\n\n if (!keys.length) {\n return;\n }\n\n const wrapper = {\n [options.filters]: keys.reduce((acc: Record<string, string>, key: string) => {\n return Object.assign(acc, { [key]: state.filters[key].join(',') });\n }, {})\n };\n\n out.push(qs.stringify(wrapper, { encode: false }));\n }\n\n /**\n * Append include parameter as `include=author,comments.author`\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendIncludes(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n if (!state.includes.length) {\n return;\n }\n\n out.push(`${options.includes}=${state.includes}`);\n }\n\n /**\n * Append JSON:API bracket pagination as `page[number]=1&page[size]=15`\n *\n * `qs.stringify` already returns the two segments joined with `&`, so we\n * push the whole string as one accumulator entry — `_join` will glue\n * it onto the rest with the same separator.\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendPagination(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n const pagination = qs.stringify(\n { [options.page]: { number: state.page, size: state.limit } },\n { encode: false }\n );\n\n out.push(pagination);\n }\n\n /**\n * Append sort parameter as `sort=-field1,field2` (`-` prefix = DESC)\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSort(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n if (!state.sorts.length) {\n return;\n }\n\n const pairs = state.sorts.map(sort =>\n `${sort.order === SortEnum.DESC ? '-' : ''}${sort.field}`\n );\n\n out.push(`${options.sort}=${pairs.join(',')}`);\n }\n}\n","import { IPaginatedObject } from '../interfaces/paginated-object.interface';\nimport { IResponseStrategy } from '../interfaces/response-strategy.interface';\nimport { PaginatedCollection } from '../models/paginated-collection';\nimport { ResponseOptions } from '../models/response-options';\n\n/**\n * Base class for response strategies whose pagination metadata lives at\n * dot-notation paths inside the response body\n *\n * JSON:API and NestJS share an identical body-traversal algorithm: the\n * total / current-page / etc. live at nested keys like `meta.total`, and\n * `from`/`to` are either present directly or must be derived from\n * `currentPage` × `perPage`. Both strategies were duplicating this\n * verbatim before this base existed; concrete classes now extend and\n * provide only the docstring describing their driver's specific path\n * conventions (see `JsonApiResponseStrategy`, `NestjsResponseStrategy`).\n *\n * Drivers whose pagination metadata travels via HTTP headers (PostgREST)\n * or whose body has a flat shape with no dot paths (Laravel, Spatie) do\n * not extend this class — they implement `IResponseStrategy` directly.\n */\nexport abstract class AbstractDotPathResponseStrategy implements IResponseStrategy {\n\n /**\n * Parse a nested-envelope pagination response into a PaginatedCollection\n *\n * @param response - The raw API response object\n * @param options - The response key name configuration (dot-notation paths supported)\n * @returns A typed PaginatedCollection instance\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public paginate<T extends IPaginatedObject>(response: Record<string, any>, options: ResponseOptions): PaginatedCollection<T> {\n const data = this.resolve(response, options.data) as T[];\n const currentPage = this.resolve(response, options.currentPage) as number;\n const total = this.resolve(response, options.total) as number | undefined;\n const perPage = this.resolve(response, options.perPage) as number | undefined;\n const lastPage = this.resolve(response, options.lastPage) as number | undefined;\n\n // Compute from/to if not directly available\n const from = this.resolveFrom(response, options, currentPage, perPage);\n const to = this.resolveTo(response, options, currentPage, perPage, total);\n\n const prevPageUrl = this.resolve(response, options.prevPageUrl) as string | undefined;\n const nextPageUrl = this.resolve(response, options.nextPageUrl) as string | undefined;\n const firstPageUrl = this.resolve(response, options.firstPageUrl) as string | undefined;\n const lastPageUrl = this.resolve(response, options.lastPageUrl) as string | undefined;\n\n return new PaginatedCollection(\n data,\n currentPage,\n from,\n to,\n total,\n perPage,\n prevPageUrl,\n nextPageUrl,\n lastPage,\n firstPageUrl,\n lastPageUrl\n );\n }\n\n /**\n * Resolve a value from a response object using a dot-notation path\n *\n * Supports both flat keys (`'data'`) and nested paths (`'meta.totalItems'`).\n *\n * @param response - The raw response object\n * @param path - The dot-notation path to resolve\n * @returns The resolved value, or undefined if any segment is missing\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n protected resolve(response: Record<string, any>, path: string): unknown {\n return path.split('.').reduce((obj, key) => obj?.[key], response);\n }\n\n /**\n * Resolve the \"from\" index value\n *\n * If `options.from` resolves to a value in the response, use it.\n * Otherwise compute `(currentPage - 1) * perPage + 1` when both are known.\n *\n * @param response - The raw response object\n * @param options - The response key name configuration\n * @param currentPage - The current page number\n * @param perPage - The number of items per page\n * @returns The \"from\" index, or `undefined` when neither path nor inputs suffice\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n protected resolveFrom(response: Record<string, any>, options: ResponseOptions, currentPage: number, perPage?: number): number | undefined {\n const direct = this.resolve(response, options.from);\n\n if (direct !== undefined) {\n return direct as number;\n }\n\n if (currentPage && perPage) {\n return (currentPage - 1) * perPage + 1;\n }\n\n return undefined;\n }\n\n /**\n * Resolve the \"to\" index value\n *\n * If `options.to` resolves to a value in the response, use it.\n * Otherwise compute `Math.min(currentPage * perPage, total)` when all\n * three are known.\n *\n * @param response - The raw response object\n * @param options - The response key name configuration\n * @param currentPage - The current page number\n * @param perPage - The number of items per page\n * @param total - The total number of items\n * @returns The \"to\" index, or `undefined` when neither path nor inputs suffice\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n protected resolveTo(response: Record<string, any>, options: ResponseOptions, currentPage: number, perPage?: number, total?: number): number | undefined {\n const direct = this.resolve(response, options.to);\n\n if (direct !== undefined) {\n return direct as number;\n }\n\n if (currentPage && perPage && total) {\n return Math.min(currentPage * perPage, total);\n }\n\n return undefined;\n }\n}\n","import { AbstractDotPathResponseStrategy } from './abstract-dot-path-response.strategy';\n\n/**\n * Response strategy for the JSON:API driver\n *\n * Parses JSON:API pagination responses:\n * ```json\n * {\n * \"data\": [...],\n * \"meta\": {\n * \"current-page\": 1,\n * \"per-page\": 10,\n * \"total\": 100,\n * \"page-count\": 10,\n * \"from\": 1,\n * \"to\": 10\n * },\n * \"links\": {\n * \"first\": \"url\",\n * \"prev\": \"url\",\n * \"next\": \"url\",\n * \"last\": \"url\"\n * }\n * }\n * ```\n *\n * Default key paths are configured in `JsonApiResponseOptions`. The\n * traversal algorithm (dot-notation resolution + computed `from`/`to`) is\n * inherited from `AbstractDotPathResponseStrategy`; this class exists so\n * `DriverEnum.JSON_API` resolves to a distinct identity at the DI layer\n * even though the parsing logic is shared with NestJS.\n *\n * @see https://jsonapi.org/format/\n */\nexport class JsonApiResponseStrategy extends AbstractDotPathResponseStrategy {}\n","import { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { IStrategyCapabilities } from '../interfaces/strategy-capabilities.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\nimport { AbstractRequestStrategy } from './abstract-request.strategy';\n\n/**\n * Request strategy for the Laravel (pagination-only) driver\n *\n * Generates simple pagination URIs:\n * - `/{resource}?limit=N&page=N`\n *\n * Filters, sorts, fields, includes, search, and select in state are ignored.\n */\nexport class LaravelRequestStrategy extends AbstractRequestStrategy {\n\n /**\n * Pagination-only driver — no filtering, sorting, or column selection\n */\n public readonly capabilities: IStrategyCapabilities = {\n fields: false,\n filters: false,\n includes: false,\n operatorFilters: false,\n search: false,\n select: false,\n sort: false\n };\n\n /**\n * Emit only the pagination params; filters/sorts/etc. are ignored\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @returns The two pagination query-string fragments\n */\n protected parts(state: IQueryBuilderState, options: QueryBuilderOptions): string[] {\n return [\n `${options.limit}=${state.limit}`,\n `${options.page}=${state.page}`\n ];\n }\n}\n","import { IPaginatedObject } from '../interfaces/paginated-object.interface';\nimport { IResponseStrategy } from '../interfaces/response-strategy.interface';\nimport { PaginatedCollection } from '../models/paginated-collection';\nimport { ResponseOptions } from '../models/response-options';\n\n/**\n * Base class for response strategies whose pagination metadata is a flat\n * key-value envelope on the response body\n *\n * Laravel's stock pagination and Spatie's `QueryBuilder` both emit the\n * same flat shape — `{ data, current_page, total, per_page, from, to,\n * next_page_url, prev_page_url, first_page_url, last_page, last_page_url\n * }` — and both response strategies were duplicating the byte-identical\n * `new PaginatedCollection(response[options.X], ...)` body before this\n * base existed. Concrete classes now extend and provide only the\n * docstring describing their driver's specific shape (see\n * `LaravelResponseStrategy`, `SpatieResponseStrategy`).\n *\n * Drivers whose pagination metadata is a nested envelope (JSON:API,\n * NestJS, Strapi) extend `AbstractDotPathResponseStrategy` instead.\n * Drivers whose metadata comes from HTTP headers (PostgREST) or is\n * derived from response URLs (DRF) implement `IResponseStrategy`\n * directly.\n */\nexport abstract class AbstractFlatResponseStrategy implements IResponseStrategy {\n\n /**\n * Parse a flat-envelope pagination response into a PaginatedCollection\n *\n * @param response - The raw API response object\n * @param options - The response key name configuration\n * @returns A typed PaginatedCollection instance\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public paginate<T extends IPaginatedObject>(response: Record<string, any>, options: ResponseOptions): PaginatedCollection<T> {\n return new PaginatedCollection(\n response[options.data],\n response[options.currentPage],\n response[options.from],\n response[options.to],\n response[options.total],\n response[options.perPage],\n response[options.prevPageUrl],\n response[options.nextPageUrl],\n response[options.lastPage],\n response[options.firstPageUrl],\n response[options.lastPageUrl]\n );\n }\n}\n","import { AbstractFlatResponseStrategy } from './abstract-flat-response.strategy';\n\n/**\n * Response strategy for the Laravel (pagination-only) driver\n *\n * Parses flat Laravel pagination responses:\n * ```json\n * {\n * \"data\": [...],\n * \"current_page\": 1,\n * \"total\": 100,\n * \"per_page\": 15,\n * \"from\": 1,\n * \"to\": 15,\n * \"next_page_url\": \"...\",\n * \"prev_page_url\": \"...\",\n * \"first_page_url\": \"...\",\n * \"last_page\": 7,\n * \"last_page_url\": \"...\"\n * }\n * ```\n *\n * The traversal algorithm (flat `response[options.X]` lookups) is\n * inherited from `AbstractFlatResponseStrategy`; this class exists so\n * `DriverEnum.LARAVEL` resolves to a distinct identity at the DI layer\n * even though the parsing logic is shared with Spatie.\n */\nexport class LaravelResponseStrategy extends AbstractFlatResponseStrategy {}\n","import { SortEnum } from '../enums/sort.enum';\nimport { InvalidLimitError } from '../errors/invalid-limit.error';\nimport { IOperatorFilter } from '../interfaces/operator-filter.interface';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { IStrategyCapabilities } from '../interfaces/strategy-capabilities.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\nimport { AbstractRequestStrategy } from './abstract-request.strategy';\n\n/**\n * Request strategy for the NestJS (nestjs-paginate) driver\n *\n * Generates URIs in the NestJS paginate format:\n * - Simple filters: `filter.field=value`\n * - Operator filters: `filter.field=$operator:value`\n * - Sorts: `sortBy=field1:DESC,field2:ASC`\n * - Select: `select=col1,col2`\n * - Search: `search=term`\n * - Pagination: `limit=N&page=N`\n *\n * @see https://github.com/ppetzold/nestjs-paginate\n */\nexport class NestjsRequestStrategy extends AbstractRequestStrategy {\n\n /**\n * Filters, operator filters, sorts, flat select, global search — no\n * per-model fields, no includes\n */\n public readonly capabilities: IStrategyCapabilities = {\n fields: false,\n filters: true,\n includes: false,\n operatorFilters: true,\n search: true,\n select: true,\n sort: true\n };\n\n /**\n * Validate that the given limit is accepted by nestjs-paginate\n *\n * Accepts any integer `>= 1` as a page size, plus `-1` which nestjs-paginate\n * interprets as \"fetch all items\" (server must opt-in via `maxLimit: -1`).\n *\n * @param limit - The limit value to validate\n * @throws {InvalidLimitError} If the value is not an integer, or is 0, or is a negative number other than -1\n */\n public override validateLimit(limit: number): void {\n if (Number.isInteger(limit) && (limit === -1 || limit >= 1)) {\n return;\n }\n\n throw new InvalidLimitError(limit, true);\n }\n\n /**\n * Emit NestJS-format query-string segments in canonical order:\n * filters → operator filters → sortBy → select → search → limit → page\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @returns Ordered query-string fragments\n */\n protected parts(state: IQueryBuilderState, options: QueryBuilderOptions): string[] {\n const out: string[] = [];\n\n this._appendFilters(state, options, out);\n this._appendOperatorFilters(state, options, out);\n this._appendSort(state, options, out);\n this._appendSelect(state, options, out);\n this._appendSearch(state, options, out);\n this._appendLimit(state, options, out);\n this._appendPage(state, options, out);\n\n return out;\n }\n\n /**\n * Append simple filter parameters as `filter.field=value1,value2`\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendFilters(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n const keys = Object.keys(state.filters);\n\n if (!keys.length) {\n return;\n }\n\n keys.forEach(key => {\n const values = state.filters[key].join(',');\n out.push(`${options.filters}.${key}=${values}`);\n });\n }\n\n /**\n * Append the limit parameter\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendLimit(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n out.push(`${options.limit}=${state.limit}`);\n }\n\n /**\n * Append operator-filter parameters as `filter.field=$op:value`\n *\n * Groups by field; multi-value operators ($in, $btw) join values with commas.\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendOperatorFilters(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n if (!state.operatorFilters.length) {\n return;\n }\n\n state.operatorFilters.forEach((opFilter: IOperatorFilter) => {\n const values = opFilter.values.join(',');\n out.push(`${options.filters}.${opFilter.field}=${opFilter.operator}:${values}`);\n });\n }\n\n /**\n * Append the page parameter\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendPage(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n out.push(`${options.page}=${state.page}`);\n }\n\n /**\n * Append the search parameter as `search=term`\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSearch(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n if (!state.search) {\n return;\n }\n\n out.push(`${options.search}=${state.search}`);\n }\n\n /**\n * Append the select parameter as `select=col1,col2`\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSelect(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n if (!state.select.length) {\n return;\n }\n\n out.push(`${options.select}=${state.select.join(',')}`);\n }\n\n /**\n * Append sort parameter as `sortBy=field1:DESC,field2:ASC`\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSort(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n if (!state.sorts.length) {\n return;\n }\n\n const pairs = state.sorts.map(sort =>\n `${sort.field}:${sort.order === SortEnum.DESC ? 'DESC' : 'ASC'}`\n );\n\n out.push(`${options.sortBy}=${pairs.join(',')}`);\n }\n}\n","import { AbstractDotPathResponseStrategy } from './abstract-dot-path-response.strategy';\n\n/**\n * Response strategy for the NestJS (nestjs-paginate) driver\n *\n * Parses nested NestJS pagination responses:\n * ```json\n * {\n * \"data\": [...],\n * \"meta\": {\n * \"currentPage\": 1,\n * \"totalItems\": 100,\n * \"itemsPerPage\": 10,\n * \"totalPages\": 10\n * },\n * \"links\": {\n * \"first\": \"url\",\n * \"previous\": \"url\",\n * \"next\": \"url\",\n * \"last\": \"url\",\n * \"current\": \"url\"\n * }\n * }\n * ```\n *\n * Default key paths are configured in `NestjsResponseOptions`. The\n * traversal algorithm (dot-notation resolution + computed `from`/`to`) is\n * inherited from `AbstractDotPathResponseStrategy`; this class exists so\n * `DriverEnum.NESTJS` resolves to a distinct identity at the DI layer\n * even though the parsing logic is shared with JSON:API.\n *\n * @see https://github.com/ppetzold/nestjs-paginate\n */\nexport class NestjsResponseStrategy extends AbstractDotPathResponseStrategy {}\n","/**\n * Enum representing the wire-level pagination mechanism\n *\n * `QUERY` (default) — the request strategy emits `limit` and `offset` (or\n * equivalent) query parameters on the URL.\n *\n * `RANGE` — the request strategy omits URL-based pagination and the\n * consumer instead applies HTTP request headers returned by\n * `NgQubeeService.paginationHeaders()`. Currently honoured only by the\n * PostgREST driver, which maps it to `Range-Unit: items` + `Range: 0-9`.\n * Other drivers ignore the setting.\n */\nexport enum PaginationModeEnum {\n QUERY = 'query',\n RANGE = 'range'\n}\n","import { FilterOperatorEnum } from '../enums/filter-operator.enum';\nimport { PaginationModeEnum } from '../enums/pagination-mode.enum';\nimport { SortEnum } from '../enums/sort.enum';\nimport { InvalidFilterOperatorValueError } from '../errors/invalid-filter-operator-value.error';\nimport { IOperatorFilter } from '../interfaces/operator-filter.interface';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { IStrategyCapabilities } from '../interfaces/strategy-capabilities.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\nimport { AbstractRequestStrategy } from './abstract-request.strategy';\n\n/**\n * Request strategy for the PostgREST driver\n *\n * PostgREST auto-generates REST APIs from PostgreSQL schemas and is the\n * backbone of Supabase's data API. This strategy produces URIs in\n * PostgREST's native query-string format:\n *\n * - Filters: `col=eq.val` (single value) / `col=in.(v1,v2,v3)` (multi-value)\n * - Order: `order=col1.asc,col2.desc`\n * - Select: `select=col1,col2`\n * - Pagination: `limit=N&offset=M` (offset derived from state.page)\n *\n * The `order` and `offset` query-parameter names are PostgREST conventions\n * and are intentionally not configurable via `QueryBuilderOptions` (see\n * issue #50 MVP scope). `limit`, `select`, and `filters` (per-column name)\n * honour the existing option keys.\n *\n * @see https://postgrest.org/en/stable/api.html\n * @see https://supabase.com/docs/reference/javascript/select\n */\nexport class PostgrestRequestStrategy extends AbstractRequestStrategy {\n\n /**\n * Filters, operator filters (incl. FTS), sorts, flat select — no\n * per-model fields, no JSON:API/Spatie-style includes, no global\n * search (per-column FTS via the operator family covers it)\n */\n public readonly capabilities: IStrategyCapabilities = {\n fields: false,\n filters: true,\n includes: false,\n operatorFilters: true,\n search: false,\n select: true,\n sort: true\n };\n\n private static readonly _offsetKey = 'offset';\n private static readonly _orderKey = 'order';\n\n /**\n * Active pagination mode\n *\n * QUERY (default) → URL emits limit/offset.\n * RANGE → URL omits them; `buildPaginationHeaders()` returns the\n * `Range-Unit` / `Range` HTTP headers instead.\n */\n private readonly _paginationMode: PaginationModeEnum;\n\n /**\n * @param paginationMode - Wire-level pagination mechanism. Defaults to\n * `PaginationModeEnum.QUERY`; `provideNgQubee` wires this from\n * `IConfig.pagination`.\n */\n constructor(paginationMode: PaginationModeEnum = PaginationModeEnum.QUERY) {\n super();\n this._paginationMode = paginationMode;\n }\n\n /**\n * Compute `Range-Unit` / `Range` HTTP headers for RANGE pagination mode\n *\n * In QUERY mode this returns `null` so `NgQubeeService.paginationHeaders()`\n * conveys \"no headers needed\" to the consumer. In RANGE mode the method\n * converts the 1-indexed `state.page` + `state.limit` into PostgREST's\n * 0-indexed inclusive range (`from = (page - 1) * limit`,\n * `to = from + limit - 1`) and returns both header values.\n *\n * @param state - The current query builder state\n * @returns `{ 'Range-Unit': 'items', 'Range': 'from-to' }` or `null`\n */\n public buildPaginationHeaders(state: IQueryBuilderState): Record<string, string> | null {\n if (this._paginationMode !== PaginationModeEnum.RANGE) {\n return null;\n }\n\n const from = (state.page - 1) * state.limit;\n const to = from + state.limit - 1;\n\n /* eslint-disable @typescript-eslint/naming-convention */\n return {\n 'Range-Unit': 'items',\n 'Range': `${from}-${to}`\n };\n /* eslint-enable @typescript-eslint/naming-convention */\n }\n\n /**\n * Emit PostgREST-format query-string segments in canonical order:\n * filters → operator filters → order → select → (limit + offset in\n * QUERY mode only — RANGE mode passes pagination via headers instead)\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @returns Ordered query-string fragments\n */\n protected parts(state: IQueryBuilderState, options: QueryBuilderOptions): string[] {\n const out: string[] = [];\n\n this._appendFilters(state, out);\n this._appendOperatorFilters(state, out);\n this._appendOrder(state, out);\n this._appendSelect(state, options, out);\n\n if (this._paginationMode === PaginationModeEnum.QUERY) {\n this._appendLimit(state, options, out);\n this._appendOffset(state, out);\n }\n\n return out;\n }\n\n /**\n * Append filter parameters in PostgREST format\n *\n * Every filter is operator-prefixed (PostgREST has no implicit equality):\n * a single value yields `col=eq.val`; multiple values collapse into\n * PostgREST's native IN-list syntax `col=in.(v1,v2,v3)`.\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendFilters(state: IQueryBuilderState, out: string[]): void {\n const keys = Object.keys(state.filters);\n\n if (!keys.length) {\n return;\n }\n\n keys.forEach(key => {\n const values = state.filters[key];\n\n if (!values.length) {\n return;\n }\n\n // single-value → eq.<val>\n // multi-value → in.(v1,v2,v3)\n const rhs = values.length === 1\n ? `eq.${values[0]}`\n : `in.(${values.join(',')})`;\n\n out.push(`${key}=${rhs}`);\n });\n }\n\n /**\n * Append the limit parameter\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendLimit(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n out.push(`${options.limit}=${state.limit}`);\n }\n\n /**\n * Append the offset parameter, derived from state.page\n *\n * PostgREST uses offset-based pagination, not page-based. The offset is\n * computed as `(page - 1) * limit`. Omitted when offset would be 0\n * (i.e. page 1) since PostgREST defaults to offset=0 anyway and dropping\n * it keeps the URI shorter.\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendOffset(state: IQueryBuilderState, out: string[]): void {\n const offset = (state.page - 1) * state.limit;\n\n if (offset <= 0) {\n return;\n }\n\n out.push(`${PostgrestRequestStrategy._offsetKey}=${offset}`);\n }\n\n /**\n * Append explicit operator filters\n *\n * Maps each `FilterOperatorEnum` value to PostgREST's prefix-operator\n * syntax. `BTW` expands to two query params (`gte` + `lte`); `NULL`\n * emits `is.null` / `is.not.null` based on the boolean value; `NOT`\n * picks its inner operator by arity (`not.eq.val` for single values,\n * `not.in.(v1,v2)` for multi-value).\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n * @throws {InvalidFilterOperatorValueError} If `BTW` does not receive exactly 2 values, or `NULL` does not receive exactly 1 boolean\n */\n private _appendOperatorFilters(state: IQueryBuilderState, out: string[]): void {\n if (!state.operatorFilters.length) {\n return;\n }\n\n state.operatorFilters.forEach(filter => {\n // BTW expands to two segments: col=gte.min and col=lte.max\n if (filter.operator === FilterOperatorEnum.BTW) {\n this._appendBetweenFilter(filter, out);\n return;\n }\n\n const rhs = this._formatOperatorRhs(filter);\n out.push(`${filter.field}=${rhs}`);\n });\n }\n\n /**\n * Append a `BTW` operator filter as two PostgREST segments\n *\n * Produces: `col=gte.min` and `col=lte.max`. Values must be exactly\n * `[min, max]`.\n *\n * @param filter - The operator filter carrying the BTW bounds\n * @param out - The accumulator the caller joins into the URI\n * @throws {InvalidFilterOperatorValueError} If values.length !== 2\n */\n private _appendBetweenFilter(filter: IOperatorFilter, out: string[]): void {\n if (filter.values.length !== 2) {\n throw new InvalidFilterOperatorValueError(\n filter.operator,\n 'BTW requires exactly 2 values (min, max)'\n );\n }\n\n const [min, max] = filter.values;\n\n out.push(`${filter.field}=gte.${min}`);\n out.push(`${filter.field}=lte.${max}`);\n }\n\n /**\n * Build the right-hand-side of a PostgREST filter param for the given operator\n *\n * Kept as a separate helper so each operator's shape is visible in one\n * place and the dispatch is exhaustively typed against\n * `FilterOperatorEnum`.\n *\n * @param filter - The operator filter (field, operator, values)\n * @returns The PostgREST-formatted value portion (right of the `=` sign)\n * @throws {InvalidFilterOperatorValueError} If NULL receives a non-boolean or wrong arity\n */\n private _formatOperatorRhs(filter: IOperatorFilter): string {\n const { operator, values } = filter;\n const first = values[0];\n\n switch (operator) {\n case FilterOperatorEnum.EQ: return `eq.${first}`;\n case FilterOperatorEnum.GT: return `gt.${first}`;\n case FilterOperatorEnum.GTE: return `gte.${first}`;\n case FilterOperatorEnum.LT: return `lt.${first}`;\n case FilterOperatorEnum.LTE: return `lte.${first}`;\n case FilterOperatorEnum.ILIKE: return `ilike.${first}`;\n case FilterOperatorEnum.IN: return `in.(${values.join(',')})`;\n case FilterOperatorEnum.SW: return `like.${first}*`;\n case FilterOperatorEnum.CONTAINS: return `ilike.%${first}%`;\n case FilterOperatorEnum.FTS: return `fts.${first}`;\n case FilterOperatorEnum.PLFTS: return `plfts.${first}`;\n case FilterOperatorEnum.PHFTS: return `phfts.${first}`;\n case FilterOperatorEnum.WFTS: return `wfts.${first}`;\n\n case FilterOperatorEnum.NOT:\n return values.length === 1\n ? `not.eq.${first}`\n : `not.in.(${values.join(',')})`;\n\n case FilterOperatorEnum.NULL: {\n if (values.length !== 1 || typeof first !== 'boolean') {\n throw new InvalidFilterOperatorValueError(\n operator,\n 'NULL requires exactly 1 boolean value (true → IS NULL, false → IS NOT NULL)'\n );\n }\n\n return first ? 'is.null' : 'is.not.null';\n }\n\n // BTW is dispatched by _appendOperatorFilters; falling through would be a bug\n case FilterOperatorEnum.BTW:\n throw new InvalidFilterOperatorValueError(\n operator,\n 'BTW should be dispatched to _appendBetweenFilter — this indicates a bug'\n );\n }\n }\n\n /**\n * Append the order parameter as `order=col1.asc,col2.desc`\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendOrder(state: IQueryBuilderState, out: string[]): void {\n if (!state.sorts.length) {\n return;\n }\n\n const pairs = state.sorts.map(sort =>\n `${sort.field}.${sort.order === SortEnum.DESC ? 'desc' : 'asc'}`\n );\n\n out.push(`${PostgrestRequestStrategy._orderKey}=${pairs.join(',')}`);\n }\n\n /**\n * Append the select parameter as `select=col1,col2`\n *\n * PostgREST uses a `select` query param for column pruning, matching\n * NestJS semantics.\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSelect(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n if (!state.select.length) {\n return;\n }\n\n out.push(`${options.select}=${state.select.join(',')}`);\n }\n}\n","/**\n * A minimal bag of HTTP response headers that a response strategy can read\n * by name.\n *\n * Accepts anything that exposes a `.get(name): string | null` method\n * (Angular's `HttpHeaders`, the DOM `Headers` class) or a plain object\n * keyed by header name. Consumers should not need to convert between them.\n */\nexport type HeaderBag =\n | { get(name: string): string | null }\n | Record<string, string | null | undefined>;\n\n/**\n * Read a header value by name from a `HeaderBag`, regardless of whether the\n * bag exposes a `.get()` accessor or plain property access.\n *\n * @param bag - The header bag to read from\n * @param name - The header name (case-sensitivity follows the underlying bag)\n * @returns The header value, or `null` if absent or the bag itself is falsy\n */\nexport function readHeader(bag: HeaderBag | null | undefined, name: string): string | null {\n if (!bag) {\n return null;\n }\n\n const accessor = bag as { get?: (name: string) => string | null };\n\n if (typeof accessor.get === 'function') {\n return accessor.get(name);\n }\n\n const value = (bag as Record<string, string | null | undefined>)[name];\n\n return value ?? null;\n}\n","import { HeaderBag, readHeader } from '../interfaces/header-bag.interface';\nimport { IPaginatedObject } from '../interfaces/paginated-object.interface';\nimport { IResponseStrategy } from '../interfaces/response-strategy.interface';\nimport { PaginatedCollection } from '../models/paginated-collection';\nimport { ResponseOptions } from '../models/response-options';\n\n/**\n * Internal shape holding the three values parsed out of a `Content-Range`\n * header. All three are optional because PostgREST may legitimately emit a\n * malformed header (or none at all, when the client didn't opt into counts\n * via `Prefer: count=exact`).\n */\ninterface IContentRangeParts {\n from?: number;\n to?: number;\n total?: number;\n}\n\n/**\n * Response strategy for the PostgREST driver\n *\n * PostgREST (and Supabase, which wraps it) returns a bare array body for\n * collection endpoints. Pagination metadata is carried in the\n * `Content-Range` HTTP response header, e.g. `0-9/50` meaning \"items 0–9\n * out of 50 total\". Consumers opt into totals by sending the\n * `Prefer: count=exact` request header.\n *\n * This strategy expects the consumer to pass the array body as `response`\n * (or a plain object with `response[options.data]` pointing at the array)\n * and the response headers via the optional `headers` bag. See\n * `PaginationService.paginate()` for the call-site shape.\n *\n * @see https://postgrest.org/en/stable/references/api/pagination_count.html\n */\nexport class PostgrestResponseStrategy implements IResponseStrategy {\n\n private static readonly _contentRangeHeader = 'Content-Range';\n private static readonly _contentRangeRegex = /^(\\d+)-(\\d+)\\/(\\*|\\d+)$/;\n\n /**\n * Parse a PostgREST response into a typed PaginatedCollection\n *\n * @param response - The raw response. Either the array body directly, or\n * an object with the array at `response[options.data]`.\n * @param options - The response key configuration (only `options.data` is\n * consulted; all pagination metadata comes from the Content-Range header).\n * @param headers - Optional HTTP response headers. The `Content-Range`\n * header drives page/total derivation; omission is tolerated and yields\n * a collection with `undefined` bounds (auto-sync will leave\n * `isLastPageKnown` at `false`).\n * @returns A typed PaginatedCollection instance\n */\n public paginate<T extends IPaginatedObject>(\n response: Record<string, unknown>,\n options: ResponseOptions,\n headers?: HeaderBag\n ): PaginatedCollection<T> {\n // Body may be a bare array or an envelope with the array at options.data\n const data = (Array.isArray(response) ? response : response[options.data]) as T[];\n\n // Header-driven pagination metadata\n const contentRange = readHeader(headers, PostgrestResponseStrategy._contentRangeHeader);\n const { from, to, total } = this._parseContentRange(contentRange);\n\n // Per-page can only be derived from the from/to range; fall back to undefined\n const perPage = (from !== undefined && to !== undefined) ? (to - from + 1) : undefined;\n\n // Page is 1-based in ng-qubee state; PostgREST reports 0-based indices\n const page = (perPage && from !== undefined) ? Math.floor(from / perPage) + 1 : 1;\n const lastPage = (total !== undefined && perPage) ? Math.ceil(total / perPage) : undefined;\n\n // Library convention: from/to are 1-indexed and inclusive; PostgREST emits 0-indexed\n const fromOneIndexed = from !== undefined ? from + 1 : undefined;\n const toOneIndexed = to !== undefined ? to + 1 : undefined;\n\n // PostgREST does not emit page URLs, so prev/next/first/last URLs stay undefined\n return new PaginatedCollection<T>(\n data,\n page,\n fromOneIndexed,\n toOneIndexed,\n total,\n perPage,\n undefined,\n undefined,\n lastPage\n );\n }\n\n /**\n * Extract `{from, to, total}` from a PostgREST `Content-Range` value\n *\n * Expected format: `<from>-<to>/<total|*>`. Any shape mismatch returns\n * an empty object; `*` as the total yields `total: undefined`.\n *\n * @param value - Raw header value (possibly null/undefined)\n * @returns Parsed integers; missing fields indicate an unparseable header\n */\n private _parseContentRange(value: string | null | undefined): IContentRangeParts {\n if (!value) {\n return {};\n }\n\n const match = value.trim().match(PostgrestResponseStrategy._contentRangeRegex);\n\n if (!match) {\n return {};\n }\n\n const from = parseInt(match[1], 10);\n const to = parseInt(match[2], 10);\n const total = match[3] === '*' ? undefined : parseInt(match[3], 10);\n\n return { from, to, total };\n }\n}\n","import * as qs from 'qs';\n\nimport { SortEnum } from '../enums/sort.enum';\nimport { UnselectableModelError } from '../errors/unselectable-model.error';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { IStrategyCapabilities } from '../interfaces/strategy-capabilities.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\nimport { AbstractRequestStrategy } from './abstract-request.strategy';\n\n/**\n * Request strategy for the Spatie Query Builder driver\n *\n * Generates URIs in the Spatie format:\n * - Fields: `fields[model]=col1,col2`\n * - Filters: `filter[field]=value`\n * - Includes: `include=model1,model2`\n * - Sorts: `sort=-field1,field2` (- prefix = DESC)\n * - Pagination: `limit=N&page=N`\n *\n * @see https://spatie.be/docs/laravel-query-builder\n */\nexport class SpatieRequestStrategy extends AbstractRequestStrategy {\n\n /**\n * Filters, sorts, includes, per-model fields — no operators, no flat\n * select, no global search\n */\n public readonly capabilities: IStrategyCapabilities = {\n fields: true,\n filters: true,\n includes: true,\n operatorFilters: false,\n search: false,\n select: false,\n sort: true\n };\n\n /**\n * Emit Spatie-format query-string segments in canonical order:\n * include → fields → filters → limit → page → sort\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @returns Ordered query-string fragments\n */\n protected parts(state: IQueryBuilderState, options: QueryBuilderOptions): string[] {\n const out: string[] = [];\n\n this._appendIncludes(state, options, out);\n this._appendFields(state, options, out);\n this._appendFilters(state, options, out);\n this._appendLimit(state, options, out);\n this._appendPage(state, options, out);\n this._appendSort(state, options, out);\n\n return out;\n }\n\n /**\n * Append per-model field selection in bracket notation\n *\n * Validates that each field model exists either as the main resource\n * or in the includes list.\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n * @throws Error if the resource is required but not set\n * @throws UnselectableModelError if a field model is not in resource or includes\n */\n private _appendFields(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n if (!Object.keys(state.fields).length) {\n return;\n }\n\n if (!(state.resource in state.fields)) {\n throw new Error(`Key ${state.resource} is missing in the fields object`);\n }\n\n const grouped: Record<string, string> = {};\n\n for (const model in state.fields) {\n if (!state.fields.hasOwnProperty(model)) {\n continue;\n }\n\n if (model !== state.resource && !state.includes.includes(model)) {\n throw new UnselectableModelError(model);\n }\n\n grouped[`${options.fields}[${model}]`] = state.fields[model].join(',');\n }\n\n out.push(qs.stringify(grouped, { encode: false }));\n }\n\n /**\n * Append filter parameters in bracket notation: `filter[key]=value`\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendFilters(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n const keys = Object.keys(state.filters);\n\n if (!keys.length) {\n return;\n }\n\n const wrapper = {\n [options.filters]: keys.reduce((acc: Record<string, string>, key: string) => {\n return Object.assign(acc, { [key]: state.filters[key].join(',') });\n }, {})\n };\n\n out.push(qs.stringify(wrapper, { encode: false }));\n }\n\n /**\n * Append include parameter as `include=model1,model2`\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendIncludes(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n if (!state.includes.length) {\n return;\n }\n\n out.push(`${options.includes}=${state.includes}`);\n }\n\n /**\n * Append the limit parameter\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendLimit(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n out.push(`${options.limit}=${state.limit}`);\n }\n\n /**\n * Append the page parameter\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendPage(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n out.push(`${options.page}=${state.page}`);\n }\n\n /**\n * Append sort parameter as `sort=-field1,field2` (`-` prefix = DESC)\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSort(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n if (!state.sorts.length) {\n return;\n }\n\n const pairs = state.sorts.map(sort =>\n `${sort.order === SortEnum.DESC ? '-' : ''}${sort.field}`\n );\n\n out.push(`${options.sort}=${pairs.join(',')}`);\n }\n}\n","import { AbstractFlatResponseStrategy } from './abstract-flat-response.strategy';\n\n/**\n * Response strategy for the Spatie Query Builder driver\n *\n * Parses flat Laravel-style pagination responses (Spatie's Query Builder\n * is built on Laravel's pagination):\n * ```json\n * {\n * \"data\": [...],\n * \"current_page\": 1,\n * \"total\": 100,\n * \"per_page\": 15,\n * \"from\": 1,\n * \"to\": 15,\n * ...\n * }\n * ```\n *\n * The traversal algorithm (flat `response[options.X]` lookups) is\n * inherited from `AbstractFlatResponseStrategy`; this class exists so\n * `DriverEnum.SPATIE` resolves to a distinct identity at the DI layer\n * even though the parsing logic is shared with the plain Laravel driver.\n *\n * @see https://spatie.be/docs/laravel-query-builder\n */\nexport class SpatieResponseStrategy extends AbstractFlatResponseStrategy {}\n","import * as qs from 'qs';\n\nimport { FilterOperatorEnum } from '../enums/filter-operator.enum';\nimport { SortEnum } from '../enums/sort.enum';\nimport { InvalidFilterOperatorValueError } from '../errors/invalid-filter-operator-value.error';\nimport { UnsupportedFilterOperatorError } from '../errors/unsupported-filter-operator.error';\nimport { IOperatorFilter } from '../interfaces/operator-filter.interface';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { IStrategyCapabilities } from '../interfaces/strategy-capabilities.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\nimport { AbstractRequestStrategy } from './abstract-request.strategy';\n\n/**\n * Right-hand-side payload of a Strapi `filters[field]` entry\n *\n * Each `$operator` key maps to either a primitive (single-value operators\n * like `$eq`, `$gt`) or an array (multi-value operators like `$in`,\n * `$between`). Booleans appear specifically with `$null` / `$notNull`.\n */\ntype StrapiFilterValue = string | number | boolean;\ntype StrapiFilterPayload = Record<string, StrapiFilterValue | StrapiFilterValue[]>;\n\n/**\n * Request strategy for the Strapi driver\n *\n * Generates URIs in [Strapi's filter API format](https://docs.strapi.io/dev-docs/api/rest/filters-locale-publication):\n * - Filters: `filters[field][$eq]=value` (multi-value collapses to `$in`)\n * - Operator filters: `filters[field][$op]=value` (translated from\n * `FilterOperatorEnum` — `BTW`→`$between`, `SW`→`$startsWith`,\n * `ILIKE`→`$containsi`, `NOT`→`$ne`/`$notIn`,\n * `NULL`→`$null`/`$notNull`)\n * - Sorts: `sort[0]=field:asc&sort[1]=field:desc`\n * - Field selection (flat): `fields[0]=col1&fields[1]=col2`\n * - Population: `populate[0]=relation`\n * - Pagination (page-based): `pagination[page]=N&pagination[pageSize]=N`\n *\n * Strapi-native full-text search (`FTS`, `PHFTS`, `PLFTS`, `WFTS`) is\n * PostgREST-only and throws `UnsupportedFilterOperatorError` here.\n *\n * @see https://docs.strapi.io/dev-docs/api/rest/filters-locale-publication\n */\nexport class StrapiRequestStrategy extends AbstractRequestStrategy {\n\n /**\n * Filters, operator filters, sorts, populate (`includes`), flat field\n * selection (`select`) — no per-model fields, no global search (use\n * `$contains` / `$containsi` operator filters instead)\n */\n public readonly capabilities: IStrategyCapabilities = {\n fields: false,\n filters: true,\n includes: true,\n operatorFilters: true,\n search: false,\n select: true,\n sort: true\n };\n\n /**\n * Strapi-native names of the four hardcoded query keys\n *\n * Strapi's wire format is fixed (the server reads `pagination[page]`,\n * `populate`, `sort`, `fields`); these keys are intentionally not\n * configurable through `QueryBuilderOptions` and live as private\n * statics so they are visible in one place.\n */\n private static readonly _fieldsKey = 'fields';\n private static readonly _paginationKey = 'pagination';\n private static readonly _populateKey = 'populate';\n private static readonly _sortKey = 'sort';\n\n /**\n * Emit Strapi-format query-string segments in canonical order:\n * populate → fields → filters (merged) → sort → pagination\n *\n * Simple filters and operator filters share a single `filters` wrapper\n * so qs emits one ordered, deeply-nested bracket structure rather than\n * two duplicate top-level `filters[...]` blocks.\n *\n * @param state - The current query builder state\n * @param _options - The query parameter key name configuration (unused;\n * Strapi's wire keys are fixed by the server)\n * @returns Ordered query-string fragments\n */\n protected parts(state: IQueryBuilderState, _options: QueryBuilderOptions): string[] {\n const out: string[] = [];\n\n this._appendPopulate(state, out);\n this._appendFields(state, out);\n this._appendFilters(state, out);\n this._appendSort(state, out);\n this._appendPagination(state, out);\n\n return out;\n }\n\n /**\n * Append `fields[0]=col1&fields[1]=col2` from the flat select array\n *\n * Strapi's `fields` parameter is the column-pruner for the main\n * resource; per-relation field selection is expressed through the\n * `populate` deep syntax (out of scope for this driver).\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendFields(state: IQueryBuilderState, out: string[]): void {\n if (!state.select.length) {\n return;\n }\n\n out.push(qs.stringify({ [StrapiRequestStrategy._fieldsKey]: state.select }, { encode: false }));\n }\n\n /**\n * Append the unified `filters[...]` wrapper combining simple filters\n * and operator filters\n *\n * Both kinds emit into the same nested object under `filters` so qs\n * produces a single deeply-bracketed block per request. Simple\n * single-value filters fold to `$eq`; simple multi-value filters fold\n * to `$in`. Operator filters then merge into the same per-field map,\n * potentially co-existing with a simple filter on the same field.\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendFilters(state: IQueryBuilderState, out: string[]): void {\n const simpleKeys = Object.keys(state.filters);\n\n if (!simpleKeys.length && !state.operatorFilters.length) {\n return;\n }\n\n const filters: Record<string, StrapiFilterPayload> = {};\n\n simpleKeys.forEach(key => {\n const values = state.filters[key];\n\n if (!values.length) {\n return;\n }\n\n filters[key] = values.length === 1\n ? { $eq: values[0] }\n : { $in: values };\n });\n\n state.operatorFilters.forEach((filter: IOperatorFilter) => {\n const payload = this._formatOperatorPayload(filter);\n\n filters[filter.field] = {\n ...(filters[filter.field] ?? {}),\n ...payload\n };\n });\n\n if (!Object.keys(filters).length) {\n return;\n }\n\n out.push(qs.stringify({ filters }, { encode: false }));\n }\n\n /**\n * Append the `pagination[page]` / `pagination[pageSize]` wrapper\n *\n * Page-based mode is the Strapi default; offset-based\n * (`pagination[start]` / `pagination[limit]`) is out of scope for this\n * driver until cursor/offset pagination lands library-wide.\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendPagination(state: IQueryBuilderState, out: string[]): void {\n const wrapper = {\n [StrapiRequestStrategy._paginationKey]: {\n page: state.page,\n pageSize: state.limit\n }\n };\n\n out.push(qs.stringify(wrapper, { encode: false }));\n }\n\n /**\n * Append the `populate` parameter from the includes array\n *\n * Emits `populate[0]=relation1&populate[1]=relation2`; deep-populate\n * syntax (`populate[author][fields][0]=name`) is not exposed through\n * the current state shape.\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendPopulate(state: IQueryBuilderState, out: string[]): void {\n if (!state.includes.length) {\n return;\n }\n\n out.push(qs.stringify({ [StrapiRequestStrategy._populateKey]: state.includes }, { encode: false }));\n }\n\n /**\n * Append the `sort[N]=field:dir` array\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSort(state: IQueryBuilderState, out: string[]): void {\n if (!state.sorts.length) {\n return;\n }\n\n const pairs = state.sorts.map(sort =>\n `${sort.field}:${sort.order === SortEnum.DESC ? 'desc' : 'asc'}`\n );\n\n out.push(qs.stringify({ [StrapiRequestStrategy._sortKey]: pairs }, { encode: false }));\n }\n\n /**\n * Translate a `FilterOperatorEnum` operator filter into Strapi's\n * `$operator → value` payload shape\n *\n * The mapping is library-canonical → Strapi-native:\n * - `EQ`/`GT`/`GTE`/`LT`/`LTE`/`CONTAINS` → identity (same key name)\n * - `ILIKE` → `$containsi` (case-insensitive contains)\n * - `IN` → `$in` (array)\n * - `SW` → `$startsWith`\n * - `BTW` → `$between` with `[min, max]` (arity-checked)\n * - `NOT` → `$ne` (single value) / `$notIn` (multi-value)\n * - `NULL` → `$null=true` (when value is `true`) / `$notNull=true`\n * (when value is `false`); arity- and type-checked\n *\n * PostgREST's full-text-search operators (`FTS`, `PHFTS`, `PLFTS`,\n * `WFTS`) have no Strapi equivalent and throw\n * `UnsupportedFilterOperatorError`.\n *\n * @param filter - The operator filter to translate\n * @returns A `{ $operator: value }` payload ready to merge under\n * `filters[field]`\n * @throws {InvalidFilterOperatorValueError} If `BTW` does not receive\n * exactly two values, or `NULL` does not receive exactly one boolean\n * @throws {UnsupportedFilterOperatorError} If the operator is a\n * PostgREST-only FTS variant\n */\n private _formatOperatorPayload(filter: IOperatorFilter): StrapiFilterPayload {\n const { operator, values } = filter;\n const first = values[0];\n\n switch (operator) {\n case FilterOperatorEnum.EQ: return { $eq: first };\n case FilterOperatorEnum.GT: return { $gt: first };\n case FilterOperatorEnum.GTE: return { $gte: first };\n case FilterOperatorEnum.LT: return { $lt: first };\n case FilterOperatorEnum.LTE: return { $lte: first };\n case FilterOperatorEnum.CONTAINS: return { $contains: first };\n case FilterOperatorEnum.ILIKE: return { $containsi: first };\n case FilterOperatorEnum.IN: return { $in: values };\n case FilterOperatorEnum.SW: return { $startsWith: first };\n\n case FilterOperatorEnum.BTW: {\n if (values.length !== 2) {\n throw new InvalidFilterOperatorValueError(\n operator,\n 'BTW requires exactly 2 values (min, max)'\n );\n }\n\n return { $between: values };\n }\n\n case FilterOperatorEnum.NOT:\n return values.length === 1\n ? { $ne: first }\n : { $notIn: values };\n\n case FilterOperatorEnum.NULL: {\n if (values.length !== 1 || typeof first !== 'boolean') {\n throw new InvalidFilterOperatorValueError(\n operator,\n 'NULL requires exactly 1 boolean value (true → IS NULL, false → IS NOT NULL)'\n );\n }\n\n return first ? { $null: true } : { $notNull: true };\n }\n\n case FilterOperatorEnum.FTS:\n case FilterOperatorEnum.PHFTS:\n case FilterOperatorEnum.PLFTS:\n case FilterOperatorEnum.WFTS:\n throw new UnsupportedFilterOperatorError();\n }\n }\n}\n","import { AbstractDotPathResponseStrategy } from './abstract-dot-path-response.strategy';\n\n/**\n * Response strategy for the Strapi driver\n *\n * Parses Strapi v4/v5 pagination responses:\n * ```json\n * {\n * \"data\": [{ \"id\": 1, \"documentId\": \"abc\", \"title\": \"Hello\" }],\n * \"meta\": {\n * \"pagination\": {\n * \"page\": 1,\n * \"pageSize\": 10,\n * \"pageCount\": 5,\n * \"total\": 48\n * }\n * }\n * }\n * ```\n *\n * Default key paths are configured in `StrapiResponseOptions`. Strapi\n * does not include navigation links in the envelope, so `firstPageUrl`,\n * `prevPageUrl`, `nextPageUrl`, and `lastPageUrl` resolve to `undefined`\n * unless the consumer overrides their paths via `IPaginationConfig`. The\n * traversal algorithm (dot-notation resolution + computed `from`/`to`)\n * is inherited from `AbstractDotPathResponseStrategy`; this class exists\n * so `DriverEnum.STRAPI` resolves to a distinct identity at the DI\n * layer even though the parsing logic is shared with JSON:API and\n * NestJS.\n *\n * @see https://docs.strapi.io/dev-docs/api/rest/sort-pagination\n */\nexport class StrapiResponseStrategy extends AbstractDotPathResponseStrategy {}\n","import { DriverEnum } from '../enums/driver.enum';\nimport { PaginationModeEnum } from '../enums/pagination-mode.enum';\nimport { IPaginationConfig } from '../interfaces/pagination-config.interface';\nimport { IRequestStrategy } from '../interfaces/request-strategy.interface';\nimport { IResponseStrategy } from '../interfaces/response-strategy.interface';\nimport { DrfResponseOptions, JsonApiResponseOptions, NestjsResponseOptions, ResponseOptions, StrapiResponseOptions } from '../models/response-options';\nimport { DrfRequestStrategy } from '../strategies/drf-request.strategy';\nimport { DrfResponseStrategy } from '../strategies/drf-response.strategy';\nimport { JsonApiRequestStrategy } from '../strategies/json-api-request.strategy';\nimport { JsonApiResponseStrategy } from '../strategies/json-api-response.strategy';\nimport { LaravelRequestStrategy } from '../strategies/laravel-request.strategy';\nimport { LaravelResponseStrategy } from '../strategies/laravel-response.strategy';\nimport { NestjsRequestStrategy } from '../strategies/nestjs-request.strategy';\nimport { NestjsResponseStrategy } from '../strategies/nestjs-response.strategy';\nimport { PostgrestRequestStrategy } from '../strategies/postgrest-request.strategy';\nimport { PostgrestResponseStrategy } from '../strategies/postgrest-response.strategy';\nimport { SpatieRequestStrategy } from '../strategies/spatie-request.strategy';\nimport { SpatieResponseStrategy } from '../strategies/spatie-response.strategy';\nimport { StrapiRequestStrategy } from '../strategies/strapi-request.strategy';\nimport { StrapiResponseStrategy } from '../strategies/strapi-response.strategy';\n\n/**\n * Per-driver factory bundle\n *\n * Names the four pieces a driver contributes — request strategy, response\n * strategy, response-options subclass — so adding a driver is one entry\n * in `DRIVERS` instead of three parallel `switch` cases in the provider\n * builder.\n */\nexport interface IDriverDefinition {\n\n /**\n * Build the request strategy for this driver\n *\n * Receives the configured `PaginationModeEnum`; only PostgREST\n * actually consults it today (RANGE-header mode), other drivers\n * ignore the argument.\n *\n * @param paginationMode - Wire-level pagination mechanism\n * @returns A fresh request strategy instance\n */\n createRequestStrategy(paginationMode: PaginationModeEnum): IRequestStrategy;\n\n /**\n * Build the response strategy for this driver\n *\n * @returns A fresh response strategy instance\n */\n createResponseStrategy(): IResponseStrategy;\n\n /**\n * Build the driver-specific `ResponseOptions` instance\n *\n * Honours user-supplied key-path overrides via `IPaginationConfig`.\n *\n * @param config - User-supplied response key overrides\n * @returns A `ResponseOptions` (or subclass) carrying the resolved defaults\n */\n createResponseOptions(config: IPaginationConfig): ResponseOptions;\n}\n\n/**\n * Driver registry — single source of truth for what each `DriverEnum`\n * value resolves to\n *\n * `Record<DriverEnum, IDriverDefinition>` gives compile-time\n * exhaustiveness: adding a new value to `DriverEnum` fails to compile\n * until its definition is added here. `provideNgQubee` looks up the\n * definition by driver and calls the three factories — no more parallel\n * `switch` blocks.\n */\nexport const DRIVERS: Record<DriverEnum, IDriverDefinition> = {\n [DriverEnum.DRF]: {\n createRequestStrategy: () => new DrfRequestStrategy(),\n createResponseStrategy: () => new DrfResponseStrategy(),\n createResponseOptions: (config) => new DrfResponseOptions(config)\n },\n\n [DriverEnum.JSON_API]: {\n createRequestStrategy: () => new JsonApiRequestStrategy(),\n createResponseStrategy: () => new JsonApiResponseStrategy(),\n createResponseOptions: (config) => new JsonApiResponseOptions(config)\n },\n\n [DriverEnum.LARAVEL]: {\n createRequestStrategy: () => new LaravelRequestStrategy(),\n createResponseStrategy: () => new LaravelResponseStrategy(),\n createResponseOptions: (config) => new ResponseOptions(config)\n },\n\n [DriverEnum.NESTJS]: {\n createRequestStrategy: () => new NestjsRequestStrategy(),\n createResponseStrategy: () => new NestjsResponseStrategy(),\n createResponseOptions: (config) => new NestjsResponseOptions(config)\n },\n\n [DriverEnum.POSTGREST]: {\n createRequestStrategy: (mode) => new PostgrestRequestStrategy(mode),\n createResponseStrategy: () => new PostgrestResponseStrategy(),\n createResponseOptions: (config) => new ResponseOptions(config)\n },\n\n [DriverEnum.SPATIE]: {\n createRequestStrategy: () => new SpatieRequestStrategy(),\n createResponseStrategy: () => new SpatieResponseStrategy(),\n createResponseOptions: (config) => new ResponseOptions(config)\n },\n\n [DriverEnum.STRAPI]: {\n createRequestStrategy: () => new StrapiRequestStrategy(),\n createResponseStrategy: () => new StrapiResponseStrategy(),\n createResponseOptions: (config) => new StrapiResponseOptions(config)\n }\n};\n","import { IQueryBuilderConfig } from '../interfaces/query-builder-config.interface';\n\n/**\n * Resolved query parameter key names with defaults applied\n *\n * Maps logical query concepts to the actual query parameter names\n * used in the generated URI. Unset values fall back to defaults.\n */\nexport class QueryBuilderOptions {\n public readonly appends: string;\n public readonly fields: string;\n public readonly filters: string;\n public readonly includes: string;\n public readonly limit: string;\n public readonly page: string;\n public readonly search: string;\n public readonly select: string;\n public readonly sort: string;\n public readonly sortBy: string;\n\n constructor(options: IQueryBuilderConfig) {\n this.appends = options.appends || 'append';\n this.fields = options.fields || 'fields';\n this.filters = options.filters || 'filter';\n this.includes = options.includes || 'include';\n this.limit = options.limit || 'limit';\n this.page = options.page || 'page';\n this.search = options.search || 'search';\n this.select = options.select || 'select';\n this.sort = options.sort || 'sort';\n this.sortBy = options.sortBy || 'sortBy';\n }\n}\n","/**\n * Error thrown when an invalid resource name is provided\n *\n * Resource name must be a non-empty string.\n */\nexport class InvalidResourceNameError extends Error {\n constructor(resource: string | null | undefined) {\n super(\n `Invalid resource name: Resource name must be a non-empty string. Received: ${JSON.stringify(resource)}`\n );\n this.name = 'InvalidResourceNameError';\n }\n}\n","export class InvalidPageNumberError extends Error {\n constructor(page: number) {\n super(\n `Invalid page number: Page must be a positive integer greater than 0. Received: ${page}`\n );\n this.name = 'InvalidPageNumberError';\n }\n}\n","import { Injectable, Signal, WritableSignal, computed, signal } from '@angular/core';\n\nimport { InvalidResourceNameError } from '../errors/invalid-resource-name.error';\nimport { InvalidPageNumberError } from '../errors/invalid-page-number.error';\nimport { IFields } from '../interfaces/fields.interface';\nimport { IFilters } from '../interfaces/filters.interface';\nimport { IOperatorFilter } from '../interfaces/operator-filter.interface';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { ISort } from '../interfaces/sort.interface';\n\nconst INITIAL_STATE: IQueryBuilderState = {\n baseUrl: '',\n fields: {},\n filters: {},\n includes: [],\n isLastPageKnown: false,\n lastPage: 1,\n limit: 15,\n operatorFilters: [],\n page: 1,\n resource: '',\n search: '',\n select: [],\n sorts: []\n};\n\n@Injectable()\nexport class NestService {\n\n /**\n * Private writable signal that holds the Query Builder state\n *\n * @type {IQueryBuilderState}\n */\n private _nest: WritableSignal<IQueryBuilderState> = signal(this._clone(INITIAL_STATE));\n\n /**\n * A computed signal that makes readonly the writable signal _nest\n *\n * @type {Signal<IQueryBuilderState>}\n */\n public nest: Signal<IQueryBuilderState> = computed(() => this._clone(this._nest()));\n\n constructor() {\n // Nothing to see here\n }\n\n /**\n * Set the base URL for the API\n *\n * @param {string} baseUrl - The base URL to prepend to generated URIs\n * @example\n * service.baseUrl = 'https://api.example.com';\n */\n set baseUrl(baseUrl: string) {\n this._nest.update(nest => ({\n ...nest,\n baseUrl\n }));\n }\n\n /**\n * Set the limit for paginated results\n *\n * This setter performs a raw state write. Validation of the value is the\n * responsibility of the active request strategy and is enforced upstream\n * by `NgQubeeService.setLimit()`, because the accepted range depends on\n * the driver (e.g. nestjs-paginate accepts `-1` for \"fetch all\").\n *\n * @param {number} limit - The number of items per page\n * @example\n * service.limit = 25;\n */\n set limit(limit: number) {\n this._nest.update(nest => ({\n ...nest,\n limit\n }));\n }\n\n /**\n * Set the page number for pagination\n * Must be a positive integer greater than 0\n *\n * @param {number} page - The page number to fetch\n * @throws {InvalidPageNumberError} If page is not a positive integer\n * @example\n * service.page = 2;\n */\n set page(page: number) {\n this._validatePageNumber(page);\n this._nest.update(nest => ({\n ...nest,\n page\n }));\n }\n\n /**\n * Set the resource name for the query\n * Must be a non-empty string\n *\n * @param {string} resource - The API resource name (e.g., 'users', 'posts')\n * @throws {InvalidResourceNameError} If resource is not a non-empty string\n * @example\n * service.resource = 'users';\n */\n set resource(resource: string) {\n this._validateResourceName(resource);\n this._nest.update(nest => ({\n ...nest,\n resource\n }));\n }\n\n private _clone<T>(obj: T): T {\n return JSON.parse( JSON.stringify(obj) );\n }\n\n /**\n * Validates that the page number is a positive integer\n *\n * @param {number} page - The page number to validate\n * @throws {InvalidPageNumberError} If page is not a positive integer\n * @private\n */\n private _validatePageNumber(page: number): void {\n if (!Number.isInteger(page) || page < 1) {\n throw new InvalidPageNumberError(page);\n }\n }\n\n /**\n * Validates that the resource name is a non-empty string\n *\n * @param {string} resource - The resource name to validate\n * @throws {InvalidResourceNameError} If resource is not a non-empty string\n * @private\n */\n private _validateResourceName(resource: string): void {\n if (!resource || typeof resource !== 'string' || resource.trim().length === 0) {\n throw new InvalidResourceNameError(resource);\n }\n }\n\n /**\n * Add selectable fields for the given model to the request\n * Automatically prevents duplicate fields for each model\n *\n * @param {IFields} fields - Object mapping model names to arrays of field names\n * @return {void}\n * @example\n * service.addFields({ users: ['id', 'email', 'username'] });\n * service.addFields({ posts: ['title', 'content'] });\n */\n public addFields(fields: IFields): void {\n this._nest.update(nest => {\n const mergedFields = { ...nest.fields };\n\n Object.keys(fields).forEach(model => {\n const existingFields = mergedFields[model] || [];\n const newFields = fields[model];\n\n // Use Set to prevent duplicates\n const uniqueFields = Array.from(new Set([...existingFields, ...newFields]));\n mergedFields[model] = uniqueFields;\n });\n\n return {\n ...nest,\n fields: mergedFields\n };\n });\n }\n\n /**\n * Add filters to the request\n * Automatically prevents duplicate filter values for each filter key\n *\n * @param {IFilters} filters - Object mapping filter keys to arrays of values\n * @return {void}\n * @example\n * service.addFilters({ id: [1, 2, 3] });\n * service.addFilters({ status: ['active', 'pending'] });\n */\n public addFilters(filters: IFilters): void {\n this._nest.update(nest => {\n const mergedFilters = { ...nest.filters };\n\n Object.keys(filters).forEach(key => {\n const existingValues = mergedFilters[key] || [];\n const newValues = filters[key];\n\n // Use Set to prevent duplicates\n const uniqueValues = Array.from(new Set([...existingValues, ...newValues]));\n mergedFilters[key] = uniqueValues;\n });\n\n return {\n ...nest,\n filters: mergedFilters\n };\n });\n }\n\n /**\n * Add resources to include with the request\n * Automatically prevents duplicate includes\n *\n * @param {string[]} includes - Array of resource names to include in the response\n * @return {void}\n * @example\n * service.addIncludes(['profile', 'posts']);\n * service.addIncludes(['comments']);\n */\n public addIncludes(includes: string[]): void {\n this._nest.update(nest => {\n // Use Set to prevent duplicates\n const uniqueIncludes = Array.from(new Set([...nest.includes, ...includes]));\n\n return {\n ...nest,\n includes: uniqueIncludes\n };\n });\n }\n\n /**\n * Add filters with explicit operators (NestJS only)\n * Automatically prevents duplicate operator filters for the same field + operator combination\n *\n * @param {IOperatorFilter[]} filters - Array of operator filter configurations\n * @return {void}\n * @example\n * import { FilterOperatorEnum } from 'ng-qubee';\n * service.addOperatorFilters([{ field: 'age', operator: FilterOperatorEnum.GTE, values: [18] }]);\n */\n public addOperatorFilters(filters: IOperatorFilter[]): void {\n this._nest.update(nest => {\n const merged = [...nest.operatorFilters];\n\n filters.forEach(newFilter => {\n const existingIdx = merged.findIndex(\n f => f.field === newFilter.field && f.operator === newFilter.operator\n );\n\n if (existingIdx > -1) {\n const existingValues = merged[existingIdx].values;\n merged[existingIdx] = {\n ...merged[existingIdx],\n values: Array.from(new Set([...existingValues, ...newFilter.values]))\n };\n } else {\n merged.push({ ...newFilter });\n }\n });\n\n return {\n ...nest,\n operatorFilters: merged\n };\n });\n }\n\n /**\n * Add flat field selection columns (NestJS only)\n * Automatically prevents duplicate select fields\n *\n * @param {string[]} fields - Array of column names to select\n * @return {void}\n * @example\n * service.addSelect(['id', 'name', 'email']);\n */\n public addSelect(fields: string[]): void {\n this._nest.update(nest => {\n const uniqueSelect = Array.from(new Set([...nest.select, ...fields]));\n\n return {\n ...nest,\n select: uniqueSelect\n };\n });\n }\n\n /**\n * Add a field that should be used for sorting data\n *\n * @param {ISort} sort - Sort configuration with field name and order (ASC/DESC)\n * @return {void}\n * @example\n * import { SortEnum } from 'ng-qubee';\n * service.addSort({ field: 'created_at', order: SortEnum.DESC });\n * service.addSort({ field: 'name', order: SortEnum.ASC });\n */\n public addSort(sort: ISort): void {\n this._nest.update(nest => ({\n ...nest,\n sorts: [...nest.sorts, sort]\n }));\n }\n\n /**\n * Remove fields for the given model\n * Uses deep cloning to prevent mutations to the original state\n *\n * @param {IFields} fields - Object mapping model names to arrays of field names to remove\n * @return {void}\n * @example\n * service.deleteFields({ users: ['email'] });\n * service.deleteFields({ posts: ['content', 'body'] });\n */\n public deleteFields(fields: IFields): void {\n // Deep clone the fields object to prevent mutations\n const f = this._clone(this._nest().fields);\n\n Object.keys(fields).forEach(k => {\n if (!(k in f)) {\n return;\n }\n\n f[k] = f[k].filter(v => !fields[k].includes(v));\n });\n\n this._nest.update(nest => ({\n ...nest,\n fields: f\n }));\n }\n\n /**\n * Remove filters from the request\n * Uses deep cloning to prevent mutations to the original state\n *\n * @param {...string[]} filters - Filter keys to remove\n * @return {void}\n * @example\n * service.deleteFilters('id');\n * service.deleteFilters('status', 'type');\n */\n public deleteFilters(...filters: string[]): void {\n // Deep clone the filters object to prevent mutations\n const f = this._clone(this._nest().filters);\n\n filters.forEach(k => delete f[k]);\n\n this._nest.update(nest => ({\n ...nest,\n filters: f\n }));\n }\n\n /**\n * Remove includes from the request\n *\n * @param {...string[]} includes - Include names to remove\n * @return {void}\n * @example\n * service.deleteIncludes('profile');\n * service.deleteIncludes('posts', 'comments');\n */\n public deleteIncludes(...includes: string[]): void {\n this._nest.update(nest => ({\n ...nest,\n includes: nest.includes.filter(v => !includes.includes(v))\n }));\n }\n\n /**\n * Remove operator filters by field name (NestJS only)\n *\n * @param {...string[]} fields - Field names of operator filters to remove\n * @return {void}\n * @example\n * service.deleteOperatorFilters('age');\n * service.deleteOperatorFilters('price', 'quantity');\n */\n public deleteOperatorFilters(...fields: string[]): void {\n this._nest.update(nest => ({\n ...nest,\n operatorFilters: nest.operatorFilters.filter(f => !fields.includes(f.field))\n }));\n }\n\n /**\n * Remove the search term from the state (NestJS only)\n *\n * @return {void}\n * @example\n * service.deleteSearch();\n */\n public deleteSearch(): void {\n this._nest.update(nest => ({\n ...nest,\n search: ''\n }));\n }\n\n /**\n * Remove flat field selections from the state (NestJS only)\n *\n * @param {...string[]} fields - Field names to remove from selection\n * @return {void}\n * @example\n * service.deleteSelect('email');\n * service.deleteSelect('name', 'email');\n */\n public deleteSelect(...fields: string[]): void {\n this._nest.update(nest => ({\n ...nest,\n select: nest.select.filter(f => !fields.includes(f))\n }));\n }\n\n /**\n * Remove sorts from the request by field name\n *\n * @param {...string[]} sorts - Field names of sorts to remove\n * @return {void}\n * @example\n * service.deleteSorts('created_at');\n * service.deleteSorts('name', 'created_at');\n */\n public deleteSorts(...sorts: string[]): void {\n const s = [...this._nest().sorts];\n\n sorts.forEach(field => {\n const p = s.findIndex(sort => sort.field === field);\n\n if (p > -1) {\n s.splice(p, 1);\n }\n });\n\n this._nest.update(nest => ({\n ...nest,\n sorts: s\n }));\n }\n\n /**\n * Set the full-text search term (NestJS only)\n *\n * @param {string} search - The search term\n * @return {void}\n * @example\n * service.setSearch('john doe');\n */\n public setSearch(search: string): void {\n this._nest.update(nest => ({\n ...nest,\n search\n }));\n }\n\n /**\n * Atomically record the `lastPage` value from a paginated response and\n * flip `isLastPageKnown` to `true`\n *\n * Called exclusively by `PaginationService.paginate()` as part of the\n * auto-sync contract; not intended to be invoked by consumers directly.\n * Keeping the two fields under a single write guarantees they cannot\n * drift out of sync.\n *\n * @param {number} lastPage - The last page number parsed from the most recent paginated response\n * @return {void}\n */\n public syncLastPage(lastPage: number): void {\n this._nest.update(nest => ({\n ...nest,\n isLastPageKnown: true,\n lastPage\n }));\n }\n\n /**\n * Reset the query builder state to initial values\n * Clears all fields, filters, includes, sorts, and resets pagination\n *\n * @return {void}\n * @example\n * service.reset();\n */\n public reset(): void {\n this._nest.update(_ => this._clone(INITIAL_STATE));\n }\n}\n","/**\n * Thrown when a pagination helper that needs `state.lastPage` is called\n * before `PaginationService.paginate()` has ever synced a value.\n *\n * Examples: `NgQubeeService.lastPage()`, `NgQubeeService.totalPages()`.\n *\n * Safe-for-templates predicates (`isLastPage`, `hasNextPage`, etc.) do not\n * throw and return conservative defaults instead.\n */\nexport class PaginationNotSyncedError extends Error {\n\n /**\n * @param action - Short imperative describing what the caller was trying\n * to do (e.g. \"navigate to last page\", \"read totalPages\"). Surfaced in\n * the error message so the cause is obvious at the call site.\n */\n constructor(action: string) {\n super(`Cannot ${action}: no paginated response has been synced yet. Call PaginationService.paginate() at least once first.`);\n this.name = 'PaginationNotSyncedError';\n }\n}\n","/**\n * Error thrown when per-model field selection is attempted with a driver that does not support it\n *\n * Per-model field selection is only supported by the Spatie driver.\n * Use `addSelect()` for NestJS flat field selection.\n */\nexport class UnsupportedFieldSelectionError extends Error {\n constructor() {\n super('Per-model field selection is only supported by the Spatie driver. Use addSelect() for NestJS.');\n this.name = 'UnsupportedFieldSelectionError';\n }\n}\n","/**\n * Error thrown when filters are attempted with a driver that does not support them\n *\n * Filters are only supported by the Spatie and NestJS drivers.\n */\nexport class UnsupportedFilterError extends Error {\n constructor() {\n super('Filters are only supported by the Spatie and NestJS drivers.');\n this.name = 'UnsupportedFilterError';\n }\n}\n","/**\n * Error thrown when includes are attempted with a driver that does not support them\n *\n * Includes are only supported by the Spatie driver.\n */\nexport class UnsupportedIncludesError extends Error {\n constructor() {\n super('Includes are only supported by the Spatie driver.');\n this.name = 'UnsupportedIncludesError';\n }\n}\n","/**\n * Error thrown when search is attempted with a driver that does not support it\n *\n * Search is only supported by the NestJS driver.\n */\nexport class UnsupportedSearchError extends Error {\n constructor() {\n super('Search is only supported by the NestJS driver.');\n this.name = 'UnsupportedSearchError';\n }\n}\n","/**\n * Error thrown when flat field selection is attempted with a driver that does not support it\n *\n * Flat field selection is only supported by the NestJS driver.\n * Use `addFields()` for Spatie per-model field selection.\n */\nexport class UnsupportedSelectError extends Error {\n constructor() {\n super('Flat field selection is only supported by the NestJS driver. Use addFields() for Spatie.');\n this.name = 'UnsupportedSelectError';\n }\n}\n","/**\n * Error thrown when sorts are attempted with a driver that does not support them\n *\n * Sorts are only supported by the Spatie and NestJS drivers.\n */\nexport class UnsupportedSortError extends Error {\n constructor() {\n super('Sorts are only supported by the Spatie and NestJS drivers.');\n this.name = 'UnsupportedSortError';\n }\n}\n","import { InjectionToken } from '@angular/core';\n\nimport { DriverEnum } from '../enums/driver.enum';\nimport { IRequestStrategy } from '../interfaces/request-strategy.interface';\nimport { IResponseStrategy } from '../interfaces/response-strategy.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\nimport { ResponseOptions } from '../models/response-options';\n\n/**\n * Injection token for the active pagination driver\n *\n * Provided by `provideNgQubee()` / `NgQubeeModule.forRoot()` from the\n * user-supplied `IConfig.driver`. Services read it to gate driver-specific\n * behavior (e.g. `NgQubeeService._assertDriver`).\n */\nexport const NG_QUBEE_DRIVER = new InjectionToken<DriverEnum>('NG_QUBEE_DRIVER');\n\n/**\n * Injection token for the resolved request URI strategy\n *\n * Provided by `provideNgQubee()` / `NgQubeeModule.forRoot()` based on the\n * active driver. Used by `NgQubeeService` to build request URIs.\n */\nexport const NG_QUBEE_REQUEST_STRATEGY = new InjectionToken<IRequestStrategy>('NG_QUBEE_REQUEST_STRATEGY');\n\n/**\n * Injection token for the resolved request query-parameter key options\n *\n * Provided as a fully-built `QueryBuilderOptions` instance. `provideNgQubee()`\n * constructs it from `IConfig.request`; consumers don't interact with this\n * token directly.\n */\nexport const NG_QUBEE_REQUEST_OPTIONS = new InjectionToken<QueryBuilderOptions>('NG_QUBEE_REQUEST_OPTIONS');\n\n/**\n * Injection token for the resolved response parsing strategy\n *\n * Provided by `provideNgQubee()` / `NgQubeeModule.forRoot()` based on the\n * active driver. Used by `PaginationService` to parse paginated responses.\n */\nexport const NG_QUBEE_RESPONSE_STRATEGY = new InjectionToken<IResponseStrategy>('NG_QUBEE_RESPONSE_STRATEGY');\n\n/**\n * Injection token for the resolved response field-key options\n *\n * Provided as a fully-built `ResponseOptions` instance (or a driver-specific\n * subclass like `JsonApiResponseOptions` / `NestjsResponseOptions`).\n * `provideNgQubee()` constructs the correct variant from `IConfig.response`.\n */\nexport const NG_QUBEE_RESPONSE_OPTIONS = new InjectionToken<ResponseOptions>('NG_QUBEE_RESPONSE_OPTIONS');\n","import { Inject, Injectable } from '@angular/core';\nimport { BehaviorSubject, Observable, filter, throwError } from 'rxjs';\n\n// Enums\nimport { DriverEnum } from '../enums/driver.enum';\nimport { FilterOperatorEnum } from '../enums/filter-operator.enum';\nimport { SortEnum } from '../enums/sort.enum';\n\n// Errors\nimport { InvalidPageNumberError } from '../errors/invalid-page-number.error';\nimport { PaginationNotSyncedError } from '../errors/pagination-not-synced.error';\nimport { UnsupportedFieldSelectionError } from '../errors/unsupported-field-selection.error';\nimport { UnsupportedFilterError } from '../errors/unsupported-filter.error';\nimport { UnsupportedFilterOperatorError } from '../errors/unsupported-filter-operator.error';\nimport { UnsupportedIncludesError } from '../errors/unsupported-includes.error';\nimport { UnsupportedSearchError } from '../errors/unsupported-search.error';\nimport { UnsupportedSelectError } from '../errors/unsupported-select.error';\nimport { UnsupportedSortError } from '../errors/unsupported-sort.error';\n\n// Interfaces\nimport { IFields } from '../interfaces/fields.interface';\nimport { IRequestStrategy } from '../interfaces/request-strategy.interface';\nimport { IStrategyCapabilities } from '../interfaces/strategy-capabilities.interface';\n\n// Models\nimport { QueryBuilderOptions } from '../models/query-builder-options';\n\n// Services\nimport { NestService } from './nest.service';\n\n// Tokens\nimport { NG_QUBEE_DRIVER, NG_QUBEE_REQUEST_OPTIONS, NG_QUBEE_REQUEST_STRATEGY } from '../tokens/ng-qubee.tokens';\n\n@Injectable()\nexport class NgQubeeService {\n\n /**\n * The active pagination driver\n */\n private _driver: DriverEnum;\n\n /**\n * Resolved query parameter key name options\n */\n private _options: QueryBuilderOptions;\n\n /**\n * The request strategy that builds URIs for the active driver\n */\n private _requestStrategy: IRequestStrategy;\n\n /**\n * Internal BehaviorSubject that holds the latest generated URI\n */\n private _uri$: BehaviorSubject<string> = new BehaviorSubject('');\n\n /**\n * Observable that emits non-empty generated URIs\n */\n public uri$: Observable<string> = this._uri$.asObservable().pipe(\n filter(uri => !!uri)\n );\n\n constructor(\n private _nestService: NestService,\n @Inject(NG_QUBEE_REQUEST_STRATEGY) requestStrategy: IRequestStrategy,\n @Inject(NG_QUBEE_DRIVER) driver: DriverEnum,\n @Inject(NG_QUBEE_REQUEST_OPTIONS) options: QueryBuilderOptions = new QueryBuilderOptions({})\n ) {\n this._driver = driver;\n this._options = options;\n this._requestStrategy = requestStrategy;\n }\n\n /**\n * Assert that the active strategy declares support for a capability\n *\n * Reads from `IRequestStrategy.capabilities` rather than the driver\n * enum so adding a new driver only requires declaring its capability\n * map — this method does not change.\n *\n * @param flag - The capability key to check\n * @param error - The error to throw if the capability is unsupported\n * @throws The provided error if the active strategy lacks the capability\n */\n private _assertCapability(flag: keyof IStrategyCapabilities, error: Error): void {\n if (!this._requestStrategy.capabilities[flag]) {\n throw error;\n }\n }\n\n /**\n * Add fields to the select statement for the given model (JSON:API and Spatie only)\n *\n * @param model - Model that holds the fields\n * @param fields - Fields to select\n * @returns {this}\n * @throws {UnsupportedFieldSelectionError} If the active driver does not support per-model field selection\n */\n public addFields(model: string, fields: string[]): this {\n this._assertCapability('fields', new UnsupportedFieldSelectionError());\n\n if (!fields.length) {\n return this;\n }\n\n this._nestService.addFields({ [model]: fields });\n\n return this;\n }\n\n /**\n * Add a filter with the given value(s) (JSON:API, NestJS, PostgREST, and Spatie)\n *\n * Produces: `filter[field]=value` (JSON:API / Spatie) or `filter.field=value` (NestJS)\n *\n * @param {string} field - Name of the field to filter\n * @param {(string | number | boolean)[]} values - The needle(s)\n * @returns {this}\n * @throws {UnsupportedFilterError} If the active driver does not support filters\n */\n public addFilter(field: string, ...values: (string | number | boolean)[]): this {\n this._assertCapability('filters', new UnsupportedFilterError());\n\n if (!values.length) {\n return this;\n }\n\n this._nestService.addFilters({\n [field]: values\n });\n this._nestService.page = 1;\n\n return this;\n }\n\n /**\n * Add a filter with an explicit operator (NestJS and PostgREST)\n *\n * Produces: `filter.field=$operator:value`\n *\n * @param {string} field - Name of the field to filter\n * @param {FilterOperatorEnum} operator - The filter operator to apply\n * @param {(string | number | boolean)[]} values - The value(s) for the filter\n * @returns {this}\n * @throws {UnsupportedFilterOperatorError} If the active driver does not support filter operators\n */\n public addFilterOperator(field: string, operator: FilterOperatorEnum, ...values: (string | number | boolean)[]): this {\n this._assertCapability('operatorFilters', new UnsupportedFilterOperatorError());\n\n if (!values.length) {\n return this;\n }\n\n this._nestService.addOperatorFilters([{ field, operator, values }]);\n this._nestService.page = 1;\n\n return this;\n }\n\n /**\n * Add related entities to include in the request (JSON:API and Spatie only)\n *\n * @param {string[]} models - Models to include\n * @returns {this}\n * @throws {UnsupportedIncludesError} If the active driver does not support includes\n */\n public addIncludes(...models: string[]): this {\n this._assertCapability('includes', new UnsupportedIncludesError());\n\n if (!models.length) {\n return this;\n }\n\n this._nestService.addIncludes(models);\n\n return this;\n }\n\n /**\n * Add flat field selection (NestJS and PostgREST)\n *\n * Produces: `select=col1,col2`\n *\n * @param {string[]} fields - Fields to select\n * @returns {this}\n * @throws {UnsupportedSelectError} If the active driver does not support flat field selection\n */\n public addSelect(...fields: string[]): this {\n this._assertCapability('select', new UnsupportedSelectError());\n\n if (!fields.length) {\n return this;\n }\n\n this._nestService.addSelect(fields);\n\n return this;\n }\n\n /**\n * Add a field with a sort criteria (JSON:API, NestJS, PostgREST, and Spatie)\n *\n * @param field - Field to use for sorting\n * @param {SortEnum} order - A value from the SortEnum enumeration\n * @returns {this}\n * @throws {UnsupportedSortError} If the active driver does not support sorts\n */\n public addSort(field: string, order: SortEnum): this {\n this._assertCapability('sort', new UnsupportedSortError());\n\n this._nestService.addSort({\n field,\n order\n });\n this._nestService.page = 1;\n\n return this;\n }\n\n /**\n * Get the current page number\n *\n * @remarks Always safe to call. Thin accessor over the internal state's `page` field.\n * @returns The current page number\n */\n public currentPage(): number {\n return this._nestService.nest().page;\n }\n\n /**\n * Delete selected fields for the given models in the current query builder state (JSON:API and Spatie only)\n *\n * ```\n * ngQubeeService.deleteFields({\n * users: ['email', 'password'],\n * address: ['zipcode']\n * });\n * ```\n *\n * @param {IFields} fields - Object mapping model names to field arrays to remove\n * @returns {this}\n * @throws {UnsupportedFieldSelectionError} If the active driver does not support per-model field selection\n */\n public deleteFields(fields: IFields): this {\n this._assertCapability('fields', new UnsupportedFieldSelectionError());\n this._nestService.deleteFields(fields);\n\n return this;\n }\n\n /**\n * Delete selected fields for the given model in the current query builder state (JSON:API and Spatie only)\n *\n * ```\n * ngQubeeService.deleteFieldsByModel('users', 'email', 'password');\n * ```\n *\n * @param model - Model that holds the fields\n * @param {string[]} fields - Fields to delete from the state\n * @returns {this}\n * @throws {UnsupportedFieldSelectionError} If the active driver does not support per-model field selection\n */\n public deleteFieldsByModel(model: string, ...fields: string[]): this {\n this._assertCapability('fields', new UnsupportedFieldSelectionError());\n\n if (!fields.length) {\n return this;\n }\n\n this._nestService.deleteFields({\n [model]: fields\n });\n\n return this;\n }\n\n /**\n * Remove given filters from the query builder state (JSON:API, NestJS, PostgREST, and Spatie)\n *\n * @param {string[]} filters - Filters to remove\n * @returns {this}\n * @throws {UnsupportedFilterError} If the active driver does not support filters\n */\n public deleteFilters(...filters: string[]): this {\n this._assertCapability('filters', new UnsupportedFilterError());\n\n if (!filters.length) {\n return this;\n }\n\n this._nestService.deleteFilters(...filters);\n this._nestService.page = 1;\n\n return this;\n }\n\n /**\n * Remove selected related models from the query builder state (JSON:API and Spatie only)\n *\n * @param {string[]} includes - Models to remove\n * @returns {this}\n * @throws {UnsupportedIncludesError} If the active driver does not support includes\n */\n public deleteIncludes(...includes: string[]): this {\n this._assertCapability('includes', new UnsupportedIncludesError());\n\n if (!includes.length) {\n return this;\n }\n\n this._nestService.deleteIncludes(...includes);\n\n return this;\n }\n\n /**\n * Remove operator filters by field name (NestJS and PostgREST)\n *\n * @param {string[]} fields - Field names of operator filters to remove\n * @returns {this}\n * @throws {UnsupportedFilterOperatorError} If the active driver does not support filter operators\n */\n public deleteOperatorFilters(...fields: string[]): this {\n this._assertCapability('operatorFilters', new UnsupportedFilterOperatorError());\n\n if (!fields.length) {\n return this;\n }\n\n this._nestService.deleteOperatorFilters(...fields);\n this._nestService.page = 1;\n\n return this;\n }\n\n /**\n * Remove search term from the query builder state (NestJS only)\n *\n * @returns {this}\n * @throws {UnsupportedSearchError} If the active driver does not support search\n */\n public deleteSearch(): this {\n this._assertCapability('search', new UnsupportedSearchError());\n this._nestService.deleteSearch();\n this._nestService.page = 1;\n\n return this;\n }\n\n /**\n * Remove flat field selections from the query builder state (NestJS and PostgREST)\n *\n * @param {string[]} fields - Fields to remove from selection\n * @returns {this}\n * @throws {UnsupportedSelectError} If the active driver does not support flat field selection\n */\n public deleteSelect(...fields: string[]): this {\n this._assertCapability('select', new UnsupportedSelectError());\n\n if (!fields.length) {\n return this;\n }\n\n this._nestService.deleteSelect(...fields);\n\n return this;\n }\n\n /**\n * Remove sort rules from the query builder state (JSON:API, NestJS, PostgREST, and Spatie)\n *\n * @param sorts - Fields used for sorting to remove\n * @returns {this}\n * @throws {UnsupportedSortError} If the active driver does not support sorts\n */\n public deleteSorts(...sorts: string[]): this {\n this._assertCapability('sort', new UnsupportedSortError());\n this._nestService.deleteSorts(...sorts);\n this._nestService.page = 1;\n\n return this;\n }\n\n /**\n * Navigate to the first page (page 1)\n *\n * @remarks Never throws. Idempotent when already on page 1.\n * @returns {this}\n */\n public firstPage(): this {\n this._nestService.page = 1;\n\n return this;\n }\n\n /**\n * Generate a URI accordingly to the given data and active driver\n *\n * @returns {Observable<string>} An observable that emits the generated URI\n */\n public generateUri(): Observable<string> {\n try {\n this._uri$.next(this._requestStrategy.buildUri(this._nestService.nest(), this._options));\n return this.uri$;\n } catch (error) {\n return throwError(() => error);\n }\n }\n\n /**\n * Navigate directly to the specified page\n *\n * Validates integer/positive via the existing `setPage` path, and\n * additionally rejects values that exceed `state.lastPage` when\n * pagination bounds are known.\n *\n * @param n - Target page number\n * @returns {this}\n * @throws {InvalidPageNumberError} If `n` is not a positive integer, or if `n > state.lastPage` when `state.isLastPageKnown` is true\n */\n public goToPage(n: number): this {\n const state = this._nestService.nest();\n\n if (state.isLastPageKnown && n > state.lastPage) {\n throw new InvalidPageNumberError(n);\n }\n\n this._nestService.page = n;\n\n return this;\n }\n\n /**\n * Check whether a next page exists\n *\n * @remarks Template-safe. Returns `true` when pagination bounds are unknown (conservative default — keeps a \"Next\" button enabled before the first `paginate()` call).\n * @returns `true` if `state.page < state.lastPage` when bounds are known, or `true` when bounds are unknown\n */\n public hasNextPage(): boolean {\n const state = this._nestService.nest();\n\n return !state.isLastPageKnown || state.page < state.lastPage;\n }\n\n /**\n * Check whether a previous page exists\n *\n * @remarks Always safe. Does not require a synced paginated response.\n * @returns `true` if `state.page > 1`\n */\n public hasPreviousPage(): boolean {\n return this._nestService.nest().page > 1;\n }\n\n /**\n * Check whether the current page is the first page\n *\n * @remarks Always safe. Does not require a synced paginated response.\n * @returns `true` if `state.page === 1`\n */\n public isFirstPage(): boolean {\n return this._nestService.nest().page === 1;\n }\n\n /**\n * Check whether the current page is the last page\n *\n * @remarks Template-safe. Returns `false` when pagination bounds are unknown (no paginated response has been synced yet) — keeps \"Next\" navigation unblocked until the first `paginate()` call syncs.\n * @returns `true` only when `state.isLastPageKnown` and `state.page === state.lastPage`\n */\n public isLastPage(): boolean {\n const state = this._nestService.nest();\n\n return state.isLastPageKnown && state.page === state.lastPage;\n }\n\n /**\n * Navigate to the last page known from the most recent paginated response\n *\n * @remarks Requires at least one `PaginationService.paginate()` call to have synced `state.lastPage`. Before that, the bound is unknown and this method throws.\n * @returns {this}\n * @throws {PaginationNotSyncedError} If `state.isLastPageKnown` is false (no paginated response has been synced yet)\n */\n public lastPage(): this {\n const state = this._nestService.nest();\n\n if (!state.isLastPageKnown) {\n throw new PaginationNotSyncedError('navigate to last page');\n }\n\n this._nestService.page = state.lastPage;\n\n return this;\n }\n\n /**\n * Navigate to the next page\n *\n * @remarks Never throws. Idempotent at the known last page (no-op). Pair with `hasNextPage()` for a disable-state binding.\n * @returns {this}\n */\n public nextPage(): this {\n const state = this._nestService.nest();\n\n if (state.isLastPageKnown && state.page >= state.lastPage) {\n return this;\n }\n\n this._nestService.page = state.page + 1;\n\n return this;\n }\n\n /**\n * HTTP request headers the active driver wants the consumer to apply\n *\n * Returns `null` for drivers that pass all pagination metadata on the\n * URL (Laravel, Spatie, JSON:API, NestJS, and PostgREST in its default\n * QUERY mode). Returns a map of header name → value when the active\n * driver uses HTTP headers instead — today, only the PostgREST driver\n * configured with `PaginationModeEnum.RANGE`, which yields\n * `{ 'Range-Unit': 'items', 'Range': 'from-to' }`.\n *\n * @returns Map of headers to apply to the HTTP request, or `null` when not needed\n */\n public paginationHeaders(): Record<string, string> | null {\n if (typeof this._requestStrategy.buildPaginationHeaders !== 'function') {\n return null;\n }\n\n return this._requestStrategy.buildPaginationHeaders(this._nestService.nest());\n }\n\n /**\n * Navigate to the previous page\n *\n * @remarks Never throws. Idempotent at page 1 (floored). Pair with `hasPreviousPage()` for a disable-state binding.\n * @returns {this}\n */\n public previousPage(): this {\n const state = this._nestService.nest();\n\n if (state.page <= 1) {\n return this;\n }\n\n this._nestService.page = state.page - 1;\n\n return this;\n }\n\n /**\n * Clear the current state and reset the Query Builder to a fresh, clean condition\n *\n * @returns {this}\n */\n public reset(): this {\n this._nestService.reset();\n\n return this;\n }\n\n /**\n * Set the base URL to use for composing the address\n *\n * @param {string} baseUrl - The base URL\n * @returns {this}\n */\n public setBaseUrl(baseUrl: string): this {\n this._nestService.baseUrl = baseUrl;\n\n return this;\n }\n\n /**\n * Set the items per page number\n *\n * Validation is delegated to the active request strategy because the\n * accepted range is driver-specific: nestjs-paginate additionally accepts\n * `-1` as a \"fetch all\" sentinel, while Laravel, Spatie, and JSON:API\n * require a positive integer.\n *\n * @param limit - Number of items per page (or `-1` to fetch all, NestJS only)\n * @returns {this}\n * @throws {import('../errors/invalid-limit.error').InvalidLimitError} If the value is not accepted by the active driver\n */\n public setLimit(limit: number): this {\n this._requestStrategy.validateLimit(limit);\n this._nestService.limit = limit;\n this._nestService.page = 1;\n\n return this;\n }\n\n /**\n * Set the page that the backend will use to paginate the result set\n *\n * @param page - Page number\n * @returns {this}\n */\n public setPage(page: number): this {\n this._nestService.page = page;\n\n return this;\n }\n\n /**\n * Set the API resource to run the query against\n *\n * @param {string} resource - Resource name (e.g. 'users' produces /users)\n * @returns {this}\n */\n public setResource(resource: string): this {\n this._nestService.resource = resource;\n this._nestService.page = 1;\n\n return this;\n }\n\n /**\n * Set the search term for full-text search (NestJS only)\n *\n * Produces: `search=term`\n *\n * @param {string} search - The search term\n * @returns {this}\n * @throws {UnsupportedSearchError} If the active driver does not support search\n */\n public setSearch(search: string): this {\n this._assertCapability('search', new UnsupportedSearchError());\n this._nestService.setSearch(search);\n this._nestService.page = 1;\n\n return this;\n }\n\n /**\n * Get the total number of pages reported by the most recent paginated response\n *\n * @remarks Throws when called before any `paginate()` has synced a value. For a non-throwing read in a template, read `nest().isLastPageKnown` first as a guard.\n * @returns The last page number\n * @throws {PaginationNotSyncedError} If `state.isLastPageKnown` is false (no paginated response has been synced yet)\n */\n public totalPages(): number {\n const state = this._nestService.nest();\n\n if (!state.isLastPageKnown) {\n throw new PaginationNotSyncedError('read totalPages');\n }\n\n return state.lastPage;\n }\n}\n","import { Inject, Injectable } from '@angular/core';\n\nimport { HeaderBag } from '../interfaces/header-bag.interface';\nimport { IPaginatedObject } from '../interfaces/paginated-object.interface';\nimport { IResponseStrategy } from '../interfaces/response-strategy.interface';\nimport { PaginatedCollection } from '../models/paginated-collection';\nimport { ResponseOptions } from '../models/response-options';\nimport { NestService } from './nest.service';\nimport { NG_QUBEE_RESPONSE_OPTIONS, NG_QUBEE_RESPONSE_STRATEGY } from '../tokens/ng-qubee.tokens';\n\n@Injectable()\nexport class PaginationService {\n\n /**\n * The NestService instance that owns the query-builder state for this\n * PaginationService's scope (environment-level by default, or\n * component-level when used via `provideNgQubeeInstance()`)\n */\n private _nestService: NestService;\n\n /**\n * Resolved response key name options\n */\n private _options: ResponseOptions;\n\n /**\n * The response strategy that parses responses for the active driver\n */\n private _responseStrategy: IResponseStrategy;\n\n constructor(\n nestService: NestService,\n @Inject(NG_QUBEE_RESPONSE_STRATEGY) responseStrategy: IResponseStrategy,\n @Inject(NG_QUBEE_RESPONSE_OPTIONS) options: ResponseOptions = new ResponseOptions({})\n ) {\n this._nestService = nestService;\n this._options = options;\n this._responseStrategy = responseStrategy;\n }\n\n /**\n * Transform a raw API response into a typed PaginatedCollection\n *\n * Delegates to the active driver's response strategy for parsing, then\n * auto-syncs the parsed `page` and `lastPage` back into `NestService`\n * so pagination navigation helpers on `NgQubeeService` can operate\n * against the live server-reported bounds without consumer bookkeeping.\n *\n * @remarks\n * `lastPage` is only synced when the response yields a positive integer.\n * Server-emitted `0` (empty collection edge case) and absent fields are\n * treated as \"no useful info\" and leave `isLastPageKnown: false`.\n *\n * @param response - The raw API response body. For drivers that emit a\n * bare array (PostgREST), pass the array.\n * @param headers - Optional HTTP response headers. Required by the\n * PostgREST driver (reads `Content-Range` for pagination metadata);\n * body-only drivers ignore it. Accepts Angular's `HttpHeaders`, the\n * native `Headers` class, or a plain `Record<string, string>`.\n * @returns A typed PaginatedCollection instance\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public paginate<T extends IPaginatedObject>(response: { [key: string]: any }, headers?: HeaderBag): PaginatedCollection<T> {\n const collection = this._responseStrategy.paginate<T>(response, this._options, headers);\n\n this._nestService.page = collection.page;\n\n if (typeof collection.lastPage === 'number' && Number.isInteger(collection.lastPage) && collection.lastPage > 0) {\n this._nestService.syncLastPage(collection.lastPage);\n }\n\n return collection;\n }\n}\n","import { EnvironmentProviders, Provider, makeEnvironmentProviders } from '@angular/core';\n\nimport { DRIVERS } from './drivers/driver-registry';\nimport { PaginationModeEnum } from './enums/pagination-mode.enum';\nimport { IConfig } from './interfaces/config.interface';\nimport { QueryBuilderOptions } from './models/query-builder-options';\nimport { NestService } from './services/nest.service';\nimport { NgQubeeService } from './services/ng-qubee.service';\nimport { PaginationService } from './services/pagination.service';\nimport {\n NG_QUBEE_DRIVER,\n NG_QUBEE_REQUEST_OPTIONS,\n NG_QUBEE_REQUEST_STRATEGY,\n NG_QUBEE_RESPONSE_OPTIONS,\n NG_QUBEE_RESPONSE_STRATEGY\n} from './tokens/ng-qubee.tokens';\n\n/**\n * Build the core provider list shared by `provideNgQubee()` and\n * `NgQubeeModule.forRoot()`\n *\n * Looks up the driver definition from the registry and calls its three\n * factories — request strategy, response strategy, response options.\n * Adding a driver means adding one entry to `DRIVERS`; this function\n * does not change.\n *\n * Exposes the driver, strategies, and options via injection tokens so that\n * consumers can request a component-scoped instance of the services through\n * `provideNgQubeeInstance()`.\n *\n * @param config - Configuration object compliant to the IConfig interface\n * @returns An array of Providers for the environment injector\n */\nexport function buildNgQubeeProviders(config: IConfig): Provider[] {\n const driver = config.driver;\n const paginationMode = config.pagination ?? PaginationModeEnum.QUERY;\n const definition = DRIVERS[driver];\n\n const requestOptions = new QueryBuilderOptions(Object.assign({}, config.request));\n const responseOptions = definition.createResponseOptions(Object.assign({}, config.response));\n\n return [\n { provide: NG_QUBEE_DRIVER, useValue: driver },\n { provide: NG_QUBEE_REQUEST_STRATEGY, useValue: definition.createRequestStrategy(paginationMode) },\n { provide: NG_QUBEE_REQUEST_OPTIONS, useValue: requestOptions },\n { provide: NG_QUBEE_RESPONSE_STRATEGY, useValue: definition.createResponseStrategy() },\n { provide: NG_QUBEE_RESPONSE_OPTIONS, useValue: responseOptions },\n NestService,\n NgQubeeService,\n PaginationService\n ];\n}\n\n/**\n * Sets up providers necessary to enable `NgQubee` functionality for the application.\n *\n * @usageNotes\n *\n * Basic example with the Laravel driver:\n * ```\n * bootstrapApplication(AppComponent, {\n * providers: [provideNgQubee({ driver: DriverEnum.LARAVEL })]\n * });\n * ```\n *\n * Spatie driver example:\n * ```\n * import { DriverEnum } from 'ng-qubee';\n *\n * bootstrapApplication(AppComponent, {\n * providers: [provideNgQubee({ driver: DriverEnum.SPATIE })]\n * });\n * ```\n *\n * JSON:API driver example:\n * ```\n * import { DriverEnum } from 'ng-qubee';\n *\n * bootstrapApplication(AppComponent, {\n * providers: [provideNgQubee({ driver: DriverEnum.JSON_API })]\n * });\n * ```\n *\n * NestJS driver example:\n * ```\n * import { DriverEnum } from 'ng-qubee';\n *\n * bootstrapApplication(AppComponent, {\n * providers: [provideNgQubee({ driver: DriverEnum.NESTJS })]\n * });\n * ```\n *\n * @publicApi\n * @param config - Configuration object compliant to the IConfig interface\n * @returns A set of providers to setup NgQubee\n */\nexport function provideNgQubee(config: IConfig): EnvironmentProviders {\n return makeEnvironmentProviders(buildNgQubeeProviders(config));\n}\n\n/**\n * Providers for a component-scoped NgQubee instance\n *\n * Use this inside a standalone component's `providers: [...]` to get a\n * dedicated `NgQubeeService` (and its `NestService` / `PaginationService`\n * collaborators) whose query-builder and pagination state does not bleed\n * with the app-wide shared instance provided by `provideNgQubee()`.\n *\n * @usageNotes\n *\n * ```\n * @Component({\n * standalone: true,\n * providers: [...provideNgQubeeInstance()]\n * })\n * export class MyFeatureComponent {\n * constructor(private _qb: NgQubeeService) {}\n * }\n * ```\n *\n * The driver, strategies, and options are inherited from the environment\n * injector (`provideNgQubee()` at root), so only the service instances are\n * re-created at the component level.\n *\n * @publicApi\n * @returns A provider array to spread into a component's `providers`\n */\nexport function provideNgQubeeInstance(): Provider[] {\n return [NestService, NgQubeeService, PaginationService];\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\n\nimport { IConfig } from './interfaces/config.interface';\nimport { buildNgQubeeProviders } from './provide-ngqubee';\n\n// @dynamic\n@NgModule({})\nexport class NgQubeeModule {\n\n /**\n * Configure NgQubee for the root module\n *\n * @param config - Configuration object with driver, and optional request and response settings\n * @returns Module with providers configured for the specified driver\n */\n public static forRoot(config: IConfig): ModuleWithProviders<NgQubeeModule> {\n return {\n ngModule: NgQubeeModule,\n providers: buildNgQubeeProviders(config)\n };\n }\n}\n","/*\n * Public API Surface of angular-query-builder\n */\n\nexport * from './lib/models/paginated-collection';\nexport * from './lib/ng-qubee.module';\nexport * from './lib/provide-ngqubee';\nexport * from './lib/services/ng-qubee.service';\nexport * from './lib/services/pagination.service';\n\n// Enums\nexport * from './lib/enums/driver.enum';\nexport * from './lib/enums/filter-operator.enum';\nexport * from './lib/enums/pagination-mode.enum';\nexport * from './lib/enums/sort.enum';\n\n// Error classes\nexport * from './lib/errors/invalid-filter-operator-value.error';\nexport * from './lib/errors/invalid-limit.error';\nexport * from './lib/errors/invalid-page-number.error';\nexport * from './lib/errors/invalid-resource-name.error';\nexport * from './lib/errors/key-not-found.error';\nexport * from './lib/errors/pagination-not-synced.error';\nexport * from './lib/errors/unselectable-model.error';\nexport * from './lib/errors/unsupported-field-selection.error';\nexport * from './lib/errors/unsupported-filter.error';\nexport * from './lib/errors/unsupported-filter-operator.error';\nexport * from './lib/errors/unsupported-includes.error';\nexport * from './lib/errors/unsupported-search.error';\nexport * from './lib/errors/unsupported-select.error';\nexport * from './lib/errors/unsupported-sort.error';\n\n// Interfaces\nexport * from './lib/interfaces/config.interface';\nexport * from './lib/interfaces/fields.interface';\nexport * from './lib/interfaces/filters.interface';\nexport * from './lib/interfaces/header-bag.interface';\nexport * from './lib/interfaces/nest-state.interface';\nexport * from './lib/interfaces/operator-filter.interface';\nexport * from './lib/interfaces/page.interface';\nexport * from './lib/interfaces/paginated-object.interface';\nexport * from './lib/interfaces/pagination-config.interface';\nexport * from './lib/interfaces/query-builder-config.interface';\nexport * from './lib/interfaces/query-builder-state.interface';\nexport * from './lib/interfaces/request-strategy.interface';\nexport * from './lib/interfaces/response-strategy.interface';\nexport * from './lib/interfaces/sort.interface';\n\n// Injection tokens\nexport * from './lib/tokens/ng-qubee.tokens';\n\n// Strategies\nexport * from './lib/strategies/json-api-request.strategy';\nexport * from './lib/strategies/json-api-response.strategy';\nexport * from './lib/strategies/laravel-request.strategy';\nexport * from './lib/strategies/laravel-response.strategy';\nexport * from './lib/strategies/nestjs-request.strategy';\nexport * from './lib/strategies/nestjs-response.strategy';\nexport * from './lib/strategies/postgrest-request.strategy';\nexport * from './lib/strategies/postgrest-response.strategy';\nexport * from './lib/strategies/spatie-request.strategy';\nexport * from './lib/strategies/spatie-response.strategy';\nexport * from './lib/strategies/strapi-request.strategy';\nexport * from './lib/strategies/strapi-response.strategy';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.NestService"],"mappings":";;;;;AAAM,MAAO,gBAAiB,SAAQ,KAAK,CAAA;AACvC,IAAA,WAAA,CAAY,GAAW,EAAA;AACnB,QAAA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CAAC,EAAE;AAClG,QAAA,EAAE,OAAO,EAAE,wBAAwB,EAAE,QAAQ,EAAE,cAAc,EAAE;QAC/D,EAAE,OAAO,EAAE,0BAA0B,EAAE,QAAQ,EAAE,UAAU,CAAC,sBAAsB,EAAE,EAAE;AACtF,QAAA,EAAE,OAAO,EAAE,yBAAyB,EAAE,QAAQ,EAAE,eAAe,EAAE;QACjE,WAAW;QACX,cAAc;QACd;KACD;AACH;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CG;AACG,SAAU,cAAc,CAAC,MAAe,EAAA;AAC5C,IAAA,OAAO,wBAAwB,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;AAChE;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BG;SACa,sBAAsB,GAAA;AACpC,IAAA,OAAO,CAAC,WAAW,EAAE,cAAc,EAAE,iBAAiB,CAAC;AACzD;;AC5HA;MAEa,aAAa,CAAA;AAExB;;;;;AAKG;IACI,OAAO,OAAO,CAAC,MAAe,EAAA;QACnC,OAAO;AACL,YAAA,QAAQ,EAAE,aAAa;AACvB,YAAA,SAAS,EAAE,qBAAqB,CAAC,MAAM;SACxC;IACH;uGAbW,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;wGAAb,aAAa,EAAA,CAAA;wGAAb,aAAa,EAAA,CAAA;;2FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBADzB,QAAQ;mBAAC,EAAE;;;ACNZ;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-qubee.mjs","sources":["../../../src/lib/errors/key-not-found.error.ts","../../../src/lib/models/paginated-collection.ts","../../../src/lib/models/query-builder-options.ts","../../../src/lib/models/response-options.ts","../../../src/lib/enums/driver.enum.ts","../../../src/lib/enums/filter-operator.enum.ts","../../../src/lib/enums/sort.enum.ts","../../../src/lib/errors/invalid-filter-operator-value.error.ts","../../../src/lib/errors/unsupported-filter-operator.error.ts","../../../src/lib/errors/invalid-limit.error.ts","../../../src/lib/strategies/abstract-request.strategy.ts","../../../src/lib/strategies/api-platform-request.strategy.ts","../../../src/lib/strategies/abstract-dot-path-response.strategy.ts","../../../src/lib/strategies/api-platform-response.strategy.ts","../../../src/lib/strategies/directus-request.strategy.ts","../../../src/lib/strategies/directus-response.strategy.ts","../../../src/lib/strategies/drf-request.strategy.ts","../../../src/lib/strategies/drf-response.strategy.ts","../../../src/lib/strategies/feathers-request.strategy.ts","../../../src/lib/strategies/feathers-response.strategy.ts","../../../src/lib/errors/unselectable-model.error.ts","../../../src/lib/strategies/json-api-request.strategy.ts","../../../src/lib/strategies/json-api-response.strategy.ts","../../../src/lib/strategies/json-server-request.strategy.ts","../../../src/lib/strategies/json-server-response.strategy.ts","../../../src/lib/strategies/laravel-request.strategy.ts","../../../src/lib/strategies/abstract-flat-response.strategy.ts","../../../src/lib/strategies/laravel-response.strategy.ts","../../../src/lib/strategies/nestjs-request.strategy.ts","../../../src/lib/strategies/nestjs-response.strategy.ts","../../../src/lib/strategies/nestjsx-crud-request.strategy.ts","../../../src/lib/strategies/nestjsx-crud-response.strategy.ts","../../../src/lib/strategies/odata-request.strategy.ts","../../../src/lib/strategies/odata-response.strategy.ts","../../../src/lib/strategies/payload-request.strategy.ts","../../../src/lib/strategies/payload-response.strategy.ts","../../../src/lib/strategies/pocketbase-request.strategy.ts","../../../src/lib/strategies/pocketbase-response.strategy.ts","../../../src/lib/enums/pagination-mode.enum.ts","../../../src/lib/strategies/postgrest-request.strategy.ts","../../../src/lib/interfaces/header-bag.interface.ts","../../../src/lib/strategies/postgrest-response.strategy.ts","../../../src/lib/strategies/sieve-request.strategy.ts","../../../src/lib/strategies/sieve-response.strategy.ts","../../../src/lib/strategies/spatie-request.strategy.ts","../../../src/lib/strategies/spatie-response.strategy.ts","../../../src/lib/strategies/spring-request.strategy.ts","../../../src/lib/strategies/spring-response.strategy.ts","../../../src/lib/strategies/strapi-request.strategy.ts","../../../src/lib/strategies/strapi-response.strategy.ts","../../../src/lib/strategies/wordpress-request.strategy.ts","../../../src/lib/strategies/wordpress-response.strategy.ts","../../../src/lib/drivers/driver-registry.ts","../../../src/lib/errors/invalid-resource-name.error.ts","../../../src/lib/errors/invalid-page-number.error.ts","../../../src/lib/services/nest.service.ts","../../../src/lib/errors/pagination-not-synced.error.ts","../../../src/lib/errors/unsupported-embedded.error.ts","../../../src/lib/errors/unsupported-field-selection.error.ts","../../../src/lib/errors/unsupported-filter.error.ts","../../../src/lib/errors/unsupported-includes.error.ts","../../../src/lib/errors/unsupported-search.error.ts","../../../src/lib/errors/unsupported-select.error.ts","../../../src/lib/errors/unsupported-sort.error.ts","../../../src/lib/tokens/ng-qubee.tokens.ts","../../../src/lib/services/ng-qubee.service.ts","../../../src/lib/services/pagination.service.ts","../../../src/lib/provide-ngqubee.ts","../../../src/lib/ng-qubee.module.ts","../../../src/public-api.ts","../../../src/ng-qubee.ts"],"sourcesContent":["export class KeyNotFoundError extends Error {\n constructor(key: string) {\n super(`Cannot find the key ${key} inside the collection item: does it really exists?`);\n }\n}","import { KeyNotFoundError } from \"../errors/key-not-found.error\";\nimport { INormalized } from \"../interfaces/normalized.interface\";\nimport { IPaginatedObject } from \"../interfaces/paginated-object.interface\";\n\nexport class PaginatedCollection<T extends IPaginatedObject> {\n constructor(\n public data: T[],\n public readonly page: number,\n public readonly from?: number,\n public readonly to?: number,\n public readonly total?: number,\n public readonly perPage?: number,\n public readonly prevPageUrl?: string,\n public readonly nextPageUrl?: string,\n public readonly lastPage?: number,\n public readonly firstPageUrl?: string,\n public readonly lastPageUrl?: string\n ) {\n //\n }\n\n /**\n * Normalize the collection to a paginated list of ids for state-managed applications.\n * \n * This method returns a single key object, where the key is the page number and the associated value is\n * an array of ids. Each id is fetched by the collection items, looking up for the \"id\" key. If an id is supplied\n * to this method, it will be used instead of the default \"id\" key.\n * \n * Please note that in case the key doesn't exist in the collection's item, a KeyNotFoundError is thrown\n * \n * @param k A key to use instead of the default \"id\": this will be searched inside each element of the collection\n * @returns []\n * @throws KeyNotFoundItem\n */\n public normalize(id?: string): INormalized {\n return {\n [this.page]: this.data.reduce((ids: number[], value: T) => {\n if (id && id in value) {\n ids.push(value[id]);\n } else if (value.hasOwnProperty('id')) {\n ids.push(value['id']);\n } else {\n throw new KeyNotFoundError(id || 'id');\n }\n\n return ids;\n }, [])\n }\n }\n}","import { IQueryBuilderConfig } from '../interfaces/query-builder-config.interface';\n\n/**\n * Resolved query parameter key names with defaults applied\n *\n * Maps logical query concepts to the actual query parameter names\n * used in the generated URI. Unset values fall back to defaults.\n */\nexport class QueryBuilderOptions {\n public readonly appends: string;\n public readonly fields: string;\n public readonly filters: string;\n public readonly includes: string;\n public readonly limit: string;\n public readonly page: string;\n public readonly search: string;\n public readonly select: string;\n public readonly sort: string;\n public readonly sortBy: string;\n\n constructor(options: IQueryBuilderConfig) {\n this.appends = options.appends || 'append';\n this.fields = options.fields || 'fields';\n this.filters = options.filters || 'filter';\n this.includes = options.includes || 'include';\n this.limit = options.limit || 'limit';\n this.page = options.page || 'page';\n this.search = options.search || 'search';\n this.select = options.select || 'select';\n this.sort = options.sort || 'sort';\n this.sortBy = options.sortBy || 'sortBy';\n }\n}\n","import { IPaginationConfig } from '../interfaces/pagination-config.interface';\n\n/**\n * Resolved response field key names with defaults applied\n *\n * Maps logical pagination concepts to the actual key names\n * used in the API response. Unset values fall back to Laravel defaults.\n *\n * For NestJS responses, use dot-notation paths:\n * ```typescript\n * new ResponseOptions({\n * currentPage: 'meta.currentPage',\n * total: 'meta.totalItems'\n * });\n * ```\n */\nexport class ResponseOptions {\n public readonly currentPage: string;\n public readonly data: string;\n public readonly firstPageUrl: string;\n public readonly from: string;\n public readonly lastPage: string;\n public readonly lastPageUrl: string;\n public readonly nextPageUrl: string;\n public readonly path: string;\n public readonly perPage: string;\n public readonly prevPageUrl: string;\n public readonly to: string;\n public readonly total: string;\n\n constructor(options: IPaginationConfig) {\n this.currentPage = options.currentPage || 'current_page';\n this.data = options.data || 'data';\n this.firstPageUrl = options.firstPageUrl || 'first_page_url';\n this.from = options.from || 'from';\n this.lastPage = options.lastPage || 'last_page';\n this.lastPageUrl = options.lastPageUrl || 'last_page_url';\n this.nextPageUrl = options.nextPageUrl || 'next_page_url';\n this.path = options.path || 'path';\n this.perPage = options.perPage || 'per_page';\n this.prevPageUrl = options.prevPageUrl || 'prev_page_url';\n this.to = options.to || 'to';\n this.total = options.total || 'total';\n }\n}\n\n/**\n * Pre-configured ResponseOptions for the API Platform (Symfony) driver\n *\n * Uses dot-notation paths into the Hydra/JSON-LD envelope — the Hydra\n * keys contain colons but no dots, so `hydra:view.hydra:next` traverses\n * `response['hydra:view']['hydra:next']`. The `path` slot points at the\n * view's `@id`, which the strategy parses for the current page and page\n * size; `currentPage` / `perPage` / `lastPage` have no body field and\n * default to empty paths (derived from the view URLs instead).\n */\nexport class ApiPlatformResponseOptions extends ResponseOptions {\n constructor(options: IPaginationConfig) {\n super({\n currentPage: options.currentPage || '',\n data: options.data || 'hydra:member',\n firstPageUrl: options.firstPageUrl || 'hydra:view.hydra:first',\n from: options.from || '',\n lastPage: options.lastPage || '',\n lastPageUrl: options.lastPageUrl || 'hydra:view.hydra:last',\n nextPageUrl: options.nextPageUrl || 'hydra:view.hydra:next',\n path: options.path || 'hydra:view.@id',\n perPage: options.perPage || '',\n prevPageUrl: options.prevPageUrl || 'hydra:view.hydra:previous',\n to: options.to || '',\n total: options.total || 'hydra:totalItems'\n });\n }\n}\n\n/**\n * Pre-configured ResponseOptions for the Directus driver\n *\n * The Directus envelope is `{ data, meta: { total_count, filter_count } }`\n * (with `meta=total_count,filter_count` requested — the request strategy\n * always emits it). `total` defaults to `meta.filter_count`, the count of\n * items matching the current filter; point it at `meta.total_count` via\n * `IPaginationConfig` for the unfiltered collection size. The envelope\n * names no current page, page size, or navigation URLs, so those paths\n * default to empty strings — the strategy falls back to page 1 and\n * derives `lastPage`/`from`/`to` only when the response provably holds\n * the whole filtered set. All paths are overridable (dot notation\n * supported) for custom wrappers that do include paging fields.\n */\nexport class DirectusResponseOptions extends ResponseOptions {\n constructor(options: IPaginationConfig) {\n super({\n currentPage: options.currentPage || '',\n data: options.data || 'data',\n firstPageUrl: options.firstPageUrl || '',\n from: options.from || '',\n lastPage: options.lastPage || '',\n lastPageUrl: options.lastPageUrl || '',\n nextPageUrl: options.nextPageUrl || '',\n path: options.path || '',\n perPage: options.perPage || '',\n prevPageUrl: options.prevPageUrl || '',\n to: options.to || '',\n total: options.total || 'meta.filter_count'\n });\n }\n}\n\n/**\n * Pre-configured ResponseOptions for the Django REST Framework (DRF) driver\n *\n * DRF's `PageNumberPagination` envelope is `{ count, next, previous,\n * results }`, with no body field naming the current page, per-page, or\n * last-page. The strategy parses those from the `next` / `previous`\n * URLs, so the corresponding key paths default to empty strings; the\n * strategy ignores `options.currentPage`, `options.perPage`,\n * `options.lastPage`, `options.from`, `options.to`, `options.path`,\n * `options.firstPageUrl`, and `options.lastPageUrl`.\n */\nexport class DrfResponseOptions extends ResponseOptions {\n constructor(options: IPaginationConfig) {\n super({\n currentPage: options.currentPage || '',\n data: options.data || 'results',\n firstPageUrl: options.firstPageUrl || '',\n from: options.from || '',\n lastPage: options.lastPage || '',\n lastPageUrl: options.lastPageUrl || '',\n nextPageUrl: options.nextPageUrl || 'next',\n path: options.path || '',\n perPage: options.perPage || '',\n prevPageUrl: options.prevPageUrl || 'previous',\n to: options.to || '',\n total: options.total || 'count'\n });\n }\n}\n\n/**\n * Pre-configured ResponseOptions for the FeathersJS driver\n *\n * The Feathers adapter envelope is `{ total, limit, skip, data }` —\n * offset-based, with no page number and no navigation URLs. `perPage`\n * maps to the envelope's `limit` key and `total` to `total`; the\n * strategy derives `currentPage` / `lastPage` / `from` / `to` from\n * `skip` and `limit`, so the corresponding key paths default to empty\n * strings (the `skip` key itself is fixed by the envelope and read\n * directly by the strategy).\n */\nexport class FeathersResponseOptions extends ResponseOptions {\n constructor(options: IPaginationConfig) {\n super({\n currentPage: options.currentPage || '',\n data: options.data || 'data',\n firstPageUrl: options.firstPageUrl || '',\n from: options.from || '',\n lastPage: options.lastPage || '',\n lastPageUrl: options.lastPageUrl || '',\n nextPageUrl: options.nextPageUrl || '',\n path: options.path || '',\n perPage: options.perPage || 'limit',\n prevPageUrl: options.prevPageUrl || '',\n to: options.to || '',\n total: options.total || 'total'\n });\n }\n}\n\n/**\n * Pre-configured ResponseOptions for the JSON:API driver\n *\n * Uses dot-notation paths to access nested values in the JSON:API response format.\n * JSON:API meta key names vary by implementation; these defaults cover the most\n * common conventions and can be fully customised via `IPaginationConfig`.\n */\nexport class JsonApiResponseOptions extends ResponseOptions {\n constructor(options: IPaginationConfig) {\n super({\n currentPage: options.currentPage || 'meta.current-page',\n data: options.data || 'data',\n firstPageUrl: options.firstPageUrl || 'links.first',\n from: options.from || 'meta.from',\n lastPage: options.lastPage || 'meta.page-count',\n lastPageUrl: options.lastPageUrl || 'links.last',\n nextPageUrl: options.nextPageUrl || 'links.next',\n path: options.path || 'path',\n perPage: options.perPage || 'meta.per-page',\n prevPageUrl: options.prevPageUrl || 'links.prev',\n to: options.to || 'meta.to',\n total: options.total || 'meta.total'\n });\n }\n}\n\n/**\n * Pre-configured ResponseOptions for the json-server driver\n *\n * The json-server v1 envelope is `{ first, prev, next, last, pages,\n * items, data }`, where `first`/`prev`/`next`/`last` are **page\n * numbers**, not URLs — the strategy reads `prev`/`next` directly for\n * position derivation and leaves the URL slots `undefined`, so the\n * navigation-URL paths default to empty strings. `total` maps to\n * `items` and `lastPage` to `pages`; `currentPage` and `perPage` have\n * no body field and are derived.\n */\nexport class JsonServerResponseOptions extends ResponseOptions {\n constructor(options: IPaginationConfig) {\n super({\n currentPage: options.currentPage || '',\n data: options.data || 'data',\n firstPageUrl: options.firstPageUrl || '',\n from: options.from || '',\n lastPage: options.lastPage || 'pages',\n lastPageUrl: options.lastPageUrl || '',\n nextPageUrl: options.nextPageUrl || '',\n path: options.path || '',\n perPage: options.perPage || '',\n prevPageUrl: options.prevPageUrl || '',\n to: options.to || '',\n total: options.total || 'items'\n });\n }\n}\n\n/**\n * Pre-configured ResponseOptions for the NestJS driver\n *\n * Uses dot-notation paths to access nested values in the NestJS response format.\n */\nexport class NestjsResponseOptions extends ResponseOptions {\n constructor(options: IPaginationConfig) {\n super({\n currentPage: options.currentPage || 'meta.currentPage',\n data: options.data || 'data',\n firstPageUrl: options.firstPageUrl || 'links.first',\n from: options.from || 'meta.from',\n lastPage: options.lastPage || 'meta.totalPages',\n lastPageUrl: options.lastPageUrl || 'links.last',\n nextPageUrl: options.nextPageUrl || 'links.next',\n path: options.path || 'path',\n perPage: options.perPage || 'meta.itemsPerPage',\n prevPageUrl: options.prevPageUrl || 'links.previous',\n to: options.to || 'meta.to',\n total: options.total || 'meta.totalItems'\n });\n }\n}\n\n/**\n * Pre-configured ResponseOptions for the @nestjsx/crud driver\n *\n * The `getMany` envelope is flat: `{ data, count, total, page,\n * pageCount }`. `perPage` defaults to the `count` field — the number of\n * entities on the **current** page, which equals the requested limit on\n * every page except a partial last one. The envelope carries no\n * `from`/`to` indices and no navigation links, so those paths default to\n * empty strings (the strategy derives `from`/`to` and leaves the URLs\n * `undefined`); consumers can override any path via `IPaginationConfig`.\n */\nexport class NestjsxCrudResponseOptions extends ResponseOptions {\n constructor(options: IPaginationConfig) {\n super({\n currentPage: options.currentPage || 'page',\n data: options.data || 'data',\n firstPageUrl: options.firstPageUrl || '',\n from: options.from || '',\n lastPage: options.lastPage || 'pageCount',\n lastPageUrl: options.lastPageUrl || '',\n nextPageUrl: options.nextPageUrl || '',\n path: options.path || '',\n perPage: options.perPage || 'count',\n prevPageUrl: options.prevPageUrl || '',\n to: options.to || '',\n total: options.total || 'total'\n });\n }\n}\n\n/**\n * Pre-configured ResponseOptions for the OData v4 driver\n *\n * The OData collection envelope is `{ \"@odata.count\", \"@odata.nextLink\",\n * \"value\" }` — flat keys that contain **literal dots**, so the strategy\n * reads them with flat bracket access (never dot-path traversal). No body\n * field names the current page, per-page, or last-page; the strategy\n * derives those from the `@odata.nextLink` URL's `$skip` / `$top`\n * params, so the corresponding key paths default to empty strings and\n * are ignored.\n */\nexport class OdataResponseOptions extends ResponseOptions {\n constructor(options: IPaginationConfig) {\n super({\n currentPage: options.currentPage || '',\n data: options.data || 'value',\n firstPageUrl: options.firstPageUrl || '',\n from: options.from || '',\n lastPage: options.lastPage || '',\n lastPageUrl: options.lastPageUrl || '',\n nextPageUrl: options.nextPageUrl || '@odata.nextLink',\n path: options.path || '',\n perPage: options.perPage || '',\n prevPageUrl: options.prevPageUrl || '',\n to: options.to || '',\n total: options.total || '@odata.count'\n });\n }\n}\n\n/**\n * Pre-configured ResponseOptions for the Payload CMS driver\n *\n * The envelope is the flat `mongoose-paginate-v2` shape: `{ docs,\n * totalDocs, limit, totalPages, page, pagingCounter, hasPrevPage,\n * hasNextPage, prevPage, nextPage }`. `pagingCounter` is the 1-indexed\n * offset of the first doc on the page and maps onto `from`; `to` has no\n * body field and is derived. `prevPage`/`nextPage` are page numbers,\n * not URLs, so the navigation-URL paths default to empty strings. All\n * paths are overridable via `IPaginationConfig` (dot notation\n * supported) for custom wrappers.\n */\nexport class PayloadResponseOptions extends ResponseOptions {\n constructor(options: IPaginationConfig) {\n super({\n currentPage: options.currentPage || 'page',\n data: options.data || 'docs',\n firstPageUrl: options.firstPageUrl || '',\n from: options.from || 'pagingCounter',\n lastPage: options.lastPage || 'totalPages',\n lastPageUrl: options.lastPageUrl || '',\n nextPageUrl: options.nextPageUrl || '',\n path: options.path || '',\n perPage: options.perPage || 'limit',\n prevPageUrl: options.prevPageUrl || '',\n to: options.to || '',\n total: options.total || 'totalDocs'\n });\n }\n}\n\n/**\n * Pre-configured ResponseOptions for the PocketBase driver\n *\n * The records-list envelope is flat: `{ page, perPage, totalItems,\n * totalPages, items }`. The envelope carries no `from`/`to` indices and\n * no navigation links, so those paths default to empty strings (the\n * strategy derives `from`/`to` from `page` × `perPage` and leaves the\n * URLs `undefined`); all paths are overridable via `IPaginationConfig`\n * (dot notation supported) for custom wrappers.\n */\nexport class PocketbaseResponseOptions extends ResponseOptions {\n constructor(options: IPaginationConfig) {\n super({\n currentPage: options.currentPage || 'page',\n data: options.data || 'items',\n firstPageUrl: options.firstPageUrl || '',\n from: options.from || '',\n lastPage: options.lastPage || 'totalPages',\n lastPageUrl: options.lastPageUrl || '',\n nextPageUrl: options.nextPageUrl || '',\n path: options.path || '',\n perPage: options.perPage || 'perPage',\n prevPageUrl: options.prevPageUrl || '',\n to: options.to || '',\n total: options.total || 'totalItems'\n });\n }\n}\n\n/**\n * Pre-configured ResponseOptions for the Sieve (.NET) driver\n *\n * Sieve defines no response envelope (it returns an `IQueryable` the\n * developer wraps), so these defaults target the common hand-rolled\n * `PagedResult<T>` shape: `{ data, page, pageSize, total, totalPages }`.\n * Every path is overridable via `IPaginationConfig` — dot notation is\n * supported, so nested wrappers (`meta.page`, `pagination.total`) map\n * without subclassing. `from`/`to` default to empty paths and are\n * derived; the navigation-URL slots resolve to `undefined` unless paths\n * are provided.\n */\nexport class SieveResponseOptions extends ResponseOptions {\n constructor(options: IPaginationConfig) {\n super({\n currentPage: options.currentPage || 'page',\n data: options.data || 'data',\n firstPageUrl: options.firstPageUrl || '',\n from: options.from || '',\n lastPage: options.lastPage || 'totalPages',\n lastPageUrl: options.lastPageUrl || '',\n nextPageUrl: options.nextPageUrl || '',\n path: options.path || '',\n perPage: options.perPage || 'pageSize',\n prevPageUrl: options.prevPageUrl || '',\n to: options.to || '',\n total: options.total || 'total'\n });\n }\n}\n\n/**\n * Pre-configured ResponseOptions for the Spring Data REST driver\n *\n * Uses dot-notation paths into the HAL envelope: pagination metadata\n * lives under `page.*` and navigation links under `_links.*.href`.\n * `currentPage` points at the **0-indexed** `page.number`; the strategy\n * adds 1 when reading it. `data` defaults to plain `_embedded` because\n * the collection key underneath is the resource rel name (e.g.\n * `_embedded.users`) and cannot be known statically — the strategy picks\n * the first array inside; pin an exact path via `IPaginationConfig` when\n * needed. `from`/`to` default to empty paths and are derived.\n */\nexport class SpringResponseOptions extends ResponseOptions {\n constructor(options: IPaginationConfig) {\n super({\n currentPage: options.currentPage || 'page.number',\n data: options.data || '_embedded',\n firstPageUrl: options.firstPageUrl || '_links.first.href',\n from: options.from || '',\n lastPage: options.lastPage || 'page.totalPages',\n lastPageUrl: options.lastPageUrl || '_links.last.href',\n nextPageUrl: options.nextPageUrl || '_links.next.href',\n path: options.path || '',\n perPage: options.perPage || 'page.size',\n prevPageUrl: options.prevPageUrl || '_links.prev.href',\n to: options.to || '',\n total: options.total || 'page.totalElements'\n });\n }\n}\n\n/**\n * Pre-configured ResponseOptions for the Strapi driver\n *\n * Uses dot-notation paths to access the nested `meta.pagination.*` envelope\n * Strapi v4/v5 emits. Strapi does not include navigation links by default,\n * so the URL paths point at locations that will resolve to `undefined`\n * unless the consumer overrides them.\n */\nexport class StrapiResponseOptions extends ResponseOptions {\n constructor(options: IPaginationConfig) {\n super({\n currentPage: options.currentPage || 'meta.pagination.page',\n data: options.data || 'data',\n firstPageUrl: options.firstPageUrl || 'links.first',\n from: options.from || 'meta.pagination.from',\n lastPage: options.lastPage || 'meta.pagination.pageCount',\n lastPageUrl: options.lastPageUrl || 'links.last',\n nextPageUrl: options.nextPageUrl || 'links.next',\n path: options.path || 'path',\n perPage: options.perPage || 'meta.pagination.pageSize',\n prevPageUrl: options.prevPageUrl || 'links.prev',\n to: options.to || 'meta.pagination.to',\n total: options.total || 'meta.pagination.total'\n });\n }\n}\n","/**\n * Enum representing the available pagination driver types\n *\n * Each driver encapsulates the full format knowledge for both\n * request building (URI generation) and response parsing.\n */\nexport enum DriverEnum {\n API_PLATFORM = 'api-platform',\n DIRECTUS = 'directus',\n DRF = 'drf',\n FEATHERS = 'feathers',\n JSON_API = 'json-api',\n JSON_SERVER = 'json-server',\n LARAVEL = 'laravel',\n NESTJS = 'nestjs',\n NESTJSX_CRUD = 'nestjsx-crud',\n ODATA = 'odata',\n PAYLOAD = 'payload',\n POCKETBASE = 'pocketbase',\n POSTGREST = 'postgrest',\n SIEVE = 'sieve',\n SPATIE = 'spatie',\n SPRING = 'spring',\n STRAPI = 'strapi',\n WORDPRESS = 'wordpress'\n}\n","/**\n * Enum representing the available filter operators for explicit operator\n * filters\n *\n * NestJS encodes these with the `$` prefix at the wire level\n * (`filter.field=$operator:value`); PostgREST translates them to its own\n * prefix notation (`col=eq.val`, `col=is.null`, etc.). The enum values are\n * intentionally the NestJS form; each driver's request strategy is\n * responsible for mapping them into its own shape.\n *\n * `FTS`, `PLFTS`, `PHFTS`, `WFTS` are PostgREST-native full-text search\n * variants; they throw `UnsupportedFilterOperatorError` on every other\n * driver that does not recognise them.\n *\n * @see https://github.com/ppetzold/nestjs-paginate\n * @see https://postgrest.org/en/stable/api.html#operators\n */\nexport enum FilterOperatorEnum {\n BTW = '$btw',\n CONTAINS = '$contains',\n EQ = '$eq',\n FTS = '$fts',\n GT = '$gt',\n GTE = '$gte',\n ILIKE = '$ilike',\n IN = '$in',\n LT = '$lt',\n LTE = '$lte',\n NOT = '$not',\n NULL = '$null',\n PHFTS = '$phfts',\n PLFTS = '$plfts',\n SW = '$sw',\n WFTS = '$wfts'\n}\n","export enum SortEnum {\n ASC = 'asc',\n DESC = 'desc'\n}","import { FilterOperatorEnum } from '../enums/filter-operator.enum';\n\n/**\n * Thrown when a filter operator receives a value array of the wrong shape\n *\n * Some operators have arity or type constraints that the library enforces\n * at call time so misuse fails loudly instead of silently emitting invalid\n * server requests:\n *\n * - `BTW` requires exactly two values (min, max).\n * - `NULL` requires exactly one boolean value (`true` for `IS NULL`,\n * `false` for `IS NOT NULL`).\n *\n * Operators with looser shape rules leave validation to the server; this\n * error is reserved for cases where the library itself can detect the\n * problem unambiguously from the call site.\n */\nexport class InvalidFilterOperatorValueError extends Error {\n\n /**\n * @param operator - The operator that rejected the values\n * @param reason - Short human-readable explanation of the constraint\n */\n constructor(operator: FilterOperatorEnum, reason: string) {\n super(`Invalid values for filter operator ${operator}: ${reason}`);\n this.name = 'InvalidFilterOperatorValueError';\n }\n}\n","/**\n * Error thrown when filter operators are attempted with a driver that does not support them\n *\n * Filter operators are only supported by the NestJS driver.\n * Use `addFilter()` for Spatie implicit equality filters.\n */\nexport class UnsupportedFilterOperatorError extends Error {\n constructor() {\n super('Filter operators are only supported by the NestJS driver. Use addFilter() for Spatie.');\n this.name = 'UnsupportedFilterOperatorError';\n }\n}\n","/**\n * Thrown when a limit value does not satisfy the active driver's constraints\n *\n * Validation is driver-scoped: most drivers require an integer `>= 1`, while\n * the NestJS driver additionally accepts `-1` as a \"fetch all items\" sentinel\n * (as documented by nestjs-paginate). The message is tailored accordingly so\n * the caller understands which values are permitted.\n */\nexport class InvalidLimitError extends Error {\n\n /**\n * @param limit - The rejected limit value\n * @param allowFetchAll - Whether the active driver accepts `-1` (fetch all)\n */\n constructor(limit: number, allowFetchAll: boolean = false) {\n const allowed = allowFetchAll\n ? 'a positive integer greater than 0, or -1 to fetch all items'\n : 'a positive integer greater than 0';\n\n super(`Invalid limit value: Limit must be ${allowed}. Received: ${limit}`);\n this.name = 'InvalidLimitError';\n }\n}\n","import { InvalidLimitError } from '../errors/invalid-limit.error';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { IRequestStrategy } from '../interfaces/request-strategy.interface';\nimport { IStrategyCapabilities } from '../interfaces/strategy-capabilities.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\n\n/**\n * Base class for request strategies\n *\n * Concentrates the glue every concrete strategy used to copy: the\n * resource-required guard, the `?`/`&` URL composition, and the default\n * positive-integer `validateLimit`. Concrete strategies override only\n * the parts that differ — the per-driver wire format goes into a single\n * `protected parts(state, options): string[]` method that returns the\n * ordered query-string segments the base then joins.\n *\n * Drivers that need a non-default `validateLimit` (e.g. NestJS, which\n * accepts `-1` as a fetch-all sentinel) override that method directly.\n */\nexport abstract class AbstractRequestStrategy implements IRequestStrategy {\n\n /**\n * Capability declaration for this driver\n *\n * Concrete strategies must provide a static, immutable capability map\n * so `NgQubeeService._assertCapability(...)` can read it.\n */\n public abstract readonly capabilities: IStrategyCapabilities;\n\n /**\n * Compose the full request URI from the given state\n *\n * Template method: validates the resource, computes the base path,\n * delegates the per-driver query-string segments to `parts(...)`, and\n * joins them with the conventional `?`/`&` separators.\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @returns The composed URI string\n * @throws Error if the resource is not set\n */\n public buildUri(state: IQueryBuilderState, options: QueryBuilderOptions): string {\n this.assertResource(state);\n\n const segments = this.parts(state, options);\n\n return this.join(this.baseUri(state), segments);\n }\n\n /**\n * Validate that a limit value is acceptable for this driver\n *\n * Default policy: positive integer. Drivers that recognise a sentinel\n * (NestJS treats `-1` as \"fetch all\") override this method.\n *\n * @param limit - The limit value to validate\n * @throws {InvalidLimitError} If the value is not a positive integer\n */\n public validateLimit(limit: number): void {\n if (Number.isInteger(limit) && limit >= 1) {\n return;\n }\n\n throw new InvalidLimitError(limit);\n }\n\n /**\n * Per-driver query-string segments, in emission order\n *\n * Each entry is one `key=value` (or `key=v1&key=v2` for compound\n * params like PostgREST's `BTW`). Empty arrays are valid and produce\n * a URI containing only the resource path.\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @returns Ordered list of query-string fragments\n */\n protected abstract parts(state: IQueryBuilderState, options: QueryBuilderOptions): string[];\n\n /**\n * Throw if the resource is not set on the state\n *\n * Centralises the message that was previously copy-pasted across four\n * of the five concrete strategies.\n *\n * @param state - The current query builder state\n * @throws Error if `state.resource` is empty\n */\n protected assertResource(state: IQueryBuilderState): void {\n if (!state.resource) {\n throw new Error('Set the resource property BEFORE adding filters or calling the url() / get() methods');\n }\n }\n\n /**\n * Compute the base path (no query string)\n *\n * @param state - The current query builder state\n * @returns The base URI without the query separator (e.g. `/users` or `https://api.example.com/users`)\n */\n protected baseUri(state: IQueryBuilderState): string {\n return state.baseUrl ? `${state.baseUrl}/${state.resource}` : `/${state.resource}`;\n }\n\n /**\n * Glue the base URI and the per-driver query-string segments\n *\n * Returns the bare base when no segments were emitted (e.g. PostgREST\n * in RANGE mode with no filters), otherwise joins with `?` + `&`.\n *\n * @param base - The base URI from `_baseUri`\n * @param segments - The query-string fragments from `parts(...)`\n * @returns The full URI\n */\n protected join(base: string, segments: string[]): string {\n return segments.length ? `${base}?${segments.join('&')}` : base;\n }\n}\n","import { FilterOperatorEnum } from '../enums/filter-operator.enum';\nimport { SortEnum } from '../enums/sort.enum';\nimport { InvalidFilterOperatorValueError } from '../errors/invalid-filter-operator-value.error';\nimport { UnsupportedFilterOperatorError } from '../errors/unsupported-filter-operator.error';\nimport { IOperatorFilter } from '../interfaces/operator-filter.interface';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { IStrategyCapabilities } from '../interfaces/strategy-capabilities.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\nimport { AbstractRequestStrategy } from './abstract-request.strategy';\n\n/**\n * Request strategy for the API Platform (Symfony) driver\n *\n * Generates URIs in [API Platform's filter format](https://api-platform.com/docs/core/filters/):\n * - Filters: `field=value` (exact); multi-value uses the array syntax\n * (`field[]=v1&field[]=v2`, OR semantics)\n * - Operator filters: bracket syntax `field[op]=value` — RangeFilter\n * (`gt`/`gte`/`lt`/`lte`/`between`), SearchFilter strategies\n * (`partial`/`ipartial`/`start`), ExistsFilter (`exists`) — see the\n * mapping on `_formatOperatorSegments`\n * - Relation filtering: dot paths pass through (`author.name=John` via\n * `addFilter('author.name', 'John')`)\n * - Sorts: `order[field]=asc` / `order[field]=desc` (one param per rule)\n * - Pagination: `page=N&itemsPerPage=M`\n *\n * The `order` and `itemsPerPage` keys are API Platform conventions and\n * intentionally not configurable through `QueryBuilderOptions`; `page`\n * honours the existing option key (its default matches the wire format).\n *\n * Date fields use API Platform's DateFilter (`field[after]=…`,\n * `field[before]=…`) — there is no `FilterOperatorEnum` counterpart, but\n * the bracket key passes through `addFilter` directly:\n * `addFilter('createdAt[after]', '2023-01-01')`.\n *\n * `NOT` (no negation filter in API Platform core) and the\n * PostgREST-native full-text operators (`FTS`, `PHFTS`, `PLFTS`,\n * `WFTS`) throw `UnsupportedFilterOperatorError`.\n *\n * @see https://api-platform.com/docs/core/filters/\n */\nexport class ApiPlatformRequestStrategy extends AbstractRequestStrategy {\n\n /**\n * Filters, operator filters, sorts — no per-model fields, no\n * includes (relations embed via serialization groups server-side),\n * no flat select, no global search parameter\n */\n public readonly capabilities: IStrategyCapabilities = {\n embedded: false,\n fields: false,\n filters: true,\n includes: false,\n operatorFilters: true,\n search: false,\n select: false,\n sort: true\n };\n\n /**\n * API Platform-native names of the two hardcoded query keys\n *\n * `order[...]` and `itemsPerPage` are fixed conventions of API\n * Platform's OrderFilter and pagination; they are intentionally not\n * configurable through `QueryBuilderOptions` and live as private\n * statics so they are visible in one place.\n */\n private static readonly _itemsPerPageKey = 'itemsPerPage';\n private static readonly _orderKey = 'order';\n\n /**\n * Emit API Platform-format query-string segments in canonical order:\n * filters → operator filters → order → page → itemsPerPage\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration (used\n * for `page`, whose default matches the wire format)\n * @returns Ordered query-string fragments\n */\n protected parts(state: IQueryBuilderState, options: QueryBuilderOptions): string[] {\n const out: string[] = [];\n\n this._appendFilters(state, out);\n this._appendOperatorFilters(state, out);\n this._appendOrder(state, out);\n this._appendPage(state, options, out);\n this._appendItemsPerPage(state, out);\n\n return out;\n }\n\n /**\n * Append simple filter parameters\n *\n * A single value emits the bare exact-match form (`field=value`);\n * multiple values use API Platform's array syntax with OR semantics\n * (`field[]=v1&field[]=v2`).\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendFilters(state: IQueryBuilderState, out: string[]): void {\n Object.keys(state.filters).forEach(field => {\n const values = state.filters[field];\n\n if (!values.length) {\n return;\n }\n\n if (values.length === 1) {\n out.push(`${field}=${values[0]}`);\n return;\n }\n\n values.forEach(value => out.push(`${field}[]=${value}`));\n });\n }\n\n /**\n * Append the itemsPerPage parameter\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendItemsPerPage(state: IQueryBuilderState, out: string[]): void {\n out.push(`${ApiPlatformRequestStrategy._itemsPerPageKey}=${state.limit}`);\n }\n\n /**\n * Append explicit operator filters in the bracket syntax\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendOperatorFilters(state: IQueryBuilderState, out: string[]): void {\n state.operatorFilters.forEach((filter: IOperatorFilter) => {\n out.push(...this._formatOperatorSegments(filter));\n });\n }\n\n /**\n * Append `order[field]=asc` / `order[field]=desc` params, one per rule\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendOrder(state: IQueryBuilderState, out: string[]): void {\n state.sorts.forEach(sort => {\n const direction = sort.order === SortEnum.DESC ? 'desc' : 'asc';\n\n out.push(`${ApiPlatformRequestStrategy._orderKey}[${sort.field}]=${direction}`);\n });\n }\n\n /**\n * Append the page parameter\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendPage(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n out.push(`${options.page}=${state.page}`);\n }\n\n /**\n * Translate a `FilterOperatorEnum` operator filter into one or more\n * API Platform bracket segments\n *\n * The mapping is library-canonical → API Platform-native:\n * - `EQ` → bare exact match (`field=value`, SearchFilter exact)\n * - `GT`/`GTE`/`LT`/`LTE` → RangeFilter (`field[gt]=v`, …)\n * - `BTW` → RangeFilter `field[between]=min..max` (arity-checked)\n * - `CONTAINS` → SearchFilter partial (`field[partial]=v`)\n * - `ILIKE` → SearchFilter ipartial (`field[ipartial]=v`,\n * case-insensitive)\n * - `SW` → SearchFilter start (`field[start]=v`)\n * - `IN` → array syntax (`field[]=v1&field[]=v2`)\n * - `NULL` → ExistsFilter — **inverted**: `true` (IS NULL) emits\n * `field[exists]=false`, `false` (IS NOT NULL) emits\n * `field[exists]=true`; arity- and type-checked\n *\n * `NOT` (API Platform core ships no negation filter) and PostgREST's\n * full-text-search operators (`FTS`, `PHFTS`, `PLFTS`, `WFTS`) throw\n * `UnsupportedFilterOperatorError`.\n *\n * @param filter - The operator filter to translate\n * @returns One or more bracket-syntax query-string segments\n * @throws {InvalidFilterOperatorValueError} If `BTW` does not receive\n * exactly two values, or `NULL` does not receive exactly one boolean\n * @throws {UnsupportedFilterOperatorError} If the operator has no API\n * Platform equivalent\n */\n private _formatOperatorSegments(filter: IOperatorFilter): string[] {\n const { field, operator, values } = filter;\n const first = values[0];\n\n switch (operator) {\n case FilterOperatorEnum.EQ: return [`${field}=${first}`];\n case FilterOperatorEnum.GT: return [`${field}[gt]=${first}`];\n case FilterOperatorEnum.GTE: return [`${field}[gte]=${first}`];\n case FilterOperatorEnum.LT: return [`${field}[lt]=${first}`];\n case FilterOperatorEnum.LTE: return [`${field}[lte]=${first}`];\n case FilterOperatorEnum.CONTAINS: return [`${field}[partial]=${first}`];\n case FilterOperatorEnum.ILIKE: return [`${field}[ipartial]=${first}`];\n case FilterOperatorEnum.SW: return [`${field}[start]=${first}`];\n case FilterOperatorEnum.IN: return values.map(value => `${field}[]=${value}`);\n\n case FilterOperatorEnum.BTW: {\n if (values.length !== 2) {\n throw new InvalidFilterOperatorValueError(\n operator,\n 'BTW requires exactly 2 values (min, max)'\n );\n }\n\n return [`${field}[between]=${values[0]}..${values[1]}`];\n }\n\n case FilterOperatorEnum.NULL: {\n if (values.length !== 1 || typeof first !== 'boolean') {\n throw new InvalidFilterOperatorValueError(\n operator,\n 'NULL requires exactly 1 boolean value (true → IS NULL, false → IS NOT NULL)'\n );\n }\n\n // ExistsFilter semantics are inverted relative to NULL: exists=false ⇔ IS NULL\n return first ? [`${field}[exists]=false`] : [`${field}[exists]=true`];\n }\n\n case FilterOperatorEnum.NOT:\n case FilterOperatorEnum.FTS:\n case FilterOperatorEnum.PHFTS:\n case FilterOperatorEnum.PLFTS:\n case FilterOperatorEnum.WFTS:\n throw new UnsupportedFilterOperatorError();\n }\n }\n}\n","import { IPaginatedObject } from '../interfaces/paginated-object.interface';\nimport { IResponseStrategy } from '../interfaces/response-strategy.interface';\nimport { PaginatedCollection } from '../models/paginated-collection';\nimport { ResponseOptions } from '../models/response-options';\n\n/**\n * Base class for response strategies whose pagination metadata lives at\n * dot-notation paths inside the response body\n *\n * JSON:API and NestJS share an identical body-traversal algorithm: the\n * total / current-page / etc. live at nested keys like `meta.total`, and\n * `from`/`to` are either present directly or must be derived from\n * `currentPage` × `perPage`. Both strategies were duplicating this\n * verbatim before this base existed; concrete classes now extend and\n * provide only the docstring describing their driver's specific path\n * conventions (see `JsonApiResponseStrategy`, `NestjsResponseStrategy`).\n *\n * Drivers whose pagination metadata travels via HTTP headers (PostgREST)\n * or whose body has a flat shape with no dot paths (Laravel, Spatie) do\n * not extend this class — they implement `IResponseStrategy` directly.\n */\nexport abstract class AbstractDotPathResponseStrategy implements IResponseStrategy {\n\n /**\n * Parse a nested-envelope pagination response into a PaginatedCollection\n *\n * @param response - The raw API response object\n * @param options - The response key name configuration (dot-notation paths supported)\n * @returns A typed PaginatedCollection instance\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public paginate<T extends IPaginatedObject>(response: Record<string, any>, options: ResponseOptions): PaginatedCollection<T> {\n const data = this.resolve(response, options.data) as T[];\n const currentPage = this.resolve(response, options.currentPage) as number;\n const total = this.resolve(response, options.total) as number | undefined;\n const perPage = this.resolve(response, options.perPage) as number | undefined;\n const lastPage = this.resolve(response, options.lastPage) as number | undefined;\n\n // Compute from/to if not directly available\n const from = this.resolveFrom(response, options, currentPage, perPage);\n const to = this.resolveTo(response, options, currentPage, perPage, total);\n\n const prevPageUrl = this.resolve(response, options.prevPageUrl) as string | undefined;\n const nextPageUrl = this.resolve(response, options.nextPageUrl) as string | undefined;\n const firstPageUrl = this.resolve(response, options.firstPageUrl) as string | undefined;\n const lastPageUrl = this.resolve(response, options.lastPageUrl) as string | undefined;\n\n return new PaginatedCollection(\n data,\n currentPage,\n from,\n to,\n total,\n perPage,\n prevPageUrl,\n nextPageUrl,\n lastPage,\n firstPageUrl,\n lastPageUrl\n );\n }\n\n /**\n * Resolve a value from a response object using a dot-notation path\n *\n * Supports both flat keys (`'data'`) and nested paths (`'meta.totalItems'`).\n *\n * @param response - The raw response object\n * @param path - The dot-notation path to resolve\n * @returns The resolved value, or undefined if any segment is missing\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n protected resolve(response: Record<string, any>, path: string): unknown {\n return path.split('.').reduce((obj, key) => obj?.[key], response);\n }\n\n /**\n * Resolve the \"from\" index value\n *\n * If `options.from` resolves to a value in the response, use it.\n * Otherwise compute `(currentPage - 1) * perPage + 1` when both are known.\n *\n * @param response - The raw response object\n * @param options - The response key name configuration\n * @param currentPage - The current page number\n * @param perPage - The number of items per page\n * @returns The \"from\" index, or `undefined` when neither path nor inputs suffice\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n protected resolveFrom(response: Record<string, any>, options: ResponseOptions, currentPage: number, perPage?: number): number | undefined {\n const direct = this.resolve(response, options.from);\n\n if (direct !== undefined) {\n return direct as number;\n }\n\n if (currentPage && perPage) {\n return (currentPage - 1) * perPage + 1;\n }\n\n return undefined;\n }\n\n /**\n * Resolve the \"to\" index value\n *\n * If `options.to` resolves to a value in the response, use it.\n * Otherwise compute `Math.min(currentPage * perPage, total)` when all\n * three are known.\n *\n * @param response - The raw response object\n * @param options - The response key name configuration\n * @param currentPage - The current page number\n * @param perPage - The number of items per page\n * @param total - The total number of items\n * @returns The \"to\" index, or `undefined` when neither path nor inputs suffice\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n protected resolveTo(response: Record<string, any>, options: ResponseOptions, currentPage: number, perPage?: number, total?: number): number | undefined {\n const direct = this.resolve(response, options.to);\n\n if (direct !== undefined) {\n return direct as number;\n }\n\n if (currentPage && perPage && total) {\n return Math.min(currentPage * perPage, total);\n }\n\n return undefined;\n }\n}\n","import { IPaginatedObject } from '../interfaces/paginated-object.interface';\nimport { PaginatedCollection } from '../models/paginated-collection';\nimport { ResponseOptions } from '../models/response-options';\nimport { AbstractDotPathResponseStrategy } from './abstract-dot-path-response.strategy';\n\n/**\n * Response strategy for the API Platform (Symfony) driver\n *\n * Parses API Platform's default Hydra/JSON-LD collection envelope:\n *\n * ```json\n * {\n * \"@context\": \"/contexts/Book\",\n * \"@type\": \"hydra:Collection\",\n * \"hydra:totalItems\": 48,\n * \"hydra:member\": [...],\n * \"hydra:view\": {\n * \"@id\": \"/books?page=3&itemsPerPage=10\",\n * \"hydra:first\": \"/books?page=1\",\n * \"hydra:previous\": \"/books?page=2\",\n * \"hydra:next\": \"/books?page=4\",\n * \"hydra:last\": \"/books?page=5\"\n * }\n * }\n * ```\n *\n * The Hydra keys contain colons but no dots, so the inherited\n * dot-notation resolver traverses them cleanly (`hydra:view.hydra:next`\n * → `response['hydra:view']['hydra:next']`). The body names no\n * current-page or page-size field, so both are **derived from the\n * `hydra:view` URLs**:\n *\n * - `currentPage` from the `page` param of the view's `@id` (the\n * `path` option slot points there); missing view → page **1**.\n * - `perPage` from the `itemsPerPage` param of the view's `@id`\n * (echoed whenever the request set it — this driver's request\n * strategy always does), falling back to the item count of a page\n * that has a `hydra:next` successor.\n * - `lastPage` from the `page` param of `hydra:last`, falling back to\n * `ceil(total ÷ perPage)`; a view-less response holding the whole\n * collection resolves to 1.\n *\n * URLs are typically **relative** (`/books?page=4`) — parsing retries\n * against a placeholder base, and the links are surfaced as-is on the\n * collection. JSON:API and HAL serialization formats are out of scope\n * (use the JSON:API driver for the former).\n *\n * @see https://api-platform.com/docs/core/pagination/\n */\nexport class ApiPlatformResponseStrategy extends AbstractDotPathResponseStrategy {\n\n /**\n * Parse a Hydra collection response into a PaginatedCollection\n *\n * @param response - The raw API response body\n * @param options - The response key name configuration (dot-notation paths supported)\n * @returns A typed PaginatedCollection instance\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public override paginate<T extends IPaginatedObject>(response: Record<string, any>, options: ResponseOptions): PaginatedCollection<T> {\n const data = this.resolve(response, options.data) as T[];\n const total = this.resolve(response, options.total) as number | undefined;\n const viewUrl = (this.resolve(response, options.path) ?? null) as string | null;\n\n const firstPageUrl = this.resolve(response, options.firstPageUrl) as string | undefined;\n const lastPageUrl = this.resolve(response, options.lastPageUrl) as string | undefined;\n const nextPageUrl = this.resolve(response, options.nextPageUrl) as string | undefined;\n const prevPageUrl = this.resolve(response, options.prevPageUrl) as string | undefined;\n\n const currentPage = this._deriveCurrentPage(viewUrl);\n const perPage = this._derivePerPage(viewUrl, nextPageUrl, data);\n const lastPage = this._deriveLastPage(lastPageUrl, viewUrl, data, total, perPage);\n\n const from = this.resolveFrom(response, options, currentPage, perPage) ?? this._wholeSetFrom(viewUrl, data, total);\n const to = this.resolveTo(response, options, currentPage, perPage, total) ?? this._wholeSetTo(viewUrl, data, total);\n\n return new PaginatedCollection(\n data,\n currentPage,\n from,\n to,\n total,\n perPage,\n prevPageUrl,\n nextPageUrl,\n lastPage,\n firstPageUrl,\n lastPageUrl\n );\n }\n\n /**\n * Derive the current page number from the `hydra:view` `@id` URL\n *\n * Reads the `page` query param; a missing view (pagination disabled\n * or a single-page collection without a partial view) or a link\n * without the param resolves to page 1.\n *\n * @param viewUrl - The `hydra:view.@id` URL, or null\n * @returns The current page number\n */\n private _deriveCurrentPage(viewUrl: string | null): number {\n if (viewUrl === null) {\n return 1;\n }\n\n return this._extractNumberParam(viewUrl, 'page') ?? 1;\n }\n\n /**\n * Derive the last page number\n *\n * Resolution order: the `page` param of `hydra:last`, then\n * `ceil(total ÷ perPage)`, then 1 for a view-less response that\n * provably holds the entire non-empty collection.\n *\n * @param lastPageUrl - The `hydra:view.hydra:last` URL (may be undefined)\n * @param viewUrl - The `hydra:view.@id` URL, or null\n * @param data - The items on the current page\n * @param total - The total item count\n * @param perPage - The page size\n * @returns The last page number, or undefined when inputs insufficient\n */\n private _deriveLastPage(lastPageUrl: string | undefined, viewUrl: string | null, data: unknown[] | undefined, total?: number, perPage?: number): number | undefined {\n if (lastPageUrl !== undefined) {\n const direct = this._extractNumberParam(lastPageUrl, 'page');\n\n if (direct !== undefined) {\n return direct;\n }\n }\n\n if (total !== undefined && perPage !== undefined && perPage > 0) {\n return Math.ceil(total / perPage);\n }\n\n if (viewUrl === null && total !== undefined && total > 0 && (data?.length ?? 0) >= total) {\n return 1;\n }\n\n return undefined;\n }\n\n /**\n * Derive `perPage` from the `hydra:view` `@id` URL\n *\n * Reads the `itemsPerPage` query param (echoed whenever the request\n * set it). When absent, a page with a `hydra:next` successor is\n * necessarily full, so its item count equals the page size.\n *\n * @param viewUrl - The `hydra:view.@id` URL, or null\n * @param nextPageUrl - The `hydra:view.hydra:next` URL (may be undefined)\n * @param data - The items on the current page\n * @returns The page size, or undefined\n */\n private _derivePerPage(viewUrl: string | null, nextPageUrl: string | undefined, data: unknown[] | undefined): number | undefined {\n if (viewUrl !== null) {\n const direct = this._extractNumberParam(viewUrl, 'itemsPerPage');\n\n if (direct !== undefined) {\n return direct;\n }\n }\n\n if (nextPageUrl !== undefined) {\n return data?.length || undefined;\n }\n\n return undefined;\n }\n\n /**\n * Extract an integer query parameter from a Hydra URL\n *\n * @param url - The URL to parse\n * @param name - The query-parameter name to look up (e.g. `page`)\n * @returns The integer value, or undefined\n */\n private _extractNumberParam(url: string, name: string): number | undefined {\n const raw = this._extractQueryParam(url, name);\n\n if (raw === undefined) {\n return undefined;\n }\n\n const parsed = Number.parseInt(raw, 10);\n\n return Number.isNaN(parsed) ? undefined : parsed;\n }\n\n /**\n * Extract a single query parameter from a URL via the WHATWG URL parser\n *\n * Hydra links are typically **relative** (`/books?page=4`), so parsing\n * retries against a placeholder base before giving up. Returns\n * undefined when the URL is unparseable or the parameter is absent.\n *\n * @param url - The URL to parse\n * @param name - The query-parameter name to look up\n * @returns The raw string value of the parameter, or undefined\n */\n private _extractQueryParam(url: string, name: string): string | undefined {\n try {\n const parsed = new URL(url, 'http://relative.invalid');\n const value = parsed.searchParams.get(name);\n\n return value === null ? undefined : value;\n } catch {\n return undefined;\n }\n }\n\n /**\n * Derive `from` for a view-less response holding the whole collection\n *\n * @param viewUrl - The `hydra:view.@id` URL, or null\n * @param data - The items on the current page\n * @param total - The total item count\n * @returns 1 when the response provably holds all items, undefined otherwise\n */\n private _wholeSetFrom(viewUrl: string | null, data: unknown[] | undefined, total?: number): number | undefined {\n if (viewUrl === null && total !== undefined && data?.length && data.length >= total) {\n return 1;\n }\n\n return undefined;\n }\n\n /**\n * Derive `to` for a view-less response holding the whole collection\n *\n * @param viewUrl - The `hydra:view.@id` URL, or null\n * @param data - The items on the current page\n * @param total - The total item count\n * @returns The item count when the response provably holds all items, undefined otherwise\n */\n private _wholeSetTo(viewUrl: string | null, data: unknown[] | undefined, total?: number): number | undefined {\n if (viewUrl === null && total !== undefined && data?.length && data.length >= total) {\n return data.length;\n }\n\n return undefined;\n }\n}\n","import * as qs from 'qs';\n\nimport { FilterOperatorEnum } from '../enums/filter-operator.enum';\nimport { SortEnum } from '../enums/sort.enum';\nimport { InvalidFilterOperatorValueError } from '../errors/invalid-filter-operator-value.error';\nimport { UnsupportedFilterOperatorError } from '../errors/unsupported-filter-operator.error';\nimport { IOperatorFilter } from '../interfaces/operator-filter.interface';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { IStrategyCapabilities } from '../interfaces/strategy-capabilities.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\nimport { AbstractRequestStrategy } from './abstract-request.strategy';\n\n/**\n * Right-hand-side payload of a Directus `filter[field]` entry\n *\n * Each `_operator` key maps to a primitive; multi-value operators\n * (`_in`, `_nin`, `_between`) carry their values pre-joined as a CSV\n * string, which is the form Directus parses from the query string.\n * Booleans appear specifically with `_null` / `_nnull`.\n */\ntype DirectusFilterValue = string | number | boolean;\ntype DirectusFilterPayload = Record<string, DirectusFilterValue>;\n\n/**\n * Request strategy for the Directus driver\n *\n * Generates URIs in [Directus' query format](https://docs.directus.io/reference/query.html):\n * - Filters: `filter[field][_eq]=value` (multi-value collapses to `_in`)\n * - Operator filters: `filter[field][_op]=value` (translated from\n * `FilterOperatorEnum` — `BTW`→`_between`, `SW`→`_starts_with`,\n * `ILIKE`→`_icontains`, `NOT`→`_neq`/`_nin`, `NULL`→`_null`/`_nnull`)\n * - Sorts: `sort=-created_at,name` (CSV, `-` prefix = DESC)\n * - Field selection / relations: a single `fields=` CSV — flat columns\n * from `addSelect`, whole relations from `addIncludes` (`rel.*`), and\n * column-projected relations from `addEmbedded` (`rel.col1,rel.col2`)\n * - Search: `search=term` (global full-text search)\n * - Metadata: a constant `meta=total_count,filter_count` so responses\n * carry the totals the response strategy needs\n * - Pagination (page-based): `limit=N&page=N`\n *\n * The `filter` / `sort` / `fields` / `search` / `limit` / `page` keys\n * honour the existing `QueryBuilderOptions` names (their defaults match\n * the Directus wire format); `meta` is fixed by the server and lives as\n * a private static. Directus' `deep[...]` relational query options and\n * nested relation filtering are out of scope.\n *\n * PostgREST-native full-text search operators (`FTS`, `PHFTS`, `PLFTS`,\n * `WFTS`) throw `UnsupportedFilterOperatorError` — use `search` or the\n * `CONTAINS` / `ILIKE` operator filters instead.\n *\n * @see https://docs.directus.io/reference/query.html\n * @see https://docs.directus.io/reference/filter-rules.html\n */\nexport class DirectusRequestStrategy extends AbstractRequestStrategy {\n\n /**\n * Filters, operator filters, sorts, flat select, includes and embedded\n * (both folding into `fields=`), global search — no per-model fields\n * (Directus scopes relational projections with dot paths, not a\n * `fields[model]` map)\n */\n public readonly capabilities: IStrategyCapabilities = {\n embedded: true,\n fields: false,\n filters: true,\n includes: true,\n operatorFilters: true,\n search: true,\n select: true,\n sort: true\n };\n\n /**\n * Directus-native name of the metadata query key\n *\n * `meta` has no `QueryBuilderOptions` slot and is fixed by the server,\n * so it lives as a private static to be visible in one place.\n */\n private static readonly _metaKey = 'meta';\n\n /**\n * Emit Directus-format query-string segments in canonical order:\n * filter (merged) → sort → fields → search → meta → limit → page\n *\n * Simple filters and operator filters share a single `filter` wrapper\n * so qs emits one ordered, deeply-nested bracket structure rather than\n * two duplicate top-level `filter[...]` blocks.\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @returns Ordered query-string fragments\n */\n protected parts(state: IQueryBuilderState, options: QueryBuilderOptions): string[] {\n const out: string[] = [];\n\n this._appendFilters(state, options, out);\n this._appendSort(state, options, out);\n this._appendFields(state, options, out);\n this._appendSearch(state, options, out);\n this._appendMeta(out);\n this._appendLimit(state, options, out);\n this._appendPage(state, options, out);\n\n return out;\n }\n\n /**\n * Append the single `fields=` CSV combining flat columns, whole\n * relations, and column-projected relations\n *\n * Flat columns come from `addSelect`; relations from `addIncludes`\n * emit as `rel.*`; embedded relations from `addEmbedded` emit one\n * `rel.col` entry per column (or `rel.*` when no columns were given).\n * A relation present in both folds into the embedded fragment, which\n * carries the column information. When relations are present but no\n * flat columns were selected, the flat part defaults to `*` so the\n * base item's columns are not silently dropped from the projection.\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendFields(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n const relations: string[] = [];\n\n state.includes.forEach(relation => {\n if (relation in state.embedded) {\n return;\n }\n\n relations.push(`${relation}.*`);\n });\n\n Object.keys(state.embedded).forEach(relation => {\n const columns = state.embedded[relation];\n\n if (!columns.length) {\n relations.push(`${relation}.*`);\n return;\n }\n\n relations.push(...columns.map(column => `${relation}.${column}`));\n });\n\n if (!state.select.length && !relations.length) {\n return;\n }\n\n const columns = state.select.length ? state.select : ['*'];\n\n out.push(`${options.fields}=${[...columns, ...relations].join(',')}`);\n }\n\n /**\n * Append the unified `filter[...]` wrapper combining simple filters\n * and operator filters\n *\n * Both kinds emit into the same nested object under the filter key so\n * qs produces a single deeply-bracketed block per request. Simple\n * single-value filters fold to `_eq`; simple multi-value filters fold\n * to `_in` (CSV). Operator filters then merge into the same per-field\n * map, potentially co-existing with a simple filter on the same field.\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendFilters(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n const simpleKeys = Object.keys(state.filters);\n\n if (!simpleKeys.length && !state.operatorFilters.length) {\n return;\n }\n\n const filter: Record<string, DirectusFilterPayload> = {};\n\n simpleKeys.forEach(key => {\n const values = state.filters[key];\n\n if (!values.length) {\n return;\n }\n\n /* eslint-disable @typescript-eslint/naming-convention -- `_eq` / `_in` are fixed by the Directus wire format */\n filter[key] = values.length === 1\n ? { _eq: values[0] }\n : { _in: values.join(',') };\n /* eslint-enable @typescript-eslint/naming-convention */\n });\n\n state.operatorFilters.forEach((operatorFilter: IOperatorFilter) => {\n const payload = this._formatOperatorPayload(operatorFilter);\n\n filter[operatorFilter.field] = {\n ...(filter[operatorFilter.field] ?? {}),\n ...payload\n };\n });\n\n if (!Object.keys(filter).length) {\n return;\n }\n\n out.push(qs.stringify({ [options.filters]: filter }, { encode: false }));\n }\n\n /**\n * Append the limit parameter\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendLimit(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n out.push(`${options.limit}=${state.limit}`);\n }\n\n /**\n * Append the constant `meta=total_count,filter_count` parameter\n *\n * Always emitted: the Directus response strategy reads the totals from\n * `meta`, which the server only includes when the request asks for it.\n *\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendMeta(out: string[]): void {\n out.push(`${DirectusRequestStrategy._metaKey}=total_count,filter_count`);\n }\n\n /**\n * Append the page parameter\n *\n * Directus pages are 1-indexed, matching the library state directly.\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendPage(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n out.push(`${options.page}=${state.page}`);\n }\n\n /**\n * Append the `search=` global full-text search parameter\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSearch(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n if (!state.search) {\n return;\n }\n\n out.push(`${options.search}=${state.search}`);\n }\n\n /**\n * Append the `sort=-created_at,name` CSV parameter\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSort(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n if (!state.sorts.length) {\n return;\n }\n\n const fields = state.sorts.map(sort =>\n sort.order === SortEnum.DESC ? `-${sort.field}` : sort.field\n );\n\n out.push(`${options.sort}=${fields.join(',')}`);\n }\n\n /**\n * Translate a `FilterOperatorEnum` operator filter into Directus'\n * `_operator → value` payload shape\n *\n * The mapping is library-canonical → Directus-native:\n * - `EQ`/`GT`/`GTE`/`LT`/`LTE` → `_eq`/`_gt`/`_gte`/`_lt`/`_lte`\n * - `CONTAINS` → `_contains`; `ILIKE` → `_icontains` (case-insensitive)\n * - `SW` → `_starts_with`\n * - `IN` → `_in` (CSV)\n * - `BTW` → `_between` with `min,max` (arity-checked)\n * - `NOT` → `_neq` (single value) / `_nin` (multi-value, CSV)\n * - `NULL` → `_null=true` (when value is `true`) / `_nnull=true` (when\n * value is `false`); arity- and type-checked\n *\n * PostgREST's full-text-search operators (`FTS`, `PHFTS`, `PLFTS`,\n * `WFTS`) have no Directus equivalent and throw\n * `UnsupportedFilterOperatorError`.\n *\n * @param filter - The operator filter to translate\n * @returns A `{ _operator: value }` payload ready to merge under\n * `filter[field]`\n * @throws {InvalidFilterOperatorValueError} If `BTW` does not receive\n * exactly two values, or `NULL` does not receive exactly one boolean\n * @throws {UnsupportedFilterOperatorError} If the operator is a\n * PostgREST-only FTS variant\n */\n private _formatOperatorPayload(filter: IOperatorFilter): DirectusFilterPayload {\n const { operator, values } = filter;\n const first = values[0];\n\n /* eslint-disable @typescript-eslint/naming-convention -- `_operator` keys are fixed by the Directus wire format */\n switch (operator) {\n case FilterOperatorEnum.EQ: return { _eq: first };\n case FilterOperatorEnum.GT: return { _gt: first };\n case FilterOperatorEnum.GTE: return { _gte: first };\n case FilterOperatorEnum.LT: return { _lt: first };\n case FilterOperatorEnum.LTE: return { _lte: first };\n case FilterOperatorEnum.CONTAINS: return { _contains: first };\n case FilterOperatorEnum.ILIKE: return { _icontains: first };\n case FilterOperatorEnum.IN: return { _in: values.join(',') };\n case FilterOperatorEnum.SW: return { _starts_with: first };\n\n case FilterOperatorEnum.BTW: {\n if (values.length !== 2) {\n throw new InvalidFilterOperatorValueError(\n operator,\n 'BTW requires exactly 2 values (min, max)'\n );\n }\n\n return { _between: values.join(',') };\n }\n\n case FilterOperatorEnum.NOT:\n return values.length === 1\n ? { _neq: first }\n : { _nin: values.join(',') };\n\n case FilterOperatorEnum.NULL: {\n if (values.length !== 1 || typeof first !== 'boolean') {\n throw new InvalidFilterOperatorValueError(\n operator,\n 'NULL requires exactly 1 boolean value (true → IS NULL, false → IS NOT NULL)'\n );\n }\n\n return first ? { _null: true } : { _nnull: true };\n }\n\n case FilterOperatorEnum.FTS:\n case FilterOperatorEnum.PHFTS:\n case FilterOperatorEnum.PLFTS:\n case FilterOperatorEnum.WFTS:\n throw new UnsupportedFilterOperatorError();\n }\n /* eslint-enable @typescript-eslint/naming-convention */\n }\n}\n","import { IPaginatedObject } from '../interfaces/paginated-object.interface';\nimport { PaginatedCollection } from '../models/paginated-collection';\nimport { ResponseOptions } from '../models/response-options';\nimport { AbstractDotPathResponseStrategy } from './abstract-dot-path-response.strategy';\n\n/**\n * Response strategy for the Directus driver\n *\n * Parses Directus collection responses (with `meta=total_count,filter_count`\n * requested, which the request strategy always does):\n *\n * ```json\n * {\n * \"data\": [{ \"id\": 1, \"title\": \"Hello\" }],\n * \"meta\": { \"total_count\": 48, \"filter_count\": 12 }\n * }\n * ```\n *\n * The default `total` path is `meta.filter_count` — the number of items\n * matching the current filter, which is the relevant total for paging a\n * filtered collection (`meta.total_count` ignores filters; point the\n * `total` path at it via `IPaginationConfig` if that is what you want).\n *\n * The envelope carries **no current-page or page-size field**, so:\n *\n * - `currentPage` falls back to **1** unless a `currentPage` path is\n * configured and resolves (only guaranteed correct for single-page\n * results — track the requested page in your own state for multi-page\n * UIs).\n * - `perPage` resolves only when a `perPage` path is configured.\n * - `lastPage` is `ceil(total ÷ perPage)` when both are known; on a\n * response that provably holds the whole filtered set it resolves\n * to 1.\n *\n * Every key path is overridable via `IPaginationConfig` (dot notation\n * supported), so custom wrappers that do include paging fields map\n * without subclassing.\n *\n * @see https://docs.directus.io/reference/query.html#meta\n */\nexport class DirectusResponseStrategy extends AbstractDotPathResponseStrategy {\n\n /**\n * Parse a Directus collection response into a PaginatedCollection\n *\n * @param response - The raw API response body\n * @param options - The response key name configuration (dot-notation paths supported)\n * @returns A typed PaginatedCollection instance\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public override paginate<T extends IPaginatedObject>(response: Record<string, any>, options: ResponseOptions): PaginatedCollection<T> {\n const data = this.resolve(response, options.data) as T[];\n const total = this.resolve(response, options.total) as number | undefined;\n const currentPage = (this.resolve(response, options.currentPage) as number | undefined) ?? 1;\n const perPage = this.resolve(response, options.perPage) as number | undefined;\n const lastPage = this._deriveLastPage(response, options, data, total, perPage);\n\n const from = this.resolveFrom(response, options, currentPage, perPage) ?? this._singlePageFrom(data, total);\n const to = this.resolveTo(response, options, currentPage, perPage, total) ?? this._singlePageTo(data, total);\n\n const prevPageUrl = this.resolve(response, options.prevPageUrl) as string | undefined;\n const nextPageUrl = this.resolve(response, options.nextPageUrl) as string | undefined;\n const firstPageUrl = this.resolve(response, options.firstPageUrl) as string | undefined;\n const lastPageUrl = this.resolve(response, options.lastPageUrl) as string | undefined;\n\n return new PaginatedCollection(\n data,\n currentPage,\n from,\n to,\n total,\n perPage,\n prevPageUrl,\n nextPageUrl,\n lastPage,\n firstPageUrl,\n lastPageUrl\n );\n }\n\n /**\n * Derive the last page number\n *\n * Resolution order: the configured `lastPage` path, then\n * `ceil(total ÷ perPage)` when both are known, then 1 when the\n * response provably holds the entire non-empty filtered set.\n *\n * @param response - The raw response object\n * @param options - The response key name configuration\n * @param data - The items on the current page\n * @param total - The total item count\n * @param perPage - The page size\n * @returns The last page number, or undefined when inputs insufficient\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _deriveLastPage(response: Record<string, any>, options: ResponseOptions, data: unknown[] | undefined, total?: number, perPage?: number): number | undefined {\n const direct = this.resolve(response, options.lastPage) as number | undefined;\n\n if (direct !== undefined) {\n return direct;\n }\n\n if (total !== undefined && perPage !== undefined && perPage > 0) {\n return Math.ceil(total / perPage);\n }\n\n if (total !== undefined && total > 0 && (data?.length ?? 0) >= total) {\n return 1;\n }\n\n return undefined;\n }\n\n /**\n * Derive `from` for a response that holds the whole filtered set\n *\n * @param data - The items on the current page\n * @param total - The total item count\n * @returns 1 when the page provably holds all items, undefined otherwise\n */\n private _singlePageFrom(data: unknown[] | undefined, total?: number): number | undefined {\n if (total !== undefined && data?.length && data.length >= total) {\n return 1;\n }\n\n return undefined;\n }\n\n /**\n * Derive `to` for a response that holds the whole filtered set\n *\n * @param data - The items on the current page\n * @param total - The total item count\n * @returns The item count when the page provably holds all items, undefined otherwise\n */\n private _singlePageTo(data: unknown[] | undefined, total?: number): number | undefined {\n if (total !== undefined && data?.length && data.length >= total) {\n return data.length;\n }\n\n return undefined;\n }\n}\n","import { FilterOperatorEnum } from '../enums/filter-operator.enum';\nimport { SortEnum } from '../enums/sort.enum';\nimport { InvalidFilterOperatorValueError } from '../errors/invalid-filter-operator-value.error';\nimport { UnsupportedFilterOperatorError } from '../errors/unsupported-filter-operator.error';\nimport { IOperatorFilter } from '../interfaces/operator-filter.interface';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { IStrategyCapabilities } from '../interfaces/strategy-capabilities.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\nimport { AbstractRequestStrategy } from './abstract-request.strategy';\n\n/**\n * Right-hand-side payload of a django-filter `field__lookup=value` segment\n *\n * The lookup suffix (or empty string for the default `exact` match) and\n * the serialized value combine into the flat key=value pair django-filter\n * reads on the server side.\n */\ntype DrfLookupSuffix = string;\n\n/**\n * Request strategy for the Django REST Framework (DRF) driver\n *\n * Generates URIs in DRF's flat query-parameter format, augmented by\n * django-filter's double-underscore lookup convention:\n *\n * - Simple filters: `field=value` (multi-value collapses to `field__in=v1,v2`)\n * - Operator filters: `field__lookup=value` (translated from\n * `FilterOperatorEnum` — `GTE`→`__gte`, `ILIKE`→`__icontains`,\n * `BTW`→`__range`, `NULL`→`__isnull`, etc.)\n * - Ordering: `ordering=-field1,field2` (`-` prefix = DESC)\n * - Search: `search=term` (DRF's SearchFilter)\n * - Pagination: `page=N&page_size=M` (PageNumberPagination)\n *\n * `ordering` and `page_size` are DRF-idiomatic param names and are\n * intentionally not configurable via `QueryBuilderOptions` — same\n * precedent as PostgREST's `order` and `offset`. PostgREST's full-text\n * search operators (`FTS`, `PHFTS`, `PLFTS`, `WFTS`) and the generic\n * `NOT` have no django-filter equivalent and throw\n * `UnsupportedFilterOperatorError`.\n *\n * @see https://www.django-rest-framework.org/api-guide/filtering/\n * @see https://django-filter.readthedocs.io/\n */\nexport class DrfRequestStrategy extends AbstractRequestStrategy {\n\n /**\n * Simple filters, operator filters (django-filter lookups), sorts, and\n * global search — no per-model fields, no relation includes, no flat\n * select (django-restql adds it but is not core DRF)\n */\n public readonly capabilities: IStrategyCapabilities = {\n embedded: false,\n fields: false,\n filters: true,\n includes: false,\n operatorFilters: true,\n search: true,\n select: false,\n sort: true\n };\n\n /**\n * DRF-native names of the three hardcoded query keys\n *\n * `ordering` and `page_size` are DRF/django-filter conventions and are\n * intentionally not configurable through `QueryBuilderOptions`. `page`\n * matches the default `QueryBuilderOptions.page`, and `search` matches\n * the default `QueryBuilderOptions.search`, so those flow through the\n * shared options object.\n */\n private static readonly _orderingKey = 'ordering';\n private static readonly _pageSizeKey = 'page_size';\n\n /**\n * Emit DRF-format query-string segments in canonical order:\n * filters → operator filters → ordering → search → pagination\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @returns Ordered query-string fragments\n */\n protected parts(state: IQueryBuilderState, options: QueryBuilderOptions): string[] {\n const out: string[] = [];\n\n this._appendFilters(state, out);\n this._appendOperatorFilters(state, out);\n this._appendOrdering(state, out);\n this._appendSearch(state, options, out);\n this._appendPagination(state, options, out);\n\n return out;\n }\n\n /**\n * Append simple filter parameters\n *\n * Single-value filters emit `field=value` (django-filter's default\n * exact match). Multi-value filters collapse to django-filter's\n * `field__in=v1,v2,v3` form, which is the idiomatic way to express\n * \"value in list\" in DRF.\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendFilters(state: IQueryBuilderState, out: string[]): void {\n const keys = Object.keys(state.filters);\n\n if (!keys.length) {\n return;\n }\n\n keys.forEach(key => {\n const values = state.filters[key];\n\n if (!values.length) {\n return;\n }\n\n if (values.length === 1) {\n out.push(`${key}=${values[0]}`);\n return;\n }\n\n out.push(`${key}__in=${values.join(',')}`);\n });\n }\n\n /**\n * Append operator-filter parameters as `field__lookup=value`\n *\n * Maps each `FilterOperatorEnum` value to a django-filter lookup\n * suffix. `BTW` expands to `field__range=min,max`; `NULL` emits\n * `field__isnull=true|false`; the generic `NOT` and PostgREST-only\n * FTS operators are unsupported.\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n * @throws {InvalidFilterOperatorValueError} If `BTW` does not receive\n * exactly two values, or `NULL` does not receive exactly one boolean\n * @throws {UnsupportedFilterOperatorError} If the operator has no\n * django-filter equivalent\n */\n private _appendOperatorFilters(state: IQueryBuilderState, out: string[]): void {\n if (!state.operatorFilters.length) {\n return;\n }\n\n state.operatorFilters.forEach((filter: IOperatorFilter) => {\n const [suffix, value] = this._formatOperatorPayload(filter);\n const key = suffix ? `${filter.field}__${suffix}` : filter.field;\n\n out.push(`${key}=${value}`);\n });\n }\n\n /**\n * Append `ordering=-field1,field2` (django's `-` prefix = DESC)\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendOrdering(state: IQueryBuilderState, out: string[]): void {\n if (!state.sorts.length) {\n return;\n }\n\n const pairs = state.sorts.map(sort =>\n `${sort.order === SortEnum.DESC ? '-' : ''}${sort.field}`\n );\n\n out.push(`${DrfRequestStrategy._orderingKey}=${pairs.join(',')}`);\n }\n\n /**\n * Append `page=N&page_size=M`\n *\n * `page` follows `options.page` (default `page`, matching DRF); the\n * size key is hardcoded to DRF's idiomatic `page_size`.\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendPagination(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n out.push(`${options.page}=${state.page}`);\n out.push(`${DrfRequestStrategy._pageSizeKey}=${state.limit}`);\n }\n\n /**\n * Append `search=term` when a search term is set\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSearch(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n if (!state.search) {\n return;\n }\n\n out.push(`${options.search}=${state.search}`);\n }\n\n /**\n * Translate a `FilterOperatorEnum` operator filter into a\n * `[suffix, serializedValue]` pair\n *\n * The suffix is appended to the field name with a `__` separator on the\n * wire side (`field__gte=18`). The empty string means \"no suffix\" —\n * django-filter's implicit `exact` lookup.\n *\n * Mapping:\n * - `EQ` → `''` (no suffix; default exact match)\n * - `GT`/`GTE`/`LT`/`LTE`/`CONTAINS` → identity (lowercased name)\n * - `ILIKE` → `icontains` (closest case-insensitive analog)\n * - `IN` → `in` with comma-joined values\n * - `SW` → `startswith`\n * - `BTW` → `range` with comma-joined `[min, max]` (arity-checked)\n * - `NULL` → `isnull` with boolean value (arity- and type-checked)\n * - `NOT` → `UnsupportedFilterOperatorError` (no generic negation in\n * django-filter; use `__exclude` on the queryset instead)\n * - `FTS`/`PLFTS`/`PHFTS`/`WFTS` → `UnsupportedFilterOperatorError`\n *\n * @param filter - The operator filter to translate\n * @returns A `[lookupSuffix, serializedValue]` tuple\n * @throws {InvalidFilterOperatorValueError} If `BTW` does not receive\n * exactly two values, or `NULL` does not receive exactly one boolean\n * @throws {UnsupportedFilterOperatorError} If the operator has no\n * django-filter equivalent\n */\n private _formatOperatorPayload(filter: IOperatorFilter): [DrfLookupSuffix, string] {\n const { operator, values } = filter;\n const first = values[0];\n\n switch (operator) {\n case FilterOperatorEnum.EQ: return ['', String(first)];\n case FilterOperatorEnum.GT: return ['gt', String(first)];\n case FilterOperatorEnum.GTE: return ['gte', String(first)];\n case FilterOperatorEnum.LT: return ['lt', String(first)];\n case FilterOperatorEnum.LTE: return ['lte', String(first)];\n case FilterOperatorEnum.CONTAINS: return ['contains', String(first)];\n case FilterOperatorEnum.ILIKE: return ['icontains', String(first)];\n case FilterOperatorEnum.IN: return ['in', values.join(',')];\n case FilterOperatorEnum.SW: return ['startswith', String(first)];\n\n case FilterOperatorEnum.BTW: {\n if (values.length !== 2) {\n throw new InvalidFilterOperatorValueError(\n operator,\n 'BTW requires exactly 2 values (min, max)'\n );\n }\n\n return ['range', values.join(',')];\n }\n\n case FilterOperatorEnum.NULL: {\n if (values.length !== 1 || typeof first !== 'boolean') {\n throw new InvalidFilterOperatorValueError(\n operator,\n 'NULL requires exactly 1 boolean value (true → IS NULL, false → IS NOT NULL)'\n );\n }\n\n return ['isnull', String(first)];\n }\n\n case FilterOperatorEnum.NOT:\n case FilterOperatorEnum.FTS:\n case FilterOperatorEnum.PHFTS:\n case FilterOperatorEnum.PLFTS:\n case FilterOperatorEnum.WFTS:\n throw new UnsupportedFilterOperatorError();\n }\n }\n}\n","import { IPaginatedObject } from '../interfaces/paginated-object.interface';\nimport { IResponseStrategy } from '../interfaces/response-strategy.interface';\nimport { PaginatedCollection } from '../models/paginated-collection';\nimport { ResponseOptions } from '../models/response-options';\n\n/**\n * Response strategy for the Django REST Framework (DRF) driver\n *\n * Parses DRF `PageNumberPagination` responses:\n *\n * ```json\n * {\n * \"count\": 100,\n * \"next\": \"http://api.example.com/items/?page=3\",\n * \"previous\": \"http://api.example.com/items/?page=1\",\n * \"results\": [...]\n * }\n * ```\n *\n * DRF emits no `current_page` field in the body, so this strategy\n * **derives** the current page (and the page size) by inspecting the\n * `next` / `previous` URLs:\n *\n * - `previous === null` → current page is **1**.\n * - `previous` set but has no `?page=N` param → DRF omits `page=1` from\n * URLs when the previous page is the first, so we infer **2**.\n * - `previous` has `?page=N` → current page is **N + 1**.\n *\n * Similarly, `perPage` is parsed from any `?page_size=N` query param on\n * `next` or `previous`, and `lastPage` is computed as\n * `ceil(count / perPage)`. When `perPage` cannot be discovered (e.g. on a\n * single-page response that emits both URLs as `null`), `perPage` and\n * `lastPage` are left undefined.\n *\n * Key paths are resolved through `DrfResponseOptions`, which defaults\n * `data → 'results'`, `total → 'count'`, `nextPageUrl → 'next'`,\n * `prevPageUrl → 'previous'`. The current-page / per-page / last-page\n * paths default to empty strings — the strategy ignores `options` for\n * those slots and uses URL inspection instead.\n *\n * @see https://www.django-rest-framework.org/api-guide/pagination/#pagenumberpagination\n */\nexport class DrfResponseStrategy implements IResponseStrategy {\n\n /**\n * Parse a DRF pagination response into a PaginatedCollection\n *\n * @param response - The raw API response body\n * @param options - The response key name configuration\n * @returns A typed PaginatedCollection instance\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public paginate<T extends IPaginatedObject>(response: Record<string, any>, options: ResponseOptions): PaginatedCollection<T> {\n const data = response[options.data] as T[];\n const total = response[options.total] as number | undefined;\n const prevPageUrl = (response[options.prevPageUrl] ?? null) as string | null;\n const nextPageUrl = (response[options.nextPageUrl] ?? null) as string | null;\n\n const currentPage = this._deriveCurrentPage(prevPageUrl);\n const perPage = this._derivePerPage(nextPageUrl, prevPageUrl);\n const lastPage = this._deriveLastPage(total, perPage);\n\n const from = this._deriveFrom(currentPage, perPage);\n const to = this._deriveTo(currentPage, perPage, total);\n\n return new PaginatedCollection(\n data,\n currentPage,\n from,\n to,\n total,\n perPage,\n prevPageUrl ?? undefined,\n nextPageUrl ?? undefined,\n lastPage,\n undefined,\n undefined\n );\n }\n\n /**\n * Derive the current page number from the `previous` URL\n *\n * - `null` → page 1\n * - URL without `?page=N` → page 2 (DRF omits `page=1` from URLs)\n * - URL with `?page=N` → N + 1\n *\n * @param prevPageUrl - The `previous` link from the DRF response, or null\n * @returns The current page number\n */\n private _deriveCurrentPage(prevPageUrl: string | null): number {\n if (prevPageUrl === null) {\n return 1;\n }\n\n const prevPage = this._extractPageParam(prevPageUrl);\n\n return prevPage === undefined ? 2 : prevPage + 1;\n }\n\n /**\n * Derive `from` as the 1-indexed offset of the first item on this page\n *\n * @param currentPage - The current page number\n * @param perPage - The page size (may be undefined)\n * @returns The 1-indexed `from` index, or undefined when perPage is unknown\n */\n private _deriveFrom(currentPage: number, perPage?: number): number | undefined {\n if (!perPage) {\n return undefined;\n }\n\n return (currentPage - 1) * perPage + 1;\n }\n\n /**\n * Derive the last page number as `ceil(total / perPage)`\n *\n * Both inputs must be defined; an empty result set (`total === 0`)\n * yields `lastPage = 0` which the caller treats as \"no useful info\"\n * and skips the sync to `NestService.lastPage`.\n *\n * @param total - The total item count\n * @param perPage - The page size\n * @returns The last page number, or undefined when either input is missing\n */\n private _deriveLastPage(total?: number, perPage?: number): number | undefined {\n if (total === undefined || perPage === undefined || perPage <= 0) {\n return undefined;\n }\n\n return Math.ceil(total / perPage);\n }\n\n /**\n * Derive `perPage` by parsing `?page_size=N` from any available URL\n *\n * Tries `next` first (page 1 always has a `next` URL with `page_size`\n * if any non-default size was requested), then falls back to\n * `previous`. Returns undefined when neither URL contains the param —\n * the consumer is then on a single-page result with the server's\n * default page size, which is not introspectable from the body alone.\n *\n * @param nextPageUrl - The `next` link from the response, or null\n * @param prevPageUrl - The `previous` link from the response, or null\n * @returns The page size, or undefined\n */\n private _derivePerPage(nextPageUrl: string | null, prevPageUrl: string | null): number | undefined {\n return this._extractPageSizeParam(nextPageUrl) ?? this._extractPageSizeParam(prevPageUrl);\n }\n\n /**\n * Derive `to` as the 1-indexed offset of the last item on this page\n *\n * Clamped to `total` so the last page does not report past the end.\n *\n * @param currentPage - The current page number\n * @param perPage - The page size (may be undefined)\n * @param total - The total item count (may be undefined)\n * @returns The 1-indexed `to` index, or undefined when inputs insufficient\n */\n private _deriveTo(currentPage: number, perPage?: number, total?: number): number | undefined {\n if (perPage === undefined || total === undefined) {\n return undefined;\n }\n\n return Math.min(currentPage * perPage, total);\n }\n\n /**\n * Extract the `page` query parameter from a DRF pagination URL\n *\n * Returns the integer value of `?page=N`, or undefined when the URL is\n * malformed or has no `page` param (which, by DRF convention, means\n * page 1 — the caller infers the semantics).\n *\n * @param url - The URL to parse\n * @returns The integer page value, or undefined\n */\n private _extractPageParam(url: string): number | undefined {\n const raw = this._extractQueryParam(url, 'page');\n\n if (raw === undefined) {\n return undefined;\n }\n\n const parsed = Number.parseInt(raw, 10);\n\n return Number.isNaN(parsed) ? undefined : parsed;\n }\n\n /**\n * Extract the `page_size` query parameter from a DRF pagination URL\n *\n * @param url - The URL to parse (or null)\n * @returns The integer page-size value, or undefined\n */\n private _extractPageSizeParam(url: string | null): number | undefined {\n if (url === null) {\n return undefined;\n }\n\n const raw = this._extractQueryParam(url, 'page_size');\n\n if (raw === undefined) {\n return undefined;\n }\n\n const parsed = Number.parseInt(raw, 10);\n\n return Number.isNaN(parsed) ? undefined : parsed;\n }\n\n /**\n * Extract a single query parameter from a URL via the WHATWG URL parser\n *\n * Returns undefined when the URL is unparseable (relative URL without a\n * base, or malformed) or when the parameter is absent.\n *\n * @param url - The URL to parse\n * @param name - The query-parameter name to look up\n * @returns The raw string value of the parameter, or undefined\n */\n private _extractQueryParam(url: string, name: string): string | undefined {\n try {\n const parsed = new URL(url);\n const value = parsed.searchParams.get(name);\n\n return value === null ? undefined : value;\n } catch {\n return undefined;\n }\n }\n}\n","import * as qs from 'qs';\n\nimport { FilterOperatorEnum } from '../enums/filter-operator.enum';\nimport { SortEnum } from '../enums/sort.enum';\nimport { InvalidFilterOperatorValueError } from '../errors/invalid-filter-operator-value.error';\nimport { UnsupportedFilterOperatorError } from '../errors/unsupported-filter-operator.error';\nimport { IOperatorFilter } from '../interfaces/operator-filter.interface';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { IStrategyCapabilities } from '../interfaces/strategy-capabilities.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\nimport { AbstractRequestStrategy } from './abstract-request.strategy';\n\n/**\n * Right-hand-side payload of a Feathers `field[$operator]` entry\n *\n * Each `$operator` key maps to either a primitive (single-value operators\n * like `$gt`, `$ne`) or an array (multi-value operators like `$in`,\n * `$nin`).\n */\ntype FeathersFilterValue = string | number | boolean;\ntype FeathersFilterPayload = Record<string, FeathersFilterValue | FeathersFilterValue[]>;\n\n/**\n * Request strategy for the FeathersJS driver\n *\n * Generates URIs in [Feathers' common database adapter query syntax](https://feathersjs.com/api/databases/querying):\n * - Filters: `field=value` (exact match); multi-value folds to `$in`\n * (`field[$in][0]=v1&field[$in][1]=v2`)\n * - Operator filters: `field[$op]=value` (translated from\n * `FilterOperatorEnum` — `BTW`→`$gte`+`$lte` pair, `NOT`→`$ne`/`$nin`)\n * - Sorts: `$sort[field]=1` (ASC) / `$sort[field]=-1` (DESC)\n * - Flat field selection: `$select[0]=col1&$select[1]=col2`\n * - Pagination (offset-based): `$limit=N&$skip=M` with\n * `skip = (page - 1) × limit`\n *\n * The dollar-prefixed query keys (`$limit`, `$skip`, `$sort`, `$select`)\n * are fixed by the Feathers adapter-commons parser and intentionally not\n * configurable through `QueryBuilderOptions`; they live as private\n * statics so they are visible in one place.\n *\n * Feathers' core adapter syntax has no relation includes, no per-model\n * field selection, and no global search — the corresponding fluent\n * methods throw the matching `Unsupported*Error`. `CONTAINS` / `ILIKE` /\n * `SW` (LIKE-style matching is adapter-specific, not core), `NULL` (no\n * null-check operator on the wire), and the PostgREST-native full-text\n * operators (`FTS`, `PHFTS`, `PLFTS`, `WFTS`) throw\n * `UnsupportedFilterOperatorError`.\n *\n * @see https://feathersjs.com/api/databases/querying\n */\nexport class FeathersRequestStrategy extends AbstractRequestStrategy {\n\n /**\n * Filters, operator filters, sorts, flat field selection (`select`) —\n * no per-model fields, no includes, no global search, no embedded\n * resources\n */\n public readonly capabilities: IStrategyCapabilities = {\n embedded: false,\n fields: false,\n filters: true,\n includes: false,\n operatorFilters: true,\n search: false,\n select: true,\n sort: true\n };\n\n /**\n * Feathers-native names of the four hardcoded query keys\n *\n * The dollar prefix marks adapter-commons system params apart from\n * filter fields; these keys are fixed by the server and intentionally\n * not configurable through `QueryBuilderOptions`.\n */\n private static readonly _limitKey = '$limit';\n private static readonly _selectKey = '$select';\n private static readonly _skipKey = '$skip';\n private static readonly _sortKey = '$sort';\n\n /**\n * Emit Feathers-format query-string segments in canonical order:\n * filters → operator filters → $sort → $select → $limit → $skip\n *\n * @param state - The current query builder state\n * @param _options - The query parameter key name configuration (unused;\n * Feathers' system keys are fixed by the server)\n * @returns Ordered query-string fragments\n */\n protected parts(state: IQueryBuilderState, _options: QueryBuilderOptions): string[] {\n const out: string[] = [];\n\n this._appendFilters(state, out);\n this._appendOperatorFilters(state, out);\n this._appendSort(state, out);\n this._appendSelect(state, out);\n this._appendPagination(state, out);\n\n return out;\n }\n\n /**\n * Append simple filter parameters\n *\n * A single value emits the bare exact-match form (`field=value`);\n * multiple values fold to the `$in` list\n * (`field[$in][0]=v1&field[$in][1]=v2`).\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendFilters(state: IQueryBuilderState, out: string[]): void {\n Object.keys(state.filters).forEach(field => {\n const values = state.filters[field];\n\n if (!values.length) {\n return;\n }\n\n out.push(values.length === 1\n ? `${field}=${values[0]}`\n : qs.stringify({ [field]: { $in: values } }, { encode: false }));\n });\n }\n\n /**\n * Append explicit operator filters in the `field[$op]=value` syntax\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendOperatorFilters(state: IQueryBuilderState, out: string[]): void {\n state.operatorFilters.forEach((filter: IOperatorFilter) => {\n const payload = this._formatOperatorPayload(filter);\n\n out.push(typeof payload === 'object'\n ? qs.stringify({ [filter.field]: payload }, { encode: false })\n : `${filter.field}=${payload}`);\n });\n }\n\n /**\n * Append the `$limit` / `$skip` pagination pair\n *\n * Feathers paginates by offset, so the 1-based page number from state\n * converts to `skip = (page - 1) × limit`.\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendPagination(state: IQueryBuilderState, out: string[]): void {\n out.push(`${FeathersRequestStrategy._limitKey}=${state.limit}`);\n out.push(`${FeathersRequestStrategy._skipKey}=${(state.page - 1) * state.limit}`);\n }\n\n /**\n * Append the `$select[0]=col1&$select[1]=col2` array from the flat\n * select state\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSelect(state: IQueryBuilderState, out: string[]): void {\n if (!state.select.length) {\n return;\n }\n\n out.push(qs.stringify({ [FeathersRequestStrategy._selectKey]: state.select }, { encode: false }));\n }\n\n /**\n * Append the `$sort[field]=1|-1` map\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSort(state: IQueryBuilderState, out: string[]): void {\n if (!state.sorts.length) {\n return;\n }\n\n const map: Record<string, number> = {};\n\n state.sorts.forEach(sort => {\n map[sort.field] = sort.order === SortEnum.DESC ? -1 : 1;\n });\n\n out.push(qs.stringify({ [FeathersRequestStrategy._sortKey]: map }, { encode: false }));\n }\n\n /**\n * Translate a `FilterOperatorEnum` operator filter into Feathers'\n * `$operator → value` payload shape (or a bare primitive for `EQ`)\n *\n * The mapping is library-canonical → Feathers-native:\n * - `EQ` → bare `field=value` (no operator wrapper)\n * - `GT`/`GTE`/`LT`/`LTE` → `$gt` / `$gte` / `$lt` / `$lte`\n * - `IN` → `$in` (array)\n * - `BTW` → `$gte` + `$lte` pair in one payload (arity-checked)\n * - `NOT` → `$ne` (single value) / `$nin` (multi-value)\n *\n * `CONTAINS`, `ILIKE`, and `SW` (LIKE-style matching is\n * adapter-specific in Feathers, not part of the common syntax),\n * `NULL` (no null-check operator), and PostgREST's full-text-search\n * operators (`FTS`, `PHFTS`, `PLFTS`, `WFTS`) throw\n * `UnsupportedFilterOperatorError`.\n *\n * @param filter - The operator filter to translate\n * @returns A `{ $operator: value }` payload ready to nest under\n * `field[...]`, or a bare primitive for `EQ`\n * @throws {InvalidFilterOperatorValueError} If `BTW` does not receive\n * exactly two values\n * @throws {UnsupportedFilterOperatorError} If the operator has no\n * Feathers equivalent\n */\n private _formatOperatorPayload(filter: IOperatorFilter): FeathersFilterPayload | FeathersFilterValue {\n const { operator, values } = filter;\n const first = values[0];\n\n switch (operator) {\n case FilterOperatorEnum.EQ: return first;\n case FilterOperatorEnum.GT: return { $gt: first };\n case FilterOperatorEnum.GTE: return { $gte: first };\n case FilterOperatorEnum.LT: return { $lt: first };\n case FilterOperatorEnum.LTE: return { $lte: first };\n case FilterOperatorEnum.IN: return { $in: values };\n\n case FilterOperatorEnum.BTW: {\n if (values.length !== 2) {\n throw new InvalidFilterOperatorValueError(\n operator,\n 'BTW requires exactly 2 values (min, max)'\n );\n }\n\n return { $gte: values[0], $lte: values[1] };\n }\n\n case FilterOperatorEnum.NOT:\n return values.length === 1\n ? { $ne: first }\n : { $nin: values };\n\n case FilterOperatorEnum.CONTAINS:\n case FilterOperatorEnum.ILIKE:\n case FilterOperatorEnum.SW:\n case FilterOperatorEnum.NULL:\n case FilterOperatorEnum.FTS:\n case FilterOperatorEnum.PHFTS:\n case FilterOperatorEnum.PLFTS:\n case FilterOperatorEnum.WFTS:\n throw new UnsupportedFilterOperatorError();\n }\n }\n}\n","import { IPaginatedObject } from '../interfaces/paginated-object.interface';\nimport { IResponseStrategy } from '../interfaces/response-strategy.interface';\nimport { PaginatedCollection } from '../models/paginated-collection';\nimport { ResponseOptions } from '../models/response-options';\n\n/**\n * Response strategy for the FeathersJS driver\n *\n * Parses the paginated envelope emitted by Feathers database adapters:\n *\n * ```json\n * {\n * \"total\": 48,\n * \"limit\": 10,\n * \"skip\": 10,\n * \"data\": [...]\n * }\n * ```\n *\n * The envelope is offset-based — no page number, no navigation URLs —\n * so position derives arithmetically:\n *\n * - `currentPage` is `skip / limit + 1` (integer division; a zero or\n * missing `limit` falls back to page **1**).\n * - `perPage` comes straight from `limit`; `lastPage` is\n * `ceil(total / limit)`.\n * - `from`/`to` are 1-indexed offsets derived from `skip` and the item\n * count of the current page (`from = skip + 1`,\n * `to = skip + data.length`); both stay `undefined` on an empty page.\n *\n * The `data` / `total` / `limit` key names are configurable through\n * `FeathersResponseOptions`; the `skip` key is fixed by the Feathers\n * envelope and lives as a private static.\n *\n * @see https://feathersjs.com/api/databases/common#pagination\n */\nexport class FeathersResponseStrategy implements IResponseStrategy {\n\n /**\n * Feathers-native name of the offset key\n *\n * Fixed by the adapter envelope; read for page derivation only.\n */\n private static readonly _skipKey = 'skip';\n\n /**\n * Parse a Feathers pagination response into a PaginatedCollection\n *\n * @param response - The raw API response body\n * @param options - The response key name configuration\n * @returns A typed PaginatedCollection instance\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public paginate<T extends IPaginatedObject>(response: Record<string, any>, options: ResponseOptions): PaginatedCollection<T> {\n const data = response[options.data] as T[];\n const total = response[options.total] as number | undefined;\n const perPage = response[options.perPage] as number | undefined;\n const skip = (response[FeathersResponseStrategy._skipKey] ?? 0) as number;\n\n const currentPage = perPage ? Math.floor(skip / perPage) + 1 : 1;\n const lastPage = (total !== undefined && perPage) ? Math.ceil(total / perPage) : undefined;\n\n const from = data?.length ? skip + 1 : undefined;\n const to = data?.length ? skip + data.length : undefined;\n\n return new PaginatedCollection(\n data,\n currentPage,\n from,\n to,\n total,\n perPage,\n undefined,\n undefined,\n lastPage,\n undefined,\n undefined\n );\n }\n}\n","export class UnselectableModelError extends Error {\n constructor(model: string) {\n super(`Unselectable Model: the selected model (${model}) is not present neither in the \"model\" property, nor in the includes object.`);\n }\n}","import * as qs from 'qs';\n\nimport { SortEnum } from '../enums/sort.enum';\nimport { UnselectableModelError } from '../errors/unselectable-model.error';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { IStrategyCapabilities } from '../interfaces/strategy-capabilities.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\nimport { AbstractRequestStrategy } from './abstract-request.strategy';\n\n/**\n * Request strategy for the JSON:API driver\n *\n * Generates URIs in the JSON:API format:\n * - Fields: `fields[articles]=title,body&fields[people]=name`\n * - Filters: `filter[status]=active`\n * - Includes: `include=author,comments.author`\n * - Pagination: `page[number]=1&page[size]=15`\n * - Sort: `sort=-created_at,name` (- prefix = DESC)\n *\n * @see https://jsonapi.org/format/\n */\nexport class JsonApiRequestStrategy extends AbstractRequestStrategy {\n\n /**\n * Filters, sorts, includes, per-model fields — same shape as Spatie\n * but with bracket-style pagination\n */\n public readonly capabilities: IStrategyCapabilities = {\n embedded: false,\n fields: true,\n filters: true,\n includes: true,\n operatorFilters: false,\n search: false,\n select: false,\n sort: true\n };\n\n /**\n * Emit JSON:API-format query-string segments in canonical order:\n * include → fields → filters → pagination → sort\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @returns Ordered query-string fragments\n */\n protected parts(state: IQueryBuilderState, options: QueryBuilderOptions): string[] {\n const out: string[] = [];\n\n this._appendIncludes(state, options, out);\n this._appendFields(state, options, out);\n this._appendFilters(state, options, out);\n this._appendPagination(state, options, out);\n this._appendSort(state, options, out);\n\n return out;\n }\n\n /**\n * Append per-type field selection in bracket notation\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n * @throws Error if the resource is missing from the fields object\n * @throws UnselectableModelError if a field type is not the resource or in includes\n */\n private _appendFields(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n if (!Object.keys(state.fields).length) {\n return;\n }\n\n if (!(state.resource in state.fields)) {\n throw new Error(`Key ${state.resource} is missing in the fields object`);\n }\n\n const grouped: Record<string, string> = {};\n\n for (const type in state.fields) {\n if (!state.fields.hasOwnProperty(type)) {\n continue;\n }\n\n if (type !== state.resource && !state.includes.includes(type)) {\n throw new UnselectableModelError(type);\n }\n\n grouped[`${options.fields}[${type}]`] = state.fields[type].join(',');\n }\n\n out.push(qs.stringify(grouped, { encode: false }));\n }\n\n /**\n * Append filter parameters in bracket notation: `filter[key]=value`\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendFilters(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n const keys = Object.keys(state.filters);\n\n if (!keys.length) {\n return;\n }\n\n const wrapper = {\n [options.filters]: keys.reduce((acc: Record<string, string>, key: string) => {\n return Object.assign(acc, { [key]: state.filters[key].join(',') });\n }, {})\n };\n\n out.push(qs.stringify(wrapper, { encode: false }));\n }\n\n /**\n * Append include parameter as `include=author,comments.author`\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendIncludes(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n if (!state.includes.length) {\n return;\n }\n\n out.push(`${options.includes}=${state.includes}`);\n }\n\n /**\n * Append JSON:API bracket pagination as `page[number]=1&page[size]=15`\n *\n * `qs.stringify` already returns the two segments joined with `&`, so we\n * push the whole string as one accumulator entry — `_join` will glue\n * it onto the rest with the same separator.\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendPagination(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n const pagination = qs.stringify(\n { [options.page]: { number: state.page, size: state.limit } },\n { encode: false }\n );\n\n out.push(pagination);\n }\n\n /**\n * Append sort parameter as `sort=-field1,field2` (`-` prefix = DESC)\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSort(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n if (!state.sorts.length) {\n return;\n }\n\n const pairs = state.sorts.map(sort =>\n `${sort.order === SortEnum.DESC ? '-' : ''}${sort.field}`\n );\n\n out.push(`${options.sort}=${pairs.join(',')}`);\n }\n}\n","import { AbstractDotPathResponseStrategy } from './abstract-dot-path-response.strategy';\n\n/**\n * Response strategy for the JSON:API driver\n *\n * Parses JSON:API pagination responses:\n * ```json\n * {\n * \"data\": [...],\n * \"meta\": {\n * \"current-page\": 1,\n * \"per-page\": 10,\n * \"total\": 100,\n * \"page-count\": 10,\n * \"from\": 1,\n * \"to\": 10\n * },\n * \"links\": {\n * \"first\": \"url\",\n * \"prev\": \"url\",\n * \"next\": \"url\",\n * \"last\": \"url\"\n * }\n * }\n * ```\n *\n * Default key paths are configured in `JsonApiResponseOptions`. The\n * traversal algorithm (dot-notation resolution + computed `from`/`to`) is\n * inherited from `AbstractDotPathResponseStrategy`; this class exists so\n * `DriverEnum.JSON_API` resolves to a distinct identity at the DI layer\n * even though the parsing logic is shared with NestJS.\n *\n * @see https://jsonapi.org/format/\n */\nexport class JsonApiResponseStrategy extends AbstractDotPathResponseStrategy {}\n","import { FilterOperatorEnum } from '../enums/filter-operator.enum';\nimport { SortEnum } from '../enums/sort.enum';\nimport { InvalidFilterOperatorValueError } from '../errors/invalid-filter-operator-value.error';\nimport { UnsupportedFilterOperatorError } from '../errors/unsupported-filter-operator.error';\nimport { IOperatorFilter } from '../interfaces/operator-filter.interface';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { IStrategyCapabilities } from '../interfaces/strategy-capabilities.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\nimport { AbstractRequestStrategy } from './abstract-request.strategy';\n\n/**\n * Request strategy for the json-server driver\n *\n * Generates URIs in [json-server's](https://github.com/typicode/json-server)\n * query format — the de-facto standard mock REST API for prototyping:\n * - Filters: `field=value` (exact, no operator); multi-value folds to the\n * `in` list (`field:in=v1,v2`)\n * - Operator filters: colon syntax `field:op=value` — see the mapping on\n * `_formatOperatorSegments`\n * - Sorts: `_sort=-views,title` (CSV, `-` prefix = DESC)\n * - Search: `q=term` (full-text search)\n * - Pagination: `_page=N&_per_page=M`\n *\n * The underscore-prefixed system params (`_page`, `_per_page`, `_sort`)\n * and the `q` search key are fixed by the server and intentionally not\n * configurable through `QueryBuilderOptions`; they live as private\n * statics so they are visible in one place.\n *\n * json-server has no per-model field selection, no relation includes,\n * no column projection — the corresponding fluent methods throw the\n * matching `Unsupported*Error`. `ILIKE` (no case-insensitive variant),\n * `NULL` (no null check), and the PostgREST-native full-text operators\n * (`FTS`, `PHFTS`, `PLFTS`, `WFTS`) throw\n * `UnsupportedFilterOperatorError`.\n *\n * @see https://github.com/typicode/json-server\n */\nexport class JsonServerRequestStrategy extends AbstractRequestStrategy {\n\n /**\n * Filters, operator filters, sorts, global search — no per-model\n * fields, no includes, no flat select, no embedded resources\n */\n public readonly capabilities: IStrategyCapabilities = {\n embedded: false,\n fields: false,\n filters: true,\n includes: false,\n operatorFilters: true,\n search: true,\n select: false,\n sort: true\n };\n\n /**\n * json-server-native names of the four hardcoded query keys\n *\n * The underscore prefix marks system params apart from filter fields;\n * these keys are fixed by the server and intentionally not\n * configurable through `QueryBuilderOptions`.\n */\n private static readonly _pageKey = '_page';\n private static readonly _perPageKey = '_per_page';\n private static readonly _qKey = 'q';\n private static readonly _sortKey = '_sort';\n\n /**\n * Emit json-server-format query-string segments in canonical order:\n * filters → operator filters → _sort → q → _page → _per_page\n *\n * @param state - The current query builder state\n * @param _options - The query parameter key name configuration (unused;\n * json-server's system keys are fixed by the server)\n * @returns Ordered query-string fragments\n */\n protected parts(state: IQueryBuilderState, _options: QueryBuilderOptions): string[] {\n const out: string[] = [];\n\n this._appendFilters(state, out);\n this._appendOperatorFilters(state, out);\n this._appendSort(state, out);\n this._appendSearch(state, out);\n this._appendPage(state, out);\n this._appendPerPage(state, out);\n\n return out;\n }\n\n /**\n * Append simple filter parameters\n *\n * A single value emits the bare exact-match form (`field=value`);\n * multiple values fold to the `in` list (`field:in=v1,v2`).\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendFilters(state: IQueryBuilderState, out: string[]): void {\n Object.keys(state.filters).forEach(field => {\n const values = state.filters[field];\n\n if (!values.length) {\n return;\n }\n\n out.push(values.length === 1\n ? `${field}=${values[0]}`\n : `${field}:in=${values.join(',')}`);\n });\n }\n\n /**\n * Append explicit operator filters in the colon syntax\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendOperatorFilters(state: IQueryBuilderState, out: string[]): void {\n state.operatorFilters.forEach((filter: IOperatorFilter) => {\n out.push(...this._formatOperatorSegments(filter));\n });\n }\n\n /**\n * Append the _page parameter\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendPage(state: IQueryBuilderState, out: string[]): void {\n out.push(`${JsonServerRequestStrategy._pageKey}=${state.page}`);\n }\n\n /**\n * Append the _per_page parameter\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendPerPage(state: IQueryBuilderState, out: string[]): void {\n out.push(`${JsonServerRequestStrategy._perPageKey}=${state.limit}`);\n }\n\n /**\n * Append the `q=` full-text search parameter\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSearch(state: IQueryBuilderState, out: string[]): void {\n if (!state.search) {\n return;\n }\n\n out.push(`${JsonServerRequestStrategy._qKey}=${state.search}`);\n }\n\n /**\n * Append the `_sort=-views,title` CSV parameter\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSort(state: IQueryBuilderState, out: string[]): void {\n if (!state.sorts.length) {\n return;\n }\n\n const fields = state.sorts.map(sort =>\n sort.order === SortEnum.DESC ? `-${sort.field}` : sort.field\n );\n\n out.push(`${JsonServerRequestStrategy._sortKey}=${fields.join(',')}`);\n }\n\n /**\n * Translate a `FilterOperatorEnum` operator filter into one or more\n * json-server `field:op=value` segments\n *\n * The mapping is library-canonical → json-server-native:\n * - `EQ` → `:eq`; `GT`/`GTE`/`LT`/`LTE` → `:gt` / `:gte` / `:lt` / `:lte`\n * - `CONTAINS` → `:contains`\n * - `SW` → `:startsWith`\n * - `IN` → `:in` (CSV)\n * - `BTW` → **two** AND-ed segments (`field:gte=min` and\n * `field:lte=max`, arity-checked)\n * - `NOT` → `:ne` — one segment per value, AND-ed\n *\n * `ILIKE` (json-server has no case-insensitive variant), `NULL` (no\n * null-check operator), and PostgREST's full-text-search operators\n * (`FTS`, `PHFTS`, `PLFTS`, `WFTS`) throw\n * `UnsupportedFilterOperatorError`.\n *\n * @param filter - The operator filter to translate\n * @returns One or more `field:op=value` query-string segments\n * @throws {InvalidFilterOperatorValueError} If `BTW` does not receive\n * exactly two values\n * @throws {UnsupportedFilterOperatorError} If the operator has no\n * json-server equivalent\n */\n private _formatOperatorSegments(filter: IOperatorFilter): string[] {\n const { field, operator, values } = filter;\n const first = values[0];\n\n switch (operator) {\n case FilterOperatorEnum.EQ: return [`${field}:eq=${first}`];\n case FilterOperatorEnum.GT: return [`${field}:gt=${first}`];\n case FilterOperatorEnum.GTE: return [`${field}:gte=${first}`];\n case FilterOperatorEnum.LT: return [`${field}:lt=${first}`];\n case FilterOperatorEnum.LTE: return [`${field}:lte=${first}`];\n case FilterOperatorEnum.CONTAINS: return [`${field}:contains=${first}`];\n case FilterOperatorEnum.SW: return [`${field}:startsWith=${first}`];\n case FilterOperatorEnum.IN: return [`${field}:in=${values.join(',')}`];\n\n case FilterOperatorEnum.BTW: {\n if (values.length !== 2) {\n throw new InvalidFilterOperatorValueError(\n operator,\n 'BTW requires exactly 2 values (min, max)'\n );\n }\n\n return [`${field}:gte=${values[0]}`, `${field}:lte=${values[1]}`];\n }\n\n case FilterOperatorEnum.NOT:\n return values.map(value => `${field}:ne=${value}`);\n\n case FilterOperatorEnum.ILIKE:\n case FilterOperatorEnum.NULL:\n case FilterOperatorEnum.FTS:\n case FilterOperatorEnum.PHFTS:\n case FilterOperatorEnum.PLFTS:\n case FilterOperatorEnum.WFTS:\n throw new UnsupportedFilterOperatorError();\n }\n }\n}\n","import { IPaginatedObject } from '../interfaces/paginated-object.interface';\nimport { IResponseStrategy } from '../interfaces/response-strategy.interface';\nimport { PaginatedCollection } from '../models/paginated-collection';\nimport { ResponseOptions } from '../models/response-options';\n\n/**\n * Response strategy for the json-server driver\n *\n * Parses json-server v1 paginated responses:\n *\n * ```json\n * {\n * \"first\": 1,\n * \"prev\": null,\n * \"next\": 2,\n * \"last\": 5,\n * \"pages\": 5,\n * \"items\": 48,\n * \"data\": [...]\n * }\n * ```\n *\n * Uniquely among the drivers, `first` / `prev` / `next` / `last` are\n * **page numbers**, not URLs — so the navigation-URL slots on\n * `PaginatedCollection` stay `undefined` and the strategy instead uses\n * the numbers to derive position:\n *\n * - `currentPage` is `prev + 1` (`prev === null` → page **1**).\n * - `perPage` is the item count of the current page whenever `next` is\n * set (a page with a successor is necessarily full); on the last page\n * of a multi-page set it is not introspectable and stays `undefined`.\n * - `lastPage` comes straight from `pages`; `from`/`to` derive from\n * `currentPage` × `perPage` on full pages, or count back from the\n * total on the last page (`from = total - items + 1`, `to = total`).\n *\n * The `data` / `items` / `pages` key paths are configurable through\n * `JsonServerResponseOptions`; the `prev` / `next` keys are fixed by the\n * json-server envelope and live as private statics.\n *\n * @see https://github.com/typicode/json-server\n */\nexport class JsonServerResponseStrategy implements IResponseStrategy {\n\n /**\n * json-server-native names of the page-number navigation keys\n *\n * Fixed by the v1 envelope; read for derivation only and never\n * surfaced as URLs.\n */\n private static readonly _nextKey = 'next';\n private static readonly _prevKey = 'prev';\n\n /**\n * Parse a json-server pagination response into a PaginatedCollection\n *\n * @param response - The raw API response body\n * @param options - The response key name configuration\n * @returns A typed PaginatedCollection instance\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public paginate<T extends IPaginatedObject>(response: Record<string, any>, options: ResponseOptions): PaginatedCollection<T> {\n const data = response[options.data] as T[];\n const total = response[options.total] as number | undefined;\n const lastPage = response[options.lastPage] as number | undefined;\n const prev = (response[JsonServerResponseStrategy._prevKey] ?? null) as number | null;\n const next = (response[JsonServerResponseStrategy._nextKey] ?? null) as number | null;\n\n const currentPage = prev === null ? 1 : prev + 1;\n const perPage = this._derivePerPage(next, data);\n\n const from = this._deriveFrom(data, currentPage, next, perPage, total);\n const to = this._deriveTo(data, currentPage, next, perPage, total);\n\n return new PaginatedCollection(\n data,\n currentPage,\n from,\n to,\n total,\n perPage,\n undefined,\n undefined,\n lastPage,\n undefined,\n undefined\n );\n }\n\n /**\n * Derive `from` as the 1-indexed offset of the first item on this page\n *\n * Computed from `currentPage` × `perPage` on full pages; on the last\n * page (no `next`) it counts back from the total\n * (`total - items + 1`), which also covers single-page responses.\n *\n * @param data - The items on the current page\n * @param currentPage - The current page number\n * @param next - The next page number, or null\n * @param perPage - The page size (may be undefined)\n * @param total - The total item count (may be undefined)\n * @returns The 1-indexed `from` index, or undefined when inputs insufficient\n */\n private _deriveFrom(data: unknown[] | undefined, currentPage: number, next: number | null, perPage?: number, total?: number): number | undefined {\n if (perPage) {\n return (currentPage - 1) * perPage + 1;\n }\n\n if (next === null && total !== undefined && data?.length) {\n return total - data.length + 1;\n }\n\n return undefined;\n }\n\n /**\n * Derive `perPage` from the current page's item count\n *\n * A page with a `next` successor is necessarily full, so its item\n * count equals the page size. Without a successor the page may be\n * partial and the size is not introspectable from the body alone.\n *\n * @param next - The next page number, or null\n * @param data - The items on the current page\n * @returns The page size, or undefined\n */\n private _derivePerPage(next: number | null, data: unknown[] | undefined): number | undefined {\n if (next === null) {\n return undefined;\n }\n\n return data?.length || undefined;\n }\n\n /**\n * Derive `to` as the 1-indexed offset of the last item on this page\n *\n * Clamped to `total` so the last page does not report past the end;\n * on the last page (no `next`) it is simply the total.\n *\n * @param data - The items on the current page\n * @param currentPage - The current page number\n * @param next - The next page number, or null\n * @param perPage - The page size (may be undefined)\n * @param total - The total item count (may be undefined)\n * @returns The 1-indexed `to` index, or undefined when inputs insufficient\n */\n private _deriveTo(data: unknown[] | undefined, currentPage: number, next: number | null, perPage?: number, total?: number): number | undefined {\n if (perPage !== undefined && total !== undefined) {\n return Math.min(currentPage * perPage, total);\n }\n\n if (next === null && total !== undefined && data?.length) {\n return total;\n }\n\n return undefined;\n }\n}\n","import { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { IStrategyCapabilities } from '../interfaces/strategy-capabilities.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\nimport { AbstractRequestStrategy } from './abstract-request.strategy';\n\n/**\n * Request strategy for the Laravel (pagination-only) driver\n *\n * Generates simple pagination URIs:\n * - `/{resource}?limit=N&page=N`\n *\n * Filters, sorts, fields, includes, search, and select in state are ignored.\n */\nexport class LaravelRequestStrategy extends AbstractRequestStrategy {\n\n /**\n * Pagination-only driver — no filtering, sorting, or column selection\n */\n public readonly capabilities: IStrategyCapabilities = {\n embedded: false,\n fields: false,\n filters: false,\n includes: false,\n operatorFilters: false,\n search: false,\n select: false,\n sort: false\n };\n\n /**\n * Emit only the pagination params; filters/sorts/etc. are ignored\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @returns The two pagination query-string fragments\n */\n protected parts(state: IQueryBuilderState, options: QueryBuilderOptions): string[] {\n return [\n `${options.limit}=${state.limit}`,\n `${options.page}=${state.page}`\n ];\n }\n}\n","import { IPaginatedObject } from '../interfaces/paginated-object.interface';\nimport { IResponseStrategy } from '../interfaces/response-strategy.interface';\nimport { PaginatedCollection } from '../models/paginated-collection';\nimport { ResponseOptions } from '../models/response-options';\n\n/**\n * Base class for response strategies whose pagination metadata is a flat\n * key-value envelope on the response body\n *\n * Laravel's stock pagination and Spatie's `QueryBuilder` both emit the\n * same flat shape — `{ data, current_page, total, per_page, from, to,\n * next_page_url, prev_page_url, first_page_url, last_page, last_page_url\n * }` — and both response strategies were duplicating the byte-identical\n * `new PaginatedCollection(response[options.X], ...)` body before this\n * base existed. Concrete classes now extend and provide only the\n * docstring describing their driver's specific shape (see\n * `LaravelResponseStrategy`, `SpatieResponseStrategy`).\n *\n * Drivers whose pagination metadata is a nested envelope (JSON:API,\n * NestJS, Strapi) extend `AbstractDotPathResponseStrategy` instead.\n * Drivers whose metadata comes from HTTP headers (PostgREST) or is\n * derived from response URLs (DRF) implement `IResponseStrategy`\n * directly.\n */\nexport abstract class AbstractFlatResponseStrategy implements IResponseStrategy {\n\n /**\n * Parse a flat-envelope pagination response into a PaginatedCollection\n *\n * @param response - The raw API response object\n * @param options - The response key name configuration\n * @returns A typed PaginatedCollection instance\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public paginate<T extends IPaginatedObject>(response: Record<string, any>, options: ResponseOptions): PaginatedCollection<T> {\n return new PaginatedCollection(\n response[options.data],\n response[options.currentPage],\n response[options.from],\n response[options.to],\n response[options.total],\n response[options.perPage],\n response[options.prevPageUrl],\n response[options.nextPageUrl],\n response[options.lastPage],\n response[options.firstPageUrl],\n response[options.lastPageUrl]\n );\n }\n}\n","import { AbstractFlatResponseStrategy } from './abstract-flat-response.strategy';\n\n/**\n * Response strategy for the Laravel (pagination-only) driver\n *\n * Parses flat Laravel pagination responses:\n * ```json\n * {\n * \"data\": [...],\n * \"current_page\": 1,\n * \"total\": 100,\n * \"per_page\": 15,\n * \"from\": 1,\n * \"to\": 15,\n * \"next_page_url\": \"...\",\n * \"prev_page_url\": \"...\",\n * \"first_page_url\": \"...\",\n * \"last_page\": 7,\n * \"last_page_url\": \"...\"\n * }\n * ```\n *\n * The traversal algorithm (flat `response[options.X]` lookups) is\n * inherited from `AbstractFlatResponseStrategy`; this class exists so\n * `DriverEnum.LARAVEL` resolves to a distinct identity at the DI layer\n * even though the parsing logic is shared with Spatie.\n */\nexport class LaravelResponseStrategy extends AbstractFlatResponseStrategy {}\n","import { SortEnum } from '../enums/sort.enum';\nimport { InvalidLimitError } from '../errors/invalid-limit.error';\nimport { IOperatorFilter } from '../interfaces/operator-filter.interface';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { IStrategyCapabilities } from '../interfaces/strategy-capabilities.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\nimport { AbstractRequestStrategy } from './abstract-request.strategy';\n\n/**\n * Request strategy for the NestJS (nestjs-paginate) driver\n *\n * Generates URIs in the NestJS paginate format:\n * - Simple filters: `filter.field=value`\n * - Operator filters: `filter.field=$operator:value`\n * - Sorts: `sortBy=field1:DESC,field2:ASC`\n * - Select: `select=col1,col2`\n * - Search: `search=term`\n * - Pagination: `limit=N&page=N`\n *\n * @see https://github.com/ppetzold/nestjs-paginate\n */\nexport class NestjsRequestStrategy extends AbstractRequestStrategy {\n\n /**\n * Filters, operator filters, sorts, flat select, global search — no\n * per-model fields, no includes\n */\n public readonly capabilities: IStrategyCapabilities = {\n embedded: false,\n fields: false,\n filters: true,\n includes: false,\n operatorFilters: true,\n search: true,\n select: true,\n sort: true\n };\n\n /**\n * Validate that the given limit is accepted by nestjs-paginate\n *\n * Accepts any integer `>= 1` as a page size, plus `-1` which nestjs-paginate\n * interprets as \"fetch all items\" (server must opt-in via `maxLimit: -1`).\n *\n * @param limit - The limit value to validate\n * @throws {InvalidLimitError} If the value is not an integer, or is 0, or is a negative number other than -1\n */\n public override validateLimit(limit: number): void {\n if (Number.isInteger(limit) && (limit === -1 || limit >= 1)) {\n return;\n }\n\n throw new InvalidLimitError(limit, true);\n }\n\n /**\n * Emit NestJS-format query-string segments in canonical order:\n * filters → operator filters → sortBy → select → search → limit → page\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @returns Ordered query-string fragments\n */\n protected parts(state: IQueryBuilderState, options: QueryBuilderOptions): string[] {\n const out: string[] = [];\n\n this._appendFilters(state, options, out);\n this._appendOperatorFilters(state, options, out);\n this._appendSort(state, options, out);\n this._appendSelect(state, options, out);\n this._appendSearch(state, options, out);\n this._appendLimit(state, options, out);\n this._appendPage(state, options, out);\n\n return out;\n }\n\n /**\n * Append simple filter parameters as `filter.field=value1,value2`\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendFilters(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n const keys = Object.keys(state.filters);\n\n if (!keys.length) {\n return;\n }\n\n keys.forEach(key => {\n const values = state.filters[key].join(',');\n out.push(`${options.filters}.${key}=${values}`);\n });\n }\n\n /**\n * Append the limit parameter\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendLimit(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n out.push(`${options.limit}=${state.limit}`);\n }\n\n /**\n * Append operator-filter parameters as `filter.field=$op:value`\n *\n * Groups by field; multi-value operators ($in, $btw) join values with commas.\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendOperatorFilters(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n if (!state.operatorFilters.length) {\n return;\n }\n\n state.operatorFilters.forEach((opFilter: IOperatorFilter) => {\n const values = opFilter.values.join(',');\n out.push(`${options.filters}.${opFilter.field}=${opFilter.operator}:${values}`);\n });\n }\n\n /**\n * Append the page parameter\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendPage(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n out.push(`${options.page}=${state.page}`);\n }\n\n /**\n * Append the search parameter as `search=term`\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSearch(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n if (!state.search) {\n return;\n }\n\n out.push(`${options.search}=${state.search}`);\n }\n\n /**\n * Append the select parameter as `select=col1,col2`\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSelect(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n if (!state.select.length) {\n return;\n }\n\n out.push(`${options.select}=${state.select.join(',')}`);\n }\n\n /**\n * Append sort parameter as `sortBy=field1:DESC,field2:ASC`\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSort(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n if (!state.sorts.length) {\n return;\n }\n\n const pairs = state.sorts.map(sort =>\n `${sort.field}:${sort.order === SortEnum.DESC ? 'DESC' : 'ASC'}`\n );\n\n out.push(`${options.sortBy}=${pairs.join(',')}`);\n }\n}\n","import { AbstractDotPathResponseStrategy } from './abstract-dot-path-response.strategy';\n\n/**\n * Response strategy for the NestJS (nestjs-paginate) driver\n *\n * Parses nested NestJS pagination responses:\n * ```json\n * {\n * \"data\": [...],\n * \"meta\": {\n * \"currentPage\": 1,\n * \"totalItems\": 100,\n * \"itemsPerPage\": 10,\n * \"totalPages\": 10\n * },\n * \"links\": {\n * \"first\": \"url\",\n * \"previous\": \"url\",\n * \"next\": \"url\",\n * \"last\": \"url\",\n * \"current\": \"url\"\n * }\n * }\n * ```\n *\n * Default key paths are configured in `NestjsResponseOptions`. The\n * traversal algorithm (dot-notation resolution + computed `from`/`to`) is\n * inherited from `AbstractDotPathResponseStrategy`; this class exists so\n * `DriverEnum.NESTJS` resolves to a distinct identity at the DI layer\n * even though the parsing logic is shared with JSON:API.\n *\n * @see https://github.com/ppetzold/nestjs-paginate\n */\nexport class NestjsResponseStrategy extends AbstractDotPathResponseStrategy {}\n","import { FilterOperatorEnum } from '../enums/filter-operator.enum';\nimport { SortEnum } from '../enums/sort.enum';\nimport { InvalidFilterOperatorValueError } from '../errors/invalid-filter-operator-value.error';\nimport { UnsupportedFilterOperatorError } from '../errors/unsupported-filter-operator.error';\nimport { IOperatorFilter } from '../interfaces/operator-filter.interface';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { IStrategyCapabilities } from '../interfaces/strategy-capabilities.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\nimport { AbstractRequestStrategy } from './abstract-request.strategy';\n\n/**\n * Request strategy for the @nestjsx/crud driver\n *\n * Generates URIs in [@nestjsx/crud's pipe-delimited query format](https://github.com/nestjsx/crud/wiki/Requests):\n * - Filters: `filter=field||$eq||value` (repeatable; multi-value\n * collapses to `filter=field||$in||v1,v2`)\n * - Operator filters: `filter=field||$op||value` (translated from\n * `FilterOperatorEnum` — `CONTAINS`→`$cont`, `ILIKE`→`$contL`,\n * `SW`→`$starts`, `BTW`→`$between`, `NOT`→`$ne`/`$notin`,\n * `NULL`→`$isnull`/`$notnull` with no value segment)\n * - Joins: `join=relation` (repeatable, from `addIncludes`)\n * - Field selection (flat): `fields=col1,col2` (from `addSelect`)\n * - Sorts: `sort=field,ASC` (repeatable, uppercase direction)\n * - Pagination (page-based): `page=N&limit=N`\n *\n * The JSON-shaped `s={...}` search parameter is intentionally out of\n * scope: it is not a plain search term, so `setSearch` throws\n * `UnsupportedSearchError` on this driver. PostgREST-native full-text\n * search operators (`FTS`, `PHFTS`, `PLFTS`, `WFTS`) throw\n * `UnsupportedFilterOperatorError`.\n *\n * @see https://github.com/nestjsx/crud/wiki/Requests\n */\nexport class NestjsxCrudRequestStrategy extends AbstractRequestStrategy {\n\n /**\n * Filters, operator filters, joins (`includes`), flat field selection\n * (`select`), sorts — no per-model fields, no global search (the `s`\n * parameter is JSON-shaped, not a plain term)\n */\n public readonly capabilities: IStrategyCapabilities = {\n embedded: false,\n fields: false,\n filters: true,\n includes: true,\n operatorFilters: true,\n search: false,\n select: true,\n sort: true\n };\n\n /**\n * @nestjsx/crud-native names of the four hardcoded query keys\n *\n * The wire format is fixed (the server's `CrudRequestInterceptor`\n * reads `fields`, `filter`, `join`, and `sort`); these keys are\n * intentionally not configurable through `QueryBuilderOptions` and\n * live as private statics so they are visible in one place.\n */\n private static readonly _fieldsKey = 'fields';\n private static readonly _filterKey = 'filter';\n private static readonly _joinKey = 'join';\n private static readonly _sortKey = 'sort';\n\n /**\n * Pipe delimiter separating field, operator, and value segments\n */\n private static readonly _separator = '||';\n\n /**\n * Emit @nestjsx/crud-format query-string segments in canonical order:\n * fields → filters → operator filters → join → sort → limit → page\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration (used\n * for `page` / `limit`, whose defaults match the wire format; the\n * `fields` / `filter` / `join` / `sort` keys are fixed by the server)\n * @returns Ordered query-string fragments\n */\n protected parts(state: IQueryBuilderState, options: QueryBuilderOptions): string[] {\n const out: string[] = [];\n\n this._appendFields(state, out);\n this._appendFilters(state, out);\n this._appendOperatorFilters(state, out);\n this._appendJoin(state, out);\n this._appendSort(state, out);\n this._appendLimit(state, options, out);\n this._appendPage(state, options, out);\n\n return out;\n }\n\n /**\n * Append `fields=col1,col2` from the flat select array\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendFields(state: IQueryBuilderState, out: string[]): void {\n if (!state.select.length) {\n return;\n }\n\n out.push(`${NestjsxCrudRequestStrategy._fieldsKey}=${state.select.join(',')}`);\n }\n\n /**\n * Append simple filters as repeatable `filter=field||$eq||value` params\n *\n * Single-value filters fold to `$eq`; multi-value filters fold to\n * `$in` with comma-joined values.\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendFilters(state: IQueryBuilderState, out: string[]): void {\n const sep = NestjsxCrudRequestStrategy._separator;\n\n Object.keys(state.filters).forEach(field => {\n const values = state.filters[field];\n\n if (!values.length) {\n return;\n }\n\n const condition = values.length === 1\n ? `$eq${sep}${values[0]}`\n : `$in${sep}${values.join(',')}`;\n\n out.push(`${NestjsxCrudRequestStrategy._filterKey}=${field}${sep}${condition}`);\n });\n }\n\n /**\n * Append `join=relation` params from the includes array\n *\n * Per-relation field projection (`join=relation||f1,f2`) is not\n * expressible through the current state shape and is out of scope.\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendJoin(state: IQueryBuilderState, out: string[]): void {\n state.includes.forEach(relation => {\n out.push(`${NestjsxCrudRequestStrategy._joinKey}=${relation}`);\n });\n }\n\n /**\n * Append the limit parameter\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendLimit(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n out.push(`${options.limit}=${state.limit}`);\n }\n\n /**\n * Append operator filters as repeatable `filter=field||$op||value` params\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendOperatorFilters(state: IQueryBuilderState, out: string[]): void {\n const sep = NestjsxCrudRequestStrategy._separator;\n\n state.operatorFilters.forEach((filter: IOperatorFilter) => {\n const condition = this._formatOperatorCondition(filter);\n\n out.push(`${NestjsxCrudRequestStrategy._filterKey}=${filter.field}${sep}${condition}`);\n });\n }\n\n /**\n * Append the page parameter\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendPage(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n out.push(`${options.page}=${state.page}`);\n }\n\n /**\n * Append `sort=field,ASC` params, one per sort rule\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSort(state: IQueryBuilderState, out: string[]): void {\n state.sorts.forEach(sort => {\n const direction = sort.order === SortEnum.DESC ? 'DESC' : 'ASC';\n\n out.push(`${NestjsxCrudRequestStrategy._sortKey}=${sort.field},${direction}`);\n });\n }\n\n /**\n * Translate a `FilterOperatorEnum` operator filter into @nestjsx/crud's\n * `$operator||value` condition segment\n *\n * The mapping is library-canonical → @nestjsx/crud-native:\n * - `EQ`/`GT`/`GTE`/`LT`/`LTE`/`IN` → identity (same operator name)\n * - `CONTAINS` → `$cont`; `ILIKE` → `$contL` (case-insensitive contains)\n * - `SW` → `$starts`\n * - `BTW` → `$between` with `min,max` (arity-checked)\n * - `NOT` → `$ne` (single value) / `$notin` (multi-value)\n * - `NULL` → `$isnull` (when value is `true`) / `$notnull` (when value\n * is `false`); both emit **no value segment**; arity- and type-checked\n *\n * PostgREST's full-text-search operators (`FTS`, `PHFTS`, `PLFTS`,\n * `WFTS`) have no @nestjsx/crud equivalent and throw\n * `UnsupportedFilterOperatorError`.\n *\n * @param filter - The operator filter to translate\n * @returns The `$operator||value` (or bare `$operator`) condition segment\n * @throws {InvalidFilterOperatorValueError} If `BTW` does not receive\n * exactly two values, or `NULL` does not receive exactly one boolean\n * @throws {UnsupportedFilterOperatorError} If the operator is a\n * PostgREST-only FTS variant\n */\n private _formatOperatorCondition(filter: IOperatorFilter): string {\n const sep = NestjsxCrudRequestStrategy._separator;\n const { operator, values } = filter;\n const first = values[0];\n\n switch (operator) {\n case FilterOperatorEnum.EQ: return `$eq${sep}${first}`;\n case FilterOperatorEnum.GT: return `$gt${sep}${first}`;\n case FilterOperatorEnum.GTE: return `$gte${sep}${first}`;\n case FilterOperatorEnum.LT: return `$lt${sep}${first}`;\n case FilterOperatorEnum.LTE: return `$lte${sep}${first}`;\n case FilterOperatorEnum.CONTAINS: return `$cont${sep}${first}`;\n case FilterOperatorEnum.ILIKE: return `$contL${sep}${first}`;\n case FilterOperatorEnum.IN: return `$in${sep}${values.join(',')}`;\n case FilterOperatorEnum.SW: return `$starts${sep}${first}`;\n\n case FilterOperatorEnum.BTW: {\n if (values.length !== 2) {\n throw new InvalidFilterOperatorValueError(\n operator,\n 'BTW requires exactly 2 values (min, max)'\n );\n }\n\n return `$between${sep}${values.join(',')}`;\n }\n\n case FilterOperatorEnum.NOT:\n return values.length === 1\n ? `$ne${sep}${first}`\n : `$notin${sep}${values.join(',')}`;\n\n case FilterOperatorEnum.NULL: {\n if (values.length !== 1 || typeof first !== 'boolean') {\n throw new InvalidFilterOperatorValueError(\n operator,\n 'NULL requires exactly 1 boolean value (true → IS NULL, false → IS NOT NULL)'\n );\n }\n\n return first ? '$isnull' : '$notnull';\n }\n\n case FilterOperatorEnum.FTS:\n case FilterOperatorEnum.PHFTS:\n case FilterOperatorEnum.PLFTS:\n case FilterOperatorEnum.WFTS:\n throw new UnsupportedFilterOperatorError();\n }\n }\n}\n","import { AbstractDotPathResponseStrategy } from './abstract-dot-path-response.strategy';\n\n/**\n * Response strategy for the @nestjsx/crud driver\n *\n * Parses @nestjsx/crud's `getMany` envelope:\n * ```json\n * {\n * \"data\": [{ \"id\": 1, \"name\": \"John\" }],\n * \"count\": 10,\n * \"total\": 48,\n * \"page\": 2,\n * \"pageCount\": 5\n * }\n * ```\n *\n * Default key paths are configured in `NestjsxCrudResponseOptions`. The\n * envelope carries no `from`/`to` indices and no navigation links, so\n * `from`/`to` are computed from `page` × `count` by the inherited\n * traversal algorithm and the URL slots resolve to `undefined` unless\n * the consumer overrides their paths via `IPaginationConfig`.\n *\n * Note that `count` is the number of entities **on the current page**,\n * not the requested page size — on the last page of a result set the\n * derived `from`/`to` can underestimate. Consumers needing exact\n * indices should compute them from the requested limit instead.\n *\n * The dot-notation traversal is inherited from\n * `AbstractDotPathResponseStrategy`; this class exists so\n * `DriverEnum.NESTJSX_CRUD` resolves to a distinct identity at the DI\n * layer even though the parsing logic is shared with JSON:API, NestJS,\n * and Strapi.\n *\n * @see https://github.com/nestjsx/crud/wiki/Requests\n */\nexport class NestjsxCrudResponseStrategy extends AbstractDotPathResponseStrategy {}\n","import { FilterOperatorEnum } from '../enums/filter-operator.enum';\nimport { SortEnum } from '../enums/sort.enum';\nimport { InvalidFilterOperatorValueError } from '../errors/invalid-filter-operator-value.error';\nimport { UnsupportedFilterOperatorError } from '../errors/unsupported-filter-operator.error';\nimport { IOperatorFilter } from '../interfaces/operator-filter.interface';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { IStrategyCapabilities } from '../interfaces/strategy-capabilities.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\nimport { AbstractRequestStrategy } from './abstract-request.strategy';\n\n/**\n * Request strategy for the OData v4 driver\n *\n * Generates URIs using [OData's system query options](https://www.odata.org/getting-started/basic-tutorial/#queryData):\n * - Filters: a single `$filter=` parameter holding ` and `-joined terms in\n * OData's expression language (`Price gt 20 and Category eq 'Electronics'`)\n * - Operator filters: translated from `FilterOperatorEnum` — see the\n * mapping on `_formatOperatorTerms`\n * - Sorts: `$orderby=field asc,other desc` (CSV with explicit direction)\n * - Select: `$select=col1,col2`\n * - Expand: `$expand=rel,other($select=col1,col2)` — plain relations come\n * from `addIncludes`, column-projected ones from `addEmbedded`\n * - Search: `$search=term` (OData v4 free-text search)\n * - Pagination: `$top=N&$skip=M` (skip derived from state.page) plus a\n * constant `$count=true` so responses carry the `@odata.count` total\n * the response strategy needs\n *\n * The `$`-prefixed parameter names are fixed by the OData specification\n * and intentionally not configurable through `QueryBuilderOptions`; they\n * live as private statics so they are visible in one place. String\n * literals are single-quoted with embedded quotes doubled (`'O''Brien'`)\n * per the OData ABNF; numbers and booleans are emitted bare.\n *\n * PostgREST-native full-text search operators (`FTS`, `PHFTS`, `PLFTS`,\n * `WFTS`) throw `UnsupportedFilterOperatorError` — use `$search` or the\n * `CONTAINS` / `ILIKE` operator filters instead.\n *\n * @see https://www.odata.org/\n * @see https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html\n */\nexport class OdataRequestStrategy extends AbstractRequestStrategy {\n\n /**\n * Filters, operator filters, sorts, flat select, includes and embedded\n * (both folding into `$expand`), global search — no per-model fields\n * (OData has no JSON:API-style `fields[type]` projection)\n */\n public readonly capabilities: IStrategyCapabilities = {\n embedded: true,\n fields: false,\n filters: true,\n includes: true,\n operatorFilters: true,\n search: true,\n select: true,\n sort: true\n };\n\n /**\n * OData-native names of the system query options\n *\n * The `$` prefix is mandated by the OData URL conventions; these keys\n * are intentionally not configurable through `QueryBuilderOptions` and\n * live as private statics so they are visible in one place.\n */\n private static readonly _countKey = '$count';\n private static readonly _expandKey = '$expand';\n private static readonly _filterKey = '$filter';\n private static readonly _orderbyKey = '$orderby';\n private static readonly _searchKey = '$search';\n private static readonly _selectKey = '$select';\n private static readonly _skipKey = '$skip';\n private static readonly _topKey = '$top';\n\n /**\n * Emit OData-format query-string segments in canonical order:\n * $filter → $orderby → $select → $expand → $search → $count → $top → $skip\n *\n * @param state - The current query builder state\n * @param _options - The query parameter key name configuration (unused —\n * every OData system query option name is fixed by the specification)\n * @returns Ordered query-string fragments\n */\n protected parts(state: IQueryBuilderState, _options: QueryBuilderOptions): string[] {\n const out: string[] = [];\n\n this._appendFilter(state, out);\n this._appendOrderby(state, out);\n this._appendSelect(state, out);\n this._appendExpand(state, out);\n this._appendSearch(state, out);\n this._appendCount(out);\n this._appendTop(state, out);\n this._appendSkip(state, out);\n\n return out;\n }\n\n /**\n * Append the constant `$count=true` parameter\n *\n * Always emitted: the OData response strategy reads the total from\n * `@odata.count`, which servers only include when the request asks\n * for it.\n *\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendCount(out: string[]): void {\n out.push(`${OdataRequestStrategy._countKey}=true`);\n }\n\n /**\n * Append the `$expand=` parameter combining includes and embedded\n * relations\n *\n * Plain relations from `addIncludes` emit bare (`rel`); embedded\n * relations from `addEmbedded` emit with an inline projection\n * (`rel($select=col1,col2)`) or bare when no columns were given. A\n * relation present in both folds into the embedded fragment, which\n * carries the column information.\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendExpand(state: IQueryBuilderState, out: string[]): void {\n const fragments: string[] = [];\n\n state.includes.forEach(relation => {\n if (relation in state.embedded) {\n return;\n }\n\n fragments.push(relation);\n });\n\n Object.keys(state.embedded).forEach(relation => {\n const columns = state.embedded[relation];\n\n fragments.push(columns.length ? `${relation}(${OdataRequestStrategy._selectKey}=${columns.join(',')})` : relation);\n });\n\n if (!fragments.length) {\n return;\n }\n\n out.push(`${OdataRequestStrategy._expandKey}=${fragments.join(',')}`);\n }\n\n /**\n * Append the single `$filter=` parameter combining simple and operator\n * filters\n *\n * Each term is one OData boolean expression; terms join with ` and `.\n * Simple single-value filters fold to `eq`; simple multi-value filters\n * fold to the `in` list operator (`field in ('v1','v2')`).\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendFilter(state: IQueryBuilderState, out: string[]): void {\n const terms: string[] = [];\n\n Object.keys(state.filters).forEach(field => {\n const values = state.filters[field];\n\n if (!values.length) {\n return;\n }\n\n terms.push(values.length === 1\n ? `${field} eq ${this._formatLiteral(values[0])}`\n : `${field} in (${values.map(value => this._formatLiteral(value)).join(',')})`);\n });\n\n state.operatorFilters.forEach((filter: IOperatorFilter) => {\n terms.push(...this._formatOperatorTerms(filter));\n });\n\n if (!terms.length) {\n return;\n }\n\n out.push(`${OdataRequestStrategy._filterKey}=${terms.join(' and ')}`);\n }\n\n /**\n * Append the `$orderby=field asc,other desc` CSV parameter\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendOrderby(state: IQueryBuilderState, out: string[]): void {\n if (!state.sorts.length) {\n return;\n }\n\n const pairs = state.sorts.map(sort =>\n `${sort.field} ${sort.order === SortEnum.DESC ? 'desc' : 'asc'}`\n );\n\n out.push(`${OdataRequestStrategy._orderbyKey}=${pairs.join(',')}`);\n }\n\n /**\n * Append the `$search=` free-text search parameter\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSearch(state: IQueryBuilderState, out: string[]): void {\n if (!state.search) {\n return;\n }\n\n out.push(`${OdataRequestStrategy._searchKey}=${state.search}`);\n }\n\n /**\n * Append the `$select=col1,col2` projection parameter\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSelect(state: IQueryBuilderState, out: string[]): void {\n if (!state.select.length) {\n return;\n }\n\n out.push(`${OdataRequestStrategy._selectKey}=${state.select.join(',')}`);\n }\n\n /**\n * Append the `$skip=` parameter, derived from state.page\n *\n * OData uses offset-based pagination: the skip is computed as\n * `(page - 1) * limit`. Omitted when the skip would be 0 (i.e. page 1)\n * since OData defaults to no skip and dropping it keeps the URI shorter.\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSkip(state: IQueryBuilderState, out: string[]): void {\n const skip = (state.page - 1) * state.limit;\n\n if (skip <= 0) {\n return;\n }\n\n out.push(`${OdataRequestStrategy._skipKey}=${skip}`);\n }\n\n /**\n * Append the `$top=` page-size parameter\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendTop(state: IQueryBuilderState, out: string[]): void {\n out.push(`${OdataRequestStrategy._topKey}=${state.limit}`);\n }\n\n /**\n * Format a filter value as an OData primitive literal\n *\n * Strings are single-quoted with embedded single quotes doubled\n * (`'O''Brien'`) per the OData ABNF; numbers and booleans are emitted\n * bare.\n *\n * @param value - The raw filter value\n * @returns The OData-formatted literal\n */\n private _formatLiteral(value: string | number | boolean): string {\n if (typeof value === 'string') {\n return `'${value.replace(/'/g, '\\'\\'')}'`;\n }\n\n return String(value);\n }\n\n /**\n * Translate a `FilterOperatorEnum` operator filter into one or more\n * OData boolean expressions\n *\n * The mapping is library-canonical → OData-native:\n * - `EQ` → `eq`; `GT`/`GTE`/`LT`/`LTE` → `gt` / `ge` / `lt` / `le`\n * - `CONTAINS` → `contains(field,'val')`\n * - `ILIKE` → `contains(tolower(field),tolower('val'))` (case-insensitive\n * contains)\n * - `SW` → `startswith(field,'val')`\n * - `IN` → `field in ('v1','v2')` (OData v4.01 list operator)\n * - `BTW` → **two** AND-ed terms (`field ge min` and `field le max`,\n * arity-checked)\n * - `NOT` → `ne` — one term per value, AND-ed (`field ne v1 and field ne v2`)\n * - `NULL` → `field eq null` (when value is `true`) / `field ne null`\n * (when value is `false`); arity- and type-checked\n *\n * PostgREST's full-text-search operators (`FTS`, `PHFTS`, `PLFTS`,\n * `WFTS`) have no OData equivalent and throw\n * `UnsupportedFilterOperatorError`.\n *\n * @param filter - The operator filter to translate\n * @returns One or more OData boolean expressions ready to ` and `-join\n * @throws {InvalidFilterOperatorValueError} If `BTW` does not receive\n * exactly two values, or `NULL` does not receive exactly one boolean\n * @throws {UnsupportedFilterOperatorError} If the operator is a\n * PostgREST-only FTS variant\n */\n private _formatOperatorTerms(filter: IOperatorFilter): string[] {\n const { field, operator, values } = filter;\n const first = values[0];\n\n switch (operator) {\n case FilterOperatorEnum.EQ: return [`${field} eq ${this._formatLiteral(first)}`];\n case FilterOperatorEnum.GT: return [`${field} gt ${this._formatLiteral(first)}`];\n case FilterOperatorEnum.GTE: return [`${field} ge ${this._formatLiteral(first)}`];\n case FilterOperatorEnum.LT: return [`${field} lt ${this._formatLiteral(first)}`];\n case FilterOperatorEnum.LTE: return [`${field} le ${this._formatLiteral(first)}`];\n case FilterOperatorEnum.CONTAINS: return [`contains(${field},${this._formatLiteral(first)})`];\n case FilterOperatorEnum.ILIKE: return [`contains(tolower(${field}),tolower(${this._formatLiteral(first)}))`];\n case FilterOperatorEnum.SW: return [`startswith(${field},${this._formatLiteral(first)})`];\n case FilterOperatorEnum.IN: return [`${field} in (${values.map(value => this._formatLiteral(value)).join(',')})`];\n\n case FilterOperatorEnum.BTW: {\n if (values.length !== 2) {\n throw new InvalidFilterOperatorValueError(\n operator,\n 'BTW requires exactly 2 values (min, max)'\n );\n }\n\n return [`${field} ge ${this._formatLiteral(values[0])}`, `${field} le ${this._formatLiteral(values[1])}`];\n }\n\n case FilterOperatorEnum.NOT:\n return values.map(value => `${field} ne ${this._formatLiteral(value)}`);\n\n case FilterOperatorEnum.NULL: {\n if (values.length !== 1 || typeof first !== 'boolean') {\n throw new InvalidFilterOperatorValueError(\n operator,\n 'NULL requires exactly 1 boolean value (true → IS NULL, false → IS NOT NULL)'\n );\n }\n\n return first ? [`${field} eq null`] : [`${field} ne null`];\n }\n\n case FilterOperatorEnum.FTS:\n case FilterOperatorEnum.PHFTS:\n case FilterOperatorEnum.PLFTS:\n case FilterOperatorEnum.WFTS:\n throw new UnsupportedFilterOperatorError();\n }\n }\n}\n","import { IPaginatedObject } from '../interfaces/paginated-object.interface';\nimport { IResponseStrategy } from '../interfaces/response-strategy.interface';\nimport { PaginatedCollection } from '../models/paginated-collection';\nimport { ResponseOptions } from '../models/response-options';\n\n/**\n * Response strategy for the OData v4 driver\n *\n * Parses OData collection responses:\n *\n * ```json\n * {\n * \"@odata.context\": \"https://api.example.com/$metadata#Products\",\n * \"@odata.count\": 100,\n * \"@odata.nextLink\": \"https://api.example.com/Products?$count=true&$top=10&$skip=30\",\n * \"value\": [...]\n * }\n * ```\n *\n * OData emits no current-page or page-size field in the body, so this\n * strategy **derives** them by inspecting the `@odata.nextLink` URL:\n *\n * - `perPage` comes from the link's `$top` param, falling back to the\n * item count of the current (necessarily full) page when the link\n * carries no `$top`.\n * - `currentPage` is `$skip ÷ perPage` — the next page starts where the\n * current one ends. Without a usable link (`$skiptoken`-based\n * server-driven paging, or the last page) the strategy falls back to\n * page **1**, which is only guaranteed correct for single-page results.\n * - `lastPage` is `ceil(total ÷ perPage)`; on a link-less response it\n * resolves to 1 when the page provably holds the whole result set.\n *\n * The total requires `$count=true` on the request — the request strategy\n * always emits it. Envelope keys contain **literal dots** (`@odata.count`),\n * so key paths from `OdataResponseOptions` are read with flat bracket\n * access, never dot-path traversal.\n *\n * @see https://docs.oasis-open.org/odata/odata-json-format/v4.01/odata-json-format-v4.01.html\n */\nexport class OdataResponseStrategy implements IResponseStrategy {\n\n /**\n * Parse an OData collection response into a PaginatedCollection\n *\n * @param response - The raw API response body\n * @param options - The response key name configuration\n * @returns A typed PaginatedCollection instance\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public paginate<T extends IPaginatedObject>(response: Record<string, any>, options: ResponseOptions): PaginatedCollection<T> {\n const data = response[options.data] as T[];\n const total = response[options.total] as number | undefined;\n const nextPageUrl = (response[options.nextPageUrl] ?? null) as string | null;\n\n const perPage = this._derivePerPage(nextPageUrl, data);\n const currentPage = this._deriveCurrentPage(nextPageUrl, perPage);\n const lastPage = this._deriveLastPage(nextPageUrl, data, total, perPage);\n\n const from = this._deriveFrom(nextPageUrl, data, currentPage, perPage);\n const to = this._deriveTo(nextPageUrl, data, currentPage, perPage, total);\n\n return new PaginatedCollection(\n data,\n currentPage,\n from,\n to,\n total,\n perPage,\n undefined,\n nextPageUrl ?? undefined,\n lastPage,\n undefined,\n undefined\n );\n }\n\n /**\n * Derive the current page number from the `@odata.nextLink` URL\n *\n * The next page starts where the current one ends, so\n * `currentPage = $skip ÷ perPage` (e.g. `$skip=30` with `$top=10` →\n * page 3). Falls back to **1** when the link is absent (last or only\n * page), carries no `$skip` (`$skiptoken`-based paging), or the page\n * size is unknown.\n *\n * @param nextPageUrl - The `@odata.nextLink` from the response, or null\n * @param perPage - The derived page size (may be undefined)\n * @returns The current page number\n */\n private _deriveCurrentPage(nextPageUrl: string | null, perPage?: number): number {\n if (nextPageUrl === null || !perPage) {\n return 1;\n }\n\n const skip = this._extractNumberParam(nextPageUrl, '$skip');\n\n if (skip === undefined) {\n return 1;\n }\n\n return Math.ceil(skip / perPage);\n }\n\n /**\n * Derive `from` as the 1-indexed offset of the first item on this page\n *\n * Computed from `currentPage` × `perPage` when the page size is known;\n * on a link-less single page it is 1 whenever items are present.\n *\n * @param nextPageUrl - The `@odata.nextLink` from the response, or null\n * @param data - The items on the current page\n * @param currentPage - The current page number\n * @param perPage - The page size (may be undefined)\n * @returns The 1-indexed `from` index, or undefined when inputs insufficient\n */\n private _deriveFrom(nextPageUrl: string | null, data: unknown[] | undefined, currentPage: number, perPage?: number): number | undefined {\n if (perPage) {\n return (currentPage - 1) * perPage + 1;\n }\n\n if (nextPageUrl === null && data?.length) {\n return 1;\n }\n\n return undefined;\n }\n\n /**\n * Derive the last page number\n *\n * `ceil(total ÷ perPage)` when both are known; a link-less response\n * that provably holds the entire non-empty result set resolves to 1.\n *\n * @param nextPageUrl - The `@odata.nextLink` from the response, or null\n * @param data - The items on the current page\n * @param total - The total item count\n * @param perPage - The page size\n * @returns The last page number, or undefined when inputs insufficient\n */\n private _deriveLastPage(nextPageUrl: string | null, data: unknown[] | undefined, total?: number, perPage?: number): number | undefined {\n if (total !== undefined && perPage !== undefined && perPage > 0) {\n return Math.ceil(total / perPage);\n }\n\n if (nextPageUrl === null && total !== undefined && total > 0 && (data?.length ?? 0) >= total) {\n return 1;\n }\n\n return undefined;\n }\n\n /**\n * Derive `perPage` from the `@odata.nextLink` URL\n *\n * Reads the link's `$top` param. When the link exists but carries no\n * `$top` (server-driven page size), the current page is necessarily\n * full, so its item count equals the page size. Without a link the\n * page may be partial and the size is not introspectable.\n *\n * @param nextPageUrl - The `@odata.nextLink` from the response, or null\n * @param data - The items on the current page\n * @returns The page size, or undefined\n */\n private _derivePerPage(nextPageUrl: string | null, data: unknown[] | undefined): number | undefined {\n if (nextPageUrl === null) {\n return undefined;\n }\n\n return this._extractNumberParam(nextPageUrl, '$top') ?? (data?.length || undefined);\n }\n\n /**\n * Derive `to` as the 1-indexed offset of the last item on this page\n *\n * Clamped to `total` so the last page does not report past the end;\n * on a link-less single page it is the item count.\n *\n * @param nextPageUrl - The `@odata.nextLink` from the response, or null\n * @param data - The items on the current page\n * @param currentPage - The current page number\n * @param perPage - The page size (may be undefined)\n * @param total - The total item count (may be undefined)\n * @returns The 1-indexed `to` index, or undefined when inputs insufficient\n */\n private _deriveTo(nextPageUrl: string | null, data: unknown[] | undefined, currentPage: number, perPage?: number, total?: number): number | undefined {\n if (perPage !== undefined && total !== undefined) {\n return Math.min(currentPage * perPage, total);\n }\n\n if (nextPageUrl === null && data?.length) {\n return data.length;\n }\n\n return undefined;\n }\n\n /**\n * Extract an integer query parameter from an OData pagination URL\n *\n * @param url - The URL to parse\n * @param name - The query-parameter name to look up (e.g. `$skip`)\n * @returns The integer value, or undefined\n */\n private _extractNumberParam(url: string, name: string): number | undefined {\n const raw = this._extractQueryParam(url, name);\n\n if (raw === undefined) {\n return undefined;\n }\n\n const parsed = Number.parseInt(raw, 10);\n\n return Number.isNaN(parsed) ? undefined : parsed;\n }\n\n /**\n * Extract a single query parameter from a URL via the WHATWG URL parser\n *\n * OData permits **relative** `@odata.nextLink` values, so parsing\n * retries against a placeholder base before giving up. Returns\n * undefined when the URL is unparseable or the parameter is absent.\n *\n * @param url - The URL to parse\n * @param name - The query-parameter name to look up\n * @returns The raw string value of the parameter, or undefined\n */\n private _extractQueryParam(url: string, name: string): string | undefined {\n try {\n const parsed = new URL(url, 'http://relative.invalid');\n const value = parsed.searchParams.get(name);\n\n return value === null ? undefined : value;\n } catch {\n return undefined;\n }\n }\n}\n","/* eslint-disable @typescript-eslint/naming-convention -- Payload's wire-format\n operator names (greater_than, greater_than_equal, less_than, less_than_equal,\n not_equals, not_in) are snake_case by server spec and emitted verbatim */\nimport * as qs from 'qs';\n\nimport { FilterOperatorEnum } from '../enums/filter-operator.enum';\nimport { SortEnum } from '../enums/sort.enum';\nimport { InvalidFilterOperatorValueError } from '../errors/invalid-filter-operator-value.error';\nimport { UnsupportedFilterOperatorError } from '../errors/unsupported-filter-operator.error';\nimport { IOperatorFilter } from '../interfaces/operator-filter.interface';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { IStrategyCapabilities } from '../interfaces/strategy-capabilities.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\nimport { AbstractRequestStrategy } from './abstract-request.strategy';\n\n/**\n * Right-hand-side payload of a Payload `where[field]` entry\n *\n * Each operator key maps to a primitive (single-value operators like\n * `equals`, `greater_than`) or a CSV string (multi-value operators like\n * `in`, `not_in`). Booleans appear specifically with `exists`.\n */\ntype PayloadFilterValue = string | number | boolean;\ntype PayloadFilterPayload = Record<string, PayloadFilterValue>;\n\n/**\n * Request strategy for the Payload CMS driver\n *\n * Generates URIs in [Payload's REST query format](https://payloadcms.com/docs/queries/overview):\n * - Filters: `where[field][equals]=value` (multi-value collapses to\n * `where[field][in]=v1,v2` CSV)\n * - Operator filters: `where[field][op]=value` (translated from\n * `FilterOperatorEnum` — `BTW`→`greater_than_equal`+`less_than_equal`\n * pair, `NOT`→`not_equals`/`not_in`, `NULL`→`exists` with inverted\n * boolean)\n * - Sorts: `sort=-createdAt,title` (CSV, `-` prefix = DESC)\n * - Field selection (flat): `select[col1]=true&select[col2]=true`\n * - Pagination (page-based): `page=N&limit=M`\n *\n * The `where` / `sort` / `select` / `page` / `limit` keys are fixed by\n * Payload's REST endpoints and intentionally not configurable through\n * `QueryBuilderOptions`; they live as private statics so they are\n * visible in one place.\n *\n * Relationship population is controlled by Payload's numeric `depth`\n * param, not a named-relation list — `addIncludes` therefore throws\n * `UnsupportedIncludesError` (pass `depth` through your HTTP layer if\n * needed). There is no per-model field selection and no global search\n * param. `SW` (no starts-with operator) and the PostgREST-native\n * full-text operators (`FTS`, `PHFTS`, `PLFTS`, `WFTS`) throw\n * `UnsupportedFilterOperatorError`.\n *\n * @see https://payloadcms.com/docs/queries/overview\n */\nexport class PayloadRequestStrategy extends AbstractRequestStrategy {\n\n /**\n * Filters, operator filters, sorts, flat field selection (`select`)\n * — no per-model fields, no includes (numeric `depth` instead), no\n * global search, no embedded resources\n */\n public readonly capabilities: IStrategyCapabilities = {\n embedded: false,\n fields: false,\n filters: true,\n includes: false,\n operatorFilters: true,\n search: false,\n select: true,\n sort: true\n };\n\n /**\n * Payload-native names of the five hardcoded query keys\n *\n * Fixed by the REST endpoints and intentionally not configurable\n * through `QueryBuilderOptions`.\n */\n private static readonly _limitKey = 'limit';\n private static readonly _pageKey = 'page';\n private static readonly _selectKey = 'select';\n private static readonly _sortKey = 'sort';\n private static readonly _whereKey = 'where';\n\n /**\n * Emit Payload-format query-string segments in canonical order:\n * where (merged) → sort → select → page → limit\n *\n * Simple filters and operator filters share a single `where` wrapper\n * so qs emits one ordered bracket structure rather than two duplicate\n * top-level `where[...]` blocks.\n *\n * @param state - The current query builder state\n * @param _options - The query parameter key name configuration (unused;\n * Payload's wire keys are fixed by the server)\n * @returns Ordered query-string fragments\n */\n protected parts(state: IQueryBuilderState, _options: QueryBuilderOptions): string[] {\n const out: string[] = [];\n\n this._appendWhere(state, out);\n this._appendSort(state, out);\n this._appendSelect(state, out);\n this._appendPagination(state, out);\n\n return out;\n }\n\n /**\n * Append the `page=` / `limit=` pagination pair\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendPagination(state: IQueryBuilderState, out: string[]): void {\n out.push(`${PayloadRequestStrategy._pageKey}=${state.page}`);\n out.push(`${PayloadRequestStrategy._limitKey}=${state.limit}`);\n }\n\n /**\n * Append `select[col]=true` flags from the flat select array\n *\n * Payload's select API is an object of `true` flags rather than a\n * CSV; nested selection (`select[group.field]=true`) passes through\n * when given as a dotted column name.\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSelect(state: IQueryBuilderState, out: string[]): void {\n if (!state.select.length) {\n return;\n }\n\n const flags: Record<string, boolean> = {};\n\n state.select.forEach(column => {\n flags[column] = true;\n });\n\n out.push(qs.stringify({ [PayloadRequestStrategy._selectKey]: flags }, { encode: false }));\n }\n\n /**\n * Append the `sort=-createdAt,title` CSV parameter\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSort(state: IQueryBuilderState, out: string[]): void {\n if (!state.sorts.length) {\n return;\n }\n\n const fields = state.sorts.map(sort =>\n sort.order === SortEnum.DESC ? `-${sort.field}` : sort.field\n );\n\n out.push(`${PayloadRequestStrategy._sortKey}=${fields.join(',')}`);\n }\n\n /**\n * Append the unified `where[...]` wrapper combining simple filters\n * and operator filters\n *\n * Both kinds emit into the same nested object under `where` so qs\n * produces a single bracketed block per request. Simple single-value\n * filters fold to `equals`; simple multi-value filters fold to the\n * `in` CSV. Operator filters then merge into the same per-field map,\n * potentially co-existing with a simple filter on the same field.\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendWhere(state: IQueryBuilderState, out: string[]): void {\n const simpleKeys = Object.keys(state.filters);\n\n if (!simpleKeys.length && !state.operatorFilters.length) {\n return;\n }\n\n const where: Record<string, PayloadFilterPayload> = {};\n\n simpleKeys.forEach(key => {\n const values = state.filters[key];\n\n if (!values.length) {\n return;\n }\n\n where[key] = values.length === 1\n ? { equals: values[0] }\n : { in: values.join(',') };\n });\n\n state.operatorFilters.forEach((filter: IOperatorFilter) => {\n const payload = this._formatOperatorPayload(filter);\n\n where[filter.field] = {\n ...(where[filter.field] ?? {}),\n ...payload\n };\n });\n\n if (!Object.keys(where).length) {\n return;\n }\n\n out.push(qs.stringify({ [PayloadRequestStrategy._whereKey]: where }, { encode: false }));\n }\n\n /**\n * Translate a `FilterOperatorEnum` operator filter into Payload's\n * `operator → value` payload shape\n *\n * The mapping is library-canonical → Payload-native:\n * - `EQ` → `equals`\n * - `GT`/`GTE`/`LT`/`LTE` → `greater_than` / `greater_than_equal` /\n * `less_than` / `less_than_equal`\n * - `CONTAINS` → `contains` (case-insensitive substring)\n * - `ILIKE` → `like` (case-insensitive, word-based)\n * - `IN` → `in` (CSV)\n * - `BTW` → `greater_than_equal` + `less_than_equal` pair in one\n * payload (arity-checked)\n * - `NOT` → `not_equals` (single value) / `not_in` (multi-value, CSV)\n * - `NULL` → `exists` with **inverted** boolean (`true` →\n * `exists=false` ⇔ IS NULL); arity- and type-checked\n *\n * `SW` (Payload has no starts-with operator) and PostgREST's\n * full-text-search operators (`FTS`, `PHFTS`, `PLFTS`, `WFTS`) throw\n * `UnsupportedFilterOperatorError`.\n *\n * @param filter - The operator filter to translate\n * @returns An `{ operator: value }` payload ready to merge under\n * `where[field]`\n * @throws {InvalidFilterOperatorValueError} If `BTW` does not receive\n * exactly two values, or `NULL` does not receive exactly one boolean\n * @throws {UnsupportedFilterOperatorError} If the operator has no\n * Payload equivalent\n */\n private _formatOperatorPayload(filter: IOperatorFilter): PayloadFilterPayload {\n const { operator, values } = filter;\n const first = values[0];\n\n switch (operator) {\n case FilterOperatorEnum.EQ: return { equals: first };\n case FilterOperatorEnum.GT: return { greater_than: first };\n case FilterOperatorEnum.GTE: return { greater_than_equal: first };\n case FilterOperatorEnum.LT: return { less_than: first };\n case FilterOperatorEnum.LTE: return { less_than_equal: first };\n case FilterOperatorEnum.CONTAINS: return { contains: first };\n case FilterOperatorEnum.ILIKE: return { like: first };\n case FilterOperatorEnum.IN: return { in: values.join(',') };\n\n case FilterOperatorEnum.BTW: {\n if (values.length !== 2) {\n throw new InvalidFilterOperatorValueError(\n operator,\n 'BTW requires exactly 2 values (min, max)'\n );\n }\n\n return { greater_than_equal: values[0], less_than_equal: values[1] };\n }\n\n case FilterOperatorEnum.NOT:\n return values.length === 1\n ? { not_equals: first }\n : { not_in: values.join(',') };\n\n case FilterOperatorEnum.NULL: {\n if (values.length !== 1 || typeof first !== 'boolean') {\n throw new InvalidFilterOperatorValueError(\n operator,\n 'NULL requires exactly 1 boolean value (true → IS NULL, false → IS NOT NULL)'\n );\n }\n\n // Payload semantics: exists=false matches null/missing values\n return { exists: !first };\n }\n\n case FilterOperatorEnum.SW:\n case FilterOperatorEnum.FTS:\n case FilterOperatorEnum.PHFTS:\n case FilterOperatorEnum.PLFTS:\n case FilterOperatorEnum.WFTS:\n throw new UnsupportedFilterOperatorError();\n }\n }\n}\n","import { AbstractDotPathResponseStrategy } from './abstract-dot-path-response.strategy';\n\n/**\n * Response strategy for the Payload CMS driver\n *\n * Parses Payload's paginated collection responses — the\n * `mongoose-paginate-v2` envelope, shared by many Express/Mongoose\n * backends:\n * ```json\n * {\n * \"docs\": [{ \"id\": \"abc123\", \"title\": \"Hello\" }],\n * \"totalDocs\": 48,\n * \"limit\": 10,\n * \"totalPages\": 5,\n * \"page\": 2,\n * \"pagingCounter\": 11,\n * \"hasPrevPage\": true,\n * \"hasNextPage\": true,\n * \"prevPage\": 1,\n * \"nextPage\": 3\n * }\n * ```\n *\n * Default key paths are configured in `PayloadResponseOptions`. The\n * envelope's `pagingCounter` is the 1-indexed offset of the first doc\n * on the page, so it maps straight onto `from`; `to` is computed from\n * `page` × `limit` (clamped to the total). `prevPage` / `nextPage` are\n * **page numbers**, not URLs, so the navigation-URL slots on\n * `PaginatedCollection` stay `undefined` unless the consumer overrides\n * their paths via `IPaginationConfig`. The traversal algorithm is\n * inherited from `AbstractDotPathResponseStrategy`; this class exists\n * so `DriverEnum.PAYLOAD` resolves to a distinct identity at the DI\n * layer even though the parsing logic is shared with JSON:API, NestJS,\n * Strapi, and PocketBase.\n *\n * @see https://payloadcms.com/docs/rest-api/overview\n */\nexport class PayloadResponseStrategy extends AbstractDotPathResponseStrategy {}\n","import { FilterOperatorEnum } from '../enums/filter-operator.enum';\nimport { SortEnum } from '../enums/sort.enum';\nimport { InvalidFilterOperatorValueError } from '../errors/invalid-filter-operator-value.error';\nimport { UnsupportedFilterOperatorError } from '../errors/unsupported-filter-operator.error';\nimport { IOperatorFilter } from '../interfaces/operator-filter.interface';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { IStrategyCapabilities } from '../interfaces/strategy-capabilities.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\nimport { AbstractRequestStrategy } from './abstract-request.strategy';\n\n/**\n * Request strategy for the PocketBase driver\n *\n * Generates URIs in [PocketBase's records-list format](https://pocketbase.io/docs/api-records/):\n * - Filters: a single `filter=(...)` expression-language parameter —\n * simple single-value filters fold to `field='value'`, multi-value\n * filters fold to an OR group (`(field='v1' || field='v2')`), and all\n * clauses join with ` && `\n * - Operator filters: expression terms (`field>=10`, `field~'val'`) —\n * see the mapping on `_formatOperatorClause`\n * - Sorts: `sort=-created,title` (CSV, `-` prefix = DESC)\n * - Field selection (flat): `fields=id,title` (CSV)\n * - Relation expansion: `expand=author,comments` (CSV)\n * - Pagination (page-based): `page=N&perPage=M`\n *\n * The `page` / `perPage` / `sort` / `filter` / `expand` / `fields` keys\n * are fixed by the PocketBase records API and intentionally not\n * configurable through `QueryBuilderOptions`; they live as private\n * statics so they are visible in one place.\n *\n * String literals are single-quoted with embedded quotes\n * backslash-escaped (`name='O\\'Brien'`); numbers and booleans emit\n * bare. PocketBase has no global search param (use `~` terms instead)\n * and no per-model field selection — the corresponding fluent methods\n * throw the matching `Unsupported*Error`. The PostgREST-native\n * full-text operators (`FTS`, `PHFTS`, `PLFTS`, `WFTS`) throw\n * `UnsupportedFilterOperatorError`.\n *\n * @see https://pocketbase.io/docs/api-records/\n */\nexport class PocketbaseRequestStrategy extends AbstractRequestStrategy {\n\n /**\n * Filters, operator filters, sorts, expand (`includes`), flat field\n * selection (`select`) — no per-model fields, no global search, no\n * embedded resources\n */\n public readonly capabilities: IStrategyCapabilities = {\n embedded: false,\n fields: false,\n filters: true,\n includes: true,\n operatorFilters: true,\n search: false,\n select: true,\n sort: true\n };\n\n /**\n * PocketBase-native names of the six hardcoded query keys\n *\n * The records API reads exactly these names; they are intentionally\n * not configurable through `QueryBuilderOptions` and live as private\n * statics so they are visible in one place.\n */\n private static readonly _expandKey = 'expand';\n private static readonly _fieldsKey = 'fields';\n private static readonly _filterKey = 'filter';\n private static readonly _pageKey = 'page';\n private static readonly _perPageKey = 'perPage';\n private static readonly _sortKey = 'sort';\n\n /**\n * Emit PocketBase-format query-string segments in canonical order:\n * expand → fields → filter (merged) → sort → page → perPage\n *\n * Simple filters and operator filters share the single `filter=(...)`\n * parameter so the server receives one combined expression rather\n * than two conflicting `filter` params.\n *\n * @param state - The current query builder state\n * @param _options - The query parameter key name configuration (unused;\n * PocketBase's wire keys are fixed by the server)\n * @returns Ordered query-string fragments\n */\n protected parts(state: IQueryBuilderState, _options: QueryBuilderOptions): string[] {\n const out: string[] = [];\n\n this._appendExpand(state, out);\n this._appendFields(state, out);\n this._appendFilter(state, out);\n this._appendSort(state, out);\n this._appendPagination(state, out);\n\n return out;\n }\n\n /**\n * Append the `expand=` CSV from the includes array\n *\n * Nested expansion (`author.address`) passes through verbatim when\n * given as a dotted include name.\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendExpand(state: IQueryBuilderState, out: string[]): void {\n if (!state.includes.length) {\n return;\n }\n\n out.push(`${PocketbaseRequestStrategy._expandKey}=${state.includes.join(',')}`);\n }\n\n /**\n * Append the `fields=` CSV from the flat select array\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendFields(state: IQueryBuilderState, out: string[]): void {\n if (!state.select.length) {\n return;\n }\n\n out.push(`${PocketbaseRequestStrategy._fieldsKey}=${state.select.join(',')}`);\n }\n\n /**\n * Append the single `filter=(...)` expression combining simple\n * filters and operator filters\n *\n * Clauses join with ` && `; multi-value clauses keep their own\n * parentheses so OR groups stay correctly scoped inside the AND\n * chain.\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendFilter(state: IQueryBuilderState, out: string[]): void {\n const clauses: string[] = [];\n\n Object.keys(state.filters).forEach(field => {\n const values = state.filters[field];\n\n if (!values.length) {\n return;\n }\n\n clauses.push(values.length === 1\n ? `${field}=${this._formatValue(values[0])}`\n : `(${values.map(value => `${field}=${this._formatValue(value)}`).join(' || ')})`);\n });\n\n state.operatorFilters.forEach((filter: IOperatorFilter) => {\n clauses.push(this._formatOperatorClause(filter));\n });\n\n if (!clauses.length) {\n return;\n }\n\n out.push(`${PocketbaseRequestStrategy._filterKey}=(${clauses.join(' && ')})`);\n }\n\n /**\n * Append the `page=` / `perPage=` pagination pair\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendPagination(state: IQueryBuilderState, out: string[]): void {\n out.push(`${PocketbaseRequestStrategy._pageKey}=${state.page}`);\n out.push(`${PocketbaseRequestStrategy._perPageKey}=${state.limit}`);\n }\n\n /**\n * Append the `sort=-created,title` CSV parameter\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSort(state: IQueryBuilderState, out: string[]): void {\n if (!state.sorts.length) {\n return;\n }\n\n const fields = state.sorts.map(sort =>\n sort.order === SortEnum.DESC ? `-${sort.field}` : sort.field\n );\n\n out.push(`${PocketbaseRequestStrategy._sortKey}=${fields.join(',')}`);\n }\n\n /**\n * Translate a `FilterOperatorEnum` operator filter into one\n * PocketBase expression clause\n *\n * The mapping is library-canonical → PocketBase-native:\n * - `EQ` → `field='v'`; `GT`/`GTE`/`LT`/`LTE` → `>` / `>=` / `<` / `<=`\n * - `CONTAINS`/`ILIKE` → `field~'v'` (PocketBase's `~` is a\n * case-insensitive LIKE that auto-wraps the operand in `%...%`)\n * - `SW` → `field~'v%'` (explicit trailing wildcard disables the\n * auto-wrap)\n * - `IN` → OR group `(field='v1' || field='v2')`\n * - `BTW` → AND group `(field>=min && field<=max)` (arity-checked)\n * - `NOT` → `field!='v'` (single) / AND group of `!=` terms (multi)\n * - `NULL` → `field=null` (when value is `true`) / `field!=null`\n * (when value is `false`); arity- and type-checked\n *\n * PostgREST's full-text-search operators (`FTS`, `PHFTS`, `PLFTS`,\n * `WFTS`) have no PocketBase equivalent and throw\n * `UnsupportedFilterOperatorError`.\n *\n * @param filter - The operator filter to translate\n * @returns One expression clause ready to join into `filter=(...)`\n * @throws {InvalidFilterOperatorValueError} If `BTW` does not receive\n * exactly two values, or `NULL` does not receive exactly one boolean\n * @throws {UnsupportedFilterOperatorError} If the operator is a\n * PostgREST-only FTS variant\n */\n private _formatOperatorClause(filter: IOperatorFilter): string {\n const { field, operator, values } = filter;\n const first = values[0];\n\n switch (operator) {\n case FilterOperatorEnum.EQ: return `${field}=${this._formatValue(first)}`;\n case FilterOperatorEnum.GT: return `${field}>${this._formatValue(first)}`;\n case FilterOperatorEnum.GTE: return `${field}>=${this._formatValue(first)}`;\n case FilterOperatorEnum.LT: return `${field}<${this._formatValue(first)}`;\n case FilterOperatorEnum.LTE: return `${field}<=${this._formatValue(first)}`;\n case FilterOperatorEnum.CONTAINS: return `${field}~${this._formatValue(first)}`;\n case FilterOperatorEnum.ILIKE: return `${field}~${this._formatValue(first)}`;\n case FilterOperatorEnum.SW: return `${field}~'${this._escape(String(first))}%'`;\n case FilterOperatorEnum.IN: return `(${values.map(value => `${field}=${this._formatValue(value)}`).join(' || ')})`;\n\n case FilterOperatorEnum.BTW: {\n if (values.length !== 2) {\n throw new InvalidFilterOperatorValueError(\n operator,\n 'BTW requires exactly 2 values (min, max)'\n );\n }\n\n return `(${field}>=${this._formatValue(values[0])} && ${field}<=${this._formatValue(values[1])})`;\n }\n\n case FilterOperatorEnum.NOT:\n return values.length === 1\n ? `${field}!=${this._formatValue(first)}`\n : `(${values.map(value => `${field}!=${this._formatValue(value)}`).join(' && ')})`;\n\n case FilterOperatorEnum.NULL: {\n if (values.length !== 1 || typeof first !== 'boolean') {\n throw new InvalidFilterOperatorValueError(\n operator,\n 'NULL requires exactly 1 boolean value (true → IS NULL, false → IS NOT NULL)'\n );\n }\n\n return first ? `${field}=null` : `${field}!=null`;\n }\n\n case FilterOperatorEnum.FTS:\n case FilterOperatorEnum.PHFTS:\n case FilterOperatorEnum.PLFTS:\n case FilterOperatorEnum.WFTS:\n throw new UnsupportedFilterOperatorError();\n }\n }\n\n /**\n * Backslash-escape single quotes inside a string literal\n *\n * @param value - The raw string value\n * @returns The escaped string, ready to wrap in single quotes\n */\n private _escape(value: string): string {\n return value.replace(/'/g, '\\\\\\'');\n }\n\n /**\n * Format a filter value as a PocketBase expression literal\n *\n * Strings are single-quoted (embedded quotes backslash-escaped);\n * numbers and booleans emit bare, matching the expression language's\n * literal rules.\n *\n * @param value - The raw filter value\n * @returns The formatted literal\n */\n private _formatValue(value: string | number | boolean): string {\n return typeof value === 'string' ? `'${this._escape(value)}'` : `${value}`;\n }\n}\n","import { AbstractDotPathResponseStrategy } from './abstract-dot-path-response.strategy';\n\n/**\n * Response strategy for the PocketBase driver\n *\n * Parses PocketBase records-list responses:\n * ```json\n * {\n * \"page\": 1,\n * \"perPage\": 30,\n * \"totalItems\": 48,\n * \"totalPages\": 2,\n * \"items\": [{ \"id\": \"abc123\", \"title\": \"Hello\" }]\n * }\n * ```\n *\n * Default key paths are configured in `PocketbaseResponseOptions` —\n * all flat keys, resolved by the inherited dot-path traversal (a flat\n * key is just a one-segment path). PocketBase does not include\n * navigation links in the envelope, so `firstPageUrl`, `prevPageUrl`,\n * `nextPageUrl`, and `lastPageUrl` resolve to `undefined` unless the\n * consumer overrides their paths via `IPaginationConfig`; `from`/`to`\n * are computed from `page` × `perPage`. This class exists so\n * `DriverEnum.POCKETBASE` resolves to a distinct identity at the DI\n * layer even though the parsing logic is shared with JSON:API, NestJS,\n * and Strapi.\n *\n * When the request was sent with `skipTotal=1` (not emitted by this\n * driver), PocketBase reports `totalItems`/`totalPages` as `-1`;\n * override the paths or treat the values accordingly if you opt into\n * that server-side optimisation.\n *\n * @see https://pocketbase.io/docs/api-records/\n */\nexport class PocketbaseResponseStrategy extends AbstractDotPathResponseStrategy {}\n","/**\n * Enum representing the wire-level pagination mechanism\n *\n * `QUERY` (default) — the request strategy emits `limit` and `offset` (or\n * equivalent) query parameters on the URL.\n *\n * `RANGE` — the request strategy omits URL-based pagination and the\n * consumer instead applies HTTP request headers returned by\n * `NgQubeeService.paginationHeaders()`. Currently honoured only by the\n * PostgREST driver, which maps it to `Range-Unit: items` + `Range: 0-9`.\n * Other drivers ignore the setting.\n */\nexport enum PaginationModeEnum {\n QUERY = 'query',\n RANGE = 'range'\n}\n","import { FilterOperatorEnum } from '../enums/filter-operator.enum';\nimport { PaginationModeEnum } from '../enums/pagination-mode.enum';\nimport { SortEnum } from '../enums/sort.enum';\nimport { InvalidFilterOperatorValueError } from '../errors/invalid-filter-operator-value.error';\nimport { IOperatorFilter } from '../interfaces/operator-filter.interface';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { IStrategyCapabilities } from '../interfaces/strategy-capabilities.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\nimport { AbstractRequestStrategy } from './abstract-request.strategy';\n\n/**\n * Request strategy for the PostgREST driver\n *\n * PostgREST auto-generates REST APIs from PostgreSQL schemas and is the\n * backbone of Supabase's data API. This strategy produces URIs in\n * PostgREST's native query-string format:\n *\n * - Filters: `col=eq.val` (single value) / `col=in.(v1,v2,v3)` (multi-value)\n * - Order: `order=col1.asc,col2.desc`\n * - Select: `select=col1,col2`\n * - Pagination: `limit=N&offset=M` (offset derived from state.page)\n *\n * The `order` and `offset` query-parameter names are PostgREST conventions\n * and are intentionally not configurable via `QueryBuilderOptions` (see\n * issue #50 MVP scope). `limit`, `select`, and `filters` (per-column name)\n * honour the existing option keys.\n *\n * @see https://postgrest.org/en/stable/api.html\n * @see https://supabase.com/docs/reference/javascript/select\n */\nexport class PostgrestRequestStrategy extends AbstractRequestStrategy {\n\n /**\n * Filters, operator filters (incl. FTS), sorts, flat select — no\n * per-model fields, no JSON:API/Spatie-style includes, no global\n * search (per-column FTS via the operator family covers it)\n */\n public readonly capabilities: IStrategyCapabilities = {\n embedded: true,\n fields: false,\n filters: true,\n includes: false,\n operatorFilters: true,\n search: false,\n select: true,\n sort: true\n };\n\n private static readonly _offsetKey = 'offset';\n private static readonly _orderKey = 'order';\n\n /**\n * Active pagination mode\n *\n * QUERY (default) → URL emits limit/offset.\n * RANGE → URL omits them; `buildPaginationHeaders()` returns the\n * `Range-Unit` / `Range` HTTP headers instead.\n */\n private readonly _paginationMode: PaginationModeEnum;\n\n /**\n * @param paginationMode - Wire-level pagination mechanism. Defaults to\n * `PaginationModeEnum.QUERY`; `provideNgQubee` wires this from\n * `IConfig.pagination`.\n */\n constructor(paginationMode: PaginationModeEnum = PaginationModeEnum.QUERY) {\n super();\n this._paginationMode = paginationMode;\n }\n\n /**\n * Compute `Range-Unit` / `Range` HTTP headers for RANGE pagination mode\n *\n * In QUERY mode this returns `null` so `NgQubeeService.paginationHeaders()`\n * conveys \"no headers needed\" to the consumer. In RANGE mode the method\n * converts the 1-indexed `state.page` + `state.limit` into PostgREST's\n * 0-indexed inclusive range (`from = (page - 1) * limit`,\n * `to = from + limit - 1`) and returns both header values.\n *\n * @param state - The current query builder state\n * @returns `{ 'Range-Unit': 'items', 'Range': 'from-to' }` or `null`\n */\n public buildPaginationHeaders(state: IQueryBuilderState): Record<string, string> | null {\n if (this._paginationMode !== PaginationModeEnum.RANGE) {\n return null;\n }\n\n const from = (state.page - 1) * state.limit;\n const to = from + state.limit - 1;\n\n /* eslint-disable @typescript-eslint/naming-convention */\n return {\n 'Range-Unit': 'items',\n 'Range': `${from}-${to}`\n };\n /* eslint-enable @typescript-eslint/naming-convention */\n }\n\n /**\n * Emit PostgREST-format query-string segments in canonical order:\n * filters → operator filters → order → select → (limit + offset in\n * QUERY mode only — RANGE mode passes pagination via headers instead)\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @returns Ordered query-string fragments\n */\n protected parts(state: IQueryBuilderState, options: QueryBuilderOptions): string[] {\n const out: string[] = [];\n\n this._appendFilters(state, out);\n this._appendOperatorFilters(state, out);\n this._appendOrder(state, out);\n this._appendSelect(state, options, out);\n\n if (this._paginationMode === PaginationModeEnum.QUERY) {\n this._appendLimit(state, options, out);\n this._appendOffset(state, out);\n }\n\n return out;\n }\n\n /**\n * Append filter parameters in PostgREST format\n *\n * Every filter is operator-prefixed (PostgREST has no implicit equality):\n * a single value yields `col=eq.val`; multiple values collapse into\n * PostgREST's native IN-list syntax `col=in.(v1,v2,v3)`.\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendFilters(state: IQueryBuilderState, out: string[]): void {\n const keys = Object.keys(state.filters);\n\n if (!keys.length) {\n return;\n }\n\n keys.forEach(key => {\n const values = state.filters[key];\n\n if (!values.length) {\n return;\n }\n\n // single-value → eq.<val>\n // multi-value → in.(v1,v2,v3)\n const rhs = values.length === 1\n ? `eq.${values[0]}`\n : `in.(${values.join(',')})`;\n\n out.push(`${key}=${rhs}`);\n });\n }\n\n /**\n * Append the limit parameter\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendLimit(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n out.push(`${options.limit}=${state.limit}`);\n }\n\n /**\n * Append the offset parameter, derived from state.page\n *\n * PostgREST uses offset-based pagination, not page-based. The offset is\n * computed as `(page - 1) * limit`. Omitted when offset would be 0\n * (i.e. page 1) since PostgREST defaults to offset=0 anyway and dropping\n * it keeps the URI shorter.\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendOffset(state: IQueryBuilderState, out: string[]): void {\n const offset = (state.page - 1) * state.limit;\n\n if (offset <= 0) {\n return;\n }\n\n out.push(`${PostgrestRequestStrategy._offsetKey}=${offset}`);\n }\n\n /**\n * Append explicit operator filters\n *\n * Maps each `FilterOperatorEnum` value to PostgREST's prefix-operator\n * syntax. `BTW` expands to two query params (`gte` + `lte`); `NULL`\n * emits `is.null` / `is.not.null` based on the boolean value; `NOT`\n * picks its inner operator by arity (`not.eq.val` for single values,\n * `not.in.(v1,v2)` for multi-value).\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n * @throws {InvalidFilterOperatorValueError} If `BTW` does not receive exactly 2 values, or `NULL` does not receive exactly 1 boolean\n */\n private _appendOperatorFilters(state: IQueryBuilderState, out: string[]): void {\n if (!state.operatorFilters.length) {\n return;\n }\n\n state.operatorFilters.forEach(filter => {\n // BTW expands to two segments: col=gte.min and col=lte.max\n if (filter.operator === FilterOperatorEnum.BTW) {\n this._appendBetweenFilter(filter, out);\n return;\n }\n\n const rhs = this._formatOperatorRhs(filter);\n out.push(`${filter.field}=${rhs}`);\n });\n }\n\n /**\n * Append a `BTW` operator filter as two PostgREST segments\n *\n * Produces: `col=gte.min` and `col=lte.max`. Values must be exactly\n * `[min, max]`.\n *\n * @param filter - The operator filter carrying the BTW bounds\n * @param out - The accumulator the caller joins into the URI\n * @throws {InvalidFilterOperatorValueError} If values.length !== 2\n */\n private _appendBetweenFilter(filter: IOperatorFilter, out: string[]): void {\n if (filter.values.length !== 2) {\n throw new InvalidFilterOperatorValueError(\n filter.operator,\n 'BTW requires exactly 2 values (min, max)'\n );\n }\n\n const [min, max] = filter.values;\n\n out.push(`${filter.field}=gte.${min}`);\n out.push(`${filter.field}=lte.${max}`);\n }\n\n /**\n * Build the right-hand-side of a PostgREST filter param for the given operator\n *\n * Kept as a separate helper so each operator's shape is visible in one\n * place and the dispatch is exhaustively typed against\n * `FilterOperatorEnum`.\n *\n * @param filter - The operator filter (field, operator, values)\n * @returns The PostgREST-formatted value portion (right of the `=` sign)\n * @throws {InvalidFilterOperatorValueError} If NULL receives a non-boolean or wrong arity\n */\n private _formatOperatorRhs(filter: IOperatorFilter): string {\n const { operator, values } = filter;\n const first = values[0];\n\n switch (operator) {\n case FilterOperatorEnum.EQ: return `eq.${first}`;\n case FilterOperatorEnum.GT: return `gt.${first}`;\n case FilterOperatorEnum.GTE: return `gte.${first}`;\n case FilterOperatorEnum.LT: return `lt.${first}`;\n case FilterOperatorEnum.LTE: return `lte.${first}`;\n case FilterOperatorEnum.ILIKE: return `ilike.${first}`;\n case FilterOperatorEnum.IN: return `in.(${values.join(',')})`;\n case FilterOperatorEnum.SW: return `like.${first}*`;\n case FilterOperatorEnum.CONTAINS: return `ilike.%${first}%`;\n case FilterOperatorEnum.FTS: return `fts.${first}`;\n case FilterOperatorEnum.PLFTS: return `plfts.${first}`;\n case FilterOperatorEnum.PHFTS: return `phfts.${first}`;\n case FilterOperatorEnum.WFTS: return `wfts.${first}`;\n\n case FilterOperatorEnum.NOT:\n return values.length === 1\n ? `not.eq.${first}`\n : `not.in.(${values.join(',')})`;\n\n case FilterOperatorEnum.NULL: {\n if (values.length !== 1 || typeof first !== 'boolean') {\n throw new InvalidFilterOperatorValueError(\n operator,\n 'NULL requires exactly 1 boolean value (true → IS NULL, false → IS NOT NULL)'\n );\n }\n\n return first ? 'is.null' : 'is.not.null';\n }\n\n // BTW is dispatched by _appendOperatorFilters; falling through would be a bug\n case FilterOperatorEnum.BTW:\n throw new InvalidFilterOperatorValueError(\n operator,\n 'BTW should be dispatched to _appendBetweenFilter — this indicates a bug'\n );\n }\n }\n\n /**\n * Append the order parameter as `order=col1.asc,col2.desc`\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendOrder(state: IQueryBuilderState, out: string[]): void {\n if (!state.sorts.length) {\n return;\n }\n\n const pairs = state.sorts.map(sort =>\n `${sort.field}.${sort.order === SortEnum.DESC ? 'desc' : 'asc'}`\n );\n\n out.push(`${PostgrestRequestStrategy._orderKey}=${pairs.join(',')}`);\n }\n\n /**\n * Append the select parameter as `select=col1,col2,rel(col1,col2)`\n *\n * PostgREST uses a single `select` query param for both column pruning\n * (matching NestJS semantics) and embedded-resource fetching — the\n * embedded fragments from `addEmbedded` are spliced into the same\n * param value, never emitted as a second `select`.\n *\n * Fragment shape per relation: `rel(col1,col2)` with explicit columns,\n * `rel(*)` without. When embedded relations are present but no flat\n * columns were selected, the flat part defaults to `*` so the base\n * row's columns are not silently dropped from the projection.\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSelect(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n const embedded = Object.keys(state.embedded).map(relation => {\n const columns = state.embedded[relation];\n\n return columns.length ? `${relation}(${columns.join(',')})` : `${relation}(*)`;\n });\n\n if (!state.select.length && !embedded.length) {\n return;\n }\n\n const columns = state.select.length ? state.select : ['*'];\n\n out.push(`${options.select}=${[...columns, ...embedded].join(',')}`);\n }\n}\n","/**\n * A minimal bag of HTTP response headers that a response strategy can read\n * by name.\n *\n * Accepts anything that exposes a `.get(name): string | null` method\n * (Angular's `HttpHeaders`, the DOM `Headers` class) or a plain object\n * keyed by header name. Consumers should not need to convert between them.\n */\nexport type HeaderBag =\n | { get(name: string): string | null }\n | Record<string, string | null | undefined>;\n\n/**\n * Read a header value by name from a `HeaderBag`, regardless of whether the\n * bag exposes a `.get()` accessor or plain property access.\n *\n * @param bag - The header bag to read from\n * @param name - The header name (case-sensitivity follows the underlying bag)\n * @returns The header value, or `null` if absent or the bag itself is falsy\n */\nexport function readHeader(bag: HeaderBag | null | undefined, name: string): string | null {\n if (!bag) {\n return null;\n }\n\n const accessor = bag as { get?: (name: string) => string | null };\n\n if (typeof accessor.get === 'function') {\n return accessor.get(name);\n }\n\n const value = (bag as Record<string, string | null | undefined>)[name];\n\n return value ?? null;\n}\n","import { HeaderBag, readHeader } from '../interfaces/header-bag.interface';\nimport { IPaginatedObject } from '../interfaces/paginated-object.interface';\nimport { IResponseStrategy } from '../interfaces/response-strategy.interface';\nimport { PaginatedCollection } from '../models/paginated-collection';\nimport { ResponseOptions } from '../models/response-options';\n\n/**\n * Internal shape holding the three values parsed out of a `Content-Range`\n * header. All three are optional because PostgREST may legitimately emit a\n * malformed header (or none at all, when the client didn't opt into counts\n * via `Prefer: count=exact`).\n */\ninterface IContentRangeParts {\n from?: number;\n to?: number;\n total?: number;\n}\n\n/**\n * Response strategy for the PostgREST driver\n *\n * PostgREST (and Supabase, which wraps it) returns a bare array body for\n * collection endpoints. Pagination metadata is carried in the\n * `Content-Range` HTTP response header, e.g. `0-9/50` meaning \"items 0–9\n * out of 50 total\". Consumers opt into totals by sending the\n * `Prefer: count=exact` request header.\n *\n * This strategy expects the consumer to pass the array body as `response`\n * (or a plain object with `response[options.data]` pointing at the array)\n * and the response headers via the optional `headers` bag. See\n * `PaginationService.paginate()` for the call-site shape.\n *\n * @see https://postgrest.org/en/stable/references/api/pagination_count.html\n */\nexport class PostgrestResponseStrategy implements IResponseStrategy {\n\n private static readonly _contentRangeHeader = 'Content-Range';\n private static readonly _contentRangeRegex = /^(\\d+)-(\\d+)\\/(\\*|\\d+)$/;\n\n /**\n * Parse a PostgREST response into a typed PaginatedCollection\n *\n * @param response - The raw response. Either the array body directly, or\n * an object with the array at `response[options.data]`.\n * @param options - The response key configuration (only `options.data` is\n * consulted; all pagination metadata comes from the Content-Range header).\n * @param headers - Optional HTTP response headers. The `Content-Range`\n * header drives page/total derivation; omission is tolerated and yields\n * a collection with `undefined` bounds (auto-sync will leave\n * `isLastPageKnown` at `false`).\n * @returns A typed PaginatedCollection instance\n */\n public paginate<T extends IPaginatedObject>(\n response: Record<string, unknown>,\n options: ResponseOptions,\n headers?: HeaderBag\n ): PaginatedCollection<T> {\n // Body may be a bare array or an envelope with the array at options.data\n const data = (Array.isArray(response) ? response : response[options.data]) as T[];\n\n // Header-driven pagination metadata\n const contentRange = readHeader(headers, PostgrestResponseStrategy._contentRangeHeader);\n const { from, to, total } = this._parseContentRange(contentRange);\n\n // Per-page can only be derived from the from/to range; fall back to undefined\n const perPage = (from !== undefined && to !== undefined) ? (to - from + 1) : undefined;\n\n // Page is 1-based in ng-qubee state; PostgREST reports 0-based indices\n const page = (perPage && from !== undefined) ? Math.floor(from / perPage) + 1 : 1;\n const lastPage = (total !== undefined && perPage) ? Math.ceil(total / perPage) : undefined;\n\n // Library convention: from/to are 1-indexed and inclusive; PostgREST emits 0-indexed\n const fromOneIndexed = from !== undefined ? from + 1 : undefined;\n const toOneIndexed = to !== undefined ? to + 1 : undefined;\n\n // PostgREST does not emit page URLs, so prev/next/first/last URLs stay undefined\n return new PaginatedCollection<T>(\n data,\n page,\n fromOneIndexed,\n toOneIndexed,\n total,\n perPage,\n undefined,\n undefined,\n lastPage\n );\n }\n\n /**\n * Extract `{from, to, total}` from a PostgREST `Content-Range` value\n *\n * Expected format: `<from>-<to>/<total|*>`. Any shape mismatch returns\n * an empty object; `*` as the total yields `total: undefined`.\n *\n * @param value - Raw header value (possibly null/undefined)\n * @returns Parsed integers; missing fields indicate an unparseable header\n */\n private _parseContentRange(value: string | null | undefined): IContentRangeParts {\n if (!value) {\n return {};\n }\n\n const match = value.trim().match(PostgrestResponseStrategy._contentRangeRegex);\n\n if (!match) {\n return {};\n }\n\n const from = parseInt(match[1], 10);\n const to = parseInt(match[2], 10);\n const total = match[3] === '*' ? undefined : parseInt(match[3], 10);\n\n return { from, to, total };\n }\n}\n","import { FilterOperatorEnum } from '../enums/filter-operator.enum';\nimport { SortEnum } from '../enums/sort.enum';\nimport { InvalidFilterOperatorValueError } from '../errors/invalid-filter-operator-value.error';\nimport { UnsupportedFilterOperatorError } from '../errors/unsupported-filter-operator.error';\nimport { IOperatorFilter } from '../interfaces/operator-filter.interface';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { IStrategyCapabilities } from '../interfaces/strategy-capabilities.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\nimport { AbstractRequestStrategy } from './abstract-request.strategy';\n\n/**\n * Request strategy for the Sieve (.NET) driver\n *\n * Generates URIs in [Sieve's compact expression format](https://github.com/Biarity/Sieve):\n * - Filters: a single `filters=` parameter holding comma-joined (AND)\n * `Field{op}Value` terms; multi-value terms use the pipe (OR) on the\n * value side (`status==active|pending`)\n * - Operator filters: translated from `FilterOperatorEnum` — see the\n * mapping on `_formatOperatorTerms`\n * - Sorts: `sorts=field,-other` (CSV, `-` prefix = DESC)\n * - Pagination: `page=N&pageSize=N`\n *\n * Sieve has no per-model field selection, no relation includes, no flat\n * column selection, and no global search parameter — the corresponding\n * fluent methods throw the matching `Unsupported*Error`. PostgREST-native\n * full-text search operators (`FTS`, `PHFTS`, `PLFTS`, `WFTS`) throw\n * `UnsupportedFilterOperatorError`.\n *\n * @see https://github.com/Biarity/Sieve\n */\nexport class SieveRequestStrategy extends AbstractRequestStrategy {\n\n /**\n * Filters, operator filters, sorts — no per-model fields, no includes,\n * no flat select, no global search (use `CONTAINS` / `ILIKE` operator\n * filters for partial matches)\n */\n public readonly capabilities: IStrategyCapabilities = {\n embedded: false,\n fields: false,\n filters: true,\n includes: false,\n operatorFilters: true,\n search: false,\n select: false,\n sort: true\n };\n\n /**\n * Sieve-native names of the three hardcoded query keys\n *\n * Sieve's model binder reads `filters`, `sorts`, and `pageSize` (the\n * plural forms differ from the library-wide `filter` / `sort` /\n * `limit` defaults); these keys are intentionally not configurable\n * through `QueryBuilderOptions` and live as private statics so they\n * are visible in one place.\n */\n private static readonly _filtersKey = 'filters';\n private static readonly _pageSizeKey = 'pageSize';\n private static readonly _sortsKey = 'sorts';\n\n /**\n * Emit Sieve-format query-string segments in canonical order:\n * filters → sorts → page → pageSize\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration (used\n * for `page`, whose default matches the wire format; the `filters` /\n * `sorts` / `pageSize` keys are fixed by the server)\n * @returns Ordered query-string fragments\n */\n protected parts(state: IQueryBuilderState, options: QueryBuilderOptions): string[] {\n const out: string[] = [];\n\n this._appendFilters(state, out);\n this._appendSorts(state, out);\n this._appendPage(state, options, out);\n this._appendPageSize(state, out);\n\n return out;\n }\n\n /**\n * Append the single `filters=` parameter combining simple and operator\n * filters\n *\n * Each term is one `Field{op}Value` expression; terms join with the\n * comma (Sieve's AND). Simple single-value filters fold to `==`;\n * simple multi-value filters fold to a value-level pipe OR\n * (`field==v1|v2`).\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendFilters(state: IQueryBuilderState, out: string[]): void {\n const terms: string[] = [];\n\n Object.keys(state.filters).forEach(field => {\n const values = state.filters[field];\n\n if (!values.length) {\n return;\n }\n\n terms.push(`${field}==${values.join('|')}`);\n });\n\n state.operatorFilters.forEach((filter: IOperatorFilter) => {\n terms.push(...this._formatOperatorTerms(filter));\n });\n\n if (!terms.length) {\n return;\n }\n\n out.push(`${SieveRequestStrategy._filtersKey}=${terms.join(',')}`);\n }\n\n /**\n * Append the page parameter\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendPage(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n out.push(`${options.page}=${state.page}`);\n }\n\n /**\n * Append the pageSize parameter\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendPageSize(state: IQueryBuilderState, out: string[]): void {\n out.push(`${SieveRequestStrategy._pageSizeKey}=${state.limit}`);\n }\n\n /**\n * Append the `sorts=field,-other` CSV parameter\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSorts(state: IQueryBuilderState, out: string[]): void {\n if (!state.sorts.length) {\n return;\n }\n\n const fields = state.sorts.map(sort =>\n sort.order === SortEnum.DESC ? `-${sort.field}` : sort.field\n );\n\n out.push(`${SieveRequestStrategy._sortsKey}=${fields.join(',')}`);\n }\n\n /**\n * Translate a `FilterOperatorEnum` operator filter into one or more\n * Sieve `Field{op}Value` terms\n *\n * The mapping is library-canonical → Sieve-native:\n * - `EQ` → `==`; `GT`/`GTE`/`LT`/`LTE` → `>` / `>=` / `<` / `<=`\n * - `CONTAINS` → `@=`; `ILIKE` → `@=*` (case-insensitive contains)\n * - `SW` → `_=` (starts with)\n * - `IN` → `==` with a value-level pipe OR (`field==v1|v2`)\n * - `BTW` → **two** AND-ed terms (`field>=min` and `field<=max`,\n * arity-checked)\n * - `NOT` → `!=` — one term per value, AND-ed (`field!=v1,field!=v2`)\n * - `NULL` → `==null` (when value is `true`) / `!=null` (when value is\n * `false`); arity- and type-checked\n *\n * PostgREST's full-text-search operators (`FTS`, `PHFTS`, `PLFTS`,\n * `WFTS`) have no Sieve equivalent and throw\n * `UnsupportedFilterOperatorError`.\n *\n * @param filter - The operator filter to translate\n * @returns One or more `Field{op}Value` terms ready to AND-join\n * @throws {InvalidFilterOperatorValueError} If `BTW` does not receive\n * exactly two values, or `NULL` does not receive exactly one boolean\n * @throws {UnsupportedFilterOperatorError} If the operator is a\n * PostgREST-only FTS variant\n */\n private _formatOperatorTerms(filter: IOperatorFilter): string[] {\n const { field, operator, values } = filter;\n const first = values[0];\n\n switch (operator) {\n case FilterOperatorEnum.EQ: return [`${field}==${first}`];\n case FilterOperatorEnum.GT: return [`${field}>${first}`];\n case FilterOperatorEnum.GTE: return [`${field}>=${first}`];\n case FilterOperatorEnum.LT: return [`${field}<${first}`];\n case FilterOperatorEnum.LTE: return [`${field}<=${first}`];\n case FilterOperatorEnum.CONTAINS: return [`${field}@=${first}`];\n case FilterOperatorEnum.ILIKE: return [`${field}@=*${first}`];\n case FilterOperatorEnum.SW: return [`${field}_=${first}`];\n case FilterOperatorEnum.IN: return [`${field}==${values.join('|')}`];\n\n case FilterOperatorEnum.BTW: {\n if (values.length !== 2) {\n throw new InvalidFilterOperatorValueError(\n operator,\n 'BTW requires exactly 2 values (min, max)'\n );\n }\n\n return [`${field}>=${values[0]}`, `${field}<=${values[1]}`];\n }\n\n case FilterOperatorEnum.NOT:\n return values.map(value => `${field}!=${value}`);\n\n case FilterOperatorEnum.NULL: {\n if (values.length !== 1 || typeof first !== 'boolean') {\n throw new InvalidFilterOperatorValueError(\n operator,\n 'NULL requires exactly 1 boolean value (true → IS NULL, false → IS NOT NULL)'\n );\n }\n\n return first ? [`${field}==null`] : [`${field}!=null`];\n }\n\n case FilterOperatorEnum.FTS:\n case FilterOperatorEnum.PHFTS:\n case FilterOperatorEnum.PLFTS:\n case FilterOperatorEnum.WFTS:\n throw new UnsupportedFilterOperatorError();\n }\n }\n}\n","import { AbstractDotPathResponseStrategy } from './abstract-dot-path-response.strategy';\n\n/**\n * Response strategy for the Sieve (.NET) driver\n *\n * Sieve itself does not define a response envelope — it returns an\n * `IQueryable` that the ASP.NET developer wraps in a paging DTO of their\n * choosing. This strategy therefore ships a **sensible default mapping**\n * for the common hand-rolled `PagedResult<T>` shape:\n * ```json\n * {\n * \"data\": [{ \"id\": 1, \"title\": \"Hello\" }],\n * \"page\": 2,\n * \"pageSize\": 10,\n * \"total\": 48,\n * \"totalPages\": 5\n * }\n * ```\n *\n * Every key path is configurable through `IConfig.response` (dot\n * notation supported), so any wrapper shape — `{ items, meta: {...} }`,\n * `{ results, pagination: {...} }` — can be mapped without subclassing.\n * Defaults are encoded in `SieveResponseOptions`. `from`/`to` are\n * computed from `page` × `pageSize` by the inherited traversal\n * algorithm, and the navigation-URL slots resolve to `undefined` unless\n * paths are provided.\n *\n * The dot-notation traversal is inherited from\n * `AbstractDotPathResponseStrategy`; this class exists so\n * `DriverEnum.SIEVE` resolves to a distinct identity at the DI layer.\n *\n * @see https://github.com/Biarity/Sieve\n */\nexport class SieveResponseStrategy extends AbstractDotPathResponseStrategy {}\n","import * as qs from 'qs';\n\nimport { SortEnum } from '../enums/sort.enum';\nimport { UnselectableModelError } from '../errors/unselectable-model.error';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { IStrategyCapabilities } from '../interfaces/strategy-capabilities.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\nimport { AbstractRequestStrategy } from './abstract-request.strategy';\n\n/**\n * Request strategy for the Spatie Query Builder driver\n *\n * Generates URIs in the Spatie format:\n * - Fields: `fields[model]=col1,col2`\n * - Filters: `filter[field]=value`\n * - Includes: `include=model1,model2`\n * - Sorts: `sort=-field1,field2` (- prefix = DESC)\n * - Pagination: `limit=N&page=N`\n *\n * @see https://spatie.be/docs/laravel-query-builder\n */\nexport class SpatieRequestStrategy extends AbstractRequestStrategy {\n\n /**\n * Filters, sorts, includes, per-model fields — no operators, no flat\n * select, no global search\n */\n public readonly capabilities: IStrategyCapabilities = {\n embedded: false,\n fields: true,\n filters: true,\n includes: true,\n operatorFilters: false,\n search: false,\n select: false,\n sort: true\n };\n\n /**\n * Emit Spatie-format query-string segments in canonical order:\n * include → fields → filters → limit → page → sort\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @returns Ordered query-string fragments\n */\n protected parts(state: IQueryBuilderState, options: QueryBuilderOptions): string[] {\n const out: string[] = [];\n\n this._appendIncludes(state, options, out);\n this._appendFields(state, options, out);\n this._appendFilters(state, options, out);\n this._appendLimit(state, options, out);\n this._appendPage(state, options, out);\n this._appendSort(state, options, out);\n\n return out;\n }\n\n /**\n * Append per-model field selection in bracket notation\n *\n * Validates that each field model exists either as the main resource\n * or in the includes list.\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n * @throws Error if the resource is required but not set\n * @throws UnselectableModelError if a field model is not in resource or includes\n */\n private _appendFields(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n if (!Object.keys(state.fields).length) {\n return;\n }\n\n if (!(state.resource in state.fields)) {\n throw new Error(`Key ${state.resource} is missing in the fields object`);\n }\n\n const grouped: Record<string, string> = {};\n\n for (const model in state.fields) {\n if (!state.fields.hasOwnProperty(model)) {\n continue;\n }\n\n if (model !== state.resource && !state.includes.includes(model)) {\n throw new UnselectableModelError(model);\n }\n\n grouped[`${options.fields}[${model}]`] = state.fields[model].join(',');\n }\n\n out.push(qs.stringify(grouped, { encode: false }));\n }\n\n /**\n * Append filter parameters in bracket notation: `filter[key]=value`\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendFilters(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n const keys = Object.keys(state.filters);\n\n if (!keys.length) {\n return;\n }\n\n const wrapper = {\n [options.filters]: keys.reduce((acc: Record<string, string>, key: string) => {\n return Object.assign(acc, { [key]: state.filters[key].join(',') });\n }, {})\n };\n\n out.push(qs.stringify(wrapper, { encode: false }));\n }\n\n /**\n * Append include parameter as `include=model1,model2`\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendIncludes(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n if (!state.includes.length) {\n return;\n }\n\n out.push(`${options.includes}=${state.includes}`);\n }\n\n /**\n * Append the limit parameter\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendLimit(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n out.push(`${options.limit}=${state.limit}`);\n }\n\n /**\n * Append the page parameter\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendPage(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n out.push(`${options.page}=${state.page}`);\n }\n\n /**\n * Append sort parameter as `sort=-field1,field2` (`-` prefix = DESC)\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSort(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n if (!state.sorts.length) {\n return;\n }\n\n const pairs = state.sorts.map(sort =>\n `${sort.order === SortEnum.DESC ? '-' : ''}${sort.field}`\n );\n\n out.push(`${options.sort}=${pairs.join(',')}`);\n }\n}\n","import { AbstractFlatResponseStrategy } from './abstract-flat-response.strategy';\n\n/**\n * Response strategy for the Spatie Query Builder driver\n *\n * Parses flat Laravel-style pagination responses (Spatie's Query Builder\n * is built on Laravel's pagination):\n * ```json\n * {\n * \"data\": [...],\n * \"current_page\": 1,\n * \"total\": 100,\n * \"per_page\": 15,\n * \"from\": 1,\n * \"to\": 15,\n * ...\n * }\n * ```\n *\n * The traversal algorithm (flat `response[options.X]` lookups) is\n * inherited from `AbstractFlatResponseStrategy`; this class exists so\n * `DriverEnum.SPATIE` resolves to a distinct identity at the DI layer\n * even though the parsing logic is shared with the plain Laravel driver.\n *\n * @see https://spatie.be/docs/laravel-query-builder\n */\nexport class SpatieResponseStrategy extends AbstractFlatResponseStrategy {}\n","import { SortEnum } from '../enums/sort.enum';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { IStrategyCapabilities } from '../interfaces/strategy-capabilities.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\nimport { AbstractRequestStrategy } from './abstract-request.strategy';\n\n/**\n * Request strategy for the Spring Data REST driver\n *\n * Generates URIs in [Spring Data REST's pagination format](https://docs.spring.io/spring-data/rest/reference/paging-and-sorting.html):\n * - Sorts: `sort=field,asc&sort=other,desc` (repeatable param, one per rule)\n * - Pagination: `page=N&size=N` — **`page` is 0-indexed on the wire**;\n * the library state stays 1-indexed and the strategy subtracts 1 at\n * emission time\n *\n * Spring Data REST defines no standard query parameter convention for\n * filtering, field selection, includes, or global search — those are\n * implemented server-side via custom query methods or Specifications.\n * The corresponding fluent methods (`addFilter`, `addFilterOperator`,\n * `addSelect`, `addFields`, `addIncludes`, `setSearch`) throw the\n * matching `Unsupported*Error` on this driver.\n *\n * @see https://docs.spring.io/spring-data/rest/reference/paging-and-sorting.html\n */\nexport class SpringRequestStrategy extends AbstractRequestStrategy {\n\n /**\n * Sorts only — Spring Data REST has no standard wire convention for\n * filters, operator filters, per-model fields, flat select, includes,\n * or global search\n */\n public readonly capabilities: IStrategyCapabilities = {\n embedded: false,\n fields: false,\n filters: false,\n includes: false,\n operatorFilters: false,\n search: false,\n select: false,\n sort: true\n };\n\n /**\n * Spring-native name of the hardcoded page-size query key\n *\n * The wire format is fixed (Spring's `PageableHandlerMethodArgumentResolver`\n * reads `size` by default); the key is intentionally not configurable\n * through `QueryBuilderOptions` and lives as a private static so it is\n * visible in one place.\n */\n private static readonly _sizeKey = 'size';\n\n /**\n * Emit Spring-format query-string segments in canonical order:\n * sort → page → size\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration (used\n * for `page` and `sort`, whose defaults match the wire format; the\n * `size` key is fixed by the server)\n * @returns Ordered query-string fragments\n */\n protected parts(state: IQueryBuilderState, options: QueryBuilderOptions): string[] {\n const out: string[] = [];\n\n this._appendSort(state, options, out);\n this._appendPage(state, options, out);\n this._appendSize(state, out);\n\n return out;\n }\n\n /**\n * Append the 0-indexed page parameter\n *\n * The library state is 1-indexed (page 1 is the first page); Spring's\n * `page` request parameter is 0-indexed, so the strategy subtracts 1\n * at emission time.\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendPage(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n out.push(`${options.page}=${state.page - 1}`);\n }\n\n /**\n * Append the size parameter\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSize(state: IQueryBuilderState, out: string[]): void {\n out.push(`${SpringRequestStrategy._sizeKey}=${state.limit}`);\n }\n\n /**\n * Append `sort=field,asc` params, one per sort rule (repeatable)\n *\n * Spring parses each `sort` occurrence independently — multiple rules\n * are expressed by repeating the parameter, not by comma-joining the\n * fields.\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSort(state: IQueryBuilderState, options: QueryBuilderOptions, out: string[]): void {\n state.sorts.forEach(sort => {\n const direction = sort.order === SortEnum.DESC ? 'desc' : 'asc';\n\n out.push(`${options.sort}=${sort.field},${direction}`);\n });\n }\n}\n","import { IPaginatedObject } from '../interfaces/paginated-object.interface';\nimport { PaginatedCollection } from '../models/paginated-collection';\nimport { ResponseOptions } from '../models/response-options';\nimport { AbstractDotPathResponseStrategy } from './abstract-dot-path-response.strategy';\n\n/**\n * Response strategy for the Spring Data REST driver\n *\n * Parses Spring Data REST's HAL envelope:\n * ```json\n * {\n * \"_embedded\": { \"users\": [{ \"id\": 1, \"name\": \"John\" }] },\n * \"_links\": {\n * \"first\": { \"href\": \"...\" },\n * \"prev\": { \"href\": \"...\" },\n * \"next\": { \"href\": \"...\" },\n * \"last\": { \"href\": \"...\" }\n * },\n * \"page\": { \"size\": 20, \"totalElements\": 100, \"totalPages\": 5, \"number\": 1 }\n * }\n * ```\n *\n * Two HAL quirks are absorbed here on top of the inherited dot-path\n * traversal:\n *\n * - **`page.number` is 0-indexed** — the strategy adds 1 so the library\n * state stays 1-indexed (mirroring `SpringRequestStrategy`, which\n * subtracts 1 on the way out).\n * - **The collection key under `_embedded` is the resource rel name**\n * (e.g. `_embedded.users`), which cannot be known statically. The\n * default `data` path is plain `_embedded`; when it resolves to an\n * object rather than an array, the strategy picks the first array\n * value inside it. Consumers with multiple embedded rels can pin the\n * exact path via `IConfig.response` (e.g. `data: '_embedded.users'`).\n *\n * Default key paths are configured in `SpringResponseOptions`.\n *\n * @see https://docs.spring.io/spring-data/rest/reference/paging-and-sorting.html\n */\nexport class SpringResponseStrategy extends AbstractDotPathResponseStrategy {\n\n /**\n * Parse a Spring Data REST HAL response into a PaginatedCollection\n *\n * @param response - The raw API response body\n * @param options - The response key name configuration\n * @returns A typed PaginatedCollection instance\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public override paginate<T extends IPaginatedObject>(response: Record<string, any>, options: ResponseOptions): PaginatedCollection<T> {\n const data = this._resolveData<T>(response, options);\n const currentPage = this._resolveCurrentPage(response, options);\n const total = this.resolve(response, options.total) as number | undefined;\n const perPage = this.resolve(response, options.perPage) as number | undefined;\n const lastPage = this.resolve(response, options.lastPage) as number | undefined;\n\n const from = this.resolveFrom(response, options, currentPage, perPage);\n const to = this.resolveTo(response, options, currentPage, perPage, total);\n\n const prevPageUrl = this.resolve(response, options.prevPageUrl) as string | undefined;\n const nextPageUrl = this.resolve(response, options.nextPageUrl) as string | undefined;\n const firstPageUrl = this.resolve(response, options.firstPageUrl) as string | undefined;\n const lastPageUrl = this.resolve(response, options.lastPageUrl) as string | undefined;\n\n return new PaginatedCollection(\n data,\n currentPage,\n from,\n to,\n total,\n perPage,\n prevPageUrl,\n nextPageUrl,\n lastPage,\n firstPageUrl,\n lastPageUrl\n );\n }\n\n /**\n * Resolve the 1-indexed current page from the 0-indexed `page.number`\n *\n * Falls back to page 1 when the path is missing entirely (defensive —\n * Spring always emits the `page` block on paged endpoints).\n *\n * @param response - The raw response object\n * @param options - The response key name configuration\n * @returns The 1-indexed current page number\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _resolveCurrentPage(response: Record<string, any>, options: ResponseOptions): number {\n const pageNumber = this.resolve(response, options.currentPage) as number | undefined;\n\n return (pageNumber ?? 0) + 1;\n }\n\n /**\n * Resolve the data array from the HAL `_embedded` wrapper\n *\n * When the configured path resolves directly to an array (a consumer\n * pinned `data: '_embedded.users'`), it is used as-is. When it\n * resolves to an object (the default `_embedded` path), the first\n * array value inside it is used — Spring emits exactly one collection\n * rel per listing endpoint. An empty array is returned when nothing\n * matches (e.g. Spring omits `_embedded` on empty result sets).\n *\n * @param response - The raw response object\n * @param options - The response key name configuration\n * @returns The resolved data array (possibly empty)\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _resolveData<T extends IPaginatedObject>(response: Record<string, any>, options: ResponseOptions): T[] {\n const raw = this.resolve(response, options.data);\n\n if (Array.isArray(raw)) {\n return raw as T[];\n }\n\n if (raw && typeof raw === 'object') {\n const firstArray = Object.values(raw).find(value => Array.isArray(value));\n\n if (firstArray) {\n return firstArray as T[];\n }\n }\n\n return [];\n }\n}\n","import * as qs from 'qs';\n\nimport { FilterOperatorEnum } from '../enums/filter-operator.enum';\nimport { SortEnum } from '../enums/sort.enum';\nimport { InvalidFilterOperatorValueError } from '../errors/invalid-filter-operator-value.error';\nimport { UnsupportedFilterOperatorError } from '../errors/unsupported-filter-operator.error';\nimport { IOperatorFilter } from '../interfaces/operator-filter.interface';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { IStrategyCapabilities } from '../interfaces/strategy-capabilities.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\nimport { AbstractRequestStrategy } from './abstract-request.strategy';\n\n/**\n * Right-hand-side payload of a Strapi `filters[field]` entry\n *\n * Each `$operator` key maps to either a primitive (single-value operators\n * like `$eq`, `$gt`) or an array (multi-value operators like `$in`,\n * `$between`). Booleans appear specifically with `$null` / `$notNull`.\n */\ntype StrapiFilterValue = string | number | boolean;\ntype StrapiFilterPayload = Record<string, StrapiFilterValue | StrapiFilterValue[]>;\n\n/**\n * Request strategy for the Strapi driver\n *\n * Generates URIs in [Strapi's filter API format](https://docs.strapi.io/dev-docs/api/rest/filters-locale-publication):\n * - Filters: `filters[field][$eq]=value` (multi-value collapses to `$in`)\n * - Operator filters: `filters[field][$op]=value` (translated from\n * `FilterOperatorEnum` — `BTW`→`$between`, `SW`→`$startsWith`,\n * `ILIKE`→`$containsi`, `NOT`→`$ne`/`$notIn`,\n * `NULL`→`$null`/`$notNull`)\n * - Sorts: `sort[0]=field:asc&sort[1]=field:desc`\n * - Field selection (flat): `fields[0]=col1&fields[1]=col2`\n * - Population: `populate[0]=relation`\n * - Pagination (page-based): `pagination[page]=N&pagination[pageSize]=N`\n *\n * Strapi-native full-text search (`FTS`, `PHFTS`, `PLFTS`, `WFTS`) is\n * PostgREST-only and throws `UnsupportedFilterOperatorError` here.\n *\n * @see https://docs.strapi.io/dev-docs/api/rest/filters-locale-publication\n */\nexport class StrapiRequestStrategy extends AbstractRequestStrategy {\n\n /**\n * Filters, operator filters, sorts, populate (`includes`), flat field\n * selection (`select`) — no per-model fields, no global search (use\n * `$contains` / `$containsi` operator filters instead)\n */\n public readonly capabilities: IStrategyCapabilities = {\n embedded: false,\n fields: false,\n filters: true,\n includes: true,\n operatorFilters: true,\n search: false,\n select: true,\n sort: true\n };\n\n /**\n * Strapi-native names of the four hardcoded query keys\n *\n * Strapi's wire format is fixed (the server reads `pagination[page]`,\n * `populate`, `sort`, `fields`); these keys are intentionally not\n * configurable through `QueryBuilderOptions` and live as private\n * statics so they are visible in one place.\n */\n private static readonly _fieldsKey = 'fields';\n private static readonly _paginationKey = 'pagination';\n private static readonly _populateKey = 'populate';\n private static readonly _sortKey = 'sort';\n\n /**\n * Emit Strapi-format query-string segments in canonical order:\n * populate → fields → filters (merged) → sort → pagination\n *\n * Simple filters and operator filters share a single `filters` wrapper\n * so qs emits one ordered, deeply-nested bracket structure rather than\n * two duplicate top-level `filters[...]` blocks.\n *\n * @param state - The current query builder state\n * @param _options - The query parameter key name configuration (unused;\n * Strapi's wire keys are fixed by the server)\n * @returns Ordered query-string fragments\n */\n protected parts(state: IQueryBuilderState, _options: QueryBuilderOptions): string[] {\n const out: string[] = [];\n\n this._appendPopulate(state, out);\n this._appendFields(state, out);\n this._appendFilters(state, out);\n this._appendSort(state, out);\n this._appendPagination(state, out);\n\n return out;\n }\n\n /**\n * Append `fields[0]=col1&fields[1]=col2` from the flat select array\n *\n * Strapi's `fields` parameter is the column-pruner for the main\n * resource; per-relation field selection is expressed through the\n * `populate` deep syntax (out of scope for this driver).\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendFields(state: IQueryBuilderState, out: string[]): void {\n if (!state.select.length) {\n return;\n }\n\n out.push(qs.stringify({ [StrapiRequestStrategy._fieldsKey]: state.select }, { encode: false }));\n }\n\n /**\n * Append the unified `filters[...]` wrapper combining simple filters\n * and operator filters\n *\n * Both kinds emit into the same nested object under `filters` so qs\n * produces a single deeply-bracketed block per request. Simple\n * single-value filters fold to `$eq`; simple multi-value filters fold\n * to `$in`. Operator filters then merge into the same per-field map,\n * potentially co-existing with a simple filter on the same field.\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendFilters(state: IQueryBuilderState, out: string[]): void {\n const simpleKeys = Object.keys(state.filters);\n\n if (!simpleKeys.length && !state.operatorFilters.length) {\n return;\n }\n\n const filters: Record<string, StrapiFilterPayload> = {};\n\n simpleKeys.forEach(key => {\n const values = state.filters[key];\n\n if (!values.length) {\n return;\n }\n\n filters[key] = values.length === 1\n ? { $eq: values[0] }\n : { $in: values };\n });\n\n state.operatorFilters.forEach((filter: IOperatorFilter) => {\n const payload = this._formatOperatorPayload(filter);\n\n filters[filter.field] = {\n ...(filters[filter.field] ?? {}),\n ...payload\n };\n });\n\n if (!Object.keys(filters).length) {\n return;\n }\n\n out.push(qs.stringify({ filters }, { encode: false }));\n }\n\n /**\n * Append the `pagination[page]` / `pagination[pageSize]` wrapper\n *\n * Page-based mode is the Strapi default; offset-based\n * (`pagination[start]` / `pagination[limit]`) is out of scope for this\n * driver until cursor/offset pagination lands library-wide.\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendPagination(state: IQueryBuilderState, out: string[]): void {\n const wrapper = {\n [StrapiRequestStrategy._paginationKey]: {\n page: state.page,\n pageSize: state.limit\n }\n };\n\n out.push(qs.stringify(wrapper, { encode: false }));\n }\n\n /**\n * Append the `populate` parameter from the includes array\n *\n * Emits `populate[0]=relation1&populate[1]=relation2`; deep-populate\n * syntax (`populate[author][fields][0]=name`) is not exposed through\n * the current state shape.\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendPopulate(state: IQueryBuilderState, out: string[]): void {\n if (!state.includes.length) {\n return;\n }\n\n out.push(qs.stringify({ [StrapiRequestStrategy._populateKey]: state.includes }, { encode: false }));\n }\n\n /**\n * Append the `sort[N]=field:dir` array\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSort(state: IQueryBuilderState, out: string[]): void {\n if (!state.sorts.length) {\n return;\n }\n\n const pairs = state.sorts.map(sort =>\n `${sort.field}:${sort.order === SortEnum.DESC ? 'desc' : 'asc'}`\n );\n\n out.push(qs.stringify({ [StrapiRequestStrategy._sortKey]: pairs }, { encode: false }));\n }\n\n /**\n * Translate a `FilterOperatorEnum` operator filter into Strapi's\n * `$operator → value` payload shape\n *\n * The mapping is library-canonical → Strapi-native:\n * - `EQ`/`GT`/`GTE`/`LT`/`LTE`/`CONTAINS` → identity (same key name)\n * - `ILIKE` → `$containsi` (case-insensitive contains)\n * - `IN` → `$in` (array)\n * - `SW` → `$startsWith`\n * - `BTW` → `$between` with `[min, max]` (arity-checked)\n * - `NOT` → `$ne` (single value) / `$notIn` (multi-value)\n * - `NULL` → `$null=true` (when value is `true`) / `$notNull=true`\n * (when value is `false`); arity- and type-checked\n *\n * PostgREST's full-text-search operators (`FTS`, `PHFTS`, `PLFTS`,\n * `WFTS`) have no Strapi equivalent and throw\n * `UnsupportedFilterOperatorError`.\n *\n * @param filter - The operator filter to translate\n * @returns A `{ $operator: value }` payload ready to merge under\n * `filters[field]`\n * @throws {InvalidFilterOperatorValueError} If `BTW` does not receive\n * exactly two values, or `NULL` does not receive exactly one boolean\n * @throws {UnsupportedFilterOperatorError} If the operator is a\n * PostgREST-only FTS variant\n */\n private _formatOperatorPayload(filter: IOperatorFilter): StrapiFilterPayload {\n const { operator, values } = filter;\n const first = values[0];\n\n switch (operator) {\n case FilterOperatorEnum.EQ: return { $eq: first };\n case FilterOperatorEnum.GT: return { $gt: first };\n case FilterOperatorEnum.GTE: return { $gte: first };\n case FilterOperatorEnum.LT: return { $lt: first };\n case FilterOperatorEnum.LTE: return { $lte: first };\n case FilterOperatorEnum.CONTAINS: return { $contains: first };\n case FilterOperatorEnum.ILIKE: return { $containsi: first };\n case FilterOperatorEnum.IN: return { $in: values };\n case FilterOperatorEnum.SW: return { $startsWith: first };\n\n case FilterOperatorEnum.BTW: {\n if (values.length !== 2) {\n throw new InvalidFilterOperatorValueError(\n operator,\n 'BTW requires exactly 2 values (min, max)'\n );\n }\n\n return { $between: values };\n }\n\n case FilterOperatorEnum.NOT:\n return values.length === 1\n ? { $ne: first }\n : { $notIn: values };\n\n case FilterOperatorEnum.NULL: {\n if (values.length !== 1 || typeof first !== 'boolean') {\n throw new InvalidFilterOperatorValueError(\n operator,\n 'NULL requires exactly 1 boolean value (true → IS NULL, false → IS NOT NULL)'\n );\n }\n\n return first ? { $null: true } : { $notNull: true };\n }\n\n case FilterOperatorEnum.FTS:\n case FilterOperatorEnum.PHFTS:\n case FilterOperatorEnum.PLFTS:\n case FilterOperatorEnum.WFTS:\n throw new UnsupportedFilterOperatorError();\n }\n }\n}\n","import { AbstractDotPathResponseStrategy } from './abstract-dot-path-response.strategy';\n\n/**\n * Response strategy for the Strapi driver\n *\n * Parses Strapi v4/v5 pagination responses:\n * ```json\n * {\n * \"data\": [{ \"id\": 1, \"documentId\": \"abc\", \"title\": \"Hello\" }],\n * \"meta\": {\n * \"pagination\": {\n * \"page\": 1,\n * \"pageSize\": 10,\n * \"pageCount\": 5,\n * \"total\": 48\n * }\n * }\n * }\n * ```\n *\n * Default key paths are configured in `StrapiResponseOptions`. Strapi\n * does not include navigation links in the envelope, so `firstPageUrl`,\n * `prevPageUrl`, `nextPageUrl`, and `lastPageUrl` resolve to `undefined`\n * unless the consumer overrides their paths via `IPaginationConfig`. The\n * traversal algorithm (dot-notation resolution + computed `from`/`to`)\n * is inherited from `AbstractDotPathResponseStrategy`; this class exists\n * so `DriverEnum.STRAPI` resolves to a distinct identity at the DI\n * layer even though the parsing logic is shared with JSON:API and\n * NestJS.\n *\n * @see https://docs.strapi.io/dev-docs/api/rest/sort-pagination\n */\nexport class StrapiResponseStrategy extends AbstractDotPathResponseStrategy {}\n","import { SortEnum } from '../enums/sort.enum';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { IStrategyCapabilities } from '../interfaces/strategy-capabilities.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\nimport { AbstractRequestStrategy } from './abstract-request.strategy';\n\n/**\n * Request strategy for the WordPress REST API driver\n *\n * Generates URIs in the [WordPress REST API collection format](https://developer.wordpress.org/rest-api/using-the-rest-api/pagination/):\n * - Filters: `field=value` (collection parameters like `status`,\n * `author`, `categories`); multi-value folds to a CSV (`field=v1,v2`,\n * the list convention WordPress uses for ID params)\n * - Sorts: `orderby=field&order=asc|desc` — WordPress core supports a\n * **single** orderby, so only the first sort rule is emitted\n * - Field selection (flat): `_fields=id,title` (CSV)\n * - Relation embedding: `_embed=author,wp:term` (CSV)\n * - Search: `search=term`\n * - Pagination (page-based): `page=N&per_page=M`\n *\n * The `page` / `per_page` / `orderby` / `order` / `search` and the\n * underscore-prefixed global params (`_fields`, `_embed`) are fixed by\n * the server and intentionally not configurable through\n * `QueryBuilderOptions`; they live as private statics so they are\n * visible in one place.\n *\n * WordPress caps `per_page` at **100** server-side (a 400\n * `rest_invalid_param` response beyond that); the cap is endpoint\n * policy rather than a syntax rule, so `validateLimit` keeps the\n * default positive-integer check and the server stays authoritative.\n * There is no generic comparison-operator syntax (only\n * parameter-specific helpers like `before`/`after` for dates, which\n * pass through `addFilter`), so `addFilterOperator` throws\n * `UnsupportedFilterOperatorError` via the capability gate.\n *\n * @see https://developer.wordpress.org/rest-api/reference/posts/#list-posts\n */\nexport class WordpressRequestStrategy extends AbstractRequestStrategy {\n\n /**\n * Filters, sorts, global search, flat field selection (`select`),\n * embedding (`includes`) — no operator filters, no per-model fields,\n * no embedded-column projection\n */\n public readonly capabilities: IStrategyCapabilities = {\n embedded: false,\n fields: false,\n filters: true,\n includes: true,\n operatorFilters: false,\n search: true,\n select: true,\n sort: true\n };\n\n /**\n * WordPress-native names of the seven hardcoded query keys\n *\n * The underscore prefix marks the REST API's global params apart\n * from collection filters; all keys are fixed by the server and\n * intentionally not configurable through `QueryBuilderOptions`.\n */\n private static readonly _embedKey = '_embed';\n private static readonly _fieldsKey = '_fields';\n private static readonly _orderbyKey = 'orderby';\n private static readonly _orderKey = 'order';\n private static readonly _pageKey = 'page';\n private static readonly _perPageKey = 'per_page';\n private static readonly _searchKey = 'search';\n\n /**\n * Emit WordPress-format query-string segments in canonical order:\n * filters → orderby/order → _fields → _embed → search → page → per_page\n *\n * @param state - The current query builder state\n * @param _options - The query parameter key name configuration (unused;\n * WordPress' wire keys are fixed by the server)\n * @returns Ordered query-string fragments\n */\n protected parts(state: IQueryBuilderState, _options: QueryBuilderOptions): string[] {\n const out: string[] = [];\n\n this._appendFilters(state, out);\n this._appendSort(state, out);\n this._appendFields(state, out);\n this._appendEmbed(state, out);\n this._appendSearch(state, out);\n this._appendPagination(state, out);\n\n return out;\n }\n\n /**\n * Append the `_embed=` CSV from the includes array\n *\n * A bare `_embed` (no value) embeds everything; this driver always\n * emits the named form so the response stays lean.\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendEmbed(state: IQueryBuilderState, out: string[]): void {\n if (!state.includes.length) {\n return;\n }\n\n out.push(`${WordpressRequestStrategy._embedKey}=${state.includes.join(',')}`);\n }\n\n /**\n * Append the `_fields=` CSV from the flat select array\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendFields(state: IQueryBuilderState, out: string[]): void {\n if (!state.select.length) {\n return;\n }\n\n out.push(`${WordpressRequestStrategy._fieldsKey}=${state.select.join(',')}`);\n }\n\n /**\n * Append simple filter parameters\n *\n * A single value emits the bare form (`status=publish`); multiple\n * values fold to the CSV list convention (`categories=2,3`).\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendFilters(state: IQueryBuilderState, out: string[]): void {\n Object.keys(state.filters).forEach(field => {\n const values = state.filters[field];\n\n if (!values.length) {\n return;\n }\n\n out.push(`${field}=${values.join(',')}`);\n });\n }\n\n /**\n * Append the `page=` / `per_page=` pagination pair\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendPagination(state: IQueryBuilderState, out: string[]): void {\n out.push(`${WordpressRequestStrategy._pageKey}=${state.page}`);\n out.push(`${WordpressRequestStrategy._perPageKey}=${state.limit}`);\n }\n\n /**\n * Append the `search=` parameter\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSearch(state: IQueryBuilderState, out: string[]): void {\n if (!state.search) {\n return;\n }\n\n out.push(`${WordpressRequestStrategy._searchKey}=${state.search}`);\n }\n\n /**\n * Append the `orderby=` / `order=` pair from the first sort rule\n *\n * WordPress core accepts a single `orderby` value — additional sort\n * rules in state are ignored by design (the server would reject a\n * CSV here).\n *\n * @param state - The current query builder state\n * @param out - The accumulator the caller joins into the URI\n */\n private _appendSort(state: IQueryBuilderState, out: string[]): void {\n if (!state.sorts.length) {\n return;\n }\n\n const [first] = state.sorts;\n\n out.push(`${WordpressRequestStrategy._orderbyKey}=${first.field}`);\n out.push(`${WordpressRequestStrategy._orderKey}=${first.order === SortEnum.DESC ? 'desc' : 'asc'}`);\n }\n}\n","import { HeaderBag, readHeader } from '../interfaces/header-bag.interface';\nimport { IPaginatedObject } from '../interfaces/paginated-object.interface';\nimport { IResponseStrategy } from '../interfaces/response-strategy.interface';\nimport { PaginatedCollection } from '../models/paginated-collection';\nimport { ResponseOptions } from '../models/response-options';\n\n/**\n * Internal shape holding the navigation URLs parsed out of a `Link`\n * header. Both are optional: page 1 has no `prev`, the last page has no\n * `next`, and a single-page result has neither.\n */\ninterface ILinkRelations {\n next?: string;\n prev?: string;\n}\n\n/**\n * Response strategy for the WordPress REST API driver\n *\n * WordPress returns a bare array body for collection endpoints.\n * Pagination metadata travels in HTTP response headers:\n *\n * - `X-WP-Total` — total number of records in the collection\n * - `X-WP-TotalPages` — total number of pages at the requested\n * `per_page`\n * - `Link` — RFC 5988 navigation links (`rel=\"next\"` / `rel=\"prev\"`)\n *\n * The strategy surfaces the `Link` URLs as `nextPageUrl` /\n * `prevPageUrl` and derives position from them:\n *\n * - `currentPage` is the `prev` link's `page` param + 1 (no `prev` →\n * page **1**), falling back to the `next` link's `page` param − 1.\n * - `perPage` is the item count of the current page whenever a `next`\n * link exists (a page with a successor is necessarily full); on the\n * last page of a multi-page set it is not introspectable and stays\n * `undefined`.\n * - `from`/`to` derive from `currentPage` × `perPage` on full pages,\n * or count back from the total on the last page\n * (`from = total - data.length + 1`, `to = total`).\n *\n * This strategy expects the consumer to pass the array body as\n * `response` (or a plain object with `response[options.data]` pointing\n * at the array) and the response headers via the optional `headers`\n * bag — the same call-site shape as the PostgREST driver. Omitted\n * headers are tolerated and yield a collection with `undefined`\n * bounds.\n *\n * @see https://developer.wordpress.org/rest-api/using-the-rest-api/pagination/\n */\nexport class WordpressResponseStrategy implements IResponseStrategy {\n\n private static readonly _linkHeader = 'Link';\n private static readonly _linkRegex = /<([^>]+)>\\s*;\\s*rel=\"(next|prev)\"/g;\n private static readonly _pageParamRegex = /[?&]page=(\\d+)/;\n private static readonly _totalHeader = 'X-WP-Total';\n private static readonly _totalPagesHeader = 'X-WP-TotalPages';\n\n /**\n * Parse a WordPress REST response into a typed PaginatedCollection\n *\n * @param response - The raw response. Either the array body directly, or\n * an object with the array at `response[options.data]`.\n * @param options - The response key configuration (only `options.data` is\n * consulted; all pagination metadata comes from headers).\n * @param headers - Optional HTTP response headers. `X-WP-Total` /\n * `X-WP-TotalPages` drive the totals and the `Link` header drives\n * navigation and page derivation; omission is tolerated.\n * @returns A typed PaginatedCollection instance\n */\n public paginate<T extends IPaginatedObject>(\n response: Record<string, unknown>,\n options: ResponseOptions,\n headers?: HeaderBag\n ): PaginatedCollection<T> {\n // Body may be a bare array or an envelope with the array at options.data\n const data = (Array.isArray(response) ? response : response[options.data]) as T[];\n\n // Header-driven pagination metadata\n const total = this._parseCount(readHeader(headers, WordpressResponseStrategy._totalHeader));\n const lastPage = this._parseCount(readHeader(headers, WordpressResponseStrategy._totalPagesHeader));\n const { next, prev } = this._parseLinkHeader(readHeader(headers, WordpressResponseStrategy._linkHeader));\n\n const currentPage = this._deriveCurrentPage(next, prev);\n const perPage = next !== undefined ? (data?.length || undefined) : undefined;\n\n const from = this._deriveFrom(data, currentPage, next, perPage, total);\n const to = this._deriveTo(data, currentPage, next, perPage, total);\n\n return new PaginatedCollection(\n data,\n currentPage,\n from,\n to,\n total,\n perPage,\n prev,\n next,\n lastPage,\n undefined,\n undefined\n );\n }\n\n /**\n * Derive the current page from the Link relations\n *\n * The `prev` URL's `page` param + 1 is authoritative; without a\n * `prev` the page is 1 unless a `next` URL contradicts it (its page\n * param − 1). A missing/unparseable Link header yields page 1.\n *\n * @param next - The `rel=\"next\"` URL, if present\n * @param prev - The `rel=\"prev\"` URL, if present\n * @returns The 1-indexed current page\n */\n private _deriveCurrentPage(next?: string, prev?: string): number {\n const prevPage = this._pageParam(prev);\n\n if (prevPage !== undefined) {\n return prevPage + 1;\n }\n\n const nextPage = this._pageParam(next);\n\n if (nextPage !== undefined) {\n return Math.max(nextPage - 1, 1);\n }\n\n return 1;\n }\n\n /**\n * Derive `from` as the 1-indexed offset of the first item on this page\n *\n * Computed from `currentPage` × `perPage` on full pages; on the last\n * page (no `next` link) it counts back from the total\n * (`total - items + 1`), which also covers single-page responses.\n *\n * @param data - The items on the current page\n * @param currentPage - The current page number\n * @param next - The `rel=\"next\"` URL, if present\n * @param perPage - The page size (may be undefined)\n * @param total - The total item count (may be undefined)\n * @returns The 1-indexed `from` index, or undefined when inputs insufficient\n */\n private _deriveFrom(data: unknown[] | undefined, currentPage: number, next?: string, perPage?: number, total?: number): number | undefined {\n if (perPage) {\n return (currentPage - 1) * perPage + 1;\n }\n\n if (next === undefined && total !== undefined && data?.length) {\n return total - data.length + 1;\n }\n\n return undefined;\n }\n\n /**\n * Derive `to` as the 1-indexed offset of the last item on this page\n *\n * Clamped to `total` so the last page does not report past the end;\n * on the last page (no `next` link) it is simply the total.\n *\n * @param data - The items on the current page\n * @param currentPage - The current page number\n * @param next - The `rel=\"next\"` URL, if present\n * @param perPage - The page size (may be undefined)\n * @param total - The total item count (may be undefined)\n * @returns The 1-indexed `to` index, or undefined when inputs insufficient\n */\n private _deriveTo(data: unknown[] | undefined, currentPage: number, next?: string, perPage?: number, total?: number): number | undefined {\n if (perPage !== undefined && total !== undefined) {\n return Math.min(currentPage * perPage, total);\n }\n\n if (next === undefined && total !== undefined && data?.length) {\n return total;\n }\n\n return undefined;\n }\n\n /**\n * Extract the `page` query param from a navigation URL\n *\n * @param url - The URL to inspect (possibly undefined)\n * @returns The parsed page number, or undefined\n */\n private _pageParam(url?: string): number | undefined {\n if (!url) {\n return undefined;\n }\n\n const match = url.match(WordpressResponseStrategy._pageParamRegex);\n\n return match ? parseInt(match[1], 10) : undefined;\n }\n\n /**\n * Parse a non-negative integer count header value\n *\n * @param value - Raw header value (possibly null/undefined)\n * @returns The parsed count, or undefined when absent or unparseable\n */\n private _parseCount(value: string | null | undefined): number | undefined {\n if (!value) {\n return undefined;\n }\n\n const parsed = parseInt(value.trim(), 10);\n\n return Number.isNaN(parsed) ? undefined : parsed;\n }\n\n /**\n * Extract the `rel=\"next\"` / `rel=\"prev\"` URLs from an RFC 5988\n * `Link` header value\n *\n * Tolerates any ordering, extra relations (`rel=\"collection\"` etc.\n * are ignored), and a missing header.\n *\n * @param value - Raw header value (possibly null/undefined)\n * @returns The navigation URLs found, keyed by relation\n */\n private _parseLinkHeader(value: string | null | undefined): ILinkRelations {\n if (!value) {\n return {};\n }\n\n const relations: ILinkRelations = {};\n const regex = new RegExp(WordpressResponseStrategy._linkRegex.source, 'g');\n let match: RegExpExecArray | null;\n\n while ((match = regex.exec(value)) !== null) {\n relations[match[2] as keyof ILinkRelations] = match[1];\n }\n\n return relations;\n }\n}\n","import { DriverEnum } from '../enums/driver.enum';\nimport { PaginationModeEnum } from '../enums/pagination-mode.enum';\nimport { IPaginationConfig } from '../interfaces/pagination-config.interface';\nimport { IRequestStrategy } from '../interfaces/request-strategy.interface';\nimport { IResponseStrategy } from '../interfaces/response-strategy.interface';\nimport { ApiPlatformResponseOptions, DirectusResponseOptions, DrfResponseOptions, FeathersResponseOptions, JsonApiResponseOptions, JsonServerResponseOptions, NestjsResponseOptions, NestjsxCrudResponseOptions, OdataResponseOptions, PayloadResponseOptions, PocketbaseResponseOptions, ResponseOptions, SieveResponseOptions, SpringResponseOptions, StrapiResponseOptions } from '../models/response-options';\nimport { ApiPlatformRequestStrategy } from '../strategies/api-platform-request.strategy';\nimport { ApiPlatformResponseStrategy } from '../strategies/api-platform-response.strategy';\nimport { DirectusRequestStrategy } from '../strategies/directus-request.strategy';\nimport { DirectusResponseStrategy } from '../strategies/directus-response.strategy';\nimport { DrfRequestStrategy } from '../strategies/drf-request.strategy';\nimport { DrfResponseStrategy } from '../strategies/drf-response.strategy';\nimport { FeathersRequestStrategy } from '../strategies/feathers-request.strategy';\nimport { FeathersResponseStrategy } from '../strategies/feathers-response.strategy';\nimport { JsonApiRequestStrategy } from '../strategies/json-api-request.strategy';\nimport { JsonApiResponseStrategy } from '../strategies/json-api-response.strategy';\nimport { JsonServerRequestStrategy } from '../strategies/json-server-request.strategy';\nimport { JsonServerResponseStrategy } from '../strategies/json-server-response.strategy';\nimport { LaravelRequestStrategy } from '../strategies/laravel-request.strategy';\nimport { LaravelResponseStrategy } from '../strategies/laravel-response.strategy';\nimport { NestjsRequestStrategy } from '../strategies/nestjs-request.strategy';\nimport { NestjsResponseStrategy } from '../strategies/nestjs-response.strategy';\nimport { NestjsxCrudRequestStrategy } from '../strategies/nestjsx-crud-request.strategy';\nimport { NestjsxCrudResponseStrategy } from '../strategies/nestjsx-crud-response.strategy';\nimport { OdataRequestStrategy } from '../strategies/odata-request.strategy';\nimport { OdataResponseStrategy } from '../strategies/odata-response.strategy';\nimport { PayloadRequestStrategy } from '../strategies/payload-request.strategy';\nimport { PayloadResponseStrategy } from '../strategies/payload-response.strategy';\nimport { PocketbaseRequestStrategy } from '../strategies/pocketbase-request.strategy';\nimport { PocketbaseResponseStrategy } from '../strategies/pocketbase-response.strategy';\nimport { PostgrestRequestStrategy } from '../strategies/postgrest-request.strategy';\nimport { PostgrestResponseStrategy } from '../strategies/postgrest-response.strategy';\nimport { SieveRequestStrategy } from '../strategies/sieve-request.strategy';\nimport { SieveResponseStrategy } from '../strategies/sieve-response.strategy';\nimport { SpatieRequestStrategy } from '../strategies/spatie-request.strategy';\nimport { SpatieResponseStrategy } from '../strategies/spatie-response.strategy';\nimport { SpringRequestStrategy } from '../strategies/spring-request.strategy';\nimport { SpringResponseStrategy } from '../strategies/spring-response.strategy';\nimport { StrapiRequestStrategy } from '../strategies/strapi-request.strategy';\nimport { StrapiResponseStrategy } from '../strategies/strapi-response.strategy';\nimport { WordpressRequestStrategy } from '../strategies/wordpress-request.strategy';\nimport { WordpressResponseStrategy } from '../strategies/wordpress-response.strategy';\n\n/**\n * Per-driver factory bundle\n *\n * Names the four pieces a driver contributes — request strategy, response\n * strategy, response-options subclass — so adding a driver is one entry\n * in `DRIVERS` instead of three parallel `switch` cases in the provider\n * builder.\n */\nexport interface IDriverDefinition {\n\n /**\n * Build the request strategy for this driver\n *\n * Receives the configured `PaginationModeEnum`; only PostgREST\n * actually consults it today (RANGE-header mode), other drivers\n * ignore the argument.\n *\n * @param paginationMode - Wire-level pagination mechanism\n * @returns A fresh request strategy instance\n */\n createRequestStrategy(paginationMode: PaginationModeEnum): IRequestStrategy;\n\n /**\n * Build the response strategy for this driver\n *\n * @returns A fresh response strategy instance\n */\n createResponseStrategy(): IResponseStrategy;\n\n /**\n * Build the driver-specific `ResponseOptions` instance\n *\n * Honours user-supplied key-path overrides via `IPaginationConfig`.\n *\n * @param config - User-supplied response key overrides\n * @returns A `ResponseOptions` (or subclass) carrying the resolved defaults\n */\n createResponseOptions(config: IPaginationConfig): ResponseOptions;\n}\n\n/**\n * Driver registry — single source of truth for what each `DriverEnum`\n * value resolves to\n *\n * `Record<DriverEnum, IDriverDefinition>` gives compile-time\n * exhaustiveness: adding a new value to `DriverEnum` fails to compile\n * until its definition is added here. `provideNgQubee` looks up the\n * definition by driver and calls the three factories — no more parallel\n * `switch` blocks.\n */\nexport const DRIVERS: Record<DriverEnum, IDriverDefinition> = {\n [DriverEnum.API_PLATFORM]: {\n createRequestStrategy: () => new ApiPlatformRequestStrategy(),\n createResponseStrategy: () => new ApiPlatformResponseStrategy(),\n createResponseOptions: (config) => new ApiPlatformResponseOptions(config)\n },\n\n [DriverEnum.DIRECTUS]: {\n createRequestStrategy: () => new DirectusRequestStrategy(),\n createResponseStrategy: () => new DirectusResponseStrategy(),\n createResponseOptions: (config) => new DirectusResponseOptions(config)\n },\n\n [DriverEnum.DRF]: {\n createRequestStrategy: () => new DrfRequestStrategy(),\n createResponseStrategy: () => new DrfResponseStrategy(),\n createResponseOptions: (config) => new DrfResponseOptions(config)\n },\n\n [DriverEnum.FEATHERS]: {\n createRequestStrategy: () => new FeathersRequestStrategy(),\n createResponseStrategy: () => new FeathersResponseStrategy(),\n createResponseOptions: (config) => new FeathersResponseOptions(config)\n },\n\n [DriverEnum.JSON_API]: {\n createRequestStrategy: () => new JsonApiRequestStrategy(),\n createResponseStrategy: () => new JsonApiResponseStrategy(),\n createResponseOptions: (config) => new JsonApiResponseOptions(config)\n },\n\n [DriverEnum.JSON_SERVER]: {\n createRequestStrategy: () => new JsonServerRequestStrategy(),\n createResponseStrategy: () => new JsonServerResponseStrategy(),\n createResponseOptions: (config) => new JsonServerResponseOptions(config)\n },\n\n [DriverEnum.LARAVEL]: {\n createRequestStrategy: () => new LaravelRequestStrategy(),\n createResponseStrategy: () => new LaravelResponseStrategy(),\n createResponseOptions: (config) => new ResponseOptions(config)\n },\n\n [DriverEnum.NESTJS]: {\n createRequestStrategy: () => new NestjsRequestStrategy(),\n createResponseStrategy: () => new NestjsResponseStrategy(),\n createResponseOptions: (config) => new NestjsResponseOptions(config)\n },\n\n [DriverEnum.NESTJSX_CRUD]: {\n createRequestStrategy: () => new NestjsxCrudRequestStrategy(),\n createResponseStrategy: () => new NestjsxCrudResponseStrategy(),\n createResponseOptions: (config) => new NestjsxCrudResponseOptions(config)\n },\n\n [DriverEnum.ODATA]: {\n createRequestStrategy: () => new OdataRequestStrategy(),\n createResponseStrategy: () => new OdataResponseStrategy(),\n createResponseOptions: (config) => new OdataResponseOptions(config)\n },\n\n [DriverEnum.PAYLOAD]: {\n createRequestStrategy: () => new PayloadRequestStrategy(),\n createResponseStrategy: () => new PayloadResponseStrategy(),\n createResponseOptions: (config) => new PayloadResponseOptions(config)\n },\n\n [DriverEnum.POCKETBASE]: {\n createRequestStrategy: () => new PocketbaseRequestStrategy(),\n createResponseStrategy: () => new PocketbaseResponseStrategy(),\n createResponseOptions: (config) => new PocketbaseResponseOptions(config)\n },\n\n [DriverEnum.POSTGREST]: {\n createRequestStrategy: (mode) => new PostgrestRequestStrategy(mode),\n createResponseStrategy: () => new PostgrestResponseStrategy(),\n createResponseOptions: (config) => new ResponseOptions(config)\n },\n\n [DriverEnum.SIEVE]: {\n createRequestStrategy: () => new SieveRequestStrategy(),\n createResponseStrategy: () => new SieveResponseStrategy(),\n createResponseOptions: (config) => new SieveResponseOptions(config)\n },\n\n [DriverEnum.SPATIE]: {\n createRequestStrategy: () => new SpatieRequestStrategy(),\n createResponseStrategy: () => new SpatieResponseStrategy(),\n createResponseOptions: (config) => new ResponseOptions(config)\n },\n\n [DriverEnum.SPRING]: {\n createRequestStrategy: () => new SpringRequestStrategy(),\n createResponseStrategy: () => new SpringResponseStrategy(),\n createResponseOptions: (config) => new SpringResponseOptions(config)\n },\n\n [DriverEnum.STRAPI]: {\n createRequestStrategy: () => new StrapiRequestStrategy(),\n createResponseStrategy: () => new StrapiResponseStrategy(),\n createResponseOptions: (config) => new StrapiResponseOptions(config)\n },\n\n [DriverEnum.WORDPRESS]: {\n createRequestStrategy: () => new WordpressRequestStrategy(),\n createResponseStrategy: () => new WordpressResponseStrategy(),\n createResponseOptions: (config) => new ResponseOptions(config)\n }\n};\n","/**\n * Error thrown when an invalid resource name is provided\n *\n * Resource name must be a non-empty string.\n */\nexport class InvalidResourceNameError extends Error {\n constructor(resource: string | null | undefined) {\n super(\n `Invalid resource name: Resource name must be a non-empty string. Received: ${JSON.stringify(resource)}`\n );\n this.name = 'InvalidResourceNameError';\n }\n}\n","export class InvalidPageNumberError extends Error {\n constructor(page: number) {\n super(\n `Invalid page number: Page must be a positive integer greater than 0. Received: ${page}`\n );\n this.name = 'InvalidPageNumberError';\n }\n}\n","import { Injectable, Signal, WritableSignal, computed, signal } from '@angular/core';\n\nimport { InvalidResourceNameError } from '../errors/invalid-resource-name.error';\nimport { InvalidPageNumberError } from '../errors/invalid-page-number.error';\nimport { IFields } from '../interfaces/fields.interface';\nimport { IFilters } from '../interfaces/filters.interface';\nimport { IOperatorFilter } from '../interfaces/operator-filter.interface';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { ISort } from '../interfaces/sort.interface';\nimport { Embedded } from '../types/embedded.type';\n\nconst INITIAL_STATE: IQueryBuilderState = {\n baseUrl: '',\n embedded: {},\n fields: {},\n filters: {},\n includes: [],\n isLastPageKnown: false,\n lastPage: 1,\n limit: 15,\n operatorFilters: [],\n page: 1,\n resource: '',\n search: '',\n select: [],\n sorts: []\n};\n\n@Injectable()\nexport class NestService {\n\n /**\n * Private writable signal that holds the Query Builder state\n *\n * @type {IQueryBuilderState}\n */\n private _nest: WritableSignal<IQueryBuilderState> = signal(this._clone(INITIAL_STATE));\n\n /**\n * A computed signal that makes readonly the writable signal _nest\n *\n * @type {Signal<IQueryBuilderState>}\n */\n public nest: Signal<IQueryBuilderState> = computed(() => this._clone(this._nest()));\n\n constructor() {\n // Nothing to see here\n }\n\n /**\n * Set the base URL for the API\n *\n * @param {string} baseUrl - The base URL to prepend to generated URIs\n * @example\n * service.baseUrl = 'https://api.example.com';\n */\n set baseUrl(baseUrl: string) {\n this._nest.update(nest => ({\n ...nest,\n baseUrl\n }));\n }\n\n /**\n * Set the limit for paginated results\n *\n * This setter performs a raw state write. Validation of the value is the\n * responsibility of the active request strategy and is enforced upstream\n * by `NgQubeeService.setLimit()`, because the accepted range depends on\n * the driver (e.g. nestjs-paginate accepts `-1` for \"fetch all\").\n *\n * @param {number} limit - The number of items per page\n * @example\n * service.limit = 25;\n */\n set limit(limit: number) {\n this._nest.update(nest => ({\n ...nest,\n limit\n }));\n }\n\n /**\n * Set the page number for pagination\n * Must be a positive integer greater than 0\n *\n * @param {number} page - The page number to fetch\n * @throws {InvalidPageNumberError} If page is not a positive integer\n * @example\n * service.page = 2;\n */\n set page(page: number) {\n this._validatePageNumber(page);\n this._nest.update(nest => ({\n ...nest,\n page\n }));\n }\n\n /**\n * Set the resource name for the query\n * Must be a non-empty string\n *\n * @param {string} resource - The API resource name (e.g., 'users', 'posts')\n * @throws {InvalidResourceNameError} If resource is not a non-empty string\n * @example\n * service.resource = 'users';\n */\n set resource(resource: string) {\n this._validateResourceName(resource);\n this._nest.update(nest => ({\n ...nest,\n resource\n }));\n }\n\n private _clone<T>(obj: T): T {\n return JSON.parse( JSON.stringify(obj) );\n }\n\n /**\n * Validates that the page number is a positive integer\n *\n * @param {number} page - The page number to validate\n * @throws {InvalidPageNumberError} If page is not a positive integer\n * @private\n */\n private _validatePageNumber(page: number): void {\n if (!Number.isInteger(page) || page < 1) {\n throw new InvalidPageNumberError(page);\n }\n }\n\n /**\n * Validates that the resource name is a non-empty string\n *\n * @param {string} resource - The resource name to validate\n * @throws {InvalidResourceNameError} If resource is not a non-empty string\n * @private\n */\n private _validateResourceName(resource: string): void {\n if (!resource || typeof resource !== 'string' || resource.trim().length === 0) {\n throw new InvalidResourceNameError(resource);\n }\n }\n\n /**\n * Add embedded-resource selections to the request (PostgREST only)\n * Automatically prevents duplicate columns for each relation\n *\n * An empty column array means \"all columns\" (`relation(*)`); merging an\n * empty array into a relation that already has explicit columns keeps\n * the explicit columns.\n *\n * @param {Embedded} embedded - Object mapping relation names to arrays of columns to project\n * @return {void}\n * @example\n * service.addEmbedded({ author: ['id', 'name'] });\n * service.addEmbedded({ comments: [] });\n */\n public addEmbedded(embedded: Embedded): void {\n this._nest.update(nest => {\n const mergedEmbedded = { ...nest.embedded };\n\n Object.keys(embedded).forEach(relation => {\n const existingColumns = mergedEmbedded[relation] || [];\n const newColumns = embedded[relation];\n\n // Use Set to prevent duplicates\n const uniqueColumns = Array.from(new Set([...existingColumns, ...newColumns]));\n mergedEmbedded[relation] = uniqueColumns;\n });\n\n return {\n ...nest,\n embedded: mergedEmbedded\n };\n });\n }\n\n /**\n * Add selectable fields for the given model to the request\n * Automatically prevents duplicate fields for each model\n *\n * @param {IFields} fields - Object mapping model names to arrays of field names\n * @return {void}\n * @example\n * service.addFields({ users: ['id', 'email', 'username'] });\n * service.addFields({ posts: ['title', 'content'] });\n */\n public addFields(fields: IFields): void {\n this._nest.update(nest => {\n const mergedFields = { ...nest.fields };\n\n Object.keys(fields).forEach(model => {\n const existingFields = mergedFields[model] || [];\n const newFields = fields[model];\n\n // Use Set to prevent duplicates\n const uniqueFields = Array.from(new Set([...existingFields, ...newFields]));\n mergedFields[model] = uniqueFields;\n });\n\n return {\n ...nest,\n fields: mergedFields\n };\n });\n }\n\n /**\n * Add filters to the request\n * Automatically prevents duplicate filter values for each filter key\n *\n * @param {IFilters} filters - Object mapping filter keys to arrays of values\n * @return {void}\n * @example\n * service.addFilters({ id: [1, 2, 3] });\n * service.addFilters({ status: ['active', 'pending'] });\n */\n public addFilters(filters: IFilters): void {\n this._nest.update(nest => {\n const mergedFilters = { ...nest.filters };\n\n Object.keys(filters).forEach(key => {\n const existingValues = mergedFilters[key] || [];\n const newValues = filters[key];\n\n // Use Set to prevent duplicates\n const uniqueValues = Array.from(new Set([...existingValues, ...newValues]));\n mergedFilters[key] = uniqueValues;\n });\n\n return {\n ...nest,\n filters: mergedFilters\n };\n });\n }\n\n /**\n * Add resources to include with the request\n * Automatically prevents duplicate includes\n *\n * @param {string[]} includes - Array of resource names to include in the response\n * @return {void}\n * @example\n * service.addIncludes(['profile', 'posts']);\n * service.addIncludes(['comments']);\n */\n public addIncludes(includes: string[]): void {\n this._nest.update(nest => {\n // Use Set to prevent duplicates\n const uniqueIncludes = Array.from(new Set([...nest.includes, ...includes]));\n\n return {\n ...nest,\n includes: uniqueIncludes\n };\n });\n }\n\n /**\n * Add filters with explicit operators (NestJS only)\n * Automatically prevents duplicate operator filters for the same field + operator combination\n *\n * @param {IOperatorFilter[]} filters - Array of operator filter configurations\n * @return {void}\n * @example\n * import { FilterOperatorEnum } from 'ng-qubee';\n * service.addOperatorFilters([{ field: 'age', operator: FilterOperatorEnum.GTE, values: [18] }]);\n */\n public addOperatorFilters(filters: IOperatorFilter[]): void {\n this._nest.update(nest => {\n const merged = [...nest.operatorFilters];\n\n filters.forEach(newFilter => {\n const existingIdx = merged.findIndex(\n f => f.field === newFilter.field && f.operator === newFilter.operator\n );\n\n if (existingIdx > -1) {\n const existingValues = merged[existingIdx].values;\n merged[existingIdx] = {\n ...merged[existingIdx],\n values: Array.from(new Set([...existingValues, ...newFilter.values]))\n };\n } else {\n merged.push({ ...newFilter });\n }\n });\n\n return {\n ...nest,\n operatorFilters: merged\n };\n });\n }\n\n /**\n * Add flat field selection columns (NestJS only)\n * Automatically prevents duplicate select fields\n *\n * @param {string[]} fields - Array of column names to select\n * @return {void}\n * @example\n * service.addSelect(['id', 'name', 'email']);\n */\n public addSelect(fields: string[]): void {\n this._nest.update(nest => {\n const uniqueSelect = Array.from(new Set([...nest.select, ...fields]));\n\n return {\n ...nest,\n select: uniqueSelect\n };\n });\n }\n\n /**\n * Add a field that should be used for sorting data\n *\n * @param {ISort} sort - Sort configuration with field name and order (ASC/DESC)\n * @return {void}\n * @example\n * import { SortEnum } from 'ng-qubee';\n * service.addSort({ field: 'created_at', order: SortEnum.DESC });\n * service.addSort({ field: 'name', order: SortEnum.ASC });\n */\n public addSort(sort: ISort): void {\n this._nest.update(nest => ({\n ...nest,\n sorts: [...nest.sorts, sort]\n }));\n }\n\n /**\n * Remove embedded-resource relations from the state (PostgREST only)\n *\n * Removes the whole relation entry, columns included.\n *\n * @param {...string[]} relations - Relation names to remove\n * @return {void}\n * @example\n * service.deleteEmbedded('author');\n * service.deleteEmbedded('comments', 'tags');\n */\n public deleteEmbedded(...relations: string[]): void {\n // Deep clone the embedded object to prevent mutations\n const e = this._clone(this._nest().embedded);\n\n relations.forEach(relation => delete e[relation]);\n\n this._nest.update(nest => ({\n ...nest,\n embedded: e\n }));\n }\n\n /**\n * Remove fields for the given model\n * Uses deep cloning to prevent mutations to the original state\n *\n * @param {IFields} fields - Object mapping model names to arrays of field names to remove\n * @return {void}\n * @example\n * service.deleteFields({ users: ['email'] });\n * service.deleteFields({ posts: ['content', 'body'] });\n */\n public deleteFields(fields: IFields): void {\n // Deep clone the fields object to prevent mutations\n const f = this._clone(this._nest().fields);\n\n Object.keys(fields).forEach(k => {\n if (!(k in f)) {\n return;\n }\n\n f[k] = f[k].filter(v => !fields[k].includes(v));\n });\n\n this._nest.update(nest => ({\n ...nest,\n fields: f\n }));\n }\n\n /**\n * Remove filters from the request\n * Uses deep cloning to prevent mutations to the original state\n *\n * @param {...string[]} filters - Filter keys to remove\n * @return {void}\n * @example\n * service.deleteFilters('id');\n * service.deleteFilters('status', 'type');\n */\n public deleteFilters(...filters: string[]): void {\n // Deep clone the filters object to prevent mutations\n const f = this._clone(this._nest().filters);\n\n filters.forEach(k => delete f[k]);\n\n this._nest.update(nest => ({\n ...nest,\n filters: f\n }));\n }\n\n /**\n * Remove includes from the request\n *\n * @param {...string[]} includes - Include names to remove\n * @return {void}\n * @example\n * service.deleteIncludes('profile');\n * service.deleteIncludes('posts', 'comments');\n */\n public deleteIncludes(...includes: string[]): void {\n this._nest.update(nest => ({\n ...nest,\n includes: nest.includes.filter(v => !includes.includes(v))\n }));\n }\n\n /**\n * Remove operator filters by field name (NestJS only)\n *\n * @param {...string[]} fields - Field names of operator filters to remove\n * @return {void}\n * @example\n * service.deleteOperatorFilters('age');\n * service.deleteOperatorFilters('price', 'quantity');\n */\n public deleteOperatorFilters(...fields: string[]): void {\n this._nest.update(nest => ({\n ...nest,\n operatorFilters: nest.operatorFilters.filter(f => !fields.includes(f.field))\n }));\n }\n\n /**\n * Remove the search term from the state (NestJS only)\n *\n * @return {void}\n * @example\n * service.deleteSearch();\n */\n public deleteSearch(): void {\n this._nest.update(nest => ({\n ...nest,\n search: ''\n }));\n }\n\n /**\n * Remove flat field selections from the state (NestJS only)\n *\n * @param {...string[]} fields - Field names to remove from selection\n * @return {void}\n * @example\n * service.deleteSelect('email');\n * service.deleteSelect('name', 'email');\n */\n public deleteSelect(...fields: string[]): void {\n this._nest.update(nest => ({\n ...nest,\n select: nest.select.filter(f => !fields.includes(f))\n }));\n }\n\n /**\n * Remove sorts from the request by field name\n *\n * @param {...string[]} sorts - Field names of sorts to remove\n * @return {void}\n * @example\n * service.deleteSorts('created_at');\n * service.deleteSorts('name', 'created_at');\n */\n public deleteSorts(...sorts: string[]): void {\n const s = [...this._nest().sorts];\n\n sorts.forEach(field => {\n const p = s.findIndex(sort => sort.field === field);\n\n if (p > -1) {\n s.splice(p, 1);\n }\n });\n\n this._nest.update(nest => ({\n ...nest,\n sorts: s\n }));\n }\n\n /**\n * Set the full-text search term (NestJS only)\n *\n * @param {string} search - The search term\n * @return {void}\n * @example\n * service.setSearch('john doe');\n */\n public setSearch(search: string): void {\n this._nest.update(nest => ({\n ...nest,\n search\n }));\n }\n\n /**\n * Atomically record the `lastPage` value from a paginated response and\n * flip `isLastPageKnown` to `true`\n *\n * Called exclusively by `PaginationService.paginate()` as part of the\n * auto-sync contract; not intended to be invoked by consumers directly.\n * Keeping the two fields under a single write guarantees they cannot\n * drift out of sync.\n *\n * @param {number} lastPage - The last page number parsed from the most recent paginated response\n * @return {void}\n */\n public syncLastPage(lastPage: number): void {\n this._nest.update(nest => ({\n ...nest,\n isLastPageKnown: true,\n lastPage\n }));\n }\n\n /**\n * Reset the query builder state to initial values\n * Clears all fields, filters, includes, sorts, and resets pagination\n *\n * @return {void}\n * @example\n * service.reset();\n */\n public reset(): void {\n this._nest.update(_ => this._clone(INITIAL_STATE));\n }\n}\n","/**\n * Thrown when a pagination helper that needs `state.lastPage` is called\n * before `PaginationService.paginate()` has ever synced a value.\n *\n * Examples: `NgQubeeService.lastPage()`, `NgQubeeService.totalPages()`.\n *\n * Safe-for-templates predicates (`isLastPage`, `hasNextPage`, etc.) do not\n * throw and return conservative defaults instead.\n */\nexport class PaginationNotSyncedError extends Error {\n\n /**\n * @param action - Short imperative describing what the caller was trying\n * to do (e.g. \"navigate to last page\", \"read totalPages\"). Surfaced in\n * the error message so the cause is obvious at the call site.\n */\n constructor(action: string) {\n super(`Cannot ${action}: no paginated response has been synced yet. Call PaginationService.paginate() at least once first.`);\n this.name = 'PaginationNotSyncedError';\n }\n}\n","/**\n * Error thrown when embedded resources are attempted with a driver that\n * does not support them\n *\n * Embedded-resource fetching (`select=col,relation(col1,col2)`) is a\n * PostgREST-native join mechanism and is only supported by the PostgREST\n * driver. Drivers with a standalone relation parameter expose it through\n * `addIncludes()` instead (JSON:API, Spatie, Strapi, @nestjsx/crud).\n */\nexport class UnsupportedEmbeddedError extends Error {\n constructor() {\n super('Embedded resources are only supported by the PostgREST driver. Use addIncludes() for drivers with a standalone relation parameter.');\n this.name = 'UnsupportedEmbeddedError';\n }\n}\n","/**\n * Error thrown when per-model field selection is attempted with a driver that does not support it\n *\n * Per-model field selection is only supported by the Spatie driver.\n * Use `addSelect()` for NestJS flat field selection.\n */\nexport class UnsupportedFieldSelectionError extends Error {\n constructor() {\n super('Per-model field selection is only supported by the Spatie driver. Use addSelect() for NestJS.');\n this.name = 'UnsupportedFieldSelectionError';\n }\n}\n","/**\n * Error thrown when filters are attempted with a driver that does not support them\n *\n * Filters are only supported by the Spatie and NestJS drivers.\n */\nexport class UnsupportedFilterError extends Error {\n constructor() {\n super('Filters are only supported by the Spatie and NestJS drivers.');\n this.name = 'UnsupportedFilterError';\n }\n}\n","/**\n * Error thrown when includes are attempted with a driver that does not support them\n *\n * Includes are only supported by the Spatie driver.\n */\nexport class UnsupportedIncludesError extends Error {\n constructor() {\n super('Includes are only supported by the Spatie driver.');\n this.name = 'UnsupportedIncludesError';\n }\n}\n","/**\n * Error thrown when search is attempted with a driver that does not support it\n *\n * Search is only supported by the NestJS driver.\n */\nexport class UnsupportedSearchError extends Error {\n constructor() {\n super('Search is only supported by the NestJS driver.');\n this.name = 'UnsupportedSearchError';\n }\n}\n","/**\n * Error thrown when flat field selection is attempted with a driver that does not support it\n *\n * Flat field selection is only supported by the NestJS driver.\n * Use `addFields()` for Spatie per-model field selection.\n */\nexport class UnsupportedSelectError extends Error {\n constructor() {\n super('Flat field selection is only supported by the NestJS driver. Use addFields() for Spatie.');\n this.name = 'UnsupportedSelectError';\n }\n}\n","/**\n * Error thrown when sorts are attempted with a driver that does not support them\n *\n * Sorts are only supported by the Spatie and NestJS drivers.\n */\nexport class UnsupportedSortError extends Error {\n constructor() {\n super('Sorts are only supported by the Spatie and NestJS drivers.');\n this.name = 'UnsupportedSortError';\n }\n}\n","import { InjectionToken } from '@angular/core';\n\nimport { DriverEnum } from '../enums/driver.enum';\nimport { IRequestStrategy } from '../interfaces/request-strategy.interface';\nimport { IResponseStrategy } from '../interfaces/response-strategy.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\nimport { ResponseOptions } from '../models/response-options';\n\n/**\n * Injection token for the active pagination driver\n *\n * Provided by `provideNgQubee()` / `NgQubeeModule.forRoot()` from the\n * user-supplied `IConfig.driver`. Services read it to gate driver-specific\n * behavior (e.g. `NgQubeeService._assertDriver`).\n */\nexport const NG_QUBEE_DRIVER = new InjectionToken<DriverEnum>('NG_QUBEE_DRIVER');\n\n/**\n * Injection token for the resolved request URI strategy\n *\n * Provided by `provideNgQubee()` / `NgQubeeModule.forRoot()` based on the\n * active driver. Used by `NgQubeeService` to build request URIs.\n */\nexport const NG_QUBEE_REQUEST_STRATEGY = new InjectionToken<IRequestStrategy>('NG_QUBEE_REQUEST_STRATEGY');\n\n/**\n * Injection token for the resolved request query-parameter key options\n *\n * Provided as a fully-built `QueryBuilderOptions` instance. `provideNgQubee()`\n * constructs it from `IConfig.request`; consumers don't interact with this\n * token directly.\n */\nexport const NG_QUBEE_REQUEST_OPTIONS = new InjectionToken<QueryBuilderOptions>('NG_QUBEE_REQUEST_OPTIONS');\n\n/**\n * Injection token for the resolved response parsing strategy\n *\n * Provided by `provideNgQubee()` / `NgQubeeModule.forRoot()` based on the\n * active driver. Used by `PaginationService` to parse paginated responses.\n */\nexport const NG_QUBEE_RESPONSE_STRATEGY = new InjectionToken<IResponseStrategy>('NG_QUBEE_RESPONSE_STRATEGY');\n\n/**\n * Injection token for the resolved response field-key options\n *\n * Provided as a fully-built `ResponseOptions` instance (or a driver-specific\n * subclass like `JsonApiResponseOptions` / `NestjsResponseOptions`).\n * `provideNgQubee()` constructs the correct variant from `IConfig.response`.\n */\nexport const NG_QUBEE_RESPONSE_OPTIONS = new InjectionToken<ResponseOptions>('NG_QUBEE_RESPONSE_OPTIONS');\n","import { Inject, Injectable } from '@angular/core';\nimport { BehaviorSubject, Observable, filter, throwError } from 'rxjs';\n\n// Enums\nimport { DriverEnum } from '../enums/driver.enum';\nimport { FilterOperatorEnum } from '../enums/filter-operator.enum';\nimport { SortEnum } from '../enums/sort.enum';\n\n// Errors\nimport { InvalidPageNumberError } from '../errors/invalid-page-number.error';\nimport { PaginationNotSyncedError } from '../errors/pagination-not-synced.error';\nimport { UnsupportedEmbeddedError } from '../errors/unsupported-embedded.error';\nimport { UnsupportedFieldSelectionError } from '../errors/unsupported-field-selection.error';\nimport { UnsupportedFilterError } from '../errors/unsupported-filter.error';\nimport { UnsupportedFilterOperatorError } from '../errors/unsupported-filter-operator.error';\nimport { UnsupportedIncludesError } from '../errors/unsupported-includes.error';\nimport { UnsupportedSearchError } from '../errors/unsupported-search.error';\nimport { UnsupportedSelectError } from '../errors/unsupported-select.error';\nimport { UnsupportedSortError } from '../errors/unsupported-sort.error';\n\n// Interfaces\nimport { IFields } from '../interfaces/fields.interface';\nimport { IRequestStrategy } from '../interfaces/request-strategy.interface';\nimport { IStrategyCapabilities } from '../interfaces/strategy-capabilities.interface';\n\n// Models\nimport { QueryBuilderOptions } from '../models/query-builder-options';\n\n// Services\nimport { NestService } from './nest.service';\n\n// Tokens\nimport { NG_QUBEE_DRIVER, NG_QUBEE_REQUEST_OPTIONS, NG_QUBEE_REQUEST_STRATEGY } from '../tokens/ng-qubee.tokens';\n\n@Injectable()\nexport class NgQubeeService {\n\n /**\n * The active pagination driver\n */\n private _driver: DriverEnum;\n\n /**\n * Resolved query parameter key name options\n */\n private _options: QueryBuilderOptions;\n\n /**\n * The request strategy that builds URIs for the active driver\n */\n private _requestStrategy: IRequestStrategy;\n\n /**\n * Internal BehaviorSubject that holds the latest generated URI\n */\n private _uri$: BehaviorSubject<string> = new BehaviorSubject('');\n\n /**\n * Observable that emits non-empty generated URIs\n */\n public uri$: Observable<string> = this._uri$.asObservable().pipe(\n filter(uri => !!uri)\n );\n\n constructor(\n private _nestService: NestService,\n @Inject(NG_QUBEE_REQUEST_STRATEGY) requestStrategy: IRequestStrategy,\n @Inject(NG_QUBEE_DRIVER) driver: DriverEnum,\n @Inject(NG_QUBEE_REQUEST_OPTIONS) options: QueryBuilderOptions = new QueryBuilderOptions({})\n ) {\n this._driver = driver;\n this._options = options;\n this._requestStrategy = requestStrategy;\n }\n\n /**\n * Assert that the active strategy declares support for a capability\n *\n * Reads from `IRequestStrategy.capabilities` rather than the driver\n * enum so adding a new driver only requires declaring its capability\n * map — this method does not change.\n *\n * @param flag - The capability key to check\n * @param error - The error to throw if the capability is unsupported\n * @throws The provided error if the active strategy lacks the capability\n */\n private _assertCapability(flag: keyof IStrategyCapabilities, error: Error): void {\n if (!this._requestStrategy.capabilities[flag]) {\n throw error;\n }\n }\n\n /**\n * Add an embedded resource to the select statement (PostgREST only)\n *\n * Splices `relation(col1,col2)` into the single `select=` query\n * parameter alongside flat columns from `addSelect`. Omit the columns\n * to project all of them (`relation(*)`):\n *\n * ```\n * qb.addEmbedded('author', 'id', 'name')\n * .addEmbedded('comments')\n * .addSelect('title');\n * // → select=title,author(id,name),comments(*)\n * ```\n *\n * Calling repeatedly with the same relation merge-dedups the columns.\n * Does not reset the page (column shape change, not record-set change).\n *\n * @param {string} relation - The related table / foreign-key name as PostgREST sees it\n * @param {string[]} columns - Optional column projection; omit for `relation(*)`\n * @returns {this}\n * @throws {UnsupportedEmbeddedError} If the active driver does not support embedded resources\n */\n public addEmbedded(relation: string, ...columns: string[]): this {\n this._assertCapability('embedded', new UnsupportedEmbeddedError());\n\n this._nestService.addEmbedded({ [relation]: columns });\n\n return this;\n }\n\n /**\n * Add fields to the select statement for the given model (JSON:API and Spatie only)\n *\n * @param model - Model that holds the fields\n * @param fields - Fields to select\n * @returns {this}\n * @throws {UnsupportedFieldSelectionError} If the active driver does not support per-model field selection\n */\n public addFields(model: string, fields: string[]): this {\n this._assertCapability('fields', new UnsupportedFieldSelectionError());\n\n if (!fields.length) {\n return this;\n }\n\n this._nestService.addFields({ [model]: fields });\n\n return this;\n }\n\n /**\n * Add a filter with the given value(s) (JSON:API, NestJS, PostgREST, and Spatie)\n *\n * Produces: `filter[field]=value` (JSON:API / Spatie) or `filter.field=value` (NestJS)\n *\n * @param {string} field - Name of the field to filter\n * @param {(string | number | boolean)[]} values - The needle(s)\n * @returns {this}\n * @throws {UnsupportedFilterError} If the active driver does not support filters\n */\n public addFilter(field: string, ...values: (string | number | boolean)[]): this {\n this._assertCapability('filters', new UnsupportedFilterError());\n\n if (!values.length) {\n return this;\n }\n\n this._nestService.addFilters({\n [field]: values\n });\n this._nestService.page = 1;\n\n return this;\n }\n\n /**\n * Add a filter with an explicit operator (NestJS and PostgREST)\n *\n * Produces: `filter.field=$operator:value`\n *\n * @param {string} field - Name of the field to filter\n * @param {FilterOperatorEnum} operator - The filter operator to apply\n * @param {(string | number | boolean)[]} values - The value(s) for the filter\n * @returns {this}\n * @throws {UnsupportedFilterOperatorError} If the active driver does not support filter operators\n */\n public addFilterOperator(field: string, operator: FilterOperatorEnum, ...values: (string | number | boolean)[]): this {\n this._assertCapability('operatorFilters', new UnsupportedFilterOperatorError());\n\n if (!values.length) {\n return this;\n }\n\n this._nestService.addOperatorFilters([{ field, operator, values }]);\n this._nestService.page = 1;\n\n return this;\n }\n\n /**\n * Add related entities to include in the request (JSON:API and Spatie only)\n *\n * @param {string[]} models - Models to include\n * @returns {this}\n * @throws {UnsupportedIncludesError} If the active driver does not support includes\n */\n public addIncludes(...models: string[]): this {\n this._assertCapability('includes', new UnsupportedIncludesError());\n\n if (!models.length) {\n return this;\n }\n\n this._nestService.addIncludes(models);\n\n return this;\n }\n\n /**\n * Add flat field selection (NestJS and PostgREST)\n *\n * Produces: `select=col1,col2`\n *\n * @param {string[]} fields - Fields to select\n * @returns {this}\n * @throws {UnsupportedSelectError} If the active driver does not support flat field selection\n */\n public addSelect(...fields: string[]): this {\n this._assertCapability('select', new UnsupportedSelectError());\n\n if (!fields.length) {\n return this;\n }\n\n this._nestService.addSelect(fields);\n\n return this;\n }\n\n /**\n * Add a field with a sort criteria (JSON:API, NestJS, PostgREST, and Spatie)\n *\n * @param field - Field to use for sorting\n * @param {SortEnum} order - A value from the SortEnum enumeration\n * @returns {this}\n * @throws {UnsupportedSortError} If the active driver does not support sorts\n */\n public addSort(field: string, order: SortEnum): this {\n this._assertCapability('sort', new UnsupportedSortError());\n\n this._nestService.addSort({\n field,\n order\n });\n this._nestService.page = 1;\n\n return this;\n }\n\n /**\n * Get the current page number\n *\n * @remarks Always safe to call. Thin accessor over the internal state's `page` field.\n * @returns The current page number\n */\n public currentPage(): number {\n return this._nestService.nest().page;\n }\n\n /**\n * Remove embedded resources from the current query builder state (PostgREST only)\n *\n * Removes the whole relation entry, columns included.\n *\n * @param {string[]} relations - Relation names to remove\n * @returns {this}\n * @throws {UnsupportedEmbeddedError} If the active driver does not support embedded resources\n */\n public deleteEmbedded(...relations: string[]): this {\n this._assertCapability('embedded', new UnsupportedEmbeddedError());\n\n if (!relations.length) {\n return this;\n }\n\n this._nestService.deleteEmbedded(...relations);\n\n return this;\n }\n\n /**\n * Delete selected fields for the given models in the current query builder state (JSON:API and Spatie only)\n *\n * ```\n * ngQubeeService.deleteFields({\n * users: ['email', 'password'],\n * address: ['zipcode']\n * });\n * ```\n *\n * @param {IFields} fields - Object mapping model names to field arrays to remove\n * @returns {this}\n * @throws {UnsupportedFieldSelectionError} If the active driver does not support per-model field selection\n */\n public deleteFields(fields: IFields): this {\n this._assertCapability('fields', new UnsupportedFieldSelectionError());\n this._nestService.deleteFields(fields);\n\n return this;\n }\n\n /**\n * Delete selected fields for the given model in the current query builder state (JSON:API and Spatie only)\n *\n * ```\n * ngQubeeService.deleteFieldsByModel('users', 'email', 'password');\n * ```\n *\n * @param model - Model that holds the fields\n * @param {string[]} fields - Fields to delete from the state\n * @returns {this}\n * @throws {UnsupportedFieldSelectionError} If the active driver does not support per-model field selection\n */\n public deleteFieldsByModel(model: string, ...fields: string[]): this {\n this._assertCapability('fields', new UnsupportedFieldSelectionError());\n\n if (!fields.length) {\n return this;\n }\n\n this._nestService.deleteFields({\n [model]: fields\n });\n\n return this;\n }\n\n /**\n * Remove given filters from the query builder state (JSON:API, NestJS, PostgREST, and Spatie)\n *\n * @param {string[]} filters - Filters to remove\n * @returns {this}\n * @throws {UnsupportedFilterError} If the active driver does not support filters\n */\n public deleteFilters(...filters: string[]): this {\n this._assertCapability('filters', new UnsupportedFilterError());\n\n if (!filters.length) {\n return this;\n }\n\n this._nestService.deleteFilters(...filters);\n this._nestService.page = 1;\n\n return this;\n }\n\n /**\n * Remove selected related models from the query builder state (JSON:API and Spatie only)\n *\n * @param {string[]} includes - Models to remove\n * @returns {this}\n * @throws {UnsupportedIncludesError} If the active driver does not support includes\n */\n public deleteIncludes(...includes: string[]): this {\n this._assertCapability('includes', new UnsupportedIncludesError());\n\n if (!includes.length) {\n return this;\n }\n\n this._nestService.deleteIncludes(...includes);\n\n return this;\n }\n\n /**\n * Remove operator filters by field name (NestJS and PostgREST)\n *\n * @param {string[]} fields - Field names of operator filters to remove\n * @returns {this}\n * @throws {UnsupportedFilterOperatorError} If the active driver does not support filter operators\n */\n public deleteOperatorFilters(...fields: string[]): this {\n this._assertCapability('operatorFilters', new UnsupportedFilterOperatorError());\n\n if (!fields.length) {\n return this;\n }\n\n this._nestService.deleteOperatorFilters(...fields);\n this._nestService.page = 1;\n\n return this;\n }\n\n /**\n * Remove search term from the query builder state (NestJS only)\n *\n * @returns {this}\n * @throws {UnsupportedSearchError} If the active driver does not support search\n */\n public deleteSearch(): this {\n this._assertCapability('search', new UnsupportedSearchError());\n this._nestService.deleteSearch();\n this._nestService.page = 1;\n\n return this;\n }\n\n /**\n * Remove flat field selections from the query builder state (NestJS and PostgREST)\n *\n * @param {string[]} fields - Fields to remove from selection\n * @returns {this}\n * @throws {UnsupportedSelectError} If the active driver does not support flat field selection\n */\n public deleteSelect(...fields: string[]): this {\n this._assertCapability('select', new UnsupportedSelectError());\n\n if (!fields.length) {\n return this;\n }\n\n this._nestService.deleteSelect(...fields);\n\n return this;\n }\n\n /**\n * Remove sort rules from the query builder state (JSON:API, NestJS, PostgREST, and Spatie)\n *\n * @param sorts - Fields used for sorting to remove\n * @returns {this}\n * @throws {UnsupportedSortError} If the active driver does not support sorts\n */\n public deleteSorts(...sorts: string[]): this {\n this._assertCapability('sort', new UnsupportedSortError());\n this._nestService.deleteSorts(...sorts);\n this._nestService.page = 1;\n\n return this;\n }\n\n /**\n * Navigate to the first page (page 1)\n *\n * @remarks Never throws. Idempotent when already on page 1.\n * @returns {this}\n */\n public firstPage(): this {\n this._nestService.page = 1;\n\n return this;\n }\n\n /**\n * Generate a URI accordingly to the given data and active driver\n *\n * @returns {Observable<string>} An observable that emits the generated URI\n */\n public generateUri(): Observable<string> {\n try {\n this._uri$.next(this._requestStrategy.buildUri(this._nestService.nest(), this._options));\n return this.uri$;\n } catch (error) {\n return throwError(() => error);\n }\n }\n\n /**\n * Navigate directly to the specified page\n *\n * Validates integer/positive via the existing `setPage` path, and\n * additionally rejects values that exceed `state.lastPage` when\n * pagination bounds are known.\n *\n * @param n - Target page number\n * @returns {this}\n * @throws {InvalidPageNumberError} If `n` is not a positive integer, or if `n > state.lastPage` when `state.isLastPageKnown` is true\n */\n public goToPage(n: number): this {\n const state = this._nestService.nest();\n\n if (state.isLastPageKnown && n > state.lastPage) {\n throw new InvalidPageNumberError(n);\n }\n\n this._nestService.page = n;\n\n return this;\n }\n\n /**\n * Check whether a next page exists\n *\n * @remarks Template-safe. Returns `true` when pagination bounds are unknown (conservative default — keeps a \"Next\" button enabled before the first `paginate()` call).\n * @returns `true` if `state.page < state.lastPage` when bounds are known, or `true` when bounds are unknown\n */\n public hasNextPage(): boolean {\n const state = this._nestService.nest();\n\n return !state.isLastPageKnown || state.page < state.lastPage;\n }\n\n /**\n * Check whether a previous page exists\n *\n * @remarks Always safe. Does not require a synced paginated response.\n * @returns `true` if `state.page > 1`\n */\n public hasPreviousPage(): boolean {\n return this._nestService.nest().page > 1;\n }\n\n /**\n * Check whether the current page is the first page\n *\n * @remarks Always safe. Does not require a synced paginated response.\n * @returns `true` if `state.page === 1`\n */\n public isFirstPage(): boolean {\n return this._nestService.nest().page === 1;\n }\n\n /**\n * Check whether the current page is the last page\n *\n * @remarks Template-safe. Returns `false` when pagination bounds are unknown (no paginated response has been synced yet) — keeps \"Next\" navigation unblocked until the first `paginate()` call syncs.\n * @returns `true` only when `state.isLastPageKnown` and `state.page === state.lastPage`\n */\n public isLastPage(): boolean {\n const state = this._nestService.nest();\n\n return state.isLastPageKnown && state.page === state.lastPage;\n }\n\n /**\n * Navigate to the last page known from the most recent paginated response\n *\n * @remarks Requires at least one `PaginationService.paginate()` call to have synced `state.lastPage`. Before that, the bound is unknown and this method throws.\n * @returns {this}\n * @throws {PaginationNotSyncedError} If `state.isLastPageKnown` is false (no paginated response has been synced yet)\n */\n public lastPage(): this {\n const state = this._nestService.nest();\n\n if (!state.isLastPageKnown) {\n throw new PaginationNotSyncedError('navigate to last page');\n }\n\n this._nestService.page = state.lastPage;\n\n return this;\n }\n\n /**\n * Navigate to the next page\n *\n * @remarks Never throws. Idempotent at the known last page (no-op). Pair with `hasNextPage()` for a disable-state binding.\n * @returns {this}\n */\n public nextPage(): this {\n const state = this._nestService.nest();\n\n if (state.isLastPageKnown && state.page >= state.lastPage) {\n return this;\n }\n\n this._nestService.page = state.page + 1;\n\n return this;\n }\n\n /**\n * HTTP request headers the active driver wants the consumer to apply\n *\n * Returns `null` for drivers that pass all pagination metadata on the\n * URL (Laravel, Spatie, JSON:API, NestJS, and PostgREST in its default\n * QUERY mode). Returns a map of header name → value when the active\n * driver uses HTTP headers instead — today, only the PostgREST driver\n * configured with `PaginationModeEnum.RANGE`, which yields\n * `{ 'Range-Unit': 'items', 'Range': 'from-to' }`.\n *\n * @returns Map of headers to apply to the HTTP request, or `null` when not needed\n */\n public paginationHeaders(): Record<string, string> | null {\n if (typeof this._requestStrategy.buildPaginationHeaders !== 'function') {\n return null;\n }\n\n return this._requestStrategy.buildPaginationHeaders(this._nestService.nest());\n }\n\n /**\n * Navigate to the previous page\n *\n * @remarks Never throws. Idempotent at page 1 (floored). Pair with `hasPreviousPage()` for a disable-state binding.\n * @returns {this}\n */\n public previousPage(): this {\n const state = this._nestService.nest();\n\n if (state.page <= 1) {\n return this;\n }\n\n this._nestService.page = state.page - 1;\n\n return this;\n }\n\n /**\n * Clear the current state and reset the Query Builder to a fresh, clean condition\n *\n * @returns {this}\n */\n public reset(): this {\n this._nestService.reset();\n\n return this;\n }\n\n /**\n * Set the base URL to use for composing the address\n *\n * @param {string} baseUrl - The base URL\n * @returns {this}\n */\n public setBaseUrl(baseUrl: string): this {\n this._nestService.baseUrl = baseUrl;\n\n return this;\n }\n\n /**\n * Set the items per page number\n *\n * Validation is delegated to the active request strategy because the\n * accepted range is driver-specific: nestjs-paginate additionally accepts\n * `-1` as a \"fetch all\" sentinel, while Laravel, Spatie, and JSON:API\n * require a positive integer.\n *\n * @param limit - Number of items per page (or `-1` to fetch all, NestJS only)\n * @returns {this}\n * @throws {import('../errors/invalid-limit.error').InvalidLimitError} If the value is not accepted by the active driver\n */\n public setLimit(limit: number): this {\n this._requestStrategy.validateLimit(limit);\n this._nestService.limit = limit;\n this._nestService.page = 1;\n\n return this;\n }\n\n /**\n * Set the page that the backend will use to paginate the result set\n *\n * @param page - Page number\n * @returns {this}\n */\n public setPage(page: number): this {\n this._nestService.page = page;\n\n return this;\n }\n\n /**\n * Set the API resource to run the query against\n *\n * @param {string} resource - Resource name (e.g. 'users' produces /users)\n * @returns {this}\n */\n public setResource(resource: string): this {\n this._nestService.resource = resource;\n this._nestService.page = 1;\n\n return this;\n }\n\n /**\n * Set the search term for full-text search (NestJS only)\n *\n * Produces: `search=term`\n *\n * @param {string} search - The search term\n * @returns {this}\n * @throws {UnsupportedSearchError} If the active driver does not support search\n */\n public setSearch(search: string): this {\n this._assertCapability('search', new UnsupportedSearchError());\n this._nestService.setSearch(search);\n this._nestService.page = 1;\n\n return this;\n }\n\n /**\n * Get the total number of pages reported by the most recent paginated response\n *\n * @remarks Throws when called before any `paginate()` has synced a value. For a non-throwing read in a template, read `nest().isLastPageKnown` first as a guard.\n * @returns The last page number\n * @throws {PaginationNotSyncedError} If `state.isLastPageKnown` is false (no paginated response has been synced yet)\n */\n public totalPages(): number {\n const state = this._nestService.nest();\n\n if (!state.isLastPageKnown) {\n throw new PaginationNotSyncedError('read totalPages');\n }\n\n return state.lastPage;\n }\n}\n","import { Inject, Injectable } from '@angular/core';\n\nimport { HeaderBag } from '../interfaces/header-bag.interface';\nimport { IPaginatedObject } from '../interfaces/paginated-object.interface';\nimport { IResponseStrategy } from '../interfaces/response-strategy.interface';\nimport { PaginatedCollection } from '../models/paginated-collection';\nimport { ResponseOptions } from '../models/response-options';\nimport { NestService } from './nest.service';\nimport { NG_QUBEE_RESPONSE_OPTIONS, NG_QUBEE_RESPONSE_STRATEGY } from '../tokens/ng-qubee.tokens';\n\n@Injectable()\nexport class PaginationService {\n\n /**\n * The NestService instance that owns the query-builder state for this\n * PaginationService's scope (environment-level by default, or\n * component-level when used via `provideNgQubeeInstance()`)\n */\n private _nestService: NestService;\n\n /**\n * Resolved response key name options\n */\n private _options: ResponseOptions;\n\n /**\n * The response strategy that parses responses for the active driver\n */\n private _responseStrategy: IResponseStrategy;\n\n constructor(\n nestService: NestService,\n @Inject(NG_QUBEE_RESPONSE_STRATEGY) responseStrategy: IResponseStrategy,\n @Inject(NG_QUBEE_RESPONSE_OPTIONS) options: ResponseOptions = new ResponseOptions({})\n ) {\n this._nestService = nestService;\n this._options = options;\n this._responseStrategy = responseStrategy;\n }\n\n /**\n * Transform a raw API response into a typed PaginatedCollection\n *\n * Delegates to the active driver's response strategy for parsing, then\n * auto-syncs the parsed `page` and `lastPage` back into `NestService`\n * so pagination navigation helpers on `NgQubeeService` can operate\n * against the live server-reported bounds without consumer bookkeeping.\n *\n * @remarks\n * `lastPage` is only synced when the response yields a positive integer.\n * Server-emitted `0` (empty collection edge case) and absent fields are\n * treated as \"no useful info\" and leave `isLastPageKnown: false`.\n *\n * @param response - The raw API response body. For drivers that emit a\n * bare array (PostgREST), pass the array.\n * @param headers - Optional HTTP response headers. Required by the\n * PostgREST driver (reads `Content-Range` for pagination metadata);\n * body-only drivers ignore it. Accepts Angular's `HttpHeaders`, the\n * native `Headers` class, or a plain `Record<string, string>`.\n * @returns A typed PaginatedCollection instance\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public paginate<T extends IPaginatedObject>(response: { [key: string]: any }, headers?: HeaderBag): PaginatedCollection<T> {\n const collection = this._responseStrategy.paginate<T>(response, this._options, headers);\n\n this._nestService.page = collection.page;\n\n if (typeof collection.lastPage === 'number' && Number.isInteger(collection.lastPage) && collection.lastPage > 0) {\n this._nestService.syncLastPage(collection.lastPage);\n }\n\n return collection;\n }\n}\n","import { EnvironmentProviders, Provider, makeEnvironmentProviders } from '@angular/core';\n\nimport { DRIVERS } from './drivers/driver-registry';\nimport { PaginationModeEnum } from './enums/pagination-mode.enum';\nimport { IConfig } from './interfaces/config.interface';\nimport { QueryBuilderOptions } from './models/query-builder-options';\nimport { NestService } from './services/nest.service';\nimport { NgQubeeService } from './services/ng-qubee.service';\nimport { PaginationService } from './services/pagination.service';\nimport {\n NG_QUBEE_DRIVER,\n NG_QUBEE_REQUEST_OPTIONS,\n NG_QUBEE_REQUEST_STRATEGY,\n NG_QUBEE_RESPONSE_OPTIONS,\n NG_QUBEE_RESPONSE_STRATEGY\n} from './tokens/ng-qubee.tokens';\n\n/**\n * Build the core provider list shared by `provideNgQubee()` and\n * `NgQubeeModule.forRoot()`\n *\n * Looks up the driver definition from the registry and calls its three\n * factories — request strategy, response strategy, response options.\n * Adding a driver means adding one entry to `DRIVERS`; this function\n * does not change.\n *\n * Exposes the driver, strategies, and options via injection tokens so that\n * consumers can request a component-scoped instance of the services through\n * `provideNgQubeeInstance()`.\n *\n * @param config - Configuration object compliant to the IConfig interface\n * @returns An array of Providers for the environment injector\n */\nexport function buildNgQubeeProviders(config: IConfig): Provider[] {\n const driver = config.driver;\n const paginationMode = config.pagination ?? PaginationModeEnum.QUERY;\n const definition = DRIVERS[driver];\n\n const requestOptions = new QueryBuilderOptions(Object.assign({}, config.request));\n const responseOptions = definition.createResponseOptions(Object.assign({}, config.response));\n\n return [\n { provide: NG_QUBEE_DRIVER, useValue: driver },\n { provide: NG_QUBEE_REQUEST_STRATEGY, useValue: definition.createRequestStrategy(paginationMode) },\n { provide: NG_QUBEE_REQUEST_OPTIONS, useValue: requestOptions },\n { provide: NG_QUBEE_RESPONSE_STRATEGY, useValue: definition.createResponseStrategy() },\n { provide: NG_QUBEE_RESPONSE_OPTIONS, useValue: responseOptions },\n NestService,\n NgQubeeService,\n PaginationService\n ];\n}\n\n/**\n * Sets up providers necessary to enable `NgQubee` functionality for the application.\n *\n * @usageNotes\n *\n * Basic example with the Laravel driver:\n * ```\n * bootstrapApplication(AppComponent, {\n * providers: [provideNgQubee({ driver: DriverEnum.LARAVEL })]\n * });\n * ```\n *\n * Spatie driver example:\n * ```\n * import { DriverEnum } from 'ng-qubee';\n *\n * bootstrapApplication(AppComponent, {\n * providers: [provideNgQubee({ driver: DriverEnum.SPATIE })]\n * });\n * ```\n *\n * JSON:API driver example:\n * ```\n * import { DriverEnum } from 'ng-qubee';\n *\n * bootstrapApplication(AppComponent, {\n * providers: [provideNgQubee({ driver: DriverEnum.JSON_API })]\n * });\n * ```\n *\n * NestJS driver example:\n * ```\n * import { DriverEnum } from 'ng-qubee';\n *\n * bootstrapApplication(AppComponent, {\n * providers: [provideNgQubee({ driver: DriverEnum.NESTJS })]\n * });\n * ```\n *\n * @publicApi\n * @param config - Configuration object compliant to the IConfig interface\n * @returns A set of providers to setup NgQubee\n */\nexport function provideNgQubee(config: IConfig): EnvironmentProviders {\n return makeEnvironmentProviders(buildNgQubeeProviders(config));\n}\n\n/**\n * Providers for a component-scoped NgQubee instance\n *\n * Use this inside a standalone component's `providers: [...]` to get a\n * dedicated `NgQubeeService` (and its `NestService` / `PaginationService`\n * collaborators) whose query-builder and pagination state does not bleed\n * with the app-wide shared instance provided by `provideNgQubee()`.\n *\n * @usageNotes\n *\n * ```\n * @Component({\n * standalone: true,\n * providers: [...provideNgQubeeInstance()]\n * })\n * export class MyFeatureComponent {\n * constructor(private _qb: NgQubeeService) {}\n * }\n * ```\n *\n * The driver, strategies, and options are inherited from the environment\n * injector (`provideNgQubee()` at root), so only the service instances are\n * re-created at the component level.\n *\n * @publicApi\n * @returns A provider array to spread into a component's `providers`\n */\nexport function provideNgQubeeInstance(): Provider[] {\n return [NestService, NgQubeeService, PaginationService];\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\n\nimport { IConfig } from './interfaces/config.interface';\nimport { buildNgQubeeProviders } from './provide-ngqubee';\n\n// @dynamic\n@NgModule({})\nexport class NgQubeeModule {\n\n /**\n * Configure NgQubee for the root module\n *\n * @param config - Configuration object with driver, and optional request and response settings\n * @returns Module with providers configured for the specified driver\n */\n public static forRoot(config: IConfig): ModuleWithProviders<NgQubeeModule> {\n return {\n ngModule: NgQubeeModule,\n providers: buildNgQubeeProviders(config)\n };\n }\n}\n","/*\n * Public API Surface of angular-query-builder\n */\n\nexport * from './lib/models/paginated-collection';\nexport * from './lib/models/query-builder-options';\nexport * from './lib/models/response-options';\nexport * from './lib/ng-qubee.module';\nexport * from './lib/provide-ngqubee';\nexport * from './lib/services/ng-qubee.service';\nexport * from './lib/services/pagination.service';\n\n// Enums\nexport * from './lib/enums/driver.enum';\nexport * from './lib/enums/filter-operator.enum';\nexport * from './lib/enums/pagination-mode.enum';\nexport * from './lib/enums/sort.enum';\n\n// Error classes\nexport * from './lib/errors/invalid-filter-operator-value.error';\nexport * from './lib/errors/invalid-limit.error';\nexport * from './lib/errors/invalid-page-number.error';\nexport * from './lib/errors/invalid-resource-name.error';\nexport * from './lib/errors/key-not-found.error';\nexport * from './lib/errors/pagination-not-synced.error';\nexport * from './lib/errors/unselectable-model.error';\nexport * from './lib/errors/unsupported-embedded.error';\nexport * from './lib/errors/unsupported-field-selection.error';\nexport * from './lib/errors/unsupported-filter.error';\nexport * from './lib/errors/unsupported-filter-operator.error';\nexport * from './lib/errors/unsupported-includes.error';\nexport * from './lib/errors/unsupported-search.error';\nexport * from './lib/errors/unsupported-select.error';\nexport * from './lib/errors/unsupported-sort.error';\n\n// Interfaces\nexport * from './lib/interfaces/config.interface';\nexport * from './lib/interfaces/fields.interface';\nexport * from './lib/interfaces/filters.interface';\nexport * from './lib/interfaces/header-bag.interface';\nexport * from './lib/interfaces/nest-state.interface';\nexport * from './lib/interfaces/operator-filter.interface';\nexport * from './lib/interfaces/page.interface';\nexport * from './lib/interfaces/paginated-object.interface';\nexport * from './lib/interfaces/pagination-config.interface';\nexport * from './lib/interfaces/query-builder-config.interface';\nexport * from './lib/interfaces/query-builder-state.interface';\nexport * from './lib/interfaces/request-strategy.interface';\nexport * from './lib/interfaces/response-strategy.interface';\nexport * from './lib/interfaces/sort.interface';\n\n// Injection tokens\nexport * from './lib/tokens/ng-qubee.tokens';\n\n// Types\nexport * from './lib/types/embedded.type';\n\n// Strategies\nexport * from './lib/strategies/api-platform-request.strategy';\nexport * from './lib/strategies/api-platform-response.strategy';\nexport * from './lib/strategies/directus-request.strategy';\nexport * from './lib/strategies/directus-response.strategy';\nexport * from './lib/strategies/drf-request.strategy';\nexport * from './lib/strategies/drf-response.strategy';\nexport * from './lib/strategies/feathers-request.strategy';\nexport * from './lib/strategies/feathers-response.strategy';\nexport * from './lib/strategies/json-api-request.strategy';\nexport * from './lib/strategies/json-api-response.strategy';\nexport * from './lib/strategies/json-server-request.strategy';\nexport * from './lib/strategies/json-server-response.strategy';\nexport * from './lib/strategies/laravel-request.strategy';\nexport * from './lib/strategies/laravel-response.strategy';\nexport * from './lib/strategies/nestjs-request.strategy';\nexport * from './lib/strategies/nestjs-response.strategy';\nexport * from './lib/strategies/nestjsx-crud-request.strategy';\nexport * from './lib/strategies/nestjsx-crud-response.strategy';\nexport * from './lib/strategies/odata-request.strategy';\nexport * from './lib/strategies/odata-response.strategy';\nexport * from './lib/strategies/payload-request.strategy';\nexport * from './lib/strategies/payload-response.strategy';\nexport * from './lib/strategies/pocketbase-request.strategy';\nexport * from './lib/strategies/pocketbase-response.strategy';\nexport * from './lib/strategies/postgrest-request.strategy';\nexport * from './lib/strategies/postgrest-response.strategy';\nexport * from './lib/strategies/sieve-request.strategy';\nexport * from './lib/strategies/sieve-response.strategy';\nexport * from './lib/strategies/spatie-request.strategy';\nexport * from './lib/strategies/spatie-response.strategy';\nexport * from './lib/strategies/spring-request.strategy';\nexport * from './lib/strategies/spring-response.strategy';\nexport * from './lib/strategies/strapi-request.strategy';\nexport * from './lib/strategies/strapi-response.strategy';\nexport * from './lib/strategies/wordpress-request.strategy';\nexport * from './lib/strategies/wordpress-response.strategy';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.NestService"],"mappings":";;;;;AAAM,MAAO,gBAAiB,SAAQ,KAAK,CAAA;AACvC,IAAA,WAAA,CAAY,GAAW,EAAA;AACnB,QAAA,KAAK,CAAC,CAAA,oBAAA,EAAuB,GAAG,CAAA,mDAAA,CAAqD,CAAC;IAC1F;AACH;;MCAY,mBAAmB,CAAA;AAEjB,IAAA,IAAA;AACS,IAAA,IAAA;AACA,IAAA,IAAA;AACA,IAAA,EAAA;AACA,IAAA,KAAA;AACA,IAAA,OAAA;AACA,IAAA,WAAA;AACA,IAAA,WAAA;AACA,IAAA,QAAA;AACA,IAAA,YAAA;AACA,IAAA,WAAA;IAXpB,WAAA,CACW,IAAS,EACA,IAAY,EACZ,IAAa,EACb,EAAW,EACX,KAAc,EACd,OAAgB,EAChB,WAAoB,EACpB,WAAoB,EACpB,QAAiB,EACjB,YAAqB,EACrB,WAAoB,EAAA;QAV7B,IAAA,CAAA,IAAI,GAAJ,IAAI;QACK,IAAA,CAAA,IAAI,GAAJ,IAAI;QACJ,IAAA,CAAA,IAAI,GAAJ,IAAI;QACJ,IAAA,CAAA,EAAE,GAAF,EAAE;QACF,IAAA,CAAA,KAAK,GAAL,KAAK;QACL,IAAA,CAAA,OAAO,GAAP,OAAO;QACP,IAAA,CAAA,WAAW,GAAX,WAAW;QACX,IAAA,CAAA,WAAW,GAAX,WAAW;QACX,IAAA,CAAA,QAAQ,GAAR,QAAQ;QACR,IAAA,CAAA,YAAY,GAAZ,YAAY;QACZ,IAAA,CAA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