ng-qubee 2.0.5 → 2.1.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.
- package/README.md +155 -0
- package/fesm2022/ng-qubee.mjs +29 -19
- package/fesm2022/ng-qubee.mjs.map +1 -1
- package/lib/interfaces/nest-state.interface.d.ts +4 -0
- package/lib/interfaces/page.interface.d.ts +2 -0
- package/package.json +6 -1
- package/public-api.d.ts +11 -1
package/README.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
# Your next Angular Query Builder 🐝
|
|
6
|
+
|
|
7
|
+
[](https://github.com/AndreaAlhena/ng-qubee/actions)
|
|
8
|
+
[](https://codecov.io/gh/AndreaAlhena/ng-qubee)
|
|
9
|
+
[](https://www.npmjs.com/package/ng-qubee)
|
|
10
|
+
[](https://opensource.org/licenses/MIT)
|
|
11
|
+
|
|
6
12
|
NgQubee is a Query Builder for Angular. Easily compose your API requests without the hassle of writing the wheel again :)
|
|
7
13
|
|
|
8
14
|
- Easily retrieve URIs with a Service
|
|
@@ -133,11 +139,17 @@ Will output _/users?include=profile,settings_
|
|
|
133
139
|
Sort elements as following:
|
|
134
140
|
|
|
135
141
|
```typescript
|
|
142
|
+
import { SortEnum } from 'ng-qubee';
|
|
143
|
+
|
|
136
144
|
this._ngQubeeService.addSort('fieldName', SortEnum.ASC);
|
|
137
145
|
```
|
|
138
146
|
|
|
139
147
|
Will output _/users?sort=fieldName_ (or _/users?sort=-fieldName_ if DESC)
|
|
140
148
|
|
|
149
|
+
The `SortEnum` provides two ordering options:
|
|
150
|
+
- `SortEnum.ASC` - Ascending order
|
|
151
|
+
- `SortEnum.DESC` - Descending order
|
|
152
|
+
|
|
141
153
|
### Page and Limit
|
|
142
154
|
NgQubee supports paginated queries:
|
|
143
155
|
|
|
@@ -213,6 +225,149 @@ NgQubeeModule.forRoot({
|
|
|
213
225
|
|
|
214
226
|
Feel free to customize your PaginationService as you need, using the keys shown in the upper list.
|
|
215
227
|
|
|
228
|
+
## TypeScript Support
|
|
229
|
+
|
|
230
|
+
NgQubee is fully typed and exports all public interfaces, enums, and types for TypeScript users.
|
|
231
|
+
|
|
232
|
+
### Available Enums
|
|
233
|
+
|
|
234
|
+
```typescript
|
|
235
|
+
import { SortEnum } from 'ng-qubee';
|
|
236
|
+
|
|
237
|
+
// Sorting options
|
|
238
|
+
SortEnum.ASC // 'asc'
|
|
239
|
+
SortEnum.DESC // 'desc'
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Available Interfaces
|
|
243
|
+
|
|
244
|
+
NgQubee exports the following interfaces for type-safe development:
|
|
245
|
+
|
|
246
|
+
#### Configuration Interfaces
|
|
247
|
+
|
|
248
|
+
```typescript
|
|
249
|
+
import {
|
|
250
|
+
IConfig,
|
|
251
|
+
IQueryBuilderConfig,
|
|
252
|
+
IPaginationConfig
|
|
253
|
+
} from 'ng-qubee';
|
|
254
|
+
|
|
255
|
+
// Main configuration interface
|
|
256
|
+
const config: IConfig = {
|
|
257
|
+
request: {
|
|
258
|
+
filters: 'custom-filter-key',
|
|
259
|
+
fields: 'custom-fields-key',
|
|
260
|
+
includes: 'custom-include-key',
|
|
261
|
+
limit: 'custom-limit-key',
|
|
262
|
+
page: 'custom-page-key',
|
|
263
|
+
sort: 'custom-sort-key'
|
|
264
|
+
},
|
|
265
|
+
response: {
|
|
266
|
+
currentPage: 'pg',
|
|
267
|
+
data: 'items',
|
|
268
|
+
total: 'count',
|
|
269
|
+
perPage: 'itemsPerPage'
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
#### Query Building Interfaces
|
|
275
|
+
|
|
276
|
+
```typescript
|
|
277
|
+
import {
|
|
278
|
+
IFilters,
|
|
279
|
+
IFields,
|
|
280
|
+
ISort
|
|
281
|
+
} from 'ng-qubee';
|
|
282
|
+
|
|
283
|
+
// Filters interface - key-value pairs with array values
|
|
284
|
+
const filters: IFilters = {
|
|
285
|
+
id: [1, 2, 3],
|
|
286
|
+
status: ['active', 'pending']
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
// Fields interface - model name with array of field names
|
|
290
|
+
const fields: IFields = {
|
|
291
|
+
users: ['id', 'email', 'username'],
|
|
292
|
+
profile: ['avatar', 'bio']
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
// Sort interface - field and order
|
|
296
|
+
const sort: ISort = {
|
|
297
|
+
field: 'created_at',
|
|
298
|
+
order: SortEnum.DESC
|
|
299
|
+
};
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
#### Pagination Interfaces
|
|
303
|
+
|
|
304
|
+
```typescript
|
|
305
|
+
import { IPaginatedObject } from 'ng-qubee';
|
|
306
|
+
|
|
307
|
+
// Use with your model type
|
|
308
|
+
interface User {
|
|
309
|
+
id: number;
|
|
310
|
+
email: string;
|
|
311
|
+
username: string;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// The paginated object can contain any additional keys
|
|
315
|
+
const paginatedData: IPaginatedObject = {
|
|
316
|
+
data: [/* users */],
|
|
317
|
+
currentPage: 1,
|
|
318
|
+
total: 100,
|
|
319
|
+
perPage: 15
|
|
320
|
+
};
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
### Usage Example with Full Types
|
|
324
|
+
|
|
325
|
+
```typescript
|
|
326
|
+
import { Component, OnInit } from '@angular/core';
|
|
327
|
+
import {
|
|
328
|
+
NgQubeeService,
|
|
329
|
+
SortEnum,
|
|
330
|
+
IFilters,
|
|
331
|
+
IFields
|
|
332
|
+
} from 'ng-qubee';
|
|
333
|
+
|
|
334
|
+
@Component({
|
|
335
|
+
selector: 'app-users',
|
|
336
|
+
template: '...'
|
|
337
|
+
})
|
|
338
|
+
export class UsersComponent implements OnInit {
|
|
339
|
+
constructor(private ngQubee: NgQubeeService) {}
|
|
340
|
+
|
|
341
|
+
ngOnInit(): void {
|
|
342
|
+
// Set up the query with type safety
|
|
343
|
+
this.ngQubee.setModel('users');
|
|
344
|
+
|
|
345
|
+
// Define fields with type checking
|
|
346
|
+
const userFields: IFields = {
|
|
347
|
+
users: ['id', 'email', 'username']
|
|
348
|
+
};
|
|
349
|
+
this.ngQubee.addFields('users', userFields.users);
|
|
350
|
+
|
|
351
|
+
// Define filters with type checking
|
|
352
|
+
const filters: IFilters = {
|
|
353
|
+
status: ['active'],
|
|
354
|
+
role: ['admin', 'moderator']
|
|
355
|
+
};
|
|
356
|
+
this.ngQubee.addFilter('status', ...filters.status);
|
|
357
|
+
this.ngQubee.addFilter('role', ...filters.role);
|
|
358
|
+
|
|
359
|
+
// Add sorting with enum
|
|
360
|
+
this.ngQubee.addSort('created_at', SortEnum.DESC);
|
|
361
|
+
|
|
362
|
+
// Generate URI
|
|
363
|
+
this.ngQubee.generateUri().subscribe(uri => {
|
|
364
|
+
console.log(uri);
|
|
365
|
+
// Output: /users?fields[users]=id,email,username&filter[status]=active&filter[role]=admin,moderator&sort=-created_at&limit=15&page=1
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
```
|
|
370
|
+
|
|
216
371
|
[ng-qubee]: <https://github.com/AndreaAlhena/ng-qubee>
|
|
217
372
|
[rxjs]: <https://reactivex.io>
|
|
218
373
|
[qs]: <https://github.com/ljharb/qs>
|
package/fesm2022/ng-qubee.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { signal, computed, Injectable, Inject, Optional, NgModule, makeEnvironmentProviders } from '@angular/core';
|
|
3
3
|
import * as qs from 'qs';
|
|
4
|
-
import { BehaviorSubject, filter } from 'rxjs';
|
|
4
|
+
import { BehaviorSubject, filter, throwError } from 'rxjs';
|
|
5
5
|
|
|
6
6
|
class KeyNotFoundError extends Error {
|
|
7
7
|
constructor(key) {
|
|
@@ -402,7 +402,7 @@ class NestService {
|
|
|
402
402
|
deleteSorts(...sorts) {
|
|
403
403
|
const s = [...this._nest().sorts];
|
|
404
404
|
sorts.forEach(field => {
|
|
405
|
-
const p =
|
|
405
|
+
const p = s.findIndex(sort => sort.field === field);
|
|
406
406
|
if (p > -1) {
|
|
407
407
|
s.splice(p, 1);
|
|
408
408
|
}
|
|
@@ -424,10 +424,10 @@ class NestService {
|
|
|
424
424
|
reset() {
|
|
425
425
|
this._nest.update(_ => this._clone(INITIAL_STATE));
|
|
426
426
|
}
|
|
427
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
428
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
427
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NestService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
428
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NestService });
|
|
429
429
|
}
|
|
430
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
430
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NestService, decorators: [{
|
|
431
431
|
type: Injectable
|
|
432
432
|
}], ctorParameters: () => [] });
|
|
433
433
|
|
|
@@ -531,7 +531,12 @@ class NgQubeeService {
|
|
|
531
531
|
return this._uri;
|
|
532
532
|
}
|
|
533
533
|
_prepend(model) {
|
|
534
|
-
|
|
534
|
+
const state = this._nestService.nest();
|
|
535
|
+
const baseUrl = state.baseUrl;
|
|
536
|
+
if (this._uri) {
|
|
537
|
+
return '&';
|
|
538
|
+
}
|
|
539
|
+
return baseUrl ? `${baseUrl}/${model}?` : `/${model}?`;
|
|
535
540
|
}
|
|
536
541
|
/**
|
|
537
542
|
* Add fields to the select statement for the given model
|
|
@@ -670,8 +675,13 @@ class NgQubeeService {
|
|
|
670
675
|
* @returns {Observable<string>} An observable that emits the generated uri
|
|
671
676
|
*/
|
|
672
677
|
generateUri() {
|
|
673
|
-
|
|
674
|
-
|
|
678
|
+
try {
|
|
679
|
+
this._uri$.next(this._parse(this._nestService.nest()));
|
|
680
|
+
return this.uri$;
|
|
681
|
+
}
|
|
682
|
+
catch (error) {
|
|
683
|
+
return throwError(() => error);
|
|
684
|
+
}
|
|
675
685
|
}
|
|
676
686
|
/**
|
|
677
687
|
* Clear the current state and reset the Query Builder to a fresh, clean condition
|
|
@@ -723,10 +733,10 @@ class NgQubeeService {
|
|
|
723
733
|
this._nestService.page = page;
|
|
724
734
|
return this;
|
|
725
735
|
}
|
|
726
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
727
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
736
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NgQubeeService, deps: [{ token: NestService }, { token: 'QUERY_PARAMS_CONFIG', optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
737
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NgQubeeService });
|
|
728
738
|
}
|
|
729
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
739
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NgQubeeService, decorators: [{
|
|
730
740
|
type: Injectable
|
|
731
741
|
}], ctorParameters: () => [{ type: NestService }, { type: undefined, decorators: [{
|
|
732
742
|
type: Inject,
|
|
@@ -773,10 +783,10 @@ class PaginationService {
|
|
|
773
783
|
paginate(response) {
|
|
774
784
|
return new PaginatedCollection(response[this._options.data], response[this._options.currentPage], response[this._options.from], response[this._options.to], response[this._options.total], response[this._options.perPage], response[this._options.prevPageUrl], response[this._options.nextPageUrl], response[this._options.lastPage], response[this._options.firstPageUrl], response[this._options.lastPageUrl]);
|
|
775
785
|
}
|
|
776
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
777
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
786
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: PaginationService, deps: [{ token: 'RESPONSE_OPTIONS', optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
787
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: PaginationService });
|
|
778
788
|
}
|
|
779
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
789
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: PaginationService, decorators: [{
|
|
780
790
|
type: Injectable
|
|
781
791
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
782
792
|
type: Inject,
|
|
@@ -803,15 +813,15 @@ class NgQubeeModule {
|
|
|
803
813
|
]
|
|
804
814
|
};
|
|
805
815
|
}
|
|
806
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
807
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.
|
|
808
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.
|
|
816
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NgQubeeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
817
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: NgQubeeModule });
|
|
818
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NgQubeeModule, providers: [{
|
|
809
819
|
deps: [NestService],
|
|
810
820
|
provide: NgQubeeService,
|
|
811
821
|
useFactory: (nestService) => new NgQubeeService(nestService, {})
|
|
812
822
|
}] });
|
|
813
823
|
}
|
|
814
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
824
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NgQubeeModule, decorators: [{
|
|
815
825
|
type: NgModule,
|
|
816
826
|
args: [{
|
|
817
827
|
providers: [{
|
|
@@ -865,5 +875,5 @@ function provideNgQubee(config = {}) {
|
|
|
865
875
|
* Generated bundle index. Do not edit.
|
|
866
876
|
*/
|
|
867
877
|
|
|
868
|
-
export { InvalidLimitError, InvalidModelNameError, InvalidPageNumberError, KeyNotFoundError, NgQubeeModule, NgQubeeService, PaginatedCollection, PaginationService, UnselectableModelError, provideNgQubee };
|
|
878
|
+
export { InvalidLimitError, InvalidModelNameError, InvalidPageNumberError, KeyNotFoundError, NgQubeeModule, NgQubeeService, PaginatedCollection, PaginationService, SortEnum, UnselectableModelError, provideNgQubee };
|
|
869
879
|
//# sourceMappingURL=ng-qubee.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-qubee.mjs","sources":["../../../projects/ng-qubee/src/lib/errors/key-not-found.error.ts","../../../projects/ng-qubee/src/lib/models/paginated-collection.ts","../../../projects/ng-qubee/src/lib/enums/sort.enum.ts","../../../projects/ng-qubee/src/lib/errors/unselectable-model.error.ts","../../../projects/ng-qubee/src/lib/models/query-builder-options.ts","../../../projects/ng-qubee/src/lib/errors/invalid-model-name.error.ts","../../../projects/ng-qubee/src/lib/errors/invalid-page-number.error.ts","../../../projects/ng-qubee/src/lib/errors/invalid-limit.error.ts","../../../projects/ng-qubee/src/lib/services/nest.service.ts","../../../projects/ng-qubee/src/lib/services/ng-qubee.service.ts","../../../projects/ng-qubee/src/lib/models/response-options.ts","../../../projects/ng-qubee/src/lib/services/pagination.service.ts","../../../projects/ng-qubee/src/lib/ng-qubee.module.ts","../../../projects/ng-qubee/src/lib/provide-ngqubee.ts","../../../projects/ng-qubee/src/public-api.ts","../../../projects/ng-qubee/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}","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}","import { IQueryBuilderConfig } from '../interfaces/query-builder-config.interface';\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 sort: 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.sort = options.sort || 'sort';\n }\n}","export class InvalidModelNameError extends Error {\n constructor(model: string | null | undefined) {\n super(\n `Invalid model name: Model name must be a non-empty string. Received: ${JSON.stringify(model)}`\n );\n this.name = 'InvalidModelNameError';\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","export class InvalidLimitError extends Error {\n constructor(limit: number) {\n super(\n `Invalid limit value: Limit must be a positive integer greater than 0. Received: ${limit}`\n );\n this.name = 'InvalidLimitError';\n }\n}\n","import { Injectable, Signal, WritableSignal, computed, signal } from '@angular/core';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { IFields } from '../interfaces/fields.interface';\nimport { IFilters } from '../interfaces/filters.interface';\nimport { ISort } from '../interfaces/sort.interface';\nimport { InvalidModelNameError } from '../errors/invalid-model-name.error';\nimport { InvalidPageNumberError } from '../errors/invalid-page-number.error';\nimport { InvalidLimitError } from '../errors/invalid-limit.error';\n\nconst INITIAL_STATE: IQueryBuilderState = {\n baseUrl: '',\n fields: {},\n filters: {},\n includes: [],\n limit: 15,\n model: '',\n page: 1,\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 * Must be a positive integer greater than 0\n *\n * @param {number} limit - The number of items per page\n * @throws {InvalidLimitError} If limit is not a positive integer\n * @example\n * service.limit = 25;\n */\n set limit(limit: number) {\n this._validateLimit(limit);\n this._nest.update(nest => ({\n ...nest,\n limit\n }));\n }\n\n /**\n * Set the model name for the query\n * Must be a non-empty string\n *\n * @param {string} model - The model/resource name (e.g., 'users', 'posts')\n * @throws {InvalidModelNameError} If model is not a non-empty string\n * @example\n * service.model = 'users';\n */\n set model(model: string) {\n this._validateModelName(model);\n this._nest.update(nest => ({\n ...nest,\n model\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 private _clone<T>(obj: T): T {\n return JSON.parse( JSON.stringify(obj) );\n }\n\n /**\n * Validates that the model name is a non-empty string\n *\n * @param {string} model - The model name to validate\n * @throws {InvalidModelNameError} If model is not a non-empty string\n * @private\n */\n private _validateModelName(model: string): void {\n if (!model || typeof model !== 'string' || model.trim().length === 0) {\n throw new InvalidModelNameError(model);\n }\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 limit is a positive integer\n *\n * @param {number} limit - The limit value to validate\n * @throws {InvalidLimitError} If limit is not a positive integer\n * @private\n */\n private _validateLimit(limit: number): void {\n if (!Number.isInteger(limit) || limit < 1) {\n throw new InvalidLimitError(limit);\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 model 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 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 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 = this.nest().sorts.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 * 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 * // State is now: { baseUrl: '', fields: {}, filters: {}, includes: [], limit: 15, model: '', page: 1, sorts: [] }\n */\n public reset(): void {\n this._nest.update(_ => this._clone(INITIAL_STATE));\n }\n}\n","import { Inject, Injectable, Optional } from '@angular/core';\nimport * as qs from 'qs';\nimport { BehaviorSubject, Observable, filter } from 'rxjs';\n\n// Enums\nimport { SortEnum } from '../enums/sort.enum';\n\n// Errors\nimport { UnselectableModelError } from '../errors/unselectable-model.error';\n\n// Interfaces\nimport { IFields } from '../interfaces/fields.interface';\nimport { IQueryBuilderConfig } from '../interfaces/query-builder-config.interface';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\n\n// Models\nimport { QueryBuilderOptions } from '../models/query-builder-options';\n\n// Services\nimport { NestService } from './nest.service';\n\n@Injectable()\nexport class NgQubeeService {\n\n private _options: QueryBuilderOptions;\n\n /**\n * This property serves as an accumulator for holding the composed string with each query param\n */\n private _uri = '';\n\n private _uri$: BehaviorSubject<string> = new BehaviorSubject('');\n\n public uri$: Observable<string> = this._uri$.asObservable().pipe(\n filter(uri => !!uri)\n );\n\n constructor(private _nestService: NestService, @Inject('QUERY_PARAMS_CONFIG') @Optional() options: IQueryBuilderConfig = {}) {\n this._options = new QueryBuilderOptions(options);\n }\n\n private _parseFields(s: IQueryBuilderState): string {\n if (!Object.keys(s.fields).length) {\n return this._uri;\n }\n\n if (!s.model) {\n throw new Error('While selecting fields, the -> model <- is required');\n }\n\n if (!(s.model in s.fields)) {\n throw new Error(`Key ${s.model} is missing in the fields object`);\n }\n\n const f = {};\n\n for (const k in s.fields) {\n if (s.fields.hasOwnProperty(k)) {\n // Check if the key is the model or is declared in \"includes\".\n // If not, it means that has not been selected anywhere and that will cause an error on the API\n if (k !== s.model && !s.includes.includes(k)) {\n throw new UnselectableModelError(k);\n }\n\n Object.assign(f, { [`${this._options.fields}[${k}]`]: s.fields[k].join(',') });\n }\n }\n\n const param = `${this._prepend(s.model)}${qs.stringify(f, { encode: false })}`;\n this._uri += param;\n\n return param;\n }\n\n private _parseFilters(s: IQueryBuilderState): string {\n const keys = Object.keys(s.filters);\n\n if (!keys.length) {\n return this._uri;\n }\n\n const f = {\n [`${this._options.filters}`]: keys.reduce((acc, key) => {\n return Object.assign(acc, { [key]: s.filters[key].join(',') });\n }, {})\n };\n const param = `${this._prepend(s.model)}${qs.stringify(f, { encode: false })}`;\n\n this._uri += param;\n\n return param;\n }\n\n private _parseIncludes(s: IQueryBuilderState): string {\n if (!s.includes.length) {\n return this._uri;\n }\n\n const param = `${this._prepend(s.model)}${this._options.includes}=${s.includes}`;\n this._uri += param;\n\n return param;\n }\n\n private _parseLimit(s: IQueryBuilderState): string {\n const param = `${this._prepend(s.model)}${this._options.limit}=${s.limit}`;\n this._uri += param;\n\n return param;\n }\n\n private _parsePage(s: IQueryBuilderState): string {\n const param = `${this._prepend(s.model)}${this._options.page}=${s.page}`;\n this._uri += param;\n\n return param;\n }\n\n private _parseSort(s: IQueryBuilderState): string {\n let param: string = '';\n\n if (!s.sorts.length) {\n return param;\n }\n\n param = `${this._prepend(s.model)}${this._options.sort}=`;\n\n s.sorts.forEach((sort, idx) => {\n param += `${sort.order === SortEnum.DESC ? '-' : ''}${sort.field}`;\n\n if (idx < s.sorts.length - 1) {\n param += ','\n }\n });\n\n this._uri += param;\n\n return param;\n }\n\n private _parse(s: IQueryBuilderState): string {\n if (!s.model) {\n throw new Error('Set the model property BEFORE adding filters or calling the url() / get() methods');\n }\n\n // Cleanup the previously generated URI\n this._uri = '';\n\n this._parseIncludes(s);\n this._parseFields(s);\n this._parseFilters(s);\n this._parseLimit(s);\n this._parsePage(s);\n this._parseSort(s);\n\n return this._uri;\n }\n\n private _prepend(model: string): string {\n return this._uri ? '&' : `/${model}?`;\n }\n\n /**\n * Add fields to the select statement for the given model\n *\n * @param model Model that holds the fields\n * @param fields Fields to select\n * @returns {this}\n */\n public addFields(model: string, fields: string[]): this {\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)\n * I.e. filter[field]=1 or filter[field]=1,2,3\n * \n * @param {string} field Name of the field to filter\n * @param {string[]} value The needle(s)\n * @returns {this}\n */\n public addFilter(field: string, ...values: (string | number | boolean)[]): this {\n if (!values.length) {\n return this;\n }\n\n this._nestService.addFilters({\n [field]: values\n });\n\n return this;\n }\n\n /**\n * Add related entities to include in the request\n * \n * @param {string[]} models \n * @returns \n */\n public addIncludes(...models: string[]): this {\n if (!models.length) {\n return this;\n }\n\n this._nestService.addIncludes(models);\n\n return this;\n }\n\n /**\n * Add a field with a sort criteria\n * \n * @param field Field to use for sorting\n * @param {SortEnum} order A value from the SortEnum enumeration\n * @returns {this}\n */\n public addSort(field: string, order: SortEnum): this {\n this._nestService.addSort({\n field,\n order\n });\n\n return this;\n }\n\n /**\n * Delete selected fields for the given models in the current query builder state\n * \n * ```\n * ngQubeeService.deleteFields({\n * users: ['email', 'password'],\n * address: ['zipcode']\n * });\n * ```\n * \n * @param {IFields} fields \n * @returns \n */\n public deleteFields(fields: IFields): this {\n this._nestService.deleteFields(fields);\n return this;\n }\n\n /**\n * Delete selected fields for the given model in the current query builder state\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 */\n public deleteFieldsByModel(model: string, ...fields: string[]): this {\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\n * \n * @param {string[]} filters Filters to remove\n * @returns {this}\n */\n public deleteFilters(...filters: string[]): this {\n if (!filters.length) {\n return this;\n }\n\n this._nestService.deleteFilters(...filters);\n\n return this;\n }\n\n /**\n * Remove selected related models from the query builder state\n * \n * @param {string[]} includes Models to remove\n * @returns \n */\n public deleteIncludes(...includes: string[]): this {\n if (!includes.length) {\n return this;\n }\n\n this._nestService.deleteIncludes(...includes);\n\n return this;\n }\n\n /**\n * Remove sorts rules from the query builder state\n * \n * @param sorts Fields used for sorting to remove\n * @returns {this}\n */\n public deleteSorts(...sorts: string[]): this {\n this._nestService.deleteSorts(...sorts);\n return this;\n }\n\n /**\n * Generate an URI accordingly to the given data\n *\n * @returns {Observable<string>} An observable that emits the generated uri\n */\n public generateUri(): Observable<string> {\n this._uri$.next(this._parse(this._nestService.nest()));\n return this.uri$;\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 return this;\n }\n\n /**\n * Set the base url to use for composing the address\n * \n * @param {string} baseUrl \n * @returns {this}\n */\n public setBaseUrl(baseUrl: string): this {\n this._nestService.baseUrl = baseUrl;\n return this;\n }\n\n /**\n * Set the items per page number\n * \n * @param limit \n * @returns {this}\n */\n public setLimit(limit: number): this {\n this._nestService.limit = limit;\n return this;\n }\n\n /**\n * Set the model to use for running the query against\n * - I.e. the model \"users\" will return /users\n * \n * @param {string} model Model name\n * @returns {this}\n */\n public setModel(model: string): this {\n this._nestService.model = model;\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 param\n * @returns {this}\n */\n public setPage(page: number): this {\n this._nestService.page = page;\n return this;\n }\n}\n","import { IPaginationConfig } from '../interfaces/pagination-config.interface';\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}","import { Inject, Injectable, Optional } from \"@angular/core\";\nimport { IPaginationConfig } from \"../interfaces/pagination-config.interface\";\nimport { PaginatedCollection } from \"../models/paginated-collection\";\nimport { ResponseOptions } from \"../models/response-options\";\nimport { IPaginatedObject } from \"../interfaces/paginated-object.interface\";\n\n@Injectable()\nexport class PaginationService {\n private _options: ResponseOptions;\n \n constructor(@Inject('RESPONSE_OPTIONS') @Optional() options: IPaginationConfig = {}) {\n this._options = new ResponseOptions(options);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public paginate<T extends IPaginatedObject>(response: {[key: string]: any}): PaginatedCollection<T> {\n return new PaginatedCollection(\n response[this._options.data],\n response[this._options.currentPage],\n response[this._options.from],\n response[this._options.to],\n response[this._options.total],\n response[this._options.perPage],\n response[this._options.prevPageUrl],\n response[this._options.nextPageUrl],\n response[this._options.lastPage],\n response[this._options.firstPageUrl],\n response[this._options.lastPageUrl]\n );\n }\n}","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { NgQubeeService } from './services/ng-qubee.service';\nimport { IConfig } from './interfaces/config.interface';\nimport { PaginationService } from './services/pagination.service';\nimport { NestService } from './services/nest.service';\n\n// @dynamic\n@NgModule({\n providers: [{\n deps: [NestService],\n provide: NgQubeeService,\n useFactory: (nestService: NestService) => new NgQubeeService(nestService, {})\n }]\n})\nexport class NgQubeeModule {\n public static forRoot(config: IConfig = {}): ModuleWithProviders<NgQubeeModule> {\n return {\n ngModule: NgQubeeModule,\n providers: [\n NestService,\n {\n deps: [NestService],\n provide: NgQubeeService,\n useFactory: (nestService: NestService) =>\n new NgQubeeService(nestService, Object.assign({}, config.request))\n }, {\n provide: PaginationService,\n useFactory: () =>\n new PaginationService(Object.assign({}, config.response))\n }\n ]\n };\n }\n}\n","import { EnvironmentProviders, makeEnvironmentProviders } from \"@angular/core\";\nimport { IConfig } from \"./interfaces/config.interface\";\nimport { NgQubeeService } from \"./services/ng-qubee.service\";\nimport { PaginationService } from \"./services/pagination.service\";\nimport { NestService } from \"./services/nest.service\";\n\n/**\n * Sets up providers necessary to enable `NgQubee` functionality for the application.\n *\n * @usageNotes\n *\n * Basic example of how you can add NgQubee to your application:\n * ```\n * const config = {};\n * \n * bootstrapApplication(AppComponent, {\n * providers: [provideNgQubee(config)]\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([\n {\n provide: NestService,\n useClass: NestService\n },\n {\n deps: [NestService],\n provide: NgQubeeService,\n useFactory: (nestService: NestService) => new NgQubeeService(nestService, Object.assign({}, config.request))\n }, {\n provide: PaginationService,\n useFactory: () => new PaginationService(Object.assign({}, config.response))\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// Error classes\nexport * from './lib/errors/invalid-model-name.error';\nexport * from './lib/errors/invalid-page-number.error';\nexport * from './lib/errors/invalid-limit.error';\nexport * from './lib/errors/key-not-found.error';\nexport * from './lib/errors/unselectable-model.error';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAAM,MAAO,gBAAiB,SAAQ,KAAK,CA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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/sort.enum.ts","../../../src/lib/errors/unselectable-model.error.ts","../../../src/lib/models/query-builder-options.ts","../../../src/lib/errors/invalid-model-name.error.ts","../../../src/lib/errors/invalid-page-number.error.ts","../../../src/lib/errors/invalid-limit.error.ts","../../../src/lib/services/nest.service.ts","../../../src/lib/services/ng-qubee.service.ts","../../../src/lib/models/response-options.ts","../../../src/lib/services/pagination.service.ts","../../../src/lib/ng-qubee.module.ts","../../../src/lib/provide-ngqubee.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}","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}","import { IQueryBuilderConfig } from '../interfaces/query-builder-config.interface';\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 sort: 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.sort = options.sort || 'sort';\n }\n}","export class InvalidModelNameError extends Error {\n constructor(model: string | null | undefined) {\n super(\n `Invalid model name: Model name must be a non-empty string. Received: ${JSON.stringify(model)}`\n );\n this.name = 'InvalidModelNameError';\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","export class InvalidLimitError extends Error {\n constructor(limit: number) {\n super(\n `Invalid limit value: Limit must be a positive integer greater than 0. Received: ${limit}`\n );\n this.name = 'InvalidLimitError';\n }\n}\n","import { Injectable, Signal, WritableSignal, computed, signal } from '@angular/core';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\nimport { IFields } from '../interfaces/fields.interface';\nimport { IFilters } from '../interfaces/filters.interface';\nimport { ISort } from '../interfaces/sort.interface';\nimport { InvalidModelNameError } from '../errors/invalid-model-name.error';\nimport { InvalidPageNumberError } from '../errors/invalid-page-number.error';\nimport { InvalidLimitError } from '../errors/invalid-limit.error';\n\nconst INITIAL_STATE: IQueryBuilderState = {\n baseUrl: '',\n fields: {},\n filters: {},\n includes: [],\n limit: 15,\n model: '',\n page: 1,\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 * Must be a positive integer greater than 0\n *\n * @param {number} limit - The number of items per page\n * @throws {InvalidLimitError} If limit is not a positive integer\n * @example\n * service.limit = 25;\n */\n set limit(limit: number) {\n this._validateLimit(limit);\n this._nest.update(nest => ({\n ...nest,\n limit\n }));\n }\n\n /**\n * Set the model name for the query\n * Must be a non-empty string\n *\n * @param {string} model - The model/resource name (e.g., 'users', 'posts')\n * @throws {InvalidModelNameError} If model is not a non-empty string\n * @example\n * service.model = 'users';\n */\n set model(model: string) {\n this._validateModelName(model);\n this._nest.update(nest => ({\n ...nest,\n model\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 private _clone<T>(obj: T): T {\n return JSON.parse( JSON.stringify(obj) );\n }\n\n /**\n * Validates that the model name is a non-empty string\n *\n * @param {string} model - The model name to validate\n * @throws {InvalidModelNameError} If model is not a non-empty string\n * @private\n */\n private _validateModelName(model: string): void {\n if (!model || typeof model !== 'string' || model.trim().length === 0) {\n throw new InvalidModelNameError(model);\n }\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 limit is a positive integer\n *\n * @param {number} limit - The limit value to validate\n * @throws {InvalidLimitError} If limit is not a positive integer\n * @private\n */\n private _validateLimit(limit: number): void {\n if (!Number.isInteger(limit) || limit < 1) {\n throw new InvalidLimitError(limit);\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 model 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 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 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 * 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 * // State is now: { baseUrl: '', fields: {}, filters: {}, includes: [], limit: 15, model: '', page: 1, sorts: [] }\n */\n public reset(): void {\n this._nest.update(_ => this._clone(INITIAL_STATE));\n }\n}\n","import { Inject, Injectable, Optional } from '@angular/core';\nimport * as qs from 'qs';\nimport { BehaviorSubject, Observable, filter, throwError } from 'rxjs';\n\n// Enums\nimport { SortEnum } from '../enums/sort.enum';\n\n// Errors\nimport { UnselectableModelError } from '../errors/unselectable-model.error';\n\n// Interfaces\nimport { IFields } from '../interfaces/fields.interface';\nimport { IQueryBuilderConfig } from '../interfaces/query-builder-config.interface';\nimport { IQueryBuilderState } from '../interfaces/query-builder-state.interface';\n\n// Models\nimport { QueryBuilderOptions } from '../models/query-builder-options';\n\n// Services\nimport { NestService } from './nest.service';\n\n@Injectable()\nexport class NgQubeeService {\n\n private _options: QueryBuilderOptions;\n\n /**\n * This property serves as an accumulator for holding the composed string with each query param\n */\n private _uri = '';\n\n private _uri$: BehaviorSubject<string> = new BehaviorSubject('');\n\n public uri$: Observable<string> = this._uri$.asObservable().pipe(\n filter(uri => !!uri)\n );\n\n constructor(private _nestService: NestService, @Inject('QUERY_PARAMS_CONFIG') @Optional() options: IQueryBuilderConfig = {}) {\n this._options = new QueryBuilderOptions(options);\n }\n\n private _parseFields(s: IQueryBuilderState): string {\n if (!Object.keys(s.fields).length) {\n return this._uri;\n }\n\n if (!s.model) {\n throw new Error('While selecting fields, the -> model <- is required');\n }\n\n if (!(s.model in s.fields)) {\n throw new Error(`Key ${s.model} is missing in the fields object`);\n }\n\n const f = {};\n\n for (const k in s.fields) {\n if (s.fields.hasOwnProperty(k)) {\n // Check if the key is the model or is declared in \"includes\".\n // If not, it means that has not been selected anywhere and that will cause an error on the API\n if (k !== s.model && !s.includes.includes(k)) {\n throw new UnselectableModelError(k);\n }\n\n Object.assign(f, { [`${this._options.fields}[${k}]`]: s.fields[k].join(',') });\n }\n }\n\n const param = `${this._prepend(s.model)}${qs.stringify(f, { encode: false })}`;\n this._uri += param;\n\n return param;\n }\n\n private _parseFilters(s: IQueryBuilderState): string {\n const keys = Object.keys(s.filters);\n\n if (!keys.length) {\n return this._uri;\n }\n\n const f = {\n [`${this._options.filters}`]: keys.reduce((acc, key) => {\n return Object.assign(acc, { [key]: s.filters[key].join(',') });\n }, {})\n };\n const param = `${this._prepend(s.model)}${qs.stringify(f, { encode: false })}`;\n\n this._uri += param;\n\n return param;\n }\n\n private _parseIncludes(s: IQueryBuilderState): string {\n if (!s.includes.length) {\n return this._uri;\n }\n\n const param = `${this._prepend(s.model)}${this._options.includes}=${s.includes}`;\n this._uri += param;\n\n return param;\n }\n\n private _parseLimit(s: IQueryBuilderState): string {\n const param = `${this._prepend(s.model)}${this._options.limit}=${s.limit}`;\n this._uri += param;\n\n return param;\n }\n\n private _parsePage(s: IQueryBuilderState): string {\n const param = `${this._prepend(s.model)}${this._options.page}=${s.page}`;\n this._uri += param;\n\n return param;\n }\n\n private _parseSort(s: IQueryBuilderState): string {\n let param: string = '';\n\n if (!s.sorts.length) {\n return param;\n }\n\n param = `${this._prepend(s.model)}${this._options.sort}=`;\n\n s.sorts.forEach((sort, idx) => {\n param += `${sort.order === SortEnum.DESC ? '-' : ''}${sort.field}`;\n\n if (idx < s.sorts.length - 1) {\n param += ','\n }\n });\n\n this._uri += param;\n\n return param;\n }\n\n private _parse(s: IQueryBuilderState): string {\n if (!s.model) {\n throw new Error('Set the model property BEFORE adding filters or calling the url() / get() methods');\n }\n\n // Cleanup the previously generated URI\n this._uri = '';\n\n this._parseIncludes(s);\n this._parseFields(s);\n this._parseFilters(s);\n this._parseLimit(s);\n this._parsePage(s);\n this._parseSort(s);\n\n return this._uri;\n }\n\n private _prepend(model: string): string {\n const state = this._nestService.nest();\n const baseUrl = state.baseUrl;\n\n if (this._uri) {\n return '&';\n }\n\n return baseUrl ? `${baseUrl}/${model}?` : `/${model}?`;\n }\n\n /**\n * Add fields to the select statement for the given model\n *\n * @param model Model that holds the fields\n * @param fields Fields to select\n * @returns {this}\n */\n public addFields(model: string, fields: string[]): this {\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)\n * I.e. filter[field]=1 or filter[field]=1,2,3\n * \n * @param {string} field Name of the field to filter\n * @param {string[]} value The needle(s)\n * @returns {this}\n */\n public addFilter(field: string, ...values: (string | number | boolean)[]): this {\n if (!values.length) {\n return this;\n }\n\n this._nestService.addFilters({\n [field]: values\n });\n\n return this;\n }\n\n /**\n * Add related entities to include in the request\n * \n * @param {string[]} models \n * @returns \n */\n public addIncludes(...models: string[]): this {\n if (!models.length) {\n return this;\n }\n\n this._nestService.addIncludes(models);\n\n return this;\n }\n\n /**\n * Add a field with a sort criteria\n * \n * @param field Field to use for sorting\n * @param {SortEnum} order A value from the SortEnum enumeration\n * @returns {this}\n */\n public addSort(field: string, order: SortEnum): this {\n this._nestService.addSort({\n field,\n order\n });\n\n return this;\n }\n\n /**\n * Delete selected fields for the given models in the current query builder state\n * \n * ```\n * ngQubeeService.deleteFields({\n * users: ['email', 'password'],\n * address: ['zipcode']\n * });\n * ```\n * \n * @param {IFields} fields \n * @returns \n */\n public deleteFields(fields: IFields): this {\n this._nestService.deleteFields(fields);\n return this;\n }\n\n /**\n * Delete selected fields for the given model in the current query builder state\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 */\n public deleteFieldsByModel(model: string, ...fields: string[]): this {\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\n * \n * @param {string[]} filters Filters to remove\n * @returns {this}\n */\n public deleteFilters(...filters: string[]): this {\n if (!filters.length) {\n return this;\n }\n\n this._nestService.deleteFilters(...filters);\n\n return this;\n }\n\n /**\n * Remove selected related models from the query builder state\n * \n * @param {string[]} includes Models to remove\n * @returns \n */\n public deleteIncludes(...includes: string[]): this {\n if (!includes.length) {\n return this;\n }\n\n this._nestService.deleteIncludes(...includes);\n\n return this;\n }\n\n /**\n * Remove sorts rules from the query builder state\n * \n * @param sorts Fields used for sorting to remove\n * @returns {this}\n */\n public deleteSorts(...sorts: string[]): this {\n this._nestService.deleteSorts(...sorts);\n return this;\n }\n\n /**\n * Generate an URI accordingly to the given data\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._parse(this._nestService.nest()));\n return this.uri$;\n } catch (error) {\n return throwError(() => error);\n }\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 return this;\n }\n\n /**\n * Set the base url to use for composing the address\n * \n * @param {string} baseUrl \n * @returns {this}\n */\n public setBaseUrl(baseUrl: string): this {\n this._nestService.baseUrl = baseUrl;\n return this;\n }\n\n /**\n * Set the items per page number\n * \n * @param limit \n * @returns {this}\n */\n public setLimit(limit: number): this {\n this._nestService.limit = limit;\n return this;\n }\n\n /**\n * Set the model to use for running the query against\n * - I.e. the model \"users\" will return /users\n * \n * @param {string} model Model name\n * @returns {this}\n */\n public setModel(model: string): this {\n this._nestService.model = model;\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 param\n * @returns {this}\n */\n public setPage(page: number): this {\n this._nestService.page = page;\n return this;\n }\n}\n","import { IPaginationConfig } from '../interfaces/pagination-config.interface';\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}","import { Inject, Injectable, Optional } from \"@angular/core\";\nimport { IPaginationConfig } from \"../interfaces/pagination-config.interface\";\nimport { PaginatedCollection } from \"../models/paginated-collection\";\nimport { ResponseOptions } from \"../models/response-options\";\nimport { IPaginatedObject } from \"../interfaces/paginated-object.interface\";\n\n@Injectable()\nexport class PaginationService {\n private _options: ResponseOptions;\n \n constructor(@Inject('RESPONSE_OPTIONS') @Optional() options: IPaginationConfig = {}) {\n this._options = new ResponseOptions(options);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public paginate<T extends IPaginatedObject>(response: {[key: string]: any}): PaginatedCollection<T> {\n return new PaginatedCollection(\n response[this._options.data],\n response[this._options.currentPage],\n response[this._options.from],\n response[this._options.to],\n response[this._options.total],\n response[this._options.perPage],\n response[this._options.prevPageUrl],\n response[this._options.nextPageUrl],\n response[this._options.lastPage],\n response[this._options.firstPageUrl],\n response[this._options.lastPageUrl]\n );\n }\n}","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { NgQubeeService } from './services/ng-qubee.service';\nimport { IConfig } from './interfaces/config.interface';\nimport { PaginationService } from './services/pagination.service';\nimport { NestService } from './services/nest.service';\n\n// @dynamic\n@NgModule({\n providers: [{\n deps: [NestService],\n provide: NgQubeeService,\n useFactory: (nestService: NestService) => new NgQubeeService(nestService, {})\n }]\n})\nexport class NgQubeeModule {\n public static forRoot(config: IConfig = {}): ModuleWithProviders<NgQubeeModule> {\n return {\n ngModule: NgQubeeModule,\n providers: [\n NestService,\n {\n deps: [NestService],\n provide: NgQubeeService,\n useFactory: (nestService: NestService) =>\n new NgQubeeService(nestService, Object.assign({}, config.request))\n }, {\n provide: PaginationService,\n useFactory: () =>\n new PaginationService(Object.assign({}, config.response))\n }\n ]\n };\n }\n}\n","import { EnvironmentProviders, makeEnvironmentProviders } from \"@angular/core\";\nimport { IConfig } from \"./interfaces/config.interface\";\nimport { NgQubeeService } from \"./services/ng-qubee.service\";\nimport { PaginationService } from \"./services/pagination.service\";\nimport { NestService } from \"./services/nest.service\";\n\n/**\n * Sets up providers necessary to enable `NgQubee` functionality for the application.\n *\n * @usageNotes\n *\n * Basic example of how you can add NgQubee to your application:\n * ```\n * const config = {};\n * \n * bootstrapApplication(AppComponent, {\n * providers: [provideNgQubee(config)]\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([\n {\n provide: NestService,\n useClass: NestService\n },\n {\n deps: [NestService],\n provide: NgQubeeService,\n useFactory: (nestService: NestService) => new NgQubeeService(nestService, Object.assign({}, config.request))\n }, {\n provide: PaginationService,\n useFactory: () => new PaginationService(Object.assign({}, config.response))\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/sort.enum';\n\n// Error classes\nexport * from './lib/errors/invalid-limit.error';\nexport * from './lib/errors/invalid-model-name.error';\nexport * from './lib/errors/invalid-page-number.error';\nexport * from './lib/errors/key-not-found.error';\nexport * from './lib/errors/unselectable-model.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/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/sort.interface';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"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;;AAE7F;;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,WACW,CAAA,IAAS,EACA,IAAY,EACZ,IAAa,EACb,EAAW,EACX,KAAc,EACd,OAAgB,EAChB,WAAoB,EACpB,WAAoB,EACpB,QAAiB,EACjB,YAAqB,EACrB,WAAoB,EAAA;QAV7B,IAAI,CAAA,IAAA,GAAJ,IAAI;QACK,IAAI,CAAA,IAAA,GAAJ,IAA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,cAAc,CAAC,WAAW,EAAE,EAAE;aAC7E,CAAC,EAAA,CAAA;;4FAES,aAAa,EAAA,UAAA,EAAA,CAAA;kBAPzB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,SAAS,EAAE,CAAC;4BACV,IAAI,EAAE,CAAC,WAAW,CAAC;AACnB,4BAAA,OAAO,EAAE,cAAc;AACvB,4BAAA,UAAU,EAAE,CAAC,WAAwB,KAAK,IAAI,cAAc,CAAC,WAAW,EAAE,EAAE;yBAC7E;AACF,iBAAA;;;ACPD;;;;;;;;;;;;;;;;;AAiBG;AACa,SAAA,cAAc,CAAC,MAAA,GAAkB,EAAE,EAAA;AACjD,IAAA,OAAO,wBAAwB,CAAC;AAC9B,QAAA;AACE,YAAA,OAAO,EAAE,WAAW;AACpB,YAAA,QAAQ,EAAE;AACX,SAAA;AACD,QAAA;YACE,IAAI,EAAE,CAAC,WAAW,CAAC;AACnB,YAAA,OAAO,EAAE,cAAc;YACvB,UAAU,EAAE,CAAC,WAAwB,KAAK,IAAI,cAAc,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC;SAC5G,EAAE;AACD,YAAA,OAAO,EAAE,iBAAiB;AAC1B,YAAA,UAAU,EAAE,MAAM,IAAI,iBAAiB,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,QAAQ,CAAC;AAC3E;AACF,KAAA,CAAC;AACJ;;ACvCA;;AAEG;;ACFH;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"email": "info@andreatantimonaco.me",
|
|
6
6
|
"url": "https://andreatantimonaco.me"
|
|
7
7
|
},
|
|
8
|
-
"version": "2.0
|
|
8
|
+
"version": "2.1.0",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -38,6 +38,11 @@
|
|
|
38
38
|
"@angular/core": ">=16.0.0 <22.0.0",
|
|
39
39
|
"rxjs": "^6.5.0 || ^7.0.0"
|
|
40
40
|
},
|
|
41
|
+
"lint-staged": {
|
|
42
|
+
"src/**/*.ts": [
|
|
43
|
+
"eslint --fix"
|
|
44
|
+
]
|
|
45
|
+
},
|
|
41
46
|
"sideEffects": false,
|
|
42
47
|
"module": "fesm2022/ng-qubee.mjs",
|
|
43
48
|
"typings": "index.d.ts",
|
package/public-api.d.ts
CHANGED
|
@@ -3,8 +3,18 @@ export * from './lib/ng-qubee.module';
|
|
|
3
3
|
export * from './lib/provide-ngqubee';
|
|
4
4
|
export * from './lib/services/ng-qubee.service';
|
|
5
5
|
export * from './lib/services/pagination.service';
|
|
6
|
+
export * from './lib/enums/sort.enum';
|
|
7
|
+
export * from './lib/errors/invalid-limit.error';
|
|
6
8
|
export * from './lib/errors/invalid-model-name.error';
|
|
7
9
|
export * from './lib/errors/invalid-page-number.error';
|
|
8
|
-
export * from './lib/errors/invalid-limit.error';
|
|
9
10
|
export * from './lib/errors/key-not-found.error';
|
|
10
11
|
export * from './lib/errors/unselectable-model.error';
|
|
12
|
+
export * from './lib/interfaces/config.interface';
|
|
13
|
+
export * from './lib/interfaces/fields.interface';
|
|
14
|
+
export * from './lib/interfaces/filters.interface';
|
|
15
|
+
export * from './lib/interfaces/nest-state.interface';
|
|
16
|
+
export * from './lib/interfaces/page.interface';
|
|
17
|
+
export * from './lib/interfaces/paginated-object.interface';
|
|
18
|
+
export * from './lib/interfaces/pagination-config.interface';
|
|
19
|
+
export * from './lib/interfaces/query-builder-config.interface';
|
|
20
|
+
export * from './lib/interfaces/sort.interface';
|