@ttt-productions/query-core 0.14.22 → 0.14.23
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/README.md +6 -6
- package/dist/defaults.d.ts +0 -15
- package/dist/defaults.d.ts.map +1 -1
- package/dist/defaults.js +0 -15
- package/dist/defaults.js.map +1 -1
- package/dist/firestore/types.d.ts +1 -49
- package/dist/firestore/types.d.ts.map +1 -1
- package/dist/firestore/types.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/keys.d.ts +0 -22
- package/dist/keys.d.ts.map +1 -1
- package/dist/keys.js +0 -4
- package/dist/keys.js.map +1 -1
- package/dist/react/cache-helpers.d.ts +0 -32
- package/dist/react/cache-helpers.d.ts.map +1 -1
- package/dist/react/cache-helpers.js +0 -28
- package/dist/react/cache-helpers.js.map +1 -1
- package/dist/react/defaults.d.ts +0 -4
- package/dist/react/defaults.d.ts.map +1 -1
- package/dist/react/defaults.js +2 -6
- package/dist/react/defaults.js.map +1 -1
- package/dist/react/domain-events/cache-invalidation.d.ts +0 -37
- package/dist/react/domain-events/cache-invalidation.d.ts.map +1 -1
- package/dist/react/domain-events/cache-invalidation.js +4 -53
- package/dist/react/domain-events/cache-invalidation.js.map +1 -1
- package/dist/react/domain-events/create-domain-event-invalidator.d.ts +0 -18
- package/dist/react/domain-events/create-domain-event-invalidator.d.ts.map +1 -1
- package/dist/react/domain-events/create-domain-event-invalidator.js +0 -5
- package/dist/react/domain-events/create-domain-event-invalidator.js.map +1 -1
- package/dist/react/firestore/absence-scheduler.d.ts +0 -28
- package/dist/react/firestore/absence-scheduler.d.ts.map +1 -1
- package/dist/react/firestore/absence-scheduler.js +1 -39
- package/dist/react/firestore/absence-scheduler.js.map +1 -1
- package/dist/react/firestore/batch-doc-loader.d.ts +0 -30
- package/dist/react/firestore/batch-doc-loader.d.ts.map +1 -1
- package/dist/react/firestore/batch-doc-loader.js +0 -34
- package/dist/react/firestore/batch-doc-loader.js.map +1 -1
- package/dist/react/firestore/context.d.ts +0 -19
- package/dist/react/firestore/context.d.ts.map +1 -1
- package/dist/react/firestore/context.js +0 -19
- package/dist/react/firestore/context.js.map +1 -1
- package/dist/react/firestore/doc-subscription-registry.d.ts +0 -23
- package/dist/react/firestore/doc-subscription-registry.d.ts.map +1 -1
- package/dist/react/firestore/doc-subscription-registry.js +0 -25
- package/dist/react/firestore/doc-subscription-registry.js.map +1 -1
- package/dist/react/firestore/infinite-helpers.d.ts +0 -12
- package/dist/react/firestore/infinite-helpers.d.ts.map +1 -1
- package/dist/react/firestore/infinite-helpers.js +0 -12
- package/dist/react/firestore/infinite-helpers.js.map +1 -1
- package/dist/react/firestore/resubscribe.d.ts +0 -20
- package/dist/react/firestore/resubscribe.d.ts.map +1 -1
- package/dist/react/firestore/resubscribe.js +0 -20
- package/dist/react/firestore/resubscribe.js.map +1 -1
- package/dist/react/firestore/subscription-status.d.ts +0 -29
- package/dist/react/firestore/subscription-status.d.ts.map +1 -1
- package/dist/react/firestore/subscription-status.js +1 -34
- package/dist/react/firestore/subscription-status.js.map +1 -1
- package/dist/react/firestore/types.d.ts +0 -64
- package/dist/react/firestore/types.d.ts.map +1 -1
- package/dist/react/firestore/types.js +0 -3
- package/dist/react/firestore/types.js.map +1 -1
- package/dist/react/firestore/use-firestore-collection.d.ts +0 -20
- package/dist/react/firestore/use-firestore-collection.d.ts.map +1 -1
- package/dist/react/firestore/use-firestore-collection.js +1 -35
- package/dist/react/firestore/use-firestore-collection.js.map +1 -1
- package/dist/react/firestore/use-firestore-count.d.ts +0 -15
- package/dist/react/firestore/use-firestore-count.d.ts.map +1 -1
- package/dist/react/firestore/use-firestore-count.js +0 -15
- package/dist/react/firestore/use-firestore-count.js.map +1 -1
- package/dist/react/firestore/use-firestore-doc.d.ts +0 -23
- package/dist/react/firestore/use-firestore-doc.d.ts.map +1 -1
- package/dist/react/firestore/use-firestore-doc.js +3 -40
- package/dist/react/firestore/use-firestore-doc.js.map +1 -1
- package/dist/react/firestore/use-firestore-infinite.d.ts +0 -29
- package/dist/react/firestore/use-firestore-infinite.d.ts.map +1 -1
- package/dist/react/firestore/use-firestore-infinite.js +0 -32
- package/dist/react/firestore/use-firestore-infinite.js.map +1 -1
- package/dist/react/firestore/use-firestore-live-infinite.d.ts +0 -34
- package/dist/react/firestore/use-firestore-live-infinite.d.ts.map +1 -1
- package/dist/react/firestore/use-firestore-live-infinite.js +1 -35
- package/dist/react/firestore/use-firestore-live-infinite.js.map +1 -1
- package/dist/react/firestore/use-firestore-paginated.d.ts +0 -30
- package/dist/react/firestore/use-firestore-paginated.d.ts.map +1 -1
- package/dist/react/firestore/use-firestore-paginated.js +2 -33
- package/dist/react/firestore/use-firestore-paginated.js.map +1 -1
- package/dist/react/firestore/useBatchFirestoreDocs.d.ts +1 -123
- package/dist/react/firestore/useBatchFirestoreDocs.d.ts.map +1 -1
- package/dist/react/firestore/useBatchFirestoreDocs.js +5 -58
- package/dist/react/firestore/useBatchFirestoreDocs.js.map +1 -1
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +0 -13
- package/dist/react/index.js.map +1 -1
- package/dist/react/pending-mutations.d.ts +1 -21
- package/dist/react/pending-mutations.d.ts.map +1 -1
- package/dist/react/pending-mutations.js +1 -32
- package/dist/react/pending-mutations.js.map +1 -1
- package/dist/react/provider.d.ts +0 -5
- package/dist/react/provider.d.ts.map +1 -1
- package/dist/react/provider.js +0 -4
- package/dist/react/provider.js.map +1 -1
- package/dist/react/query-client.d.ts +0 -4
- package/dist/react/query-client.d.ts.map +1 -1
- package/dist/react/query-client.js +0 -4
- package/dist/react/query-client.js.map +1 -1
- package/dist/react/search/types.d.ts +0 -12
- package/dist/react/search/types.d.ts.map +1 -1
- package/dist/react/search/types.js.map +1 -1
- package/dist/react/search/use-firestore-search.d.ts +0 -29
- package/dist/react/search/use-firestore-search.d.ts.map +1 -1
- package/dist/react/search/use-firestore-search.js +3 -41
- package/dist/react/search/use-firestore-search.js.map +1 -1
- package/dist/react/use-read-retry-state.d.ts +1 -21
- package/dist/react/use-read-retry-state.d.ts.map +1 -1
- package/dist/react/use-read-retry-state.js +2 -21
- package/dist/react/use-read-retry-state.js.map +1 -1
- package/dist/search/rule.d.ts +0 -6
- package/dist/search/rule.d.ts.map +1 -1
- package/dist/search/rule.js +0 -6
- package/dist/search/rule.js.map +1 -1
- package/dist/search/types.d.ts +1 -13
- package/dist/search/types.d.ts.map +1 -1
- package/dist/search/types.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# @ttt-productions/query-core
|
|
2
2
|
|
|
3
|
-
Shared TanStack Query (React Query) setup for
|
|
3
|
+
Shared TanStack Query (React Query) setup and Firestore read hooks for consuming apps.
|
|
4
4
|
|
|
5
|
-
- `
|
|
6
|
-
- `
|
|
7
|
-
-
|
|
8
|
-
-
|
|
5
|
+
- `createQueryClient()` factory with safe defaults and `QueryProvider` (`./react`)
|
|
6
|
+
- `STALE_TIMES` presets and the search rule (root)
|
|
7
|
+
- `keys` query key helpers (`./keys`)
|
|
8
|
+
- the Firestore hooks, invalidation, and cache update helpers (`./react`)
|
|
9
9
|
|
|
10
|
-
No app business logic.
|
|
10
|
+
No app business logic. See `docs/packages/query-core.md`.
|
package/dist/defaults.d.ts
CHANGED
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Named `staleTime` presets (milliseconds) for React Query call sites.
|
|
3
|
-
*
|
|
4
|
-
* Use a preset instead of a magic number so every query self-documents how
|
|
5
|
-
* fresh its data must be:
|
|
6
|
-
* - `short` (30s) — frequently-changing counts/lists; matches the client default.
|
|
7
|
-
* - `medium` (5m) — semi-dynamic data that tolerates a few minutes of staleness.
|
|
8
|
-
* - `long` (30m) — rarely-changing data (public profiles, detail docs).
|
|
9
|
-
* - `forever` (∞) — immutable for the session, OR data whose freshness is driven
|
|
10
|
-
* entirely by explicit cache invalidation (a domain event), never
|
|
11
|
-
* by elapsed time. Do NOT use `forever` for data with no
|
|
12
|
-
* invalidation path — it will never refetch.
|
|
13
|
-
*
|
|
14
|
-
* Generic time buckets, not app-specific presets — safe to live in this package.
|
|
15
|
-
*/
|
|
16
1
|
export declare const STALE_TIMES: {
|
|
17
2
|
readonly short: 30000;
|
|
18
3
|
readonly medium: number;
|
package/dist/defaults.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW;;;;;CAKd,CAAC"}
|
package/dist/defaults.js
CHANGED
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Named `staleTime` presets (milliseconds) for React Query call sites.
|
|
3
|
-
*
|
|
4
|
-
* Use a preset instead of a magic number so every query self-documents how
|
|
5
|
-
* fresh its data must be:
|
|
6
|
-
* - `short` (30s) — frequently-changing counts/lists; matches the client default.
|
|
7
|
-
* - `medium` (5m) — semi-dynamic data that tolerates a few minutes of staleness.
|
|
8
|
-
* - `long` (30m) — rarely-changing data (public profiles, detail docs).
|
|
9
|
-
* - `forever` (∞) — immutable for the session, OR data whose freshness is driven
|
|
10
|
-
* entirely by explicit cache invalidation (a domain event), never
|
|
11
|
-
* by elapsed time. Do NOT use `forever` for data with no
|
|
12
|
-
* invalidation path — it will never refetch.
|
|
13
|
-
*
|
|
14
|
-
* Generic time buckets, not app-specific presets — safe to live in this package.
|
|
15
|
-
*/
|
|
16
1
|
export const STALE_TIMES = {
|
|
17
2
|
short: 30_000,
|
|
18
3
|
medium: 5 * 60_000,
|
package/dist/defaults.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,CAAC,GAAG,MAAM;IAClB,IAAI,EAAE,EAAE,GAAG,MAAM;IACjB,OAAO,EAAE,MAAM,CAAC,iBAAiB;CACzB,CAAC","sourcesContent":["export const STALE_TIMES = {\n short: 30_000,\n medium: 5 * 60_000,\n long: 30 * 60_000,\n forever: Number.POSITIVE_INFINITY,\n} as const;\n"]}
|
|
@@ -1,39 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Document with ID included in the data object.
|
|
3
|
-
*/
|
|
4
1
|
export type WithId<T> = T & {
|
|
5
2
|
id: string;
|
|
6
3
|
};
|
|
7
|
-
/**
|
|
8
|
-
* Metadata-derived liveness of a realtime subscription. Firestore serves cached
|
|
9
|
-
* snapshots offline WITHOUT firing the error callback, so error-only detection
|
|
10
|
-
* renders a stale cached empty result as "live". This four-state is derived from
|
|
11
|
-
* `snapshot.metadata.fromCache` (server-confirmed vs cache) plus the listener
|
|
12
|
-
* error callback:
|
|
13
|
-
* - `connecting` — no server-confirmed snapshot yet (initial, or only cache-first data).
|
|
14
|
-
* - `live` — at least one server-confirmed snapshot (`fromCache === false`).
|
|
15
|
-
* - `offline` — only cached data after having been live (connectivity loss).
|
|
16
|
-
* - `error` — the listener error callback fired (e.g. permission loss).
|
|
17
|
-
*
|
|
18
|
-
* Meaningful only for `subscribe: true`; a non-subscribed hook stays `connecting`.
|
|
19
|
-
*/
|
|
4
|
+
/** Firestore serves cached snapshots offline without firing the error callback, so liveness is read from `metadata.fromCache`. */
|
|
20
5
|
export type FirestoreSourceState = 'connecting' | 'live' | 'offline' | 'error';
|
|
21
|
-
/** A query-hook result augmented with the metadata-derived subscription source state. */
|
|
22
6
|
export type WithSourceState<R> = R & {
|
|
23
7
|
sourceState: FirestoreSourceState;
|
|
24
8
|
};
|
|
25
|
-
/**
|
|
26
|
-
* One requested id's answer from `useBatchFirestoreDocs`:
|
|
27
|
-
* - `loading` — no answer yet (nothing cached for the id, or the hook is disabled).
|
|
28
|
-
* - `present` — the document exists and is readable; `data` is it.
|
|
29
|
-
* - `absent` — the read succeeded and the document does not exist.
|
|
30
|
-
* - `failed` — the read (or, in subscribe mode, the listener) errored; `error` is the cause.
|
|
31
|
-
* A failure is never reported as `absent`, and a document cached before the failure is
|
|
32
|
-
* not reported as `present`. What a failure means for a given collection (a rules denial
|
|
33
|
-
* that stands for "not there for this reader", say) is the consumer's to decide from `error`.
|
|
34
|
-
* - A failed id stays `failed` through a retry of it, with the failure it showed and `retrying`
|
|
35
|
-
* true while the retry runs; an answer replaces it, a new failure replaces its `error`.
|
|
36
|
-
*/
|
|
37
9
|
export type BatchFirestoreDocOutcome<T> = {
|
|
38
10
|
status: 'loading';
|
|
39
11
|
} | {
|
|
@@ -46,42 +18,22 @@ export type BatchFirestoreDocOutcome<T> = {
|
|
|
46
18
|
error: Error;
|
|
47
19
|
retrying: boolean;
|
|
48
20
|
};
|
|
49
|
-
/**
|
|
50
|
-
* Base options shared across all Firestore hooks.
|
|
51
|
-
*/
|
|
52
21
|
export interface FirestoreBaseOptions {
|
|
53
|
-
/** React Query cache key */
|
|
54
22
|
queryKey: readonly unknown[];
|
|
55
|
-
/** Enable/disable the query */
|
|
56
23
|
enabled?: boolean;
|
|
57
|
-
/** Stale time override (ms) */
|
|
58
24
|
staleTime?: number;
|
|
59
|
-
/** Garbage collection time override (ms) */
|
|
60
25
|
gcTime?: number;
|
|
61
26
|
}
|
|
62
|
-
/**
|
|
63
|
-
* Options for document mutations.
|
|
64
|
-
*/
|
|
65
27
|
export interface FirestoreMutationOptions<T> {
|
|
66
|
-
/** Document path for single-doc mutations */
|
|
67
28
|
docPath?: string;
|
|
68
|
-
/** Query keys to invalidate on success */
|
|
69
29
|
invalidateKeys?: readonly unknown[][];
|
|
70
|
-
/** Enable optimistic updates */
|
|
71
30
|
optimistic?: {
|
|
72
|
-
/** Query key of the cache to update */
|
|
73
31
|
queryKey: readonly unknown[];
|
|
74
|
-
/** How to update the cached data */
|
|
75
32
|
updater: (oldData: T | undefined, newData: Partial<T>) => T;
|
|
76
33
|
};
|
|
77
34
|
}
|
|
78
|
-
/**
|
|
79
|
-
* Options for batch mutations.
|
|
80
|
-
*/
|
|
81
35
|
export interface FirestoreBatchOptions {
|
|
82
|
-
/** Query keys to invalidate on success */
|
|
83
36
|
invalidateKeys?: readonly unknown[][];
|
|
84
|
-
/** Max operations per batch (default: 450) */
|
|
85
37
|
batchSize?: number;
|
|
86
38
|
}
|
|
87
39
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/firestore/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/firestore/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3C,kIAAkI;AAClI,MAAM,MAAM,oBAAoB,GAAG,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAE/E,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,WAAW,EAAE,oBAAoB,CAAA;CAAE,CAAC;AAE3E,MAAM,MAAM,wBAAwB,CAAC,CAAC,IAClC;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE,GACrB;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,CAAC,CAAA;CAAE,GAC9B;IAAE,MAAM,EAAE,QAAQ,CAAA;CAAE,GACpB;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,KAAK,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CAAC;AAE1D,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAC;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,wBAAwB,CAAC,CAAC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,SAAS,OAAO,EAAE,EAAE,CAAC;IACtC,UAAU,CAAC,EAAE;QACX,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAC;QAC7B,OAAO,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;KAC7D,CAAC;CACH;AAED,MAAM,WAAW,qBAAqB;IACpC,cAAc,CAAC,EAAE,SAAS,OAAO,EAAE,EAAE,CAAC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/firestore/types.ts"],"names":[],"mappings":"","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/firestore/types.ts"],"names":[],"mappings":"","sourcesContent":["export type WithId<T> = T & { id: string };\n\n/** Firestore serves cached snapshots offline without firing the error callback, so liveness is read from `metadata.fromCache`. */\nexport type FirestoreSourceState = 'connecting' | 'live' | 'offline' | 'error';\n\nexport type WithSourceState<R> = R & { sourceState: FirestoreSourceState };\n\nexport type BatchFirestoreDocOutcome<T> =\n | { status: 'loading' }\n | { status: 'present'; data: T }\n | { status: 'absent' }\n | { status: 'failed'; error: Error; retrying: boolean };\n\nexport interface FirestoreBaseOptions {\n queryKey: readonly unknown[];\n enabled?: boolean;\n staleTime?: number;\n gcTime?: number;\n}\n\nexport interface FirestoreMutationOptions<T> {\n docPath?: string;\n invalidateKeys?: readonly unknown[][];\n optimistic?: {\n queryKey: readonly unknown[];\n updater: (oldData: T | undefined, newData: Partial<T>) => T;\n };\n}\n\nexport interface FirestoreBatchOptions {\n invalidateKeys?: readonly unknown[][];\n batchSize?: number;\n}\n"]}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,YAAY,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACrF,OAAO,EACL,2BAA2B,EAC3B,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// Query defaults & staleTime presets (server-safe — plain constants, no React runtime)
|
|
2
1
|
export { STALE_TIMES } from './defaults.js';
|
|
3
2
|
export { FIRESTORE_SEARCH_MIN_LENGTH, isSearchableText, normalizeSearchText, } from './search/rule.js';
|
|
4
3
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,EACL,2BAA2B,EAC3B,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC","sourcesContent":["export { STALE_TIMES } from './defaults.js';\n\nexport type { FirestoreSearchConfig, SearchEqualityFilter } from './search/types.js';\nexport {\n FIRESTORE_SEARCH_MIN_LENGTH,\n isSearchableText,\n normalizeSearchText,\n} from './search/rule.js';\n"]}
|
package/dist/keys.d.ts
CHANGED
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Lightweight, stable, Firestore-safe query key helpers.
|
|
3
|
-
*
|
|
4
|
-
* All keys are arrays of `string | number | boolean | null` so they can
|
|
5
|
-
* be written into Firestore docs (used by the unified upload pipeline's
|
|
6
|
-
* `result.invalidate` field) and read back by the frontend hook to call
|
|
7
|
-
* `queryClient.invalidateQueries`. Both sides produce structurally
|
|
8
|
-
* identical arrays.
|
|
9
|
-
*
|
|
10
|
-
* Convention:
|
|
11
|
-
* - `keys.user.all` => ['user']
|
|
12
|
-
* - `keys.user.detail(id)` => ['user', 'detail', id]
|
|
13
|
-
* - `keys.user.list(param?)` => ['user', 'list', param?]
|
|
14
|
-
* - `keys.user.custom('accountStatus', id)` => ['user', 'accountStatus', id]
|
|
15
|
-
*
|
|
16
|
-
* For list filters that need multiple discriminators, use `custom`:
|
|
17
|
-
* keys.feedback.custom('list', filter, sortBy)
|
|
18
|
-
*/
|
|
19
1
|
type SerializedKeyPart = string | number | boolean | null | undefined;
|
|
20
2
|
export type QueryKey = ReadonlyArray<string | number | boolean | null>;
|
|
21
3
|
export declare const keys: {
|
|
@@ -81,10 +63,6 @@ export declare const keys: {
|
|
|
81
63
|
};
|
|
82
64
|
readonly custom: (...parts: SerializedKeyPart[]) => QueryKey;
|
|
83
65
|
};
|
|
84
|
-
/**
|
|
85
|
-
* Utility for apps that want to define their own scoped key sets
|
|
86
|
-
* while following the same conventions.
|
|
87
|
-
*/
|
|
88
66
|
export declare function createKeyScope(scope: string): {
|
|
89
67
|
readonly all: QueryKey;
|
|
90
68
|
readonly detail: (id: string) => QueryKey;
|
package/dist/keys.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../src/keys.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../src/keys.ts"],"names":[],"mappings":"AAAA,KAAK,iBAAiB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;AAEtE,MAAM,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,CAAC;AAOvE,eAAO,MAAM,IAAI;;;8BAGA,MAAM;gCACJ,iBAAiB;oCACb,iBAAiB,EAAE;;;;8BAIzB,MAAM;gCACJ,iBAAiB;oCACb,iBAAiB,EAAE;;;;8BAIzB,MAAM;gCACJ,iBAAiB;oCACb,iBAAiB,EAAE;;;;8BAIzB,MAAM;gCACJ,iBAAiB;oCACb,iBAAiB,EAAE;;;;8BAIzB,MAAM;gCACJ,iBAAiB;oCACb,iBAAiB,EAAE;;;;8BAIzB,MAAM;gCACJ,iBAAiB;oCACb,iBAAiB,EAAE;;;;8BAIzB,MAAM;gCACJ,iBAAiB;oCACb,iBAAiB,EAAE;;;;8BAIzB,MAAM;gCACJ,iBAAiB;oCACb,iBAAiB,EAAE;;;;8BAIzB,MAAM;gCACJ,iBAAiB;oCACb,iBAAiB,EAAE;;;;8BAIzB,MAAM;gCACJ,iBAAiB;oCACb,iBAAiB,EAAE;;gCAErB,iBAAiB,EAAE;CAC9B,CAAC;AAEX,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM;;0BAG3B,MAAM;4BACJ,iBAAiB;gCACb,iBAAiB,EAAE;EAEzC"}
|
package/dist/keys.js
CHANGED
|
@@ -65,10 +65,6 @@ export const keys = {
|
|
|
65
65
|
},
|
|
66
66
|
custom: (...parts) => withScope('custom', ...parts),
|
|
67
67
|
};
|
|
68
|
-
/**
|
|
69
|
-
* Utility for apps that want to define their own scoped key sets
|
|
70
|
-
* while following the same conventions.
|
|
71
|
-
*/
|
|
72
68
|
export function createKeyScope(scope) {
|
|
73
69
|
return {
|
|
74
70
|
all: withScope(scope),
|
package/dist/keys.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../src/keys.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../src/keys.ts"],"names":[],"mappings":"AAIA,SAAS,SAAS,CAAC,KAAa,EAAE,GAAG,KAA0B;IAC7D,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAA8C,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC;IACjG,OAAO,CAAC,KAAK,EAAE,GAAG,OAAO,CAAU,CAAC;AACtC,CAAC;AAED,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,IAAI,EAAE;QACJ,GAAG,EAAE,SAAS,CAAC,MAAM,CAAC;QACtB,MAAM,EAAE,CAAC,EAAU,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE,CAAC;QACvD,IAAI,EAAE,CAAC,KAAyB,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC;QACrE,MAAM,EAAE,CAAC,GAAG,KAA0B,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC;KACvE;IACD,OAAO,EAAE;QACP,GAAG,EAAE,SAAS,CAAC,SAAS,CAAC;QACzB,MAAM,EAAE,CAAC,EAAU,EAAE,EAAE,CAAC,SAAS,CAAC,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC;QAC1D,IAAI,EAAE,CAAC,KAAyB,EAAE,EAAE,CAAC,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC;QACxE,MAAM,EAAE,CAAC,GAAG,KAA0B,EAAE,EAAE,CAAC,SAAS,CAAC,SAAS,EAAE,GAAG,KAAK,CAAC;KAC1E;IACD,QAAQ,EAAE;QACR,GAAG,EAAE,SAAS,CAAC,UAAU,CAAC;QAC1B,MAA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QACR,GAAG,EAAE,SAAS,CAAC,UAAU,CAAC;QAC1B,MAAM,EAAE,CAAC,EAAU,EAAE,EAAE,CAAC,SAAS,CAAC,UAAU,EAAE,QAAQ,EAAE,EAAE,CAAC;QAC3D,IAAI,EAAE,CAAC,KAAyB,EAAE,EAAE,CAAC,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC;QACzE,MAAM,EAAE,CAAC,GAAG,KAA0B,EAAE,EAAE,CAAC,SAAS,CAAC,UAAU,EAAE,GAAG,KAAK,CAAC;KAC3E;IACD,MAAM,EAAE,CAAC,GAAG,KAA0B,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,GAAG,KAAK,CAAC;CAChE,CAAC;AAEX,MAAM,UAAU,cAAc,CAAC,KAAa;IAC1C,OAAO;QACL,GAAG,EAAE,SAAS,CAAC,KAAK,CAAC;QACrB,MAAM,EAAE,CAAC,EAAU,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC;QACtD,IAAI,EAAE,CAAC,KAAyB,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC;QACpE,MAAM,EAAE,CAAC,GAAG,KAA0B,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,KAAK,CAAC;KAC7D,CAAC;AACb,CAAC","sourcesContent":["type SerializedKeyPart = string | number | boolean | null | undefined;\n\nexport type QueryKey = ReadonlyArray<string | number | boolean | null>;\n\nfunction withScope(scope: string, ...parts: SerializedKeyPart[]): QueryKey {\n const cleaned = parts.filter((p): p is Exclude<SerializedKeyPart, undefined> => p !== undefined);\n return [scope, ...cleaned] as const;\n}\n\nexport const keys = {\n user: {\n all: withScope('user'),\n detail: (id: string) => withScope('user', 'detail', id),\n list: (param?: SerializedKeyPart) => withScope('user', 'list', param),\n custom: (...parts: SerializedKeyPart[]) => withScope('user', ...parts),\n },\n follows: {\n all: withScope('follows'),\n detail: (id: string) => withScope('follows', 'detail', id),\n list: (param?: SerializedKeyPart) => withScope('follows', 'list', param),\n custom: (...parts: SerializedKeyPart[]) => withScope('follows', ...parts),\n },\n entities: {\n all: withScope('entities'),\n detail: (id: string) => withScope('entities', 'detail', id),\n list: (param?: SerializedKeyPart) => withScope('entities', 'list', param),\n custom: (...parts: SerializedKeyPart[]) => withScope('entities', ...parts),\n },\n messages: {\n all: withScope('messages'),\n detail: (id: string) => withScope('messages', 'detail', id),\n list: (param?: SerializedKeyPart) => withScope('messages', 'list', param),\n custom: (...parts: SerializedKeyPart[]) => withScope('messages', ...parts),\n },\n admin: {\n all: withScope('admin'),\n detail: (id: string) => withScope('admin', 'detail', id),\n list: (param?: SerializedKeyPart) => withScope('admin', 'list', param),\n custom: (...parts: SerializedKeyPart[]) => withScope('admin', ...parts),\n },\n chat: {\n all: withScope('chat'),\n detail: (id: string) => withScope('chat', 'detail', id),\n list: (param?: SerializedKeyPart) => withScope('chat', 'list', param),\n custom: (...parts: SerializedKeyPart[]) => withScope('chat', ...parts),\n },\n notifications: {\n all: withScope('notifications'),\n detail: (id: string) => withScope('notifications', 'detail', id),\n list: (param?: SerializedKeyPart) => withScope('notifications', 'list', param),\n custom: (...parts: SerializedKeyPart[]) => withScope('notifications', ...parts),\n },\n shortLinks: {\n all: withScope('shortLinks'),\n detail: (id: string) => withScope('shortLinks', 'detail', id),\n list: (param?: SerializedKeyPart) => withScope('shortLinks', 'list', param),\n custom: (...parts: SerializedKeyPart[]) => withScope('shortLinks', ...parts),\n },\n mentions: {\n all: withScope('mentions'),\n detail: (id: string) => withScope('mentions', 'detail', id),\n list: (param?: SerializedKeyPart) => withScope('mentions', 'list', param),\n custom: (...parts: SerializedKeyPart[]) => withScope('mentions', ...parts),\n },\n feedback: {\n all: withScope('feedback'),\n detail: (id: string) => withScope('feedback', 'detail', id),\n list: (param?: SerializedKeyPart) => withScope('feedback', 'list', param),\n custom: (...parts: SerializedKeyPart[]) => withScope('feedback', ...parts),\n },\n custom: (...parts: SerializedKeyPart[]) => withScope('custom', ...parts),\n} as const;\n\nexport function createKeyScope(scope: string) {\n return {\n all: withScope(scope),\n detail: (id: string) => withScope(scope, 'detail', id),\n list: (param?: SerializedKeyPart) => withScope(scope, 'list', param),\n custom: (...parts: SerializedKeyPart[]) => withScope(scope, ...parts),\n } as const;\n}\n"]}
|
|
@@ -1,48 +1,16 @@
|
|
|
1
1
|
import type { InfiniteData, QueryClient, QueryKey } from '@tanstack/react-query';
|
|
2
|
-
/** Invalidate everything that matches a key prefix. */
|
|
3
2
|
export declare function invalidateByPrefix(client: QueryClient, prefix: QueryKey): Promise<void>;
|
|
4
|
-
/** Remove everything that matches a key prefix (drops cached data). */
|
|
5
3
|
export declare function removeByPrefix(client: QueryClient, prefix: QueryKey): void;
|
|
6
|
-
/**
|
|
7
|
-
* Generic cache update helper.
|
|
8
|
-
* Useful for optimistic updates without baking in business logic.
|
|
9
|
-
*/
|
|
10
4
|
export declare function updateQueryData<T>(client: QueryClient, key: QueryKey, updater: (prev: T | undefined) => T): void;
|
|
11
|
-
/** The cache key of page `page` of a `useFirestorePaginated` list keyed `queryKey`. */
|
|
12
5
|
export declare function paginatedPageKey(queryKey: QueryKey, page: number): QueryKey;
|
|
13
|
-
/**
|
|
14
|
-
* Patch rows in place across every cached page of a `useFirestorePaginated` list
|
|
15
|
-
* (`queryKey` is the base key the hook was given). Return the same row to leave it
|
|
16
|
-
* unchanged; a page with no changed row keeps its identity. Cursors and has-more are
|
|
17
|
-
* untouched, so paging stays aligned with the server.
|
|
18
|
-
*/
|
|
19
6
|
export declare function mapPaginatedItems<T>(client: QueryClient, queryKey: QueryKey, mapItem: (item: T) => T): void;
|
|
20
|
-
/**
|
|
21
|
-
* Put a just-created row at the top of page 1 of a `useFirestorePaginated` list, only
|
|
22
|
-
* when page 1 is cached. Use it only for a list ordered newest-first. Page 1 keeps its
|
|
23
|
-
* cursor, so it shows one extra row and page 2 keeps its place until page 1 is next read;
|
|
24
|
-
* that read moves page 1's cursor, and the hook then re-reads page 2 from the new cursor
|
|
25
|
-
* before showing it.
|
|
26
|
-
*/
|
|
27
7
|
export declare function prependToFirstPaginatedPage<T>(client: QueryClient, queryKey: QueryKey, item: T): void;
|
|
28
|
-
/** How `placeRowInPages` reads and writes one infinite list's pages. */
|
|
29
8
|
export interface PagedRows<P, T> {
|
|
30
9
|
rowsOf: (page: P) => readonly T[];
|
|
31
10
|
withRows: (page: P, rows: T[]) => P;
|
|
32
|
-
/** True when `candidate` is the row being placed (its id). */
|
|
33
11
|
isRow: (candidate: T) => boolean;
|
|
34
|
-
/** True when `a` comes before `b` in the list's own order. */
|
|
35
12
|
sortsBefore: (a: T, b: T) => boolean;
|
|
36
|
-
/** True when this page is not the last one the source holds (a next page exists). */
|
|
37
13
|
hasMoreAfter: (page: P) => boolean;
|
|
38
14
|
}
|
|
39
|
-
/**
|
|
40
|
-
* Place, move, or drop ONE row in a cached infinite list's loaded pages, in place: the row leaves
|
|
41
|
-
* wherever it sits and, when `belongs`, joins at its position in the list's own order. A row that
|
|
42
|
-
* sorts after every loaded row is added only when no further page exists; otherwise the next page
|
|
43
|
-
* read returns it, so placing it here would list it twice. Every other row, every page, and every
|
|
44
|
-
* cursor stays put; a list the row neither left nor joined is returned as it was. Never a reset to the
|
|
45
|
-
* first page.
|
|
46
|
-
*/
|
|
47
15
|
export declare function placeRowInPages<P, T, TParam = unknown>(data: InfiniteData<P, TParam> | undefined, row: T, belongs: boolean, how: PagedRows<P, T>): InfiniteData<P, TParam> | undefined;
|
|
48
16
|
//# sourceMappingURL=cache-helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache-helpers.d.ts","sourceRoot":"","sources":["../../src/react/cache-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGjF,
|
|
1
|
+
{"version":3,"file":"cache-helpers.d.ts","source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CACpC;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,EACpD,IAAI,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG,SAAS,EACzC,GAAG,EAAE,CAAC,EACN,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GACnB,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG,SAAS,CA2BrC"}
|
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
/** Invalidate everything that matches a key prefix. */
|
|
2
1
|
export async function invalidateByPrefix(client, prefix) {
|
|
3
2
|
return client.invalidateQueries({ queryKey: prefix, exact: false });
|
|
4
3
|
}
|
|
5
|
-
/** Remove everything that matches a key prefix (drops cached data). */
|
|
6
4
|
export function removeByPrefix(client, prefix) {
|
|
7
5
|
return client.removeQueries({ queryKey: prefix, exact: false });
|
|
8
6
|
}
|
|
9
|
-
/**
|
|
10
|
-
* Generic cache update helper.
|
|
11
|
-
* Useful for optimistic updates without baking in business logic.
|
|
12
|
-
*/
|
|
13
7
|
export function updateQueryData(client, key, updater) {
|
|
14
8
|
client.setQueryData(key, (prev) => updater(prev));
|
|
15
9
|
}
|
|
16
|
-
/** The cache key of page `page` of a `useFirestorePaginated` list keyed `queryKey`. */
|
|
17
10
|
export function paginatedPageKey(queryKey, page) {
|
|
18
11
|
return [...queryKey, 'page', page];
|
|
19
12
|
}
|
|
@@ -26,12 +19,6 @@ function isPaginatedPage(value) {
|
|
|
26
19
|
function isPageKey(baseKey, key) {
|
|
27
20
|
return key.length === baseKey.length + 2 && key[baseKey.length] === 'page';
|
|
28
21
|
}
|
|
29
|
-
/**
|
|
30
|
-
* Patch rows in place across every cached page of a `useFirestorePaginated` list
|
|
31
|
-
* (`queryKey` is the base key the hook was given). Return the same row to leave it
|
|
32
|
-
* unchanged; a page with no changed row keeps its identity. Cursors and has-more are
|
|
33
|
-
* untouched, so paging stays aligned with the server.
|
|
34
|
-
*/
|
|
35
22
|
export function mapPaginatedItems(client, queryKey, mapItem) {
|
|
36
23
|
for (const [key, value] of client.getQueriesData({ queryKey })) {
|
|
37
24
|
if (!isPageKey(queryKey, key) || !isPaginatedPage(value))
|
|
@@ -47,13 +34,6 @@ export function mapPaginatedItems(client, queryKey, mapItem) {
|
|
|
47
34
|
client.setQueryData(key, { ...value, items });
|
|
48
35
|
}
|
|
49
36
|
}
|
|
50
|
-
/**
|
|
51
|
-
* Put a just-created row at the top of page 1 of a `useFirestorePaginated` list, only
|
|
52
|
-
* when page 1 is cached. Use it only for a list ordered newest-first. Page 1 keeps its
|
|
53
|
-
* cursor, so it shows one extra row and page 2 keeps its place until page 1 is next read;
|
|
54
|
-
* that read moves page 1's cursor, and the hook then re-reads page 2 from the new cursor
|
|
55
|
-
* before showing it.
|
|
56
|
-
*/
|
|
57
37
|
export function prependToFirstPaginatedPage(client, queryKey, item) {
|
|
58
38
|
const key = paginatedPageKey(queryKey, 1);
|
|
59
39
|
const value = client.getQueryData(key);
|
|
@@ -61,14 +41,6 @@ export function prependToFirstPaginatedPage(client, queryKey, item) {
|
|
|
61
41
|
return;
|
|
62
42
|
client.setQueryData(key, { ...value, items: [item, ...value.items] });
|
|
63
43
|
}
|
|
64
|
-
/**
|
|
65
|
-
* Place, move, or drop ONE row in a cached infinite list's loaded pages, in place: the row leaves
|
|
66
|
-
* wherever it sits and, when `belongs`, joins at its position in the list's own order. A row that
|
|
67
|
-
* sorts after every loaded row is added only when no further page exists; otherwise the next page
|
|
68
|
-
* read returns it, so placing it here would list it twice. Every other row, every page, and every
|
|
69
|
-
* cursor stays put; a list the row neither left nor joined is returned as it was. Never a reset to the
|
|
70
|
-
* first page.
|
|
71
|
-
*/
|
|
72
44
|
export function placeRowInPages(data, row, belongs, how) {
|
|
73
45
|
if (!data || data.pages.length === 0)
|
|
74
46
|
return data;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache-helpers.js","sourceRoot":"","sources":["../../src/react/cache-helpers.ts"],"names":[],"mappings":"AAGA,
|
|
1
|
+
{"version":3,"file":"cache-helpers.js","sourceRoot":"","sources":["../../src/react/cache-helpers.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,MAAmB,EAAE,MAAgB;IAC5E,OAAO,MAAM,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;AACtE,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,MAAmB,EAAE,MAAgB;IAClE,OAAO,MAAM,CAAC,aAAa,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;AAClE,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,MAAmB,EACnB,GAAa,EACb,OAAmC;IAEnC,MAAM,CAAC,YAAY,CAAI,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,QAAkB,EAAE,IAAY;IAC/D,OAAO,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;AACrC,CAAC;AAED,SAAS,eAAe,CAAC,KAAc;IACrC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,KAAK,CAAC,OAAO,CAAE,KAA6B,CAAC,KAAK,CAAC;QACnD,OAAQ,KAA+B,CAAC,OAAO,KAAK,SAAS,CAC9D,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,OAAiB,EAAE,GAAa;IACjD,OAAO,GAAG,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,MAAM,CAAC;AAC7E,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/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AAO,IAAI,MAAM,CAAC;IAC9B,CAAC;IACD,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAC1B,OAAO,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACtF,CAAC","sourcesContent":["import type { InfiniteData, QueryClient, QueryKey } from '@tanstack/react-query';\nimport type { PaginatedPage } from './firestore/types.js';\n\nexport async function invalidateByPrefix(client: QueryClient, prefix: QueryKey) {\n return client.invalidateQueries({ queryKey: prefix, exact: false });\n}\n\nexport function removeByPrefix(client: QueryClient, prefix: QueryKey) {\n return client.removeQueries({ queryKey: prefix, exact: false });\n}\n\nexport function updateQueryData<T>(\n client: QueryClient,\n key: QueryKey,\n updater: (prev: T | undefined) => T,\n) {\n client.setQueryData<T>(key, (prev) => updater(prev));\n}\n\nexport function paginatedPageKey(queryKey: QueryKey, page: number): QueryKey {\n return [...queryKey, 'page', page];\n}\n\nfunction isPaginatedPage(value: unknown): value is PaginatedPage<unknown> {\n return (\n typeof value === 'object' &&\n value !== null &&\n Array.isArray((value as { items?: unknown }).items) &&\n typeof (value as { hasMore?: unknown }).hasMore === 'boolean'\n );\n}\n\nfunction isPageKey(baseKey: QueryKey, key: QueryKey): boolean {\n return key.length === baseKey.length + 2 && key[baseKey.length] === 'page';\n}\n\nexport function mapPaginatedItems<T>(\n client: QueryClient,\n queryKey: QueryKey,\n mapItem: (item: T) => T,\n): void {\n for (const [key, value] of client.getQueriesData<PaginatedPage<T>>({ queryKey })) {\n if (!isPageKey(queryKey, key) || !isPaginatedPage(value)) continue;\n let changed = false;\n const items = value.items.map((item) => {\n const next = mapItem(item as T);\n if (next !== item) changed = true;\n return next;\n });\n if (changed) client.setQueryData<PaginatedPage<T>>(key, { ...value, items });\n }\n}\n\nexport function prependToFirstPaginatedPage<T>(\n client: QueryClient,\n queryKey: QueryKey,\n item: T,\n): void {\n const key = paginatedPageKey(queryKey, 1);\n const value = client.getQueryData<PaginatedPage<T>>(key);\n if (!isPaginatedPage(value)) return;\n client.setQueryData<PaginatedPage<T>>(key, { ...value, items: [item, ...value.items] });\n}\n\nexport interface PagedRows<P, T> {\n rowsOf: (page: P) => readonly T[];\n withRows: (page: P, rows: T[]) => P;\n isRow: (candidate: T) => boolean;\n sortsBefore: (a: T, b: T) => boolean;\n hasMoreAfter: (page: P) => boolean;\n}\n\nexport function placeRowInPages<P, T, TParam = unknown>(\n data: InfiniteData<P, TParam> | undefined,\n row: T,\n belongs: boolean,\n how: PagedRows<P, T>,\n): InfiniteData<P, TParam> | undefined {\n if (!data || data.pages.length === 0) return data;\n let changed = false;\n const rows = data.pages.map((page) => {\n const kept = how.rowsOf(page).filter((candidate) => !how.isRow(candidate));\n if (kept.length !== how.rowsOf(page).length) changed = true;\n return kept;\n });\n if (belongs) {\n let placed = false;\n for (const pageRows of rows) {\n const index = pageRows.findIndex((candidate) => how.sortsBefore(row, candidate));\n if (index !== -1) {\n pageRows.splice(index, 0, row);\n placed = true;\n break;\n }\n }\n const lastIndex = data.pages.length - 1;\n if (!placed && !how.hasMoreAfter(data.pages[lastIndex])) {\n rows[lastIndex].push(row);\n placed = true;\n }\n changed = changed || placed;\n }\n if (!changed) return data;\n return { ...data, pages: data.pages.map((page, i) => how.withRows(page, rows[i])) };\n}\n"]}
|
package/dist/react/defaults.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import type { DefaultOptions, QueryClientConfig } from '@tanstack/react-query';
|
|
2
|
-
/**
|
|
3
|
-
* Small, conservative defaults intended to work well across apps.
|
|
4
|
-
* Apps can override via `createQueryClient({ defaultOptions: ... })`.
|
|
5
|
-
*/
|
|
6
2
|
export declare const defaultQueryOptions: DefaultOptions;
|
|
7
3
|
export declare const defaultQueryClientConfig: QueryClientConfig;
|
|
8
4
|
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/react/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/E
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/react/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/E,eAAO,MAAM,mBAAmB,EAAE,cAcjC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,iBAEtC,CAAC"}
|
package/dist/react/defaults.js
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Small, conservative defaults intended to work well across apps.
|
|
3
|
-
* Apps can override via `createQueryClient({ defaultOptions: ... })`.
|
|
4
|
-
*/
|
|
5
1
|
export const defaultQueryOptions = {
|
|
6
2
|
queries: {
|
|
7
3
|
refetchOnWindowFocus: false,
|
|
8
4
|
refetchOnReconnect: true,
|
|
9
5
|
refetchOnMount: false,
|
|
10
|
-
staleTime: 30_000,
|
|
11
|
-
gcTime: 5 * 60_000,
|
|
6
|
+
staleTime: 30_000,
|
|
7
|
+
gcTime: 5 * 60_000,
|
|
12
8
|
retry: (failureCount) => failureCount < 2,
|
|
13
9
|
},
|
|
14
10
|
mutations: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../src/react/defaults.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../src/react/defaults.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,mBAAmB,GAAmB;IACjD,OAAO,EAAE;QACP,oBAAoB,EAAE,KAAK;QAC3B,kBAAkB,EAAE,IAAI;QACxB,cAAc,EAAE,KAAK;QAErB,SAAS,EAAE,MAAM;QACjB,MAAM,EAAE,CAAC,GAAG,MAAM;QAElB,KAAK,EAAE,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,GAAG,CAAC;KAC1C;IACD,SAAS,EAAE;QACT,KAAK,EAAE,CAAC;KACT;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAsB;IACzD,cAAc,EAAE,mBAAmB;CACpC,CAAC","sourcesContent":["import type { DefaultOptions, QueryClientConfig } from '@tanstack/react-query';\n\nexport const defaultQueryOptions: DefaultOptions = {\n queries: {\n refetchOnWindowFocus: false,\n refetchOnReconnect: true,\n refetchOnMount: false,\n\n staleTime: 30_000,\n gcTime: 5 * 60_000,\n\n retry: (failureCount) => failureCount < 2,\n },\n mutations: {\n retry: 0,\n },\n};\n\nexport const defaultQueryClientConfig: QueryClientConfig = {\n defaultOptions: defaultQueryOptions,\n};\n"]}
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import type { Query, QueryClient, QueryKey } from '@tanstack/react-query';
|
|
2
2
|
export type RefetchType = 'active' | 'all' | 'none';
|
|
3
|
-
/**
|
|
4
|
-
* What an entry does to the queries it matches:
|
|
5
|
-
* - `"refresh"` (the default) marks them stale and refetches per `refetchType`;
|
|
6
|
-
* - `"remove"` cancels them and drops them from the cache — for data that no longer exists, or a
|
|
7
|
-
* held answer that must not be served again;
|
|
8
|
-
* - `"reset"` returns them to their initial state and refetches the active ones from scratch.
|
|
9
|
-
*/
|
|
10
3
|
export type CacheAction = 'refresh' | 'remove' | 'reset';
|
|
11
4
|
export type CacheInvalidation = {
|
|
12
5
|
kind: 'exact';
|
|
@@ -25,7 +18,6 @@ export type CacheInvalidation = {
|
|
|
25
18
|
refetchType?: RefetchType;
|
|
26
19
|
action?: CacheAction;
|
|
27
20
|
};
|
|
28
|
-
/** `refetchType` belongs to a refresh; a remove or reset takes none. */
|
|
29
21
|
type EntryOptions = {
|
|
30
22
|
refetchType?: RefetchType;
|
|
31
23
|
action?: 'refresh';
|
|
@@ -36,35 +28,6 @@ export declare function exact(queryKey: QueryKey, opts?: EntryOptions): CacheInv
|
|
|
36
28
|
export declare function prefix(queryKey: QueryKey, opts?: EntryOptions): CacheInvalidation;
|
|
37
29
|
export declare function predicate(description: string, match: (query: Query) => boolean, opts?: EntryOptions): CacheInvalidation;
|
|
38
30
|
export declare function serializeInvalidation(inv: CacheInvalidation): string;
|
|
39
|
-
/**
|
|
40
|
-
* Dispatch a deduplicated list of cache invalidations.
|
|
41
|
-
*
|
|
42
|
-
* Returns a promise that resolves once every `invalidateQueries` call it issued
|
|
43
|
-
* has settled — i.e. once the refetches those invalidations triggered have
|
|
44
|
-
* landed. The dispatch itself stays synchronous (every cancellation and
|
|
45
|
-
* invalidation is issued before this function returns), so a fire-and-forget
|
|
46
|
-
* caller can ignore the promise, while a mutation `onSuccess` that
|
|
47
|
-
* RETURNS or awaits the promise stays pending until the refreshed data is in
|
|
48
|
-
* the cache. The promise never rejects: `invalidateQueries` refetches without
|
|
49
|
-
* `throwOnError`, so a failed refetch surfaces on its own query, never as a
|
|
50
|
-
* failure of the committed action that triggered it. The scoped
|
|
51
|
-
* `cancelQueries` calls stay fire-and-forget — cancellation takes effect
|
|
52
|
-
* synchronously and is not part of the refresh being awaited.
|
|
53
|
-
*
|
|
54
|
-
* Before each invalidation, any query it matches that is mid-PENDING-INITIAL-READ
|
|
55
|
-
* is cancelled (see `cancelPendingInitialReads`) so a read that started before
|
|
56
|
-
* the write committed can never land as the query's first — and freshly-marked —
|
|
57
|
-
* value.
|
|
58
|
-
*
|
|
59
|
-
* `refetchType` governs whether that cancellation happens:
|
|
60
|
-
* - `'active'` (the default) and `'all'` cancel-then-invalidate every matched
|
|
61
|
-
* pending initial read — including one TanStack's refetch pass will not
|
|
62
|
-
* restart, since a stale first value would otherwise land and mark the query
|
|
63
|
-
* fresh, while a cancelled one simply refetches for its next observer.
|
|
64
|
-
* - `'none'` invalidates WITHOUT cancelling: the caller has asked for no
|
|
65
|
-
* refetch at all, so cancelling would abandon the only in-flight read the
|
|
66
|
-
* consumer has and leave it with no data and no pending request.
|
|
67
|
-
*/
|
|
68
31
|
export declare function applyInvalidations(queryClient: QueryClient, invalidations: ReadonlyArray<CacheInvalidation>): Promise<void>;
|
|
69
32
|
export {};
|
|
70
33
|
//# sourceMappingURL=cache-invalidation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache-invalidation.d.ts","sourceRoot":"","sources":["../../../src/react/domain-events/cache-invalidation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAgB,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAExF,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;AAEpD
|
|
1
|
+
{"version":3,"file":"cache-invalidation.d.ts","sourceRoot":"","sources":["../../../src/react/domain-events/cache-invalidation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAgB,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAExF,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;AAEpD,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEzD,MAAM,MAAM,iBAAiB,GACzB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,QAAQ,CAAC;IAAC,WAAW,CAAC,EAAE,WAAW,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,CAAA;CAAE,GACtF;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,EAAE,QAAQ,CAAC;IAAC,WAAW,CAAC,EAAE,WAAW,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,CAAA;CAAE,GACvF;IACE,IAAI,EAAE,WAAW,CAAC;IAClB,WAAW,EAAE,MAAM,CAA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