@ethlete/query 5.23.0 → 5.24.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/CHANGELOG.md +6 -0
- package/fesm2022/ethlete-query.mjs +1039 -651
- package/fesm2022/ethlete-query.mjs.map +1 -1
- package/lib/experimental/{bearer-auth-provider-config.d.ts → auth/bearer-auth-provider-config.d.ts} +1 -3
- package/lib/experimental/{bearer-auth-provider.d.ts → auth/bearer-auth-provider.d.ts} +1 -1
- package/lib/experimental/auth/index.d.ts +2 -0
- package/lib/experimental/gql/gql-query-creator-templates.d.ts +11 -0
- package/lib/experimental/gql/gql-query-creator.d.ts +14 -0
- package/lib/experimental/gql/gql-query-execute.d.ts +11 -0
- package/lib/experimental/gql/gql-query.d.ts +12 -0
- package/lib/experimental/gql/index.d.ts +4 -0
- package/lib/experimental/http/index.d.ts +20 -0
- package/lib/experimental/http/paged-query-stack.d.ts +149 -0
- package/lib/experimental/http/query-client-config.d.ts +45 -0
- package/lib/experimental/{query-creator-templates.d.ts → http/query-creator-templates.d.ts} +11 -1
- package/lib/experimental/http/query-creator.d.ts +73 -0
- package/lib/experimental/{query-dependencies.d.ts → http/query-dependencies.d.ts} +5 -0
- package/lib/experimental/http/query-errors.d.ts +50 -0
- package/lib/experimental/{query-execute-utils.d.ts → http/query-execute-utils.d.ts} +15 -2
- package/lib/experimental/{query-execute.d.ts → http/query-execute.d.ts} +5 -3
- package/lib/experimental/http/query-features.d.ts +85 -0
- package/lib/experimental/{query-repository.d.ts → http/query-repository.d.ts} +3 -1
- package/lib/experimental/{query-snapshot.d.ts → http/query-snapshot.d.ts} +2 -2
- package/lib/experimental/http/query-stack.d.ts +101 -0
- package/lib/experimental/{query-utils.d.ts → http/query-utils.d.ts} +25 -15
- package/lib/experimental/{query.d.ts → http/query.d.ts} +24 -2
- package/lib/experimental/{secure-query-creator.d.ts → http/secure-query-creator.d.ts} +1 -1
- package/lib/experimental/{secure-query-execute.d.ts → http/secure-query-execute.d.ts} +2 -2
- package/lib/experimental/index.d.ts +4 -22
- package/lib/experimental/ws/index.d.ts +2 -0
- package/lib/experimental/ws/web-socket-client-config.d.ts +12 -0
- package/lib/experimental/ws/web-socket-client.d.ts +20 -0
- package/lib/experimental/ws/web-socket-errors.d.ts +9 -0
- package/lib/gql/gql.d.ts +3 -2
- package/package.json +8 -7
- package/lib/experimental/paged-query.d.ts +0 -77
- package/lib/experimental/query-client-config.d.ts +0 -18
- package/lib/experimental/query-creator.d.ts +0 -39
- package/lib/experimental/query-errors.d.ts +0 -49
- package/lib/experimental/query-features.d.ts +0 -48
- package/lib/experimental/query-stack.d.ts +0 -48
- /package/lib/experimental/{http-request.d.ts → http/http-request.d.ts} +0 -0
- /package/lib/experimental/{query-client.d.ts → http/query-client.d.ts} +0 -0
- /package/lib/experimental/{query-state.d.ts → http/query-state.d.ts} +0 -0
- /package/lib/experimental/{secure-query.d.ts → http/secure-query.d.ts} +0 -0
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { HttpErrorResponse } from '@angular/common/http';
|
|
2
|
-
import { Signal } from '@angular/core';
|
|
3
|
-
import { AnyQuery } from './query';
|
|
4
|
-
export type QueryStack<T extends AnyQuery, J = ReturnType<T['response']>[]> = {
|
|
5
|
-
/** Contains all queries in the stack. */
|
|
6
|
-
queries: Signal<T[]>;
|
|
7
|
-
/** Contains the last query in the stack. Useful for getting current pagination values. */
|
|
8
|
-
lastQuery: Signal<T | null>;
|
|
9
|
-
/** True if any query in the stack is loading. */
|
|
10
|
-
loading: Signal<boolean>;
|
|
11
|
-
/** Contains the first error that occurred in the stack. */
|
|
12
|
-
error: Signal<HttpErrorResponse | null>;
|
|
13
|
-
/** Contains the responses of all queries in the stack. Will be `null` for queries that are loading or errored. */
|
|
14
|
-
response: Signal<J>;
|
|
15
|
-
/** Executes all queries in the stack. */
|
|
16
|
-
execute: (options?: {
|
|
17
|
-
allowCache?: boolean;
|
|
18
|
-
}) => void;
|
|
19
|
-
/** Destroys all queries in the stack and empties it. This should only be used if `append` is true. */
|
|
20
|
-
clear: () => void;
|
|
21
|
-
};
|
|
22
|
-
export type AnyQueryStack = QueryStack<AnyQuery>;
|
|
23
|
-
export type CreateQueryStackOptions<T extends AnyQuery, J = ReturnType<T['response']>[]> = {
|
|
24
|
-
/**
|
|
25
|
-
* If true, new queries will be appended to the existing ones. Otherwise, existing queries will be destroyed.
|
|
26
|
-
* This should be used for things like infinite scrolling where already fetched queries should not be destroyed.
|
|
27
|
-
*/
|
|
28
|
-
append?: boolean;
|
|
29
|
-
/**
|
|
30
|
-
* If append is true, this function will be called to merge the old and new queries.
|
|
31
|
-
* Useful if you want to append the new queries in a specific order (e.g. at the beginning).
|
|
32
|
-
*/
|
|
33
|
-
appendFn?: (oldQueries: T[], newQueries: T[]) => {
|
|
34
|
-
/** The new queries merged with the old ones. */
|
|
35
|
-
queries: T[];
|
|
36
|
-
/** The last query in the new queries. */
|
|
37
|
-
lastQuery: T | null;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Transforms the responses of all queries in the stack. Useful for merging or filtering responses.
|
|
41
|
-
*/
|
|
42
|
-
transform?: (responses: ReturnType<T['response']>[]) => J;
|
|
43
|
-
};
|
|
44
|
-
export declare const transformArrayResponse: <T extends (unknown | null)[]>(responses: T) => NonNullable<T[0]>[];
|
|
45
|
-
export declare const transformPaginatedResponse: <T extends ({
|
|
46
|
-
items: unknown[];
|
|
47
|
-
} | null)[]>(responses: T) => NonNullable<NonNullable<T[0]>["items"]>;
|
|
48
|
-
export declare const createQueryStack: <T extends AnyQuery, J = ReturnType<T["response"]>[]>(computation: () => T | T[] | null, options?: CreateQueryStackOptions<T, J>) => QueryStack<T, J>;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|