@ethlete/query 0.1.0-next.10 → 0.1.0-next.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/esm2020/lib/auth/auth-provider.types.mjs +1 -1
  2. package/esm2020/lib/auth/basic-auth-provider.mjs +5 -5
  3. package/esm2020/lib/auth/bearer-auth-provider.mjs +18 -8
  4. package/esm2020/lib/auth/custom-header-auth-provider.mjs +4 -4
  5. package/esm2020/lib/directives/infinity-query-trigger.directive.mjs +3 -3
  6. package/esm2020/lib/directives/infinity-query.directive.mjs +7 -9
  7. package/esm2020/lib/directives/query.directive.mjs +17 -17
  8. package/esm2020/lib/infinite-query/infinity-query.mjs +11 -11
  9. package/esm2020/lib/query/query.mjs +44 -22
  10. package/esm2020/lib/query/query.types.mjs +1 -1
  11. package/esm2020/lib/query-client/query-client.mjs +7 -7
  12. package/esm2020/lib/query-client/query-client.types.mjs +1 -1
  13. package/esm2020/lib/query-form/query-form.mjs +4 -4
  14. package/fesm2015/ethlete-query.mjs +140 -106
  15. package/fesm2015/ethlete-query.mjs.map +1 -1
  16. package/fesm2020/ethlete-query.mjs +134 -103
  17. package/fesm2020/ethlete-query.mjs.map +1 -1
  18. package/lib/auth/auth-provider.types.d.ts +16 -1
  19. package/lib/auth/bearer-auth-provider.d.ts +1 -0
  20. package/lib/directives/infinity-query.directive.d.ts +1 -2
  21. package/lib/infinite-query/infinity-query.types.d.ts +4 -4
  22. package/lib/query/query.d.ts +5 -3
  23. package/lib/query/query.types.d.ts +17 -14
  24. package/lib/query/query.utils.d.ts +1 -1
  25. package/lib/query-client/query-client.d.ts +9 -9
  26. package/lib/query-client/query-client.types.d.ts +9 -9
  27. package/lib/query-form/query-form.types.d.ts +2 -2
  28. package/lib/request/request.types.d.ts +10 -10
  29. package/package.json +5 -5
@@ -2,35 +2,34 @@ import { __awaiter } from 'tslib';
2
2
  import { Subject, timer, filter, takeWhile, switchMap, of, BehaviorSubject, interval, takeUntil, tap, fromEvent, startWith, concat, take, debounceTime, combineLatest, map, distinctUntilChanged } from 'rxjs';
3
3
  import * as i0 from '@angular/core';
4
4
  import { Directive, Input, InjectionToken, inject, ChangeDetectorRef, ViewContainerRef, TemplateRef, ErrorHandler, ElementRef } from '@angular/core';
5
- import * as i1 from '@ethlete/core';
6
- import { DestroyDirective } from '@ethlete/core';
5
+ import { DestroyService } from '@ethlete/core';
7
6
  import { FormGroup } from '@angular/forms';
8
7
  import { Router, ActivatedRoute } from '@angular/router';
9
8
 
10
9
  class CustomHeaderAuthProvider {
10
+ get header() {
11
+ return { [this._config.name]: this._config.value };
12
+ }
11
13
  constructor(_config) {
12
14
  this._config = _config;
13
15
  this.queryClient = null;
14
16
  }
15
- get header() {
16
- return { [this._config.name]: this._config.value };
17
- }
18
17
  cleanUp() {
19
18
  // noop
20
19
  }
21
20
  }
22
21
 
