apixa 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +257 -2
- package/dist/chunk-6ZX7GAWG.js +10 -0
- package/dist/chunk-A3QU5MFP.js +907 -0
- package/dist/chunk-DGSIZXRI.js +247 -0
- package/dist/chunk-GWZTJ7LM.js +2410 -0
- package/dist/chunk-IAQ5YOVE.js +10 -0
- package/dist/chunk-KE7UM4VW.js +707 -0
- package/dist/chunk-LARJYKRJ.js +117 -0
- package/dist/chunk-MLPW6EET.js +10 -0
- package/dist/chunk-QVKMZELC.js +10 -0
- package/dist/chunk-QY5YMHHN.js +607 -0
- package/dist/chunk-QZIU7J3G.js +10 -0
- package/dist/chunk-R4FXTZWU.js +10 -0
- package/dist/chunk-SIFGLE22.js +794 -0
- package/dist/chunk-WNJUPR6P.js +707 -0
- package/dist/chunk-ZSLMMDUX.js +727 -0
- package/dist/data-3HVQ54F3.js +2550 -0
- package/dist/data-ADLKYCN6.js +2211 -0
- package/dist/data-B47EIZXW.js +6 -0
- package/dist/data-DL4IKJCX.js +6 -0
- package/dist/data-GNCSLYM4.js +6 -0
- package/dist/data-GTTIEVFI.js +6 -0
- package/dist/data-HWX62BTJ.js +4772 -0
- package/dist/data-JR6F6HSR.js +6 -0
- package/dist/data-OKVHGTXW.js +3544 -0
- package/dist/data-PQPSE56A.js +1308 -0
- package/dist/data-QF32LRM4.js +3506 -0
- package/dist/data-UIVRJ77R.js +2456 -0
- package/dist/data-UZVNJUNM.js +2256 -0
- package/dist/data-WRWVXGYD.js +6 -0
- package/dist/data-Y6374BIT.js +3350 -0
- package/dist/index.d.ts +305 -0
- package/dist/index.js +80 -0
- package/dist/inference-BGj3DlzE.d.ts +1220 -0
- package/dist/loader-hhMdppVZ.d.ts +32 -0
- package/dist/mock-datasets-Xa9NXK9n.d.ts +178 -0
- package/dist/mocking/datasets/comments.d.ts +6 -0
- package/dist/mocking/datasets/comments.js +7 -0
- package/dist/mocking/datasets/companies.d.ts +6 -0
- package/dist/mocking/datasets/companies.js +7 -0
- package/dist/mocking/datasets/index.d.ts +18 -0
- package/dist/mocking/datasets/index.js +265 -0
- package/dist/mocking/datasets/orders.d.ts +6 -0
- package/dist/mocking/datasets/orders.js +7 -0
- package/dist/mocking/datasets/posts.d.ts +6 -0
- package/dist/mocking/datasets/posts.js +7 -0
- package/dist/mocking/datasets/products.d.ts +6 -0
- package/dist/mocking/datasets/products.js +7 -0
- package/dist/mocking/datasets/users.d.ts +6 -0
- package/dist/mocking/datasets/users.js +7 -0
- package/dist/mocking/index.d.ts +317 -0
- package/dist/mocking/index.js +366 -0
- package/dist/mocking/node.d.ts +33 -0
- package/dist/mocking/node.js +189 -0
- package/dist/mocking/register.d.ts +2 -0
- package/dist/mocking/register.js +9 -0
- package/dist/mutation-controller-BjCOn42y.d.ts +476 -0
- package/dist/react/advanced.d.ts +111 -0
- package/dist/react/advanced.js +119 -0
- package/dist/react/index.d.ts +283 -0
- package/dist/react/index.js +303 -0
- package/dist/types-mSoi1qGP.d.ts +46 -0
- package/package.json +128 -4
|
@@ -0,0 +1,794 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BUILTIN_CONVENTIONS,
|
|
3
|
+
createIdempotencyKey,
|
|
4
|
+
getOperationMetadata
|
|
5
|
+
} from "./chunk-GWZTJ7LM.js";
|
|
6
|
+
|
|
7
|
+
// packages/tanstack-query/src/operations.ts
|
|
8
|
+
var BUILTIN_READ_NAMES = new Set(
|
|
9
|
+
Object.entries(BUILTIN_CONVENTIONS).filter(([, convention]) => convention.access === "read").map(([name]) => name)
|
|
10
|
+
);
|
|
11
|
+
var cache = /* @__PURE__ */ new WeakMap();
|
|
12
|
+
function describeOperations(resource) {
|
|
13
|
+
const cached = cache.get(resource);
|
|
14
|
+
if (cached) return cached;
|
|
15
|
+
const metadata = getOperationMetadata(resource);
|
|
16
|
+
const table = /* @__PURE__ */ new Map();
|
|
17
|
+
for (const name of Object.keys(resource)) {
|
|
18
|
+
if (typeof resource[name] !== "function") continue;
|
|
19
|
+
const meta = metadata?.[name];
|
|
20
|
+
table.set(
|
|
21
|
+
name,
|
|
22
|
+
meta ? {
|
|
23
|
+
kind: meta.kind,
|
|
24
|
+
builtin: meta.builtin,
|
|
25
|
+
optionsIndex: meta.optionsIndex,
|
|
26
|
+
idempotency: meta.idempotency === true
|
|
27
|
+
} : metadata ? { kind: "write", builtin: false, optionsIndex: null, idempotency: false } : Object.prototype.hasOwnProperty.call(BUILTIN_CONVENTIONS, name) ? {
|
|
28
|
+
kind: BUILTIN_CONVENTIONS[name].access,
|
|
29
|
+
builtin: true,
|
|
30
|
+
optionsIndex: null,
|
|
31
|
+
idempotency: false
|
|
32
|
+
} : { kind: "write", builtin: false, optionsIndex: null, idempotency: false }
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
cache.set(resource, table);
|
|
36
|
+
return table;
|
|
37
|
+
}
|
|
38
|
+
function isPlainObject(value) {
|
|
39
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) return false;
|
|
40
|
+
const proto = Object.getPrototypeOf(value);
|
|
41
|
+
return proto === Object.prototype || proto === null;
|
|
42
|
+
}
|
|
43
|
+
function assertNoFullResponse(args, info) {
|
|
44
|
+
if (info.optionsIndex === null) return;
|
|
45
|
+
const options = args[info.optionsIndex];
|
|
46
|
+
if (isPlainObject(options) && options.full === true) {
|
|
47
|
+
throw new Error(
|
|
48
|
+
"Apixa TanStack hooks return raw payloads; full: true needs the Core client directly."
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// packages/tanstack-query/src/keys.ts
|
|
54
|
+
function createResourceKeys(input) {
|
|
55
|
+
const root = [...input.scope ?? [], ...input.queryKey];
|
|
56
|
+
return {
|
|
57
|
+
all: () => root,
|
|
58
|
+
lists: () => [...root, "list"],
|
|
59
|
+
list: (query) => query === void 0 ? [...root, "list"] : [...root, "list", query],
|
|
60
|
+
detail: (id) => [...root, "detail", id],
|
|
61
|
+
operation: (op, parts = []) => [...root, "operation", op, ...parts],
|
|
62
|
+
infinites: () => [...root, "infinite"],
|
|
63
|
+
infinite: (op = "getAll", parts = []) => [...root, "infinite", op, ...parts],
|
|
64
|
+
mutation: (op) => [...root, "mutation", op]
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// packages/tanstack-query/src/query-options.ts
|
|
69
|
+
import {
|
|
70
|
+
infiniteQueryOptions,
|
|
71
|
+
queryOptions
|
|
72
|
+
} from "@tanstack/react-query";
|
|
73
|
+
function createResourceQueryOptions(resource, options) {
|
|
74
|
+
return buildResourceQueryOptions(resource, options);
|
|
75
|
+
}
|
|
76
|
+
function buildResourceQueryOptions(resource, options) {
|
|
77
|
+
if (Object.prototype.hasOwnProperty.call(options, "readOperations")) {
|
|
78
|
+
throw new Error('readOperations was removed; declare kind: "read" on the Core operation.');
|
|
79
|
+
}
|
|
80
|
+
const {
|
|
81
|
+
queryKey,
|
|
82
|
+
scope,
|
|
83
|
+
operation = "getAll",
|
|
84
|
+
args,
|
|
85
|
+
keyParts,
|
|
86
|
+
query,
|
|
87
|
+
...nativeOptions
|
|
88
|
+
} = options;
|
|
89
|
+
if (!Array.isArray(queryKey) || queryKey.length === 0) {
|
|
90
|
+
throw new Error("Resource query requires a non-empty queryKey.");
|
|
91
|
+
}
|
|
92
|
+
const run = resource[operation];
|
|
93
|
+
if (typeof run !== "function") {
|
|
94
|
+
throw new Error(`Resource has no ${operation} operation.`);
|
|
95
|
+
}
|
|
96
|
+
const info = describeOperations(resource).get(operation);
|
|
97
|
+
if (info.kind !== "read") {
|
|
98
|
+
throw new Error(`Operation ${operation} is not a read; declare kind: "read" in Core.`);
|
|
99
|
+
}
|
|
100
|
+
if (typeof args === "function" && keyParts === void 0) {
|
|
101
|
+
throw new Error("Argument-builder queries require keyParts.");
|
|
102
|
+
}
|
|
103
|
+
if (query !== void 0 && args !== void 0) {
|
|
104
|
+
throw new Error("Use either query or args for getAll; combining them is ambiguous.");
|
|
105
|
+
}
|
|
106
|
+
const staticArgs = Array.isArray(args) ? args : query === void 0 ? void 0 : info.optionsIndex === null ? [{ query }] : withOptions([], info, { query });
|
|
107
|
+
if (staticArgs) assertNoFullResponse(staticArgs, info);
|
|
108
|
+
const keys = createResourceKeys({ queryKey, scope });
|
|
109
|
+
const identity = keyParts ?? normalizeIdentity(staticArgs ?? [], info);
|
|
110
|
+
let generatedKey;
|
|
111
|
+
if (operation === "getAll") {
|
|
112
|
+
const listQuery = query !== void 0 ? query : listQueryOf(identity, info);
|
|
113
|
+
generatedKey = keyParts !== void 0 ? keys.list(keyParts) : identity.length === 0 ? keys.list() : listQuery !== void 0 ? keys.list(listQuery) : keys.list(identity);
|
|
114
|
+
} else if (operation === "getById") {
|
|
115
|
+
generatedKey = [...keys.detail(identity[0]), ...identity.slice(1)];
|
|
116
|
+
} else {
|
|
117
|
+
generatedKey = keys.operation(operation, identity);
|
|
118
|
+
}
|
|
119
|
+
const missingDetailId = operation === "getById" && typeof args !== "function" && missingIdentifier(staticArgs?.[0]);
|
|
120
|
+
const enabled = missingDetailId ? false : nativeOptions.enabled;
|
|
121
|
+
return queryOptions({
|
|
122
|
+
...nativeOptions,
|
|
123
|
+
enabled,
|
|
124
|
+
queryKey: generatedKey,
|
|
125
|
+
queryFn: (context) => {
|
|
126
|
+
const callArgs = typeof args === "function" ? args(context) : staticArgs ?? [];
|
|
127
|
+
if (operation === "getById" && missingIdentifier(callArgs[0])) {
|
|
128
|
+
throw new Error("getById requires a valid identifier.");
|
|
129
|
+
}
|
|
130
|
+
assertNoFullResponse(callArgs, info);
|
|
131
|
+
const bound = typeof args === "function" ? callArgs : withOptions(callArgs, info, { signal: context.signal });
|
|
132
|
+
return run(...bound);
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
function withOptions(values, info, extra) {
|
|
137
|
+
const index = info.optionsIndex;
|
|
138
|
+
if (index === null) return [...values];
|
|
139
|
+
const current = values[index];
|
|
140
|
+
if (current !== void 0 && !isPlainObject(current)) return [...values];
|
|
141
|
+
const result = [...values];
|
|
142
|
+
while (result.length < index) result.push(void 0);
|
|
143
|
+
result[index] = { ...current ?? {}, ...extra };
|
|
144
|
+
return result;
|
|
145
|
+
}
|
|
146
|
+
function normalizeIdentity(values, info) {
|
|
147
|
+
const result = [...values];
|
|
148
|
+
const index = info.optionsIndex;
|
|
149
|
+
if (index !== null && isPlainObject(result[index])) {
|
|
150
|
+
const {
|
|
151
|
+
signal: _signal,
|
|
152
|
+
timeout: _timeout,
|
|
153
|
+
retry: _retry,
|
|
154
|
+
idempotencyKey: _idempotencyKey,
|
|
155
|
+
...rest
|
|
156
|
+
} = result[index];
|
|
157
|
+
result[index] = Object.keys(rest).length === 0 ? void 0 : rest;
|
|
158
|
+
}
|
|
159
|
+
while (result.length > 0 && result[result.length - 1] === void 0) result.pop();
|
|
160
|
+
return result;
|
|
161
|
+
}
|
|
162
|
+
function listQueryOf(identity, info) {
|
|
163
|
+
if (info.optionsIndex !== 0 || identity.length !== 1) return void 0;
|
|
164
|
+
const options = identity[0];
|
|
165
|
+
if (!isPlainObject(options)) return void 0;
|
|
166
|
+
const keys = Object.keys(options);
|
|
167
|
+
return keys.length === 1 && keys[0] === "query" ? options.query : void 0;
|
|
168
|
+
}
|
|
169
|
+
function missingIdentifier(value) {
|
|
170
|
+
if (value === void 0 || value === null || value === "") return true;
|
|
171
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
172
|
+
const parts = Object.values(value);
|
|
173
|
+
return parts.length === 0 || parts.some((part) => part === void 0 || part === null || part === "");
|
|
174
|
+
}
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
function createResourceInfiniteQueryOptions(resource, options) {
|
|
178
|
+
return buildResourceInfiniteQueryOptions(
|
|
179
|
+
resource,
|
|
180
|
+
options
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
function buildResourceInfiniteQueryOptions(resource, options) {
|
|
184
|
+
const { queryKey, scope, operation = "getAll", keyParts, infinite, ...nativeOptions } = options;
|
|
185
|
+
for (const removed of ["args", "query"]) {
|
|
186
|
+
if (Object.prototype.hasOwnProperty.call(options, removed)) {
|
|
187
|
+
throw new Error(
|
|
188
|
+
`Infinite queries take ${removed} inside infinite: { ${removed}: (pageParam) => \u2026 }.`
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
if (!Array.isArray(queryKey) || queryKey.length === 0) {
|
|
193
|
+
throw new Error("Resource query requires a non-empty queryKey.");
|
|
194
|
+
}
|
|
195
|
+
if (!infinite || typeof infinite !== "object") {
|
|
196
|
+
throw new Error("Infinite resource query requires an infinite config.");
|
|
197
|
+
}
|
|
198
|
+
if (!Object.prototype.hasOwnProperty.call(infinite, "initialPageParam")) {
|
|
199
|
+
throw new Error("infinite.initialPageParam is required (use null or 0 for the first page).");
|
|
200
|
+
}
|
|
201
|
+
if (typeof infinite.getNextPageParam !== "function") {
|
|
202
|
+
throw new Error("infinite.getNextPageParam must be a function.");
|
|
203
|
+
}
|
|
204
|
+
if (infinite.query !== void 0 && infinite.args !== void 0) {
|
|
205
|
+
throw new Error("Use either infinite.query or infinite.args; combining them is ambiguous.");
|
|
206
|
+
}
|
|
207
|
+
const run = resource[operation];
|
|
208
|
+
if (typeof run !== "function") throw new Error(`Resource has no ${operation} operation.`);
|
|
209
|
+
const info = describeOperations(resource).get(operation);
|
|
210
|
+
if (info.kind !== "read") {
|
|
211
|
+
throw new Error(`Operation ${operation} is not a read; declare kind: "read" in Core.`);
|
|
212
|
+
}
|
|
213
|
+
if (infinite.query !== void 0 && info.optionsIndex === null && operation !== "getAll") {
|
|
214
|
+
throw new Error(
|
|
215
|
+
`infinite.query needs Core's RequestOptions slot; ${operation} has a signature Core does not own \u2014 use infinite.args.`
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
const keys = createResourceKeys({ queryKey, scope });
|
|
219
|
+
const { query: pageQuery, args: pageArgs, initialPageParam, maxPages } = infinite;
|
|
220
|
+
return infiniteQueryOptions({
|
|
221
|
+
...nativeOptions,
|
|
222
|
+
queryKey: keys.infinite(operation, keyParts ?? []),
|
|
223
|
+
initialPageParam,
|
|
224
|
+
getNextPageParam: infinite.getNextPageParam,
|
|
225
|
+
getPreviousPageParam: infinite.getPreviousPageParam,
|
|
226
|
+
...maxPages === void 0 ? {} : { maxPages },
|
|
227
|
+
queryFn: (context) => {
|
|
228
|
+
const pageParam = context.pageParam;
|
|
229
|
+
let callArgs;
|
|
230
|
+
if (pageArgs) {
|
|
231
|
+
callArgs = [...pageArgs(pageParam, context)];
|
|
232
|
+
} else {
|
|
233
|
+
const query = pageQuery?.(pageParam);
|
|
234
|
+
const extra = { signal: context.signal };
|
|
235
|
+
if (query !== void 0) extra.query = query;
|
|
236
|
+
callArgs = info.optionsIndex === null ? query === void 0 ? [] : [{ query }] : withOptions([], info, extra);
|
|
237
|
+
}
|
|
238
|
+
assertNoFullResponse(callArgs, info);
|
|
239
|
+
return run(...callArgs);
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
function prefetchResourceQuery(client, resource, options) {
|
|
244
|
+
return client.prefetchQuery(buildResourceQueryOptions(resource, options));
|
|
245
|
+
}
|
|
246
|
+
function prefetchResourceInfiniteQuery(client, resource, options) {
|
|
247
|
+
const { pages, ...rest } = options;
|
|
248
|
+
return client.prefetchInfiniteQuery({
|
|
249
|
+
...buildResourceInfiniteQueryOptions(resource, rest),
|
|
250
|
+
...pages === void 0 ? {} : { pages }
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// packages/tanstack-query/src/query-helpers.ts
|
|
255
|
+
var INHERITED = ["staleTime", "gcTime", "retry", "retryDelay", "networkMode", "meta"];
|
|
256
|
+
function createQueryHelpers(resource, client, keys, current) {
|
|
257
|
+
const observed = () => {
|
|
258
|
+
const state = current();
|
|
259
|
+
if (!state.built) {
|
|
260
|
+
throw new Error(
|
|
261
|
+
'This resource query observes nothing (no getAll); pass a target such as { operation: "getById", args: [id] }.'
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
return state;
|
|
265
|
+
};
|
|
266
|
+
const inherited = (overrides) => {
|
|
267
|
+
const { options } = current();
|
|
268
|
+
const out = { queryKey: options.queryKey, scope: options.scope };
|
|
269
|
+
for (const key of INHERITED) if (options[key] !== void 0) out[key] = options[key];
|
|
270
|
+
return { ...out, ...overrides, queryKey: options.queryKey, scope: options.scope };
|
|
271
|
+
};
|
|
272
|
+
const resolve = (target) => {
|
|
273
|
+
if (target === void 0) {
|
|
274
|
+
const state = observed();
|
|
275
|
+
return { queryKey: state.built.queryKey, exact: true, infinite: state.infinite };
|
|
276
|
+
}
|
|
277
|
+
if (target.all === true) return { queryKey: keys.all(), exact: false, infinite: false };
|
|
278
|
+
if (target.lists === true) return { queryKey: keys.lists(), exact: false, infinite: false };
|
|
279
|
+
if (target.infinite === true) {
|
|
280
|
+
return {
|
|
281
|
+
queryKey: keys.infinite(
|
|
282
|
+
target.operation ?? "getAll",
|
|
283
|
+
target.keyParts ?? []
|
|
284
|
+
),
|
|
285
|
+
exact: true,
|
|
286
|
+
infinite: true
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
if (target.infinite !== void 0) {
|
|
290
|
+
const built2 = buildResourceInfiniteQueryOptions(resource, {
|
|
291
|
+
...inherited(target),
|
|
292
|
+
infinite: target.infinite
|
|
293
|
+
});
|
|
294
|
+
return { queryKey: built2.queryKey, exact: true, infinite: true };
|
|
295
|
+
}
|
|
296
|
+
const built = buildResourceQueryOptions(resource, inherited(target));
|
|
297
|
+
return { queryKey: built.queryKey, exact: true, infinite: false };
|
|
298
|
+
};
|
|
299
|
+
const exactOnly = (target, what) => {
|
|
300
|
+
const resolved = resolve(target);
|
|
301
|
+
if (!resolved.exact) throw new Error(`cache.${what} needs one entry, not a prefix target.`);
|
|
302
|
+
return resolved;
|
|
303
|
+
};
|
|
304
|
+
const prefetch = (target) => {
|
|
305
|
+
if (target === void 0) {
|
|
306
|
+
const state = observed();
|
|
307
|
+
return state.infinite ? client.prefetchInfiniteQuery(state.built) : client.prefetchQuery(state.built);
|
|
308
|
+
}
|
|
309
|
+
if (target.infinite === true) {
|
|
310
|
+
throw new Error(
|
|
311
|
+
"prefetch needs the paging config: { infinite: { initialPageParam, getNextPageParam, \u2026 } }."
|
|
312
|
+
);
|
|
313
|
+
}
|
|
314
|
+
if (target.infinite !== void 0) {
|
|
315
|
+
const { pages, infinite, ...rest } = target;
|
|
316
|
+
const options = buildResourceInfiniteQueryOptions(resource, {
|
|
317
|
+
...inherited(rest),
|
|
318
|
+
infinite
|
|
319
|
+
});
|
|
320
|
+
return client.prefetchInfiniteQuery({
|
|
321
|
+
...options,
|
|
322
|
+
...pages === void 0 ? {} : { pages }
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
return client.prefetchQuery(buildResourceQueryOptions(resource, inherited(target)));
|
|
326
|
+
};
|
|
327
|
+
const cache2 = {
|
|
328
|
+
get: (target) => client.getQueryData(exactOnly(target, "get").queryKey),
|
|
329
|
+
set: (updater, target) => {
|
|
330
|
+
const { queryKey, infinite } = exactOnly(target, "set");
|
|
331
|
+
return client.setQueryData(queryKey, (previous) => {
|
|
332
|
+
const next = typeof updater === "function" ? updater(previous) : updater;
|
|
333
|
+
if (infinite && next !== void 0) assertInfiniteData(next);
|
|
334
|
+
return next;
|
|
335
|
+
});
|
|
336
|
+
},
|
|
337
|
+
remove: (target) => {
|
|
338
|
+
const { queryKey, exact } = resolve(target);
|
|
339
|
+
client.removeQueries({ queryKey, exact });
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
const cancel = (target) => {
|
|
343
|
+
const { queryKey, exact } = resolve(target);
|
|
344
|
+
return client.cancelQueries({ queryKey, exact });
|
|
345
|
+
};
|
|
346
|
+
return { prefetch, cache: cache2, cancel };
|
|
347
|
+
}
|
|
348
|
+
function assertInfiniteData(value) {
|
|
349
|
+
const data = value;
|
|
350
|
+
if (!data || typeof data !== "object" || !Array.isArray(data.pages) || !Array.isArray(data.pageParams) || data.pages.length !== data.pageParams.length) {
|
|
351
|
+
throw new Error(
|
|
352
|
+
"cache.set on an infinite query must return { pages, pageParams } arrays of equal length."
|
|
353
|
+
);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
// packages/tanstack-query/src/query-controller.ts
|
|
358
|
+
function createResourceQueryController(resource, config, keys = createResourceKeys(config)) {
|
|
359
|
+
const root = { queryKey: config.queryKey, scope: config.scope };
|
|
360
|
+
const listOptions = (overrides = {}) => buildResourceQueryOptions(resource, {
|
|
361
|
+
...overrides,
|
|
362
|
+
...root,
|
|
363
|
+
query: overrides.args === void 0 ? config.query : void 0,
|
|
364
|
+
...overrides.query === void 0 ? {} : { query: overrides.query }
|
|
365
|
+
});
|
|
366
|
+
const detailOptions = (id, overrides = {}) => buildResourceQueryOptions(resource, {
|
|
367
|
+
...overrides,
|
|
368
|
+
...root,
|
|
369
|
+
operation: "getById",
|
|
370
|
+
args: [id]
|
|
371
|
+
});
|
|
372
|
+
const operationOptions = (options) => buildResourceQueryOptions(resource, { ...options, ...root });
|
|
373
|
+
const scoped = (filters) => ({ ...filters, queryKey: keys.all() });
|
|
374
|
+
return {
|
|
375
|
+
keys,
|
|
376
|
+
listQueryParams: config.query,
|
|
377
|
+
listOptions,
|
|
378
|
+
detailOptions,
|
|
379
|
+
operationOptions,
|
|
380
|
+
invalidate: (client, filters) => client.invalidateQueries({ ...filters, queryKey: keys.all() }),
|
|
381
|
+
invalidateLists: async (client, filters) => {
|
|
382
|
+
await Promise.all([
|
|
383
|
+
client.invalidateQueries({ ...filters, queryKey: keys.lists() }),
|
|
384
|
+
client.invalidateQueries({ ...filters, queryKey: keys.infinites() })
|
|
385
|
+
]);
|
|
386
|
+
},
|
|
387
|
+
invalidateDetail: (client, id, filters) => (
|
|
388
|
+
// Prefix match: also covers detail variants keyed with extra arguments.
|
|
389
|
+
client.invalidateQueries({ ...filters, queryKey: keys.detail(id) })
|
|
390
|
+
),
|
|
391
|
+
refetch: (client, filters) => client.refetchQueries(scoped(filters)),
|
|
392
|
+
cancel: (client, filters) => client.cancelQueries(scoped(filters)),
|
|
393
|
+
remove: (client, filters) => client.removeQueries(scoped(filters)),
|
|
394
|
+
reset: (client, filters) => client.resetQueries(scoped(filters)),
|
|
395
|
+
getCached: (client, target) => client.getQueryData(
|
|
396
|
+
Array.isArray(target) ? target : target.queryKey
|
|
397
|
+
),
|
|
398
|
+
setCached: (client, target, updater) => client.setQueryData(
|
|
399
|
+
Array.isArray(target) ? target : target.queryKey,
|
|
400
|
+
updater
|
|
401
|
+
),
|
|
402
|
+
fetch: (client, options) => client.fetchQuery(options),
|
|
403
|
+
prefetch: (client, options) => client.prefetchQuery(options),
|
|
404
|
+
ensure: (client, options) => client.ensureQueryData(options),
|
|
405
|
+
fetchDetail: (client, id) => client.fetchQuery(detailOptions(id)),
|
|
406
|
+
fetchOperation: (client, operation, ...args) => client.fetchQuery(buildResourceQueryOptions(resource, { ...root, operation, args }))
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
// packages/tanstack-query/src/optimistic.ts
|
|
411
|
+
function inFlightFetches(queries) {
|
|
412
|
+
const out = [];
|
|
413
|
+
for (const query of queries) {
|
|
414
|
+
const promise = query.promise;
|
|
415
|
+
if (query.state.fetchStatus === "fetching" && query.state.data !== void 0 && promise) {
|
|
416
|
+
out.push({ query, promise });
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
return out;
|
|
420
|
+
}
|
|
421
|
+
function restartStaleFetches(fetches) {
|
|
422
|
+
for (const { query, promise } of fetches) {
|
|
423
|
+
if (query.state.fetchStatus !== "fetching" || query.promise !== promise) continue;
|
|
424
|
+
void query.fetch(void 0, { cancelRefetch: true }).catch(() => void 0);
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
var REGISTRIES = /* @__PURE__ */ new WeakMap();
|
|
428
|
+
var OptimisticLayers = class _OptimisticLayers {
|
|
429
|
+
constructor(client) {
|
|
430
|
+
this.client = client;
|
|
431
|
+
}
|
|
432
|
+
client;
|
|
433
|
+
#entries = /* @__PURE__ */ new Map();
|
|
434
|
+
#unsubscribe;
|
|
435
|
+
#writing = false;
|
|
436
|
+
static for(client) {
|
|
437
|
+
let registry = REGISTRIES.get(client);
|
|
438
|
+
if (!registry) {
|
|
439
|
+
registry = new _OptimisticLayers(client);
|
|
440
|
+
REGISTRIES.set(client, registry);
|
|
441
|
+
}
|
|
442
|
+
return registry;
|
|
443
|
+
}
|
|
444
|
+
/** Number of entries holding layers (for tests and leak checks). */
|
|
445
|
+
get size() {
|
|
446
|
+
return this.#entries.size;
|
|
447
|
+
}
|
|
448
|
+
async begin(token, targets) {
|
|
449
|
+
const cache2 = this.client.getQueryCache();
|
|
450
|
+
const matches = [];
|
|
451
|
+
for (const target of targets) {
|
|
452
|
+
for (const query of cache2.findAll({ queryKey: target.queryKey, exact: target.exact })) {
|
|
453
|
+
matches.push({ query, update: target.update });
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
if (matches.length === 0) return;
|
|
457
|
+
await Promise.all(
|
|
458
|
+
matches.map(
|
|
459
|
+
({ query }) => this.client.cancelQueries({ queryKey: query.queryKey, exact: true })
|
|
460
|
+
)
|
|
461
|
+
);
|
|
462
|
+
for (const { query, update } of matches) {
|
|
463
|
+
let entry = this.#entries.get(query.queryHash);
|
|
464
|
+
if (!entry) {
|
|
465
|
+
if (query.state.data === void 0) continue;
|
|
466
|
+
entry = { query, base: query.state.data, layers: [] };
|
|
467
|
+
this.#entries.set(query.queryHash, entry);
|
|
468
|
+
}
|
|
469
|
+
entry.layers.push({
|
|
470
|
+
token,
|
|
471
|
+
committed: false,
|
|
472
|
+
apply: (data) => data === void 0 ? data : update(data)
|
|
473
|
+
});
|
|
474
|
+
this.#write(entry);
|
|
475
|
+
}
|
|
476
|
+
this.#subscribe();
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* Settles one mutation's layers. On success, returns the fetches of its entries that were in
|
|
480
|
+
* flight at commit time: they were sent before the server had the change, so their responses
|
|
481
|
+
* are stale (pass them to `restartStaleFetches` once invalidation has started).
|
|
482
|
+
*/
|
|
483
|
+
settle(token, succeeded) {
|
|
484
|
+
const inFlight = [];
|
|
485
|
+
for (const [hash, entry] of [...this.#entries]) {
|
|
486
|
+
const index = entry.layers.findIndex((layer) => layer.token === token);
|
|
487
|
+
if (index === -1) continue;
|
|
488
|
+
if (succeeded) {
|
|
489
|
+
entry.layers[index].committed = true;
|
|
490
|
+
inFlight.push(...inFlightFetches([entry.query]));
|
|
491
|
+
} else entry.layers.splice(index, 1);
|
|
492
|
+
if (entry.layers.every((layer) => layer.committed)) {
|
|
493
|
+
if (!succeeded) this.#write(entry);
|
|
494
|
+
this.#entries.delete(hash);
|
|
495
|
+
} else {
|
|
496
|
+
this.#write(entry);
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
this.#maybeUnsubscribe();
|
|
500
|
+
return inFlight;
|
|
501
|
+
}
|
|
502
|
+
#write(entry) {
|
|
503
|
+
const visible = entry.layers.reduce((data, layer) => layer.apply(data), entry.base);
|
|
504
|
+
this.#writing = true;
|
|
505
|
+
try {
|
|
506
|
+
this.client.setQueryData(entry.query.queryKey, visible);
|
|
507
|
+
} finally {
|
|
508
|
+
this.#writing = false;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
#subscribe() {
|
|
512
|
+
if (this.#unsubscribe || this.#entries.size === 0) return;
|
|
513
|
+
this.#unsubscribe = this.client.getQueryCache().subscribe((event) => this.#onEvent(event));
|
|
514
|
+
}
|
|
515
|
+
#maybeUnsubscribe() {
|
|
516
|
+
if (this.#entries.size === 0 && this.#unsubscribe) {
|
|
517
|
+
this.#unsubscribe();
|
|
518
|
+
this.#unsubscribe = void 0;
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
#onEvent(event) {
|
|
522
|
+
const entry = this.#entries.get(event.query.queryHash);
|
|
523
|
+
if (!entry) return;
|
|
524
|
+
if (event.type === "removed") {
|
|
525
|
+
this.#entries.delete(event.query.queryHash);
|
|
526
|
+
this.#maybeUnsubscribe();
|
|
527
|
+
return;
|
|
528
|
+
}
|
|
529
|
+
if (event.type !== "updated" || event.action.type !== "success" || this.#writing) return;
|
|
530
|
+
if (event.action.manual) {
|
|
531
|
+
this.#entries.delete(event.query.queryHash);
|
|
532
|
+
this.#maybeUnsubscribe();
|
|
533
|
+
return;
|
|
534
|
+
}
|
|
535
|
+
entry.base = event.query.state.data;
|
|
536
|
+
entry.layers = entry.layers.filter((layer) => !layer.committed);
|
|
537
|
+
if (entry.layers.length === 0) {
|
|
538
|
+
this.#entries.delete(event.query.queryHash);
|
|
539
|
+
this.#maybeUnsubscribe();
|
|
540
|
+
} else {
|
|
541
|
+
this.#write(entry);
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
};
|
|
545
|
+
|
|
546
|
+
// packages/tanstack-query/src/mutation-store.ts
|
|
547
|
+
import {
|
|
548
|
+
MutationObserver
|
|
549
|
+
} from "@tanstack/react-query";
|
|
550
|
+
var ResourceMutationStore = class {
|
|
551
|
+
constructor(client, resource, keys, config) {
|
|
552
|
+
this.client = client;
|
|
553
|
+
this.resource = resource;
|
|
554
|
+
this.keys = keys;
|
|
555
|
+
this.table = describeOperations(resource);
|
|
556
|
+
this.#config = validateConfig(this.table, config);
|
|
557
|
+
this.renderConfig = this.#config;
|
|
558
|
+
}
|
|
559
|
+
client;
|
|
560
|
+
resource;
|
|
561
|
+
keys;
|
|
562
|
+
table;
|
|
563
|
+
#observers = /* @__PURE__ */ new Map();
|
|
564
|
+
#unsubscribe = /* @__PURE__ */ new Map();
|
|
565
|
+
#listeners = /* @__PURE__ */ new Set();
|
|
566
|
+
#version = 0;
|
|
567
|
+
#config;
|
|
568
|
+
/** Config of the current render (lazy observers and state getters use it). */
|
|
569
|
+
renderConfig;
|
|
570
|
+
/** Idempotency key per call, keyed by the call's variables (TanStack retries reuse them). */
|
|
571
|
+
#idempotencyKeys = /* @__PURE__ */ new WeakMap();
|
|
572
|
+
/** Inherited operations first (Core order), then client-only ones. */
|
|
573
|
+
names(config = this.#config) {
|
|
574
|
+
const clientOnly = Object.keys(config).filter((name) => !this.table.has(name));
|
|
575
|
+
return [...this.table].filter(([, info]) => info.kind === "write").map(([name]) => name).concat(clientOnly);
|
|
576
|
+
}
|
|
577
|
+
isRead(name) {
|
|
578
|
+
return this.table.get(name)?.kind === "read";
|
|
579
|
+
}
|
|
580
|
+
/** The observer for `name`, created on first use with `config` (render) or the committed one. */
|
|
581
|
+
observer(name, config = this.#config) {
|
|
582
|
+
let observer = this.#observers.get(name);
|
|
583
|
+
if (!observer) {
|
|
584
|
+
observer = new MutationObserver(
|
|
585
|
+
this.client,
|
|
586
|
+
this.#options(name, config)
|
|
587
|
+
);
|
|
588
|
+
this.#observers.set(name, observer);
|
|
589
|
+
if (this.#listeners.size > 0) this.#attach(name, observer);
|
|
590
|
+
}
|
|
591
|
+
return observer;
|
|
592
|
+
}
|
|
593
|
+
/** Run one call; each call keeps its own promise (concurrent calls are independent). */
|
|
594
|
+
run(name, args) {
|
|
595
|
+
return this.observer(name, this.renderConfig).mutate([...args]);
|
|
596
|
+
}
|
|
597
|
+
/** Commit the rendered config (from an effect), like `useMutation`'s `setOptions` effect. */
|
|
598
|
+
commit(config) {
|
|
599
|
+
this.#config = validateConfig(this.table, config);
|
|
600
|
+
for (const [name, observer] of this.#observers) {
|
|
601
|
+
observer.setOptions(this.#options(name, this.#config));
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
createdObservers() {
|
|
605
|
+
return this.#observers.values();
|
|
606
|
+
}
|
|
607
|
+
subscribe = (listener) => {
|
|
608
|
+
this.#listeners.add(listener);
|
|
609
|
+
if (this.#listeners.size === 1) {
|
|
610
|
+
for (const [name, observer] of this.#observers) this.#attach(name, observer);
|
|
611
|
+
}
|
|
612
|
+
return () => {
|
|
613
|
+
this.#listeners.delete(listener);
|
|
614
|
+
if (this.#listeners.size === 0) {
|
|
615
|
+
for (const off of this.#unsubscribe.values()) off();
|
|
616
|
+
this.#unsubscribe.clear();
|
|
617
|
+
}
|
|
618
|
+
};
|
|
619
|
+
};
|
|
620
|
+
getSnapshot = () => this.#version;
|
|
621
|
+
#attach(name, observer) {
|
|
622
|
+
if (this.#unsubscribe.has(name)) return;
|
|
623
|
+
this.#unsubscribe.set(
|
|
624
|
+
name,
|
|
625
|
+
observer.subscribe(() => {
|
|
626
|
+
this.#version++;
|
|
627
|
+
for (const listener of this.#listeners) listener();
|
|
628
|
+
})
|
|
629
|
+
);
|
|
630
|
+
}
|
|
631
|
+
#options(name, config) {
|
|
632
|
+
const info = this.table.get(name);
|
|
633
|
+
const entry = config[name] ?? {};
|
|
634
|
+
const { mutationFn, invalidate: invalidate2, optimistic, ...native } = entry;
|
|
635
|
+
const resource = this.resource;
|
|
636
|
+
const keys = this.keys;
|
|
637
|
+
const policy = invalidate2 ?? "all";
|
|
638
|
+
const defaults = this.client.defaultMutationOptions({ mutationKey: keys.mutation(name) });
|
|
639
|
+
const own = (key) => Object.prototype.hasOwnProperty.call(entry, key) ? entry[key] : defaults[key];
|
|
640
|
+
const success = own("onSuccess");
|
|
641
|
+
const layers = optimistic ? OptimisticLayers.for(this.client) : void 0;
|
|
642
|
+
const targets = optimistic ? optimisticTargets(name, optimistic, keys) : void 0;
|
|
643
|
+
const idempotencyKeys = this.#idempotencyKeys;
|
|
644
|
+
const owner = this.resource;
|
|
645
|
+
const options = {
|
|
646
|
+
...native,
|
|
647
|
+
mutationKey: keys.mutation(name),
|
|
648
|
+
mutationFn: (args) => {
|
|
649
|
+
if (!info) return mutationFn(...args);
|
|
650
|
+
assertNoFullResponse(args, info);
|
|
651
|
+
const run = resource[name];
|
|
652
|
+
if (typeof run !== "function") throw new Error(`Resource has no ${name} operation.`);
|
|
653
|
+
return run(...withIdempotencyKey(owner, name, info, args, idempotencyKeys));
|
|
654
|
+
},
|
|
655
|
+
onSuccess: async (data, args, onMutateResult, context) => {
|
|
656
|
+
const stale = layers?.settle(args, true) ?? [];
|
|
657
|
+
const invalidation = applyInvalidation(policy, {
|
|
658
|
+
client: context.client,
|
|
659
|
+
keys,
|
|
660
|
+
data,
|
|
661
|
+
args
|
|
662
|
+
});
|
|
663
|
+
restartStaleFetches(stale);
|
|
664
|
+
await invalidation;
|
|
665
|
+
return success?.(data, args, onMutateResult, context);
|
|
666
|
+
}
|
|
667
|
+
};
|
|
668
|
+
if (layers && targets) {
|
|
669
|
+
const mutate = own("onMutate");
|
|
670
|
+
const failed = own("onError");
|
|
671
|
+
options.onMutate = async (args, context) => {
|
|
672
|
+
await layers.begin(args, targets(args));
|
|
673
|
+
return mutate?.(args, context);
|
|
674
|
+
};
|
|
675
|
+
options.onError = async (error, args, onMutateResult, context) => {
|
|
676
|
+
layers.settle(args, false);
|
|
677
|
+
return failed?.(error, args, onMutateResult, context);
|
|
678
|
+
};
|
|
679
|
+
}
|
|
680
|
+
return options;
|
|
681
|
+
}
|
|
682
|
+
};
|
|
683
|
+
function validateConfig(table, config) {
|
|
684
|
+
for (const [name, entry] of Object.entries(config)) {
|
|
685
|
+
if (entry === void 0) continue;
|
|
686
|
+
if (table.get(name)?.kind === "read") {
|
|
687
|
+
throw new Error(
|
|
688
|
+
`mutations.${name}: Core classifies "${name}" as a read; use useResourceQuery instead.`
|
|
689
|
+
);
|
|
690
|
+
}
|
|
691
|
+
const inherited = table.has(name);
|
|
692
|
+
if (inherited && entry.mutationFn !== void 0) {
|
|
693
|
+
throw new Error(
|
|
694
|
+
`mutations.${name}: "${name}" is an operation of this resource; inherited operations run Core's implementation and cannot take a mutationFn.`
|
|
695
|
+
);
|
|
696
|
+
}
|
|
697
|
+
if (!inherited && typeof entry.mutationFn !== "function") {
|
|
698
|
+
throw new Error(
|
|
699
|
+
`mutations.${name}: not an operation of this resource; a client-only operation needs a mutationFn.`
|
|
700
|
+
);
|
|
701
|
+
}
|
|
702
|
+
if (entry.optimistic !== void 0) validateOptimistic(name, entry.optimistic);
|
|
703
|
+
}
|
|
704
|
+
return config;
|
|
705
|
+
}
|
|
706
|
+
function validateOptimistic(name, optimistic) {
|
|
707
|
+
if (optimistic === null || typeof optimistic !== "object") {
|
|
708
|
+
throw new Error(`mutations.${name}.optimistic must be an object.`);
|
|
709
|
+
}
|
|
710
|
+
const { detail, update, list, targets } = optimistic;
|
|
711
|
+
if (detail !== void 0 && typeof update !== "function") {
|
|
712
|
+
throw new Error(`mutations.${name}.optimistic.detail needs optimistic.update.`);
|
|
713
|
+
}
|
|
714
|
+
if (update !== void 0 && detail === void 0) {
|
|
715
|
+
throw new Error(`mutations.${name}.optimistic.update needs optimistic.detail (the id).`);
|
|
716
|
+
}
|
|
717
|
+
if (detail === void 0 && list === void 0 && targets === void 0) {
|
|
718
|
+
throw new Error(`mutations.${name}.optimistic needs detail + update, list, or targets.`);
|
|
719
|
+
}
|
|
720
|
+
for (const [key, value] of Object.entries({ detail, list, targets })) {
|
|
721
|
+
if (value !== void 0 && typeof value !== "function") {
|
|
722
|
+
throw new Error(`mutations.${name}.optimistic.${key} must be a function.`);
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
function invalidate(client, queryKey) {
|
|
727
|
+
const inFlight = inFlightFetches(client.getQueryCache().findAll({ queryKey }));
|
|
728
|
+
const done = client.invalidateQueries({ queryKey });
|
|
729
|
+
restartStaleFetches(inFlight);
|
|
730
|
+
return done;
|
|
731
|
+
}
|
|
732
|
+
async function applyInvalidation(policy, { client, keys, data, args }) {
|
|
733
|
+
if (policy === false || policy === void 0) return;
|
|
734
|
+
if (policy === true || policy === "all") {
|
|
735
|
+
await invalidate(client, keys.all());
|
|
736
|
+
} else if (policy === "lists") {
|
|
737
|
+
await Promise.all([invalidate(client, keys.lists()), invalidate(client, keys.infinites())]);
|
|
738
|
+
} else if (typeof policy === "function") {
|
|
739
|
+
await policy({ client, keys, data, args });
|
|
740
|
+
} else if (typeof policy === "object") {
|
|
741
|
+
const { lists, details } = policy;
|
|
742
|
+
await Promise.all([
|
|
743
|
+
lists ? invalidate(client, keys.lists()) : void 0,
|
|
744
|
+
lists ? invalidate(client, keys.infinites()) : void 0,
|
|
745
|
+
...(details?.(data, args) ?? []).map((id) => invalidate(client, keys.detail(id)))
|
|
746
|
+
]);
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
function optimisticTargets(name, optimistic, keys) {
|
|
750
|
+
validateOptimistic(name, optimistic);
|
|
751
|
+
const { detail, update, list, targets } = optimistic;
|
|
752
|
+
return (args) => {
|
|
753
|
+
const out = [];
|
|
754
|
+
if (detail) {
|
|
755
|
+
const ids = detail(args);
|
|
756
|
+
for (const id of Array.isArray(ids) ? ids : ids == null ? [] : [ids]) {
|
|
757
|
+
out.push({ queryKey: keys.detail(id), update: (current) => update(current, args) });
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
if (list) out.push({ queryKey: keys.lists(), update: (current) => list(current, args) });
|
|
761
|
+
if (targets) out.push(...targets(args, keys));
|
|
762
|
+
return out;
|
|
763
|
+
};
|
|
764
|
+
}
|
|
765
|
+
function withIdempotencyKey(resource, name, info, args, keys) {
|
|
766
|
+
if (!info.idempotency || info.optionsIndex === null) return args;
|
|
767
|
+
const current = args[info.optionsIndex];
|
|
768
|
+
if (current !== void 0 && !isPlainObject(current)) return args;
|
|
769
|
+
if (isPlainObject(current) && current.idempotencyKey !== void 0) return args;
|
|
770
|
+
let key = keys.get(args);
|
|
771
|
+
if (key === void 0) {
|
|
772
|
+
key = createIdempotencyKey(resource, name);
|
|
773
|
+
if (key === void 0) return args;
|
|
774
|
+
keys.set(args, key);
|
|
775
|
+
}
|
|
776
|
+
return withOptions(args, info, { idempotencyKey: key });
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
export {
|
|
780
|
+
describeOperations,
|
|
781
|
+
createResourceKeys,
|
|
782
|
+
createResourceQueryOptions,
|
|
783
|
+
buildResourceQueryOptions,
|
|
784
|
+
createResourceInfiniteQueryOptions,
|
|
785
|
+
buildResourceInfiniteQueryOptions,
|
|
786
|
+
prefetchResourceQuery,
|
|
787
|
+
prefetchResourceInfiniteQuery,
|
|
788
|
+
createQueryHelpers,
|
|
789
|
+
createResourceQueryController,
|
|
790
|
+
OptimisticLayers,
|
|
791
|
+
ResourceMutationStore,
|
|
792
|
+
validateConfig,
|
|
793
|
+
applyInvalidation
|
|
794
|
+
};
|