@ethlete/query 5.16.0 → 5.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/esm2022/ethlete-query.mjs +5 -0
- package/esm2022/index.mjs +20 -0
- package/esm2022/lib/auth/auth-provider.types.mjs +2 -0
- package/esm2022/lib/auth/auth-provider.utils.mjs +25 -0
- package/esm2022/lib/auth/basic-auth-provider.mjs +15 -0
- package/esm2022/lib/auth/bearer-auth-provider.mjs +168 -0
- package/esm2022/lib/auth/custom-header-auth-provider.mjs +12 -0
- package/esm2022/lib/auth/index.mjs +6 -0
- package/esm2022/lib/class-validator/class-validator.types.mjs +2 -0
- package/esm2022/lib/class-validator/class-validator.utils.mjs +4 -0
- package/esm2022/lib/class-validator/index.mjs +3 -0
- package/esm2022/lib/devtools/components/query-devtools/index.mjs +2 -0
- package/esm2022/lib/devtools/components/query-devtools/query-devtools.component.mjs +297 -0
- package/esm2022/lib/devtools/pipes/index.mjs +2 -0
- package/esm2022/lib/devtools/pipes/query-short-name.pipe.mjs +24 -0
- package/esm2022/lib/devtools/utils/index.mjs +2 -0
- package/esm2022/lib/devtools/utils/query-client.utils.mjs +13 -0
- package/esm2022/lib/directives/index.mjs +4 -0
- package/esm2022/lib/directives/infinity-query-trigger.directive.mjs +56 -0
- package/esm2022/lib/directives/infinity-query.directive.mjs +147 -0
- package/esm2022/lib/directives/query.directive.mjs +123 -0
- package/esm2022/lib/entity/entity-store.mjs +127 -0
- package/esm2022/lib/entity/entity.types.mjs +2 -0
- package/esm2022/lib/entity/entity.utils.mjs +29 -0
- package/esm2022/lib/entity/index.mjs +4 -0
- package/esm2022/lib/gql/gql.mjs +23 -0
- package/esm2022/lib/gql/index.mjs +2 -0
- package/esm2022/lib/infinite-query/index.mjs +4 -0
- package/esm2022/lib/infinite-query/infinity-query.mjs +171 -0
- package/esm2022/lib/infinite-query/infinity-query.types.mjs +2 -0
- package/esm2022/lib/infinite-query/infinity-query.utils.mjs +3 -0
- package/esm2022/lib/logger/index.mjs +2 -0
- package/esm2022/lib/logger/logger.mjs +16 -0
- package/esm2022/lib/query/index.mjs +4 -0
- package/esm2022/lib/query/query.mjs +430 -0
- package/esm2022/lib/query/query.types.mjs +2 -0
- package/esm2022/lib/query/query.utils.mjs +253 -0
- package/esm2022/lib/query-client/index.mjs +4 -0
- package/esm2022/lib/query-client/query-client.mjs +80 -0
- package/esm2022/lib/query-client/query-client.types.mjs +2 -0
- package/esm2022/lib/query-client/query-client.utils.mjs +20 -0
- package/esm2022/lib/query-creator/index.mjs +3 -0
- package/esm2022/lib/query-creator/query-creator.mjs +55 -0
- package/esm2022/lib/query-creator/query-creator.types.mjs +2 -0
- package/esm2022/lib/query-form/index.mjs +4 -0
- package/esm2022/lib/query-form/query-form.mjs +379 -0
- package/esm2022/lib/query-form/query-form.types.mjs +2 -0
- package/esm2022/lib/query-form/query-form.utils.mjs +97 -0
- package/esm2022/lib/query-store/index.mjs +2 -0
- package/esm2022/lib/query-store/query-store.mjs +144 -0
- package/esm2022/lib/request/index.mjs +4 -0
- package/esm2022/lib/request/request.mjs +196 -0
- package/esm2022/lib/request/request.types.mjs +2 -0
- package/esm2022/lib/request/request.util.mjs +252 -0
- package/esm2022/lib/symfony/index.mjs +3 -0
- package/esm2022/lib/symfony/symfony.types.mjs +2 -0
- package/esm2022/lib/symfony/symfony.utils.mjs +31 -0
- package/esm2022/lib/utils/data.utils.mjs +138 -0
- package/esm2022/lib/utils/deep-freeze.util.mjs +17 -0
- package/esm2022/lib/utils/def.util.mjs +8 -0
- package/esm2022/lib/utils/index.mjs +4 -0
- package/fesm2022/ethlete-query.mjs +3289 -0
- package/fesm2022/ethlete-query.mjs.map +1 -0
- package/{src/index.ts → index.d.ts} +0 -2
- package/lib/auth/auth-provider.types.d.ts +133 -0
- package/lib/auth/auth-provider.utils.d.ts +9 -0
- package/lib/auth/basic-auth-provider.d.ts +10 -0
- package/lib/auth/bearer-auth-provider.d.ts +23 -0
- package/lib/auth/custom-header-auth-provider.d.ts +9 -0
- package/{src/lib/class-validator/class-validator.types.ts → lib/class-validator/class-validator.types.d.ts} +3 -4
- package/lib/class-validator/class-validator.utils.d.ts +2 -0
- package/lib/devtools/components/query-devtools/query-devtools.component.d.ts +151 -0
- package/lib/devtools/pipes/query-short-name.pipe.d.ts +8 -0
- package/lib/devtools/utils/query-client.utils.d.ts +12 -0
- package/lib/directives/infinity-query-trigger.directive.d.ts +15 -0
- package/lib/directives/infinity-query.directive.d.ts +49 -0
- package/lib/directives/query.directive.d.ts +63 -0
- package/lib/entity/entity-store.d.ts +25 -0
- package/lib/entity/entity.types.d.ts +25 -0
- package/lib/entity/entity.utils.d.ts +12 -0
- package/lib/gql/gql.d.ts +6 -0
- package/lib/infinite-query/infinity-query.d.ts +29 -0
- package/lib/infinite-query/infinity-query.types.d.ts +104 -0
- package/lib/infinite-query/infinity-query.utils.d.ts +4 -0
- package/lib/logger/logger.d.ts +12 -0
- package/lib/query/query.d.ts +60 -0
- package/lib/query/query.types.d.ts +388 -0
- package/lib/query/query.utils.d.ts +82 -0
- package/lib/query-client/query-client.d.ts +29 -0
- package/lib/query-client/query-client.types.d.ts +82 -0
- package/lib/query-client/query-client.utils.d.ts +4 -0
- package/lib/query-creator/query-creator.d.ts +20 -0
- package/lib/query-creator/query-creator.types.d.ts +13 -0
- package/lib/query-form/query-form.d.ts +91 -0
- package/lib/query-form/query-form.types.d.ts +145 -0
- package/lib/query-form/query-form.utils.d.ts +13 -0
- package/lib/query-store/query-store.d.ts +31 -0
- package/lib/request/request.d.ts +3 -0
- package/lib/request/request.types.d.ts +126 -0
- package/lib/request/request.util.d.ts +92 -0
- package/lib/symfony/symfony.types.d.ts +19 -0
- package/lib/symfony/symfony.utils.d.ts +6 -0
- package/lib/utils/data.utils.d.ts +59 -0
- package/lib/utils/deep-freeze.util.d.ts +1 -0
- package/{src/lib/utils/def.util.ts → lib/utils/def.util.d.ts} +1 -1
- package/package.json +23 -6
- package/.eslintrc.json +0 -40
- package/jest.config.ts +0 -23
- package/ng-package.json +0 -8
- package/project.json +0 -37
- package/src/lib/auth/auth-provider.types.ts +0 -160
- package/src/lib/auth/auth-provider.utils.ts +0 -39
- package/src/lib/auth/basic-auth-provider.ts +0 -17
- package/src/lib/auth/bearer-auth-provider.ts +0 -243
- package/src/lib/auth/custom-header-auth-provider.ts +0 -13
- package/src/lib/class-validator/class-validator.utils.ts +0 -5
- package/src/lib/devtools/components/query-devtools/query-devtools.component.html +0 -402
- package/src/lib/devtools/components/query-devtools/query-devtools.component.scss +0 -360
- package/src/lib/devtools/components/query-devtools/query-devtools.component.ts +0 -427
- package/src/lib/devtools/pipes/query-short-name.pipe.ts +0 -24
- package/src/lib/devtools/utils/query-client.utils.ts +0 -25
- package/src/lib/directives/infinity-query-trigger.directive.ts +0 -58
- package/src/lib/directives/infinity-query.directive.ts +0 -208
- package/src/lib/directives/query.directive.ts +0 -201
- package/src/lib/entity/entity-store.ts +0 -180
- package/src/lib/entity/entity.types.ts +0 -34
- package/src/lib/entity/entity.utils.ts +0 -51
- package/src/lib/gql/gql.ts +0 -22
- package/src/lib/infinite-query/infinity-query.ts +0 -245
- package/src/lib/infinite-query/infinity-query.types.ts +0 -149
- package/src/lib/infinite-query/infinity-query.utils.ts +0 -14
- package/src/lib/logger/logger.ts +0 -30
- package/src/lib/query/query.ts +0 -631
- package/src/lib/query/query.types.ts +0 -532
- package/src/lib/query/query.utils.spec.ts +0 -92
- package/src/lib/query/query.utils.ts +0 -450
- package/src/lib/query-client/query-client.spec.ts +0 -77
- package/src/lib/query-client/query-client.ts +0 -195
- package/src/lib/query-client/query-client.types.ts +0 -101
- package/src/lib/query-client/query-client.utils.spec.ts +0 -61
- package/src/lib/query-client/query-client.utils.ts +0 -28
- package/src/lib/query-creator/query-creator.ts +0 -103
- package/src/lib/query-creator/query-creator.types.ts +0 -74
- package/src/lib/query-form/query-form.ts +0 -526
- package/src/lib/query-form/query-form.types.ts +0 -169
- package/src/lib/query-form/query-form.utils.ts +0 -116
- package/src/lib/query-store/query-store.ts +0 -192
- package/src/lib/request/request.ts +0 -253
- package/src/lib/request/request.types.ts +0 -164
- package/src/lib/request/request.util.spec.ts +0 -177
- package/src/lib/request/request.util.ts +0 -399
- package/src/lib/stories/angular-example-page.mdx +0 -85
- package/src/lib/stories/authentication-page.mdx +0 -35
- package/src/lib/stories/changelog-page.mdx +0 -9
- package/src/lib/stories/client-page.mdx +0 -100
- package/src/lib/stories/queries-page.mdx +0 -117
- package/src/lib/symfony/symfony.types.ts +0 -21
- package/src/lib/symfony/symfony.utils.ts +0 -43
- package/src/lib/utils/data.utils.ts +0 -280
- package/src/lib/utils/deep-freeze.util.ts +0 -21
- package/src/test-setup.ts +0 -1
- package/tsconfig.json +0 -29
- package/tsconfig.lib.json +0 -12
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -11
- /package/{src/lib/auth/index.ts → lib/auth/index.d.ts} +0 -0
- /package/{src/lib/class-validator/index.ts → lib/class-validator/index.d.ts} +0 -0
- /package/{src/lib/devtools/components/query-devtools/index.ts → lib/devtools/components/query-devtools/index.d.ts} +0 -0
- /package/{src/lib/devtools/pipes/index.ts → lib/devtools/pipes/index.d.ts} +0 -0
- /package/{src/lib/devtools/utils/index.ts → lib/devtools/utils/index.d.ts} +0 -0
- /package/{src/lib/directives/index.ts → lib/directives/index.d.ts} +0 -0
- /package/{src/lib/entity/index.ts → lib/entity/index.d.ts} +0 -0
- /package/{src/lib/gql/index.ts → lib/gql/index.d.ts} +0 -0
- /package/{src/lib/infinite-query/index.ts → lib/infinite-query/index.d.ts} +0 -0
- /package/{src/lib/logger/index.ts → lib/logger/index.d.ts} +0 -0
- /package/{src/lib/query/index.ts → lib/query/index.d.ts} +0 -0
- /package/{src/lib/query-client/index.ts → lib/query-client/index.d.ts} +0 -0
- /package/{src/lib/query-creator/index.ts → lib/query-creator/index.d.ts} +0 -0
- /package/{src/lib/query-form/index.ts → lib/query-form/index.d.ts} +0 -0
- /package/{src/lib/query-store/index.ts → lib/query-store/index.d.ts} +0 -0
- /package/{src/lib/request/index.ts → lib/request/index.d.ts} +0 -0
- /package/{src/lib/symfony/index.ts → lib/symfony/index.d.ts} +0 -0
- /package/{src/lib/utils/index.ts → lib/utils/index.d.ts} +0 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { AnyQueryCreator, QueryArgsOf, QueryResponseOf } from '../query-creator';
|
|
2
|
+
export interface AuthProvider {
|
|
3
|
+
/**
|
|
4
|
+
* The up to date auth header.
|
|
5
|
+
* This will automatically get injected into every query that has the `secure` property set to `true`.
|
|
6
|
+
*/
|
|
7
|
+
header: Record<string, string>;
|
|
8
|
+
}
|
|
9
|
+
export interface AuthProviderBasicConfig {
|
|
10
|
+
/**
|
|
11
|
+
* Basic auth username
|
|
12
|
+
*/
|
|
13
|
+
username: string;
|
|
14
|
+
/**
|
|
15
|
+
* Basic auth password
|
|
16
|
+
*/
|
|
17
|
+
password: string;
|
|
18
|
+
}
|
|
19
|
+
export interface AuthProviderCustomHeaderConfig {
|
|
20
|
+
/**
|
|
21
|
+
* The custom header name
|
|
22
|
+
* @example `X-Api-Key`
|
|
23
|
+
*/
|
|
24
|
+
name: string;
|
|
25
|
+
/**
|
|
26
|
+
* The custom header value
|
|
27
|
+
* @example `myApiKey`
|
|
28
|
+
*/
|
|
29
|
+
value: string;
|
|
30
|
+
}
|
|
31
|
+
export interface AuthProviderBearerConfig<T extends AnyQueryCreator> {
|
|
32
|
+
/**
|
|
33
|
+
* The initial jwt
|
|
34
|
+
*/
|
|
35
|
+
token?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Refresh token configuration
|
|
38
|
+
*/
|
|
39
|
+
refreshConfig?: BearerRefreshConfig<T>;
|
|
40
|
+
}
|
|
41
|
+
export interface BearerRefreshConfig<T extends AnyQueryCreator> {
|
|
42
|
+
/**
|
|
43
|
+
* The query used to trade the refresh token for a new token response.
|
|
44
|
+
*/
|
|
45
|
+
queryCreator: T;
|
|
46
|
+
/**
|
|
47
|
+
* Determines if the token should be refreshed if **any** query returns a 401 response.
|
|
48
|
+
* @default true
|
|
49
|
+
*/
|
|
50
|
+
refreshOnUnauthorizedResponse?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* The initial refresh token
|
|
53
|
+
*/
|
|
54
|
+
token?: string;
|
|
55
|
+
/**
|
|
56
|
+
* The cookie name where the refresh token is stored
|
|
57
|
+
*/
|
|
58
|
+
cookieName?: string;
|
|
59
|
+
/**
|
|
60
|
+
* The domain of the cookie. If not set, the current origin will be used.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* "https://example.com" -> "example.com"
|
|
64
|
+
* "https://sub.example.com" -> "example.com"
|
|
65
|
+
*/
|
|
66
|
+
cookieDomain?: string;
|
|
67
|
+
/**
|
|
68
|
+
* The days until the cookie expires
|
|
69
|
+
* @default 30
|
|
70
|
+
*/
|
|
71
|
+
cookieExpiresInDays?: number;
|
|
72
|
+
/**
|
|
73
|
+
* The path of the cookie
|
|
74
|
+
* @default '/'
|
|
75
|
+
*/
|
|
76
|
+
cookiePath?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Enable or disable the cookie
|
|
79
|
+
* @default true
|
|
80
|
+
*/
|
|
81
|
+
cookieEnabled?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* The same site property of the cookie
|
|
84
|
+
* @default 'lax'
|
|
85
|
+
*/
|
|
86
|
+
cookieSameSite?: 'strict' | 'none' | 'lax';
|
|
87
|
+
/**
|
|
88
|
+
* The time in milliseconds before the token expires when the refresh should be triggered.
|
|
89
|
+
* @default 300000 (5 minutes)
|
|
90
|
+
*/
|
|
91
|
+
refreshBuffer?: number;
|
|
92
|
+
/**
|
|
93
|
+
* The expires in property name inside the jwt body
|
|
94
|
+
* @default 'exp'
|
|
95
|
+
*/
|
|
96
|
+
expiresInPropertyName?: string;
|
|
97
|
+
/**
|
|
98
|
+
* Determines when the token should be refreshed.
|
|
99
|
+
* @default AuthBearerRefreshStrategy.BeforeExpiration
|
|
100
|
+
*/
|
|
101
|
+
strategy?: AuthBearerRefreshStrategy;
|
|
102
|
+
/**
|
|
103
|
+
* Adapter function used to build the request body for the refresh request.
|
|
104
|
+
* @default { body: { refreshToken: "refreshToken" } }
|
|
105
|
+
*/
|
|
106
|
+
requestArgsAdapter?: (tokens: {
|
|
107
|
+
token: string | null;
|
|
108
|
+
refreshToken: string;
|
|
109
|
+
}) => QueryArgsOf<T>;
|
|
110
|
+
/**
|
|
111
|
+
* Adapter function used to extract the token and refreshToken from the response.
|
|
112
|
+
* @default { token: "token", refreshToken: "refreshToken" }
|
|
113
|
+
*/
|
|
114
|
+
responseAdapter?: (response: NonNullable<QueryResponseOf<T>>) => TokenResponse;
|
|
115
|
+
}
|
|
116
|
+
export declare const enum AuthBearerRefreshStrategy {
|
|
117
|
+
/**
|
|
118
|
+
* Automatically refresh the token 5 minutes before expiration.
|
|
119
|
+
* The time can be configured with the `refreshBuffer` property.
|
|
120
|
+
*/
|
|
121
|
+
BeforeExpiration = "beforeExpiration"
|
|
122
|
+
}
|
|
123
|
+
export interface TokenResponse {
|
|
124
|
+
/**
|
|
125
|
+
* The access token used inside the authorization http header.
|
|
126
|
+
*/
|
|
127
|
+
token: string | null;
|
|
128
|
+
/**
|
|
129
|
+
* The refresh token used for requesting a new token response once the current tokes is expired.
|
|
130
|
+
* This property is required if the bearer refresh config is set.
|
|
131
|
+
*/
|
|
132
|
+
refreshToken: string | null;
|
|
133
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AnyQueryCreator } from '../query-creator';
|
|
2
|
+
import { AuthProvider } from './auth-provider.types';
|
|
3
|
+
import { BasicAuthProvider } from './basic-auth-provider';
|
|
4
|
+
import { BearerAuthProvider } from './bearer-auth-provider';
|
|
5
|
+
import { CustomHeaderAuthProvider } from './custom-header-auth-provider';
|
|
6
|
+
export declare const isBasicAuthProvider: (authProvider: AuthProvider) => authProvider is BasicAuthProvider;
|
|
7
|
+
export declare const isBearerAuthProvider: <T extends AnyQueryCreator>(authProvider: AuthProvider) => authProvider is BearerAuthProvider<T>;
|
|
8
|
+
export declare const isCustomHeaderAuthProvider: (authProvider: AuthProvider) => authProvider is CustomHeaderAuthProvider;
|
|
9
|
+
export declare const decryptBearer: <Result = Record<string, unknown>>(token: string) => Result | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AuthProvider, AuthProviderBasicConfig } from './auth-provider.types';
|
|
2
|
+
export declare class BasicAuthProvider implements AuthProvider {
|
|
3
|
+
_config: AuthProviderBasicConfig;
|
|
4
|
+
get header(): {
|
|
5
|
+
Authorization: string;
|
|
6
|
+
};
|
|
7
|
+
private get _basicAuthString();
|
|
8
|
+
constructor(_config: AuthProviderBasicConfig);
|
|
9
|
+
cleanUp(): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AnyQueryCreator, ConstructQuery } from '../query-creator';
|
|
2
|
+
import { AuthProvider, AuthProviderBearerConfig, TokenResponse } from './auth-provider.types';
|
|
3
|
+
export declare class BearerAuthProvider<T extends AnyQueryCreator> implements AuthProvider {
|
|
4
|
+
_config: AuthProviderBearerConfig<T>;
|
|
5
|
+
private readonly _destroy$;
|
|
6
|
+
private readonly _currentRefreshQuery$;
|
|
7
|
+
private readonly _tokens$;
|
|
8
|
+
get header(): {
|
|
9
|
+
Authorization: string;
|
|
10
|
+
};
|
|
11
|
+
get tokens$(): import("rxjs").Observable<TokenResponse>;
|
|
12
|
+
get tokens(): TokenResponse;
|
|
13
|
+
get currentRefreshQuery$(): import("rxjs").Observable<ConstructQuery<T> | null>;
|
|
14
|
+
get currentRefreshQuery(): ConstructQuery<T> | null;
|
|
15
|
+
get shouldRefreshOnUnauthorizedResponse(): boolean;
|
|
16
|
+
constructor(_config: AuthProviderBearerConfig<T>);
|
|
17
|
+
cleanUp(): void;
|
|
18
|
+
enableCookie(): void;
|
|
19
|
+
disableCookie(): void;
|
|
20
|
+
private _setCookie;
|
|
21
|
+
private _deleteCookie;
|
|
22
|
+
private _prepareForRefresh;
|
|
23
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AuthProvider, AuthProviderCustomHeaderConfig } from './auth-provider.types';
|
|
2
|
+
export declare class CustomHeaderAuthProvider implements AuthProvider {
|
|
3
|
+
_config: AuthProviderCustomHeaderConfig;
|
|
4
|
+
get header(): {
|
|
5
|
+
[x: string]: string;
|
|
6
|
+
};
|
|
7
|
+
constructor(_config: AuthProviderCustomHeaderConfig);
|
|
8
|
+
cleanUp(): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { TrackByFunction } from '@angular/core';
|
|
2
|
+
import { FormControl } from '@angular/forms';
|
|
3
|
+
import { BehaviorSubject } from 'rxjs';
|
|
4
|
+
import { BasicAuthProvider, CustomHeaderAuthProvider } from '../../../auth';
|
|
5
|
+
import { EntityStore } from '../../../entity';
|
|
6
|
+
import { AnyQuery } from '../../../query';
|
|
7
|
+
import { QueryClientDevtoolsOptions } from '../../utils';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
type QueryDevtoolsSnapLayout = 'full' | 'left' | 'right' | 'bottom' | 'top';
|
|
10
|
+
type QueryListMode = 'live' | 'history';
|
|
11
|
+
type QueryViewMode = 'query' | 'authProvider';
|
|
12
|
+
export declare class QueryDevtoolsComponent {
|
|
13
|
+
private readonly _cdr;
|
|
14
|
+
protected readonly _destroy$: import("rxjs").Observable<boolean>;
|
|
15
|
+
protected readonly queryClientConfigs: QueryClientDevtoolsOptions[];
|
|
16
|
+
protected readonly isOpen: import("@angular/core").WritableSignal<boolean>;
|
|
17
|
+
protected readonly isTranslucent: import("@angular/core").WritableSignal<boolean>;
|
|
18
|
+
protected readonly snapLayout: import("@angular/core").WritableSignal<QueryDevtoolsSnapLayout>;
|
|
19
|
+
protected readonly queryListMode: import("@angular/core").WritableSignal<QueryListMode>;
|
|
20
|
+
protected readonly viewMode: import("@angular/core").WritableSignal<QueryViewMode>;
|
|
21
|
+
protected showResponse: import("@angular/core").WritableSignal<boolean>;
|
|
22
|
+
protected showRawResponse: import("@angular/core").WritableSignal<boolean>;
|
|
23
|
+
protected showQueryConfig: import("@angular/core").WritableSignal<boolean>;
|
|
24
|
+
protected showEntityStoreValue: import("@angular/core").WritableSignal<boolean>;
|
|
25
|
+
protected showArguments: import("@angular/core").WritableSignal<boolean>;
|
|
26
|
+
protected selectedClientIdCtrl: FormControl<number | null>;
|
|
27
|
+
protected readonly selectedClientId: import("@angular/core").Signal<number | null | undefined>;
|
|
28
|
+
protected readonly selectedQueryId: import("@angular/core").WritableSignal<number | null>;
|
|
29
|
+
protected readonly selectedClientConfig: import("@angular/core").Signal<QueryClientDevtoolsOptions>;
|
|
30
|
+
protected readonly queryStore: import("@angular/core").Signal<import("@ethlete/query").QueryStore>;
|
|
31
|
+
protected readonly queryStore$: import("rxjs").Observable<import("@ethlete/query").QueryStore>;
|
|
32
|
+
private readonly _queries$;
|
|
33
|
+
protected readonly queries: import("@angular/core").Signal<AnyQuery[] | undefined>;
|
|
34
|
+
protected readonly selectedQuery: import("@angular/core").Signal<AnyQuery | null>;
|
|
35
|
+
protected readonly selectedQuery$: import("rxjs").Observable<AnyQuery | null>;
|
|
36
|
+
protected selectedQueryEntityStore: import("@angular/core").Signal<EntityStore<unknown> | null>;
|
|
37
|
+
protected readonly selectedQueryEntityStore$: import("rxjs").Observable<EntityStore<unknown> | null>;
|
|
38
|
+
protected readonly selectedQueryEntityStoreValue$: import("rxjs").Observable<Record<string, unknown> | null>;
|
|
39
|
+
protected readonly queryHistory$: BehaviorSubject<AnyQuery[]>;
|
|
40
|
+
protected readonly stringifiedQueryConfig: import("@angular/core").Signal<{
|
|
41
|
+
query: string;
|
|
42
|
+
transferVia: import("../../../query").GqlTransferOption | undefined;
|
|
43
|
+
method: import("@ethlete/query").Method;
|
|
44
|
+
secure: boolean | undefined;
|
|
45
|
+
route: any;
|
|
46
|
+
reportProgress: boolean | undefined;
|
|
47
|
+
responseType: "arraybuffer" | "blob" | "json" | "text" | undefined;
|
|
48
|
+
withCredentials: boolean | undefined;
|
|
49
|
+
autoRefreshOn: import("../../../query").QueryAutoRefreshConfig | undefined;
|
|
50
|
+
enableSmartPolling: boolean | undefined;
|
|
51
|
+
hasEntityStore: boolean;
|
|
52
|
+
} | {
|
|
53
|
+
method: import("@ethlete/query").Method;
|
|
54
|
+
secure: boolean | undefined;
|
|
55
|
+
route: any;
|
|
56
|
+
reportProgress: boolean | undefined;
|
|
57
|
+
responseType: "arraybuffer" | "blob" | "json" | "text" | undefined;
|
|
58
|
+
withCredentials: boolean | undefined;
|
|
59
|
+
autoRefreshOn: import("../../../query").QueryAutoRefreshConfig | undefined;
|
|
60
|
+
enableSmartPolling: boolean | undefined;
|
|
61
|
+
hasEntityStore: boolean;
|
|
62
|
+
} | null>;
|
|
63
|
+
protected readonly authProvider: import("@angular/core").Signal<import("../../../auth").AuthProvider | null | undefined>;
|
|
64
|
+
protected readonly authProviderDetails: import("@angular/core").Signal<{
|
|
65
|
+
readonly type: "CustomHeaderAuthProvider";
|
|
66
|
+
readonly header: () => {
|
|
67
|
+
[x: string]: string;
|
|
68
|
+
};
|
|
69
|
+
readonly provider: CustomHeaderAuthProvider;
|
|
70
|
+
readonly config: {
|
|
71
|
+
readonly name: string;
|
|
72
|
+
readonly value: string;
|
|
73
|
+
readonly username?: undefined;
|
|
74
|
+
readonly password?: undefined;
|
|
75
|
+
readonly token?: undefined;
|
|
76
|
+
readonly refreshConfig?: undefined;
|
|
77
|
+
};
|
|
78
|
+
} | {
|
|
79
|
+
readonly type: "BasicAuthProvider";
|
|
80
|
+
readonly header: () => {
|
|
81
|
+
Authorization: string;
|
|
82
|
+
};
|
|
83
|
+
readonly provider: BasicAuthProvider;
|
|
84
|
+
readonly config: {
|
|
85
|
+
readonly username: string;
|
|
86
|
+
readonly password: string;
|
|
87
|
+
readonly name?: undefined;
|
|
88
|
+
readonly value?: undefined;
|
|
89
|
+
readonly token?: undefined;
|
|
90
|
+
readonly refreshConfig?: undefined;
|
|
91
|
+
};
|
|
92
|
+
} | {
|
|
93
|
+
readonly type: "BearerAuthProvider";
|
|
94
|
+
readonly header: () => {
|
|
95
|
+
Authorization: string;
|
|
96
|
+
};
|
|
97
|
+
readonly provider: import("../../../auth").BearerAuthProvider<import("@ethlete/query").AnyQueryCreator>;
|
|
98
|
+
readonly config: {
|
|
99
|
+
readonly token: string | undefined;
|
|
100
|
+
readonly refreshConfig: {
|
|
101
|
+
readonly refreshOnUnauthorizedResponse: boolean | "true (default)";
|
|
102
|
+
readonly token: string | undefined;
|
|
103
|
+
readonly cookieName: string | undefined;
|
|
104
|
+
readonly cookieDomain: string;
|
|
105
|
+
readonly cookieExpiresInDays: number | "30 (default)";
|
|
106
|
+
readonly cookiePath: string;
|
|
107
|
+
readonly cookieEnabled: boolean | "true (default)";
|
|
108
|
+
readonly cookieSameSite: "strict" | "none" | "lax" | "lax (default)";
|
|
109
|
+
readonly refreshBuffer: number | "30000 (default)";
|
|
110
|
+
readonly expiresInPropertyName: string;
|
|
111
|
+
readonly strategy: import("../../../auth").AuthBearerRefreshStrategy | "AuthBearerRefreshStrategy.BeforeExpiration (default)";
|
|
112
|
+
readonly requestArgsAdapter: "custom" | "default";
|
|
113
|
+
readonly responseAdapter: "custom" | "default";
|
|
114
|
+
};
|
|
115
|
+
readonly name?: undefined;
|
|
116
|
+
readonly value?: undefined;
|
|
117
|
+
readonly username?: undefined;
|
|
118
|
+
readonly password?: undefined;
|
|
119
|
+
};
|
|
120
|
+
} | {
|
|
121
|
+
readonly type: "UnknownAuthProvider";
|
|
122
|
+
readonly header: () => Record<string, string>;
|
|
123
|
+
readonly provider: import("../../../auth").AuthProvider;
|
|
124
|
+
readonly config: {
|
|
125
|
+
readonly name?: undefined;
|
|
126
|
+
readonly value?: undefined;
|
|
127
|
+
readonly username?: undefined;
|
|
128
|
+
readonly password?: undefined;
|
|
129
|
+
readonly token?: undefined;
|
|
130
|
+
readonly refreshConfig?: undefined;
|
|
131
|
+
};
|
|
132
|
+
} | null>;
|
|
133
|
+
constructor();
|
|
134
|
+
protected trackByClient: TrackByFunction<QueryClientDevtoolsOptions>;
|
|
135
|
+
protected trackByQuery: TrackByFunction<AnyQuery>;
|
|
136
|
+
protected toggleOpen(): void;
|
|
137
|
+
protected toggleTranslucent(): void;
|
|
138
|
+
protected toggleShowResponse(): void;
|
|
139
|
+
protected toggleShowQueryConfig(): void;
|
|
140
|
+
protected toggleShowRawResponse(): void;
|
|
141
|
+
protected toggleShowEntityStoreValue(): void;
|
|
142
|
+
protected toggleShowArguments(): void;
|
|
143
|
+
protected selectSnapLayout(layout: QueryDevtoolsSnapLayout): void;
|
|
144
|
+
protected selectQueryListMode(mode: QueryListMode): void;
|
|
145
|
+
protected selectViewMode(mode: QueryViewMode): void;
|
|
146
|
+
protected selectQuery(query: AnyQuery): void;
|
|
147
|
+
protected clearQueryHistory(): void;
|
|
148
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<QueryDevtoolsComponent, never>;
|
|
149
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<QueryDevtoolsComponent, "et-query-devtools", never, {}, {}, never, never, true, never>;
|
|
150
|
+
}
|
|
151
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import { AnyQuery } from '../../query';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class QueryShortNamePipe implements PipeTransform {
|
|
5
|
+
transform(value: AnyQuery): string;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<QueryShortNamePipe, never>;
|
|
7
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<QueryShortNamePipe, "queryShortName", true>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { QueryClient } from '../../query-client';
|
|
3
|
+
export interface QueryClientDevtoolsOptions {
|
|
4
|
+
displayName?: string;
|
|
5
|
+
client: QueryClient;
|
|
6
|
+
}
|
|
7
|
+
export declare const QUERY_CLIENT_DEVTOOLS_TOKEN: InjectionToken<QueryClientDevtoolsOptions[]>;
|
|
8
|
+
export declare const provideQueryClientForDevtools: (queryClient: QueryClientDevtoolsOptions) => {
|
|
9
|
+
provide: InjectionToken<QueryClientDevtoolsOptions[]>;
|
|
10
|
+
useValue: QueryClientDevtoolsOptions;
|
|
11
|
+
multi: boolean;
|
|
12
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class InfinityQueryTriggerDirective implements OnInit, OnDestroy {
|
|
4
|
+
private _elementRef;
|
|
5
|
+
private _infinityQuery;
|
|
6
|
+
private _destroy;
|
|
7
|
+
private _observer;
|
|
8
|
+
click$: import("rxjs").Observable<unknown>;
|
|
9
|
+
scrollContainerSelector: string | null;
|
|
10
|
+
ngOnInit(): void;
|
|
11
|
+
ngOnDestroy(): void;
|
|
12
|
+
private _setupIntersectionObserver;
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<InfinityQueryTriggerDirective, never>;
|
|
14
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<InfinityQueryTriggerDirective, "[etInfinityQueryTrigger], et-infinity-query-trigger", never, { "scrollContainerSelector": { "alias": "scrollContainerSelector"; "required": false; }; }, {}, never, never, true, never>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { InfinityQueryConfig, InfinityQueryOf } from '../infinite-query';
|
|
3
|
+
import { BaseArguments } from '../query';
|
|
4
|
+
import { AnyQueryCreator, ConstructQuery } from '../query-creator';
|
|
5
|
+
import { RequestError } from '../request';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
import * as i1 from "@ethlete/core";
|
|
8
|
+
interface InfinityQueryContext<Q extends InfinityQueryConfig<AnyQueryCreator, BaseArguments | undefined, any, unknown[]>> {
|
|
9
|
+
$implicit: Q['response']['arrayType'] | null;
|
|
10
|
+
etInfinityQuery: Q['response']['arrayType'] | null;
|
|
11
|
+
loading: boolean;
|
|
12
|
+
error: RequestError<unknown> | null;
|
|
13
|
+
isFirstLoad: boolean;
|
|
14
|
+
canLoadMore: boolean;
|
|
15
|
+
currentPage: number | null;
|
|
16
|
+
currentCalculatedPage: number | null;
|
|
17
|
+
totalPages: number | null;
|
|
18
|
+
itemsPerPage: number | null;
|
|
19
|
+
currentQuery: ConstructQuery<Q['queryCreator']> | null;
|
|
20
|
+
}
|
|
21
|
+
export declare const INFINITY_QUERY_TOKEN: InjectionToken<InfinityQueryDirective<any>>;
|
|
22
|
+
export declare class InfinityQueryDirective<Q extends InfinityQueryConfig<AnyQueryCreator, BaseArguments | undefined, any, unknown[]>> {
|
|
23
|
+
private readonly _queryConfigChanged$;
|
|
24
|
+
private readonly _viewContext;
|
|
25
|
+
private _infinityQueryInstance;
|
|
26
|
+
private readonly _destroy$;
|
|
27
|
+
private readonly _cdr;
|
|
28
|
+
private readonly _viewContainerRef;
|
|
29
|
+
private readonly _mainTemplateRef;
|
|
30
|
+
private readonly _errorHandler;
|
|
31
|
+
private readonly _delayable;
|
|
32
|
+
private readonly _data$;
|
|
33
|
+
get infinityQuery(): Q;
|
|
34
|
+
set infinityQuery(v: Q);
|
|
35
|
+
private _infinityQuery;
|
|
36
|
+
get context(): InfinityQueryContext<Q>;
|
|
37
|
+
get instance(): InfinityQueryOf<Q> | null;
|
|
38
|
+
get data$(): import("rxjs").Observable<Q["response"]["arrayType"]>;
|
|
39
|
+
data: import("@angular/core").Signal<Q["response"]["arrayType"]>;
|
|
40
|
+
static ngTemplateContextGuard<Q extends InfinityQueryConfig<AnyQueryCreator, BaseArguments | undefined, any, unknown[]>>(dir: InfinityQueryDirective<Q>, ctx: unknown): ctx is InfinityQueryContext<Q>;
|
|
41
|
+
constructor();
|
|
42
|
+
private _setupInfinityQuery;
|
|
43
|
+
loadNextPage(): void;
|
|
44
|
+
reset(newConfig?: Omit<Q, 'queryCreator' | 'response'>): void;
|
|
45
|
+
private _cleanup;
|
|
46
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<InfinityQueryDirective<any>, never>;
|
|
47
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<InfinityQueryDirective<any>, "[etInfinityQuery]", ["etInfinityQuery"], { "infinityQuery": { "alias": "etInfinityQuery"; "required": false; }; }, {}, never, never, true, [{ directive: typeof i1.DelayableDirective; inputs: {}; outputs: {}; }]>;
|
|
48
|
+
}
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { AnyQuery, AnyQueryCollection, QueryCollectionKeysOf, QueryOf } from '../query';
|
|
3
|
+
import { QueryDataOf } from '../query-creator';
|
|
4
|
+
import { RequestError, RequestProgress } from '../request';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
interface QueryContext<Q extends AnyQuery | AnyQueryCollection | null> {
|
|
7
|
+
/**
|
|
8
|
+
* The queries's response data.
|
|
9
|
+
*/
|
|
10
|
+
$implicit: QueryDataOf<QueryOf<Q>> | null;
|
|
11
|
+
/**
|
|
12
|
+
* The queries's response data.
|
|
13
|
+
*/
|
|
14
|
+
etQuery: QueryDataOf<QueryOf<Q>> | null;
|
|
15
|
+
/**
|
|
16
|
+
* The query used inside this directive. Useful if for instance the query gets unwrapped via async pipe inside the directive.
|
|
17
|
+
*/
|
|
18
|
+
query: QueryOf<Q> | null;
|
|
19
|
+
/**
|
|
20
|
+
* Is true when the query is triggered by user interaction.
|
|
21
|
+
*/
|
|
22
|
+
loading: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Is true when the query is triggered by either polling or auto refresh event.
|
|
25
|
+
*/
|
|
26
|
+
refreshing: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* The query's progress state.
|
|
29
|
+
*/
|
|
30
|
+
progress: RequestProgress | null;
|
|
31
|
+
/**
|
|
32
|
+
* The query's error state.
|
|
33
|
+
*/
|
|
34
|
+
error: RequestError<unknown> | null;
|
|
35
|
+
/**
|
|
36
|
+
* The query's scope (only available when the query is a collection)
|
|
37
|
+
*/
|
|
38
|
+
scope: QueryCollectionKeysOf<Q> | null;
|
|
39
|
+
}
|
|
40
|
+
export declare class QueryDirective<Q extends AnyQuery | AnyQueryCollection | null> implements OnInit, OnDestroy {
|
|
41
|
+
private _mainTemplateRef;
|
|
42
|
+
private _viewContainerRef;
|
|
43
|
+
private _errorHandler;
|
|
44
|
+
private _cdr;
|
|
45
|
+
private _isMainViewCreated;
|
|
46
|
+
private _subscription;
|
|
47
|
+
private readonly _viewContext;
|
|
48
|
+
get query(): Q;
|
|
49
|
+
set query(v: Q);
|
|
50
|
+
private _query;
|
|
51
|
+
get cache(): boolean;
|
|
52
|
+
set cache(v: boolean);
|
|
53
|
+
private _cache;
|
|
54
|
+
static ngTemplateContextGuard<Q extends AnyQuery | AnyQueryCollection | null>(dir: QueryDirective<Q>, ctx: unknown): ctx is QueryContext<Q>;
|
|
55
|
+
ngOnInit(): void;
|
|
56
|
+
ngOnDestroy(): void;
|
|
57
|
+
private _subscribeToQuery;
|
|
58
|
+
private _updateView;
|
|
59
|
+
private _renderMainView;
|
|
60
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<QueryDirective<any>, never>;
|
|
61
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<QueryDirective<any>, "[etQuery]", never, { "query": { "alias": "etQuery"; "required": false; }; "cache": { "alias": "etQueryCache"; "required": false; }; }, {}, never, never, true, never>;
|
|
62
|
+
}
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { EntityKey, EntityStoreConfig } from './entity.types';
|
|
3
|
+
export declare class EntityStore<T> {
|
|
4
|
+
private readonly _config;
|
|
5
|
+
constructor(_config: EntityStoreConfig);
|
|
6
|
+
select(key: EntityKey): Observable<T | null>;
|
|
7
|
+
select(keys: EntityKey[]): Observable<T[]>;
|
|
8
|
+
select(keys: EntityKey[][]): Observable<T[]>;
|
|
9
|
+
/**
|
|
10
|
+
* **Note:** Prefer `select` over `selectWhere` when possible.
|
|
11
|
+
*/
|
|
12
|
+
selectWhere(predicate: (value: T) => boolean): Observable<T[]>;
|
|
13
|
+
set(key: EntityKey, value: T): void;
|
|
14
|
+
set(keys: EntityKey[], values: T[]): void;
|
|
15
|
+
set(keys: EntityKey[][], values: T[][]): void;
|
|
16
|
+
remove(key: EntityKey): void;
|
|
17
|
+
remove(keys: EntityKey[]): void;
|
|
18
|
+
remove(keys: EntityKey[][]): void;
|
|
19
|
+
logState(): void;
|
|
20
|
+
private _select;
|
|
21
|
+
private _selectMany;
|
|
22
|
+
private _set;
|
|
23
|
+
private _remove;
|
|
24
|
+
private _normalizeKeys;
|
|
25
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type EntityKey = string | number;
|
|
2
|
+
export interface EntityStoreConfig {
|
|
3
|
+
name: string;
|
|
4
|
+
logActions?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface InsertFromConfig<OriginStoreType, OriginKeys extends keyof NonNullable<OriginStoreType>, IdFn extends (value: NonNullable<OriginStoreType>) => EntityKey | EntityKey[]> {
|
|
7
|
+
/**
|
|
8
|
+
* The property key of which the value should be replaced.
|
|
9
|
+
*/
|
|
10
|
+
for: OriginKeys;
|
|
11
|
+
/**
|
|
12
|
+
* A function that returns the id of the entity. Can also return an array of ids.
|
|
13
|
+
*/
|
|
14
|
+
id: IdFn;
|
|
15
|
+
}
|
|
16
|
+
export interface RemoveFromConfig<T> {
|
|
17
|
+
/**
|
|
18
|
+
* The where function to select the entities to remove.
|
|
19
|
+
*/
|
|
20
|
+
where: (entity: T) => boolean;
|
|
21
|
+
/**
|
|
22
|
+
* A function that returns the id of the entity.
|
|
23
|
+
*/
|
|
24
|
+
id: (entity: T) => EntityKey;
|
|
25
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Paginated } from '@ethlete/types';
|
|
2
|
+
import { EntityStore } from './entity-store';
|
|
3
|
+
import { EntityKey, InsertFromConfig, RemoveFromConfig } from './entity.types';
|
|
4
|
+
export declare function mapToPaginated<T>(response: Paginated<T>): import("rxjs").OperatorFunction<unknown, Paginated<T>>;
|
|
5
|
+
/**
|
|
6
|
+
* Use an other store to represent a property of the current entity.
|
|
7
|
+
*/
|
|
8
|
+
export declare const insertFrom: <OriginStoreType, OriginKeys extends keyof NonNullable<OriginStoreType>, SubStoreType extends NonNullable<OriginStoreType>[OriginKeys] extends Array<infer U> ? U : NonNullable<OriginStoreType>[OriginKeys], IdFn extends (value: NonNullable<OriginStoreType>) => EntityKey | EntityKey[], ComputedEntityType extends ReturnType<IdFn> extends Array<unknown> ? OriginStoreType : Omit<OriginStoreType, OriginKeys> & { [K in OriginKeys]: SubStoreType | null; }>(store: EntityStore<SubStoreType>, { for: key, id }: InsertFromConfig<OriginStoreType, OriginKeys, IdFn>) => import("rxjs").OperatorFunction<OriginStoreType, ComputedEntityType | null>;
|
|
9
|
+
/**
|
|
10
|
+
* Remove entities from a store based on a where function.
|
|
11
|
+
*/
|
|
12
|
+
export declare const removeFrom: <T>(store: EntityStore<T>, { where, id }: RemoveFromConfig<T>) => void;
|
package/lib/gql/gql.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const transformGql: (str: string) => (variables: Record<string, unknown> | null | undefined) => {
|
|
2
|
+
query: string;
|
|
3
|
+
variables?: string;
|
|
4
|
+
operationName?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const gql: (strings: TemplateStringsArray, ...values: string[]) => string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { AnyQueryCreator, ConstructQuery, QueryArgsOf, QueryDataOf } from '../query-creator';
|
|
3
|
+
import { InfinityQueryConfig } from './infinity-query.types';
|
|
4
|
+
export declare class InfinityQuery<QueryCreator extends AnyQueryCreator, Query extends ConstructQuery<QueryCreator>, Args extends QueryArgsOf<QueryCreator>, QueryResponse extends QueryDataOf<QueryCreator>, InfinityResponse extends unknown[]> {
|
|
5
|
+
private _config;
|
|
6
|
+
private _destroy$;
|
|
7
|
+
private readonly _queries$;
|
|
8
|
+
private readonly _currentPage$;
|
|
9
|
+
private readonly _currentCalculatedPage$;
|
|
10
|
+
private readonly _totalPages$;
|
|
11
|
+
private readonly _itemsPerPage$;
|
|
12
|
+
private readonly _data$;
|
|
13
|
+
private readonly _lastQuery$;
|
|
14
|
+
get currentPage$(): Observable<number | null>;
|
|
15
|
+
get currentPage(): number | null;
|
|
16
|
+
get currentCalculatedPage$(): Observable<number | null>;
|
|
17
|
+
get currentCalculatedPage(): number | null;
|
|
18
|
+
get totalPages$(): Observable<number | null>;
|
|
19
|
+
get totalPages(): number | null;
|
|
20
|
+
get itemsPerPage$(): Observable<number>;
|
|
21
|
+
get itemsPerPage(): number;
|
|
22
|
+
get data$(): Observable<InfinityResponse | null>;
|
|
23
|
+
get currentQuery$(): Observable<Query | null>;
|
|
24
|
+
constructor(_config: InfinityQueryConfig<QueryCreator, Args, QueryResponse, InfinityResponse>, _destroy$: Observable<boolean>);
|
|
25
|
+
nextPage(): void;
|
|
26
|
+
reset(newConfig?: Omit<InfinityQueryConfig<QueryCreator, Args, QueryResponse, InfinityResponse>, 'queryCreator' | 'response'>): void;
|
|
27
|
+
private _prepareArgs;
|
|
28
|
+
private _getPageParamLocation;
|
|
29
|
+
}
|