ng-qubee 2.1.0 → 3.0.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.
Files changed (32) hide show
  1. package/README.md +301 -54
  2. package/fesm2022/ng-qubee.mjs +1257 -264
  3. package/fesm2022/ng-qubee.mjs.map +1 -1
  4. package/package.json +4 -4
  5. package/types/ng-qubee.d.ts +1302 -0
  6. package/index.d.ts +0 -5
  7. package/lib/enums/sort.enum.d.ts +0 -4
  8. package/lib/errors/invalid-limit.error.d.ts +0 -3
  9. package/lib/errors/invalid-model-name.error.d.ts +0 -3
  10. package/lib/errors/invalid-page-number.error.d.ts +0 -3
  11. package/lib/errors/key-not-found.error.d.ts +0 -3
  12. package/lib/errors/unselectable-model.error.d.ts +0 -3
  13. package/lib/interfaces/config.interface.d.ts +0 -6
  14. package/lib/interfaces/fields.interface.d.ts +0 -3
  15. package/lib/interfaces/filters.interface.d.ts +0 -3
  16. package/lib/interfaces/nest-state.interface.d.ts +0 -4
  17. package/lib/interfaces/normalized.interface.d.ts +0 -3
  18. package/lib/interfaces/page.interface.d.ts +0 -2
  19. package/lib/interfaces/paginated-object.interface.d.ts +0 -3
  20. package/lib/interfaces/pagination-config.interface.d.ts +0 -14
  21. package/lib/interfaces/query-builder-config.interface.d.ts +0 -9
  22. package/lib/interfaces/query-builder-state.interface.d.ts +0 -13
  23. package/lib/interfaces/sort.interface.d.ts +0 -5
  24. package/lib/models/paginated-collection.d.ts +0 -30
  25. package/lib/models/query-builder-options.d.ts +0 -11
  26. package/lib/models/response-options.d.ts +0 -16
  27. package/lib/ng-qubee.module.d.ts +0 -9
  28. package/lib/provide-ngqubee.d.ts +0 -21
  29. package/lib/services/nest.service.d.ts +0 -182
  30. package/lib/services/ng-qubee.service.d.ts +0 -147
  31. package/lib/services/pagination.service.d.ts +0 -13
  32. package/public-api.d.ts +0 -20