23
22
  class BasicAuthProvider {
24
- constructor(_config) {
25
- this._config = _config;
26
- this.queryClient = null;
27
- }
28
23
  get header() {
29
24
  return { Authorization: `Basic ${this._basicAuthString}` };
30
25
  }
31
26
  get _basicAuthString() {
32
27
  return btoa(`${this._config.username}:${this._config.password}`);
33
28
  }
29
+ constructor(_config) {
30
+ this._config = _config;
31
+ this.queryClient = null;
32
+ }
34
33
  cleanUp() {
35
34
  // noop
36
35
  }
@@ -317,11 +316,15 @@ const decryptBearer = (token) => {
317
316
  };
318
317
 
319
318
  class BearerAuthProvider {
319
+ get header() {
320
+ return { Authorization: `Bearer ${this._token}` };
321
+ }
320
322
  constructor(_config) {
321
323
  var _a, _b;
322
324
  this._config = _config;
323
325
  this._refreshToken = null;
324
326
  this._refreshTimerSubscription = null;
327
+ this._failureCount = 0;
325
328
  this.queryClient = null;
326
329
  this.onRefreshInitiation$ = new Subject();
327
330
  this.onRefreshSuccess$ = new Subject();
@@ -332,16 +335,14 @@ class BearerAuthProvider {
332
335
  this._setupRefresh(this._config.refreshConfig);
333
336
  }
334
337
  }
335
- get header() {
336
- return { Authorization: `Bearer ${this._token}` };
337
- }
338
338
  cleanUp() {
339
339
  var _a;
340
340
  (_a = this._refreshTimerSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
341
341
  this._refreshTimerSubscription = null;
342
342
  }
343
343
  _setupRefresh(config) {
344
- var _a;
344
+ var _a, _b;
345
+ this.cleanUp();
345
346
  const bearer = decryptBearer(this._token);
346
347
  if (!bearer) {
347
348
  return;
@@ -349,11 +350,12 @@ class BearerAuthProvider {
349
350
  const expiresInPropertyName = config.expiresInPropertyName || 'exp';
350
351
  const expiresIn = bearer[expiresInPropertyName];
351
352
  const fiveMinutes = 5 * 60 * 1000;
353
+ const refreshBuffer = (_a = config.refreshBuffer) !== null && _a !== void 0 ? _a : fiveMinutes;
352
354
  if (expiresIn === undefined) {
353
355
  throw new Error(`Bearer token does not contain an '${expiresInPropertyName}' property`);
354
356
  }
355
- const remainingTime = new Date(expiresIn * 1000).getTime() - fiveMinutes - new Date().getTime();
356
- const strategy = (_a = config.strategy) !== null && _a !== void 0 ? _a : "beforeExpiration" /* AuthBearerRefreshStrategy.BeforeExpiration */;
357
+ const remainingTime = new Date(expiresIn * 1000).getTime() - refreshBuffer - new Date().getTime();
358
+ const strategy = (_b = config.strategy) !== null && _b !== void 0 ? _b : "beforeExpiration" /* AuthBearerRefreshStrategy.BeforeExpiration */;
357
359
  switch (strategy) {
358
360
  case "beforeExpiration" /* AuthBearerRefreshStrategy.BeforeExpiration */:
359
361
  this._refreshTimerSubscription = timer(remainingTime).subscribe(() => this._refresh(config));
@@ -361,6 +363,7 @@ class BearerAuthProvider {
361
363
  }
362
364
  }
363
365
  _refresh(config) {
366
+ var _a, _b;
364
367
  return __awaiter(this, void 0, void 0, function* () {
365
368
  if (!this._refreshToken) {
366
369
  throw new Error('No refresh token found');
@@ -368,13 +371,14 @@ class BearerAuthProvider {
368
371
  if (!this.queryClient) {
369
372
  throw new Error('Query client instance is null');
370
373
  }
371
- const { method, route, bodyAdapter, responseAdapter } = config;
374
+ const { method, route, requestAdapter, responseAdapter, paramLocation } = config;
375
+ const data = (_a = requestAdapter === null || requestAdapter === void 0 ? void 0 : requestAdapter(this._refreshToken)) !== null && _a !== void 0 ? _a : { refreshToken: this._refreshToken };
372
376
  const fullRoute = buildRoute({
373
377
  base: this.queryClient.config.baseRoute,
374
378
  route,
379
+ queryParams: paramLocation === 'query' ? data : undefined,
375
380
  });
376
- const body = bodyAdapter ? bodyAdapter(this._refreshToken) : { refreshToken: this._refreshToken };
377
- const requestInit = { body: buildBody(body), method };
381
+ const requestInit = { body: paramLocation === 'body' ? buildBody(data) : undefined, method };
378
382
  this.onRefreshInitiation$.next();
379
383
  try {
380
384
  const result = yield request({
@@ -391,6 +395,8 @@ class BearerAuthProvider {
391
395
  this._token = tokens.token;
392
396
  this._refreshToken = tokens.refreshToken;
393
397
  this.onRefreshSuccess$.next(tokens);
398
+ this._setupRefresh(config);
399
+ this._failureCount = 0;
394
400
  }
395
401
  catch (error) {
396
402
  if (error instanceof Error) {
@@ -399,6 +405,10 @@ class BearerAuthProvider {
399
405
  else {
400
406
  this.onRefreshFailure$.next(error);
401
407
  }
408
+ this._failureCount++;
409
+ if (this._failureCount <= ((_b = config.maxRefreshAttempts) !== null && _b !== void 0 ? _b : 3)) {
410
+ this._setupRefresh(config);
411
+ }
402
412
  }
403
413
  });
404
414
  }
@@ -427,31 +437,6 @@ const gql = (strings, ...values) => {
427
437
  return str;
428
438
  };
429
439
 
430
- const deepFreeze = (object) => {
431
- // check if object is actually an object or frozen
432
- if (!object || typeof object !== 'object' || Object.isFrozen(object)) {
433
- return object;
434
- }
435
- // Retrieve the property names defined on object
436
- const propNames = Object.getOwnPropertyNames(object);
437
- // Freeze properties before freezing self
438
- for (const name of propNames) {
439
- const value = object[name];
440
- if (value && typeof value === 'object') {
441
- deepFreeze(value);
442
- }
443
- }
444
- return Object.freeze(object);
445
- };
446
-
447
- /**
448
- * Dummy function for providing types while not breaking inference.
449
- * **This function always returns null.**
450
- * @see https://github.com/microsoft/TypeScript/issues/26242
451
- * @returns null
452
- */
453
- const def = () => null;
454
-
455
440
  function filterSuccess() {
456
441
  return function (source) {
457
442
  return source.pipe(filter((value) => isQueryStateSuccess(value)));
@@ -506,21 +491,8 @@ const isGqlQueryConfig = (config) => {
506
491
  };
507
492
 
508
493
  class Query {
509
- constructor(_client, _queryConfig, _route, _args) {
510
- this._client = _client;
511
- this._queryConfig = _queryConfig;
512
- this._route = _route;
513
- this._args = _args;
514
- this._currentId = 0;
515
- this._abortController = new AbortController();
516
- this._pollingSubscription = null;
517
- this._state$ = new BehaviorSubject({
518
- type: "PREPARED" /* QueryStateType.Prepared */,
519
- meta: { id: this._currentId },
520
- });
521
- }
522
494
  get _nextId() {
523
- return this._currentId++;
495
+ return ++this._currentId;
524
496
  }
525
497
  get state$() {
526
498
  return this._state$.asObservable();
@@ -538,6 +510,20 @@ class Query {
538
510
  }
539
511
  return ts < Date.now();
540
512
  }
513
+ constructor(_client, _queryConfig, _route, _args) {
514
+ this._client = _client;
515
+ this._queryConfig = _queryConfig;
516
+ this._route = _route;
517
+ this._args = _args;
518
+ this._currentId = 0;
519
+ this._abortController = new AbortController();
520
+ this._pollingSubscription = null;
521
+ this._onAbort$ = new Subject();
522
+ this._state$ = new BehaviorSubject({
523
+ type: "PREPARED" /* QueryStateType.Prepared */,
524
+ meta: { id: this._currentId },
525
+ });
526
+ }
541
527
  clone() {
542
528
  return this._client.fetch(this._queryConfig);
543
529
  }
@@ -553,11 +539,12 @@ class Query {
553
539
  if (isQueryStateLoading(this._state$.value)) {
554
540
  this.abort();
555
541
  }
556
- const meta = deepFreeze({ id });
542
+ const meta = { id };
557
543
  this._state$.next({
558
544
  type: "LOADING" /* QueryStateType.Loading */,
559
545
  meta,
560
546
  });
547
+ this._updateUseResultInDependencies();
561
548
  let body = null;
562
549
  let contentType = null;
563
550
  if (isGqlQueryConfig(this._queryConfig)) {
@@ -622,9 +609,9 @@ class Query {
622
609
  : responseData;
623
610
  this._state$.next({
624
611
  type: "SUCCESS" /* QueryStateType.Success */,
625
- response: deepFreeze(transformedResponse),
626
- rawResponse: deepFreeze(responseData),
627
- meta: deepFreeze(Object.assign(Object.assign({}, meta), { expiresAt: response.expiresInTimestamp })),
612
+ response: transformedResponse,
613
+ rawResponse: responseData,
614
+ meta: Object.assign(Object.assign({}, meta), { expiresAt: response.expiresInTimestamp }),
628
615
  });
629
616
  })
630
617
  .catch((error) => this._handleExecuteError(error, meta));
@@ -633,6 +620,7 @@ class Query {
633
620
  abort() {
634
621
  this._abortController.abort();
635
622
  this._abortController = new AbortController();
623
+ this._onAbort$.next();
636
624
  return this;
637
625
  }
638
626
  poll(config) {
@@ -650,6 +638,28 @@ class Query {
650
638
  this._pollingSubscription = null;
651
639
  return this;
652
640
  }
641
+ _updateUseResultInDependencies() {
642
+ var _a, _b;
643
+ if (!((_b = (_a = this._args) === null || _a === void 0 ? void 0 : _a.useResultIn) === null || _b === void 0 ? void 0 : _b.length)) {
644
+ return;
645
+ }
646
+ this.state$
647
+ .pipe(filterSuccess(), takeUntil(this._onAbort$), takeUntilResponse(), tap((state) => {
648
+ var _a;
649
+ if (!((_a = this._args) === null || _a === void 0 ? void 0 : _a.useResultIn)) {
650
+ return;
651
+ }
652
+ for (const query of this._args.useResultIn) {
653
+ query._state$.next({
654
+ type: "SUCCESS" /* QueryStateType.Success */,
655
+ meta: Object.assign(Object.assign({}, state.meta), { id: query._nextId }),
656
+ rawResponse: state.rawResponse,
657
+ response: state.response,
658
+ });
659
+ }
660
+ }))
661
+ .subscribe();
662
+ }
653
663
  _handleExecuteError(error, meta) {
654
664
  if (isAbortRequestError(error)) {
655
665
  this._state$.next({
@@ -671,6 +681,19 @@ class Query {
671
681
  }
672
682
 
673
683
  class QueryDirective {
684
+ get query() {
685
+ return this._query;
686
+ }
687
+ set query(v) {
688
+ this._query = v;
689
+ this._subscribeToQuery();
690
+ }
691
+ get cache() {
692
+ return this._cache;
693
+ }
694
+ set cache(v) {
695
+ this._cache = v;
696
+ }
674
697
  constructor(_mainTemplateRef, _viewContainerRef, _errorHandler, _cdr) {
675
698
  this._mainTemplateRef = _mainTemplateRef;
676
699
  this._viewContainerRef = _viewContainerRef;
@@ -687,19 +710,6 @@ class QueryDirective {
687
710
  };
688
711
  this._cache = false;
689
712
  }
690
- get query() {
691
- return this._query;
692
- }
693
- set query(v) {
694
- this._query = v;
695
- this._subscribeToQuery();
696
- }
697
- get cache() {
698
- return this._cache;
699
- }
700
- set cache(v) {
701
- this._cache = v;
702
- }
703
713
  static ngTemplateContextGuard(dir, ctx) {
704
714
  return true;
705
715
  }
@@ -753,9 +763,9 @@ class QueryDirective {
753
763
  }
754
764
  }
755
765
  }
756
- QueryDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: QueryDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: i0.ErrorHandler }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
757
- QueryDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.2", type: QueryDirective, isStandalone: true, selector: "[query]", inputs: { query: "query", cache: ["queryCache", "cache"] }, ngImport: i0 });
758
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: QueryDirective, decorators: [{
766
+ QueryDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: QueryDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: i0.ErrorHandler }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
767
+ QueryDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.0", type: QueryDirective, isStandalone: true, selector: "[query]", inputs: { query: "query", cache: ["queryCache", "cache"] }, ngImport: i0 });
768
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: QueryDirective, decorators: [{
759
769
  type: Directive,
760
770
  args: [{
761
771
  // eslint-disable-next-line @angular-eslint/directive-selector
@@ -771,17 +781,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.2", ngImpor
771
781
 
772
782
  /* eslint-disable @typescript-eslint/no-explicit-any */
773
783
  class InfinityQuery {
774
- constructor(_config) {
775
- var _a, _b;
776
- this._config = _config;
777
- this._currentPage$ = new BehaviorSubject(null);
778
- this._currentCalculatedPage$ = new BehaviorSubject(null);
779
- this._totalPages$ = new BehaviorSubject(null);
780
- this._itemsPerPage$ = new BehaviorSubject((_b = (_a = this._config.limitParam) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : 10);
781
- this._currentQuery$ = new BehaviorSubject(null);
782
- this._data$ = new BehaviorSubject([]);
783
- this._subscriptions = [];
784
- }
785
784
  get currentPage$() {
786
785
  return this._currentPage$.asObservable();
787
786
  }
@@ -818,6 +817,17 @@ class InfinityQuery {
818
817
  get data() {
819
818
  return this._data$.getValue();
820
819
  }
820
+ constructor(_config) {
821
+ var _a, _b;
822
+ this._config = _config;
823
+ this._currentPage$ = new BehaviorSubject(null);
824
+ this._currentCalculatedPage$ = new BehaviorSubject(null);
825
+ this._totalPages$ = new BehaviorSubject(null);
826
+ this._itemsPerPage$ = new BehaviorSubject((_b = (_a = this._config.limitParam) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : 10);
827
+ this._currentQuery$ = new BehaviorSubject(null);
828
+ this._data$ = new BehaviorSubject([]);
829
+ this._subscriptions = [];
830
+ }
821
831
  nextPage() {
822
832
  var _a, _b, _c, _d, _e;
823
833
  const newPage = ((_a = this._currentPage$.value) !== null && _a !== void 0 ? _a : 0) + 1;
@@ -934,7 +944,7 @@ class InfinityQueryDirective {
934
944
  itemsPerPage: null,
935
945
  };
936
946
  this._infinityQueryInstance = null;
937
- this._destroy$ = inject(DestroyDirective).destroy$;
947
+ this._destroy$ = inject(DestroyService).destroy$;
938
948
  this._cdr = inject(ChangeDetectorRef);
939
949
  this._viewContainerRef = inject(ViewContainerRef);
940
950
  this._mainTemplateRef = inject((TemplateRef));
@@ -1051,17 +1061,16 @@ class InfinityQueryDirective {
1051
1061
  this._data$.next([]);
1052
1062
  }
1053
1063
  }
1054
- InfinityQueryDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: InfinityQueryDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1055
- InfinityQueryDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.2", type: InfinityQueryDirective, isStandalone: true, selector: "[infinityQuery]", inputs: { infinityQuery: "infinityQuery" }, providers: [{ provide: INFINITY_QUERY_TOKEN, useExisting: InfinityQueryDirective }], exportAs: ["infinityQuery"], hostDirectives: [{ directive: i1.DestroyDirective }], ngImport: i0 });
1056
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: InfinityQueryDirective, decorators: [{
1064
+ InfinityQueryDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: InfinityQueryDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1065
+ InfinityQueryDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.0", type: InfinityQueryDirective, isStandalone: true, selector: "[infinityQuery]", inputs: { infinityQuery: "infinityQuery" }, providers: [{ provide: INFINITY_QUERY_TOKEN, useExisting: InfinityQueryDirective }, DestroyService], exportAs: ["infinityQuery"], ngImport: i0 });
1066
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: InfinityQueryDirective, decorators: [{
1057
1067
  type: Directive,
1058
1068
  args: [{
1059
1069
  // eslint-disable-next-line @angular-eslint/directive-selector
1060
1070
  selector: '[infinityQuery]',
1061
1071
  exportAs: 'infinityQuery',
1062
1072
  standalone: true,
1063
- providers: [{ provide: INFINITY_QUERY_TOKEN, useExisting: InfinityQueryDirective }],
1064
- hostDirectives: [DestroyDirective],
1073
+ providers: [{ provide: INFINITY_QUERY_TOKEN, useExisting: InfinityQueryDirective }, DestroyService],
1065
1074
  }]
1066
1075
  }], propDecorators: { infinityQuery: [{
1067
1076
  type: Input
@@ -1105,9 +1114,9 @@ class InfinityQueryTriggerDirective {
1105
1114
  this._observer.observe(this._elementRef.nativeElement);
1106
1115
  }
1107
1116
  }
1108
- InfinityQueryTriggerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: InfinityQueryTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1109
- InfinityQueryTriggerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.2", type: InfinityQueryTriggerDirective, isStandalone: true, selector: "[infinityQueryTrigger], infinity-query-trigger", inputs: { scrollContainerSelector: "scrollContainerSelector" }, ngImport: i0 });
1110
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: InfinityQueryTriggerDirective, decorators: [{
1117
+ InfinityQueryTriggerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: InfinityQueryTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1118
+ InfinityQueryTriggerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.0", type: InfinityQueryTriggerDirective, isStandalone: true, selector: "[infinityQueryTrigger], infinity-query-trigger", inputs: { scrollContainerSelector: "scrollContainerSelector" }, ngImport: i0 });
1119
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: InfinityQueryTriggerDirective, decorators: [{
1111
1120
  type: Directive,
1112
1121
  args: [{
1113
1122
  // eslint-disable-next-line @angular-eslint/directive-selector
@@ -1202,6 +1211,12 @@ config, args) => {
1202
1211
  };
1203
1212
 
1204
1213
  class QueryClient {
1214
+ get config() {
1215
+ return this._clientConfig;
1216
+ }
1217
+ get authProvider() {
1218
+ return this._authProvider;
1219
+ }
1205
1220
  constructor(_clientConfig) {
1206
1221
  var _a, _b;
1207
1222
  this._clientConfig = _clientConfig;
@@ -1257,23 +1272,17 @@ class QueryClient {
1257
1272
  enableGarbageCollectorLogging: (_b = _clientConfig.logging) === null || _b === void 0 ? void 0 : _b.queryStateGarbageCollector,
1258
1273
  });
1259
1274
  }
1260
- get config() {
1261
- return this._clientConfig;
1262
- }
1263
- get authProvider() {
1264
- return this._authProvider;
1265
- }
1266
1275
  }
1267
1276
 
1268
1277
  class QueryField {
1278
+ get control() {
1279
+ return this.data.control;
1280
+ }
1269
1281
  constructor(data) {
1270
1282
  this.data = data;
1271
1283
  this.changes$ = this._setupChangesObservable();
1272
1284
  this._currentDebounceTimeout = null;
1273
1285
  }
1274
- get control() {
1275
- return this.data.control;
1276
- }
1277
1286
  setValue(value) {
1278
1287
  if (this._currentDebounceTimeout !== null) {
1279
1288
  clearTimeout(this._currentDebounceTimeout);
@@ -1482,6 +1491,31 @@ const transformToSortQueryParam = (value) => {
1482
1491
  return null;
1483
1492
  };
1484
1493
 
1494
+ const deepFreeze = (object) => {
1495
+ // check if object is actually an object or frozen
1496
+ if (!object || typeof object !== 'object' || Object.isFrozen(object)) {
1497
+ return object;
1498
+ }
1499
+ // Retrieve the property names defined on object
1500
+ const propNames = Object.getOwnPropertyNames(object);
1501
+ // Freeze properties before freezing self
1502
+ for (const name of propNames) {
1503
+ const value = object[name];
1504
+ if (value && typeof value === 'object') {
1505
+ deepFreeze(value);
1506
+ }
1507
+ }
1508
+ return Object.freeze(object);
1509
+ };
1510
+
1511
+ /**
1512
+ * Dummy function for providing types while not breaking inference.
1513
+ * **This function always returns null.**
1514
+ * @see https://github.com/microsoft/TypeScript/issues/26242
1515
+ * @returns null
1516
+ */
1517
+ const def = () => null;
1518
+
1485
1519
  /**
1486
1520
  * Generated bundle index. Do not edit.
1487
1521
  */