@panneau/data 4.1.1 → 5.0.0-alpha.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/README.md +65 -0
- package/dist/adapter.d.ts +84 -0
- package/dist/adapter.d.ts.map +1 -0
- package/dist/errors.d.ts +51 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +78 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +4 -456
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -1794
- package/dist/laravel/index.d.ts +17 -0
- package/dist/laravel/index.d.ts.map +1 -0
- package/dist/laravel/index.js +37 -0
- package/dist/laravel/index.js.map +1 -0
- package/dist/query/context.d.ts +15 -0
- package/dist/query/context.d.ts.map +1 -0
- package/dist/query/context.js +34 -0
- package/dist/query/context.js.map +1 -0
- package/dist/query/hooks.d.ts +52 -0
- package/dist/query/hooks.d.ts.map +1 -0
- package/dist/query/hooks.js +299 -0
- package/dist/query/hooks.js.map +1 -0
- package/dist/query/index.d.ts +6 -0
- package/dist/query/index.d.ts.map +1 -0
- package/dist/query/index.js +6 -0
- package/dist/query/keys.d.ts +17 -0
- package/dist/query/keys.d.ts.map +1 -0
- package/dist/query/keys.js +55 -0
- package/dist/query/keys.js.map +1 -0
- package/dist/query/options.d.ts +18 -0
- package/dist/query/options.d.ts.map +1 -0
- package/dist/query/options.js +30 -0
- package/dist/query/options.js.map +1 -0
- package/dist/query/refresh.d.ts +12 -0
- package/dist/query/refresh.d.ts.map +1 -0
- package/dist/query/refresh.js +24 -0
- package/dist/query/refresh.js.map +1 -0
- package/dist/rest.d.ts +25 -0
- package/dist/rest.d.ts.map +1 -0
- package/dist/rest.js +243 -0
- package/dist/rest.js.map +1 -0
- package/package.json +40 -55
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { DataAdapter } from '../adapter';
|
|
2
|
+
import { type RestAdapterOptions } from '../rest';
|
|
3
|
+
export interface LaravelAdapterOptions extends RestAdapterOptions {
|
|
4
|
+
/** Name of the cookie that holds the CSRF token. Defaults to Laravel's `XSRF-TOKEN`. */
|
|
5
|
+
xsrfCookie?: string;
|
|
6
|
+
/** Header that sends the CSRF token. Defaults to `X-XSRF-TOKEN`. */
|
|
7
|
+
xsrfHeader?: string;
|
|
8
|
+
/** Reads the cookies. Defaults to `document.cookie`, or no cookies outside a browser. */
|
|
9
|
+
cookies?: () => string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The REST adapter set up for `laravel-panneau` with Laravel's session authentication: it sends
|
|
13
|
+
* cookies, adds the CSRF token from the `XSRF-TOKEN` cookie to every request, and treats `419`
|
|
14
|
+
* (expired CSRF token or session) as unauthorized.
|
|
15
|
+
*/
|
|
16
|
+
export declare function createLaravelAdapter({ xsrfCookie, xsrfHeader, cookies, headers, credentials, createError, ...options }: LaravelAdapterOptions): DataAdapter;
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/laravel/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,OAAO,EAAE,KAAK,kBAAkB,EAAqB,MAAM,SAAS,CAAC;AAErE,MAAM,WAAW,qBAAsB,SAAQ,kBAAkB;IAC7D,wFAAwF;IACxF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yFAAyF;IACzF,OAAO,CAAC,EAAE,MAAM,MAAM,CAAC;CAC1B;AAgBD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,EACjC,UAAyB,EACzB,UAA2B,EAC3B,OAAwE,EACxE,OAAO,EACP,WAAuB,EACvB,WAAW,EACX,GAAG,OAAO,EACb,EAAE,qBAAqB,GAAG,WAAW,CAiBrC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { UnauthorizedError } from "../errors.js";
|
|
2
|
+
import { createRestAdapter } from "../rest.js";
|
|
3
|
+
//#region src/laravel/index.ts
|
|
4
|
+
function readCookie(cookies, name) {
|
|
5
|
+
for (const part of cookies.split(";")) {
|
|
6
|
+
const [key, ...value] = part.trim().split("=");
|
|
7
|
+
if (key === name) try {
|
|
8
|
+
return decodeURIComponent(value.join("="));
|
|
9
|
+
} catch {
|
|
10
|
+
return value.join("=");
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The REST adapter set up for `laravel-panneau` with Laravel's session authentication: it sends
|
|
17
|
+
* cookies, adds the CSRF token from the `XSRF-TOKEN` cookie to every request, and treats `419`
|
|
18
|
+
* (expired CSRF token or session) as unauthorized.
|
|
19
|
+
*/
|
|
20
|
+
function createLaravelAdapter({ xsrfCookie = "XSRF-TOKEN", xsrfHeader = "X-XSRF-TOKEN", cookies = () => typeof document === "undefined" ? "" : document.cookie, headers, credentials = "include", createError, ...options }) {
|
|
21
|
+
return createRestAdapter({
|
|
22
|
+
...options,
|
|
23
|
+
credentials,
|
|
24
|
+
headers: async () => {
|
|
25
|
+
const result = new Headers(typeof headers === "function" ? await headers() : headers);
|
|
26
|
+
result.set("X-Requested-With", "XMLHttpRequest");
|
|
27
|
+
const token = readCookie(cookies(), xsrfCookie);
|
|
28
|
+
if (token !== null) result.set(xsrfHeader, token);
|
|
29
|
+
return result;
|
|
30
|
+
},
|
|
31
|
+
createError: (problem, response) => createError?.(problem, response) ?? (problem.status === 419 ? new UnauthorizedError(problem) : void 0)
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { createLaravelAdapter };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/laravel/index.ts"],"sourcesContent":["import type { DataAdapter } from '../adapter';\nimport { UnauthorizedError } from '../errors';\nimport { type RestAdapterOptions, createRestAdapter } from '../rest';\n\nexport interface LaravelAdapterOptions extends RestAdapterOptions {\n /** Name of the cookie that holds the CSRF token. Defaults to Laravel's `XSRF-TOKEN`. */\n xsrfCookie?: string;\n /** Header that sends the CSRF token. Defaults to `X-XSRF-TOKEN`. */\n xsrfHeader?: string;\n /** Reads the cookies. Defaults to `document.cookie`, or no cookies outside a browser. */\n cookies?: () => string;\n}\n\nfunction readCookie(cookies: string, name: string): string | null {\n for (const part of cookies.split(';')) {\n const [key, ...value] = part.trim().split('=');\n if (key === name) {\n try {\n return decodeURIComponent(value.join('='));\n } catch {\n return value.join('=');\n }\n }\n }\n return null;\n}\n\n/**\n * The REST adapter set up for `laravel-panneau` with Laravel's session authentication: it sends\n * cookies, adds the CSRF token from the `XSRF-TOKEN` cookie to every request, and treats `419`\n * (expired CSRF token or session) as unauthorized.\n */\nexport function createLaravelAdapter({\n xsrfCookie = 'XSRF-TOKEN',\n xsrfHeader = 'X-XSRF-TOKEN',\n cookies = () => (typeof document === 'undefined' ? '' : document.cookie),\n headers,\n credentials = 'include',\n createError,\n ...options\n}: LaravelAdapterOptions): DataAdapter {\n return createRestAdapter({\n ...options,\n credentials,\n headers: async () => {\n const result = new Headers(typeof headers === 'function' ? await headers() : headers);\n result.set('X-Requested-With', 'XMLHttpRequest');\n const token = readCookie(cookies(), xsrfCookie);\n if (token !== null) {\n result.set(xsrfHeader, token);\n }\n return result;\n },\n createError: (problem, response) =>\n createError?.(problem, response) ??\n (problem.status === 419 ? new UnauthorizedError(problem) : undefined),\n });\n}\n"],"mappings":";;;AAaA,SAAS,WAAW,SAAiB,MAA6B;CAC9D,KAAK,MAAM,QAAQ,QAAQ,MAAM,GAAG,GAAG;EACnC,MAAM,CAAC,KAAK,GAAG,SAAS,KAAK,KAAK,CAAC,CAAC,MAAM,GAAG;EAC7C,IAAI,QAAQ,MACR,IAAI;GACA,OAAO,mBAAmB,MAAM,KAAK,GAAG,CAAC;EAC7C,QAAQ;GACJ,OAAO,MAAM,KAAK,GAAG;EACzB;CAER;CACA,OAAO;AACX;;;;;;AAOA,SAAgB,qBAAqB,EACjC,aAAa,cACb,aAAa,gBACb,gBAAiB,OAAO,aAAa,cAAc,KAAK,SAAS,QACjE,SACA,cAAc,WACd,aACA,GAAG,WACgC;CACnC,OAAO,kBAAkB;EACrB,GAAG;EACH;EACA,SAAS,YAAY;GACjB,MAAM,SAAS,IAAI,QAAQ,OAAO,YAAY,aAAa,MAAM,QAAQ,IAAI,OAAO;GACpF,OAAO,IAAI,oBAAoB,gBAAgB;GAC/C,MAAM,QAAQ,WAAW,QAAQ,GAAG,UAAU;GAC9C,IAAI,UAAU,MACV,OAAO,IAAI,YAAY,KAAK;GAEhC,OAAO;EACX;EACA,cAAc,SAAS,aACnB,cAAc,SAAS,QAAQ,MAC9B,QAAQ,WAAW,MAAM,IAAI,kBAAkB,OAAO,IAAI,KAAA;CACnE,CAAC;AACL"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { DataAdapter } from '../adapter';
|
|
3
|
+
export interface DataAdapterProviderProps {
|
|
4
|
+
/** The adapter of the hooks below: `createRestAdapter()`, a preset or a custom adapter. */
|
|
5
|
+
adapter: DataAdapter;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Provides the adapter used by the query hooks. The hooks also need TanStack Query's
|
|
10
|
+
* `QueryClientProvider` above them.
|
|
11
|
+
*/
|
|
12
|
+
export declare function DataAdapterProvider({ adapter, children }: DataAdapterProviderProps): import("react").JSX.Element;
|
|
13
|
+
/** The adapter of the closest `DataAdapterProvider`. */
|
|
14
|
+
export declare function useDataAdapter(): DataAdapter;
|
|
15
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/query/context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAsB,MAAM,OAAO,CAAC;AAE3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAI9C,MAAM,WAAW,wBAAwB;IACrC,2FAA2F;IAC3F,OAAO,EAAE,WAAW,CAAC;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,wBAAwB,+BAElF;AAED,wDAAwD;AACxD,wBAAgB,cAAc,IAAI,WAAW,CAM5C"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
2
|
+
import { createContext, use } from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/query/context.tsx
|
|
5
|
+
var DataAdapterContext = createContext(null);
|
|
6
|
+
/**
|
|
7
|
+
* Provides the adapter used by the query hooks. The hooks also need TanStack Query's
|
|
8
|
+
* `QueryClientProvider` above them.
|
|
9
|
+
*/
|
|
10
|
+
function DataAdapterProvider(t0) {
|
|
11
|
+
const $ = c(3);
|
|
12
|
+
const { adapter, children } = t0;
|
|
13
|
+
let t1;
|
|
14
|
+
if ($[0] !== adapter || $[1] !== children) {
|
|
15
|
+
t1 = /* @__PURE__ */ jsx(DataAdapterContext, {
|
|
16
|
+
value: adapter,
|
|
17
|
+
children
|
|
18
|
+
});
|
|
19
|
+
$[0] = adapter;
|
|
20
|
+
$[1] = children;
|
|
21
|
+
$[2] = t1;
|
|
22
|
+
} else t1 = $[2];
|
|
23
|
+
return t1;
|
|
24
|
+
}
|
|
25
|
+
/** The adapter of the closest `DataAdapterProvider`. */
|
|
26
|
+
function useDataAdapter() {
|
|
27
|
+
const adapter = use(DataAdapterContext);
|
|
28
|
+
if (adapter === null) throw new Error("useDataAdapter() needs a <DataAdapterProvider> above it.");
|
|
29
|
+
return adapter;
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { DataAdapterProvider, useDataAdapter };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","names":["adapter","children","_c"],"sources":["../../src/query/context.tsx"],"sourcesContent":["import { type ReactNode, createContext, use } from 'react';\n\nimport type { DataAdapter } from '../adapter';\n\nconst DataAdapterContext = createContext<DataAdapter | null>(null);\n\nexport interface DataAdapterProviderProps {\n /** The adapter of the hooks below: `createRestAdapter()`, a preset or a custom adapter. */\n adapter: DataAdapter;\n children?: ReactNode;\n}\n\n/**\n * Provides the adapter used by the query hooks. The hooks also need TanStack Query's\n * `QueryClientProvider` above them.\n */\nexport function DataAdapterProvider({ adapter, children }: DataAdapterProviderProps) {\n return <DataAdapterContext value={adapter}>{children}</DataAdapterContext>;\n}\n\n/** The adapter of the closest `DataAdapterProvider`. */\nexport function useDataAdapter(): DataAdapter {\n const adapter = use(DataAdapterContext);\n if (adapter === null) {\n throw new Error('useDataAdapter() needs a <DataAdapterProvider> above it.');\n }\n return adapter;\n}\n"],"mappings":";;;;AAIA,IAAM,qBAAqB,cAAkC,IAAI;;;;;AAYjE,SAAO,oBAAA,IAAA;CAAA,MAAA,IAAAE,EAAA,CAAA;CAA6B,MAAA,EAAA,SAAA,aAAA;CAA+C,IAAA;CAAA,IAAA,EAAA,OAAA,WAAA,EAAA,OAAA,UAAA;EACxE,KAAA,oBAAC,oBAAD;GAA2BF,OAAA;GAAU;EAAlB,CAAA;EAAgD,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAAnE;AAAmE;;AAI9E,SAAgB,iBAA8B;CAC1C,MAAM,UAAU,IAAI,kBAAkB;CACtC,IAAI,YAAY,MACZ,MAAM,IAAI,MAAM,0DAA0D;CAE9E,OAAO;AACX"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type UseMutationResult, type UseQueryOptions, type UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import type { ActionRequest, ActionRun, Definition, Item, ListQuery, ListResponse } from '@panneau/protocol';
|
|
3
|
+
import type { ActionResponse, Values } from '../adapter';
|
|
4
|
+
import { queryKeys } from './keys';
|
|
5
|
+
/** Options of a query hook: TanStack Query's options, without the key and the function. */
|
|
6
|
+
export type QueryHookOptions<TData, TKey extends readonly unknown[]> = Omit<UseQueryOptions<TData, Error, TData, TKey>, 'queryKey' | 'queryFn'>;
|
|
7
|
+
/**
|
|
8
|
+
* The definition for the current user. Pass `initialData` when the server inlines it in the page.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useDefinition(options?: QueryHookOptions<Definition, ReturnType<typeof queryKeys.definition>>): UseQueryResult<Definition>;
|
|
11
|
+
/** A page of items of a resource. */
|
|
12
|
+
export declare function useResourceList(resource: string, query?: ListQuery, options?: QueryHookOptions<ListResponse, ReturnType<typeof queryKeys.list>>): UseQueryResult<ListResponse>;
|
|
13
|
+
/** One item of a resource. Nothing is fetched while `id` is `null` or `undefined`. */
|
|
14
|
+
export declare function useResourceItem(resource: string, id: string | null | undefined, options?: QueryHookOptions<Item, ReturnType<typeof queryKeys.item>>): UseQueryResult<Item>;
|
|
15
|
+
/** Creates an item, then refetches the lists of the resource. */
|
|
16
|
+
export declare function useCreateItem(resource: string): UseMutationResult<Item, Error, Values>;
|
|
17
|
+
export interface UpdateItemVariables {
|
|
18
|
+
/** Id of the item. */
|
|
19
|
+
id: string;
|
|
20
|
+
/** The values to change, keyed by field name. */
|
|
21
|
+
values: Values;
|
|
22
|
+
/** The version the values were edited from, sent as `If-Match`. */
|
|
23
|
+
version?: string | null;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Updates an item, then caches the updated item and refetches the lists of the resource. Fails
|
|
27
|
+
* with a `ConflictError` when the item changed since `version`.
|
|
28
|
+
*/
|
|
29
|
+
export declare function useUpdateItem(resource: string): UseMutationResult<Item, Error, UpdateItemVariables>;
|
|
30
|
+
/** Deletes an item, then removes it from the cache and refetches the lists of the resource. */
|
|
31
|
+
export declare function useDeleteItem(resource: string): UseMutationResult<void, Error, string>;
|
|
32
|
+
export interface RunActionVariables extends ActionRequest {
|
|
33
|
+
/** Id of the action. */
|
|
34
|
+
action: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Runs an action of a resource. When it finishes right away, the cache is refreshed as its
|
|
38
|
+
* result asks (`refresh`). When the backend queues it, follow the run with `useActionRun()`.
|
|
39
|
+
*/
|
|
40
|
+
export declare function useRunAction(resource: string): UseMutationResult<ActionResponse, Error, RunActionVariables>;
|
|
41
|
+
/** Whether a run has finished, successfully or not. */
|
|
42
|
+
export declare function isRunFinished(run: ActionRun): boolean;
|
|
43
|
+
export interface UseActionRunOptions {
|
|
44
|
+
/** Milliseconds between two checks while the run is not finished. Defaults to 2 seconds. */
|
|
45
|
+
interval?: number;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Follows a queued action run until it finishes. When it does, the cache is refreshed as its
|
|
49
|
+
* result asks. Nothing is fetched while `id` is `null` or `undefined`.
|
|
50
|
+
*/
|
|
51
|
+
export declare function useActionRun(id: string | null | undefined, { interval }?: UseActionRunOptions): UseQueryResult<ActionRun>;
|
|
52
|
+
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/query/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,cAAc,EAKtB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EACR,aAAa,EACb,SAAS,EACT,UAAU,EACV,IAAI,EACJ,SAAS,EACT,YAAY,EACf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEz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jB,iBAAiB,CAAC,IAAI,EAAE,KAAK,EAAE,mBAAmB,CAAC,CAWrD;AAED,+FAA+F;AAC/F,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,CAUtF;AAED,MAAM,WAAW,kBAAmB,SAAQ,aAAa;IACrD,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAgB,YAAY,CACxB,QAAQ,EAAE,MAAM,GACjB,iBAAiB,CAAC,cAAc,EAAE,KAAK,EAAE,kBAAkB,CAAC,CAc9D;AASD,uDAAuD;AACvD,wBAAgB,aAAa,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAErD;AAED,MAAM,WAAW,mBAAmB;IAChC,4FAA4F;IAC5F,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,YAAY,CACxB,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC7B,EAAE,QAAe,EAAE,GAAE,mBAAwB,GAC9C,cAAc,CAAC,SAAS,CAAC,CAsB3B"}
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import { useDataAdapter } from "./context.js";
|
|
2
|
+
import { queryKeys } from "./keys.js";
|
|
3
|
+
import { definitionQueryOptions, resourceItemQueryOptions, resourceListQueryOptions } from "./options.js";
|
|
4
|
+
import { invalidateActionResult } from "./refresh.js";
|
|
5
|
+
import { c } from "react/compiler-runtime";
|
|
6
|
+
import { skipToken, useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
7
|
+
//#region src/query/hooks.ts
|
|
8
|
+
/**
|
|
9
|
+
* The definition for the current user. Pass `initialData` when the server inlines it in the page.
|
|
10
|
+
*/
|
|
11
|
+
function useDefinition(t0) {
|
|
12
|
+
const $ = c(7);
|
|
13
|
+
let t1;
|
|
14
|
+
if ($[0] !== t0) {
|
|
15
|
+
t1 = t0 === void 0 ? {} : t0;
|
|
16
|
+
$[0] = t0;
|
|
17
|
+
$[1] = t1;
|
|
18
|
+
} else t1 = $[1];
|
|
19
|
+
const options = t1;
|
|
20
|
+
const adapter = useDataAdapter();
|
|
21
|
+
let t2;
|
|
22
|
+
if ($[2] !== adapter) {
|
|
23
|
+
t2 = definitionQueryOptions(adapter);
|
|
24
|
+
$[2] = adapter;
|
|
25
|
+
$[3] = t2;
|
|
26
|
+
} else t2 = $[3];
|
|
27
|
+
let t3;
|
|
28
|
+
if ($[4] !== options || $[5] !== t2) {
|
|
29
|
+
t3 = {
|
|
30
|
+
...t2,
|
|
31
|
+
...options
|
|
32
|
+
};
|
|
33
|
+
$[4] = options;
|
|
34
|
+
$[5] = t2;
|
|
35
|
+
$[6] = t3;
|
|
36
|
+
} else t3 = $[6];
|
|
37
|
+
return useQuery(t3);
|
|
38
|
+
}
|
|
39
|
+
/** A page of items of a resource. */
|
|
40
|
+
function useResourceList(resource, t0, t1) {
|
|
41
|
+
const $ = c(11);
|
|
42
|
+
let t2;
|
|
43
|
+
if ($[0] !== t0) {
|
|
44
|
+
t2 = t0 === void 0 ? {} : t0;
|
|
45
|
+
$[0] = t0;
|
|
46
|
+
$[1] = t2;
|
|
47
|
+
} else t2 = $[1];
|
|
48
|
+
const query = t2;
|
|
49
|
+
let t3;
|
|
50
|
+
if ($[2] !== t1) {
|
|
51
|
+
t3 = t1 === void 0 ? {} : t1;
|
|
52
|
+
$[2] = t1;
|
|
53
|
+
$[3] = t3;
|
|
54
|
+
} else t3 = $[3];
|
|
55
|
+
const options = t3;
|
|
56
|
+
const adapter = useDataAdapter();
|
|
57
|
+
let t4;
|
|
58
|
+
if ($[4] !== adapter || $[5] !== query || $[6] !== resource) {
|
|
59
|
+
t4 = resourceListQueryOptions(adapter, resource, query);
|
|
60
|
+
$[4] = adapter;
|
|
61
|
+
$[5] = query;
|
|
62
|
+
$[6] = resource;
|
|
63
|
+
$[7] = t4;
|
|
64
|
+
} else t4 = $[7];
|
|
65
|
+
let t5;
|
|
66
|
+
if ($[8] !== options || $[9] !== t4) {
|
|
67
|
+
t5 = {
|
|
68
|
+
...t4,
|
|
69
|
+
...options
|
|
70
|
+
};
|
|
71
|
+
$[8] = options;
|
|
72
|
+
$[9] = t4;
|
|
73
|
+
$[10] = t5;
|
|
74
|
+
} else t5 = $[10];
|
|
75
|
+
return useQuery(t5);
|
|
76
|
+
}
|
|
77
|
+
/** One item of a resource. Nothing is fetched while `id` is `null` or `undefined`. */
|
|
78
|
+
function useResourceItem(resource, id, t0) {
|
|
79
|
+
const $ = c(10);
|
|
80
|
+
let t1;
|
|
81
|
+
if ($[0] !== t0) {
|
|
82
|
+
t1 = t0 === void 0 ? {} : t0;
|
|
83
|
+
$[0] = t0;
|
|
84
|
+
$[1] = t1;
|
|
85
|
+
} else t1 = $[1];
|
|
86
|
+
const options = t1;
|
|
87
|
+
const adapter = useDataAdapter();
|
|
88
|
+
const t2 = id ?? "";
|
|
89
|
+
let t3;
|
|
90
|
+
if ($[2] !== adapter || $[3] !== resource || $[4] !== t2) {
|
|
91
|
+
t3 = resourceItemQueryOptions(adapter, resource, t2);
|
|
92
|
+
$[2] = adapter;
|
|
93
|
+
$[3] = resource;
|
|
94
|
+
$[4] = t2;
|
|
95
|
+
$[5] = t3;
|
|
96
|
+
} else t3 = $[5];
|
|
97
|
+
const query = t3;
|
|
98
|
+
const t4 = id == null ? skipToken : query.queryFn;
|
|
99
|
+
let t5;
|
|
100
|
+
if ($[6] !== options || $[7] !== query || $[8] !== t4) {
|
|
101
|
+
t5 = {
|
|
102
|
+
...query,
|
|
103
|
+
queryFn: t4,
|
|
104
|
+
...options
|
|
105
|
+
};
|
|
106
|
+
$[6] = options;
|
|
107
|
+
$[7] = query;
|
|
108
|
+
$[8] = t4;
|
|
109
|
+
$[9] = t5;
|
|
110
|
+
} else t5 = $[9];
|
|
111
|
+
return useQuery(t5);
|
|
112
|
+
}
|
|
113
|
+
/** Creates an item, then refetches the lists of the resource. */
|
|
114
|
+
function useCreateItem(resource) {
|
|
115
|
+
const $ = c(9);
|
|
116
|
+
const adapter = useDataAdapter();
|
|
117
|
+
const client = useQueryClient();
|
|
118
|
+
let t0;
|
|
119
|
+
if ($[0] !== adapter || $[1] !== resource) {
|
|
120
|
+
t0 = (values) => adapter.create(resource, values);
|
|
121
|
+
$[0] = adapter;
|
|
122
|
+
$[1] = resource;
|
|
123
|
+
$[2] = t0;
|
|
124
|
+
} else t0 = $[2];
|
|
125
|
+
let t1;
|
|
126
|
+
if ($[3] !== client || $[4] !== resource) {
|
|
127
|
+
t1 = (item) => {
|
|
128
|
+
client.setQueryData(queryKeys.item(resource, item.id), item);
|
|
129
|
+
return client.invalidateQueries({ queryKey: queryKeys.lists(resource) });
|
|
130
|
+
};
|
|
131
|
+
$[3] = client;
|
|
132
|
+
$[4] = resource;
|
|
133
|
+
$[5] = t1;
|
|
134
|
+
} else t1 = $[5];
|
|
135
|
+
let t2;
|
|
136
|
+
if ($[6] !== t0 || $[7] !== t1) {
|
|
137
|
+
t2 = {
|
|
138
|
+
mutationFn: t0,
|
|
139
|
+
onSuccess: t1
|
|
140
|
+
};
|
|
141
|
+
$[6] = t0;
|
|
142
|
+
$[7] = t1;
|
|
143
|
+
$[8] = t2;
|
|
144
|
+
} else t2 = $[8];
|
|
145
|
+
return useMutation(t2);
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Updates an item, then caches the updated item and refetches the lists of the resource. Fails
|
|
149
|
+
* with a `ConflictError` when the item changed since `version`.
|
|
150
|
+
*/
|
|
151
|
+
function useUpdateItem(resource) {
|
|
152
|
+
const $ = c(9);
|
|
153
|
+
const adapter = useDataAdapter();
|
|
154
|
+
const client = useQueryClient();
|
|
155
|
+
let t0;
|
|
156
|
+
if ($[0] !== adapter || $[1] !== resource) {
|
|
157
|
+
t0 = (t1) => {
|
|
158
|
+
const { id, values, version } = t1;
|
|
159
|
+
return adapter.update(resource, id, values, { version });
|
|
160
|
+
};
|
|
161
|
+
$[0] = adapter;
|
|
162
|
+
$[1] = resource;
|
|
163
|
+
$[2] = t0;
|
|
164
|
+
} else t0 = $[2];
|
|
165
|
+
let t1;
|
|
166
|
+
if ($[3] !== client || $[4] !== resource) {
|
|
167
|
+
t1 = (item) => {
|
|
168
|
+
client.setQueryData(queryKeys.item(resource, item.id), item);
|
|
169
|
+
return client.invalidateQueries({ queryKey: queryKeys.lists(resource) });
|
|
170
|
+
};
|
|
171
|
+
$[3] = client;
|
|
172
|
+
$[4] = resource;
|
|
173
|
+
$[5] = t1;
|
|
174
|
+
} else t1 = $[5];
|
|
175
|
+
let t2;
|
|
176
|
+
if ($[6] !== t0 || $[7] !== t1) {
|
|
177
|
+
t2 = {
|
|
178
|
+
mutationFn: t0,
|
|
179
|
+
onSuccess: t1
|
|
180
|
+
};
|
|
181
|
+
$[6] = t0;
|
|
182
|
+
$[7] = t1;
|
|
183
|
+
$[8] = t2;
|
|
184
|
+
} else t2 = $[8];
|
|
185
|
+
return useMutation(t2);
|
|
186
|
+
}
|
|
187
|
+
/** Deletes an item, then removes it from the cache and refetches the lists of the resource. */
|
|
188
|
+
function useDeleteItem(resource) {
|
|
189
|
+
const $ = c(9);
|
|
190
|
+
const adapter = useDataAdapter();
|
|
191
|
+
const client = useQueryClient();
|
|
192
|
+
let t0;
|
|
193
|
+
if ($[0] !== adapter || $[1] !== resource) {
|
|
194
|
+
t0 = (id) => adapter.delete(resource, id);
|
|
195
|
+
$[0] = adapter;
|
|
196
|
+
$[1] = resource;
|
|
197
|
+
$[2] = t0;
|
|
198
|
+
} else t0 = $[2];
|
|
199
|
+
let t1;
|
|
200
|
+
if ($[3] !== client || $[4] !== resource) {
|
|
201
|
+
t1 = (_result, id_0) => {
|
|
202
|
+
client.removeQueries({ queryKey: queryKeys.item(resource, id_0) });
|
|
203
|
+
return client.invalidateQueries({ queryKey: queryKeys.lists(resource) });
|
|
204
|
+
};
|
|
205
|
+
$[3] = client;
|
|
206
|
+
$[4] = resource;
|
|
207
|
+
$[5] = t1;
|
|
208
|
+
} else t1 = $[5];
|
|
209
|
+
let t2;
|
|
210
|
+
if ($[6] !== t0 || $[7] !== t1) {
|
|
211
|
+
t2 = {
|
|
212
|
+
mutationFn: t0,
|
|
213
|
+
onSuccess: t1
|
|
214
|
+
};
|
|
215
|
+
$[6] = t0;
|
|
216
|
+
$[7] = t1;
|
|
217
|
+
$[8] = t2;
|
|
218
|
+
} else t2 = $[8];
|
|
219
|
+
return useMutation(t2);
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Runs an action of a resource. When it finishes right away, the cache is refreshed as its
|
|
223
|
+
* result asks (`refresh`). When the backend queues it, follow the run with `useActionRun()`.
|
|
224
|
+
*/
|
|
225
|
+
function useRunAction(resource) {
|
|
226
|
+
const $ = c(9);
|
|
227
|
+
const adapter = useDataAdapter();
|
|
228
|
+
const client = useQueryClient();
|
|
229
|
+
let t0;
|
|
230
|
+
if ($[0] !== adapter || $[1] !== resource) {
|
|
231
|
+
t0 = (t1) => {
|
|
232
|
+
const { action, ...request } = t1;
|
|
233
|
+
return adapter.runAction(resource, action, request);
|
|
234
|
+
};
|
|
235
|
+
$[0] = adapter;
|
|
236
|
+
$[1] = resource;
|
|
237
|
+
$[2] = t0;
|
|
238
|
+
} else t0 = $[2];
|
|
239
|
+
let t1;
|
|
240
|
+
if ($[3] !== client || $[4] !== resource) {
|
|
241
|
+
t1 = (response, t2) => {
|
|
242
|
+
const { selection } = t2;
|
|
243
|
+
if (response.run !== void 0) {
|
|
244
|
+
client.setQueryData(queryKeys.actionRun(response.run.id), response.run);
|
|
245
|
+
return client.invalidateQueries({
|
|
246
|
+
queryKey: queryKeys.actionRuns(),
|
|
247
|
+
exact: true
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
return invalidateActionResult(client, resource, response.result, selection);
|
|
251
|
+
};
|
|
252
|
+
$[3] = client;
|
|
253
|
+
$[4] = resource;
|
|
254
|
+
$[5] = t1;
|
|
255
|
+
} else t1 = $[5];
|
|
256
|
+
let t2;
|
|
257
|
+
if ($[6] !== t0 || $[7] !== t1) {
|
|
258
|
+
t2 = {
|
|
259
|
+
mutationFn: t0,
|
|
260
|
+
onSuccess: t1
|
|
261
|
+
};
|
|
262
|
+
$[6] = t0;
|
|
263
|
+
$[7] = t1;
|
|
264
|
+
$[8] = t2;
|
|
265
|
+
} else t2 = $[8];
|
|
266
|
+
return useMutation(t2);
|
|
267
|
+
}
|
|
268
|
+
var FINISHED_RUN_STATUSES = /* @__PURE__ */ new Set([
|
|
269
|
+
"succeeded",
|
|
270
|
+
"partial",
|
|
271
|
+
"failed",
|
|
272
|
+
"cancelled"
|
|
273
|
+
]);
|
|
274
|
+
/** Whether a run has finished, successfully or not. */
|
|
275
|
+
function isRunFinished(run) {
|
|
276
|
+
return FINISHED_RUN_STATUSES.has(run.status);
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Follows a queued action run until it finishes. When it does, the cache is refreshed as its
|
|
280
|
+
* result asks. Nothing is fetched while `id` is `null` or `undefined`.
|
|
281
|
+
*/
|
|
282
|
+
function useActionRun(id, { interval = 2e3 } = {}) {
|
|
283
|
+
const adapter = useDataAdapter();
|
|
284
|
+
const client = useQueryClient();
|
|
285
|
+
return useQuery({
|
|
286
|
+
queryKey: queryKeys.actionRun(id ?? ""),
|
|
287
|
+
queryFn: id == null ? skipToken : async ({ signal }) => {
|
|
288
|
+
const previous = client.getQueryData(queryKeys.actionRun(id));
|
|
289
|
+
const run = await adapter.getActionRun(id, { signal });
|
|
290
|
+
if (isRunFinished(run) && (previous === void 0 || !isRunFinished(previous)) && run.result !== void 0) await invalidateActionResult(client, run.resource, run.result);
|
|
291
|
+
return run;
|
|
292
|
+
},
|
|
293
|
+
refetchInterval: (query) => query.state.data !== void 0 && isRunFinished(query.state.data) ? false : interval
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
//#endregion
|
|
297
|
+
export { isRunFinished, useActionRun, useCreateItem, useDefinition, useDeleteItem, useResourceItem, useResourceList, useRunAction, useUpdateItem };
|
|
298
|
+
|
|
299
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.js","names":["id","_c"],"sources":["../../src/query/hooks.ts"],"sourcesContent":["import {\n type UseMutationResult,\n type UseQueryOptions,\n type UseQueryResult,\n skipToken,\n useMutation,\n useQuery,\n useQueryClient,\n} from '@tanstack/react-query';\n\nimport type {\n ActionRequest,\n ActionRun,\n Definition,\n Item,\n ListQuery,\n ListResponse,\n} from '@panneau/protocol';\n\nimport type { ActionResponse, Values } from '../adapter';\nimport { useDataAdapter } from './context';\nimport { queryKeys } from './keys';\nimport {\n definitionQueryOptions,\n resourceItemQueryOptions,\n resourceListQueryOptions,\n} from './options';\nimport { invalidateActionResult } from './refresh';\n\n/** Options of a query hook: TanStack Query's options, without the key and the function. */\nexport type QueryHookOptions<TData, TKey extends readonly unknown[]> = Omit<\n UseQueryOptions<TData, Error, TData, TKey>,\n 'queryKey' | 'queryFn'\n>;\n\n/**\n * The definition for the current user. Pass `initialData` when the server inlines it in the page.\n */\nexport function useDefinition(\n options: QueryHookOptions<Definition, ReturnType<typeof queryKeys.definition>> = {},\n): UseQueryResult<Definition> {\n const adapter = useDataAdapter();\n return useQuery({ ...definitionQueryOptions(adapter), ...options });\n}\n\n/** A page of items of a resource. */\nexport function useResourceList(\n resource: string,\n query: ListQuery = {},\n options: QueryHookOptions<ListResponse, ReturnType<typeof queryKeys.list>> = {},\n): UseQueryResult<ListResponse> {\n const adapter = useDataAdapter();\n return useQuery({ ...resourceListQueryOptions(adapter, resource, query), ...options });\n}\n\n/** One item of a resource. Nothing is fetched while `id` is `null` or `undefined`. */\nexport function useResourceItem(\n resource: string,\n id: string | null | undefined,\n options: QueryHookOptions<Item, ReturnType<typeof queryKeys.item>> = {},\n): UseQueryResult<Item> {\n const adapter = useDataAdapter();\n const query = resourceItemQueryOptions(adapter, resource, id ?? '');\n return useQuery({ ...query, queryFn: id == null ? skipToken : query.queryFn, ...options });\n}\n\n/** Creates an item, then refetches the lists of the resource. */\nexport function useCreateItem(resource: string): UseMutationResult<Item, Error, Values> {\n const adapter = useDataAdapter();\n const client = useQueryClient();\n return useMutation({\n mutationFn: (values: Values) => adapter.create(resource, values),\n onSuccess: (item) => {\n client.setQueryData(queryKeys.item(resource, item.id), item);\n return client.invalidateQueries({ queryKey: queryKeys.lists(resource) });\n },\n });\n}\n\nexport interface UpdateItemVariables {\n /** Id of the item. */\n id: string;\n /** The values to change, keyed by field name. */\n values: Values;\n /** The version the values were edited from, sent as `If-Match`. */\n version?: string | null;\n}\n\n/**\n * Updates an item, then caches the updated item and refetches the lists of the resource. Fails\n * with a `ConflictError` when the item changed since `version`.\n */\nexport function useUpdateItem(\n resource: string,\n): UseMutationResult<Item, Error, UpdateItemVariables> {\n const adapter = useDataAdapter();\n const client = useQueryClient();\n return useMutation({\n mutationFn: ({ id, values, version }: UpdateItemVariables) =>\n adapter.update(resource, id, values, { version }),\n onSuccess: (item) => {\n client.setQueryData(queryKeys.item(resource, item.id), item);\n return client.invalidateQueries({ queryKey: queryKeys.lists(resource) });\n },\n });\n}\n\n/** Deletes an item, then removes it from the cache and refetches the lists of the resource. */\nexport function useDeleteItem(resource: string): UseMutationResult<void, Error, string> {\n const adapter = useDataAdapter();\n const client = useQueryClient();\n return useMutation({\n mutationFn: (id: string) => adapter.delete(resource, id),\n onSuccess: (_result, id) => {\n client.removeQueries({ queryKey: queryKeys.item(resource, id) });\n return client.invalidateQueries({ queryKey: queryKeys.lists(resource) });\n },\n });\n}\n\nexport interface RunActionVariables extends ActionRequest {\n /** Id of the action. */\n action: string;\n}\n\n/**\n * Runs an action of a resource. When it finishes right away, the cache is refreshed as its\n * result asks (`refresh`). When the backend queues it, follow the run with `useActionRun()`.\n */\nexport function useRunAction(\n resource: string,\n): UseMutationResult<ActionResponse, Error, RunActionVariables> {\n const adapter = useDataAdapter();\n const client = useQueryClient();\n return useMutation({\n mutationFn: ({ action, ...request }: RunActionVariables) =>\n adapter.runAction(resource, action, request),\n onSuccess: (response, { selection }) => {\n if (response.run !== undefined) {\n client.setQueryData(queryKeys.actionRun(response.run.id), response.run);\n return client.invalidateQueries({ queryKey: queryKeys.actionRuns(), exact: true });\n }\n return invalidateActionResult(client, resource, response.result, selection);\n },\n });\n}\n\nconst FINISHED_RUN_STATUSES: ReadonlySet<ActionRun['status']> = new Set([\n 'succeeded',\n 'partial',\n 'failed',\n 'cancelled',\n]);\n\n/** Whether a run has finished, successfully or not. */\nexport function isRunFinished(run: ActionRun): boolean {\n return FINISHED_RUN_STATUSES.has(run.status);\n}\n\nexport interface UseActionRunOptions {\n /** Milliseconds between two checks while the run is not finished. Defaults to 2 seconds. */\n interval?: number;\n}\n\n/**\n * Follows a queued action run until it finishes. When it does, the cache is refreshed as its\n * result asks. Nothing is fetched while `id` is `null` or `undefined`.\n */\nexport function useActionRun(\n id: string | null | undefined,\n { interval = 2000 }: UseActionRunOptions = {},\n): UseQueryResult<ActionRun> {\n const adapter = useDataAdapter();\n const client = useQueryClient();\n return useQuery({\n queryKey: queryKeys.actionRun(id ?? ''),\n queryFn:\n id == null\n ? skipToken\n : async ({ signal }) => {\n const previous = client.getQueryData<ActionRun>(queryKeys.actionRun(id));\n const run = await adapter.getActionRun(id, { signal });\n const justFinished =\n isRunFinished(run) &&\n (previous === undefined || !isRunFinished(previous));\n if (justFinished && run.result !== undefined) {\n await invalidateActionResult(client, run.resource, run.result);\n }\n return run;\n },\n refetchInterval: (query) =>\n query.state.data !== undefined && isRunFinished(query.state.data) ? false : interval,\n });\n}\n"],"mappings":";;;;;;;;;;AAsCA,SAAO,cAAA,IAAA;CAAA,MAAA,IAAAC,EAAA,CAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,IAAA;EACH,KAAA,OAAA,KAAA,IAAA,CAAkF,IAAlF;EAAmF,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAnF,MAA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E,OAAO;EACX;EACV,kBAAkB,UACd,MAAM,MAAM,SAAS,KAAA,KAAa,cAAc,MAAM,MAAM,IAAI,IAAI,QAAQ;CACpF,CAAC;AACL"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { DataAdapterProvider, type DataAdapterProviderProps, useDataAdapter } from './context';
|
|
2
|
+
export { type QueryHookOptions, type RunActionVariables, type UpdateItemVariables, type UseActionRunOptions, isRunFinished, useActionRun, useCreateItem, useDefinition, useDeleteItem, useResourceItem, useResourceList, useRunAction, useUpdateItem, } from './hooks';
|
|
3
|
+
export { queryKeys } from './keys';
|
|
4
|
+
export { type DataQueryOptions, definitionQueryOptions, resourceItemQueryOptions, resourceListQueryOptions, } from './options';
|
|
5
|
+
export { invalidateActionResult } from './refresh';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/query/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,KAAK,wBAAwB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC/F,OAAO,EACH,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,aAAa,EACb,YAAY,EACZ,aAAa,EACb,aAAa,EACb,aAAa,EACb,eAAe,EACf,eAAe,EACf,YAAY,EACZ,aAAa,GAChB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EACH,KAAK,gBAAgB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,wBAAwB,GAC3B,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DataAdapterProvider, useDataAdapter } from "./context.js";
|
|
2
|
+
import { queryKeys } from "./keys.js";
|
|
3
|
+
import { definitionQueryOptions, resourceItemQueryOptions, resourceListQueryOptions } from "./options.js";
|
|
4
|
+
import { invalidateActionResult } from "./refresh.js";
|
|
5
|
+
import { isRunFinished, useActionRun, useCreateItem, useDefinition, useDeleteItem, useResourceItem, useResourceList, useRunAction, useUpdateItem } from "./hooks.js";
|
|
6
|
+
export { DataAdapterProvider, definitionQueryOptions, invalidateActionResult, isRunFinished, queryKeys, resourceItemQueryOptions, resourceListQueryOptions, useActionRun, useCreateItem, useDataAdapter, useDefinition, useDeleteItem, useResourceItem, useResourceList, useRunAction, useUpdateItem };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ListQuery } from '@panneau/protocol';
|
|
2
|
+
/**
|
|
3
|
+
* Query keys of the hooks, to read, prefetch or invalidate their data with the query client.
|
|
4
|
+
* Keys are nested: invalidating `queryKeys.resource('pages')` covers its lists and items.
|
|
5
|
+
*/
|
|
6
|
+
export declare const queryKeys: {
|
|
7
|
+
all: readonly ["panneau"];
|
|
8
|
+
definition: () => readonly ["panneau", "definition"];
|
|
9
|
+
resource: (resource: string) => readonly ["panneau", "resources", string];
|
|
10
|
+
lists: (resource: string) => readonly ["panneau", "resources", string, "list"];
|
|
11
|
+
list: (resource: string, query?: ListQuery) => readonly ["panneau", "resources", string, "list", ListQuery];
|
|
12
|
+
items: (resource: string) => readonly ["panneau", "resources", string, "item"];
|
|
13
|
+
item: (resource: string, id: string) => readonly ["panneau", "resources", string, "item", string];
|
|
14
|
+
actionRuns: () => readonly ["panneau", "actions", "runs"];
|
|
15
|
+
actionRun: (id: string) => readonly ["panneau", "actions", "runs", string];
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../src/query/keys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,SAAS;;;yBAGG,MAAM;sBACT,MAAM;qBACP,MAAM,UAAS,SAAS;sBAEvB,MAAM;qBACP,MAAM,MAAM,MAAM;;oBAEnB,MAAM;CACzB,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
//#region src/query/keys.ts
|
|
2
|
+
/**
|
|
3
|
+
* Query keys of the hooks, to read, prefetch or invalidate their data with the query client.
|
|
4
|
+
* Keys are nested: invalidating `queryKeys.resource('pages')` covers its lists and items.
|
|
5
|
+
*/
|
|
6
|
+
var queryKeys = {
|
|
7
|
+
all: ["panneau"],
|
|
8
|
+
definition: () => ["panneau", "definition"],
|
|
9
|
+
resource: (resource) => [
|
|
10
|
+
"panneau",
|
|
11
|
+
"resources",
|
|
12
|
+
resource
|
|
13
|
+
],
|
|
14
|
+
lists: (resource) => [
|
|
15
|
+
"panneau",
|
|
16
|
+
"resources",
|
|
17
|
+
resource,
|
|
18
|
+
"list"
|
|
19
|
+
],
|
|
20
|
+
list: (resource, query = {}) => [
|
|
21
|
+
"panneau",
|
|
22
|
+
"resources",
|
|
23
|
+
resource,
|
|
24
|
+
"list",
|
|
25
|
+
query
|
|
26
|
+
],
|
|
27
|
+
items: (resource) => [
|
|
28
|
+
"panneau",
|
|
29
|
+
"resources",
|
|
30
|
+
resource,
|
|
31
|
+
"item"
|
|
32
|
+
],
|
|
33
|
+
item: (resource, id) => [
|
|
34
|
+
"panneau",
|
|
35
|
+
"resources",
|
|
36
|
+
resource,
|
|
37
|
+
"item",
|
|
38
|
+
id
|
|
39
|
+
],
|
|
40
|
+
actionRuns: () => [
|
|
41
|
+
"panneau",
|
|
42
|
+
"actions",
|
|
43
|
+
"runs"
|
|
44
|
+
],
|
|
45
|
+
actionRun: (id) => [
|
|
46
|
+
"panneau",
|
|
47
|
+
"actions",
|
|
48
|
+
"runs",
|
|
49
|
+
id
|
|
50
|
+
]
|
|
51
|
+
};
|
|
52
|
+
//#endregion
|
|
53
|
+
export { queryKeys };
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.js","names":[],"sources":["../../src/query/keys.ts"],"sourcesContent":["import type { ListQuery } from '@panneau/protocol';\n\n/**\n * Query keys of the hooks, to read, prefetch or invalidate their data with the query client.\n * Keys are nested: invalidating `queryKeys.resource('pages')` covers its lists and items.\n */\nexport const queryKeys = {\n all: ['panneau'] as const,\n definition: () => ['panneau', 'definition'] as const,\n resource: (resource: string) => ['panneau', 'resources', resource] as const,\n lists: (resource: string) => ['panneau', 'resources', resource, 'list'] as const,\n list: (resource: string, query: ListQuery = {}) =>\n ['panneau', 'resources', resource, 'list', query] as const,\n items: (resource: string) => ['panneau', 'resources', resource, 'item'] as const,\n item: (resource: string, id: string) => ['panneau', 'resources', resource, 'item', id] as const,\n actionRuns: () => ['panneau', 'actions', 'runs'] as const,\n actionRun: (id: string) => ['panneau', 'actions', 'runs', id] as const,\n};\n"],"mappings":";;;;;AAMA,IAAa,YAAY;CACrB,KAAK,CAAC,SAAS;CACf,kBAAkB,CAAC,WAAW,YAAY;CAC1C,WAAW,aAAqB;EAAC;EAAW;EAAa;CAAQ;CACjE,QAAQ,aAAqB;EAAC;EAAW;EAAa;EAAU;CAAM;CACtE,OAAO,UAAkB,QAAmB,CAAC,MACzC;EAAC;EAAW;EAAa;EAAU;EAAQ;CAAK;CACpD,QAAQ,aAAqB;EAAC;EAAW;EAAa;EAAU;CAAM;CACtE,OAAO,UAAkB,OAAe;EAAC;EAAW;EAAa;EAAU;EAAQ;CAAE;CACrF,kBAAkB;EAAC;EAAW;EAAW;CAAM;CAC/C,YAAY,OAAe;EAAC;EAAW;EAAW;EAAQ;CAAE;AAChE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type DataTag, type QueryKey, type UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { Definition, Item, ListQuery, ListResponse } from '@panneau/protocol';
|
|
3
|
+
import type { DataAdapter } from '../adapter';
|
|
4
|
+
import { queryKeys } from './keys';
|
|
5
|
+
/**
|
|
6
|
+
* Query options made by the `*QueryOptions()` functions. Their key is tagged with the type of the
|
|
7
|
+
* data, so `queryClient.getQueryData(options.queryKey)` is typed.
|
|
8
|
+
*/
|
|
9
|
+
export type DataQueryOptions<TData, TKey extends QueryKey> = UseQueryOptions<TData, Error, TData, TKey> & {
|
|
10
|
+
queryKey: DataTag<TKey, TData, Error>;
|
|
11
|
+
};
|
|
12
|
+
/** Query options of the definition, for `useQuery()`, prefetching or route loaders. */
|
|
13
|
+
export declare function definitionQueryOptions(adapter: DataAdapter): DataQueryOptions<Definition, ReturnType<typeof queryKeys.definition>>;
|
|
14
|
+
/** Query options of a page of items. The previous page stays shown while the next one loads. */
|
|
15
|
+
export declare function resourceListQueryOptions(adapter: DataAdapter, resource: string, query?: ListQuery): DataQueryOptions<ListResponse, ReturnType<typeof queryKeys.list>>;
|
|
16
|
+
/** Query options of one item. */
|
|
17
|
+
export declare function resourceItemQueryOptions(adapter: DataAdapter, resource: string, id: string): DataQueryOptions<Item, ReturnType<typeof queryKeys.item>>;
|
|
18
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/query/options.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,eAAe,EAGvB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEnF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC;;;GAGG;AACH,MAAM,MAAM,gBAAgB,CAAC,KAAK,EAAE,IAAI,SAAS,QAAQ,IAAI,eAAe,CACxE,KAAK,EACL,KAAK,EACL,KAAK,EACL,IAAI,CACP,GAAG;IAAE,QAAQ,EAAE,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;CAAE,CAAC;AAE9C,uFAAuF;AACvF,wBAAgB,sBAAsB,CAClC,OAAO,EAAE,WAAW,GACrB,gBAAgB,CAAC,UAAU,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC,UAAU,CAAC,CAAC,CAOvE;AAED,gGAAgG;AAChG,wBAAgB,wBAAwB,CACpC,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,MAAM,EAChB,KAAK,GAAE,SAAc,GACtB,gBAAgB,CAAC,YAAY,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,CAMnE;AAED,iCAAiC;AACjC,wBAAgB,wBAAwB,CACpC,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,MAAM,GACX,gBAAgB,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,CAK3D"}
|