ng-qubee 3.2.0 → 3.3.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/query-builder-options.ts","../../../src/lib/models/response-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-filter-operator.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/enums/sort.enum.ts","../../../src/lib/errors/invalid-limit.error.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/laravel-request.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/spatie-request.strategy.ts","../../../src/lib/strategies/spatie-response.strategy.ts","../../../src/lib/provide-ngqubee.ts","../../../src/lib/ng-qubee.module.ts","../../../src/lib/enums/filter-operator.enum.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 JSON_API = 'json-api',\n LARAVEL = 'laravel',\n NESTJS = 'nestjs',\n SPATIE = 'spatie'\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 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 * 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 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 * 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';\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 driver is one of the allowed drivers\n *\n * @param allowed - The allowed drivers\n * @param error - The error to throw if the driver is not allowed\n * @throws The provided error if the active driver is not in the allowed list\n */\n private _assertDriver(allowed: DriverEnum[], error: Error): void {\n if (!allowed.includes(this._driver)) {\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._assertDriver([DriverEnum.JSON_API, DriverEnum.SPATIE], 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, 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._assertDriver([DriverEnum.JSON_API, DriverEnum.NESTJS, DriverEnum.SPATIE], 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 only)\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._assertDriver([DriverEnum.NESTJS], 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._assertDriver([DriverEnum.JSON_API, DriverEnum.SPATIE], 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 only)\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._assertDriver([DriverEnum.NESTJS], 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, 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._assertDriver([DriverEnum.JSON_API, DriverEnum.NESTJS, DriverEnum.SPATIE], 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._assertDriver([DriverEnum.JSON_API, DriverEnum.SPATIE], 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._assertDriver([DriverEnum.JSON_API, DriverEnum.SPATIE], 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, 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._assertDriver([DriverEnum.JSON_API, DriverEnum.NESTJS, DriverEnum.SPATIE], 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._assertDriver([DriverEnum.JSON_API, DriverEnum.SPATIE], 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 only)\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._assertDriver([DriverEnum.NESTJS], 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._assertDriver([DriverEnum.NESTJS], 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 only)\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._assertDriver([DriverEnum.NESTJS], 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, 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._assertDriver([DriverEnum.JSON_API, DriverEnum.NESTJS, DriverEnum.SPATIE], 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 * 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._assertDriver([DriverEnum.NESTJS], 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 { 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 object\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 }): PaginatedCollection<T> {\n const collection = this._responseStrategy.paginate<T>(response, this._options);\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","export enum SortEnum {\n ASC = 'asc',\n DESC = 'desc'\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","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 { InvalidLimitError } from '../errors/invalid-limit.error';\nimport { UnselectableModelError } from '../errors/unselectable-model.error';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { IRequestStrategy } from '../interfaces/request-strategy.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\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 implements IRequestStrategy {\n\n /**\n * Accumulator for composing the URI string\n */\n private _uri = '';\n\n /**\n * Build a URI string from the given state using the JSON:API format\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 resource is not set\n */\n public buildUri(state: IQueryBuilderState, options: QueryBuilderOptions): string {\n if (!state.resource) {\n throw new Error('Set the resource property BEFORE adding filters or calling the url() / get() methods');\n }\n\n this._uri = '';\n\n this._parseIncludes(state, options);\n this._parseFields(state, options);\n this._parseFilters(state, options);\n this._parsePagination(state, options);\n this._parseSort(state, options);\n\n return this._uri;\n }\n\n /**\n * Validate that the given limit is accepted by the JSON:API driver\n *\n * The JSON:API specification leaves pagination semantics to the server and\n * does not define a \"fetch all\" sentinel, so only positive integers are\n * accepted.\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 * Parse and append field selection parameters\n *\n * Validates that each field model exists either as the main resource\n * or in the includes list. Fields are grouped by type in bracket notation.\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @returns The generated field selection parameter string\n * @throws Error if resource is required but not set\n * @throws UnselectableModelError if a field model is not in resource or includes\n */\n private _parseFields(state: IQueryBuilderState, options: QueryBuilderOptions): string {\n if (!Object.keys(state.fields).length) {\n return this._uri;\n }\n\n if (!state.resource) {\n throw new Error('While selecting fields, the -> resource <- is required');\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 f: Record<string, string> = {};\n\n for (const k in state.fields) {\n if (state.fields.hasOwnProperty(k)) {\n if (k !== state.resource && !state.includes.includes(k)) {\n throw new UnselectableModelError(k);\n }\n\n Object.assign(f, { [`${options.fields}[${k}]`]: state.fields[k].join(',') });\n }\n }\n\n const param = `${this._prepend(state)}${qs.stringify(f, { encode: false })}`;\n this._uri += param;\n\n return param;\n }\n\n /**\n * Parse and append filter parameters\n *\n * Generates filter parameters in bracket notation: `filter[key]=value1,value2`\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @returns The generated filter parameter string\n */\n private _parseFilters(state: IQueryBuilderState, options: QueryBuilderOptions): string {\n const keys = Object.keys(state.filters);\n\n if (!keys.length) {\n return this._uri;\n }\n\n const f = {\n [`${options.filters}`]: keys.reduce((acc: Record<string, string>, key: string) => {\n return Object.assign(acc, { [key]: state.filters[key].join(',') });\n }, {})\n };\n const param = `${this._prepend(state)}${qs.stringify(f, { encode: false })}`;\n\n this._uri += param;\n\n return param;\n }\n\n /**\n * Parse and append include parameters\n *\n * Generates: `include=author,comments.author`\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @returns The generated include parameter string\n */\n private _parseIncludes(state: IQueryBuilderState, options: QueryBuilderOptions): string {\n if (!state.includes.length) {\n return this._uri;\n }\n\n const param = `${this._prepend(state)}${options.includes}=${state.includes}`;\n this._uri += param;\n\n return param;\n }\n\n /**\n * Parse and append pagination parameters in JSON:API bracket notation\n *\n * Generates: `page[number]=1&page[size]=15`\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @returns The generated pagination parameter string\n */\n private _parsePagination(state: IQueryBuilderState, options: QueryBuilderOptions): string {\n const pagination = qs.stringify(\n { [options.page]: { number: state.page, size: state.limit } },\n { encode: false }\n );\n const param = `${this._prepend(state)}${pagination}`;\n\n this._uri += param;\n\n return param;\n }\n\n /**\n * Parse and append sort parameters\n *\n * Generates: `sort=-field1,field2` where `-` prefix indicates DESC order\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @returns The generated sort parameter string\n */\n private _parseSort(state: IQueryBuilderState, options: QueryBuilderOptions): string {\n let param = '';\n\n if (!state.sorts.length) {\n return param;\n }\n\n param = `${this._prepend(state)}${options.sort}=`;\n\n state.sorts.forEach((sort, idx) => {\n param += `${sort.order === SortEnum.DESC ? '-' : ''}${sort.field}`;\n\n if (idx < state.sorts.length - 1) {\n param += ',';\n }\n });\n\n this._uri += param;\n\n return param;\n }\n\n /**\n * Determine the appropriate URI prefix based on the current accumulator state\n *\n * Returns the full base path with `?` for the first parameter,\n * or `&` for subsequent parameters.\n *\n * @param state - The current query builder state\n * @returns The prefix string to prepend to the next parameter\n */\n private _prepend(state: IQueryBuilderState): string {\n if (this._uri) {\n return '&';\n }\n\n return state.baseUrl ? `${state.baseUrl}/${state.resource}?` : `/${state.resource}?`;\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: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 * @see https://jsonapi.org/format/\n */\nexport class JsonApiResponseStrategy implements IResponseStrategy {\n\n /**\n * Parse a JSON:API pagination response into a PaginatedCollection\n *\n * Supports dot-notation key paths for accessing nested values.\n * Computes `from` and `to` from `currentPage` and `perPage` when\n * they are not directly available in the response.\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 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.current-page').\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 not found\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _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 the path resolves to a value in the response, use it.\n * Otherwise, compute it from currentPage and perPage:\n * `(currentPage - 1) * perPage + 1`\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 computed \"from\" index\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _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 the path resolves to a value in the response, use it.\n * Otherwise, compute it from currentPage, perPage, and total:\n * `Math.min(currentPage * perPage, total)`\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 computed \"to\" index\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _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 { InvalidLimitError } from '../errors/invalid-limit.error';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { IRequestStrategy } from '../interfaces/request-strategy.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\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 implements IRequestStrategy {\n\n /**\n * Build a pagination-only URI from the given state\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 resource is not set\n */\n public buildUri(state: IQueryBuilderState, options: QueryBuilderOptions): string {\n if (!state.resource) {\n throw new Error('Set the resource property BEFORE calling the url() / get() methods');\n }\n\n const base = state.baseUrl ? `${state.baseUrl}/${state.resource}` : `/${state.resource}`;\n\n return `${base}?${options.limit}=${state.limit}&${options.page}=${state.page}`;\n }\n\n /**\n * Validate that the given limit is accepted by the Laravel driver\n *\n * Laravel pagination does not recognize `-1` as a \"fetch all\" sentinel,\n * so only positive integers are accepted.\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","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 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 * ...\n * }\n * ```\n */\nexport class LaravelResponseStrategy implements IResponseStrategy {\n\n /**\n * Parse a flat Laravel 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 { 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 { IRequestStrategy } from '../interfaces/request-strategy.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\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 implements IRequestStrategy {\n\n /**\n * Accumulator for composing the URI string\n */\n private _uri = '';\n\n /**\n * Build a URI string from the given state using the NestJS paginate format\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 model is not set\n */\n public buildUri(state: IQueryBuilderState, options: QueryBuilderOptions): string {\n if (!state.resource) {\n throw new Error('Set the resource property BEFORE adding filters or calling the url() / get() methods');\n }\n\n this._uri = '';\n\n this._parseFilters(state, options);\n this._parseOperatorFilters(state, options);\n this._parseSort(state, options);\n this._parseSelect(state, options);\n this._parseSearch(state, options);\n this._parseLimit(state, options);\n this._parsePage(state, options);\n\n return this._uri;\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 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 * Parse and append simple filter parameters\n *\n * Generates: `filter.field=value1,value2` for each filter\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n */\n private _parseFilters(state: IQueryBuilderState, options: QueryBuilderOptions): 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 const param = `${this._prepend(state)}${options.filters}.${key}=${values}`;\n this._uri += param;\n });\n }\n\n /**\n * Parse and append the limit parameter\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n */\n private _parseLimit(state: IQueryBuilderState, options: QueryBuilderOptions): void {\n const param = `${this._prepend(state)}${options.limit}=${state.limit}`;\n this._uri += param;\n }\n\n /**\n * Parse and append operator filter parameters\n *\n * Groups operator filters by field and generates:\n * - Single value: `filter.field=$operator:value`\n * - Multiple values ($in, $btw): `filter.field=$operator:val1,val2`\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n */\n private _parseOperatorFilters(state: IQueryBuilderState, options: QueryBuilderOptions): void {\n if (!state.operatorFilters.length) {\n return;\n }\n\n state.operatorFilters.forEach((opFilter: IOperatorFilter) => {\n const values = opFilter.values.join(',');\n const param = `${this._prepend(state)}${options.filters}.${opFilter.field}=${opFilter.operator}:${values}`;\n this._uri += param;\n });\n }\n\n /**\n * Parse and append the page parameter\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n */\n private _parsePage(state: IQueryBuilderState, options: QueryBuilderOptions): void {\n const param = `${this._prepend(state)}${options.page}=${state.page}`;\n this._uri += param;\n }\n\n /**\n * Parse and append the search parameter\n *\n * Generates: `search=term`\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n */\n private _parseSearch(state: IQueryBuilderState, options: QueryBuilderOptions): void {\n if (!state.search) {\n return;\n }\n\n const param = `${this._prepend(state)}${options.search}=${state.search}`;\n this._uri += param;\n }\n\n /**\n * Parse and append the select parameter\n *\n * Generates: `select=col1,col2`\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n */\n private _parseSelect(state: IQueryBuilderState, options: QueryBuilderOptions): void {\n if (!state.select.length) {\n return;\n }\n\n const param = `${this._prepend(state)}${options.select}=${state.select.join(',')}`;\n this._uri += param;\n }\n\n /**\n * Parse and append sort parameters\n *\n * Generates: `sortBy=field1:DESC,field2:ASC`\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n */\n private _parseSort(state: IQueryBuilderState, options: QueryBuilderOptions): void {\n if (!state.sorts.length) {\n return;\n }\n\n const sortPairs = state.sorts.map(sort =>\n `${sort.field}:${sort.order === SortEnum.DESC ? 'DESC' : 'ASC'}`\n );\n\n const param = `${this._prepend(state)}${options.sortBy}=${sortPairs.join(',')}`;\n this._uri += param;\n }\n\n /**\n * Determine the appropriate URI prefix based on the current accumulator state\n *\n * Returns the full base path with `?` for the first parameter,\n * or `&` for subsequent parameters.\n *\n * @param state - The current query builder state\n * @returns The prefix string to prepend to the next parameter\n */\n private _prepend(state: IQueryBuilderState): string {\n if (this._uri) {\n return '&';\n }\n\n return state.baseUrl ? `${state.baseUrl}/${state.resource}?` : `/${state.resource}?`;\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 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 * @see https://github.com/ppetzold/nestjs-paginate\n */\nexport class NestjsResponseStrategy implements IResponseStrategy {\n\n /**\n * Parse a nested NestJS pagination response into a PaginatedCollection\n *\n * Supports dot-notation key paths for accessing nested values.\n * Computes `from` and `to` from `currentPage` and `itemsPerPage` when\n * they are not directly available in the response.\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 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.currentPage').\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 not found\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _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 the path resolves to a value in the response, use it.\n * Otherwise, compute it from currentPage and perPage:\n * `(currentPage - 1) * perPage + 1`\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 computed \"from\" index\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _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 the path resolves to a value in the response, use it.\n * Otherwise, compute it from currentPage, perPage, and total:\n * `Math.min(currentPage * perPage, total)`\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 computed \"to\" index\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _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 * as qs from 'qs';\n\nimport { SortEnum } from '../enums/sort.enum';\nimport { InvalidLimitError } from '../errors/invalid-limit.error';\nimport { UnselectableModelError } from '../errors/unselectable-model.error';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { IRequestStrategy } from '../interfaces/request-strategy.interface';\nimport { QueryBuilderOptions } from '../models/query-builder-options';\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 implements IRequestStrategy {\n\n /**\n * Accumulator for composing the URI string\n */\n private _uri = '';\n\n /**\n * Build a URI string from the given state using the Spatie format\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 resource is not set\n */\n public buildUri(state: IQueryBuilderState, options: QueryBuilderOptions): string {\n if (!state.resource) {\n throw new Error('Set the resource property BEFORE adding filters or calling the url() / get() methods');\n }\n\n this._uri = '';\n\n this._parseIncludes(state, options);\n this._parseFields(state, options);\n this._parseFilters(state, options);\n this._parseLimit(state, options);\n this._parsePage(state, options);\n this._parseSort(state, options);\n\n return this._uri;\n }\n\n /**\n * Validate that the given limit is accepted by the Spatie driver\n *\n * Spatie query-builder does not recognize `-1` as a \"fetch all\" sentinel,\n * so only positive integers are accepted.\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 * Parse and append field selection parameters\n *\n * Validates that each field model exists either as the main resource\n * or in the includes list. Fields are grouped by model in bracket notation.\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @returns The generated field selection parameter string\n * @throws Error if resource is required but not set\n * @throws UnselectableModelError if a field model is not in resource or includes\n */\n private _parseFields(state: IQueryBuilderState, options: QueryBuilderOptions): string {\n if (!Object.keys(state.fields).length) {\n return this._uri;\n }\n\n if (!state.resource) {\n throw new Error('While selecting fields, the -> resource <- is required');\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 f: Record<string, string> = {};\n\n for (const k in state.fields) {\n if (state.fields.hasOwnProperty(k)) {\n if (k !== state.resource && !state.includes.includes(k)) {\n throw new UnselectableModelError(k);\n }\n\n Object.assign(f, { [`${options.fields}[${k}]`]: state.fields[k].join(',') });\n }\n }\n\n const param = `${this._prepend(state)}${qs.stringify(f, { encode: false })}`;\n this._uri += param;\n\n return param;\n }\n\n /**\n * Parse and append filter parameters\n *\n * Generates filter parameters in bracket notation: `filter[key]=value1,value2`\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @returns The generated filter parameter string\n */\n private _parseFilters(state: IQueryBuilderState, options: QueryBuilderOptions): string {\n const keys = Object.keys(state.filters);\n\n if (!keys.length) {\n return this._uri;\n }\n\n const f = {\n [`${options.filters}`]: keys.reduce((acc: Record<string, string>, key: string) => {\n return Object.assign(acc, { [key]: state.filters[key].join(',') });\n }, {})\n };\n const param = `${this._prepend(state)}${qs.stringify(f, { encode: false })}`;\n\n this._uri += param;\n\n return param;\n }\n\n /**\n * Parse and append include parameters\n *\n * Generates: `include=model1,model2`\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @returns The generated include parameter string\n */\n private _parseIncludes(state: IQueryBuilderState, options: QueryBuilderOptions): string {\n if (!state.includes.length) {\n return this._uri;\n }\n\n const param = `${this._prepend(state)}${options.includes}=${state.includes}`;\n this._uri += param;\n\n return param;\n }\n\n /**\n * Parse and append the limit parameter\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @returns The generated limit parameter string\n */\n private _parseLimit(state: IQueryBuilderState, options: QueryBuilderOptions): string {\n const param = `${this._prepend(state)}${options.limit}=${state.limit}`;\n this._uri += param;\n\n return param;\n }\n\n /**\n * Parse and append the page parameter\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @returns The generated page parameter string\n */\n private _parsePage(state: IQueryBuilderState, options: QueryBuilderOptions): string {\n const param = `${this._prepend(state)}${options.page}=${state.page}`;\n this._uri += param;\n\n return param;\n }\n\n /**\n * Parse and append sort parameters\n *\n * Generates: `sort=-field1,field2` where `-` prefix indicates DESC order\n *\n * @param state - The current query builder state\n * @param options - The query parameter key name configuration\n * @returns The generated sort parameter string\n */\n private _parseSort(state: IQueryBuilderState, options: QueryBuilderOptions): string {\n let param = '';\n\n if (!state.sorts.length) {\n return param;\n }\n\n param = `${this._prepend(state)}${options.sort}=`;\n\n state.sorts.forEach((sort, idx) => {\n param += `${sort.order === SortEnum.DESC ? '-' : ''}${sort.field}`;\n\n if (idx < state.sorts.length - 1) {\n param += ',';\n }\n });\n\n this._uri += param;\n\n return param;\n }\n\n /**\n * Determine the appropriate URI prefix based on the current accumulator state\n *\n * Returns the full base path with `?` for the first parameter,\n * or `&` for subsequent parameters.\n *\n * @param state - The current query builder state\n * @returns The prefix string to prepend to the next parameter\n */\n private _prepend(state: IQueryBuilderState): string {\n if (this._uri) {\n return '&';\n }\n\n return state.baseUrl ? `${state.baseUrl}/${state.resource}?` : `/${state.resource}?`;\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 Spatie Query Builder 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 * ...\n * }\n * ```\n *\n * @see https://spatie.be/docs/laravel-query-builder\n */\nexport class SpatieResponseStrategy implements IResponseStrategy {\n\n /**\n * Parse a flat Laravel 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 { EnvironmentProviders, Provider, makeEnvironmentProviders } from '@angular/core';\n\nimport { DriverEnum } from './enums/driver.enum';\nimport { IConfig } from './interfaces/config.interface';\nimport { IPaginationConfig } from './interfaces/pagination-config.interface';\nimport { IRequestStrategy } from './interfaces/request-strategy.interface';\nimport { IResponseStrategy } from './interfaces/response-strategy.interface';\nimport { QueryBuilderOptions } from './models/query-builder-options';\nimport { JsonApiResponseOptions, NestjsResponseOptions, ResponseOptions } from './models/response-options';\nimport { NestService } from './services/nest.service';\nimport { NgQubeeService } from './services/ng-qubee.service';\nimport { PaginationService } from './services/pagination.service';\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 { SpatieRequestStrategy } from './strategies/spatie-request.strategy';\nimport { SpatieResponseStrategy } from './strategies/spatie-response.strategy';\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 * Resolve the request strategy instance for the given driver\n *\n * @param driver - The pagination driver\n * @returns The corresponding request strategy\n */\nfunction resolveRequestStrategy(driver: DriverEnum): IRequestStrategy {\n switch (driver) {\n case DriverEnum.JSON_API:\n return new JsonApiRequestStrategy();\n case DriverEnum.NESTJS:\n return new NestjsRequestStrategy();\n case DriverEnum.SPATIE:\n return new SpatieRequestStrategy();\n case DriverEnum.LARAVEL:\n return new LaravelRequestStrategy();\n }\n}\n\n/**\n * Resolve the response strategy instance for the given driver\n *\n * @param driver - The pagination driver\n * @returns The corresponding response strategy\n */\nfunction resolveResponseStrategy(driver: DriverEnum): IResponseStrategy {\n switch (driver) {\n case DriverEnum.JSON_API:\n return new JsonApiResponseStrategy();\n case DriverEnum.NESTJS:\n return new NestjsResponseStrategy();\n case DriverEnum.SPATIE:\n return new SpatieResponseStrategy();\n case DriverEnum.LARAVEL:\n return new LaravelResponseStrategy();\n }\n}\n\n/**\n * Resolve the driver-specific `ResponseOptions` instance\n *\n * @param driver - The pagination driver\n * @param responseConfig - User-supplied response key overrides\n * @returns A pre-built ResponseOptions (or driver-specific subclass)\n */\nfunction resolveResponseOptions(driver: DriverEnum, responseConfig: IPaginationConfig): ResponseOptions {\n if (driver === DriverEnum.JSON_API) {\n return new JsonApiResponseOptions(responseConfig);\n }\n\n if (driver === DriverEnum.NESTJS) {\n return new NestjsResponseOptions(responseConfig);\n }\n\n return new ResponseOptions(responseConfig);\n}\n\n/**\n * Build the core provider list shared by `provideNgQubee()` and\n * `NgQubeeModule.forRoot()`\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 requestOptions = new QueryBuilderOptions(Object.assign({}, config.request));\n const responseOptions = resolveResponseOptions(driver, Object.assign({}, config.response));\n\n return [\n { provide: NG_QUBEE_DRIVER, useValue: driver },\n { provide: NG_QUBEE_REQUEST_STRATEGY, useValue: resolveRequestStrategy(driver) },\n { provide: NG_QUBEE_REQUEST_OPTIONS, useValue: requestOptions },\n { provide: NG_QUBEE_RESPONSE_STRATEGY, useValue: resolveResponseStrategy(driver) },\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 * Enum representing the available filter operators for the NestJS driver\n *\n * These operators map to the nestjs-paginate filter syntax:\n * `filter.field=$operator:value`\n *\n * @see https://github.com/ppetzold/nestjs-paginate\n */\nexport enum FilterOperatorEnum {\n BTW = '$btw',\n CONTAINS = '$contains',\n EQ = '$eq',\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 SW = '$sw'\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/sort.enum';\n\n// Error classes\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/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/spatie-request.strategy';\nexport * from './lib/strategies/spatie-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,CAAA,WAAW,GAAX,WAAW;;IAG/B;AAEA;;;;;;;;;;;;A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S;AAAZ,CAAA,UAAY,kBAAkB,EAAA;AAC5B,IAAA,kBAAA,CAAA,KAAA,CAAA,GAAA,MAAY;AACZ,IAAA,kBAAA,CAAA,UAAA,CAAA,GAAA,WAAsB;AACtB,IAAA,kBAAA,CAAA,IAAA,CAAA,GAAA,KAAU;AACV,IAAA,kBAAA,CAAA,IAAA,CAAA,GAAA,KAAU;AACV,IAAA,kBAAA,CAAA,KAAA,CAAA,GAAA,MAAY;AACZ,IAAA,kBAAA,CAAA,OAAA,CAAA,GAAA,QAAgB;AAChB,IAAA,kBAAA,CAAA,IAAA,CAAA,GAAA,KAAU;AACV,IAAA,kBAAA,CAAA,IAAA,CAAA,GAAA,KAAU;AACV,IAAA,kBAAA,CAAA,KAAA,CAAA,GAAA,MAAY;AACZ,IAAA,kBAAA,CAAA,KAAA,CAAA,GAAA,MAAY;AACZ,IAAA,kBAAA,CAAA,MAAA,CAAA,GAAA,OAAc;AACd,IAAA,kBAAA,CAAA,IAAA,CAAA,GAAA,KAAU;AACZ,CAAC,EAbW,kBAAkB,KAAlB,kBAAkB,GAAA,EAAA,CAAA,CAAA;;ACR9B;;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/enums/driver.enum.ts","../../../src/lib/models/response-options.ts","../../../src/lib/enums/sort.enum.ts","../../../src/lib/errors/unselectable-model.error.ts","../../../src/lib/errors/invalid-limit.error.ts","../../../src/lib/strategies/abstract-request.strategy.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/laravel-response.strategy.ts","../../../src/lib/strategies/nestjs-request.strategy.ts","../../../src/lib/strategies/nestjs-response.strategy.ts","../../../src/lib/enums/filter-operator.enum.ts","../../../src/lib/enums/pagination-mode.enum.ts","../../../src/lib/errors/invalid-filter-operator-value.error.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/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-filter-operator.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 JSON_API = 'json-api',\n LARAVEL = 'laravel',\n NESTJS = 'nestjs',\n POSTGREST = 'postgrest',\n SPATIE = 'spatie'\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 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","export enum SortEnum {\n ASC = 'asc',\n DESC = 'desc'\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}","/**\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 * 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 * 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 * ...\n * }\n * ```\n */\nexport class LaravelResponseStrategy implements IResponseStrategy {\n\n /**\n * Parse a flat Laravel 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 { 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 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","/**\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';\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","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 { 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 Spatie Query Builder 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 * ...\n * }\n * ```\n *\n * @see https://spatie.be/docs/laravel-query-builder\n */\nexport class SpatieResponseStrategy implements IResponseStrategy {\n\n /**\n * Parse a flat Laravel 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 { 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 { JsonApiResponseOptions, NestjsResponseOptions, ResponseOptions } from '../models/response-options';\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';\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.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","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 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 * 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';\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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