@codeleap/query 7.0.0 → 7.0.1

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.
Files changed (45) hide show
  1. package/dist/factors/createQueryManager.js +37 -0
  2. package/dist/factors/createQueryManager.js.map +1 -0
  3. package/dist/factors/createQueryOperations.js +36 -0
  4. package/dist/factors/createQueryOperations.js.map +1 -0
  5. package/dist/factors/index.js +3 -0
  6. package/dist/factors/index.js.map +1 -0
  7. package/dist/index.js +4 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/lib/Mutations.js +235 -0
  10. package/dist/lib/Mutations.js.map +1 -0
  11. package/dist/lib/QueryClientEnhanced/index.js +195 -0
  12. package/dist/lib/QueryClientEnhanced/index.js.map +1 -0
  13. package/dist/lib/QueryClientEnhanced/types.js +2 -0
  14. package/dist/lib/QueryClientEnhanced/types.js.map +1 -0
  15. package/dist/lib/QueryKeys.js +313 -0
  16. package/dist/lib/QueryKeys.js.map +1 -0
  17. package/dist/lib/QueryManager.js +400 -0
  18. package/dist/lib/QueryManager.js.map +1 -0
  19. package/dist/lib/QueryOperations/index.js +284 -0
  20. package/dist/lib/QueryOperations/index.js.map +1 -0
  21. package/dist/lib/QueryOperations/types.js +2 -0
  22. package/dist/lib/QueryOperations/types.js.map +1 -0
  23. package/dist/lib/index.js +6 -0
  24. package/dist/lib/index.js.map +1 -0
  25. package/dist/types/core.js +2 -0
  26. package/dist/types/core.js.map +1 -0
  27. package/dist/types/create.js +2 -0
  28. package/dist/types/create.js.map +1 -0
  29. package/dist/types/delete.js +2 -0
  30. package/dist/types/delete.js.map +1 -0
  31. package/dist/types/index.js +8 -0
  32. package/dist/types/index.js.map +1 -0
  33. package/dist/types/list.js +2 -0
  34. package/dist/types/list.js.map +1 -0
  35. package/dist/types/retrieve.js +2 -0
  36. package/dist/types/retrieve.js.map +1 -0
  37. package/dist/types/update.js +2 -0
  38. package/dist/types/update.js.map +1 -0
  39. package/dist/types/utility.js +2 -0
  40. package/dist/types/utility.js.map +1 -0
  41. package/dist/utils/index.js +2 -0
  42. package/dist/utils/index.js.map +1 -0
  43. package/dist/utils/misc.js +35 -0
  44. package/dist/utils/misc.js.map +1 -0
  45. package/package.json +6 -6
