ng-qubee 1.0.9 → 2.0.2
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 +90 -67
- package/esm2022/lib/enums/sort.enum.mjs +6 -0
- package/esm2022/lib/errors/key-not-found.error.mjs +6 -0
- package/esm2022/lib/errors/unselectable-model.error.mjs +6 -0
- package/esm2022/lib/interfaces/config.interface.mjs +2 -0
- package/esm2022/lib/interfaces/fields.interface.mjs +2 -0
- package/esm2022/lib/interfaces/filters.interface.mjs +2 -0
- package/esm2022/lib/interfaces/normalized.interface.mjs +2 -0
- package/esm2022/lib/interfaces/paginated-object.interface.mjs +2 -0
- package/esm2022/lib/interfaces/pagination-config.interface.mjs +2 -0
- package/esm2022/lib/interfaces/query-builder-config.interface.mjs +2 -0
- package/esm2022/lib/interfaces/query-builder-state.interface.mjs +2 -0
- package/esm2022/lib/interfaces/sort.interface.mjs +2 -0
- package/esm2022/lib/models/paginated-collection.mjs +47 -0
- package/esm2022/lib/models/query-builder-options.mjs +12 -0
- package/esm2022/lib/models/response-options.mjs +17 -0
- package/esm2022/lib/ng-qubee.module.mjs +42 -0
- package/esm2022/lib/provide-ngqubee.mjs +39 -0
- package/esm2022/lib/services/nest.service.mjs +173 -0
- package/esm2022/lib/services/ng-qubee.service.mjs +319 -0
- package/esm2022/lib/services/pagination.service.mjs +23 -0
- package/esm2022/ng-qubee.mjs +5 -0
- package/esm2022/public-api.mjs +9 -0
- package/fesm2022/ng-qubee.mjs +678 -0
- package/fesm2022/ng-qubee.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/interfaces/normalized.interface.d.ts +3 -0
- package/lib/interfaces/paginated-object.interface.d.ts +3 -0
- package/lib/interfaces/query-builder-state.interface.d.ts +1 -2
- package/lib/interfaces/sort.interface.d.ts +2 -1
- package/lib/models/paginated-collection.d.ts +18 -16
- package/lib/ng-qubee.module.d.ts +4 -1
- package/lib/provide-ngqubee.d.ts +21 -0
- package/lib/services/nest.service.d.ts +81 -0
- package/lib/{ng-qubee.service.d.ts → services/ng-qubee.service.d.ts} +30 -8
- package/lib/services/pagination.service.d.ts +5 -1
- package/package.json +20 -18
- package/public-api.d.ts +3 -2
- package/bundles/ng-qubee.umd.js +0 -909
- package/bundles/ng-qubee.umd.js.map +0 -1
- package/bundles/ng-qubee.umd.min.js +0 -16
- package/bundles/ng-qubee.umd.min.js.map +0 -1
- package/esm2015/lib/actions/query-builder.actions.js +0 -17
- package/esm2015/lib/enums/sort.enum.js +0 -6
- package/esm2015/lib/errors/key-not-found.error.js +0 -6
- package/esm2015/lib/errors/unselectable-model.error.js +0 -6
- package/esm2015/lib/interfaces/config.interface.js +0 -2
- package/esm2015/lib/interfaces/fields.interface.js +0 -2
- package/esm2015/lib/interfaces/filters.interface.js +0 -2
- package/esm2015/lib/interfaces/nest-state.interface.js +0 -2
- package/esm2015/lib/interfaces/pagination-config.interface.js +0 -2
- package/esm2015/lib/interfaces/query-builder-config.interface.js +0 -2
- package/esm2015/lib/interfaces/query-builder-state.interface.js +0 -2
- package/esm2015/lib/interfaces/sort.interface.js +0 -2
- package/esm2015/lib/models/paginated-collection.js +0 -45
- package/esm2015/lib/models/query-builder-options.js +0 -12
- package/esm2015/lib/models/response-options.js +0 -17
- package/esm2015/lib/ng-qubee.module.js +0 -33
- package/esm2015/lib/ng-qubee.service.js +0 -280
- package/esm2015/lib/reducers/query-builder.reducer.js +0 -51
- package/esm2015/lib/services/pagination.service.js +0 -18
- package/esm2015/lib/services/store.service.js +0 -26
- package/esm2015/ng-qubee.js +0 -6
- package/esm2015/public-api.js +0 -8
- package/fesm2015/ng-qubee.js +0 -508
- package/fesm2015/ng-qubee.js.map +0 -1
- package/lib/actions/query-builder.actions.d.ts +0 -43
- package/lib/interfaces/nest-state.interface.d.ts +0 -4
- package/lib/reducers/query-builder.reducer.d.ts +0 -2
- package/lib/services/store.service.d.ts +0 -9
- package/ng-qubee.d.ts +0 -7
- package/ng-qubee.metadata.json +0 -1
|
@@ -0,0 +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/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}","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';\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 set baseUrl(baseUrl: string) {\n this._nest.update(nest => ({\n ...nest,\n baseUrl\n }));\n }\n\n set limit(limit: number) {\n this._nest.update(nest => ({\n ...nest,\n limit\n }));\n }\n\n set model(model: string) {\n this._nest.update(nest => ({\n ...nest,\n model\n }));\n }\n\n set page(page: number) {\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 * Add selectable fields for the given model to the request\n * \n * @param {IFields} fields \n * @return {void}\n * @todo Avoid duplicated fields\n */\n public addFields(fields: IFields): void {\n this._nest.update(nest => ({\n ...nest,\n fields: { ...nest.fields, ...fields }\n }));\n }\n\n /**\n * Add filters to the request\n * \n * @param {IFilters} filters\n * @todo Avoid duplicated filters\n */\n public addFilters(filters: IFilters): void {\n this._nest.update(nest => ({\n ...nest,\n filters: { ...nest.filters, ...filters }\n }));\n }\n\n /**\n * Add resources to include with the request\n * \n * @param {string[]} includes models to include to the request\n * @return {void}\n * @todo Avoid duplicated includes\n */\n public addIncludes(includes: string[]): void {\n this._nest.update(nest => ({\n ...nest,\n includes: [...nest.includes, ...includes]\n }))\n }\n\n /**\n * Add a field that should be used for sorting data\n * \n * @param {ISort} sort\n * @return {void}\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 * \n * @param {IFields} fields \n */\n public deleteFields(fields: IFields): void {\n const f = Object.assign({}, this.nest().fields);\n\n Object.keys(fields).forEach(k => {\n if (!(k in f)) {\n return;\n }\n\n f[k] = this._nest().fields[k].filter(v => !fields[k].includes(v));\n });\n\n this._nest.update(nest => ({\n ...nest,\n fields: f\n }));\n }\n\n /**\n * \n * @param filters \n * @todo Create a clone of the filter obj before assigning to f\n */\n public deleteFilters(...filters: string[]): void {\n const f = Object.assign({}, 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 * \n * @param includes \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 * \n * @param sorts \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 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 // private _removeArgIfEmpty(arg: string): string {\n // const params = new URL(this._uri).searchParams;\n \n // if (!params.get(arg)) {\n // params.delete(arg);\n // }\n \n\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';\nimport { IQueryBuilderConfig } from '../interfaces/query-builder-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 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 * 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,E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-
|
|
1
|
+
import { INormalized } from "../interfaces/normalized.interface";
|
|
2
|
+
import { IPaginatedObject } from "../interfaces/paginated-object.interface";
|
|
3
|
+
export declare class PaginatedCollection<T extends IPaginatedObject> {
|
|
2
4
|
data: T[];
|
|
3
5
|
readonly page: number;
|
|
4
|
-
readonly from?: number;
|
|
5
|
-
readonly to?: number;
|
|
6
|
-
readonly total?: number;
|
|
7
|
-
readonly perPage?: number;
|
|
8
|
-
readonly prevPageUrl?: string;
|
|
9
|
-
readonly nextPageUrl?: string;
|
|
10
|
-
readonly lastPage?: number;
|
|
11
|
-
readonly firstPageUrl?: string;
|
|
12
|
-
readonly lastPageUrl?: string;
|
|
13
|
-
constructor(data: T[], page: number, from?: number, to?: number, total?: number, perPage?: number, prevPageUrl?: string, nextPageUrl?: string, lastPage?: number, firstPageUrl?: string, lastPageUrl?: string);
|
|
6
|
+
readonly from?: number | undefined;
|
|
7
|
+
readonly to?: number | undefined;
|
|
8
|
+
readonly total?: number | undefined;
|
|
9
|
+
readonly perPage?: number | undefined;
|
|
10
|
+
readonly prevPageUrl?: string | undefined;
|
|
11
|
+
readonly nextPageUrl?: string | undefined;
|
|
12
|
+
readonly lastPage?: number | undefined;
|
|
13
|
+
readonly firstPageUrl?: string | undefined;
|
|
14
|
+
readonly lastPageUrl?: string | undefined;
|
|
15
|
+
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);
|
|
14
16
|
/**
|
|
15
|
-
* Normalize the collection to a paginated list of ids for state-managed
|
|
17
|
+
* Normalize the collection to a paginated list of ids for state-managed applications.
|
|
16
18
|
*
|
|
17
19
|
* This method returns a single key object, where the key is the page number and the associated value is
|
|
18
20
|
* an array of ids. Each id is fetched by the collection items, looking up for the "id" key. If an id is supplied
|
|
19
21
|
* to this method, it will be used instead of the default "id" key.
|
|
20
22
|
*
|
|
21
|
-
* Please note that in case the key doesn't exist in the collection's item,
|
|
23
|
+
* Please note that in case the key doesn't exist in the collection's item, a KeyNotFoundError is thrown
|
|
22
24
|
*
|
|
23
25
|
* @param k A key to use instead of the default "id": this will be searched inside each element of the collection
|
|
26
|
+
* @returns []
|
|
27
|
+
* @throws KeyNotFoundItem
|
|
24
28
|
*/
|
|
25
|
-
normalize(id?: string):
|
|
26
|
-
[x: number]: any[];
|
|
27
|
-
};
|
|
29
|
+
normalize(id?: string): INormalized;
|
|
28
30
|
}
|
package/lib/ng-qubee.module.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { ModuleWithProviders } from '@angular/core';
|
|
2
2
|
import { IConfig } from './interfaces/config.interface';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
3
4
|
export declare class NgQubeeModule {
|
|
4
|
-
private static _config;
|
|
5
5
|
static forRoot(config?: IConfig): ModuleWithProviders<NgQubeeModule>;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgQubeeModule, never>;
|
|
7
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgQubeeModule, never, never, never>;
|
|
8
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NgQubeeModule>;
|
|
6
9
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { EnvironmentProviders } from "@angular/core";
|
|
2
|
+
import { IConfig } from "./interfaces/config.interface";
|
|
3
|
+
/**
|
|
4
|
+
* Sets up providers necessary to enable `NgQubee` functionality for the application.
|
|
5
|
+
*
|
|
6
|
+
* @usageNotes
|
|
7
|
+
*
|
|
8
|
+
* Basic example of how you can add NgQubee to your application:
|
|
9
|
+
* ```
|
|
10
|
+
* const config = {};
|
|
11
|
+
*
|
|
12
|
+
* bootstrapApplication(AppComponent, {
|
|
13
|
+
* providers: [provideNgQubee(config)]
|
|
14
|
+
* });
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @publicApi
|
|
18
|
+
* @param config Configuration object compliant to the IConfig interface
|
|
19
|
+
* @returns A set of providers to setup NgQubee
|
|
20
|
+
*/
|
|
21
|
+
export declare function provideNgQubee(config?: IConfig): EnvironmentProviders;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { Signal } from '@angular/core';
|
|
2
|
+
import { IQueryBuilderState } from '../interfaces/query-builder-state.interface';
|
|
3
|
+
import { IFields } from '../interfaces/fields.interface';
|
|
4
|
+
import { IFilters } from '../interfaces/filters.interface';
|
|
5
|
+
import { ISort } from '../interfaces/sort.interface';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class NestService {
|
|
8
|
+
/**
|
|
9
|
+
* Private writable signal that holds the Query Builder state
|
|
10
|
+
*
|
|
11
|
+
* @type {IQueryBuilderState}
|
|
12
|
+
*/
|
|
13
|
+
private _nest;
|
|
14
|
+
/**
|
|
15
|
+
* A computed signal that makes readonly the writable signal _nest
|
|
16
|
+
*
|
|
17
|
+
* @type {Signal<IQueryBuilderState>}
|
|
18
|
+
*/
|
|
19
|
+
nest: Signal<IQueryBuilderState>;
|
|
20
|
+
constructor();
|
|
21
|
+
set baseUrl(baseUrl: string);
|
|
22
|
+
set limit(limit: number);
|
|
23
|
+
set model(model: string);
|
|
24
|
+
set page(page: number);
|
|
25
|
+
private _clone;
|
|
26
|
+
/**
|
|
27
|
+
* Add selectable fields for the given model to the request
|
|
28
|
+
*
|
|
29
|
+
* @param {IFields} fields
|
|
30
|
+
* @return {void}
|
|
31
|
+
* @todo Avoid duplicated fields
|
|
32
|
+
*/
|
|
33
|
+
addFields(fields: IFields): void;
|
|
34
|
+
/**
|
|
35
|
+
* Add filters to the request
|
|
36
|
+
*
|
|
37
|
+
* @param {IFilters} filters
|
|
38
|
+
* @todo Avoid duplicated filters
|
|
39
|
+
*/
|
|
40
|
+
addFilters(filters: IFilters): void;
|
|
41
|
+
/**
|
|
42
|
+
* Add resources to include with the request
|
|
43
|
+
*
|
|
44
|
+
* @param {string[]} includes models to include to the request
|
|
45
|
+
* @return {void}
|
|
46
|
+
* @todo Avoid duplicated includes
|
|
47
|
+
*/
|
|
48
|
+
addIncludes(includes: string[]): void;
|
|
49
|
+
/**
|
|
50
|
+
* Add a field that should be used for sorting data
|
|
51
|
+
*
|
|
52
|
+
* @param {ISort} sort
|
|
53
|
+
* @return {void}
|
|
54
|
+
*/
|
|
55
|
+
addSort(sort: ISort): void;
|
|
56
|
+
/**
|
|
57
|
+
* Remove fields for the given model
|
|
58
|
+
*
|
|
59
|
+
* @param {IFields} fields
|
|
60
|
+
*/
|
|
61
|
+
deleteFields(fields: IFields): void;
|
|
62
|
+
/**
|
|
63
|
+
*
|
|
64
|
+
* @param filters
|
|
65
|
+
* @todo Create a clone of the filter obj before assigning to f
|
|
66
|
+
*/
|
|
67
|
+
deleteFilters(...filters: string[]): void;
|
|
68
|
+
/**
|
|
69
|
+
*
|
|
70
|
+
* @param includes
|
|
71
|
+
*/
|
|
72
|
+
deleteIncludes(...includes: string[]): void;
|
|
73
|
+
/**
|
|
74
|
+
*
|
|
75
|
+
* @param sorts
|
|
76
|
+
*/
|
|
77
|
+
deleteSorts(...sorts: string[]): void;
|
|
78
|
+
reset(): void;
|
|
79
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NestService, never>;
|
|
80
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<NestService>;
|
|
81
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { IQueryBuilderConfig } from './interfaces/query-builder-config.interface';
|
|
2
|
-
import { SortEnum } from './enums/sort.enum';
|
|
3
1
|
import { Observable } from 'rxjs';
|
|
4
|
-
import {
|
|
2
|
+
import { SortEnum } from '../enums/sort.enum';
|
|
3
|
+
import { IFields } from '../interfaces/fields.interface';
|
|
4
|
+
import { IQueryBuilderConfig } from '../interfaces/query-builder-config.interface';
|
|
5
|
+
import { NestService } from './nest.service';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
5
7
|
export declare class NgQubeeService {
|
|
6
|
-
private
|
|
8
|
+
private _nestService;
|
|
7
9
|
private _options;
|
|
8
10
|
/**
|
|
9
11
|
* This property serves as an accumulator for holding the composed string with each query param
|
|
@@ -11,7 +13,7 @@ export declare class NgQubeeService {
|
|
|
11
13
|
private _uri;
|
|
12
14
|
private _uri$;
|
|
13
15
|
uri$: Observable<string>;
|
|
14
|
-
constructor(
|
|
16
|
+
constructor(_nestService: NestService, options?: IQueryBuilderConfig);
|
|
15
17
|
private _parseFields;
|
|
16
18
|
private _parseFilters;
|
|
17
19
|
private _parseIncludes;
|
|
@@ -48,18 +50,36 @@ export declare class NgQubeeService {
|
|
|
48
50
|
* Add a field with a sort criteria
|
|
49
51
|
*
|
|
50
52
|
* @param field Field to use for sorting
|
|
51
|
-
* @param {SortEnum}
|
|
53
|
+
* @param {SortEnum} order A value from the SortEnum enumeration
|
|
52
54
|
* @returns {this}
|
|
53
55
|
*/
|
|
54
|
-
addSort(field: string,
|
|
56
|
+
addSort(field: string, order: SortEnum): this;
|
|
57
|
+
/**
|
|
58
|
+
* Delete selected fields for the given models in the current query builder state
|
|
59
|
+
*
|
|
60
|
+
* ```
|
|
61
|
+
* ngQubeeService.deleteFields({
|
|
62
|
+
* users: ['email', 'password'],
|
|
63
|
+
* address: ['zipcode']
|
|
64
|
+
* });
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* @param {IFields} fields
|
|
68
|
+
* @returns
|
|
69
|
+
*/
|
|
70
|
+
deleteFields(fields: IFields): this;
|
|
55
71
|
/**
|
|
56
72
|
* Delete selected fields for the given model in the current query builder state
|
|
57
73
|
*
|
|
74
|
+
* ```
|
|
75
|
+
* ngQubeeService.deleteFieldsByModel('users', 'email', 'password']);
|
|
76
|
+
* ```
|
|
77
|
+
*
|
|
58
78
|
* @param model Model that holds the fields
|
|
59
79
|
* @param {string[]} fields Fields to delete from the state
|
|
60
80
|
* @returns {this}
|
|
61
81
|
*/
|
|
62
|
-
|
|
82
|
+
deleteFieldsByModel(model: string, ...fields: string[]): this;
|
|
63
83
|
/**
|
|
64
84
|
* Remove given filters from the query builder state
|
|
65
85
|
*
|
|
@@ -122,4 +142,6 @@ export declare class NgQubeeService {
|
|
|
122
142
|
* @returns {this}
|
|
123
143
|
*/
|
|
124
144
|
setPage(page: number): this;
|
|
145
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgQubeeService, [null, { optional: true; }]>;
|
|
146
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<NgQubeeService>;
|
|
125
147
|
}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { IPaginationConfig } from "../interfaces/pagination-config.interface";
|
|
2
2
|
import { PaginatedCollection } from "../models/paginated-collection";
|
|
3
|
+
import { IPaginatedObject } from "../interfaces/paginated-object.interface";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
3
5
|
export declare class PaginationService {
|
|
4
6
|
private _options;
|
|
5
7
|
constructor(options?: IPaginationConfig);
|
|
6
|
-
paginate<T>(response: {
|
|
8
|
+
paginate<T extends IPaginatedObject>(response: {
|
|
7
9
|
[key: string]: any;
|
|
8
10
|
}): PaginatedCollection<T>;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PaginationService, [{ optional: true; }]>;
|
|
12
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<PaginationService>;
|
|
9
13
|
}
|
package/package.json
CHANGED
|
@@ -5,25 +5,27 @@
|
|
|
5
5
|
"email": "info@andreatantimonaco.me",
|
|
6
6
|
"url": "https://andreatantimonaco.me"
|
|
7
7
|
},
|
|
8
|
-
"version": "
|
|
8
|
+
"version": "2.0.2",
|
|
9
9
|
"license": "MIT",
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
"rxjs": "~6.6.0"
|
|
14
|
-
},
|
|
10
|
+
"allowedNonPeerDependencies": [
|
|
11
|
+
"qs"
|
|
12
|
+
],
|
|
15
13
|
"dependencies": {
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"redux": "^4.1.0",
|
|
19
|
-
"tslib": "^2.0.0"
|
|
14
|
+
"qs": "^6.11.2",
|
|
15
|
+
"tslib": "^2.3.0"
|
|
20
16
|
},
|
|
21
|
-
"
|
|
22
|
-
"module": "
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
"sideEffects": false,
|
|
18
|
+
"module": "fesm2022/ng-qubee.mjs",
|
|
19
|
+
"typings": "index.d.ts",
|
|
20
|
+
"exports": {
|
|
21
|
+
"./package.json": {
|
|
22
|
+
"default": "./package.json"
|
|
23
|
+
},
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./index.d.ts",
|
|
26
|
+
"esm2022": "./esm2022/ng-qubee.mjs",
|
|
27
|
+
"esm": "./esm2022/ng-qubee.mjs",
|
|
28
|
+
"default": "./fesm2022/ng-qubee.mjs"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
29
31
|
}
|
package/public-api.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export * from './lib/ng-qubee.service';
|
|
2
|
-
export * from './lib/ng-qubee.module';
|
|
3
1
|
export * from './lib/models/paginated-collection';
|
|
2
|
+
export * from './lib/ng-qubee.module';
|
|
3
|
+
export * from './lib/provide-ngqubee';
|
|
4
|
+
export * from './lib/services/ng-qubee.service';
|
|
4
5
|
export * from './lib/services/pagination.service';
|