@@ -0,0 +1,1302 @@
1
+ import * as i0 from '@angular/core';
2
+ import { ModuleWithProviders, EnvironmentProviders, Signal } from '@angular/core';
3
+ import { Observable } from 'rxjs';
4
+
5
+ interface INormalized {
6
+ [k: number | string]: number[] | string[];
7
+ }
8
+
9
+ interface IPaginatedObject {
10
+ [k: string]: any;
11
+ }
12
+
13
+ declare class PaginatedCollection<T extends IPaginatedObject> {
14
+ data: T[];
15
+ readonly page: number;
16
+ readonly from?: number | undefined;
17
+ readonly to?: number | undefined;
18
+ readonly total?: number | undefined;
19
+ readonly perPage?: number | undefined;
20
+ readonly prevPageUrl?: string | undefined;
21
+ readonly nextPageUrl?: string | undefined;
22
+ readonly lastPage?: number | undefined;
23
+ readonly firstPageUrl?: string | undefined;
24
+ readonly lastPageUrl?: string | undefined;
25
+ constructor(data: T[], page: number, from?: number | undefined, to?: number | undefined, total?: number | undefined, perPage?: number | undefined, prevPageUrl?: string | undefined, nextPageUrl?: string | undefined, lastPage?: number | undefined, firstPageUrl?: string | undefined, lastPageUrl?: string | undefined);
26
+ /**
27
+ * Normalize the collection to a paginated list of ids for state-managed applications.
28
+ *
29
+ * This method returns a single key object, where the key is the page number and the associated value is
30
+ * an array of ids. Each id is fetched by the collection items, looking up for the "id" key. If an id is supplied
31
+ * to this method, it will be used instead of the default "id" key.
32
+ *
33
+ * Please note that in case the key doesn't exist in the collection's item, a KeyNotFoundError is thrown
34
+ *
35
+ * @param k A key to use instead of the default "id": this will be searched inside each element of the collection
36
+ * @returns []
37
+ * @throws KeyNotFoundItem
38
+ */
39
+ normalize(id?: string): INormalized;
40
+ }
41
+
42
+ /**
43
+ * Enum representing the available pagination driver types
44
+ *
45
+ * Each driver encapsulates the full format knowledge for both
46
+ * request building (URI generation) and response parsing.
47
+ */
48
+ declare enum DriverEnum {
49
+ LARAVEL = "laravel",
50
+ NESTJS = "nestjs",
51
+ SPATIE = "spatie"
52
+ }
53
+
54
+ /**
55
+ * Configuration interface for customizing response field key names
56
+ *
57
+ * Each property maps a logical pagination concept to the actual key name
58
+ * used in the API response. The defaults depend on the selected driver.
59
+ *
60
+ * For the NestJS driver, dot-notation paths are used to access nested values
61
+ * (e.g., 'meta.currentPage', 'links.next').
62
+ */
63
+ interface IPaginationConfig {
64
+ /** Key for the current page number (Laravel: 'current_page', NestJS: 'meta.currentPage') */
65
+ currentPage?: string;
66
+ /** Key for the data array (default: 'data') */
67
+ data?: string;
68
+ /** Key for the first page URL (Laravel: 'first_page_url', NestJS: 'links.first') */
69
+ firstPageUrl?: string;
70
+ /** Key for the "from" item index (Laravel: 'from', NestJS: computed) */
71
+ from?: string;
72
+ /** Key for the last page number (Laravel: 'last_page', NestJS: 'meta.totalPages') */
73
+ lastPage?: string;
74
+ /** Key for the last page URL (Laravel: 'last_page_url', NestJS: 'links.last') */
75
+ lastPageUrl?: string;
76
+ /** Key for the next page URL (Laravel: 'next_page_url', NestJS: 'links.next') */
77
+ nextPageUrl?: string;
78
+ /** Key for the base path (Laravel only, default: 'path') */
79
+ path?: string;
80
+ /** Key for items per page (Laravel: 'per_page', NestJS: 'meta.itemsPerPage') */
81
+ perPage?: string;
82
+ /** Key for the previous page URL (Laravel: 'prev_page_url', NestJS: 'links.previous') */
83
+ prevPageUrl?: string;
84
+ /** Key for the "to" item index (Laravel: 'to', NestJS: computed) */
85
+ to?: string;
86
+ /** Key for the total item count (Laravel: 'total', NestJS: 'meta.totalItems') */
87
+ total?: string;
88
+ }
89
+
90
+ /**
91
+ * Configuration interface for customizing request query parameter key names
92
+ *
93
+ * Each property maps a logical query concept to the actual query parameter name
94
+ * used in the generated URI. The defaults depend on the selected driver.
95
+ */
96
+ interface IQueryBuilderConfig {
97
+ /** Key for the appends parameter (Laravel only, default: 'append') */
98
+ appends?: string;
99
+ /** Key for the fields parameter (Laravel: 'fields', NestJS: 'select') */
100
+ fields?: string;
101
+ /** Key for the filters parameter (default: 'filter') */
102
+ filters?: string;
103
+ /** Key for the includes parameter (Laravel only, default: 'include') */
104
+ includes?: string;
105
+ /** Key for the limit parameter (default: 'limit') */
106
+ limit?: string;
107
+ /** Key for the page parameter (default: 'page') */
108
+ page?: string;
109
+ /** Key for the search parameter (NestJS only, default: 'search') */
110
+ search?: string;
111
+ /** Key for the select parameter (NestJS only, default: 'select') */
112
+ select?: string;
113
+ /** Key for the sort parameter (Laravel: 'sort', NestJS: 'sortBy') */
114
+ sort?: string;
115
+ /** Key for the sortBy parameter (NestJS only, default: 'sortBy') */
116
+ sortBy?: string;
117
+ }
118
+
119
+ /**
120
+ * Main configuration interface for ng-qubee
121
+ *
122
+ * Allows configuring the pagination driver and customizing
123
+ * both request query parameter keys and response field keys.
124
+ *
125
+ * @example
126
+ * ```typescript
127
+ * const config: IConfig = {
128
+ * driver: DriverEnum.NESTJS,
129
+ * request: { filters: 'filter', sort: 'sortBy' },
130
+ * response: { data: 'data' }
131
+ * };
132
+ * ```
133
+ */
134
+ interface IConfig {
135
+ /** The pagination driver to use */
136
+ driver: DriverEnum;
137
+ /** Custom key names for request query parameters */
138
+ request?: IQueryBuilderConfig;
139
+ /** Custom key names for response field mapping */
140
+ response?: IPaginationConfig;
141
+ }
142
+
143
+ declare class NgQubeeModule {
144
+ /**
145
+ * Configure NgQubee for the root module
146
+ *
147
+ * @param config - Configuration object with driver, and optional request and response settings
148
+ * @returns Module with providers configured for the specified driver
149
+ */
150
+ static forRoot(config: IConfig): ModuleWithProviders<NgQubeeModule>;
151
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgQubeeModule, never>;
152
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NgQubeeModule, never, never, never>;
153
+ static ɵinj: i0.ɵɵInjectorDeclaration<NgQubeeModule>;
154
+ }
155
+
156
+ /**
157
+ * Sets up providers necessary to enable `NgQubee` functionality for the application.
158
+ *
159
+ * @usageNotes
160
+ *
161
+ * Basic example with the Laravel driver:
162
+ * ```
163
+ * bootstrapApplication(AppComponent, {
164
+ * providers: [provideNgQubee({ driver: DriverEnum.LARAVEL })]
165
+ * });
166
+ * ```
167
+ *
168
+ * Spatie driver example:
169
+ * ```
170
+ * import { DriverEnum } from 'ng-qubee';
171
+ *
172
+ * bootstrapApplication(AppComponent, {
173
+ * providers: [provideNgQubee({ driver: DriverEnum.SPATIE })]
174
+ * });
175
+ * ```
176
+ *
177
+ * NestJS driver example:
178
+ * ```
179
+ * import { DriverEnum } from 'ng-qubee';
180
+ *
181
+ * bootstrapApplication(AppComponent, {
182
+ * providers: [provideNgQubee({ driver: DriverEnum.NESTJS })]
183
+ * });
184
+ * ```
185
+ *
186
+ * @publicApi
187
+ * @param config - Configuration object compliant to the IConfig interface
188
+ * @returns A set of providers to setup NgQubee
189
+ */
190
+ declare function provideNgQubee(config: IConfig): EnvironmentProviders;
191
+
192
+ /**
193
+ * Enum representing the available filter operators for the NestJS driver
194
+ *
195
+ * These operators map to the nestjs-paginate filter syntax:
196
+ * `filter.field=$operator:value`
197
+ *
198
+ * @see https://github.com/ppetzold/nestjs-paginate
199
+ */
200
+ declare enum FilterOperatorEnum {
201
+ BTW = "$btw",
202
+ CONTAINS = "$contains",
203
+ EQ = "$eq",
204
+ GT = "$gt",
205
+ GTE = "$gte",
206
+ ILIKE = "$ilike",
207
+ IN = "$in",
208
+ LT = "$lt",
209
+ LTE = "$lte",
210
+ NOT = "$not",
211
+ NULL = "$null",
212
+ SW = "$sw"
213
+ }
214
+
215
+ declare enum SortEnum {
216
+ ASC = "asc",
217
+ DESC = "desc"
218
+ }
219
+
220
+ interface IFields {
221
+ [model: string]: string[];
222
+ }
223
+
224
+ interface IFilters {
225
+ [k: string]: (string | number | boolean)[];
226
+ }
227
+
228
+ /**
229
+ * Represents a filter with an explicit operator for the NestJS driver
230
+ *
231
+ * Operator filters produce query parameters in the format:
232
+ * `filter.field=$operator:value`
233
+ *
234
+ * @example
235
+ * ```typescript
236
+ * const filter: IOperatorFilter = {
237
+ * field: 'age',
238
+ * operator: FilterOperatorEnum.GTE,
239
+ * values: [18]
240
+ * };
241
+ * // Produces: filter.age=$gte:18
242
+ * ```
243
+ */
244
+ interface IOperatorFilter {
245
+ /** The field name to filter on */
246
+ field: string;
247
+ /** The filter operator to apply */
248
+ operator: FilterOperatorEnum;
249
+ /** The value(s) for the filter */
250
+ values: (string | number | boolean)[];
251
+ }
252
+
253
+ interface ISort {
254
+ field: string;
255
+ order: SortEnum;
256
+ }
257
+
258
+ /**
259
+ * Represents the complete query builder state
260
+ *
261
+ * This is a superset that covers the needs of all drivers.
262
+ * Each driver reads only the fields it needs from this state.
263
+ */
264
+ interface IQueryBuilderState {
265
+ /** The base URL to prepend to generated URIs */
266
+ baseUrl: string;
267
+ /** Per-model field selection (Spatie only) */
268
+ fields: IFields;
269
+ /** Simple key-value filters (Spatie and NestJS) */
270
+ filters: IFilters;
271
+ /** Related models to include (Spatie only) */
272
+ includes: string[];
273
+ /** Number of items per page (all drivers) */
274
+ limit: number;
275
+ /** Filters with explicit operators (NestJS only) */
276
+ operatorFilters: IOperatorFilter[];
277
+ /** Current page number (all drivers) */
278
+ page: number;
279
+ /** The API resource name for URI generation (all drivers) */
280
+ resource: string;
281
+ /** Full-text search term (NestJS only) */
282
+ search: string;
283
+ /** Flat field selection (NestJS only) */
284
+ select: string[];
285
+ /** Sort configurations (Spatie and NestJS) */
286
+ sorts: ISort[];
287
+ }
288
+
289
+ /**
290
+ * Resolved query parameter key names with defaults applied
291
+ *
292
+ * Maps logical query concepts to the actual query parameter names
293
+ * used in the generated URI. Unset values fall back to defaults.
294
+ */
295
+ declare class QueryBuilderOptions {
296
+ readonly appends: string;
297
+ readonly fields: string;
298
+ readonly filters: string;
299
+ readonly includes: string;
300
+ readonly limit: string;
301
+ readonly page: string;
302
+ readonly search: string;
303
+ readonly select: string;
304
+ readonly sort: string;
305
+ readonly sortBy: string;
306
+ constructor(options: IQueryBuilderConfig);
307
+ }
308
+
309
+ /**
310
+ * Strategy interface for building request URIs
311
+ *
312
+ * Each driver implements this interface to produce URIs
313
+ * in the format expected by the corresponding backend.
314
+ */
315
+ interface IRequestStrategy {
316
+ /**
317
+ * Build a URI string from the given query builder state
318
+ *
319
+ * @param state - The current query builder state
320
+ * @param options - The query parameter key name configuration
321
+ * @returns The composed URI string
322
+ */
323
+ buildUri(state: IQueryBuilderState, options: QueryBuilderOptions): string;
324
+ }
325
+
326
+ declare class NestService {
327
+ /**
328
+ * Private writable signal that holds the Query Builder state
329
+ *
330
+ * @type {IQueryBuilderState}
331
+ */
332
+ private _nest;
333
+ /**
334
+ * A computed signal that makes readonly the writable signal _nest
335
+ *
336
+ * @type {Signal<IQueryBuilderState>}
337
+ */
338
+ nest: Signal<IQueryBuilderState>;
339
+ constructor();
340
+ /**
341
+ * Set the base URL for the API
342
+ *
343
+ * @param {string} baseUrl - The base URL to prepend to generated URIs
344
+ * @example
345
+ * service.baseUrl = 'https://api.example.com';
346
+ */
347
+ set baseUrl(baseUrl: string);
348
+ /**
349
+ * Set the limit for paginated results
350
+ * Must be a positive integer greater than 0
351
+ *
352
+ * @param {number} limit - The number of items per page
353
+ * @throws {InvalidLimitError} If limit is not a positive integer
354
+ * @example
355
+ * service.limit = 25;
356
+ */
357
+ set limit(limit: number);
358
+ /**
359
+ * Set the page number for pagination
360
+ * Must be a positive integer greater than 0
361
+ *
362
+ * @param {number} page - The page number to fetch
363
+ * @throws {InvalidPageNumberError} If page is not a positive integer
364
+ * @example
365
+ * service.page = 2;
366
+ */
367
+ set page(page: number);
368
+ /**
369
+ * Set the resource name for the query
370
+ * Must be a non-empty string
371
+ *
372
+ * @param {string} resource - The API resource name (e.g., 'users', 'posts')
373
+ * @throws {InvalidResourceNameError} If resource is not a non-empty string
374
+ * @example
375
+ * service.resource = 'users';
376
+ */
377
+ set resource(resource: string);
378
+ private _clone;
379
+ /**
380
+ * Validates that the limit is a positive integer
381
+ *
382
+ * @param {number} limit - The limit value to validate
383
+ * @throws {InvalidLimitError} If limit is not a positive integer
384
+ * @private
385
+ */
386
+ private _validateLimit;
387
+ /**
388
+ * Validates that the page number is a positive integer
389
+ *
390
+ * @param {number} page - The page number to validate
391
+ * @throws {InvalidPageNumberError} If page is not a positive integer
392
+ * @private
393
+ */
394
+ private _validatePageNumber;
395
+ /**
396
+ * Validates that the resource name is a non-empty string
397
+ *
398
+ * @param {string} resource - The resource name to validate
399
+ * @throws {InvalidResourceNameError} If resource is not a non-empty string
400
+ * @private
401
+ */
402
+ private _validateResourceName;
403
+ /**
404
+ * Add selectable fields for the given model to the request
405
+ * Automatically prevents duplicate fields for each model
406
+ *
407
+ * @param {IFields} fields - Object mapping model names to arrays of field names
408
+ * @return {void}
409
+ * @example
410
+ * service.addFields({ users: ['id', 'email', 'username'] });
411
+ * service.addFields({ posts: ['title', 'content'] });
412
+ */
413
+ addFields(fields: IFields): void;
414
+ /**
415
+ * Add filters to the request
416
+ * Automatically prevents duplicate filter values for each filter key
417
+ *
418
+ * @param {IFilters} filters - Object mapping filter keys to arrays of values
419
+ * @return {void}
420
+ * @example
421
+ * service.addFilters({ id: [1, 2, 3] });
422
+ * service.addFilters({ status: ['active', 'pending'] });
423
+ */
424
+ addFilters(filters: IFilters): void;
425
+ /**
426
+ * Add resources to include with the request
427
+ * Automatically prevents duplicate includes
428
+ *
429
+ * @param {string[]} includes - Array of resource names to include in the response
430
+ * @return {void}
431
+ * @example
432
+ * service.addIncludes(['profile', 'posts']);
433
+ * service.addIncludes(['comments']);
434
+ */
435
+ addIncludes(includes: string[]): void;
436
+ /**
437
+ * Add filters with explicit operators (NestJS only)
438
+ * Automatically prevents duplicate operator filters for the same field + operator combination
439
+ *
440
+ * @param {IOperatorFilter[]} filters - Array of operator filter configurations
441
+ * @return {void}
442
+ * @example
443
+ * import { FilterOperatorEnum } from 'ng-qubee';
444
+ * service.addOperatorFilters([{ field: 'age', operator: FilterOperatorEnum.GTE, values: [18] }]);
445
+ */
446
+ addOperatorFilters(filters: IOperatorFilter[]): void;
447
+ /**
448
+ * Add flat field selection columns (NestJS only)
449
+ * Automatically prevents duplicate select fields
450
+ *
451
+ * @param {string[]} fields - Array of column names to select
452
+ * @return {void}
453
+ * @example
454
+ * service.addSelect(['id', 'name', 'email']);
455
+ */
456
+ addSelect(fields: string[]): void;
457
+ /**
458
+ * Add a field that should be used for sorting data
459
+ *
460
+ * @param {ISort} sort - Sort configuration with field name and order (ASC/DESC)
461
+ * @return {void}
462
+ * @example
463
+ * import { SortEnum } from 'ng-qubee';
464
+ * service.addSort({ field: 'created_at', order: SortEnum.DESC });
465
+ * service.addSort({ field: 'name', order: SortEnum.ASC });
466
+ */
467
+ addSort(sort: ISort): void;
468
+ /**
469
+ * Remove fields for the given model
470
+ * Uses deep cloning to prevent mutations to the original state
471
+ *
472
+ * @param {IFields} fields - Object mapping model names to arrays of field names to remove
473
+ * @return {void}
474
+ * @example
475
+ * service.deleteFields({ users: ['email'] });
476
+ * service.deleteFields({ posts: ['content', 'body'] });
477
+ */
478
+ deleteFields(fields: IFields): void;
479
+ /**
480
+ * Remove filters from the request
481
+ * Uses deep cloning to prevent mutations to the original state
482
+ *
483
+ * @param {...string[]} filters - Filter keys to remove
484
+ * @return {void}
485
+ * @example
486
+ * service.deleteFilters('id');
487
+ * service.deleteFilters('status', 'type');
488
+ */
489
+ deleteFilters(...filters: string[]): void;
490
+ /**
491
+ * Remove includes from the request
492
+ *
493
+ * @param {...string[]} includes - Include names to remove
494
+ * @return {void}
495
+ * @example
496
+ * service.deleteIncludes('profile');
497
+ * service.deleteIncludes('posts', 'comments');
498
+ */
499
+ deleteIncludes(...includes: string[]): void;
500
+ /**
501
+ * Remove operator filters by field name (NestJS only)
502
+ *
503
+ * @param {...string[]} fields - Field names of operator filters to remove
504
+ * @return {void}
505
+ * @example
506
+ * service.deleteOperatorFilters('age');
507
+ * service.deleteOperatorFilters('price', 'quantity');
508
+ */
509
+ deleteOperatorFilters(...fields: string[]): void;
510
+ /**
511
+ * Remove the search term from the state (NestJS only)
512
+ *
513
+ * @return {void}
514
+ * @example
515
+ * service.deleteSearch();
516
+ */
517
+ deleteSearch(): void;
518
+ /**
519
+ * Remove flat field selections from the state (NestJS only)
520
+ *
521
+ * @param {...string[]} fields - Field names to remove from selection
522
+ * @return {void}
523
+ * @example
524
+ * service.deleteSelect('email');
525
+ * service.deleteSelect('name', 'email');
526
+ */
527
+ deleteSelect(...fields: string[]): void;
528
+ /**
529
+ * Remove sorts from the request by field name
530
+ *
531
+ * @param {...string[]} sorts - Field names of sorts to remove
532
+ * @return {void}
533
+ * @example
534
+ * service.deleteSorts('created_at');
535
+ * service.deleteSorts('name', 'created_at');
536
+ */
537
+ deleteSorts(...sorts: string[]): void;
538
+ /**
539
+ * Set the full-text search term (NestJS only)
540
+ *
541
+ * @param {string} search - The search term
542
+ * @return {void}
543
+ * @example
544
+ * service.setSearch('john doe');
545
+ */
546
+ setSearch(search: string): void;
547
+ /**
548
+ * Reset the query builder state to initial values
549
+ * Clears all fields, filters, includes, sorts, and resets pagination
550
+ *
551
+ * @return {void}
552
+ * @example
553
+ * service.reset();
554
+ */
555
+ reset(): void;
556
+ static ɵfac: i0.ɵɵFactoryDeclaration<NestService, never>;
557
+ static ɵprov: i0.ɵɵInjectableDeclaration<NestService>;
558
+ }
559
+
560
+ declare class NgQubeeService {
561
+ private _nestService;
562
+ /**
563
+ * The active pagination driver
564
+ */
565
+ private _driver;
566
+ /**
567
+ * Resolved query parameter key name options
568
+ */
569
+ private _options;
570
+ /**
571
+ * The request strategy that builds URIs for the active driver
572
+ */
573
+ private _requestStrategy;
574
+ /**
575
+ * Internal BehaviorSubject that holds the latest generated URI
576
+ */
577
+ private _uri$;
578
+ /**
579
+ * Observable that emits non-empty generated URIs
580
+ */
581
+ uri$: Observable<string>;
582
+ constructor(_nestService: NestService, requestStrategy: IRequestStrategy, driver: DriverEnum, options?: IQueryBuilderConfig);
583
+ /**
584
+ * Assert that the active driver is one of the allowed drivers
585
+ *
586
+ * @param allowed - The allowed drivers
587
+ * @param error - The error to throw if the driver is not allowed
588
+ * @throws The provided error if the active driver is not in the allowed list
589
+ */
590
+ private _assertDriver;
591
+ /**
592
+ * Add fields to the select statement for the given model (Spatie only)
593
+ *
594
+ * @param model - Model that holds the fields
595
+ * @param fields - Fields to select
596
+ * @returns {this}
597
+ * @throws {UnsupportedFieldSelectionError} If the active driver does not support per-model field selection
598
+ */
599
+ addFields(model: string, fields: string[]): this;
600
+ /**
601
+ * Add a filter with the given value(s) (Spatie and NestJS only)
602
+ *
603
+ * Produces: `filter[field]=value` (Spatie) or `filter.field=value` (NestJS)
604
+ *
605
+ * @param {string} field - Name of the field to filter
606
+ * @param {(string | number | boolean)[]} values - The needle(s)
607
+ * @returns {this}
608
+ * @throws {UnsupportedFilterError} If the active driver does not support filters
609
+ */
610
+ addFilter(field: string, ...values: (string | number | boolean)[]): this;
611
+ /**
612
+ * Add a filter with an explicit operator (NestJS only)
613
+ *
614
+ * Produces: `filter.field=$operator:value`
615
+ *
616
+ * @param {string} field - Name of the field to filter
617
+ * @param {FilterOperatorEnum} operator - The filter operator to apply
618
+ * @param {(string | number | boolean)[]} values - The value(s) for the filter
619
+ * @returns {this}
620
+ * @throws {UnsupportedFilterOperatorError} If the active driver does not support filter operators
621
+ */
622
+ addFilterOperator(field: string, operator: FilterOperatorEnum, ...values: (string | number | boolean)[]): this;
623
+ /**
624
+ * Add related entities to include in the request (Spatie only)
625
+ *
626
+ * @param {string[]} models - Models to include
627
+ * @returns {this}
628
+ * @throws {UnsupportedIncludesError} If the active driver does not support includes
629
+ */
630
+ addIncludes(...models: string[]): this;
631
+ /**
632
+ * Add flat field selection (NestJS only)
633
+ *
634
+ * Produces: `select=col1,col2`
635
+ *
636
+ * @param {string[]} fields - Fields to select
637
+ * @returns {this}
638
+ * @throws {UnsupportedSelectError} If the active driver does not support flat field selection
639
+ */
640
+ addSelect(...fields: string[]): this;
641
+ /**
642
+ * Add a field with a sort criteria (Spatie and NestJS only)
643
+ *
644
+ * @param field - Field to use for sorting
645
+ * @param {SortEnum} order - A value from the SortEnum enumeration
646
+ * @returns {this}
647
+ * @throws {UnsupportedSortError} If the active driver does not support sorts
648
+ */
649
+ addSort(field: string, order: SortEnum): this;
650
+ /**
651
+ * Delete selected fields for the given models in the current query builder state (Spatie only)
652
+ *
653
+ * ```
654
+ * ngQubeeService.deleteFields({
655
+ * users: ['email', 'password'],
656
+ * address: ['zipcode']
657
+ * });
658
+ * ```
659
+ *
660
+ * @param {IFields} fields - Object mapping model names to field arrays to remove
661
+ * @returns {this}
662
+ * @throws {UnsupportedFieldSelectionError} If the active driver does not support per-model field selection
663
+ */
664
+ deleteFields(fields: IFields): this;
665
+ /**
666
+ * Delete selected fields for the given model in the current query builder state (Spatie only)
667
+ *
668
+ * ```
669
+ * ngQubeeService.deleteFieldsByModel('users', 'email', 'password');
670
+ * ```
671
+ *
672
+ * @param model - Model that holds the fields
673
+ * @param {string[]} fields - Fields to delete from the state
674
+ * @returns {this}
675
+ * @throws {UnsupportedFieldSelectionError} If the active driver does not support per-model field selection
676
+ */
677
+ deleteFieldsByModel(model: string, ...fields: string[]): this;
678
+ /**
679
+ * Remove given filters from the query builder state (Spatie and NestJS only)
680
+ *
681
+ * @param {string[]} filters - Filters to remove
682
+ * @returns {this}
683
+ * @throws {UnsupportedFilterError} If the active driver does not support filters
684
+ */
685
+ deleteFilters(...filters: string[]): this;
686
+ /**
687
+ * Remove selected related models from the query builder state (Spatie only)
688
+ *
689
+ * @param {string[]} includes - Models to remove
690
+ * @returns {this}
691
+ * @throws {UnsupportedIncludesError} If the active driver does not support includes
692
+ */
693
+ deleteIncludes(...includes: string[]): this;
694
+ /**
695
+ * Remove operator filters by field name (NestJS only)
696
+ *
697
+ * @param {string[]} fields - Field names of operator filters to remove
698
+ * @returns {this}
699
+ * @throws {UnsupportedFilterOperatorError} If the active driver does not support filter operators
700
+ */
701
+ deleteOperatorFilters(...fields: string[]): this;
702
+ /**
703
+ * Remove search term from the query builder state (NestJS only)
704
+ *
705
+ * @returns {this}
706
+ * @throws {UnsupportedSearchError} If the active driver does not support search
707
+ */
708
+ deleteSearch(): this;
709
+ /**
710
+ * Remove flat field selections from the query builder state (NestJS only)
711
+ *
712
+ * @param {string[]} fields - Fields to remove from selection
713
+ * @returns {this}
714
+ * @throws {UnsupportedSelectError} If the active driver does not support flat field selection
715
+ */
716
+ deleteSelect(...fields: string[]): this;
717
+ /**
718
+ * Remove sort rules from the query builder state (Spatie and NestJS only)
719
+ *
720
+ * @param sorts - Fields used for sorting to remove
721
+ * @returns {this}
722
+ * @throws {UnsupportedSortError} If the active driver does not support sorts
723
+ */
724
+ deleteSorts(...sorts: string[]): this;
725
+ /**
726
+ * Generate a URI accordingly to the given data and active driver
727
+ *
728
+ * @returns {Observable<string>} An observable that emits the generated URI
729
+ */
730
+ generateUri(): Observable<string>;
731
+ /**
732
+ * Clear the current state and reset the Query Builder to a fresh, clean condition
733
+ *
734
+ * @returns {this}
735
+ */
736
+ reset(): this;
737
+ /**
738
+ * Set the base URL to use for composing the address
739
+ *
740
+ * @param {string} baseUrl - The base URL
741
+ * @returns {this}
742
+ */
743
+ setBaseUrl(baseUrl: string): this;
744
+ /**
745
+ * Set the items per page number
746
+ *
747
+ * @param limit - Number of items per page
748
+ * @returns {this}
749
+ */
750
+ setLimit(limit: number): this;
751
+ /**
752
+ * Set the page that the backend will use to paginate the result set
753
+ *
754
+ * @param page - Page number
755
+ * @returns {this}
756
+ */
757
+ setPage(page: number): this;
758
+ /**
759
+ * Set the API resource to run the query against
760
+ *
761
+ * @param {string} resource - Resource name (e.g. 'users' produces /users)
762
+ * @returns {this}
763
+ */
764
+ setResource(resource: string): this;
765
+ /**
766
+ * Set the search term for full-text search (NestJS only)
767
+ *
768
+ * Produces: `search=term`
769
+ *
770
+ * @param {string} search - The search term
771
+ * @returns {this}
772
+ * @throws {UnsupportedSearchError} If the active driver does not support search
773
+ */
774
+ setSearch(search: string): this;
775
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgQubeeService, [null, null, null, { optional: true; }]>;
776
+ static ɵprov: i0.ɵɵInjectableDeclaration<NgQubeeService>;
777
+ }
778
+
779
+ /**
780
+ * Resolved response field key names with defaults applied
781
+ *
782
+ * Maps logical pagination concepts to the actual key names
783
+ * used in the API response. Unset values fall back to Laravel defaults.
784
+ *
785
+ * For NestJS responses, use dot-notation paths:
786
+ * ```typescript
787
+ * new ResponseOptions({
788
+ * currentPage: 'meta.currentPage',
789
+ * total: 'meta.totalItems'
790
+ * });
791
+ * ```
792
+ */
793
+ declare class ResponseOptions {
794
+ readonly currentPage: string;
795
+ readonly data: string;
796
+ readonly firstPageUrl: string;
797
+ readonly from: string;
798
+ readonly lastPage: string;
799
+ readonly lastPageUrl: string;
800
+ readonly nextPageUrl: string;
801
+ readonly path: string;
802
+ readonly perPage: string;
803
+ readonly prevPageUrl: string;
804
+ readonly to: string;
805
+ readonly total: string;
806
+ constructor(options: IPaginationConfig);
807
+ }
808
+
809
+ /**
810
+ * Strategy interface for parsing paginated API responses
811
+ *
812
+ * Each driver implements this interface to parse responses
813
+ * from the corresponding backend format into a PaginatedCollection.
814
+ */
815
+ interface IResponseStrategy {
816
+ /**
817
+ * Parse a raw API response into a typed PaginatedCollection
818
+ *
819
+ * @param response - The raw API response object
820
+ * @param options - The response key name configuration
821
+ * @returns A typed PaginatedCollection instance
822
+ */
823
+ paginate<T extends IPaginatedObject>(response: Record<string, unknown>, options: ResponseOptions): PaginatedCollection<T>;
824
+ }
825
+
826
+ declare class PaginationService {
827
+ /**
828
+ * Resolved response key name options
829
+ */
830
+ private _options;
831
+ /**
832
+ * The response strategy that parses responses for the active driver
833
+ */
834
+ private _responseStrategy;
835
+ constructor(responseStrategy: IResponseStrategy, options?: IPaginationConfig);
836
+ /**
837
+ * Transform a raw API response into a typed PaginatedCollection
838
+ *
839
+ * Delegates to the active driver's response strategy for parsing.
840
+ *
841
+ * @param response - The raw API response object
842
+ * @returns A typed PaginatedCollection instance
843
+ */
844
+ paginate<T extends IPaginatedObject>(response: {
845
+ [key: string]: any;
846
+ }): PaginatedCollection<T>;
847
+ static ɵfac: i0.ɵɵFactoryDeclaration<PaginationService, [null, { optional: true; }]>;
848
+ static ɵprov: i0.ɵɵInjectableDeclaration<PaginationService>;
849
+ }
850
+
851
+ declare class InvalidLimitError extends Error {
852
+ constructor(limit: number);
853
+ }
854
+
855
+ declare class InvalidPageNumberError extends Error {
856
+ constructor(page: number);
857
+ }
858
+
859
+ /**
860
+ * Error thrown when an invalid resource name is provided
861
+ *
862
+ * Resource name must be a non-empty string.
863
+ */
864
+ declare class InvalidResourceNameError extends Error {
865
+ constructor(resource: string | null | undefined);
866
+ }
867
+
868
+ declare class KeyNotFoundError extends Error {
869
+ constructor(key: string);
870
+ }
871
+
872
+ declare class UnselectableModelError extends Error {
873
+ constructor(model: string);
874
+ }
875
+
876
+ /**
877
+ * Error thrown when per-model field selection is attempted with a driver that does not support it
878
+ *
879
+ * Per-model field selection is only supported by the Spatie driver.
880
+ * Use `addSelect()` for NestJS flat field selection.
881
+ */
882
+ declare class UnsupportedFieldSelectionError extends Error {
883
+ constructor();
884
+ }
885
+
886
+ /**
887
+ * Error thrown when filters are attempted with a driver that does not support them
888
+ *
889
+ * Filters are only supported by the Spatie and NestJS drivers.
890
+ */
891
+ declare class UnsupportedFilterError extends Error {
892
+ constructor();
893
+ }
894
+
895
+ /**
896
+ * Error thrown when filter operators are attempted with a driver that does not support them
897
+ *
898
+ * Filter operators are only supported by the NestJS driver.
899
+ * Use `addFilter()` for Spatie implicit equality filters.
900
+ */
901
+ declare class UnsupportedFilterOperatorError extends Error {
902
+ constructor();
903
+ }
904
+
905
+ /**
906
+ * Error thrown when includes are attempted with a driver that does not support them
907
+ *
908
+ * Includes are only supported by the Spatie driver.
909
+ */
910
+ declare class UnsupportedIncludesError extends Error {
911
+ constructor();
912
+ }
913
+
914
+ /**
915
+ * Error thrown when search is attempted with a driver that does not support it
916
+ *
917
+ * Search is only supported by the NestJS driver.
918
+ */
919
+ declare class UnsupportedSearchError extends Error {
920
+ constructor();
921
+ }
922
+
923
+ /**
924
+ * Error thrown when flat field selection is attempted with a driver that does not support it
925
+ *
926
+ * Flat field selection is only supported by the NestJS driver.
927
+ * Use `addFields()` for Spatie per-model field selection.
928
+ */
929
+ declare class UnsupportedSelectError extends Error {
930
+ constructor();
931
+ }
932
+
933
+ /**
934
+ * Error thrown when sorts are attempted with a driver that does not support them
935
+ *
936
+ * Sorts are only supported by the Spatie and NestJS drivers.
937
+ */
938
+ declare class UnsupportedSortError extends Error {
939
+ constructor();
940
+ }
941
+
942
+ interface INestState {
943
+ nest: IQueryBuilderState;
944
+ }
945
+
946
+ interface IPage {
947
+ }
948
+
949
+ /**
950
+ * Request strategy for the Laravel (pagination-only) driver
951
+ *
952
+ * Generates simple pagination URIs:
953
+ * - `/{resource}?limit=N&page=N`
954
+ *
955
+ * Filters, sorts, fields, includes, search, and select in state are ignored.
956
+ */
957
+ declare class LaravelRequestStrategy implements IRequestStrategy {
958
+ /**
959
+ * Build a pagination-only URI from the given state
960
+ *
961
+ * @param state - The current query builder state
962
+ * @param options - The query parameter key name configuration
963
+ * @returns The composed URI string
964
+ * @throws Error if resource is not set
965
+ */
966
+ buildUri(state: IQueryBuilderState, options: QueryBuilderOptions): string;
967
+ }
968
+
969
+ /**
970
+ * Response strategy for the Laravel (pagination-only) driver
971
+ *
972
+ * Parses flat Laravel pagination responses:
973
+ * ```json
974
+ * {
975
+ * "data": [...],
976
+ * "current_page": 1,
977
+ * "total": 100,
978
+ * "per_page": 15,
979
+ * "from": 1,
980
+ * "to": 15,
981
+ * ...
982
+ * }
983
+ * ```
984
+ */
985
+ declare class LaravelResponseStrategy implements IResponseStrategy {
986
+ /**
987
+ * Parse a flat Laravel pagination response into a PaginatedCollection
988
+ *
989
+ * @param response - The raw API response object
990
+ * @param options - The response key name configuration
991
+ * @returns A typed PaginatedCollection instance
992
+ */
993
+ paginate<T extends IPaginatedObject>(response: Record<string, any>, options: ResponseOptions): PaginatedCollection<T>;
994
+ }
995
+
996
+ /**
997
+ * Request strategy for the NestJS (nestjs-paginate) driver
998
+ *
999
+ * Generates URIs in the NestJS paginate format:
1000
+ * - Simple filters: `filter.field=value`
1001
+ * - Operator filters: `filter.field=$operator:value`
1002
+ * - Sorts: `sortBy=field1:DESC,field2:ASC`
1003
+ * - Select: `select=col1,col2`
1004
+ * - Search: `search=term`
1005
+ * - Pagination: `limit=N&page=N`
1006
+ *
1007
+ * @see https://github.com/ppetzold/nestjs-paginate
1008
+ */
1009
+ declare class NestjsRequestStrategy implements IRequestStrategy {
1010
+ /**
1011
+ * Accumulator for composing the URI string
1012
+ */
1013
+ private _uri;
1014
+ /**
1015
+ * Build a URI string from the given state using the NestJS paginate format
1016
+ *
1017
+ * @param state - The current query builder state
1018
+ * @param options - The query parameter key name configuration
1019
+ * @returns The composed URI string
1020
+ * @throws Error if model is not set
1021
+ */
1022
+ buildUri(state: IQueryBuilderState, options: QueryBuilderOptions): string;
1023
+ /**
1024
+ * Parse and append simple filter parameters
1025
+ *
1026
+ * Generates: `filter.field=value1,value2` for each filter
1027
+ *
1028
+ * @param state - The current query builder state
1029
+ * @param options - The query parameter key name configuration
1030
+ */
1031
+ private _parseFilters;
1032
+ /**
1033
+ * Parse and append the limit parameter
1034
+ *
1035
+ * @param state - The current query builder state
1036
+ * @param options - The query parameter key name configuration
1037
+ */
1038
+ private _parseLimit;
1039
+ /**
1040
+ * Parse and append operator filter parameters
1041
+ *
1042
+ * Groups operator filters by field and generates:
1043
+ * - Single value: `filter.field=$operator:value`
1044
+ * - Multiple values ($in, $btw): `filter.field=$operator:val1,val2`
1045
+ *
1046
+ * @param state - The current query builder state
1047
+ * @param options - The query parameter key name configuration
1048
+ */
1049
+ private _parseOperatorFilters;
1050
+ /**
1051
+ * Parse and append the page parameter
1052
+ *
1053
+ * @param state - The current query builder state
1054
+ * @param options - The query parameter key name configuration
1055
+ */
1056
+ private _parsePage;
1057
+ /**
1058
+ * Parse and append the search parameter
1059
+ *
1060
+ * Generates: `search=term`
1061
+ *
1062
+ * @param state - The current query builder state
1063
+ * @param options - The query parameter key name configuration
1064
+ */
1065
+ private _parseSearch;
1066
+ /**
1067
+ * Parse and append the select parameter
1068
+ *
1069
+ * Generates: `select=col1,col2`
1070
+ *
1071
+ * @param state - The current query builder state
1072
+ * @param options - The query parameter key name configuration
1073
+ */
1074
+ private _parseSelect;
1075
+ /**
1076
+ * Parse and append sort parameters
1077
+ *
1078
+ * Generates: `sortBy=field1:DESC,field2:ASC`
1079
+ *
1080
+ * @param state - The current query builder state
1081
+ * @param options - The query parameter key name configuration
1082
+ */
1083
+ private _parseSort;
1084
+ /**
1085
+ * Determine the appropriate URI prefix based on the current accumulator state
1086
+ *
1087
+ * Returns the full base path with `?` for the first parameter,
1088
+ * or `&` for subsequent parameters.
1089
+ *
1090
+ * @param state - The current query builder state
1091
+ * @returns The prefix string to prepend to the next parameter
1092
+ */
1093
+ private _prepend;
1094
+ }
1095
+
1096
+ /**
1097
+ * Response strategy for the NestJS (nestjs-paginate) driver
1098
+ *
1099
+ * Parses nested NestJS pagination responses:
1100
+ * ```json
1101
+ * {
1102
+ * "data": [...],
1103
+ * "meta": {
1104
+ * "currentPage": 1,
1105
+ * "totalItems": 100,
1106
+ * "itemsPerPage": 10,
1107
+ * "totalPages": 10
1108
+ * },
1109
+ * "links": {
1110
+ * "first": "url",
1111
+ * "previous": "url",
1112
+ * "next": "url",
1113
+ * "last": "url",
1114
+ * "current": "url"
1115
+ * }
1116
+ * }
1117
+ * ```
1118
+ *
1119
+ * @see https://github.com/ppetzold/nestjs-paginate
1120
+ */
1121
+ declare class NestjsResponseStrategy implements IResponseStrategy {
1122
+ /**
1123
+ * Parse a nested NestJS pagination response into a PaginatedCollection
1124
+ *
1125
+ * Supports dot-notation key paths for accessing nested values.
1126
+ * Computes `from` and `to` from `currentPage` and `itemsPerPage` when
1127
+ * they are not directly available in the response.
1128
+ *
1129
+ * @param response - The raw API response object
1130
+ * @param options - The response key name configuration
1131
+ * @returns A typed PaginatedCollection instance
1132
+ */
1133
+ paginate<T extends IPaginatedObject>(response: Record<string, any>, options: ResponseOptions): PaginatedCollection<T>;
1134
+ /**
1135
+ * Resolve a value from a response object using a dot-notation path
1136
+ *
1137
+ * Supports both flat keys ('data') and nested paths ('meta.currentPage').
1138
+ *
1139
+ * @param response - The raw response object
1140
+ * @param path - The dot-notation path to resolve
1141
+ * @returns The resolved value, or undefined if not found
1142
+ */
1143
+ private _resolve;
1144
+ /**
1145
+ * Resolve the "from" index value
1146
+ *
1147
+ * If the path resolves to a value in the response, use it.
1148
+ * Otherwise, compute it from currentPage and perPage:
1149
+ * `(currentPage - 1) * perPage + 1`
1150
+ *
1151
+ * @param response - The raw response object
1152
+ * @param options - The response key name configuration
1153
+ * @param currentPage - The current page number
1154
+ * @param perPage - The number of items per page
1155
+ * @returns The computed "from" index
1156
+ */
1157
+ private _resolveFrom;
1158
+ /**
1159
+ * Resolve the "to" index value
1160
+ *
1161
+ * If the path resolves to a value in the response, use it.
1162
+ * Otherwise, compute it from currentPage, perPage, and total:
1163
+ * `Math.min(currentPage * perPage, total)`
1164
+ *
1165
+ * @param response - The raw response object
1166
+ * @param options - The response key name configuration
1167
+ * @param currentPage - The current page number
1168
+ * @param perPage - The number of items per page
1169
+ * @param total - The total number of items
1170
+ * @returns The computed "to" index
1171
+ */
1172
+ private _resolveTo;
1173
+ }
1174
+
1175
+ /**
1176
+ * Request strategy for the Spatie Query Builder driver
1177
+ *
1178
+ * Generates URIs in the Spatie format:
1179
+ * - Fields: `fields[model]=col1,col2`
1180
+ * - Filters: `filter[field]=value`
1181
+ * - Includes: `include=model1,model2`
1182
+ * - Sorts: `sort=-field1,field2` (- prefix = DESC)
1183
+ * - Pagination: `limit=N&page=N`
1184
+ *
1185
+ * @see https://spatie.be/docs/laravel-query-builder
1186
+ */
1187
+ declare class SpatieRequestStrategy implements IRequestStrategy {
1188
+ /**
1189
+ * Accumulator for composing the URI string
1190
+ */
1191
+ private _uri;
1192
+ /**
1193
+ * Build a URI string from the given state using the Spatie format
1194
+ *
1195
+ * @param state - The current query builder state
1196
+ * @param options - The query parameter key name configuration
1197
+ * @returns The composed URI string
1198
+ * @throws Error if resource is not set
1199
+ */
1200
+ buildUri(state: IQueryBuilderState, options: QueryBuilderOptions): string;
1201
+ /**
1202
+ * Parse and append field selection parameters
1203
+ *
1204
+ * Validates that each field model exists either as the main resource
1205
+ * or in the includes list. Fields are grouped by model in bracket notation.
1206
+ *
1207
+ * @param state - The current query builder state
1208
+ * @param options - The query parameter key name configuration
1209
+ * @returns The generated field selection parameter string
1210
+ * @throws Error if resource is required but not set
1211
+ * @throws UnselectableModelError if a field model is not in resource or includes
1212
+ */
1213
+ private _parseFields;
1214
+ /**
1215
+ * Parse and append filter parameters
1216
+ *
1217
+ * Generates filter parameters in bracket notation: `filter[key]=value1,value2`
1218
+ *
1219
+ * @param state - The current query builder state
1220
+ * @param options - The query parameter key name configuration
1221
+ * @returns The generated filter parameter string
1222
+ */
1223
+ private _parseFilters;
1224
+ /**
1225
+ * Parse and append include parameters
1226
+ *
1227
+ * Generates: `include=model1,model2`
1228
+ *
1229
+ * @param state - The current query builder state
1230
+ * @param options - The query parameter key name configuration
1231
+ * @returns The generated include parameter string
1232
+ */
1233
+ private _parseIncludes;
1234
+ /**
1235
+ * Parse and append the limit parameter
1236
+ *
1237
+ * @param state - The current query builder state
1238
+ * @param options - The query parameter key name configuration
1239
+ * @returns The generated limit parameter string
1240
+ */
1241
+ private _parseLimit;
1242
+ /**
1243
+ * Parse and append the page parameter
1244
+ *
1245
+ * @param state - The current query builder state
1246
+ * @param options - The query parameter key name configuration
1247
+ * @returns The generated page parameter string
1248
+ */
1249
+ private _parsePage;
1250
+ /**
1251
+ * Parse and append sort parameters
1252
+ *
1253
+ * Generates: `sort=-field1,field2` where `-` prefix indicates DESC order
1254
+ *
1255
+ * @param state - The current query builder state
1256
+ * @param options - The query parameter key name configuration
1257
+ * @returns The generated sort parameter string
1258
+ */
1259
+ private _parseSort;
1260
+ /**
1261
+ * Determine the appropriate URI prefix based on the current accumulator state
1262
+ *
1263
+ * Returns the full base path with `?` for the first parameter,
1264
+ * or `&` for subsequent parameters.
1265
+ *
1266
+ * @param state - The current query builder state
1267
+ * @returns The prefix string to prepend to the next parameter
1268
+ */
1269
+ private _prepend;
1270
+ }
1271
+
1272
+ /**
1273
+ * Response strategy for the Spatie Query Builder driver
1274
+ *
1275
+ * Parses flat Laravel pagination responses:
1276
+ * ```json
1277
+ * {
1278
+ * "data": [...],
1279
+ * "current_page": 1,
1280
+ * "total": 100,
1281
+ * "per_page": 15,
1282
+ * "from": 1,
1283
+ * "to": 15,
1284
+ * ...
1285
+ * }
1286
+ * ```
1287
+ *
1288
+ * @see https://spatie.be/docs/laravel-query-builder
1289
+ */
1290
+ declare class SpatieResponseStrategy implements IResponseStrategy {
1291
+ /**
1292
+ * Parse a flat Laravel pagination response into a PaginatedCollection
1293
+ *
1294
+ * @param response - The raw API response object
1295
+ * @param options - The response key name configuration
1296
+ * @returns A typed PaginatedCollection instance
1297
+ */
1298
+ paginate<T extends IPaginatedObject>(response: Record<string, any>, options: ResponseOptions): PaginatedCollection<T>;
1299
+ }
1300
+
1301
+ export { DriverEnum, FilterOperatorEnum, InvalidLimitError, InvalidPageNumberError, InvalidResourceNameError, KeyNotFoundError, LaravelRequestStrategy, LaravelResponseStrategy, NestjsRequestStrategy, NestjsResponseStrategy, NgQubeeModule, NgQubeeService, PaginatedCollection, PaginationService, SortEnum, SpatieRequestStrategy, SpatieResponseStrategy, UnselectableModelError, UnsupportedFieldSelectionError, UnsupportedFilterError, UnsupportedFilterOperatorError, UnsupportedIncludesError, UnsupportedSearchError, UnsupportedSelectError, UnsupportedSortError, provideNgQubee };
1302
+ export type { IConfig, IFields, IFilters, INestState, IOperatorFilter, IPage, IPaginatedObject, IPaginationConfig, IQueryBuilderConfig, IQueryBuilderState, IRequestStrategy, IResponseStrategy, ISort };