@@ -0,0 +1,313 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { useMemo } from 'react';
11
+ import { TypeGuards } from '@codeleap/types';
12
+ import deepEqual from 'fast-deep-equal';
13
+ /**
14
+ * Class for managing React Query keys and operations for a specific query type
15
+ * @template T - The query item type that extends QueryItem
16
+ * @template F - The filter type used for list queries
17
+ */
18
+ export class QueryKeys {
19
+ /**
20
+ * Creates a new QueryKeys instance
21
+ * @param queryName - The name of the query used as base for all keys
22
+ * @param queryClient - The React Query client instance
23
+ */
24
+ constructor(queryName, queryClient) {
25
+ this.queryName = queryName;
26
+ this.queryClient = queryClient;
27
+ }
28
+ /**
29
+ * Gets the base query keys for different operations
30
+ * @returns Object containing base query keys for list, retrieve, create, update, and delete operations
31
+ */
32
+ get keys() {
33
+ return {
34
+ // queries
35
+ list: [this.queryName, 'list'],
36
+ retrieve: (id) => [this.queryName, 'retrieve', id],
37
+ // mutations
38
+ create: [this.queryName, 'create'],
39
+ update: [this.queryName, 'update'],
40
+ delete: [this.queryName, 'delete'],
41
+ };
42
+ }
43
+ /**
44
+ * Generates a list query key with optional filters
45
+ * @param filters - Optional filters to include in the query key
46
+ * @returns Query key array with or without filters
47
+ */
48
+ listKeyWithFilters(filters) {
49
+ const hasValidFilters = !TypeGuards.isNil(filters) && (typeof filters !== 'object'
50
+ ? Boolean(filters)
51
+ : Object.values(filters !== null && filters !== void 0 ? filters : {}).some(value => value != null && (typeof value !== 'string' || value.trim() !== '')));
52
+ return hasValidFilters ? [...this.keys.list, filters] : this.keys.list;
53
+ }
54
+ /**
55
+ * React hook that returns a memoized list query key with filters
56
+ * @param filters - Optional filters to include in the query key
57
+ * @returns Memoized query key array
58
+ */
59
+ useListKeyWithFilters(filters) {
60
+ return useMemo(() => {
61
+ return this.listKeyWithFilters(filters);
62
+ }, [filters]);
63
+ }
64
+ /**
65
+ * React hook that returns a memoized retrieve query key
66
+ * @param id - The ID of the item to retrieve
67
+ * @returns Memoized query key array for retrieve operation
68
+ */
69
+ useRetrieveKey(id) {
70
+ return useMemo(() => {
71
+ return this.keys.retrieve(id);
72
+ }, [id]);
73
+ }
74
+ /**
75
+ * Predicate function to check if a query belongs to this query name (all operations)
76
+ * @private
77
+ * @param queryName - The query name to match against
78
+ * @param query - The query object to check
79
+ * @returns True if the query matches the query name
80
+ */
81
+ predicateQueryKeyAll(queryName, query) {
82
+ var _a;
83
+ const queryKey = (_a = query === null || query === void 0 ? void 0 : query.queryKey) === null || _a === void 0 ? void 0 : _a.join('/');
84
+ return queryKey === null || queryKey === void 0 ? void 0 : queryKey.includes(queryName);
85
+ }
86
+ /**
87
+ * Predicate function to check if a query is a list query for this query name
88
+ * @private
89
+ * @param queryName - The query name to match against
90
+ * @param query - The query object to check
91
+ * @param toIgnoreQueryKeys - Query keys to ignore in the matching
92
+ * @returns True if the query is a list query and not in the ignore list
93
+ */
94
+ predicateQueryKeyList(queryName, query, toIgnoreQueryKeys) {
95
+ var _a;
96
+ const queryKey = (_a = query === null || query === void 0 ? void 0 : query.queryKey) === null || _a === void 0 ? void 0 : _a.join('/');
97
+ if (!TypeGuards.isNil(toIgnoreQueryKeys)) {
98
+ const ignoreQueryKeys = Array.isArray(toIgnoreQueryKeys === null || toIgnoreQueryKeys === void 0 ? void 0 : toIgnoreQueryKeys[0]) ? toIgnoreQueryKeys : [toIgnoreQueryKeys];
99
+ if (ignoreQueryKeys.some(key => deepEqual(query === null || query === void 0 ? void 0 : query.queryKey, key))) {
100
+ return false;
101
+ }
102
+ }
103
+ const isListQueryKey = (queryKey === null || queryKey === void 0 ? void 0 : queryKey.includes(queryName)) && (queryKey === null || queryKey === void 0 ? void 0 : queryKey.includes('list'));
104
+ return isListQueryKey;
105
+ }
106
+ /**
107
+ * Invalidates all queries for this query name
108
+ * @param filters - Optional filters to apply to the invalidation
109
+ * @param options - Optional invalidation options
110
+ * @returns Promise that resolves when invalidation is complete
111
+ */
112
+ invalidateAll(filters, options) {
113
+ return __awaiter(this, void 0, void 0, function* () {
114
+ return this.queryClient.invalidateQueries(Object.assign(Object.assign({}, filters), { predicate: (query) => this.predicateQueryKeyAll(this.queryName, query) }), options);
115
+ });
116
+ }
117
+ /**
118
+ * Invalidates list queries, optionally with specific filters
119
+ * @param listFilters - Optional filters to target specific list queries
120
+ * @param ignoreQueryKeys - Query keys to ignore during invalidation
121
+ * @param filters - Optional filters to apply to the invalidation
122
+ * @param options - Optional invalidation options
123
+ * @returns Promise that resolves when invalidation is complete
124
+ */
125
+ invalidateList(listFilters, ignoreQueryKeys, filters, options) {
126
+ return __awaiter(this, void 0, void 0, function* () {
127
+ if (!!listFilters) {
128
+ const queryKey = this.listKeyWithFilters(listFilters);
129
+ return this.queryClient.invalidateQueries(Object.assign(Object.assign({}, filters), { queryKey }), options);
130
+ }
131
+ return this.queryClient.invalidateQueries(Object.assign(Object.assign({}, filters), { predicate: (query) => this.predicateQueryKeyList(this.queryName, query, ignoreQueryKeys) }), options);
132
+ });
133
+ }
134
+ /**
135
+ * Invalidates a specific retrieve query by ID
136
+ * @param id - The ID of the item to invalidate
137
+ * @param filters - Optional filters to apply to the invalidation
138
+ * @param options - Optional invalidation options
139
+ * @returns Promise that resolves when invalidation is complete
140
+ */
141
+ invalidateRetrieve(id, filters, options) {
142
+ return __awaiter(this, void 0, void 0, function* () {
143
+ const queryKey = this.keys.retrieve(id);
144
+ return this.queryClient.invalidateQueries(Object.assign(Object.assign({}, filters), { queryKey }), options);
145
+ });
146
+ }
147
+ /**
148
+ * Refetches all queries for this query name
149
+ * @param filters - Optional filters to apply to the refetch
150
+ * @param options - Optional refetch options
151
+ * @returns Promise that resolves when refetch is complete
152
+ */
153
+ refetchAll(filters, options) {
154
+ return __awaiter(this, void 0, void 0, function* () {
155
+ return this.queryClient.refetchQueries(Object.assign(Object.assign({}, filters), { predicate: (query) => this.predicateQueryKeyAll(this.queryName, query) }), options);
156
+ });
157
+ }
158
+ /**
159
+ * Refetches list queries, optionally with specific filters
160
+ * @param listFilters - Optional filters to target specific list queries
161
+ * @param ignoreQueryKeys - Query keys to ignore during refetch
162
+ * @param filters - Optional filters to apply to the refetch
163
+ * @param options - Optional refetch options
164
+ * @returns Promise that resolves when refetch is complete
165
+ */
166
+ refetchList(listFilters, ignoreQueryKeys, filters, options) {
167
+ return __awaiter(this, void 0, void 0, function* () {
168
+ if (!!listFilters) {
169
+ const queryKey = this.listKeyWithFilters(listFilters);
170
+ return this.queryClient.refetchQueries(Object.assign(Object.assign({}, filters), { queryKey }), options);
171
+ }
172
+ return this.queryClient.refetchQueries(Object.assign(Object.assign({}, filters), { predicate: (query) => this.predicateQueryKeyList(this.queryName, query, ignoreQueryKeys) }), options);
173
+ });
174
+ }
175
+ /**
176
+ * Refetches a specific retrieve query by ID
177
+ * @param id - The ID of the item to refetch
178
+ * @param filters - Optional filters to apply to the refetch
179
+ * @param options - Optional refetch options
180
+ * @returns Promise that resolves when refetch is complete
181
+ */
182
+ refetchRetrieve(id, filters, options) {
183
+ return __awaiter(this, void 0, void 0, function* () {
184
+ const queryKey = this.keys.retrieve(id);
185
+ return this.queryClient.refetchQueries(Object.assign(Object.assign({}, filters), { queryKey }), options);
186
+ });
187
+ }
188
+ /**
189
+ * Removes a specific retrieve query data from the cache
190
+ * @param id - The ID of the item to remove from cache
191
+ * @param filters - Optional filters to apply to the removal
192
+ * @returns Promise that resolves when removal is complete
193
+ */
194
+ removeRetrieveQueryData(id, filters) {
195
+ return __awaiter(this, void 0, void 0, function* () {
196
+ const queryKey = this.keys.retrieve(id);
197
+ return this.queryClient.removeQueries(Object.assign(Object.assign({}, filters), { queryKey }));
198
+ });
199
+ }
200
+ /**
201
+ * Cancels list queries that are currently in flight
202
+ * @param listFilters - Optional filters to target specific list queries
203
+ * @param ignoreQueryKeys - Query keys to ignore during cancellation
204
+ * @param filters - Optional filters to apply to the cancellation
205
+ * @param options - Optional cancellation options
206
+ * @returns Promise that resolves when cancellation is complete
207
+ */
208
+ cancelListQueries(listFilters, ignoreQueryKeys, filters, options) {
209
+ return __awaiter(this, void 0, void 0, function* () {
210
+ if (!!listFilters) {
211
+ const queryKey = this.listKeyWithFilters(listFilters);
212
+ return this.queryClient.cancelQueries(Object.assign(Object.assign({}, filters), { queryKey }), options);
213
+ }
214
+ return this.queryClient.cancelQueries(Object.assign(Object.assign({}, filters), { predicate: (query) => this.predicateQueryKeyList(this.queryName, query, ignoreQueryKeys) }), options);
215
+ });
216
+ }
217
+ /**
218
+ * Gets list data from the cache, including both items array and item map
219
+ * @param filters - Optional filters to target specific list data
220
+ * @returns Object containing items array and itemMap (keyed by ID)
221
+ */
222
+ getListData(filters) {
223
+ var _a;
224
+ const queryKey = this.listKeyWithFilters(filters);
225
+ const data = this.queryClient.getQueryData(queryKey);
226
+ const items = ((_a = data === null || data === void 0 ? void 0 : data.pages) !== null && _a !== void 0 ? _a : []).flat();
227
+ const itemMap = items.reduce((acc, item) => {
228
+ acc[item === null || item === void 0 ? void 0 : item.id] = item;
229
+ return acc;
230
+ }, {});
231
+ return {
232
+ items,
233
+ itemMap,
234
+ };
235
+ }
236
+ /**
237
+ * Retrieves item data from cache with intelligent fallback strategies
238
+ *
239
+ * @description Searches for an item using a multi-layered approach:
240
+ * 1. Direct cache lookup using retrieve query
241
+ * 2. Fallback to itemMap from list data (shallow search)
242
+ * 3. Deep search through all paginated list queries
243
+ *
244
+ * @param {QueryItem['id']} id - The unique identifier of the item to retrieve
245
+ * @param {RetrieveDataOptions} [options] - Configuration options for retrieval behavior
246
+ * @param {boolean} [options.onlyQueryData=false] - If true, only returns data from the specific retrieve query cache, ignoring list data fallbacks
247
+ * @param {boolean} [options.deepSearch=true] - If true, performs deep search through paginated queries when item not found in direct cache or itemMap
248
+ *
249
+ * @returns Item | undefined
250
+ */
251
+ getRetrieveData(id, options = {}) {
252
+ var _a;
253
+ const { onlyQueryData = false, deepSearch = false, } = options;
254
+ if (TypeGuards.isNil(id))
255
+ return undefined;
256
+ const queryKey = this.keys.retrieve(id);
257
+ const queryData = this.queryClient.getQueryData(queryKey);
258
+ if (queryData === null || queryData === void 0 ? void 0 : queryData.id)
259
+ return queryData;
260
+ if (onlyQueryData)
261
+ return undefined;
262
+ if (!deepSearch) {
263
+ const { itemMap } = this.getListData();
264
+ return itemMap === null || itemMap === void 0 ? void 0 : itemMap[id];
265
+ }
266
+ const queries = this.getAllListQueries();
267
+ for (const query of queries) {
268
+ const pages = (_a = query.state.data) === null || _a === void 0 ? void 0 : _a.pages;
269
+ if (!(pages === null || pages === void 0 ? void 0 : pages.length))
270
+ continue;
271
+ const item = pages
272
+ .filter(Boolean)
273
+ .flatMap(page => Array.isArray(page) ? page : [])
274
+ .find(item => (item === null || item === void 0 ? void 0 : item.id) === id);
275
+ if (item)
276
+ return item;
277
+ }
278
+ return undefined;
279
+ }
280
+ /**
281
+ * Gets all list queries from the query cache
282
+ * @returns Array of list queries for this query name
283
+ */
284
+ getAllListQueries() {
285
+ const queries = this.queryClient.getQueryCache().findAll({
286
+ predicate: (query) => this.predicateQueryKeyList(this.queryName, query),
287
+ });
288
+ return queries;
289
+ }
290
+ /**
291
+ * Gets a specific list query from the query cache
292
+ * @param listFilters - Optional filters to identify a specific list query. If omitted, returns the unfiltered list query
293
+ * @returns The matching list query, or undefined if not found
294
+ */
295
+ getListQuery(listFilters) {
296
+ const query = this.queryClient.getQueryCache().find({
297
+ queryKey: this.listKeyWithFilters(listFilters)
298
+ });
299
+ return query;
300
+ }
301
+ }
302
+ /**
303
+ * Factory function to create a new QueryKeys instance
304
+ * @template T - The query item type that extends QueryItem
305
+ * @template F - The filter type used for list queries
306
+ * @param name - The name of the query used as base for all keys
307
+ * @param queryClient - The React Query client instance
308
+ * @returns New QueryKeys instance
309
+ */
310
+ export const createQueryKeys = (name, queryClient) => {
311
+ return new QueryKeys(name, queryClient);
312
+ };
313
+ //# sourceMappingURL=QueryKeys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueryKeys.js","sourceRoot":"","sources":["../../src/lib/QueryKeys.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,OAAO,SAAS,MAAM,iBAAiB,CAAA;AAEvC;;;;GAIG;AACH,MAAM,OAAO,SAAS;IACpB;;;;OAIG;IACH,YACU,SAAiB,EACjB,WAAwB;QADxB,cAAS,GAAT,SAAS,CAAQ;QACjB,gBAAW,GAAX,WAAW,CAAa;IAC9B,CAAC;IAEL;;;OAGG;IACH,IAAI,IAAI;QACN,OAAO;YACL,UAAU;YACV,IAAI,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAa;YAC1C,QAAQ,EAAE,CAAC,EAAmB,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,EAAE,EAAE,CAAa;YAE/E,YAAY;YACZ,MAAM,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAa;YAC9C,MAAM,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAa;YAC9C,MAAM,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAa;SAC/C,CAAA;IACH,CAAC;IAED;;;;OAIG;IACH,kBAAkB,CAAC,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