@ethlete/query 5.15.0 → 5.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +40 -0
- package/CHANGELOG.md +14 -0
- package/jest.config.ts +23 -0
- package/ng-package.json +8 -0
- package/package.json +6 -23
- package/project.json +37 -0
- package/{index.d.ts → src/index.ts} +2 -0
- package/src/lib/auth/auth-provider.types.ts +160 -0
- package/src/lib/auth/auth-provider.utils.ts +39 -0
- package/src/lib/auth/basic-auth-provider.ts +17 -0
- package/src/lib/auth/bearer-auth-provider.ts +243 -0
- package/src/lib/auth/custom-header-auth-provider.ts +13 -0
- package/{lib/class-validator/class-validator.types.d.ts → src/lib/class-validator/class-validator.types.ts} +4 -3
- package/src/lib/class-validator/class-validator.utils.ts +5 -0
- package/src/lib/devtools/components/query-devtools/query-devtools.component.html +402 -0
- package/src/lib/devtools/components/query-devtools/query-devtools.component.scss +360 -0
- package/src/lib/devtools/components/query-devtools/query-devtools.component.ts +427 -0
- package/src/lib/devtools/pipes/query-short-name.pipe.ts +24 -0
- package/src/lib/devtools/utils/query-client.utils.ts +25 -0
- package/src/lib/directives/infinity-query-trigger.directive.ts +58 -0
- package/src/lib/directives/infinity-query.directive.ts +208 -0
- package/src/lib/directives/query.directive.ts +201 -0
- package/src/lib/entity/entity-store.ts +180 -0
- package/src/lib/entity/entity.types.ts +34 -0
- package/src/lib/entity/entity.utils.ts +51 -0
- package/src/lib/gql/gql.ts +22 -0
- package/src/lib/infinite-query/infinity-query.ts +245 -0
- package/src/lib/infinite-query/infinity-query.types.ts +149 -0
- package/src/lib/infinite-query/infinity-query.utils.ts +14 -0
- package/src/lib/logger/logger.ts +30 -0
- package/src/lib/query/query.ts +631 -0
- package/src/lib/query/query.types.ts +532 -0
- package/src/lib/query/query.utils.spec.ts +92 -0
- package/src/lib/query/query.utils.ts +450 -0
- package/src/lib/query-client/query-client.spec.ts +77 -0
- package/src/lib/query-client/query-client.ts +195 -0
- package/src/lib/query-client/query-client.types.ts +101 -0
- package/src/lib/query-client/query-client.utils.spec.ts +61 -0
- package/src/lib/query-client/query-client.utils.ts +28 -0
- package/src/lib/query-creator/query-creator.ts +103 -0
- package/src/lib/query-creator/query-creator.types.ts +74 -0
- package/src/lib/query-form/query-form.ts +526 -0
- package/src/lib/query-form/query-form.types.ts +169 -0
- package/src/lib/query-form/query-form.utils.ts +116 -0
- package/src/lib/query-store/query-store.ts +192 -0
- package/src/lib/request/request.ts +253 -0
- package/src/lib/request/request.types.ts +164 -0
- package/src/lib/request/request.util.spec.ts +177 -0
- package/src/lib/request/request.util.ts +399 -0
- package/src/lib/stories/angular-example-page.mdx +85 -0
- package/src/lib/stories/authentication-page.mdx +35 -0
- package/src/lib/stories/changelog-page.mdx +9 -0
- package/src/lib/stories/client-page.mdx +100 -0
- package/src/lib/stories/queries-page.mdx +117 -0
- package/src/lib/symfony/symfony.types.ts +21 -0
- package/src/lib/symfony/symfony.utils.ts +43 -0
- package/src/lib/utils/data.utils.ts +280 -0
- package/src/lib/utils/deep-freeze.util.ts +21 -0
- package/{lib/utils/def.util.d.ts → src/lib/utils/def.util.ts} +1 -1
- package/src/test-setup.ts +1 -0
- package/tsconfig.json +29 -0
- package/tsconfig.lib.json +12 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +11 -0
- package/esm2022/ethlete-query.mjs +0 -5
- package/esm2022/index.mjs +0 -20
- package/esm2022/lib/auth/auth-provider.types.mjs +0 -2
- package/esm2022/lib/auth/auth-provider.utils.mjs +0 -25
- package/esm2022/lib/auth/basic-auth-provider.mjs +0 -15
- package/esm2022/lib/auth/bearer-auth-provider.mjs +0 -168
- package/esm2022/lib/auth/custom-header-auth-provider.mjs +0 -12
- package/esm2022/lib/auth/index.mjs +0 -6
- package/esm2022/lib/class-validator/class-validator.types.mjs +0 -2
- package/esm2022/lib/class-validator/class-validator.utils.mjs +0 -4
- package/esm2022/lib/class-validator/index.mjs +0 -3
- package/esm2022/lib/devtools/components/query-devtools/index.mjs +0 -2
- package/esm2022/lib/devtools/components/query-devtools/query-devtools.component.mjs +0 -297
- package/esm2022/lib/devtools/pipes/index.mjs +0 -2
- package/esm2022/lib/devtools/pipes/query-short-name.pipe.mjs +0 -24
- package/esm2022/lib/devtools/utils/index.mjs +0 -2
- package/esm2022/lib/devtools/utils/query-client.utils.mjs +0 -13
- package/esm2022/lib/directives/index.mjs +0 -4
- package/esm2022/lib/directives/infinity-query-trigger.directive.mjs +0 -56
- package/esm2022/lib/directives/infinity-query.directive.mjs +0 -147
- package/esm2022/lib/directives/query.directive.mjs +0 -123
- package/esm2022/lib/entity/entity-store.mjs +0 -127
- package/esm2022/lib/entity/entity.types.mjs +0 -2
- package/esm2022/lib/entity/entity.utils.mjs +0 -29
- package/esm2022/lib/entity/index.mjs +0 -4
- package/esm2022/lib/gql/gql.mjs +0 -23
- package/esm2022/lib/gql/index.mjs +0 -2
- package/esm2022/lib/infinite-query/index.mjs +0 -4
- package/esm2022/lib/infinite-query/infinity-query.mjs +0 -171
- package/esm2022/lib/infinite-query/infinity-query.types.mjs +0 -2
- package/esm2022/lib/infinite-query/infinity-query.utils.mjs +0 -3
- package/esm2022/lib/logger/index.mjs +0 -2
- package/esm2022/lib/logger/logger.mjs +0 -16
- package/esm2022/lib/query/index.mjs +0 -4
- package/esm2022/lib/query/query.mjs +0 -428
- package/esm2022/lib/query/query.types.mjs +0 -2
- package/esm2022/lib/query/query.utils.mjs +0 -253
- package/esm2022/lib/query-client/index.mjs +0 -4
- package/esm2022/lib/query-client/query-client.mjs +0 -80
- package/esm2022/lib/query-client/query-client.types.mjs +0 -2
- package/esm2022/lib/query-client/query-client.utils.mjs +0 -20
- package/esm2022/lib/query-creator/index.mjs +0 -3
- package/esm2022/lib/query-creator/query-creator.mjs +0 -55
- package/esm2022/lib/query-creator/query-creator.types.mjs +0 -2
- package/esm2022/lib/query-form/index.mjs +0 -4
- package/esm2022/lib/query-form/query-form.mjs +0 -368
- package/esm2022/lib/query-form/query-form.types.mjs +0 -2
- package/esm2022/lib/query-form/query-form.utils.mjs +0 -97
- package/esm2022/lib/query-store/index.mjs +0 -2
- package/esm2022/lib/query-store/query-store.mjs +0 -144
- package/esm2022/lib/request/index.mjs +0 -4
- package/esm2022/lib/request/request.mjs +0 -196
- package/esm2022/lib/request/request.types.mjs +0 -2
- package/esm2022/lib/request/request.util.mjs +0 -252
- package/esm2022/lib/symfony/index.mjs +0 -3
- package/esm2022/lib/symfony/symfony.types.mjs +0 -2
- package/esm2022/lib/symfony/symfony.utils.mjs +0 -31
- package/esm2022/lib/utils/data.utils.mjs +0 -138
- package/esm2022/lib/utils/deep-freeze.util.mjs +0 -17
- package/esm2022/lib/utils/def.util.mjs +0 -8
- package/esm2022/lib/utils/index.mjs +0 -4
- package/fesm2022/ethlete-query.mjs +0 -3276
- package/fesm2022/ethlete-query.mjs.map +0 -1
- package/lib/auth/auth-provider.types.d.ts +0 -133
- package/lib/auth/auth-provider.utils.d.ts +0 -9
- package/lib/auth/basic-auth-provider.d.ts +0 -10
- package/lib/auth/bearer-auth-provider.d.ts +0 -23
- package/lib/auth/custom-header-auth-provider.d.ts +0 -9
- package/lib/class-validator/class-validator.utils.d.ts +0 -2
- package/lib/devtools/components/query-devtools/query-devtools.component.d.ts +0 -151
- package/lib/devtools/pipes/query-short-name.pipe.d.ts +0 -8
- package/lib/devtools/utils/query-client.utils.d.ts +0 -12
- package/lib/directives/infinity-query-trigger.directive.d.ts +0 -15
- package/lib/directives/infinity-query.directive.d.ts +0 -49
- package/lib/directives/query.directive.d.ts +0 -63
- package/lib/entity/entity-store.d.ts +0 -25
- package/lib/entity/entity.types.d.ts +0 -25
- package/lib/entity/entity.utils.d.ts +0 -12
- package/lib/gql/gql.d.ts +0 -6
- package/lib/infinite-query/infinity-query.d.ts +0 -29
- package/lib/infinite-query/infinity-query.types.d.ts +0 -104
- package/lib/infinite-query/infinity-query.utils.d.ts +0 -4
- package/lib/logger/logger.d.ts +0 -12
- package/lib/query/query.d.ts +0 -60
- package/lib/query/query.types.d.ts +0 -388
- package/lib/query/query.utils.d.ts +0 -91
- package/lib/query-client/query-client.d.ts +0 -29
- package/lib/query-client/query-client.types.d.ts +0 -82
- package/lib/query-client/query-client.utils.d.ts +0 -4
- package/lib/query-creator/query-creator.d.ts +0 -20
- package/lib/query-creator/query-creator.types.d.ts +0 -13
- package/lib/query-form/query-form.d.ts +0 -89
- package/lib/query-form/query-form.types.d.ts +0 -138
- package/lib/query-form/query-form.utils.d.ts +0 -13
- package/lib/query-store/query-store.d.ts +0 -31
- package/lib/request/request.d.ts +0 -3
- package/lib/request/request.types.d.ts +0 -126
- package/lib/request/request.util.d.ts +0 -92
- package/lib/symfony/symfony.types.d.ts +0 -19
- package/lib/symfony/symfony.utils.d.ts +0 -6
- package/lib/utils/data.utils.d.ts +0 -59
- package/lib/utils/deep-freeze.util.d.ts +0 -1
- /package/{lib/auth/index.d.ts → src/lib/auth/index.ts} +0 -0
- /package/{lib/class-validator/index.d.ts → src/lib/class-validator/index.ts} +0 -0
- /package/{lib/devtools/components/query-devtools/index.d.ts → src/lib/devtools/components/query-devtools/index.ts} +0 -0
- /package/{lib/devtools/pipes/index.d.ts → src/lib/devtools/pipes/index.ts} +0 -0
- /package/{lib/devtools/utils/index.d.ts → src/lib/devtools/utils/index.ts} +0 -0
- /package/{lib/directives/index.d.ts → src/lib/directives/index.ts} +0 -0
- /package/{lib/entity/index.d.ts → src/lib/entity/index.ts} +0 -0
- /package/{lib/gql/index.d.ts → src/lib/gql/index.ts} +0 -0
- /package/{lib/infinite-query/index.d.ts → src/lib/infinite-query/index.ts} +0 -0
- /package/{lib/logger/index.d.ts → src/lib/logger/index.ts} +0 -0
- /package/{lib/query/index.d.ts → src/lib/query/index.ts} +0 -0
- /package/{lib/query-client/index.d.ts → src/lib/query-client/index.ts} +0 -0
- /package/{lib/query-creator/index.d.ts → src/lib/query-creator/index.ts} +0 -0
- /package/{lib/query-form/index.d.ts → src/lib/query-form/index.ts} +0 -0
- /package/{lib/query-store/index.d.ts → src/lib/query-store/index.ts} +0 -0
- /package/{lib/request/index.d.ts → src/lib/request/index.ts} +0 -0
- /package/{lib/symfony/index.d.ts → src/lib/symfony/index.ts} +0 -0
- /package/{lib/utils/index.d.ts → src/lib/utils/index.ts} +0 -0
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { FormViolationListView, FormViolationView } from '@ethlete/types';
|
|
2
|
-
import { SymfonyError } from './symfony.types';
|
|
3
|
-
export declare const isSymfonyError: (error: unknown) => error is SymfonyError;
|
|
4
|
-
export declare const isSymfonyPagerfantaOutOfRangeError: (error: unknown) => error is SymfonyError;
|
|
5
|
-
export declare const isSymfonyFormViolationListError: (error: unknown) => error is FormViolationListView;
|
|
6
|
-
export declare const isSymfonyListError: (error: unknown) => error is FormViolationView[];
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { CreateComputedOptions, Signal } from '@angular/core';
|
|
2
|
-
import { ToObservableOptions, ToSignalOptions } from '@angular/core/rxjs-interop';
|
|
3
|
-
import { Observable, Subscribable } from 'rxjs';
|
|
4
|
-
import { AnyQuery, AnyQueryCollection, QueryOf, QueryState } from '../query';
|
|
5
|
-
import { QueryDataOf } from '../query-creator';
|
|
6
|
-
export interface QueryContainerConfig {
|
|
7
|
-
/**
|
|
8
|
-
* If `true`, the previous query will be aborted when a new query is pushed into the container.
|
|
9
|
-
* @default true // Only if the request can be cached (GET, OPTIONS, HEAD and GQL_QUERY). Otherwise false.
|
|
10
|
-
*/
|
|
11
|
-
abortPrevious?: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* If `true`, the query will be aborted when the container is destroyed.
|
|
14
|
-
* @default true // Only if the request can be cached (GET, OPTIONS, HEAD and GQL_QUERY). Otherwise false.
|
|
15
|
-
*/
|
|
16
|
-
abortOnDestroy?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* If `true`, the previous polling will be stopped when a new query is pushed into the container.
|
|
19
|
-
* @default true // Only if the query has no other dependents and the request can be cached (GET, OPTIONS, HEAD and GQL_QUERY). Otherwise false.
|
|
20
|
-
*/
|
|
21
|
-
stopPreviousPolling?: boolean;
|
|
22
|
-
}
|
|
23
|
-
export interface QueryFilterConfig {
|
|
24
|
-
/**
|
|
25
|
-
* If `true`, the response will be cached until the next response is received or the query fails.
|
|
26
|
-
* @default false
|
|
27
|
-
*/
|
|
28
|
-
cacheResponse?: boolean;
|
|
29
|
-
}
|
|
30
|
-
export declare const addQueryContainerHandling: (obs: Observable<AnyQuery | AnyQuery[] | null>, valueFn: () => AnyQuery | AnyQuery[] | null | undefined, config?: QueryContainerConfig) => void;
|
|
31
|
-
export declare function toQuerySignal<T extends AnyQuery | null>(source: Observable<T> | Subscribable<T>): Signal<T | undefined>;
|
|
32
|
-
export declare function toQuerySignal<T extends AnyQuery | null>(source: Observable<T> | Subscribable<T>, options: ToSignalOptions & {
|
|
33
|
-
initialValue?: undefined;
|
|
34
|
-
requireSync?: false;
|
|
35
|
-
} & QueryContainerConfig): Signal<T | undefined>;
|
|
36
|
-
export declare function toQuerySignal<T extends AnyQuery | null>(source: Observable<T> | Subscribable<T>, options: ToSignalOptions & {
|
|
37
|
-
initialValue?: null;
|
|
38
|
-
requireSync?: false;
|
|
39
|
-
} & QueryContainerConfig): Signal<T | null>;
|
|
40
|
-
export declare function toQuerySignal<T extends AnyQuery | null>(source: Observable<T> | Subscribable<T>, options: ToSignalOptions & {
|
|
41
|
-
initialValue?: undefined;
|
|
42
|
-
requireSync: true;
|
|
43
|
-
} & QueryContainerConfig): Signal<T>;
|
|
44
|
-
export declare function toQuerySignal<T extends AnyQuery | null, const U extends T>(source: Observable<T> | Subscribable<T>, options: ToSignalOptions & {
|
|
45
|
-
initialValue: U;
|
|
46
|
-
requireSync?: false;
|
|
47
|
-
} & QueryContainerConfig): Signal<T | U>;
|
|
48
|
-
export declare function queryComputed<T extends AnyQuery | null>(computation: () => T, options?: CreateComputedOptions<T> & QueryContainerConfig & ToObservableOptions): Signal<T>;
|
|
49
|
-
/**
|
|
50
|
-
* Creates a signal that will only be reactive until the first query is created.
|
|
51
|
-
* All subsequent changes inside the computation will be ignored.
|
|
52
|
-
*/
|
|
53
|
-
export declare function queryComputedTillTruthy<T extends AnyQuery | null>(computation: () => T, options?: CreateComputedOptions<T> & QueryContainerConfig & ToObservableOptions): Signal<T | null>;
|
|
54
|
-
export declare function queryArrayComputed<T extends AnyQuery[] | null>(computation: () => T, options?: CreateComputedOptions<T> & QueryContainerConfig & ToObservableOptions): Signal<T>;
|
|
55
|
-
export declare function toQuerySubject<T extends AnyQuery | null>(source: Signal<T>, options?: ToObservableOptions & QueryContainerConfig): Observable<T>;
|
|
56
|
-
export declare function queryStateSignal<T extends Signal<AnyQuery | AnyQueryCollection | null>>(source: T, options?: QueryFilterConfig): Signal<QueryState<QueryDataOf<QueryOf<ReturnType<T>>>> | null>;
|
|
57
|
-
export declare function queryStateResponseSignal<T extends Signal<AnyQuery | AnyQueryCollection | null>>(source: T, options?: QueryFilterConfig): Signal<QueryDataOf<QueryOf<ReturnType<T>>> | null>;
|
|
58
|
-
export declare function queryStateErrorSignal<T extends Signal<AnyQuery | AnyQueryCollection | null>>(source: T): Signal<import("@ethlete/query").RequestError<unknown> | null>;
|
|
59
|
-
export declare function queryStateLoadingSignal<T extends Signal<AnyQuery | AnyQueryCollection | null>>(source: T): Signal<import("../query").Loading | null>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const deepFreeze: <T extends Record<string, unknown>>(object: T) => T;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|