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