@ethlete/query 5.32.1 → 5.32.3
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/CHANGELOG.md +12 -0
- package/fesm2022/ethlete-query.mjs +118 -84
- package/fesm2022/ethlete-query.mjs.map +1 -1
- package/lib/experimental/auth/bearer-auth-provider.d.ts +0 -2
- package/lib/experimental/http/query-dependencies.d.ts +3 -1
- package/lib/experimental/http/query-utils.d.ts +5 -3
- package/lib/experimental/http/secure-query-execute.d.ts +1 -1
- package/package.json +5 -5
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i1 from '@ethlete/core';
|
|
2
|
-
import { createDestroy, computedTillTruthy, syncSignal, getCookie, setCookie, deleteCookie, DelayableDirective, nextFrame, RuntimeError, isObject, injectRoute, getDomain, previousSignalValue, injectQueryParamChanges, injectQueryParams, clone, equal, ET_PROPERTY_REMOVED } from '@ethlete/core';
|
|
2
|
+
import { createDestroy, computedTillTruthy, syncSignal, getCookie, setCookie, deleteCookie, DelayableDirective, nextFrame, RuntimeError, isObject, injectRoute, getDomain, clamp, previousSignalValue, injectQueryParamChanges, injectQueryParams, clone, equal, ET_PROPERTY_REMOVED } from '@ethlete/core';
|
|
3
3
|
import { Observable, takeUntil, startWith, pairwise, tap, switchMap, of, BehaviorSubject, Subject, fromEvent, timer, take, filter, takeWhile, map, shareReplay, ReplaySubject, combineLatest, interval, skip, withLatestFrom, debounceTime, Subscription, retry, throwError, catchError, merge } from 'rxjs';
|
|
4
4
|
import { HttpStatusCode, HttpErrorResponse, HttpEventType, HttpClient, HttpHeaders } from '@angular/common/http';
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
6
|
-
import { assertInInjectionContext, inject, Injector, computed, signal, isDevMode, untracked, TemplateRef, ViewContainerRef, ErrorHandler, ChangeDetectorRef, Directive, Input, InjectionToken, ElementRef, Pipe, effect, Component, ChangeDetectionStrategy, ViewEncapsulation, runInInjectionContext, EnvironmentInjector, createEnvironmentInjector, DestroyRef, NgZone } from '@angular/core';
|
|
6
|
+
import { assertInInjectionContext, inject, Injector, computed, signal, isDevMode, untracked, TemplateRef, ViewContainerRef, ErrorHandler, ChangeDetectorRef, Directive, Input, InjectionToken, ElementRef, Pipe, effect, Component, ChangeDetectionStrategy, ViewEncapsulation, runInInjectionContext, EnvironmentInjector, createEnvironmentInjector, DestroyRef, ɵEffectScheduler as _EffectScheduler, NgZone } from '@angular/core';
|
|
7
7
|
import { toSignal, toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
8
8
|
import { AsyncPipe, JsonPipe, NgClass } from '@angular/common';
|
|
9
9
|
import * as i1$1 from '@angular/forms';
|
|
@@ -1986,10 +1986,10 @@ class QueryDirective {
|
|
|
1986
1986
|
this._viewContainerRef.createEmbeddedView(this._mainTemplateRef, this._viewContext);
|
|
1987
1987
|
}
|
|
1988
1988
|
}
|
|
1989
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
1990
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
1989
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: QueryDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1990
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.1", type: QueryDirective, isStandalone: true, selector: "[etQuery]", inputs: { query: ["etQuery", "query"], cache: ["etQueryCache", "cache"] }, ngImport: i0 }); }
|
|
1991
1991
|
}
|
|
1992
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
1992
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: QueryDirective, decorators: [{
|
|
1993
1993
|
type: Directive,
|
|
1994
1994
|
args: [{
|
|
1995
1995
|
selector: '[etQuery]',
|
|
@@ -2297,10 +2297,10 @@ class InfinityQueryDirective {
|
|
|
2297
2297
|
this._viewContext.currentQuery = null;
|
|
2298
2298
|
this._data$.next([]);
|
|
2299
2299
|
}
|
|
2300
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
2301
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
2300
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: InfinityQueryDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2301
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.1", type: InfinityQueryDirective, isStandalone: true, selector: "[etInfinityQuery]", inputs: { infinityQuery: ["etInfinityQuery", "infinityQuery"] }, providers: [{ provide: INFINITY_QUERY_TOKEN, useExisting: InfinityQueryDirective }], exportAs: ["etInfinityQuery"], hostDirectives: [{ directive: i1.DelayableDirective }], ngImport: i0 }); }
|
|
2302
2302
|
}
|
|
2303
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
2303
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: InfinityQueryDirective, decorators: [{
|
|
2304
2304
|
type: Directive,
|
|
2305
2305
|
args: [{
|
|
2306
2306
|
selector: '[etInfinityQuery]',
|
|
@@ -2352,10 +2352,10 @@ class InfinityQueryTriggerDirective {
|
|
|
2352
2352
|
});
|
|
2353
2353
|
this._observer.observe(this._elementRef.nativeElement);
|
|
2354
2354
|
}
|
|
2355
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
2356
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
2355
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: InfinityQueryTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2356
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.1", type: InfinityQueryTriggerDirective, isStandalone: true, selector: "[etInfinityQueryTrigger], et-infinity-query-trigger", inputs: { scrollContainerSelector: "scrollContainerSelector" }, ngImport: i0 }); }
|
|
2357
2357
|
}
|
|
2358
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
2358
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: InfinityQueryTriggerDirective, decorators: [{
|
|
2359
2359
|
type: Directive,
|
|
2360
2360
|
args: [{
|
|
2361
2361
|
selector: '[etInfinityQueryTrigger], et-infinity-query-trigger',
|
|
@@ -2379,10 +2379,10 @@ class QueryShortNamePipe {
|
|
|
2379
2379
|
}
|
|
2380
2380
|
return route;
|
|
2381
2381
|
}
|
|
2382
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
2383
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.
|
|
2382
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: QueryShortNamePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
2383
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.1", ngImport: i0, type: QueryShortNamePipe, isStandalone: true, name: "queryShortName" }); }
|
|
2384
2384
|
}
|
|
2385
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
2385
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: QueryShortNamePipe, decorators: [{
|
|
2386
2386
|
type: Pipe,
|
|
2387
2387
|
args: [{ name: 'queryShortName', standalone: true }]
|
|
2388
2388
|
}] });
|
|
@@ -2673,10 +2673,10 @@ class QueryDevtoolsComponent {
|
|
|
2673
2673
|
clearQueryHistory() {
|
|
2674
2674
|
this.queryHistory$.next([]);
|
|
2675
2675
|
}
|
|
2676
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
2677
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.0", type: QueryDevtoolsComponent, isStandalone: true, selector: "et-query-devtools", host: { classAttribute: "et-query-devtools" }, ngImport: i0, template: "@if (!isOpen()) {\n <button (click)=\"toggleOpen()\" class=\"et-query-devtools-open-btn et-qd-chip\">Query Devtools</button>\n}\n\n@if (isOpen()) {\n <div\n [class.et-query-devtools-container--transparent]=\"isTranslucent()\"\n class=\"et-query-devtools-container et-query-devtools-container--snap-{{ snapLayout() }}\"\n >\n <header class=\"et-qd-header\">\n <h3 class=\"et-qd-header__title\">Query Devtools</h3>\n\n <div class=\"et-qd-header__select\">\n <label for=\"et-query-client-instance\">Client instance</label>\n <select [formControl]=\"selectedClientIdCtrl\" id=\"et-query-client-instance\">\n @for (clientConfig of queryClientConfigs; track trackByClient(i, clientConfig); let i = $index) {\n <option [value]=\"i\">\n {{ clientConfig.displayName ?? clientConfig.client.config.baseRoute }}\n </option>\n }\n </select>\n </div>\n\n <button (click)=\"toggleOpen()\" class=\"et-qd-btn et-qd-btn-secondary\">Close</button>\n </header>\n\n <div class=\"et-qd-sub-header\">\n <button\n [ngClass]=\"{ 'et-qd-chip-secondary': !isTranslucent() }\"\n (click)=\"toggleTranslucent()\"\n class=\"et-qd-chip et-qd-translucent-clickable\"\n >\n Translucent\n </button>\n <div class=\"et-qd-sub-header__divider\"></div>\n <button\n [ngClass]=\"{ 'et-qd-chip-secondary': snapLayout() !== 'full' }\"\n (click)=\"selectSnapLayout('full')\"\n class=\"et-qd-chip\"\n >\n Fullscreen\n </button>\n <button\n [ngClass]=\"{ 'et-qd-chip-secondary': snapLayout() !== 'top' }\"\n (click)=\"selectSnapLayout('top')\"\n class=\"et-qd-chip\"\n >\n Top\n </button>\n <button\n [ngClass]=\"{ 'et-qd-chip-secondary': snapLayout() !== 'bottom' }\"\n (click)=\"selectSnapLayout('bottom')\"\n class=\"et-qd-chip\"\n >\n Bottom\n </button>\n <button\n [ngClass]=\"{ 'et-qd-chip-secondary': snapLayout() !== 'left' }\"\n (click)=\"selectSnapLayout('left')\"\n class=\"et-qd-chip\"\n >\n Left\n </button>\n <button\n [ngClass]=\"{ 'et-qd-chip-secondary': snapLayout() !== 'right' }\"\n (click)=\"selectSnapLayout('right')\"\n class=\"et-qd-chip\"\n >\n Right\n </button>\n </div>\n\n @if (selectedClientConfig(); as cfg) {\n <div class=\"et-qd-client\">\n <p class=\"et-qd-client__title\">{{ cfg.displayName ?? cfg.client.config.baseRoute }}</p>\n\n <div class=\"et-qd-client__actions\">\n <button (click)=\"cfg.client._store.refreshQueriesInUse()\" class=\"et-qd-chip\">Refresh all</button>\n <button (click)=\"cfg.client._store.refreshQueriesInUse({ ignoreCacheValidity: true })\" class=\"et-qd-chip\">\n Refresh all (ignore caches)\n </button>\n <button\n (click)=\"cfg.client._store.refreshQueriesInUse({ ignoreCacheValidity: true, purgeUnused: true })\"\n class=\"et-qd-chip\"\n >\n Refresh all (ignore caches & purge unused)\n </button>\n </div>\n </div>\n }\n\n @if (selectedClientConfig(); as cfg) {\n <div class=\"et-qd-queries\">\n <p class=\"et-qd-queries__title\">Inspector</p>\n <div class=\"et-qd-queries__actions\">\n <button\n [ngClass]=\"{ 'et-qd-chip-secondary': queryListMode() !== 'live' || viewMode() !== 'query' }\"\n (click)=\"selectQueryListMode('live'); selectViewMode('query')\"\n class=\"et-qd-chip et-qd-chip-bordered\"\n >\n Live Queries ({{ queries()?.length ?? 0 }})\n </button>\n <button\n [ngClass]=\"{ 'et-qd-chip-secondary': queryListMode() !== 'history' || viewMode() !== 'query' }\"\n (click)=\"selectQueryListMode('history'); selectViewMode('query')\"\n class=\"et-qd-chip et-qd-chip-bordered\"\n >\n Query History ({{ (queryHistory$ | async)?.length ?? 0 }}/50)\n </button>\n @if (queryListMode() === 'history' && viewMode() === 'query') {\n <div class=\"et-qd-queries__divider\"></div>\n <button (click)=\"clearQueryHistory()\" class=\"et-qd-chip et-qd-chip-bordered\">Clear history</button>\n }\n\n <div class=\"et-qd-queries__divider\"></div>\n <button\n [ngClass]=\"{ 'et-qd-chip-secondary': viewMode() !== 'authProvider' }\"\n (click)=\"selectViewMode('authProvider')\"\n class=\"et-qd-chip et-qd-chip-bordered\"\n >\n Auth Provider\n </button>\n </div>\n\n @if (viewMode() === 'query') {\n <div class=\"et-qd-queries__browser\">\n @if (queryListMode() === 'live') {\n <ul class=\"et-qd-queries__browser-list\">\n @for (query of queries(); track trackByQuery($index, query)) {\n <li>\n <button\n [class.et-qd-query--active]=\"selectedQuery()?._id === query._id\"\n (click)=\"selectQuery(query)\"\n >\n <span> {{ query._queryConfig.method }}</span>\n <span> {{ query | queryShortName }}</span>\n </button>\n </li>\n }\n </ul>\n }\n @if (queryListMode() === 'history') {\n <ul class=\"et-qd-queries__browser-list\">\n @for (query of queryHistory$ | async; track trackByQuery($index, query)) {\n <li>\n <button\n [class.et-qd-query--active]=\"selectedQuery()?._id === query._id\"\n (click)=\"selectQuery(query)\"\n >\n <span> {{ query._queryConfig.method }}</span>\n <span> {{ query | queryShortName }}</span>\n </button>\n </li>\n }\n </ul>\n }\n <div class=\"et-qd-queries__browser-detail\">\n @if (selectedQuery(); as query) {\n <p class=\"et-qd-queries__browser-detail__title\">\n {{ query._queryConfig.method }} {{ query._routeWithParams }}\n </p>\n\n <div class=\"et-qd-queries__actions\">\n <button (click)=\"query.execute()\" class=\"et-qd-chip et-qd-chip-bordered\">Execute</button>\n <button (click)=\"query.execute({ skipCache: true })\" class=\"et-qd-chip et-qd-chip-bordered\">\n Execute (ignore cache)\n </button>\n\n <button (click)=\"query.abort()\" class=\"et-qd-chip et-qd-chip-bordered\">Abort</button>\n <div class=\"et-qd-queries__divider\"></div>\n <button\n [ngClass]=\"{ 'et-qd-chip-secondary': !query.isPolling }\"\n (click)=\"query.poll({ interval: 5000, takeUntil: _destroy$ })\"\n class=\"et-qd-chip et-qd-chip-bordered\"\n >\n Poll\n </button>\n\n <button\n [ngClass]=\"{ 'et-qd-chip-secondary': query.isPolling }\"\n (click)=\"query.stopPolling()\"\n class=\"et-qd-chip et-qd-chip-bordered\"\n >\n Stop polling\n </button>\n @if (query.isPolling || query._isPollingPaused) {\n <button (click)=\"query.pausePolling()\" class=\"et-qd-chip et-qd-chip-secondary et-qd-chip-bordered\">\n Pause polling\n </button>\n <button (click)=\"query.resumePolling()\" class=\"et-qd-chip et-qd-chip-secondary et-qd-chip-bordered\">\n Resume polling\n </button>\n }\n </div>\n\n <div class=\"et-qd-list\">\n <div class=\"et-qd-list-item\">\n <p>State type</p>\n <pre>{{ query.rawState.type }}</pre>\n </div>\n\n <div class=\"et-qd-list-item\">\n <p>Dependents</p>\n <pre>{{ query._dependents | json }}</pre>\n </div>\n\n <div class=\"et-qd-list-item\">\n <p>Is expired</p>\n <pre>{{ query.isExpired }}</pre>\n </div>\n\n <div class=\"et-qd-list-item\">\n <p>Is in use</p>\n <pre>{{ query.isInUse }}</pre>\n </div>\n\n <div class=\"et-qd-list-item\">\n <p>Subscriber count</p>\n <pre>{{ query._subscriberCount }}</pre>\n </div>\n\n <div class=\"et-qd-list-item\">\n <p>Is polling</p>\n <pre>{{ query.isPolling }}</pre>\n </div>\n\n <div class=\"et-qd-list-item\">\n <p>Is polling paused</p>\n <pre>{{ query._isPollingPaused }}</pre>\n </div>\n\n <div class=\"et-qd-list-item\">\n <p>Enable smart polling</p>\n <pre>{{ query._enableSmartPolling }}</pre>\n </div>\n\n <div class=\"et-qd-list-item\">\n <p>Query store key</p>\n <pre>{{ query._queryStoreKey }}</pre>\n </div>\n\n <div class=\"et-qd-list-item\">\n <p>Arguments</p>\n\n <div>\n <button\n [ngClass]=\"{ 'et-qd-chip-secondary': !showArguments() }\"\n (click)=\"toggleShowArguments()\"\n class=\"et-qd-chip et-qd-chip-bordered\"\n >\n Toggle\n </button>\n </div>\n @if (showArguments()) {\n <pre>{{ query._arguments | json }}</pre>\n }\n </div>\n\n <div class=\"et-qd-list-item\">\n <p>State</p>\n <p><i> Warning, this will cause a subscription if shown!</i></p>\n <div>\n <button\n [ngClass]=\"{ 'et-qd-chip-secondary': !showResponse() }\"\n (click)=\"toggleShowResponse()\"\n class=\"et-qd-chip et-qd-chip-bordered\"\n >\n Toggle\n </button>\n </div>\n @if (showResponse()) {\n <pre>{{ query.state$ | async | json }}</pre>\n }\n </div>\n\n <div class=\"et-qd-list-item\">\n <p>Raw state</p>\n <p><i> The query state unaffected by entity stores</i></p>\n\n <div>\n <button\n [ngClass]=\"{ 'et-qd-chip-secondary': !showRawResponse() }\"\n (click)=\"toggleShowRawResponse()\"\n class=\"et-qd-chip et-qd-chip-bordered\"\n >\n Toggle\n </button>\n </div>\n @if (showRawResponse()) {\n <pre>{{ query.rawState | json }}</pre>\n }\n </div>\n\n <div class=\"et-qd-list-item\">\n <p>Query config</p>\n\n <div>\n <button\n [ngClass]=\"{ 'et-qd-chip-secondary': !showQueryConfig() }\"\n (click)=\"toggleShowQueryConfig()\"\n class=\"et-qd-chip et-qd-chip-bordered\"\n >\n Toggle\n </button>\n </div>\n @if (showQueryConfig()) {\n <pre>{{ stringifiedQueryConfig() | json }}</pre>\n }\n </div>\n\n @if (!!query._queryConfig.entity) {\n <div class=\"et-qd-list-item\">\n <p>Entity store value</p>\n\n <div>\n <button\n [ngClass]=\"{ 'et-qd-chip-secondary': !showEntityStoreValue() }\"\n (click)=\"toggleShowEntityStoreValue()\"\n class=\"et-qd-chip et-qd-chip-bordered\"\n >\n Toggle\n </button>\n </div>\n @if (showEntityStoreValue()) {\n <pre>{{ selectedQueryEntityStoreValue$ | async | json }}</pre>\n }\n </div>\n }\n </div>\n }\n </div>\n </div>\n } @else if (viewMode() === 'authProvider') {\n <div class=\"et-qd-auth-provider__viewer\">\n @if (authProviderDetails(); as details) {\n <div class=\"et-qd-list\">\n <div class=\"et-qd-list-item\">\n <p>Type</p>\n <pre>{{ details.type }}</pre>\n </div>\n <div class=\"et-qd-list-item\">\n <p>Header value</p>\n <pre>{{ details.header() | json }}</pre>\n </div>\n <div class=\"et-qd-list-item\">\n <p>Config</p>\n <pre>{{ details.config | json }}</pre>\n </div>\n\n @if (details.type === 'BearerAuthProvider') {\n <div class=\"et-qd-list-item\">\n <p>Tokens</p>\n <pre>{{ details.provider.tokens$ | async | json }}</pre>\n </div>\n\n <div class=\"et-qd-list-item\">\n <p>Should refresh on unauthorized response</p>\n <pre>{{ details.provider.shouldRefreshOnUnauthorizedResponse }}</pre>\n </div>\n\n <ng-container\n *etQuery=\"\n details.provider.currentRefreshQuery$ | async as response;\n loading as loading;\n error as error;\n query as query\n \"\n >\n <div class=\"et-qd-list-item\">\n <p>Refresh query response</p>\n\n <div>\n <button (click)=\"details.provider._refreshQuery()\" class=\"et-qd-chip et-qd-chip-bordered\">\n Refresh\n </button>\n </div>\n <pre>{{ response | json }}</pre>\n </div>\n <div class=\"et-qd-list-item\">\n <p>Refresh query loading</p>\n <pre>{{ loading }}</pre>\n </div>\n <div class=\"et-qd-list-item\">\n <p>Refresh query error</p>\n <pre>{{ error ?? 'null' }}</pre>\n </div>\n <div class=\"et-qd-list-item\">\n <p>State</p>\n <pre>{{ query?.state$ | async | json }}</pre>\n </div>\n </ng-container>\n }\n </div>\n } @else {\n <p>No auth provider set</p>\n }\n </div>\n }\n </div>\n }\n </div>\n}\n", styles: [":host{position:fixed;top:0;z-index:1000000;font-size:14px;color:#fff}.et-query-devtools-container{position:fixed;inset:0;background-color:#25292e;z-index:10000;overflow:auto;font-family:monospace;display:grid;grid-template-rows:auto auto auto minmax(0,1fr)}.et-query-devtools-container.et-query-devtools-container--transparent{opacity:.25;pointer-events:none}.et-query-devtools-container.et-query-devtools-container--transparent .et-query-devtools-translucent-btn{pointer-events:all}.et-query-devtools-container.et-query-devtools-container--snap-left{inset-inline-start:0;inset-block-start:0;inset-block-end:0;width:50%;border-right:1px solid rgb(37,41,46)}.et-query-devtools-container.et-query-devtools-container--snap-right{inset-inline-start:unset;inset-inline-end:0;inset-block-start:0;inset-block-end:0;width:50%;border-left:1px solid rgb(37,41,46)}.et-query-devtools-container.et-query-devtools-container--snap-top{inset-inline-start:0;inset-block-start:0;inset-inline-end:0;height:50%;border-bottom:1px solid rgb(37,41,46)}.et-query-devtools-container.et-query-devtools-container--snap-bottom{inset-inline-start:0;inset-block-start:unset;inset-block-end:0;inset-inline-end:0;height:50%;border-top:1px solid rgb(37,41,46)}button.et-query-devtools-open-btn{position:fixed;inset-inline-end:20px;inset-block-end:0;z-index:9999;font-family:monospace;border-radius:3px 3px 0 0;line-height:14px;font-size:12px}.et-qd-header{background-color:#00ffa1;padding:12px;display:grid;grid-template-columns:1fr auto auto;gap:12px;align-items:center}.et-qd-header__title{color:#25292e;margin:0;font-size:22px}.et-qd-header__select{display:grid;background-color:#25292e;border-radius:10px;overflow:hidden}.et-qd-header__select select{width:250px;color:#fff;padding:3px 10px 2px;border:none;background-color:#25292e;font-family:monospace}.et-qd-header__select label{padding:3px 10px;color:#25292e;font-size:12px;font-weight:700;color:#fff;border-bottom:1px solid gray}.et-qd-sub-header{background-color:#00b371;padding:12px;display:flex;gap:12px;flex-wrap:wrap}.et-qd-sub-header__divider{width:1px;background-color:#25292e}.et-qd-btn{background-color:#00ffa1;color:#25292e;border:none;padding:12px;cursor:pointer;font-size:14px;font-weight:700;text-align:center;text-decoration:none;display:inline-block;width:100%;transition:all .3s ease-in-out;font-family:monospace;border-radius:10px}.et-qd-btn:hover{background-color:#00cc81}.et-qd-btn.et-qd-btn-secondary{background-color:#25292e;color:#00ffa1}.et-qd-btn.et-qd-btn-secondary:hover{background-color:#3c424a}.et-qd-chip{background-color:#00ffa1;color:#25292e;border:none;padding:4px 9px;cursor:pointer;font-size:12px;font-weight:700;text-align:center;text-decoration:none;display:inline-block;transition:all .3s ease-in-out;font-family:monospace;border-radius:10px}.et-qd-chip:hover{background-color:#00cc81}.et-qd-chip.et-qd-chip-secondary{background-color:#25292e;color:#00ffa1}.et-qd-chip.et-qd-chip-secondary:hover{background-color:#3c424a}.et-qd-chip.et-qd-chip-bordered{border:1px solid rgb(0,255,161)}.et-qd-translucent-clickable{pointer-events:all}.et-qd-client{border-bottom:1px solid rgb(59.734939759,66.1927710843,74.265060241);padding:12px}.et-qd-client__title{margin:0;font-size:14px;color:#fff;font-weight:700}.et-qd-client__actions{display:flex;gap:12px;margin-top:12px}.et-qd-queries{padding:12px;display:grid;grid-template-rows:auto auto minmax(0,1fr)}.et-qd-queries__actions{display:flex;gap:12px;margin-top:12px;margin-bottom:16px}.et-qd-queries__title{margin:0;font-size:14px;color:#fff;font-weight:700}.et-qd-queries__divider{width:1px;background-color:#3c424a}.et-qd-queries__browser{display:grid;grid-template-columns:1fr minmax(0,3fr);margin-left:-12px;margin-right:-12px;border-top:1px solid rgb(59.734939759,66.1927710843,74.265060241);margin-bottom:-12px}.et-qd-queries__browser-list{border-right:1px solid rgb(59.734939759,66.1927710843,74.265060241);list-style:none;padding:0;margin:0;display:grid;grid-auto-flow:row;grid-auto-rows:55px;overflow-y:auto;overflow-x:hidden}.et-qd-queries__browser-list li{margin:0}.et-qd-queries__browser-list li button{all:unset;font-family:monospace;box-sizing:border-box;width:100%;border:none;border-bottom:1px solid rgb(59.734939759,66.1927710843,74.265060241);background-color:#25292e;color:#fff;text-align:left;padding:12px;height:100%;transition:all .3s ease-in-out;cursor:pointer;display:grid;grid-template-columns:auto minmax(0,1fr);gap:2px;display:block}.et-qd-queries__browser-list li button span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.et-qd-queries__browser-list li button span:first-of-type{font-weight:700}.et-qd-queries__browser-list li button:hover,.et-qd-queries__browser-list li button.et-qd-query--active{background-color:#30363c}.et-qd-queries__browser-detail{padding:12px;overflow-y:auto;overflow-x:hidden}.et-qd-queries__browser-detail__title{margin:0;font-size:14px;color:#fff;font-weight:700}.et-qd-auth-provider__viewer{border-top:1px solid rgb(59.734939759,66.1927710843,74.265060241);margin-left:-12px;margin-right:-12px;margin-bottom:-12px;padding:12px;overflow-y:auto;overflow-x:hidden}.et-qd-list{display:grid;gap:12px}.et-qd-list-item{display:grid}.et-qd-list-item p{font-weight:700;margin:0;padding-bottom:8px}.et-qd-list-item p+p{margin-top:-8px}.et-qd-list-item div+pre{margin-top:8px}.et-qd-list-item pre{margin:0;padding:4px;background-color:#0e1012;border-radius:4px;max-height:450px;overflow:auto}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: JsonPipe, name: "json" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: QueryShortNamePipe, name: "queryShortName" }, { kind: "directive", type: QueryDirective, selector: "[etQuery]", inputs: ["etQuery", "etQueryCache"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.ShadowDom }); }
|
|
2676
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: QueryDevtoolsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2677
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: QueryDevtoolsComponent, isStandalone: true, selector: "et-query-devtools", host: { classAttribute: "et-query-devtools" }, ngImport: i0, template: "@if (!isOpen()) {\n <button (click)=\"toggleOpen()\" class=\"et-query-devtools-open-btn et-qd-chip\">Query Devtools</button>\n}\n\n@if (isOpen()) {\n <div\n [class.et-query-devtools-container--transparent]=\"isTranslucent()\"\n class=\"et-query-devtools-container et-query-devtools-container--snap-{{ snapLayout() }}\"\n >\n <header class=\"et-qd-header\">\n <h3 class=\"et-qd-header__title\">Query Devtools</h3>\n\n <div class=\"et-qd-header__select\">\n <label for=\"et-query-client-instance\">Client instance</label>\n <select [formControl]=\"selectedClientIdCtrl\" id=\"et-query-client-instance\">\n @for (clientConfig of queryClientConfigs; track trackByClient(i, clientConfig); let i = $index) {\n <option [value]=\"i\">\n {{ clientConfig.displayName ?? clientConfig.client.config.baseRoute }}\n </option>\n }\n </select>\n </div>\n\n <button (click)=\"toggleOpen()\" class=\"et-qd-btn et-qd-btn-secondary\">Close</button>\n </header>\n\n <div class=\"et-qd-sub-header\">\n <button\n [ngClass]=\"{ 'et-qd-chip-secondary': !isTranslucent() }\"\n (click)=\"toggleTranslucent()\"\n class=\"et-qd-chip et-qd-translucent-clickable\"\n >\n Translucent\n </button>\n <div class=\"et-qd-sub-header__divider\"></div>\n <button\n [ngClass]=\"{ 'et-qd-chip-secondary': snapLayout() !== 'full' }\"\n (click)=\"selectSnapLayout('full')\"\n class=\"et-qd-chip\"\n >\n Fullscreen\n </button>\n <button\n [ngClass]=\"{ 'et-qd-chip-secondary': snapLayout() !== 'top' }\"\n (click)=\"selectSnapLayout('top')\"\n class=\"et-qd-chip\"\n >\n Top\n </button>\n <button\n [ngClass]=\"{ 'et-qd-chip-secondary': snapLayout() !== 'bottom' }\"\n (click)=\"selectSnapLayout('bottom')\"\n class=\"et-qd-chip\"\n >\n Bottom\n </button>\n <button\n [ngClass]=\"{ 'et-qd-chip-secondary': snapLayout() !== 'left' }\"\n (click)=\"selectSnapLayout('left')\"\n class=\"et-qd-chip\"\n >\n Left\n </button>\n <button\n [ngClass]=\"{ 'et-qd-chip-secondary': snapLayout() !== 'right' }\"\n (click)=\"selectSnapLayout('right')\"\n class=\"et-qd-chip\"\n >\n Right\n </button>\n </div>\n\n @if (selectedClientConfig(); as cfg) {\n <div class=\"et-qd-client\">\n <p class=\"et-qd-client__title\">{{ cfg.displayName ?? cfg.client.config.baseRoute }}</p>\n\n <div class=\"et-qd-client__actions\">\n <button (click)=\"cfg.client._store.refreshQueriesInUse()\" class=\"et-qd-chip\">Refresh all</button>\n <button (click)=\"cfg.client._store.refreshQueriesInUse({ ignoreCacheValidity: true })\" class=\"et-qd-chip\">\n Refresh all (ignore caches)\n </button>\n <button\n (click)=\"cfg.client._store.refreshQueriesInUse({ ignoreCacheValidity: true, purgeUnused: true })\"\n class=\"et-qd-chip\"\n >\n Refresh all (ignore caches & purge unused)\n </button>\n </div>\n </div>\n }\n\n @if (selectedClientConfig(); as cfg) {\n <div class=\"et-qd-queries\">\n <p class=\"et-qd-queries__title\">Inspector</p>\n <div class=\"et-qd-queries__actions\">\n <button\n [ngClass]=\"{ 'et-qd-chip-secondary': queryListMode() !== 'live' || viewMode() !== 'query' }\"\n (click)=\"selectQueryListMode('live'); selectViewMode('query')\"\n class=\"et-qd-chip et-qd-chip-bordered\"\n >\n Live Queries ({{ queries()?.length ?? 0 }})\n </button>\n <button\n [ngClass]=\"{ 'et-qd-chip-secondary': queryListMode() !== 'history' || viewMode() !== 'query' }\"\n (click)=\"selectQueryListMode('history'); selectViewMode('query')\"\n class=\"et-qd-chip et-qd-chip-bordered\"\n >\n Query History ({{ (queryHistory$ | async)?.length ?? 0 }}/50)\n </button>\n @if (queryListMode() === 'history' && viewMode() === 'query') {\n <div class=\"et-qd-queries__divider\"></div>\n <button (click)=\"clearQueryHistory()\" class=\"et-qd-chip et-qd-chip-bordered\">Clear history</button>\n }\n\n <div class=\"et-qd-queries__divider\"></div>\n <button\n [ngClass]=\"{ 'et-qd-chip-secondary': viewMode() !== 'authProvider' }\"\n (click)=\"selectViewMode('authProvider')\"\n class=\"et-qd-chip et-qd-chip-bordered\"\n >\n Auth Provider\n </button>\n </div>\n\n @if (viewMode() === 'query') {\n <div class=\"et-qd-queries__browser\">\n @if (queryListMode() === 'live') {\n <ul class=\"et-qd-queries__browser-list\">\n @for (query of queries(); track trackByQuery($index, query)) {\n <li>\n <button\n [class.et-qd-query--active]=\"selectedQuery()?._id === query._id\"\n (click)=\"selectQuery(query)\"\n >\n <span> {{ query._queryConfig.method }}</span>\n <span> {{ query | queryShortName }}</span>\n </button>\n </li>\n }\n </ul>\n }\n @if (queryListMode() === 'history') {\n <ul class=\"et-qd-queries__browser-list\">\n @for (query of queryHistory$ | async; track trackByQuery($index, query)) {\n <li>\n <button\n [class.et-qd-query--active]=\"selectedQuery()?._id === query._id\"\n (click)=\"selectQuery(query)\"\n >\n <span> {{ query._queryConfig.method }}</span>\n <span> {{ query | queryShortName }}</span>\n </button>\n </li>\n }\n </ul>\n }\n <div class=\"et-qd-queries__browser-detail\">\n @if (selectedQuery(); as query) {\n <p class=\"et-qd-queries__browser-detail__title\">\n {{ query._queryConfig.method }} {{ query._routeWithParams }}\n </p>\n\n <div class=\"et-qd-queries__actions\">\n <button (click)=\"query.execute()\" class=\"et-qd-chip et-qd-chip-bordered\">Execute</button>\n <button (click)=\"query.execute({ skipCache: true })\" class=\"et-qd-chip et-qd-chip-bordered\">\n Execute (ignore cache)\n </button>\n\n <button (click)=\"query.abort()\" class=\"et-qd-chip et-qd-chip-bordered\">Abort</button>\n <div class=\"et-qd-queries__divider\"></div>\n <button\n [ngClass]=\"{ 'et-qd-chip-secondary': !query.isPolling }\"\n (click)=\"query.poll({ interval: 5000, takeUntil: _destroy$ })\"\n class=\"et-qd-chip et-qd-chip-bordered\"\n >\n Poll\n </button>\n\n <button\n [ngClass]=\"{ 'et-qd-chip-secondary': query.isPolling }\"\n (click)=\"query.stopPolling()\"\n class=\"et-qd-chip et-qd-chip-bordered\"\n >\n Stop polling\n </button>\n @if (query.isPolling || query._isPollingPaused) {\n <button (click)=\"query.pausePolling()\" class=\"et-qd-chip et-qd-chip-secondary et-qd-chip-bordered\">\n Pause polling\n </button>\n <button (click)=\"query.resumePolling()\" class=\"et-qd-chip et-qd-chip-secondary et-qd-chip-bordered\">\n Resume polling\n </button>\n }\n </div>\n\n <div class=\"et-qd-list\">\n <div class=\"et-qd-list-item\">\n <p>State type</p>\n <pre>{{ query.rawState.type }}</pre>\n </div>\n\n <div class=\"et-qd-list-item\">\n <p>Dependents</p>\n <pre>{{ query._dependents | json }}</pre>\n </div>\n\n <div class=\"et-qd-list-item\">\n <p>Is expired</p>\n <pre>{{ query.isExpired }}</pre>\n </div>\n\n <div class=\"et-qd-list-item\">\n <p>Is in use</p>\n <pre>{{ query.isInUse }}</pre>\n </div>\n\n <div class=\"et-qd-list-item\">\n <p>Subscriber count</p>\n <pre>{{ query._subscriberCount }}</pre>\n </div>\n\n <div class=\"et-qd-list-item\">\n <p>Is polling</p>\n <pre>{{ query.isPolling }}</pre>\n </div>\n\n <div class=\"et-qd-list-item\">\n <p>Is polling paused</p>\n <pre>{{ query._isPollingPaused }}</pre>\n </div>\n\n <div class=\"et-qd-list-item\">\n <p>Enable smart polling</p>\n <pre>{{ query._enableSmartPolling }}</pre>\n </div>\n\n <div class=\"et-qd-list-item\">\n <p>Query store key</p>\n <pre>{{ query._queryStoreKey }}</pre>\n </div>\n\n <div class=\"et-qd-list-item\">\n <p>Arguments</p>\n\n <div>\n <button\n [ngClass]=\"{ 'et-qd-chip-secondary': !showArguments() }\"\n (click)=\"toggleShowArguments()\"\n class=\"et-qd-chip et-qd-chip-bordered\"\n >\n Toggle\n </button>\n </div>\n @if (showArguments()) {\n <pre>{{ query._arguments | json }}</pre>\n }\n </div>\n\n <div class=\"et-qd-list-item\">\n <p>State</p>\n <p><i> Warning, this will cause a subscription if shown!</i></p>\n <div>\n <button\n [ngClass]=\"{ 'et-qd-chip-secondary': !showResponse() }\"\n (click)=\"toggleShowResponse()\"\n class=\"et-qd-chip et-qd-chip-bordered\"\n >\n Toggle\n </button>\n </div>\n @if (showResponse()) {\n <pre>{{ query.state$ | async | json }}</pre>\n }\n </div>\n\n <div class=\"et-qd-list-item\">\n <p>Raw state</p>\n <p><i> The query state unaffected by entity stores</i></p>\n\n <div>\n <button\n [ngClass]=\"{ 'et-qd-chip-secondary': !showRawResponse() }\"\n (click)=\"toggleShowRawResponse()\"\n class=\"et-qd-chip et-qd-chip-bordered\"\n >\n Toggle\n </button>\n </div>\n @if (showRawResponse()) {\n <pre>{{ query.rawState | json }}</pre>\n }\n </div>\n\n <div class=\"et-qd-list-item\">\n <p>Query config</p>\n\n <div>\n <button\n [ngClass]=\"{ 'et-qd-chip-secondary': !showQueryConfig() }\"\n (click)=\"toggleShowQueryConfig()\"\n class=\"et-qd-chip et-qd-chip-bordered\"\n >\n Toggle\n </button>\n </div>\n @if (showQueryConfig()) {\n <pre>{{ stringifiedQueryConfig() | json }}</pre>\n }\n </div>\n\n @if (!!query._queryConfig.entity) {\n <div class=\"et-qd-list-item\">\n <p>Entity store value</p>\n\n <div>\n <button\n [ngClass]=\"{ 'et-qd-chip-secondary': !showEntityStoreValue() }\"\n (click)=\"toggleShowEntityStoreValue()\"\n class=\"et-qd-chip et-qd-chip-bordered\"\n >\n Toggle\n </button>\n </div>\n @if (showEntityStoreValue()) {\n <pre>{{ selectedQueryEntityStoreValue$ | async | json }}</pre>\n }\n </div>\n }\n </div>\n }\n </div>\n </div>\n } @else if (viewMode() === 'authProvider') {\n <div class=\"et-qd-auth-provider__viewer\">\n @if (authProviderDetails(); as details) {\n <div class=\"et-qd-list\">\n <div class=\"et-qd-list-item\">\n <p>Type</p>\n <pre>{{ details.type }}</pre>\n </div>\n <div class=\"et-qd-list-item\">\n <p>Header value</p>\n <pre>{{ details.header() | json }}</pre>\n </div>\n <div class=\"et-qd-list-item\">\n <p>Config</p>\n <pre>{{ details.config | json }}</pre>\n </div>\n\n @if (details.type === 'BearerAuthProvider') {\n <div class=\"et-qd-list-item\">\n <p>Tokens</p>\n <pre>{{ details.provider.tokens$ | async | json }}</pre>\n </div>\n\n <div class=\"et-qd-list-item\">\n <p>Should refresh on unauthorized response</p>\n <pre>{{ details.provider.shouldRefreshOnUnauthorizedResponse }}</pre>\n </div>\n\n <ng-container\n *etQuery=\"\n details.provider.currentRefreshQuery$ | async as response;\n loading as loading;\n error as error;\n query as query\n \"\n >\n <div class=\"et-qd-list-item\">\n <p>Refresh query response</p>\n\n <div>\n <button (click)=\"details.provider._refreshQuery()\" class=\"et-qd-chip et-qd-chip-bordered\">\n Refresh\n </button>\n </div>\n <pre>{{ response | json }}</pre>\n </div>\n <div class=\"et-qd-list-item\">\n <p>Refresh query loading</p>\n <pre>{{ loading }}</pre>\n </div>\n <div class=\"et-qd-list-item\">\n <p>Refresh query error</p>\n <pre>{{ error ?? 'null' }}</pre>\n </div>\n <div class=\"et-qd-list-item\">\n <p>State</p>\n <pre>{{ query?.state$ | async | json }}</pre>\n </div>\n </ng-container>\n }\n </div>\n } @else {\n <p>No auth provider set</p>\n }\n </div>\n }\n </div>\n }\n </div>\n}\n", styles: [":host{position:fixed;top:0;z-index:1000000;font-size:14px;color:#fff}.et-query-devtools-container{position:fixed;inset:0;background-color:#25292e;z-index:10000;overflow:auto;font-family:monospace;display:grid;grid-template-rows:auto auto auto minmax(0,1fr)}.et-query-devtools-container.et-query-devtools-container--transparent{opacity:.25;pointer-events:none}.et-query-devtools-container.et-query-devtools-container--transparent .et-query-devtools-translucent-btn{pointer-events:all}.et-query-devtools-container.et-query-devtools-container--snap-left{inset-inline-start:0;inset-block-start:0;inset-block-end:0;width:50%;border-right:1px solid rgb(37,41,46)}.et-query-devtools-container.et-query-devtools-container--snap-right{inset-inline-start:unset;inset-inline-end:0;inset-block-start:0;inset-block-end:0;width:50%;border-left:1px solid rgb(37,41,46)}.et-query-devtools-container.et-query-devtools-container--snap-top{inset-inline-start:0;inset-block-start:0;inset-inline-end:0;height:50%;border-bottom:1px solid rgb(37,41,46)}.et-query-devtools-container.et-query-devtools-container--snap-bottom{inset-inline-start:0;inset-block-start:unset;inset-block-end:0;inset-inline-end:0;height:50%;border-top:1px solid rgb(37,41,46)}button.et-query-devtools-open-btn{position:fixed;inset-inline-end:20px;inset-block-end:0;z-index:9999;font-family:monospace;border-radius:3px 3px 0 0;line-height:14px;font-size:12px}.et-qd-header{background-color:#00ffa1;padding:12px;display:grid;grid-template-columns:1fr auto auto;gap:12px;align-items:center}.et-qd-header__title{color:#25292e;margin:0;font-size:22px}.et-qd-header__select{display:grid;background-color:#25292e;border-radius:10px;overflow:hidden}.et-qd-header__select select{width:250px;color:#fff;padding:3px 10px 2px;border:none;background-color:#25292e;font-family:monospace}.et-qd-header__select label{padding:3px 10px;color:#25292e;font-size:12px;font-weight:700;color:#fff;border-bottom:1px solid gray}.et-qd-sub-header{background-color:#00b371;padding:12px;display:flex;gap:12px;flex-wrap:wrap}.et-qd-sub-header__divider{width:1px;background-color:#25292e}.et-qd-btn{background-color:#00ffa1;color:#25292e;border:none;padding:12px;cursor:pointer;font-size:14px;font-weight:700;text-align:center;text-decoration:none;display:inline-block;width:100%;transition:all .3s ease-in-out;font-family:monospace;border-radius:10px}.et-qd-btn:hover{background-color:#00cc81}.et-qd-btn.et-qd-btn-secondary{background-color:#25292e;color:#00ffa1}.et-qd-btn.et-qd-btn-secondary:hover{background-color:#3c424a}.et-qd-chip{background-color:#00ffa1;color:#25292e;border:none;padding:4px 9px;cursor:pointer;font-size:12px;font-weight:700;text-align:center;text-decoration:none;display:inline-block;transition:all .3s ease-in-out;font-family:monospace;border-radius:10px}.et-qd-chip:hover{background-color:#00cc81}.et-qd-chip.et-qd-chip-secondary{background-color:#25292e;color:#00ffa1}.et-qd-chip.et-qd-chip-secondary:hover{background-color:#3c424a}.et-qd-chip.et-qd-chip-bordered{border:1px solid rgb(0,255,161)}.et-qd-translucent-clickable{pointer-events:all}.et-qd-client{border-bottom:1px solid rgb(59.734939759,66.1927710843,74.265060241);padding:12px}.et-qd-client__title{margin:0;font-size:14px;color:#fff;font-weight:700}.et-qd-client__actions{display:flex;gap:12px;margin-top:12px}.et-qd-queries{padding:12px;display:grid;grid-template-rows:auto auto minmax(0,1fr)}.et-qd-queries__actions{display:flex;gap:12px;margin-top:12px;margin-bottom:16px}.et-qd-queries__title{margin:0;font-size:14px;color:#fff;font-weight:700}.et-qd-queries__divider{width:1px;background-color:#3c424a}.et-qd-queries__browser{display:grid;grid-template-columns:1fr minmax(0,3fr);margin-left:-12px;margin-right:-12px;border-top:1px solid rgb(59.734939759,66.1927710843,74.265060241);margin-bottom:-12px}.et-qd-queries__browser-list{border-right:1px solid rgb(59.734939759,66.1927710843,74.265060241);list-style:none;padding:0;margin:0;display:grid;grid-auto-flow:row;grid-auto-rows:55px;overflow-y:auto;overflow-x:hidden}.et-qd-queries__browser-list li{margin:0}.et-qd-queries__browser-list li button{all:unset;font-family:monospace;box-sizing:border-box;width:100%;border:none;border-bottom:1px solid rgb(59.734939759,66.1927710843,74.265060241);background-color:#25292e;color:#fff;text-align:left;padding:12px;height:100%;transition:all .3s ease-in-out;cursor:pointer;display:grid;grid-template-columns:auto minmax(0,1fr);gap:2px;display:block}.et-qd-queries__browser-list li button span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.et-qd-queries__browser-list li button span:first-of-type{font-weight:700}.et-qd-queries__browser-list li button:hover,.et-qd-queries__browser-list li button.et-qd-query--active{background-color:#30363c}.et-qd-queries__browser-detail{padding:12px;overflow-y:auto;overflow-x:hidden}.et-qd-queries__browser-detail__title{margin:0;font-size:14px;color:#fff;font-weight:700}.et-qd-auth-provider__viewer{border-top:1px solid rgb(59.734939759,66.1927710843,74.265060241);margin-left:-12px;margin-right:-12px;margin-bottom:-12px;padding:12px;overflow-y:auto;overflow-x:hidden}.et-qd-list{display:grid;gap:12px}.et-qd-list-item{display:grid}.et-qd-list-item p{font-weight:700;margin:0;padding-bottom:8px}.et-qd-list-item p+p{margin-top:-8px}.et-qd-list-item div+pre{margin-top:8px}.et-qd-list-item pre{margin:0;padding:4px;background-color:#0e1012;border-radius:4px;max-height:450px;overflow:auto}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: JsonPipe, name: "json" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: QueryShortNamePipe, name: "queryShortName" }, { kind: "directive", type: QueryDirective, selector: "[etQuery]", inputs: ["etQuery", "etQueryCache"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.ShadowDom }); }
|
|
2678
2678
|
}
|
|
2679
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
2679
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: QueryDevtoolsComponent, decorators: [{
|
|
2680
2680
|
type: Component,
|
|
2681
2681
|
args: [{ selector: 'et-query-devtools', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.ShadowDom, host: {
|
|
2682
2682
|
class: 'et-query-devtools',
|
|
@@ -3035,7 +3035,7 @@ const createBearerAuthProvider = (options) => {
|
|
|
3035
3035
|
const isCookieEnabled = cookieEnabled();
|
|
3036
3036
|
const res = latestExecutedQuery();
|
|
3037
3037
|
const error = res?.query?.query.error();
|
|
3038
|
-
if (!isCookieEnabled || (error && error.
|
|
3038
|
+
if (!isCookieEnabled || (error && error.code === 401)) {
|
|
3039
3039
|
deleteCookie$1();
|
|
3040
3040
|
return;
|
|
3041
3041
|
}
|
|
@@ -3248,33 +3248,42 @@ const createQuerySnapshotFn = (options) => {
|
|
|
3248
3248
|
* This will also pause polling and auto refresh until new args are set.
|
|
3249
3249
|
*/
|
|
3250
3250
|
const CLEAR_QUERY_ARGS = Symbol('CLEAR_QUERY_ARGS');
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
const queryEffect = (fn, errorMessage, options) => {
|
|
3254
|
-
let lastTriggerTs = 0;
|
|
3255
|
-
let illegalWrites = 0;
|
|
3256
|
-
let isFirstRun = true;
|
|
3251
|
+
/** A angular effect that can be nested inside another effect */
|
|
3252
|
+
const nestedEffect = (fn, options) => {
|
|
3257
3253
|
const activeConsumer = getActiveConsumer();
|
|
3258
3254
|
setActiveConsumer(null);
|
|
3259
3255
|
const eff = effect(() => {
|
|
3260
|
-
|
|
3261
|
-
const now = performance.now();
|
|
3262
|
-
if (now - lastTriggerTs < 100) {
|
|
3263
|
-
illegalWrites++;
|
|
3264
|
-
if (illegalWrites > 5) {
|
|
3265
|
-
throw new Error(errorMessage);
|
|
3266
|
-
}
|
|
3267
|
-
}
|
|
3268
|
-
lastTriggerTs = now;
|
|
3269
|
-
}
|
|
3270
|
-
fn(isFirstRun);
|
|
3271
|
-
if (isFirstRun) {
|
|
3272
|
-
isFirstRun = false;
|
|
3273
|
-
}
|
|
3256
|
+
fn();
|
|
3274
3257
|
}, options);
|
|
3275
3258
|
setActiveConsumer(activeConsumer);
|
|
3276
3259
|
return eff;
|
|
3277
3260
|
};
|
|
3261
|
+
const CIRCULAR_QUERY_DEPENDENCY_ERROR_MESSAGE = 'Query was executed more than 5 times in less than 100ms. This is usually a sign of a circular dependency.';
|
|
3262
|
+
const circularQueryDependencyChecker = () => {
|
|
3263
|
+
let lastTriggerTs = 0;
|
|
3264
|
+
let illegalWrites = 0;
|
|
3265
|
+
// Typing this as number will throw an type error during testing since it is of type Timeout in a node env.
|
|
3266
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3267
|
+
let timeout = null;
|
|
3268
|
+
const check = () => {
|
|
3269
|
+
const now = performance.now();
|
|
3270
|
+
if (now - lastTriggerTs < 100) {
|
|
3271
|
+
illegalWrites++;
|
|
3272
|
+
if (illegalWrites > 5) {
|
|
3273
|
+
throw new Error(CIRCULAR_QUERY_DEPENDENCY_ERROR_MESSAGE);
|
|
3274
|
+
}
|
|
3275
|
+
}
|
|
3276
|
+
lastTriggerTs = now;
|
|
3277
|
+
if (timeout)
|
|
3278
|
+
clearTimeout(timeout);
|
|
3279
|
+
timeout = setTimeout(() => {
|
|
3280
|
+
illegalWrites = 0;
|
|
3281
|
+
}, 100);
|
|
3282
|
+
};
|
|
3283
|
+
return {
|
|
3284
|
+
check,
|
|
3285
|
+
};
|
|
3286
|
+
};
|
|
3278
3287
|
const shouldAutoExecuteQuery = (method) => {
|
|
3279
3288
|
return method === 'GET' || method === 'HEAD' || method === 'OPTIONS';
|
|
3280
3289
|
};
|
|
@@ -3329,14 +3338,22 @@ const extractExpiresInSeconds = (headers) => {
|
|
|
3329
3338
|
const shouldRetryRequest = (options) => {
|
|
3330
3339
|
const normalizedOptions = options instanceof HttpErrorResponse ? { retryCount: 0, error: options } : options;
|
|
3331
3340
|
const { retryCount, error } = normalizedOptions;
|
|
3332
|
-
const defaultRetryDelay = 1000 + 1000 * retryCount;
|
|
3341
|
+
const defaultRetryDelay = clamp(1000 + 1000 * retryCount, 1000, 5000);
|
|
3342
|
+
const { status, error: detail, headers } = error;
|
|
3343
|
+
// Code 0 usually means the internet connection is down. We retry in this case.
|
|
3344
|
+
// It could also be a CORS issue but that should not be the case in production.
|
|
3345
|
+
// We will retry in this case until the connection is back.
|
|
3346
|
+
if (status === 0) {
|
|
3347
|
+
return { retry: true, delay: defaultRetryDelay };
|
|
3348
|
+
}
|
|
3349
|
+
// Don't retry if we already retried 3 times
|
|
3333
3350
|
if (retryCount > 3) {
|
|
3334
3351
|
return { retry: false };
|
|
3335
3352
|
}
|
|
3353
|
+
// Don't retry if it's not an http error
|
|
3336
3354
|
if (!(error instanceof HttpErrorResponse)) {
|
|
3337
3355
|
return { retry: false };
|
|
3338
3356
|
}
|
|
3339
|
-
const { status, error: detail, headers } = error;
|
|
3340
3357
|
// Retry on 5xx errors (except 500 internal server error since those are usually not recoverable)
|
|
3341
3358
|
if (status >= 501) {
|
|
3342
3359
|
// Don't retry if a requested page is out of range
|
|
@@ -3358,11 +3375,6 @@ const shouldRetryRequest = (options) => {
|
|
|
3358
3375
|
}
|
|
3359
3376
|
return { retry: true, delay: defaultRetryDelay };
|
|
3360
3377
|
}
|
|
3361
|
-
// Code 0 usually means the internet connection is down. We retry in this case.
|
|
3362
|
-
// It could also be a CORS issue but that should not be the case in production.
|
|
3363
|
-
if (status === 0) {
|
|
3364
|
-
return { retry: true, delay: defaultRetryDelay };
|
|
3365
|
-
}
|
|
3366
3378
|
return { retry: false };
|
|
3367
3379
|
};
|
|
3368
3380
|
const getQueryFeatureUsage = (options) => {
|
|
@@ -3696,7 +3708,7 @@ const withArgs = (args) => {
|
|
|
3696
3708
|
type: "withArgs" /* QueryFeatureType.WithArgs */,
|
|
3697
3709
|
fn: (context) => {
|
|
3698
3710
|
const currArgs = computed(() => args());
|
|
3699
|
-
|
|
3711
|
+
nestedEffect(() => {
|
|
3700
3712
|
const currArgsNow = currArgs();
|
|
3701
3713
|
if (currArgsNow === null)
|
|
3702
3714
|
return;
|
|
@@ -3709,7 +3721,7 @@ const withArgs = (args) => {
|
|
|
3709
3721
|
if (context.flags.shouldAutoExecute)
|
|
3710
3722
|
context.execute({ args: currArgsNow });
|
|
3711
3723
|
});
|
|
3712
|
-
},
|
|
3724
|
+
}, { injector: context.deps.injector });
|
|
3713
3725
|
},
|
|
3714
3726
|
});
|
|
3715
3727
|
};
|
|
@@ -3728,7 +3740,7 @@ const withPolling = (options) => {
|
|
|
3728
3740
|
throw withPollingUsedOnUnsupportedHttpMethod(context.flags.method);
|
|
3729
3741
|
}
|
|
3730
3742
|
let intervalId = null;
|
|
3731
|
-
|
|
3743
|
+
nestedEffect(() => {
|
|
3732
3744
|
const args = context.state.args();
|
|
3733
3745
|
untracked(() => {
|
|
3734
3746
|
if (intervalId !== null)
|
|
@@ -3744,7 +3756,7 @@ const withPolling = (options) => {
|
|
|
3744
3756
|
context.execute({ args });
|
|
3745
3757
|
}, options.interval);
|
|
3746
3758
|
});
|
|
3747
|
-
},
|
|
3759
|
+
}, { injector: context.deps.injector });
|
|
3748
3760
|
context.deps.destroyRef.onDestroy(() => intervalId !== null && clearInterval(intervalId));
|
|
3749
3761
|
},
|
|
3750
3762
|
});
|
|
@@ -3754,14 +3766,14 @@ const withLogging = (options) => {
|
|
|
3754
3766
|
return createQueryFeature({
|
|
3755
3767
|
type: "withLogging" /* QueryFeatureType.WithLogging */,
|
|
3756
3768
|
fn: (context) => {
|
|
3757
|
-
|
|
3769
|
+
nestedEffect(() => {
|
|
3758
3770
|
const event = context.state.latestHttpEvent();
|
|
3759
3771
|
if (event === null)
|
|
3760
3772
|
return;
|
|
3761
3773
|
untracked(() => {
|
|
3762
3774
|
options.logFn(event);
|
|
3763
3775
|
});
|
|
3764
|
-
},
|
|
3776
|
+
}, { injector: context.deps.injector });
|
|
3765
3777
|
},
|
|
3766
3778
|
});
|
|
3767
3779
|
};
|
|
@@ -3770,14 +3782,14 @@ const withErrorHandling = (options) => {
|
|
|
3770
3782
|
return createQueryFeature({
|
|
3771
3783
|
type: "withErrorHandling" /* QueryFeatureType.WithErrorHandling */,
|
|
3772
3784
|
fn: (context) => {
|
|
3773
|
-
|
|
3785
|
+
nestedEffect(() => {
|
|
3774
3786
|
const error = context.state.error();
|
|
3775
3787
|
if (error === null)
|
|
3776
3788
|
return;
|
|
3777
3789
|
untracked(() => {
|
|
3778
3790
|
options.handler(error);
|
|
3779
3791
|
});
|
|
3780
|
-
},
|
|
3792
|
+
}, { injector: context.deps.injector });
|
|
3781
3793
|
},
|
|
3782
3794
|
});
|
|
3783
3795
|
};
|
|
@@ -3786,14 +3798,14 @@ const withSuccessHandling = (options) => {
|
|
|
3786
3798
|
return createQueryFeature({
|
|
3787
3799
|
type: "withSuccessHandling" /* QueryFeatureType.WithSuccessHandling */,
|
|
3788
3800
|
fn: (context) => {
|
|
3789
|
-
|
|
3801
|
+
nestedEffect(() => {
|
|
3790
3802
|
const response = context.state.response();
|
|
3791
3803
|
if (response === null)
|
|
3792
3804
|
return;
|
|
3793
3805
|
untracked(() => {
|
|
3794
3806
|
options.handler(response);
|
|
3795
3807
|
});
|
|
3796
|
-
},
|
|
3808
|
+
}, { injector: context.deps.injector });
|
|
3797
3809
|
},
|
|
3798
3810
|
});
|
|
3799
3811
|
};
|
|
@@ -3812,7 +3824,7 @@ const withAutoRefresh = (options) => {
|
|
|
3812
3824
|
if (context.flags.onlyManualExecution && !options.ignoreOnlyManualExecution) {
|
|
3813
3825
|
throw withAutoRefreshUsedInManualQuery();
|
|
3814
3826
|
}
|
|
3815
|
-
|
|
3827
|
+
nestedEffect(() => {
|
|
3816
3828
|
for (const signal of options.onSignalChanges) {
|
|
3817
3829
|
signal();
|
|
3818
3830
|
}
|
|
@@ -3824,7 +3836,7 @@ const withAutoRefresh = (options) => {
|
|
|
3824
3836
|
return;
|
|
3825
3837
|
context.execute({ args });
|
|
3826
3838
|
});
|
|
3827
|
-
},
|
|
3839
|
+
}, { injector: context.deps.injector });
|
|
3828
3840
|
},
|
|
3829
3841
|
});
|
|
3830
3842
|
};
|
|
@@ -3832,7 +3844,7 @@ const withResponseUpdate = (options) => {
|
|
|
3832
3844
|
return createQueryFeature({
|
|
3833
3845
|
type: "withResponseUpdate" /* QueryFeatureType.WithResponseUpdate */,
|
|
3834
3846
|
fn: (context) => {
|
|
3835
|
-
|
|
3847
|
+
nestedEffect(() => {
|
|
3836
3848
|
const currentResponse = untracked(() => context.state.response());
|
|
3837
3849
|
const response = options.updater({ currentResponse });
|
|
3838
3850
|
if (response === null)
|
|
@@ -3840,7 +3852,7 @@ const withResponseUpdate = (options) => {
|
|
|
3840
3852
|
untracked(() => {
|
|
3841
3853
|
context.state.response.set(response);
|
|
3842
3854
|
});
|
|
3843
|
-
},
|
|
3855
|
+
}, { injector: context.deps.injector });
|
|
3844
3856
|
},
|
|
3845
3857
|
});
|
|
3846
3858
|
};
|
|
@@ -4149,11 +4161,13 @@ const setupQueryDependencies = (options) => {
|
|
|
4149
4161
|
const destroyRef = queryEnvironmentInjector.get(DestroyRef);
|
|
4150
4162
|
const scopeDestroyRef = inject(DestroyRef);
|
|
4151
4163
|
const client = inject(options.clientConfig.token);
|
|
4164
|
+
const effectScheduler = inject(_EffectScheduler);
|
|
4152
4165
|
const dependencies = {
|
|
4153
4166
|
destroyRef,
|
|
4154
4167
|
scopeDestroyRef,
|
|
4155
4168
|
client,
|
|
4156
4169
|
injector: queryEnvironmentInjector,
|
|
4170
|
+
effectScheduler,
|
|
4157
4171
|
};
|
|
4158
4172
|
// cleanup the environment injector when the scope (e.g. the component the query is in) is destroyed
|
|
4159
4173
|
const scopeDestroyListener = scopeDestroyRef.onDestroy(() => {
|
|
@@ -4228,8 +4242,13 @@ const cleanupPreviousExecute = (options) => {
|
|
|
4228
4242
|
|
|
4229
4243
|
const createExecuteFn = (executeOptions) => {
|
|
4230
4244
|
const executeState = setupQueryExecuteState();
|
|
4245
|
+
const circularChecker = circularQueryDependencyChecker();
|
|
4231
4246
|
const reset = () => resetExecuteState({ executeState, executeOptions });
|
|
4232
4247
|
const exec = (executeArgs) => {
|
|
4248
|
+
circularChecker.check();
|
|
4249
|
+
// Make sure all effects are flushed before reading the args.
|
|
4250
|
+
// A withArgs feature effect might still be pending otherwise resulting in the wrong args being read.
|
|
4251
|
+
executeOptions.deps.effectScheduler.flush();
|
|
4233
4252
|
const { args = executeOptions.state.args(), options } = executeArgs ?? {};
|
|
4234
4253
|
cleanupPreviousExecute({ executeOptions, executeState });
|
|
4235
4254
|
queryExecute({ executeOptions, executeState, args, options });
|
|
@@ -4411,17 +4430,18 @@ const createQueryCreator = (options, internals) => {
|
|
|
4411
4430
|
};
|
|
4412
4431
|
|
|
4413
4432
|
const AUTH_HEADER = 'Authorization';
|
|
4414
|
-
const createSecureExecuteFn = (
|
|
4433
|
+
const createSecureExecuteFn = (executeOptions) => {
|
|
4415
4434
|
const executeState = setupQueryExecuteState();
|
|
4416
|
-
const authProvider = inject(
|
|
4435
|
+
const authProvider = inject(executeOptions.creatorInternals.authProvider.token);
|
|
4436
|
+
const circularChecker = circularQueryDependencyChecker();
|
|
4417
4437
|
let authQuerySubscription = Subscription.EMPTY;
|
|
4418
4438
|
const reset = () => {
|
|
4419
4439
|
authQuerySubscription.unsubscribe();
|
|
4420
4440
|
authQuerySubscription = Subscription.EMPTY;
|
|
4421
|
-
resetExecuteState({ executeState, executeOptions:
|
|
4441
|
+
resetExecuteState({ executeState, executeOptions: executeOptions });
|
|
4422
4442
|
};
|
|
4423
4443
|
const error = (query) => {
|
|
4424
|
-
const state =
|
|
4444
|
+
const state = executeOptions.state;
|
|
4425
4445
|
state.error.set(query.error());
|
|
4426
4446
|
state.loading.set(null);
|
|
4427
4447
|
state.response.set(null);
|
|
@@ -4430,6 +4450,7 @@ const createSecureExecuteFn = (options) => {
|
|
|
4430
4450
|
};
|
|
4431
4451
|
const authAndExec = (executeArgs) => {
|
|
4432
4452
|
const { args, options: runOptions } = executeArgs ?? {};
|
|
4453
|
+
console.log('authAndExec', { executeArgs, args, runOptions });
|
|
4433
4454
|
const tokens = authProvider.tokens();
|
|
4434
4455
|
let headers = args?.headers || new HttpHeaders();
|
|
4435
4456
|
if (!tokens) {
|
|
@@ -4440,41 +4461,49 @@ const createSecureExecuteFn = (options) => {
|
|
|
4440
4461
|
}
|
|
4441
4462
|
const updatedArgs = { ...(args ?? {}), headers };
|
|
4442
4463
|
queryExecute({
|
|
4443
|
-
executeOptions:
|
|
4464
|
+
executeOptions: executeOptions,
|
|
4444
4465
|
executeState,
|
|
4445
4466
|
args: updatedArgs,
|
|
4446
4467
|
options: runOptions,
|
|
4447
4468
|
});
|
|
4448
4469
|
};
|
|
4449
4470
|
const exec = (executeArgs) => {
|
|
4471
|
+
circularChecker.check();
|
|
4472
|
+
// Make sure all effects are flushed before reading the args.
|
|
4473
|
+
// A withArgs feature effect might still be pending otherwise resulting in the wrong args being read.
|
|
4474
|
+
executeOptions.deps.effectScheduler.flush();
|
|
4475
|
+
const execArgsWithDefaults = {
|
|
4476
|
+
args: executeArgs?.args ?? executeOptions.state.args(),
|
|
4477
|
+
options: executeArgs?.options,
|
|
4478
|
+
};
|
|
4450
4479
|
authQuerySubscription.unsubscribe();
|
|
4451
4480
|
authQuerySubscription = Subscription.EMPTY;
|
|
4452
|
-
cleanupPreviousExecute({ executeOptions:
|
|
4481
|
+
cleanupPreviousExecute({ executeOptions: executeOptions, executeState });
|
|
4453
4482
|
const authQuery = authProvider.latestExecutedQuery();
|
|
4454
4483
|
// This might happen if a secure query gets executed while the auth query has just been created.
|
|
4455
4484
|
// This is due to the fact that the query state is being synced with the state inside the http request using effect.
|
|
4456
4485
|
const isAuthQueryFreshlyExecuted = authQuery?.lastTimeExecutedAt() === null;
|
|
4457
4486
|
if (!authQuery || authQuery.loading() || isAuthQueryFreshlyExecuted) {
|
|
4458
|
-
|
|
4459
|
-
authQuerySubscription = toObservable(authProvider.latestExecutedQuery, { injector:
|
|
4487
|
+
executeOptions.state.loading.set({ executeTime: Date.now(), progress: null });
|
|
4488
|
+
authQuerySubscription = toObservable(authProvider.latestExecutedQuery, { injector: executeOptions.deps.injector })
|
|
4460
4489
|
.pipe(switchMap((query) => {
|
|
4461
4490
|
if (!query)
|
|
4462
4491
|
return of(null);
|
|
4463
|
-
return toObservable(query.isAlive, { injector:
|
|
4492
|
+
return toObservable(query.isAlive, { injector: executeOptions.deps.injector }).pipe(tap((isAlive) => {
|
|
4464
4493
|
if (isAlive)
|
|
4465
4494
|
return;
|
|
4466
4495
|
if (query.error()) {
|
|
4467
4496
|
error(query);
|
|
4468
4497
|
}
|
|
4469
4498
|
else if (query.response()) {
|
|
4470
|
-
authAndExec(
|
|
4499
|
+
authAndExec(execArgsWithDefaults);
|
|
4471
4500
|
}
|
|
4472
4501
|
}));
|
|
4473
4502
|
}))
|
|
4474
4503
|
.subscribe();
|
|
4475
4504
|
}
|
|
4476
4505
|
else if (authQuery.response()) {
|
|
4477
|
-
authAndExec(
|
|
4506
|
+
authAndExec(execArgsWithDefaults);
|
|
4478
4507
|
}
|
|
4479
4508
|
else if (authQuery.error()) {
|
|
4480
4509
|
error(authQuery);
|
|
@@ -4567,8 +4596,13 @@ const createSecurePatchQuery = (client, authProvider) => {
|
|
|
4567
4596
|
|
|
4568
4597
|
const createGqlExecuteFn = (executeOptions) => {
|
|
4569
4598
|
const executeState = setupQueryExecuteState();
|
|
4599
|
+
const circularChecker = circularQueryDependencyChecker();
|
|
4570
4600
|
const reset = () => resetExecuteState({ executeState, executeOptions });
|
|
4571
4601
|
const exec = (executeArgs) => {
|
|
4602
|
+
circularChecker.check();
|
|
4603
|
+
// Make sure all effects are flushed before reading the args.
|
|
4604
|
+
// A withArgs feature effect might still be pending otherwise resulting in the wrong args being read.
|
|
4605
|
+
executeOptions.deps.effectScheduler.flush();
|
|
4572
4606
|
const { args = executeOptions.state.args(), options } = executeArgs ?? {};
|
|
4573
4607
|
cleanupPreviousExecute({ executeOptions, executeState });
|
|
4574
4608
|
// TODO: This should get cleaned up
|
|
@@ -4851,10 +4885,10 @@ class ParseHttpErrorCodeToTitleDePipe {
|
|
|
4851
4885
|
constructor() {
|
|
4852
4886
|
this.transform = parseHttpErrorCodeToTitleDe;
|
|
4853
4887
|
}
|
|
4854
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
4855
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.
|
|
4888
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ParseHttpErrorCodeToTitleDePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
4889
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.1", ngImport: i0, type: ParseHttpErrorCodeToTitleDePipe, isStandalone: true, name: "parseHttpErrorCodeToTitleDe" }); }
|
|
4856
4890
|
}
|
|
4857
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
4891
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ParseHttpErrorCodeToTitleDePipe, decorators: [{
|
|
4858
4892
|
type: Pipe,
|
|
4859
4893
|
args: [{
|
|
4860
4894
|
name: 'parseHttpErrorCodeToTitleDe',
|
|
@@ -4865,10 +4899,10 @@ class ParseHttpErrorCodeToMessageDePipe {
|
|
|
4865
4899
|
constructor() {
|
|
4866
4900
|
this.transform = parseHttpErrorCodeToMessageDe;
|
|
4867
4901
|
}
|
|
4868
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
4869
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.
|
|
4902
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ParseHttpErrorCodeToMessageDePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
4903
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.1", ngImport: i0, type: ParseHttpErrorCodeToMessageDePipe, isStandalone: true, name: "parseHttpErrorCodeToMessageDe" }); }
|
|
4870
4904
|
}
|
|
4871
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
4905
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ParseHttpErrorCodeToMessageDePipe, decorators: [{
|
|
4872
4906
|
type: Pipe,
|
|
4873
4907
|
args: [{
|
|
4874
4908
|
name: 'parseHttpErrorCodeToMessageDe',
|
|
@@ -5053,10 +5087,10 @@ class ParseHttpErrorCodeToTitleEnPipe {
|
|
|
5053
5087
|
constructor() {
|
|
5054
5088
|
this.transform = parseHttpErrorCodeToTitleEn;
|
|
5055
5089
|
}
|
|
5056
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
5057
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.
|
|
5090
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ParseHttpErrorCodeToTitleEnPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
5091
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.1", ngImport: i0, type: ParseHttpErrorCodeToTitleEnPipe, isStandalone: true, name: "parseHttpErrorCodeToTitleEn" }); }
|
|
5058
5092
|
}
|
|
5059
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
5093
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ParseHttpErrorCodeToTitleEnPipe, decorators: [{
|
|
5060
5094
|
type: Pipe,
|
|
5061
5095
|
args: [{
|
|
5062
5096
|
name: 'parseHttpErrorCodeToTitleEn',
|
|
@@ -5067,10 +5101,10 @@ class ParseHttpErrorCodeToMessageEnPipe {
|
|
|
5067
5101
|
constructor() {
|
|
5068
5102
|
this.transform = parseHttpErrorCodeToMessageEn;
|
|
5069
5103
|
}
|
|
5070
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
5071
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.
|
|
5104
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ParseHttpErrorCodeToMessageEnPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
5105
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.1", ngImport: i0, type: ParseHttpErrorCodeToMessageEnPipe, isStandalone: true, name: "parseHttpErrorCodeToMessageEn" }); }
|
|
5072
5106
|
}
|
|
5073
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
5107
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ParseHttpErrorCodeToMessageEnPipe, decorators: [{
|
|
5074
5108
|
type: Pipe,
|
|
5075
5109
|
args: [{
|
|
5076
5110
|
name: 'parseHttpErrorCodeToMessageEn',
|
|
@@ -5206,11 +5240,11 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
5206
5240
|
ParseHttpErrorCodeToMessageEnPipe: ParseHttpErrorCodeToMessageEnPipe,
|
|
5207
5241
|
ParseHttpErrorCodeToTitleDePipe: ParseHttpErrorCodeToTitleDePipe,
|
|
5208
5242
|
ParseHttpErrorCodeToTitleEnPipe: ParseHttpErrorCodeToTitleEnPipe,
|
|
5209
|
-
QUERY_EFFECT_ERROR_MESSAGE: QUERY_EFFECT_ERROR_MESSAGE,
|
|
5210
5243
|
SPEED_BUFFER_TIME_IN_MS: SPEED_BUFFER_TIME_IN_MS,
|
|
5211
5244
|
applyQueryFeatures: applyQueryFeatures,
|
|
5212
5245
|
bearerExpiresInPropertyNotNumber: bearerExpiresInPropertyNotNumber,
|
|
5213
5246
|
buildQueryCacheKey: buildQueryCacheKey,
|
|
5247
|
+
circularQueryDependencyChecker: circularQueryDependencyChecker,
|
|
5214
5248
|
cleanupPreviousExecute: cleanupPreviousExecute,
|
|
5215
5249
|
contentfulGqlLikePaginationAdapter: contentfulGqlLikePaginationAdapter,
|
|
5216
5250
|
cookieLoginTriedButCookieDisabled: cookieLoginTriedButCookieDisabled,
|
|
@@ -5265,6 +5299,7 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
5265
5299
|
loginCalledWithoutConfig: loginCalledWithoutConfig,
|
|
5266
5300
|
loginWithTokenCalledWithoutConfig: loginWithTokenCalledWithoutConfig,
|
|
5267
5301
|
maybeExecute: maybeExecute,
|
|
5302
|
+
nestedEffect: nestedEffect,
|
|
5268
5303
|
normalizeQueryRepositoryKey: normalizeQueryRepositoryKey,
|
|
5269
5304
|
pagedQueryStackNextPageCalledWithoutPreviousPage: pagedQueryStackNextPageCalledWithoutPreviousPage,
|
|
5270
5305
|
pagedQueryStackPageBiggerThanTotalPages: pagedQueryStackPageBiggerThanTotalPages,
|
|
@@ -5276,7 +5311,6 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
5276
5311
|
provideBearerAuthProvider: provideBearerAuthProvider,
|
|
5277
5312
|
provideQueryClient: provideQueryClient,
|
|
5278
5313
|
provideWebSocketClient: provideWebSocketClient,
|
|
5279
|
-
queryEffect: queryEffect,
|
|
5280
5314
|
queryExecute: queryExecute,
|
|
5281
5315
|
queryFeatureUsedMultipleTimes: queryFeatureUsedMultipleTimes,
|
|
5282
5316
|
queryStackWithArgsUsed: queryStackWithArgsUsed,
|