@ethlete/query 6.0.0-next.4 → 6.0.0-next.6
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 +164 -129
- package/fesm2022/ethlete-query.mjs.map +1 -1
- package/package.json +10 -9
- package/types/ethlete-query.d.ts +26 -1
|
@@ -307,7 +307,7 @@ const withArgs = (args) => {
|
|
|
307
307
|
return createQueryFeature({
|
|
308
308
|
type: QueryFeatureType.WITH_ARGS,
|
|
309
309
|
fn: (context) => {
|
|
310
|
-
const currArgs = computed(() => args(), ...(ngDevMode ? [{ debugName: "currArgs" }] : []));
|
|
310
|
+
const currArgs = computed(() => args(), ...(ngDevMode ? [{ debugName: "currArgs" }] : /* istanbul ignore next */ []));
|
|
311
311
|
nestedEffect(() => {
|
|
312
312
|
const currArgsNow = currArgs();
|
|
313
313
|
if (currArgsNow === null)
|
|
@@ -458,20 +458,20 @@ const withResponseUpdate = (options) => {
|
|
|
458
458
|
};
|
|
459
459
|
|
|
460
460
|
const setupQueryState = (options) => {
|
|
461
|
-
const request = signal(null, ...(ngDevMode ? [{ debugName: "request" }] : []));
|
|
462
|
-
const rawResponse = linkedSignal(() => request()?.response() ?? null, ...(ngDevMode ? [{ debugName: "rawResponse" }] : []));
|
|
461
|
+
const request = signal(null, ...(ngDevMode ? [{ debugName: "request" }] : /* istanbul ignore next */ []));
|
|
462
|
+
const rawResponse = linkedSignal(() => request()?.response() ?? null, ...(ngDevMode ? [{ debugName: "rawResponse" }] : /* istanbul ignore next */ []));
|
|
463
463
|
const response = computed(() => {
|
|
464
464
|
const raw = rawResponse();
|
|
465
465
|
if (raw === null)
|
|
466
466
|
return null;
|
|
467
467
|
return options.transformResponse ? options.transformResponse(raw) : raw;
|
|
468
|
-
}, ...(ngDevMode ? [{ debugName: "response" }] : []));
|
|
469
|
-
const loading = linkedSignal(() => request()?.loading() ?? null, ...(ngDevMode ? [{ debugName: "loading" }] : []));
|
|
470
|
-
const error = linkedSignal(() => request()?.error() ?? null, ...(ngDevMode ? [{ debugName: "error" }] : []));
|
|
471
|
-
const latestHttpEvent = linkedSignal(() => request()?.currentEvent() ?? null, ...(ngDevMode ? [{ debugName: "latestHttpEvent" }] : []));
|
|
472
|
-
const args = signal(null, ...(ngDevMode ? [{ debugName: "args" }] : []));
|
|
473
|
-
const lastTimeExecutedAt = signal(null, ...(ngDevMode ? [{ debugName: "lastTimeExecutedAt" }] : []));
|
|
474
|
-
const lastTriggeredBy = signal(null, ...(ngDevMode ? [{ debugName: "lastTriggeredBy" }] : []));
|
|
468
|
+
}, ...(ngDevMode ? [{ debugName: "response" }] : /* istanbul ignore next */ []));
|
|
469
|
+
const loading = linkedSignal(() => request()?.loading() ?? null, ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
470
|
+
const error = linkedSignal(() => request()?.error() ?? null, ...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
|
|
471
|
+
const latestHttpEvent = linkedSignal(() => request()?.currentEvent() ?? null, ...(ngDevMode ? [{ debugName: "latestHttpEvent" }] : /* istanbul ignore next */ []));
|
|
472
|
+
const args = signal(null, ...(ngDevMode ? [{ debugName: "args" }] : /* istanbul ignore next */ []));
|
|
473
|
+
const lastTimeExecutedAt = signal(null, ...(ngDevMode ? [{ debugName: "lastTimeExecutedAt" }] : /* istanbul ignore next */ []));
|
|
474
|
+
const lastTriggeredBy = signal(null, ...(ngDevMode ? [{ debugName: "lastTriggeredBy" }] : /* istanbul ignore next */ []));
|
|
475
475
|
const executionState = computed(() => {
|
|
476
476
|
const currentResponse = response();
|
|
477
477
|
const currentError = error();
|
|
@@ -506,7 +506,7 @@ const setupQueryState = (options) => {
|
|
|
506
506
|
else {
|
|
507
507
|
return null;
|
|
508
508
|
}
|
|
509
|
-
}, ...(ngDevMode ? [{ debugName: "executionState" }] : []));
|
|
509
|
+
}, ...(ngDevMode ? [{ debugName: "executionState" }] : /* istanbul ignore next */ []));
|
|
510
510
|
const state = {
|
|
511
511
|
rawResponse,
|
|
512
512
|
response,
|
|
@@ -530,7 +530,7 @@ const createQuerySnapshotFn = (options) => {
|
|
|
530
530
|
const context = injectQueryContext();
|
|
531
531
|
const snapshotFn = () => {
|
|
532
532
|
const snapshotState = setupQueryState({});
|
|
533
|
-
const isAlive = signal(true, ...(ngDevMode ? [{ debugName: "isAlive" }] : []));
|
|
533
|
+
const isAlive = signal(true, ...(ngDevMode ? [{ debugName: "isAlive" }] : /* istanbul ignore next */ []));
|
|
534
534
|
const killEffectRef = effect(() => {
|
|
535
535
|
const currentLoading = state.loading();
|
|
536
536
|
const currentError = state.error();
|
|
@@ -555,7 +555,7 @@ const createQuerySnapshotFn = (options) => {
|
|
|
555
555
|
killEffectRef.destroy();
|
|
556
556
|
isAlive.set(false);
|
|
557
557
|
});
|
|
558
|
-
}, { ...(ngDevMode ? { debugName: "killEffectRef" } : {}), injector: context.deps.injector });
|
|
558
|
+
}, { ...(ngDevMode ? { debugName: "killEffectRef" } : /* istanbul ignore next */ {}), injector: context.deps.injector });
|
|
559
559
|
const snapshot = {
|
|
560
560
|
args: wrapAsObservableSignal(snapshotState.args.asReadonly(), context.deps.injector),
|
|
561
561
|
response: wrapAsObservableSignal(snapshotState.response, context.deps.injector),
|
|
@@ -1538,18 +1538,18 @@ const SPEED_BUFFER_TIME_IN_MS = 2000;
|
|
|
1538
1538
|
const createHttpRequest = (options) => {
|
|
1539
1539
|
let currentStreamSubscription = Subscription.EMPTY;
|
|
1540
1540
|
const { args, clientOptions, dependencies } = options;
|
|
1541
|
-
const currentEvent = signal(null, ...(ngDevMode ? [{ debugName: "currentEvent" }] : []));
|
|
1542
|
-
const loading = signal(null, ...(ngDevMode ? [{ debugName: "loading" }] : []));
|
|
1543
|
-
const error = signal(null, ...(ngDevMode ? [{ debugName: "error" }] : []));
|
|
1544
|
-
const response = signal(null, ...(ngDevMode ? [{ debugName: "response" }] : []));
|
|
1545
|
-
const lastLoadEventTime = signal(0, ...(ngDevMode ? [{ debugName: "lastLoadEventTime" }] : []));
|
|
1546
|
-
const lastLoadEventAmount = signal(0, ...(ngDevMode ? [{ debugName: "lastLoadEventAmount" }] : []));
|
|
1547
|
-
const lastExecuteTime = signal(0, ...(ngDevMode ? [{ debugName: "lastExecuteTime" }] : []));
|
|
1548
|
-
const expiresIn = signal(null, ...(ngDevMode ? [{ debugName: "expiresIn" }] : []));
|
|
1541
|
+
const currentEvent = signal(null, ...(ngDevMode ? [{ debugName: "currentEvent" }] : /* istanbul ignore next */ []));
|
|
1542
|
+
const loading = signal(null, ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
1543
|
+
const error = signal(null, ...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
|
|
1544
|
+
const response = signal(null, ...(ngDevMode ? [{ debugName: "response" }] : /* istanbul ignore next */ []));
|
|
1545
|
+
const lastLoadEventTime = signal(0, ...(ngDevMode ? [{ debugName: "lastLoadEventTime" }] : /* istanbul ignore next */ []));
|
|
1546
|
+
const lastLoadEventAmount = signal(0, ...(ngDevMode ? [{ debugName: "lastLoadEventAmount" }] : /* istanbul ignore next */ []));
|
|
1547
|
+
const lastExecuteTime = signal(0, ...(ngDevMode ? [{ debugName: "lastExecuteTime" }] : /* istanbul ignore next */ []));
|
|
1548
|
+
const expiresIn = signal(null, ...(ngDevMode ? [{ debugName: "expiresIn" }] : /* istanbul ignore next */ []));
|
|
1549
1549
|
const isStale = computed(() => {
|
|
1550
1550
|
const expiresInTs = expiresIn();
|
|
1551
1551
|
return expiresInTs === null || expiresInTs < Date.now();
|
|
1552
|
-
}, ...(ngDevMode ? [{ debugName: "isStale" }] : []));
|
|
1552
|
+
}, ...(ngDevMode ? [{ debugName: "isStale" }] : /* istanbul ignore next */ []));
|
|
1553
1553
|
const createStream = () => {
|
|
1554
1554
|
const headers = typeof args?.headers === 'function' ? args.headers() : args?.headers;
|
|
1555
1555
|
return dependencies.httpClient
|
|
@@ -1696,9 +1696,9 @@ const createQueryStack = (options) => {
|
|
|
1696
1696
|
return { queries, lastQuery };
|
|
1697
1697
|
}, transform, argsKeyFn, deduplicateArgs, maxQueries = Infinity, removeStrategy = 'oldest', } = options ?? {};
|
|
1698
1698
|
const injector = inject(Injector);
|
|
1699
|
-
const queries = signal([], ...(ngDevMode ? [{ debugName: "queries" }] : []));
|
|
1700
|
-
const lastQuery = signal(null, ...(ngDevMode ? [{ debugName: "lastQuery" }] : []));
|
|
1701
|
-
const firstQuery = computed(() => queries()[0] ?? null, ...(ngDevMode ? [{ debugName: "firstQuery" }] : []));
|
|
1699
|
+
const queries = signal([], ...(ngDevMode ? [{ debugName: "queries" }] : /* istanbul ignore next */ []));
|
|
1700
|
+
const lastQuery = signal(null, ...(ngDevMode ? [{ debugName: "lastQuery" }] : /* istanbul ignore next */ []));
|
|
1701
|
+
const firstQuery = computed(() => queries()[0] ?? null, ...(ngDevMode ? [{ debugName: "firstQuery" }] : /* istanbul ignore next */ []));
|
|
1702
1702
|
const hasWithArgsFeature = features.some((f) => f.type == QueryFeatureType.WITH_ARGS);
|
|
1703
1703
|
const hasWithOptimisticUpdateFeature = features.some((f) => f.type == QueryFeatureType.WITH_RESPONSE_UPDATE);
|
|
1704
1704
|
if (hasWithArgsFeature) {
|
|
@@ -1780,23 +1780,23 @@ const createQueryStack = (options) => {
|
|
|
1780
1780
|
untracked(() => clear());
|
|
1781
1781
|
});
|
|
1782
1782
|
effect(() => runWithArgs(args(dependencies?.())));
|
|
1783
|
-
const anyLoading = computed(() => queries().some((q) => q.loading()), ...(ngDevMode ? [{ debugName: "anyLoading" }] : []));
|
|
1784
|
-
const loadingCount = computed(() => queries().filter((q) => q.loading()).length, ...(ngDevMode ? [{ debugName: "loadingCount" }] : []));
|
|
1783
|
+
const anyLoading = computed(() => queries().some((q) => q.loading()), ...(ngDevMode ? [{ debugName: "anyLoading" }] : /* istanbul ignore next */ []));
|
|
1784
|
+
const loadingCount = computed(() => queries().filter((q) => q.loading()).length, ...(ngDevMode ? [{ debugName: "loadingCount" }] : /* istanbul ignore next */ []));
|
|
1785
1785
|
const allLoading = computed(() => {
|
|
1786
1786
|
const qs = queries();
|
|
1787
1787
|
return qs.length > 0 && qs.every((q) => q.loading());
|
|
1788
|
-
}, ...(ngDevMode ? [{ debugName: "allLoading" }] : []));
|
|
1788
|
+
}, ...(ngDevMode ? [{ debugName: "allLoading" }] : /* istanbul ignore next */ []));
|
|
1789
1789
|
const loadingProgress = computed(() => {
|
|
1790
1790
|
const total = queries().length;
|
|
1791
1791
|
const loaded = queries().filter((q) => !q.loading()).length;
|
|
1792
1792
|
return { loaded, total };
|
|
1793
|
-
}, ...(ngDevMode ? [{ debugName: "loadingProgress" }] : []));
|
|
1793
|
+
}, ...(ngDevMode ? [{ debugName: "loadingProgress" }] : /* istanbul ignore next */ []));
|
|
1794
1794
|
const anyError = computed(() => queries()
|
|
1795
1795
|
.map((q) => q.error())
|
|
1796
|
-
.find((e) => e !== null) ?? null, ...(ngDevMode ? [{ debugName: "anyError" }] : []));
|
|
1796
|
+
.find((e) => e !== null) ?? null, ...(ngDevMode ? [{ debugName: "anyError" }] : /* istanbul ignore next */ []));
|
|
1797
1797
|
const errors = computed(() => queries()
|
|
1798
1798
|
.map((q) => q.error())
|
|
1799
|
-
.filter((e) => e !== null), ...(ngDevMode ? [{ debugName: "errors" }] : []));
|
|
1799
|
+
.filter((e) => e !== null), ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
1800
1800
|
const response = computed(() => {
|
|
1801
1801
|
const responses = queries().map((q) => q.response());
|
|
1802
1802
|
return transform?.(responses) ?? responses;
|
|
@@ -1891,12 +1891,12 @@ const fakePaginationAdapter = (totalHits = 10) => {
|
|
|
1891
1891
|
};
|
|
1892
1892
|
const createPagedQueryStack = (options) => {
|
|
1893
1893
|
const { responseNormalizer, queryCreator, features } = options;
|
|
1894
|
-
const currentPageArgs = signal(null, ...(ngDevMode ? [{ debugName: "currentPageArgs" }] : []));
|
|
1895
|
-
const initialPage = signal(options.initialPage ?? 1, ...(ngDevMode ? [{ debugName: "initialPage" }] : []));
|
|
1896
|
-
const loadedMinPage = signal(initialPage(), ...(ngDevMode ? [{ debugName: "loadedMinPage" }] : []));
|
|
1897
|
-
const loadedMaxPage = signal(initialPage(), ...(ngDevMode ? [{ debugName: "loadedMaxPage" }] : []));
|
|
1898
|
-
const lastResetTimestamp = signal(Date.now(), ...(ngDevMode ? [{ debugName: "lastResetTimestamp" }] : []));
|
|
1899
|
-
const pageDirection = signal('next', ...(ngDevMode ? [{ debugName: "pageDirection" }] : []));
|
|
1894
|
+
const currentPageArgs = signal(null, ...(ngDevMode ? [{ debugName: "currentPageArgs" }] : /* istanbul ignore next */ []));
|
|
1895
|
+
const initialPage = signal(options.initialPage ?? 1, ...(ngDevMode ? [{ debugName: "initialPage" }] : /* istanbul ignore next */ []));
|
|
1896
|
+
const loadedMinPage = signal(initialPage(), ...(ngDevMode ? [{ debugName: "loadedMinPage" }] : /* istanbul ignore next */ []));
|
|
1897
|
+
const loadedMaxPage = signal(initialPage(), ...(ngDevMode ? [{ debugName: "loadedMaxPage" }] : /* istanbul ignore next */ []));
|
|
1898
|
+
const lastResetTimestamp = signal(Date.now(), ...(ngDevMode ? [{ debugName: "lastResetTimestamp" }] : /* istanbul ignore next */ []));
|
|
1899
|
+
const pageDirection = signal('next', ...(ngDevMode ? [{ debugName: "pageDirection" }] : /* istanbul ignore next */ []));
|
|
1900
1900
|
const stack = createQueryStack({
|
|
1901
1901
|
args: () => null,
|
|
1902
1902
|
queryCreator,
|
|
@@ -1935,22 +1935,22 @@ const createPagedQueryStack = (options) => {
|
|
|
1935
1935
|
if (!res)
|
|
1936
1936
|
return null;
|
|
1937
1937
|
return responseNormalizer(res, all);
|
|
1938
|
-
}, ...(ngDevMode ? [{ debugName: "maxPagination" }] : []));
|
|
1938
|
+
}, ...(ngDevMode ? [{ debugName: "maxPagination" }] : /* istanbul ignore next */ []));
|
|
1939
1939
|
const minPagination = computed(() => {
|
|
1940
1940
|
const res = stack.firstQuery()?.response();
|
|
1941
1941
|
const all = stack.response();
|
|
1942
1942
|
if (!res)
|
|
1943
1943
|
return null;
|
|
1944
1944
|
return responseNormalizer(res, all);
|
|
1945
|
-
}, ...(ngDevMode ? [{ debugName: "minPagination" }] : []));
|
|
1945
|
+
}, ...(ngDevMode ? [{ debugName: "minPagination" }] : /* istanbul ignore next */ []));
|
|
1946
1946
|
const isFirstPageLoaded = computed(() => {
|
|
1947
1947
|
const min = minPagination();
|
|
1948
1948
|
return min ? loadedMinPage() === min.currentPage : false;
|
|
1949
|
-
}, ...(ngDevMode ? [{ debugName: "isFirstPageLoaded" }] : []));
|
|
1949
|
+
}, ...(ngDevMode ? [{ debugName: "isFirstPageLoaded" }] : /* istanbul ignore next */ []));
|
|
1950
1950
|
const isLastPageLoaded = computed(() => {
|
|
1951
1951
|
const max = maxPagination();
|
|
1952
1952
|
return max ? loadedMaxPage() === max.totalPages : false;
|
|
1953
|
-
}, ...(ngDevMode ? [{ debugName: "isLastPageLoaded" }] : []));
|
|
1953
|
+
}, ...(ngDevMode ? [{ debugName: "isLastPageLoaded" }] : /* istanbul ignore next */ []));
|
|
1954
1954
|
const fetchPreviousPage = () => {
|
|
1955
1955
|
const page = loadedMinPage() - 1;
|
|
1956
1956
|
const allResponses = stack.response();
|
|
@@ -2026,18 +2026,18 @@ const createPagedQueryStack = (options) => {
|
|
|
2026
2026
|
if (!currentMinPagination)
|
|
2027
2027
|
return false;
|
|
2028
2028
|
return loadedMinPage() > 1;
|
|
2029
|
-
}, ...(ngDevMode ? [{ debugName: "canFetchPreviousPage" }] : []));
|
|
2029
|
+
}, ...(ngDevMode ? [{ debugName: "canFetchPreviousPage" }] : /* istanbul ignore next */ []));
|
|
2030
2030
|
const canFetchNextPage = computed(() => {
|
|
2031
2031
|
const currentMaxPagination = maxPagination();
|
|
2032
2032
|
return currentMaxPagination ? loadedMaxPage() < currentMaxPagination.totalPages : false;
|
|
2033
|
-
}, ...(ngDevMode ? [{ debugName: "canFetchNextPage" }] : []));
|
|
2033
|
+
}, ...(ngDevMode ? [{ debugName: "canFetchNextPage" }] : /* istanbul ignore next */ []));
|
|
2034
2034
|
const items = computed(() => {
|
|
2035
2035
|
const res = stack.response();
|
|
2036
2036
|
return res.map((r) => responseNormalizer(r, res).items).flat();
|
|
2037
|
-
}, ...(ngDevMode ? [{ debugName: "items" }] : []));
|
|
2037
|
+
}, ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
2038
2038
|
const isFirstLoad = computed(() => {
|
|
2039
2039
|
return stack.queries().length === 1 && !!stack.lastQuery()?.loading();
|
|
2040
|
-
}, ...(ngDevMode ? [{ debugName: "isFirstLoad" }] : []));
|
|
2040
|
+
}, ...(ngDevMode ? [{ debugName: "isFirstLoad" }] : /* istanbul ignore next */ []));
|
|
2041
2041
|
const execute = (options) => {
|
|
2042
2042
|
const whereFn = options?.where;
|
|
2043
2043
|
if (whereFn) {
|
|
@@ -2210,7 +2210,7 @@ function effectComputed(computation, injector) {
|
|
|
2210
2210
|
// Ignore errors in the initial computation
|
|
2211
2211
|
// Angular might throw an error if required inputs are read but not available yet
|
|
2212
2212
|
}
|
|
2213
|
-
const lastResult = signal(initialData, ...(ngDevMode ? [{ debugName: "lastResult" }] : []));
|
|
2213
|
+
const lastResult = signal(initialData, ...(ngDevMode ? [{ debugName: "lastResult" }] : /* istanbul ignore next */ []));
|
|
2214
2214
|
effect(() => {
|
|
2215
2215
|
const data = runInInjectionContext(injector, () => computation());
|
|
2216
2216
|
untracked(() => {
|
|
@@ -2261,7 +2261,7 @@ function queryStateSignal(source, options) {
|
|
|
2261
2261
|
})), {
|
|
2262
2262
|
initialValue: null,
|
|
2263
2263
|
});
|
|
2264
|
-
const rwSignal = linkedSignal(roSignal, ...(ngDevMode ? [{ debugName: "rwSignal" }] : []));
|
|
2264
|
+
const rwSignal = linkedSignal(roSignal, ...(ngDevMode ? [{ debugName: "rwSignal" }] : /* istanbul ignore next */ []));
|
|
2265
2265
|
return rwSignal;
|
|
2266
2266
|
}
|
|
2267
2267
|
function queryStateResponseSignal(source, options) {
|
|
@@ -2269,7 +2269,7 @@ function queryStateResponseSignal(source, options) {
|
|
|
2269
2269
|
const dataSignal = computed(() => {
|
|
2270
2270
|
const state = s();
|
|
2271
2271
|
return isQueryStateSuccess(state) ? state.response : null;
|
|
2272
|
-
}, ...(ngDevMode ? [{ debugName: "dataSignal" }] : []));
|
|
2272
|
+
}, ...(ngDevMode ? [{ debugName: "dataSignal" }] : /* istanbul ignore next */ []));
|
|
2273
2273
|
dataSignal['reset'] = () => {
|
|
2274
2274
|
s.set(null);
|
|
2275
2275
|
};
|
|
@@ -2352,7 +2352,7 @@ class V2QueryCreator {
|
|
|
2352
2352
|
};
|
|
2353
2353
|
this.createSignal = (initialValue, config) => {
|
|
2354
2354
|
assertInInjectionContext(this.createSignal);
|
|
2355
|
-
const _signal = signal(initialValue ?? null, ...(ngDevMode ? [{ debugName: "_signal" }] : []));
|
|
2355
|
+
const _signal = signal(initialValue ?? null, ...(ngDevMode ? [{ debugName: "_signal" }] : /* istanbul ignore next */ []));
|
|
2356
2356
|
addQueryContainerHandling(toObservable(_signal), () => _signal(), config);
|
|
2357
2357
|
return _signal;
|
|
2358
2358
|
};
|
|
@@ -2959,7 +2959,7 @@ class LegacyQuery {
|
|
|
2959
2959
|
});
|
|
2960
2960
|
}
|
|
2961
2961
|
});
|
|
2962
|
-
}, ...(ngDevMode ? [{ debugName: "storeSyncEffect" }] : []));
|
|
2962
|
+
}, ...(ngDevMode ? [{ debugName: "storeSyncEffect" }] : /* istanbul ignore next */ []));
|
|
2963
2963
|
/**
|
|
2964
2964
|
* @internal
|
|
2965
2965
|
*/
|
|
@@ -3112,7 +3112,7 @@ class LegacyQueryCreator {
|
|
|
3112
3112
|
legacyQuery.destroy();
|
|
3113
3113
|
destroyEffect.destroy();
|
|
3114
3114
|
}
|
|
3115
|
-
}, ...(ngDevMode ? [{ debugName: "destroyEffect" }] : []));
|
|
3115
|
+
}, ...(ngDevMode ? [{ debugName: "destroyEffect" }] : /* istanbul ignore next */ []));
|
|
3116
3116
|
}
|
|
3117
3117
|
return legacyQuery;
|
|
3118
3118
|
});
|
|
@@ -3124,7 +3124,7 @@ class LegacyQueryCreator {
|
|
|
3124
3124
|
return subject;
|
|
3125
3125
|
};
|
|
3126
3126
|
this.createSignal = (initialValue, config) => {
|
|
3127
|
-
const _signal = signal(initialValue ?? null, ...(ngDevMode ? [{ debugName: "_signal" }] : []));
|
|
3127
|
+
const _signal = signal(initialValue ?? null, ...(ngDevMode ? [{ debugName: "_signal" }] : /* istanbul ignore next */ []));
|
|
3128
3128
|
addQueryContainerHandling(toObservable(_signal), () => _signal(), config);
|
|
3129
3129
|
return _signal;
|
|
3130
3130
|
};
|
|
@@ -3271,7 +3271,7 @@ const createQueryCollectionSubject = (queryMap, config) => {
|
|
|
3271
3271
|
};
|
|
3272
3272
|
const createQueryCollectionSignal = (queryMap, config) => {
|
|
3273
3273
|
assertInInjectionContext(createQueryCollectionSignal);
|
|
3274
|
-
const _signal = signal(null, ...(ngDevMode ? [{ debugName: "_signal" }] : []));
|
|
3274
|
+
const _signal = signal(null, ...(ngDevMode ? [{ debugName: "_signal" }] : /* istanbul ignore next */ []));
|
|
3275
3275
|
addQueryContainerHandling(toObservable(_signal).pipe(map((s) => s?.query ?? null)), () => _signal()?.query ?? null, config);
|
|
3276
3276
|
return _signal;
|
|
3277
3277
|
};
|
|
@@ -4005,7 +4005,7 @@ class V2BearerAuthProvider {
|
|
|
4005
4005
|
}
|
|
4006
4006
|
|
|
4007
4007
|
const [provideInfinityQueryResponseDelay, injectInfinityQueryResponseDelay] = createProvider(() => {
|
|
4008
|
-
const enabled = signal(false, ...(ngDevMode ? [{ debugName: "enabled" }] : []));
|
|
4008
|
+
const enabled = signal(false, ...(ngDevMode ? [{ debugName: "enabled" }] : /* istanbul ignore next */ []));
|
|
4009
4009
|
const enabled$ = toObservable(enabled);
|
|
4010
4010
|
return {
|
|
4011
4011
|
enabled,
|
|
@@ -4316,13 +4316,13 @@ class InfinityQueryDirective {
|
|
|
4316
4316
|
this._viewContext.currentQuery = null;
|
|
4317
4317
|
this._data$.next([]);
|
|
4318
4318
|
}
|
|
4319
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
4320
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.
|
|
4319
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: InfinityQueryDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4320
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.13", type: InfinityQueryDirective, isStandalone: true, selector: "[etInfinityQuery]", inputs: { infinityQuery: ["etInfinityQuery", "infinityQuery"] }, providers: [
|
|
4321
4321
|
{ provide: INFINITY_QUERY_TOKEN, useExisting: InfinityQueryDirective },
|
|
4322
4322
|
provideInfinityQueryResponseDelay(),
|
|
4323
4323
|
], exportAs: ["etInfinityQuery"], ngImport: i0 }); }
|
|
4324
4324
|
}
|
|
4325
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
4325
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: InfinityQueryDirective, decorators: [{
|
|
4326
4326
|
type: Directive,
|
|
4327
4327
|
args: [{
|
|
4328
4328
|
selector: '[etInfinityQuery]',
|
|
@@ -4344,10 +4344,10 @@ class InfinityQueryTriggerDirective {
|
|
|
4344
4344
|
this._destroy = new Subject();
|
|
4345
4345
|
this._observer = null;
|
|
4346
4346
|
this.click$ = fromEvent(this._elementRef.nativeElement, 'click');
|
|
4347
|
-
this.scrollContainerSelector = input(null, ...(ngDevMode ? [{ debugName: "scrollContainerSelector" }] : []));
|
|
4347
|
+
this.scrollContainerSelector = input(null, ...(ngDevMode ? [{ debugName: "scrollContainerSelector" }] : /* istanbul ignore next */ []));
|
|
4348
4348
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4349
|
-
this.infinityQueryOverride = input(null, ...(ngDevMode ? [{ debugName: "infinityQueryOverride" }] : []));
|
|
4350
|
-
this.infinityQuery = computed(() => this.infinityQueryOverride() ?? this._infinityQuery, ...(ngDevMode ? [{ debugName: "infinityQuery" }] : []));
|
|
4349
|
+
this.infinityQueryOverride = input(null, ...(ngDevMode ? [{ debugName: "infinityQueryOverride" }] : /* istanbul ignore next */ []));
|
|
4350
|
+
this.infinityQuery = computed(() => this.infinityQueryOverride() ?? this._infinityQuery, ...(ngDevMode ? [{ debugName: "infinityQuery" }] : /* istanbul ignore next */ []));
|
|
4351
4351
|
}
|
|
4352
4352
|
ngOnInit() {
|
|
4353
4353
|
const isInteractive = this._elementRef.nativeElement.tagName === 'BUTTON';
|
|
@@ -4379,10 +4379,10 @@ class InfinityQueryTriggerDirective {
|
|
|
4379
4379
|
});
|
|
4380
4380
|
this._observer.observe(this._elementRef.nativeElement);
|
|
4381
4381
|
}
|
|
4382
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
4383
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.
|
|
4382
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: InfinityQueryTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4383
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.13", type: InfinityQueryTriggerDirective, isStandalone: true, selector: "[etInfinityQueryTrigger], et-infinity-query-trigger", inputs: { scrollContainerSelector: { classPropertyName: "scrollContainerSelector", publicName: "scrollContainerSelector", isSignal: true, isRequired: false, transformFunction: null }, infinityQueryOverride: { classPropertyName: "infinityQueryOverride", publicName: "infinityQueryOverride", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
|
4384
4384
|
}
|
|
4385
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
4385
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: InfinityQueryTriggerDirective, decorators: [{
|
|
4386
4386
|
type: Directive,
|
|
4387
4387
|
args: [{
|
|
4388
4388
|
selector: '[etInfinityQueryTrigger], et-infinity-query-trigger',
|
|
@@ -4406,8 +4406,8 @@ class QueryDirective {
|
|
|
4406
4406
|
scope: null,
|
|
4407
4407
|
query: null,
|
|
4408
4408
|
};
|
|
4409
|
-
this.query = input.required({ ...(ngDevMode ? { debugName: "query" } : {}), alias: 'etQuery' });
|
|
4410
|
-
this.cache = input(false, { ...(ngDevMode ? { debugName: "cache" } : {}), alias: 'etQueryCache' });
|
|
4409
|
+
this.query = input.required({ ...(ngDevMode ? { debugName: "query" } : /* istanbul ignore next */ {}), alias: 'etQuery' });
|
|
4410
|
+
this.cache = input(false, { ...(ngDevMode ? { debugName: "cache" } : /* istanbul ignore next */ {}), alias: 'etQueryCache' });
|
|
4411
4411
|
this.queryState = queryStateSignal(this.query);
|
|
4412
4412
|
inject(ViewContainerRef).createEmbeddedView(inject(TemplateRef), this._viewContext);
|
|
4413
4413
|
effect(() => {
|
|
@@ -4468,10 +4468,10 @@ class QueryDirective {
|
|
|
4468
4468
|
});
|
|
4469
4469
|
});
|
|
4470
4470
|
}
|
|
4471
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
4472
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.
|
|
4471
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: QueryDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4472
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.13", type: QueryDirective, isStandalone: true, selector: "[etQuery]", inputs: { query: { classPropertyName: "query", publicName: "etQuery", isSignal: true, isRequired: true, transformFunction: null }, cache: { classPropertyName: "cache", publicName: "etQueryCache", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
|
4473
4473
|
}
|
|
4474
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
4474
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: QueryDirective, decorators: [{
|
|
4475
4475
|
type: Directive,
|
|
4476
4476
|
args: [{
|
|
4477
4477
|
selector: '[etQuery]',
|
|
@@ -4492,10 +4492,10 @@ class QueryShortNamePipe {
|
|
|
4492
4492
|
}
|
|
4493
4493
|
return route;
|
|
4494
4494
|
}
|
|
4495
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
4496
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.
|
|
4495
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: QueryShortNamePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
4496
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.13", ngImport: i0, type: QueryShortNamePipe, isStandalone: true, name: "queryShortName" }); }
|
|
4497
4497
|
}
|
|
4498
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
4498
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: QueryShortNamePipe, decorators: [{
|
|
4499
4499
|
type: Pipe,
|
|
4500
4500
|
args: [{ name: 'queryShortName' }]
|
|
4501
4501
|
}] });
|
|
@@ -4517,19 +4517,19 @@ class QueryDevtoolsComponent {
|
|
|
4517
4517
|
this._cdr = inject(ChangeDetectorRef);
|
|
4518
4518
|
this._destroy$ = createDestroy();
|
|
4519
4519
|
this.queryClientConfigs = inject(QUERY_CLIENT_DEVTOOLS_TOKEN);
|
|
4520
|
-
this.isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
|
|
4521
|
-
this.isTranslucent = signal(false, ...(ngDevMode ? [{ debugName: "isTranslucent" }] : []));
|
|
4522
|
-
this.snapLayout = signal('full', ...(ngDevMode ? [{ debugName: "snapLayout" }] : []));
|
|
4523
|
-
this.queryListMode = signal('live', ...(ngDevMode ? [{ debugName: "queryListMode" }] : []));
|
|
4524
|
-
this.viewMode = signal('query', ...(ngDevMode ? [{ debugName: "viewMode" }] : []));
|
|
4525
|
-
this.showResponse = signal(false, ...(ngDevMode ? [{ debugName: "showResponse" }] : []));
|
|
4526
|
-
this.showRawResponse = signal(false, ...(ngDevMode ? [{ debugName: "showRawResponse" }] : []));
|
|
4527
|
-
this.showQueryConfig = signal(false, ...(ngDevMode ? [{ debugName: "showQueryConfig" }] : []));
|
|
4528
|
-
this.showEntityStoreValue = signal(false, ...(ngDevMode ? [{ debugName: "showEntityStoreValue" }] : []));
|
|
4529
|
-
this.showArguments = signal(false, ...(ngDevMode ? [{ debugName: "showArguments" }] : []));
|
|
4520
|
+
this.isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
|
|
4521
|
+
this.isTranslucent = signal(false, ...(ngDevMode ? [{ debugName: "isTranslucent" }] : /* istanbul ignore next */ []));
|
|
4522
|
+
this.snapLayout = signal('full', ...(ngDevMode ? [{ debugName: "snapLayout" }] : /* istanbul ignore next */ []));
|
|
4523
|
+
this.queryListMode = signal('live', ...(ngDevMode ? [{ debugName: "queryListMode" }] : /* istanbul ignore next */ []));
|
|
4524
|
+
this.viewMode = signal('query', ...(ngDevMode ? [{ debugName: "viewMode" }] : /* istanbul ignore next */ []));
|
|
4525
|
+
this.showResponse = signal(false, ...(ngDevMode ? [{ debugName: "showResponse" }] : /* istanbul ignore next */ []));
|
|
4526
|
+
this.showRawResponse = signal(false, ...(ngDevMode ? [{ debugName: "showRawResponse" }] : /* istanbul ignore next */ []));
|
|
4527
|
+
this.showQueryConfig = signal(false, ...(ngDevMode ? [{ debugName: "showQueryConfig" }] : /* istanbul ignore next */ []));
|
|
4528
|
+
this.showEntityStoreValue = signal(false, ...(ngDevMode ? [{ debugName: "showEntityStoreValue" }] : /* istanbul ignore next */ []));
|
|
4529
|
+
this.showArguments = signal(false, ...(ngDevMode ? [{ debugName: "showArguments" }] : /* istanbul ignore next */ []));
|
|
4530
4530
|
this.selectedClientIdCtrl = new FormControl(0);
|
|
4531
4531
|
this.selectedClientId = toSignal(this.selectedClientIdCtrl.valueChanges.pipe(startWith(this.selectedClientIdCtrl.value)));
|
|
4532
|
-
this.selectedQueryId = signal(null, ...(ngDevMode ? [{ debugName: "selectedQueryId" }] : []));
|
|
4532
|
+
this.selectedQueryId = signal(null, ...(ngDevMode ? [{ debugName: "selectedQueryId" }] : /* istanbul ignore next */ []));
|
|
4533
4533
|
this.selectedClientConfig = computed(() => {
|
|
4534
4534
|
if (this.queryClientConfigs.length === 1) {
|
|
4535
4535
|
return this.queryClientConfigs[0];
|
|
@@ -4540,11 +4540,11 @@ class QueryDevtoolsComponent {
|
|
|
4540
4540
|
return this.queryClientConfigs[0];
|
|
4541
4541
|
}
|
|
4542
4542
|
return cfg;
|
|
4543
|
-
}, ...(ngDevMode ? [{ debugName: "selectedClientConfig" }] : []));
|
|
4543
|
+
}, ...(ngDevMode ? [{ debugName: "selectedClientConfig" }] : /* istanbul ignore next */ []));
|
|
4544
4544
|
this.queryStore = computed(() => {
|
|
4545
4545
|
const config = this.selectedClientConfig();
|
|
4546
4546
|
return config.client._store;
|
|
4547
|
-
}, ...(ngDevMode ? [{ debugName: "queryStore" }] : []));
|
|
4547
|
+
}, ...(ngDevMode ? [{ debugName: "queryStore" }] : /* istanbul ignore next */ []));
|
|
4548
4548
|
this.queryStore$ = toObservable(this.queryStore);
|
|
4549
4549
|
this._queries$ = new BehaviorSubject([]);
|
|
4550
4550
|
this.queries = toSignal(this._queries$);
|
|
@@ -4558,14 +4558,14 @@ class QueryDevtoolsComponent {
|
|
|
4558
4558
|
return this.queries()?.find((q) => q._id === id) ?? null;
|
|
4559
4559
|
}
|
|
4560
4560
|
return this.queryHistory$.getValue()?.find((q) => q._id === id) ?? null;
|
|
4561
|
-
}, ...(ngDevMode ? [{ debugName: "selectedQuery" }] : []));
|
|
4561
|
+
}, ...(ngDevMode ? [{ debugName: "selectedQuery" }] : /* istanbul ignore next */ []));
|
|
4562
4562
|
this.selectedQuery$ = toObservable(this.selectedQuery);
|
|
4563
4563
|
this.selectedQueryEntityStore = computed(() => {
|
|
4564
4564
|
const query = this.selectedQuery();
|
|
4565
4565
|
if (!query)
|
|
4566
4566
|
return null;
|
|
4567
4567
|
return query.store;
|
|
4568
|
-
}, ...(ngDevMode ? [{ debugName: "selectedQueryEntityStore" }] : []));
|
|
4568
|
+
}, ...(ngDevMode ? [{ debugName: "selectedQueryEntityStore" }] : /* istanbul ignore next */ []));
|
|
4569
4569
|
this.selectedQueryEntityStore$ = toObservable(this.selectedQueryEntityStore);
|
|
4570
4570
|
this.selectedQueryEntityStoreValue$ = this.selectedQueryEntityStore$.pipe(switchMap((s) => s?._change$.pipe(startWith(''), map(() => {
|
|
4571
4571
|
if (!s._dictionary)
|
|
@@ -4603,7 +4603,7 @@ class QueryDevtoolsComponent {
|
|
|
4603
4603
|
return {
|
|
4604
4604
|
...sharedCfg,
|
|
4605
4605
|
};
|
|
4606
|
-
}, ...(ngDevMode ? [{ debugName: "stringifiedQueryConfig" }] : []));
|
|
4606
|
+
}, ...(ngDevMode ? [{ debugName: "stringifiedQueryConfig" }] : /* istanbul ignore next */ []));
|
|
4607
4607
|
this.authProvider = toSignal(toObservable(this.selectedClientConfig).pipe(switchMap((c) => c.client.authProvider$)));
|
|
4608
4608
|
this.authProviderDetails = computed(() => {
|
|
4609
4609
|
const provider = this.authProvider();
|
|
@@ -4665,7 +4665,7 @@ class QueryDevtoolsComponent {
|
|
|
4665
4665
|
config: {},
|
|
4666
4666
|
};
|
|
4667
4667
|
}
|
|
4668
|
-
}, ...(ngDevMode ? [{ debugName: "authProviderDetails" }] : []));
|
|
4668
|
+
}, ...(ngDevMode ? [{ debugName: "authProviderDetails" }] : /* istanbul ignore next */ []));
|
|
4669
4669
|
this.trackByClient = (_, { client }) => client.config.baseRoute;
|
|
4670
4670
|
this.trackByQuery = (_, { _id }) => _id;
|
|
4671
4671
|
this.selectedClientIdCtrl.valueChanges
|
|
@@ -4786,10 +4786,10 @@ class QueryDevtoolsComponent {
|
|
|
4786
4786
|
clearQueryHistory() {
|
|
4787
4787
|
this.queryHistory$.next([]);
|
|
4788
4788
|
}
|
|
4789
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
4790
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.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: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: QueryDirective, selector: "[etQuery]", inputs: ["etQuery", "etQueryCache"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: JsonPipe, name: "json" }, { kind: "pipe", type: QueryShortNamePipe, name: "queryShortName" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.ShadowDom }); }
|
|
4789
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: QueryDevtoolsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4790
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.13", 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: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: QueryDirective, selector: "[etQuery]", inputs: ["etQuery", "etQueryCache"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: JsonPipe, name: "json" }, { kind: "pipe", type: QueryShortNamePipe, name: "queryShortName" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.ShadowDom }); }
|
|
4791
4791
|
}
|
|
4792
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
4792
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: QueryDevtoolsComponent, decorators: [{
|
|
4793
4793
|
type: Component,
|
|
4794
4794
|
args: [{ selector: 'et-query-devtools', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.ShadowDom, host: {
|
|
4795
4795
|
class: 'et-query-devtools',
|
|
@@ -5164,8 +5164,8 @@ const setupLeaderElection = () => {
|
|
|
5164
5164
|
const leaderTimeout = 3000;
|
|
5165
5165
|
const storageKey = 'ethlete-auth-leader-heartbeat';
|
|
5166
5166
|
const tabId = `tab-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
|
|
5167
|
-
const isLeader = signal(false, ...(ngDevMode ? [{ debugName: "isLeader" }] : []));
|
|
5168
|
-
const instanceCount = signal(1, ...(ngDevMode ? [{ debugName: "instanceCount" }] : []));
|
|
5167
|
+
const isLeader = signal(false, ...(ngDevMode ? [{ debugName: "isLeader" }] : /* istanbul ignore next */ []));
|
|
5168
|
+
const instanceCount = signal(1, ...(ngDevMode ? [{ debugName: "instanceCount" }] : /* istanbul ignore next */ []));
|
|
5169
5169
|
const knownTabs = new Map();
|
|
5170
5170
|
knownTabs.set(tabId, Date.now());
|
|
5171
5171
|
let channel = null;
|
|
@@ -5539,11 +5539,20 @@ const defaultExtractTokens = (response) => {
|
|
|
5539
5539
|
}
|
|
5540
5540
|
return { accessToken: response['accessToken'], refreshToken: response['refreshToken'] };
|
|
5541
5541
|
};
|
|
5542
|
-
const
|
|
5542
|
+
const deriveExecutionStateType = (builder, triggeredBy) => {
|
|
5543
|
+
if (triggeredBy === 'persistent-auth')
|
|
5544
|
+
return 'autoLogin';
|
|
5545
|
+
if (builder._type === 'tokenRefreshQuery')
|
|
5546
|
+
return 'tokenRefresh';
|
|
5547
|
+
if (triggeredBy === 'token-revocation')
|
|
5548
|
+
return 'revocation';
|
|
5549
|
+
return builder.key;
|
|
5550
|
+
};
|
|
5551
|
+
const setupBearerQueryRegistry = (builders, injector, latestExecutedQuery, latestNonInternalQuery, setTokens, executionState) => {
|
|
5543
5552
|
const queries = {};
|
|
5544
5553
|
const querySnapshots = new Map();
|
|
5545
5554
|
for (const builder of builders) {
|
|
5546
|
-
const querySnapshot = signal(null, ...(ngDevMode ? [{ debugName: "querySnapshot" }] : []));
|
|
5555
|
+
const querySnapshot = signal(null, ...(ngDevMode ? [{ debugName: "querySnapshot" }] : /* istanbul ignore next */ []));
|
|
5547
5556
|
querySnapshots.set(builder.key, querySnapshot);
|
|
5548
5557
|
const extractTokens = builder.config.extractTokens ?? defaultExtractTokens;
|
|
5549
5558
|
effect(() => {
|
|
@@ -5572,10 +5581,27 @@ const setupBearerQueryRegistry = (builders, injector, latestExecutedQuery, lates
|
|
|
5572
5581
|
});
|
|
5573
5582
|
query.execute({ args, options });
|
|
5574
5583
|
const snapshot = query.createSnapshot();
|
|
5575
|
-
|
|
5576
|
-
if (
|
|
5577
|
-
|
|
5584
|
+
const stateType = deriveExecutionStateType(builder, options?.triggeredBy);
|
|
5585
|
+
if (stateType !== 'revocation') {
|
|
5586
|
+
latestExecutedQuery.set({ key: builder.key, snapshot });
|
|
5587
|
+
if (!snapshot.triggeredBy()) {
|
|
5588
|
+
latestNonInternalQuery.set({ key: builder.key, snapshot });
|
|
5589
|
+
}
|
|
5578
5590
|
}
|
|
5591
|
+
executionState.set({ type: stateType, state: 'loading' });
|
|
5592
|
+
effect(() => {
|
|
5593
|
+
const response = snapshot.response();
|
|
5594
|
+
const loading = snapshot.loading();
|
|
5595
|
+
const error = snapshot.error();
|
|
5596
|
+
if (loading)
|
|
5597
|
+
return;
|
|
5598
|
+
if (error) {
|
|
5599
|
+
executionState.set({ type: stateType, state: 'error', error });
|
|
5600
|
+
}
|
|
5601
|
+
else if (response) {
|
|
5602
|
+
executionState.set({ type: stateType, state: 'success', response });
|
|
5603
|
+
}
|
|
5604
|
+
}, { injector });
|
|
5579
5605
|
querySnapshot.set(snapshot);
|
|
5580
5606
|
return snapshot;
|
|
5581
5607
|
};
|
|
@@ -5635,8 +5661,8 @@ const createBearerAuthProviderImpl = (config) => {
|
|
|
5635
5661
|
const injector = inject(Injector);
|
|
5636
5662
|
const destroyRef = inject(DestroyRef);
|
|
5637
5663
|
const queryClient = config.queryClientRef[1]();
|
|
5638
|
-
const accessToken = signal(null, ...(ngDevMode ? [{ debugName: "accessToken" }] : []));
|
|
5639
|
-
const refreshToken = signal(null, ...(ngDevMode ? [{ debugName: "refreshToken" }] : []));
|
|
5664
|
+
const accessToken = signal(null, ...(ngDevMode ? [{ debugName: "accessToken" }] : /* istanbul ignore next */ []));
|
|
5665
|
+
const refreshToken = signal(null, ...(ngDevMode ? [{ debugName: "refreshToken" }] : /* istanbul ignore next */ []));
|
|
5640
5666
|
const afterTokenRefresh$ = new Subject();
|
|
5641
5667
|
const bearerData = computed(() => {
|
|
5642
5668
|
const token = accessToken();
|
|
@@ -5651,22 +5677,24 @@ const createBearerAuthProviderImpl = (config) => {
|
|
|
5651
5677
|
}
|
|
5652
5678
|
return null;
|
|
5653
5679
|
}
|
|
5654
|
-
}, ...(ngDevMode ? [{ debugName: "bearerData" }] : []));
|
|
5655
|
-
const isAuthenticated = computed(() => !!accessToken(), ...(ngDevMode ? [{ debugName: "isAuthenticated" }] : []));
|
|
5656
|
-
const latestExecutedQuery = signal(null, ...(ngDevMode ? [{ debugName: "latestExecutedQuery" }] : []));
|
|
5657
|
-
const latestNonInternalQuery = signal(null, ...(ngDevMode ? [{ debugName: "latestNonInternalQuery" }] : []));
|
|
5680
|
+
}, ...(ngDevMode ? [{ debugName: "bearerData" }] : /* istanbul ignore next */ []));
|
|
5681
|
+
const isAuthenticated = computed(() => !!accessToken(), ...(ngDevMode ? [{ debugName: "isAuthenticated" }] : /* istanbul ignore next */ []));
|
|
5682
|
+
const latestExecutedQuery = signal(null, ...(ngDevMode ? [{ debugName: "latestExecutedQuery" }] : /* istanbul ignore next */ []));
|
|
5683
|
+
const latestNonInternalQuery = signal(null, ...(ngDevMode ? [{ debugName: "latestNonInternalQuery" }] : /* istanbul ignore next */ []));
|
|
5684
|
+
const executionState = signal(null, ...(ngDevMode ? [{ debugName: "executionState" }] : /* istanbul ignore next */ []));
|
|
5658
5685
|
const setTokens = (access, refresh) => {
|
|
5659
5686
|
accessToken.set(access);
|
|
5660
5687
|
refreshToken.set(refresh);
|
|
5661
5688
|
afterTokenRefresh$.next();
|
|
5662
5689
|
};
|
|
5663
|
-
const { queries } = setupBearerQueryRegistry(config.queries, injector, latestExecutedQuery, latestNonInternalQuery, setTokens);
|
|
5690
|
+
const { queries } = setupBearerQueryRegistry(config.queries, injector, latestExecutedQuery, latestNonInternalQuery, setTokens, executionState);
|
|
5664
5691
|
const logout = () => {
|
|
5665
5692
|
accessToken.set(null);
|
|
5666
5693
|
refreshToken.set(null);
|
|
5667
5694
|
queryClient.repository.unbindAllSecure();
|
|
5668
5695
|
latestExecutedQuery.set(null);
|
|
5669
5696
|
latestNonInternalQuery.set(null);
|
|
5697
|
+
executionState.set({ type: 'logout', state: 'success' });
|
|
5670
5698
|
};
|
|
5671
5699
|
const isLeader = createLeaderElection(config);
|
|
5672
5700
|
const querySetupContext = {
|
|
@@ -5694,6 +5722,7 @@ const createBearerAuthProviderImpl = (config) => {
|
|
|
5694
5722
|
leaderElection: isLeader.leaderElectionContext,
|
|
5695
5723
|
afterTokenRefresh$,
|
|
5696
5724
|
queries: queries,
|
|
5725
|
+
executionState,
|
|
5697
5726
|
};
|
|
5698
5727
|
const features = setupFeatures(config.features, featureSetupContext);
|
|
5699
5728
|
setupMultiTabSyncIfEnabled(config, accessToken, refreshToken, queryClient);
|
|
@@ -5706,6 +5735,7 @@ const createBearerAuthProviderImpl = (config) => {
|
|
|
5706
5735
|
isAuthenticated,
|
|
5707
5736
|
latestExecutedQuery: latestExecutedQuery.asReadonly(),
|
|
5708
5737
|
latestNonInternalQuery: latestNonInternalQuery.asReadonly(),
|
|
5738
|
+
executionState: executionState.asReadonly(),
|
|
5709
5739
|
logout,
|
|
5710
5740
|
afterTokenRefresh$,
|
|
5711
5741
|
};
|
|
@@ -5855,8 +5885,8 @@ const withInactivityLogout = (config = {}) => {
|
|
|
5855
5885
|
const activityEvents = config.activityEvents ?? ['mousedown', 'keydown', 'scroll', 'touchstart'];
|
|
5856
5886
|
const destroyRef = inject(DestroyRef);
|
|
5857
5887
|
const document = inject(DOCUMENT);
|
|
5858
|
-
const enabled = signal(true, ...(ngDevMode ? [{ debugName: "enabled" }] : []));
|
|
5859
|
-
const lastActivityTime = signal(Date.now(), ...(ngDevMode ? [{ debugName: "lastActivityTime" }] : []));
|
|
5888
|
+
const enabled = signal(true, ...(ngDevMode ? [{ debugName: "enabled" }] : /* istanbul ignore next */ []));
|
|
5889
|
+
const lastActivityTime = signal(Date.now(), ...(ngDevMode ? [{ debugName: "lastActivityTime" }] : /* istanbul ignore next */ []));
|
|
5860
5890
|
const resetTimer = () => {
|
|
5861
5891
|
lastActivityTime.set(Date.now());
|
|
5862
5892
|
};
|
|
@@ -5939,7 +5969,7 @@ const createPersistentAuthFeature = (config, context) => {
|
|
|
5939
5969
|
}
|
|
5940
5970
|
return config.defaultRememberMe ?? false;
|
|
5941
5971
|
};
|
|
5942
|
-
const rememberMeSignal = signal(initializeRememberMe(), ...(ngDevMode ? [{ debugName: "rememberMeSignal" }] : []));
|
|
5972
|
+
const rememberMeSignal = signal(initializeRememberMe(), ...(ngDevMode ? [{ debugName: "rememberMeSignal" }] : /* istanbul ignore next */ []));
|
|
5943
5973
|
effect(() => {
|
|
5944
5974
|
const token = refreshToken();
|
|
5945
5975
|
const rememberMe = rememberMeSignal();
|
|
@@ -6000,7 +6030,7 @@ const withTokenExpirationWarning = (config = {}) => {
|
|
|
6000
6030
|
if (typeof exp !== 'number')
|
|
6001
6031
|
return null;
|
|
6002
6032
|
return new Date(exp * 1000);
|
|
6003
|
-
}, ...(ngDevMode ? [{ debugName: "expiresAt" }] : []));
|
|
6033
|
+
}, ...(ngDevMode ? [{ debugName: "expiresAt" }] : /* istanbul ignore next */ []));
|
|
6004
6034
|
const expiresIn$ = combineLatest([interval(checkInterval), toObservable(context.bearerData)]).pipe(map(() => {
|
|
6005
6035
|
const expiry = expiresAt();
|
|
6006
6036
|
if (!expiry)
|
|
@@ -6031,23 +6061,26 @@ const withTokenExpirationWarning = (config = {}) => {
|
|
|
6031
6061
|
const withTokenRevocation = (config) => {
|
|
6032
6062
|
return (context) => {
|
|
6033
6063
|
const revokeOnLogout = config.revokeOnLogout ?? true;
|
|
6034
|
-
const enabled = signal(true, ...(ngDevMode ? [{ debugName: "enabled" }] : []));
|
|
6064
|
+
const enabled = signal(true, ...(ngDevMode ? [{ debugName: "enabled" }] : /* istanbul ignore next */ []));
|
|
6035
6065
|
let previousAccessToken = null;
|
|
6066
|
+
let previousRefreshToken = null;
|
|
6036
6067
|
let currentRevocationSnapshot = null;
|
|
6037
|
-
const
|
|
6068
|
+
const revokeWithTokens = (accessToken, refreshToken) => {
|
|
6038
6069
|
if (currentRevocationSnapshot?.isAlive())
|
|
6039
6070
|
return currentRevocationSnapshot;
|
|
6040
|
-
const accessToken = context.accessToken();
|
|
6041
|
-
const refreshToken = context.refreshToken();
|
|
6042
6071
|
if (!accessToken && !refreshToken) {
|
|
6043
6072
|
return null;
|
|
6044
6073
|
}
|
|
6045
6074
|
const args = config.buildArgs({ accessToken, refreshToken });
|
|
6075
|
+
context.executionState.set({ type: 'revocation', state: 'loading' });
|
|
6046
6076
|
currentRevocationSnapshot = context.queries[config.queryKey].execute(args, {
|
|
6047
6077
|
triggeredBy: 'token-revocation',
|
|
6048
6078
|
});
|
|
6049
6079
|
return currentRevocationSnapshot;
|
|
6050
6080
|
};
|
|
6081
|
+
const revoke = () => {
|
|
6082
|
+
return revokeWithTokens(context.accessToken(), context.refreshToken());
|
|
6083
|
+
};
|
|
6051
6084
|
const enable = () => {
|
|
6052
6085
|
enabled.set(true);
|
|
6053
6086
|
};
|
|
@@ -6057,10 +6090,12 @@ const withTokenRevocation = (config) => {
|
|
|
6057
6090
|
if (revokeOnLogout) {
|
|
6058
6091
|
effect(() => {
|
|
6059
6092
|
const currentToken = context.accessToken();
|
|
6093
|
+
const currentRefreshToken = context.refreshToken();
|
|
6060
6094
|
if (previousAccessToken && !currentToken && enabled()) {
|
|
6061
|
-
untracked(() =>
|
|
6095
|
+
untracked(() => revokeWithTokens(previousAccessToken, previousRefreshToken));
|
|
6062
6096
|
}
|
|
6063
6097
|
previousAccessToken = currentToken;
|
|
6098
|
+
previousRefreshToken = currentRefreshToken;
|
|
6064
6099
|
}, { injector: context.injector });
|
|
6065
6100
|
}
|
|
6066
6101
|
const instance = {
|
|
@@ -6384,10 +6419,10 @@ class ParseHttpErrorCodeToTitleDePipe {
|
|
|
6384
6419
|
constructor() {
|
|
6385
6420
|
this.transform = parseHttpErrorCodeToTitleDe;
|
|
6386
6421
|
}
|
|
6387
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
6388
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.
|
|
6422
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: ParseHttpErrorCodeToTitleDePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
6423
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.13", ngImport: i0, type: ParseHttpErrorCodeToTitleDePipe, isStandalone: true, name: "parseHttpErrorCodeToTitleDe" }); }
|
|
6389
6424
|
}
|
|
6390
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
6425
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: ParseHttpErrorCodeToTitleDePipe, decorators: [{
|
|
6391
6426
|
type: Pipe,
|
|
6392
6427
|
args: [{
|
|
6393
6428
|
name: 'parseHttpErrorCodeToTitleDe',
|
|
@@ -6397,10 +6432,10 @@ class ParseHttpErrorCodeToMessageDePipe {
|
|
|
6397
6432
|
constructor() {
|
|
6398
6433
|
this.transform = parseHttpErrorCodeToMessageDe;
|
|
6399
6434
|
}
|
|
6400
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
6401
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.
|
|
6435
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: ParseHttpErrorCodeToMessageDePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
6436
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.13", ngImport: i0, type: ParseHttpErrorCodeToMessageDePipe, isStandalone: true, name: "parseHttpErrorCodeToMessageDe" }); }
|
|
6402
6437
|
}
|
|
6403
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
6438
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: ParseHttpErrorCodeToMessageDePipe, decorators: [{
|
|
6404
6439
|
type: Pipe,
|
|
6405
6440
|
args: [{
|
|
6406
6441
|
name: 'parseHttpErrorCodeToMessageDe',
|
|
@@ -6584,10 +6619,10 @@ class ParseHttpErrorCodeToTitleEnPipe {
|
|
|
6584
6619
|
constructor() {
|
|
6585
6620
|
this.transform = parseHttpErrorCodeToTitleEn;
|
|
6586
6621
|
}
|
|
6587
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
6588
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.
|
|
6622
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: ParseHttpErrorCodeToTitleEnPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
6623
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.13", ngImport: i0, type: ParseHttpErrorCodeToTitleEnPipe, isStandalone: true, name: "parseHttpErrorCodeToTitleEn" }); }
|
|
6589
6624
|
}
|
|
6590
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
6625
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: ParseHttpErrorCodeToTitleEnPipe, decorators: [{
|
|
6591
6626
|
type: Pipe,
|
|
6592
6627
|
args: [{
|
|
6593
6628
|
name: 'parseHttpErrorCodeToTitleEn',
|
|
@@ -6597,10 +6632,10 @@ class ParseHttpErrorCodeToMessageEnPipe {
|
|
|
6597
6632
|
constructor() {
|
|
6598
6633
|
this.transform = parseHttpErrorCodeToMessageEn;
|
|
6599
6634
|
}
|
|
6600
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
6601
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.
|
|
6635
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: ParseHttpErrorCodeToMessageEnPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
6636
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.13", ngImport: i0, type: ParseHttpErrorCodeToMessageEnPipe, isStandalone: true, name: "parseHttpErrorCodeToMessageEn" }); }
|
|
6602
6637
|
}
|
|
6603
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
6638
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: ParseHttpErrorCodeToMessageEnPipe, decorators: [{
|
|
6604
6639
|
type: Pipe,
|
|
6605
6640
|
args: [{
|
|
6606
6641
|
name: 'parseHttpErrorCodeToMessageEn',
|
|
@@ -7270,17 +7305,17 @@ const createWebSocketClient = (options) => {
|
|
|
7270
7305
|
transports: options.transports,
|
|
7271
7306
|
});
|
|
7272
7307
|
const rooms = new Map();
|
|
7273
|
-
const isConnected = signal(false, ...(ngDevMode ? [{ debugName: "isConnected" }] : []));
|
|
7308
|
+
const isConnected = signal(false, ...(ngDevMode ? [{ debugName: "isConnected" }] : /* istanbul ignore next */ []));
|
|
7274
7309
|
const joinRoom = (room) => {
|
|
7275
7310
|
const roomFn = typeof room === 'function' ? room : () => room;
|
|
7276
7311
|
const pre = previousSignalValue(computed(() => roomFn()));
|
|
7277
|
-
const roomData = signal(null, ...(ngDevMode ? [{ debugName: "roomData" }] : []));
|
|
7312
|
+
const roomData = signal(null, ...(ngDevMode ? [{ debugName: "roomData" }] : /* istanbul ignore next */ []));
|
|
7278
7313
|
const join = (name) => {
|
|
7279
7314
|
socket.emit('join-room', name);
|
|
7280
7315
|
const existingRoom = rooms.get(name);
|
|
7281
7316
|
if (existingRoom)
|
|
7282
7317
|
return existingRoom;
|
|
7283
|
-
const message = signal(null, ...(ngDevMode ? [{ debugName: "message" }] : []));
|
|
7318
|
+
const message = signal(null, ...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
|
|
7284
7319
|
const newRoom = {
|
|
7285
7320
|
latestMessage: message,
|
|
7286
7321
|
};
|