@learnorama/mozaik-sdk 0.7.0-staging.26.1 → 0.8.2-staging.31.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/account.d.ts +1 -1
- package/dist/api/account.js.map +1 -1
- package/dist/api/admin-catalogue.d.ts +1 -1
- package/dist/api/admin-catalogue.js.map +1 -1
- package/dist/api/admin-consumption.d.ts +1 -1
- package/dist/api/admin-consumption.js.map +1 -1
- package/dist/api/admin-desk.d.ts +86 -1
- package/dist/api/admin-desk.js +280 -1
- package/dist/api/admin-desk.js.map +1 -1
- package/dist/api/admin-licenses.d.ts +1 -1
- package/dist/api/admin-licenses.js.map +1 -1
- package/dist/api/admin-patrons.d.ts +2 -7
- package/dist/api/admin-patrons.js +1 -6
- package/dist/api/admin-patrons.js.map +1 -1
- package/dist/api/admin-reviews.d.ts +1 -1
- package/dist/api/admin-reviews.js.map +1 -1
- package/dist/api/admin-roles.d.ts +1 -1
- package/dist/api/admin-roles.js.map +1 -1
- package/dist/api/admin-support.d.ts +1 -1
- package/dist/api/admin-support.js.map +1 -1
- package/dist/api/admin-tenants.d.ts +2 -2
- package/dist/api/admin-tenants.js +1 -1
- package/dist/api/admin-tenants.js.map +1 -1
- package/dist/api/admin-tutoring.d.ts +1 -1
- package/dist/api/admin-tutoring.js.map +1 -1
- package/dist/api/auth.d.ts +1 -1
- package/dist/api/auth.js.map +1 -1
- package/dist/api/biblio-catalogue.d.ts +1 -1
- package/dist/api/biblio-catalogue.js.map +1 -1
- package/dist/api/biblio-home.d.ts +1 -1
- package/dist/api/biblio-home.js.map +1 -1
- package/dist/api/biblio-library.d.ts +1 -1
- package/dist/api/biblio-library.js.map +1 -1
- package/dist/api/biblio-nextory.d.ts +1 -1
- package/dist/api/biblio-nextory.js.map +1 -1
- package/dist/api/biblio-press.d.ts +1 -1
- package/dist/api/biblio-press.js.map +1 -1
- package/dist/api/biblio-search.d.ts +1 -1
- package/dist/api/biblio-search.js.map +1 -1
- package/dist/api/biblio-telemetry.d.ts +1 -1
- package/dist/api/biblio-telemetry.js.map +1 -1
- package/dist/api/consumption.d.ts +1 -1
- package/dist/api/consumption.js.map +1 -1
- package/dist/api/cvs-app.d.ts +1 -1
- package/dist/api/cvs-app.js.map +1 -1
- package/dist/api/cvs-documents.d.ts +1 -1
- package/dist/api/cvs-documents.js.map +1 -1
- package/dist/api/cvs-favorites.d.ts +1 -1
- package/dist/api/cvs-favorites.js.map +1 -1
- package/dist/api/cvs-ils.d.ts +1 -1
- package/dist/api/cvs-ils.js.map +1 -1
- package/dist/api/cvs-loans.d.ts +1 -1
- package/dist/api/cvs-loans.js.map +1 -1
- package/dist/api/cvs-payments.d.ts +1 -1
- package/dist/api/cvs-payments.js.map +1 -1
- package/dist/api/cvs-streaming.d.ts +1 -1
- package/dist/api/cvs-streaming.js.map +1 -1
- package/dist/api/index.d.ts +2 -2
- package/dist/api/index.js +2 -2
- package/dist/api/partner-catalogue.d.ts +1 -1
- package/dist/api/partner-catalogue.js.map +1 -1
- package/dist/api/partner-reader.d.ts +1 -1
- package/dist/api/partner-reader.js.map +1 -1
- package/dist/api/profiles.d.ts +1 -1
- package/dist/api/profiles.js.map +1 -1
- package/dist/api/search.d.ts +1 -1
- package/dist/api/search.js.map +1 -1
- package/dist/api/tutoring-catalogue.d.ts +1 -1
- package/dist/api/tutoring-catalogue.js.map +1 -1
- package/dist/api/tutoring-chat.d.ts +1 -1
- package/dist/api/tutoring-chat.js.map +1 -1
- package/dist/api/tutoring-dispatch.d.ts +2 -2
- package/dist/api/tutoring-dispatch.js +1 -1
- package/dist/api/tutoring-dispatch.js.map +1 -1
- package/dist/api/tutoring-practitioner.d.ts +1 -1
- package/dist/api/tutoring-practitioner.js.map +1 -1
- package/dist/api/tutoring-requests.d.ts +1 -1
- package/dist/api/tutoring-requests.js.map +1 -1
- package/dist/chunks/client2.d.ts +1 -1
- package/dist/chunks/connection.d.ts +1 -1
- package/dist/chunks/index.d.ts +789 -223
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +2 -2
- package/dist/models.js +15 -1
- package/dist/models.js.map +1 -1
- package/dist/react/account.d.ts +1 -1
- package/dist/react/account.js +1 -1
- package/dist/react/account.js.map +1 -1
- package/dist/react/admin-catalogue.d.ts +1 -1
- package/dist/react/admin-catalogue.js +1 -1
- package/dist/react/admin-catalogue.js.map +1 -1
- package/dist/react/admin-consumption.d.ts +1 -1
- package/dist/react/admin-consumption.js +1 -1
- package/dist/react/admin-consumption.js.map +1 -1
- package/dist/react/admin-desk.d.ts +545 -1
- package/dist/react/admin-desk.js +689 -2
- package/dist/react/admin-desk.js.map +1 -1
- package/dist/react/admin-licenses.d.ts +1 -1
- package/dist/react/admin-licenses.js +1 -1
- package/dist/react/admin-licenses.js.map +1 -1
- package/dist/react/admin-patrons.d.ts +2 -7
- package/dist/react/admin-patrons.js +2 -7
- package/dist/react/admin-patrons.js.map +1 -1
- package/dist/react/admin-reviews.d.ts +1 -1
- package/dist/react/admin-reviews.js +1 -1
- package/dist/react/admin-reviews.js.map +1 -1
- package/dist/react/admin-roles.d.ts +1 -1
- package/dist/react/admin-roles.js +1 -1
- package/dist/react/admin-roles.js.map +1 -1
- package/dist/react/admin-support.d.ts +1 -1
- package/dist/react/admin-support.js +1 -1
- package/dist/react/admin-support.js.map +1 -1
- package/dist/react/admin-tenants.d.ts +2 -2
- package/dist/react/admin-tenants.js +2 -2
- package/dist/react/admin-tenants.js.map +1 -1
- package/dist/react/admin-tutoring.d.ts +1 -1
- package/dist/react/admin-tutoring.js +1 -1
- package/dist/react/admin-tutoring.js.map +1 -1
- package/dist/react/auth.d.ts +1 -1
- package/dist/react/auth.js +1 -1
- package/dist/react/auth.js.map +1 -1
- package/dist/react/biblio-catalogue.d.ts +1 -1
- package/dist/react/biblio-catalogue.js +1 -1
- package/dist/react/biblio-catalogue.js.map +1 -1
- package/dist/react/biblio-home.d.ts +1 -1
- package/dist/react/biblio-home.js +1 -1
- package/dist/react/biblio-home.js.map +1 -1
- package/dist/react/biblio-library.d.ts +1 -1
- package/dist/react/biblio-library.js +1 -1
- package/dist/react/biblio-library.js.map +1 -1
- package/dist/react/biblio-nextory.d.ts +1 -1
- package/dist/react/biblio-nextory.js +1 -1
- package/dist/react/biblio-nextory.js.map +1 -1
- package/dist/react/biblio-press.d.ts +1 -1
- package/dist/react/biblio-press.js +1 -1
- package/dist/react/biblio-press.js.map +1 -1
- package/dist/react/biblio-search.d.ts +1 -1
- package/dist/react/biblio-search.js +1 -1
- package/dist/react/biblio-search.js.map +1 -1
- package/dist/react/biblio-telemetry.d.ts +1 -1
- package/dist/react/biblio-telemetry.js +1 -1
- package/dist/react/biblio-telemetry.js.map +1 -1
- package/dist/react/chat.d.ts +1 -1
- package/dist/react/consumption.d.ts +1 -1
- package/dist/react/consumption.js +1 -1
- package/dist/react/consumption.js.map +1 -1
- package/dist/react/cvs-app.d.ts +1 -1
- package/dist/react/cvs-app.js +1 -1
- package/dist/react/cvs-app.js.map +1 -1
- package/dist/react/cvs-documents.d.ts +1 -1
- package/dist/react/cvs-documents.js +1 -1
- package/dist/react/cvs-documents.js.map +1 -1
- package/dist/react/cvs-favorites.d.ts +1 -1
- package/dist/react/cvs-favorites.js +1 -1
- package/dist/react/cvs-favorites.js.map +1 -1
- package/dist/react/cvs-ils.d.ts +1 -1
- package/dist/react/cvs-ils.js +1 -1
- package/dist/react/cvs-ils.js.map +1 -1
- package/dist/react/cvs-loans.d.ts +1 -1
- package/dist/react/cvs-loans.js +1 -1
- package/dist/react/cvs-loans.js.map +1 -1
- package/dist/react/cvs-payments.d.ts +1 -1
- package/dist/react/cvs-payments.js +1 -1
- package/dist/react/cvs-payments.js.map +1 -1
- package/dist/react/cvs-streaming.d.ts +1 -1
- package/dist/react/cvs-streaming.js +1 -1
- package/dist/react/cvs-streaming.js.map +1 -1
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +2 -2
- package/dist/react/partner-catalogue.d.ts +1 -1
- package/dist/react/partner-catalogue.js +1 -1
- package/dist/react/partner-catalogue.js.map +1 -1
- package/dist/react/partner-reader.d.ts +1 -1
- package/dist/react/partner-reader.js +1 -1
- package/dist/react/partner-reader.js.map +1 -1
- package/dist/react/profiles.d.ts +1 -1
- package/dist/react/profiles.js +1 -1
- package/dist/react/profiles.js.map +1 -1
- package/dist/react/search.d.ts +1 -1
- package/dist/react/search.js +1 -1
- package/dist/react/search.js.map +1 -1
- package/dist/react/tutoring-catalogue.d.ts +1 -1
- package/dist/react/tutoring-catalogue.js +1 -1
- package/dist/react/tutoring-catalogue.js.map +1 -1
- package/dist/react/tutoring-chat.d.ts +1 -1
- package/dist/react/tutoring-chat.js +1 -1
- package/dist/react/tutoring-chat.js.map +1 -1
- package/dist/react/tutoring-dispatch.d.ts +2 -2
- package/dist/react/tutoring-dispatch.js +2 -2
- package/dist/react/tutoring-dispatch.js.map +1 -1
- package/dist/react/tutoring-practitioner.d.ts +1 -1
- package/dist/react/tutoring-practitioner.js +1 -1
- package/dist/react/tutoring-practitioner.js.map +1 -1
- package/dist/react/tutoring-requests.d.ts +1 -1
- package/dist/react/tutoring-requests.js +1 -1
- package/dist/react/tutoring-requests.js.map +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consumption.js","names":[],"sources":["../../src/react/consumption/consumption.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.
|
|
1
|
+
{"version":3,"file":"consumption.js","names":[],"sources":["../../src/react/consumption/consumption.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.8.2\n */\nimport {\n useMutation\n} from '@tanstack/react-query';\nimport type {\n MutationFunction,\n QueryClient,\n UseMutationOptions,\n UseMutationResult\n} from '@tanstack/react-query';\n\nimport type {\n HTTPExceptionResponse,\n LeaseRead,\n ValidationErrorResponse\n} from '../../models';\n\nimport { request } from '../../client';\nimport type { ErrorType } from '../../client';\n\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n\n\nexport const getCloseLeaseUrl = (eventId: number,) => {\n\n\n\n\n return `/consumption/${eventId}`\n}\n\n/**\n * Finish reading. Returns the seat immediately rather than at lapse.\n *\n * ``204`` whether or not the lease was still open: the desired end state is\n * \"closed\", and a client that lost its connection and retried should not get an\n * error for succeeding twice.\n * @summary Close Lease\n */\nexport const closeLease = async (eventId: number, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getCloseLeaseUrl(eventId),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\n\n\n\nexport const getCloseLeaseMutationKey = () => ['closeLease'] as const;\n\nexport const getCloseLeaseMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof closeLease>>, TError,CloseLeaseMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof closeLease>>, TError,CloseLeaseMutationVariables, TContext> => {\n\nconst mutationKey = getCloseLeaseMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof closeLease>>, CloseLeaseMutationVariables> = (props) => {\n const {eventId} = props ?? {};\n\n return closeLease(eventId,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type CloseLeaseMutationResult = NonNullable<Awaited<ReturnType<typeof closeLease>>>\n\n export type CloseLeaseMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type CloseLeaseMutationVariables = {eventId: number}\n\n /**\n * @summary Close Lease\n */\nexport const useCloseLease = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof closeLease>>, TError,CloseLeaseMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof closeLease>>,\n TError,\n CloseLeaseMutationVariables,\n TContext\n > => {\n return useMutation(getCloseLeaseMutationOptions(options), queryClient);\n }\n export const getRenewLeaseUrl = (eventId: number,) => {\n\n\n\n\n return `/consumption/${eventId}`\n}\n\n/**\n * Heartbeat. Push the lease out; the client repeats before it lapses.\n *\n * ``404`` when the lease is closed, reaped, or somebody else's — the three are\n * deliberately indistinguishable, because a lease id is a bare integer and\n * guessing one must not reveal whether it exists.\n *\n * This does not write the ledger. A reader refreshing every thirty seconds for\n * an hour would be 120 UPDATEs on the table we bill from, for a value that only\n * matters while it is current; the durable extent is settled once, at close.\n * @summary Renew Lease\n */\nexport const renewLease = async (eventId: number, options?: Parameters<typeof request>[1]): Promise<LeaseRead> => {\n\n return request<LeaseRead>(getRenewLeaseUrl(eventId),\n {\n ...options,\n method: 'PUT'\n\n\n }\n);}\n\n\n\n\n\nexport const getRenewLeaseMutationKey = () => ['renewLease'] as const;\n\nexport const getRenewLeaseMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof renewLease>>, TError,RenewLeaseMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof renewLease>>, TError,RenewLeaseMutationVariables, TContext> => {\n\nconst mutationKey = getRenewLeaseMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof renewLease>>, RenewLeaseMutationVariables> = (props) => {\n const {eventId} = props ?? {};\n\n return renewLease(eventId,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type RenewLeaseMutationResult = NonNullable<Awaited<ReturnType<typeof renewLease>>>\n\n export type RenewLeaseMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type RenewLeaseMutationVariables = {eventId: number}\n\n /**\n * @summary Renew Lease\n */\nexport const useRenewLease = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof renewLease>>, TError,RenewLeaseMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof renewLease>>,\n TError,\n RenewLeaseMutationVariables,\n TContext\n > => {\n return useMutation(getRenewLeaseMutationOptions(options), queryClient);\n }\n"],"mappings":";;;;;;;;;;;AA+BA,MAAa,oBAAoB,YAAqB;CAKpD,OAAO,gBAAgB;AACzB;;;;;;;;;AAUA,MAAa,aAAa,OAAO,SAAiB,YAA2D;CAE3G,OAAO,QAAc,iBAAiB,OAAO,GAC7C;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAMF,MAAa,iCAAiC,CAAC,YAAY;AAE3D,MAAa,gCACW,YACuF;CAE/G,MAAM,cAAc,yBAAyB;CAC7C,MAAM,EAAC,UAAU,iBAAiB,SAAS,mBAAkB,UACvD,QAAQ,YAAY,iBAAiB,QAAQ,YAAY,QAAQ,SAAS,cAC1E,UACE;EAAC,GAAG;E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laybackReportRead, hn as NotificationListRead, t as ValidationErrorResponse } from "../chunks/index.js";
|
|
3
3
|
import { a as ErrorType, c as request, n as BodyType } from "../chunks/client.js";
|
|
4
4
|
import { DataTag, DefinedInitialDataOptions, DefinedUseQueryResult, QueryClient, QueryKey, UndefinedInitialDataOptions, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
|
|
5
5
|
//#region src/react/cvs-app/cvs-app.d.ts
|
package/dist/react/cvs-app.js
CHANGED
|
@@ -7,7 +7,7 @@ import { useMutation, useQuery } from "@tanstack/react-query";
|
|
|
7
7
|
* Do not edit manually.
|
|
8
8
|
* Mozaik backend
|
|
9
9
|
* Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.
|
|
10
|
-
* OpenAPI spec version: 0.
|
|
10
|
+
* OpenAPI spec version: 0.8.2
|
|
11
11
|
*/
|
|
12
12
|
const withQueryKey = (query, queryKey) => {
|
|
13
13
|
const result = { queryKey };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cvs-app.js","names":[],"sources":["../../src/react/cvs-app/cvs-app.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.7.0\n */\nimport {\n useMutation,\n useQuery\n} from '@tanstack/react-query';\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n MutationFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseMutationOptions,\n UseMutationResult,\n UseQueryOptions,\n UseQueryResult\n} from '@tanstack/react-query';\n\nimport type {\n HTTPExceptionResponse,\n ListNotificationsParams,\n NotificationListRead,\n PlaybackReportRead,\n PlaybackReportWrite,\n ValidationErrorResponse\n} from '../../models';\n\nimport { request } from '../../client';\nimport type { ErrorType , BodyType } from '../../client';\n\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n\n\nconst withQueryKey = <T extends object, K>(query: T, queryKey: K): T & { queryKey: K } => {\n const result = { queryKey } as T & { queryKey: K };\n for (const key of Object.keys(query)) {\n // The explicit queryKey always wins, matching the previous\n // `{ ...query, queryKey }` spread where it was set last.\n if (key === 'queryKey') continue;\n Object.defineProperty(result, key, {\n enumerable: true,\n configurable: true,\n get: () => (query as Record<string, unknown>)[key],\n });\n }\n return result;\n};\n\nexport const getListNotificationsUrl = (params?: ListNotificationsParams,) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : String(value))\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/cvs/notifications?${stringifiedParams}` : `/cvs/notifications`\n}\n\n/**\n * Notifications published to this caller's library.\n *\n * **These are tenant broadcasts, not a per-user inbox.** ``app_notification``\n * has no user column and no read state — ``app_notification_bm`` links a\n * notification to a library and that is the whole model. So ``unread_count`` is\n * always ``0`` here and every notification is returned every time.\n *\n * Giving each member their own read state is a schema change (a\n * ``notification_read`` row per user and notification), not a query change. It\n * is worth doing — a broadcast list that never shrinks is one people stop\n * opening — but it is a decision rather than a port, so it is not made here.\n * @summary List Notifications\n */\nexport const listNotifications = async (params?: ListNotificationsParams, options?: Parameters<typeof request>[1]): Promise<NotificationListRead> => {\n\n return request<NotificationListRead>(getListNotificationsUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getListNotificationsQueryKey = (params?: ListNotificationsParams,) => {\n return [\n `/cvs/notifications`, ...(params ? [params] : [])\n ] as const;\n }\n\n\nexport const getListNotificationsQueryOptions = <TData = Awaited<ReturnType<typeof listNotifications>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params?: ListNotificationsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listNotifications>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getListNotificationsQueryKey(params);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof listNotifications>>> = ({ signal }) => listNotifications(params, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listNotifications>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ListNotificationsQueryResult = NonNullable<Awaited<ReturnType<typeof listNotifications>>>\nexport type ListNotificationsQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useListNotifications<TData = Awaited<ReturnType<typeof listNotifications>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params: undefined | ListNotificationsParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listNotifications>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof listNotifications>>,\n TError,\n Awaited<ReturnType<typeof listNotifications>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListNotifications<TData = Awaited<ReturnType<typeof listNotifications>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListNotificationsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listNotifications>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof listNotifications>>,\n TError,\n Awaited<ReturnType<typeof listNotifications>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListNotifications<TData = Awaited<ReturnType<typeof listNotifications>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListNotificationsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listNotifications>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary List Notifications\n */\n\nexport function useListNotifications<TData = Awaited<ReturnType<typeof listNotifications>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListNotificationsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listNotifications>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getListNotificationsQueryOptions(params,options)\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n return withQueryKey(query, queryOptions.queryKey);\n}\n\n\n\n\n\n\nexport const getCreateReportUrl = () => {\n\n\n\n\n return `/cvs/reports`\n}\n\n/**\n * Report a playback problem.\n *\n * The identifying fields are taken from the credential, not the body. The\n * legacy took ``adhId``, ``bmId`` and ``bmBibLocaleId`` from the query string\n * and declared no ``Authorization`` at all, so anyone holding the shared\n * ``api_key`` — which every deployed app binary contains — could file a report\n * in any patron's name, at any library. The DTO still carries those three\n * fields, marked transition-only, and this handler ignores every one of them.\n *\n * ``email`` is free text that ends up in a message. Authenticated and\n * rate-limited it is a support channel; unauthenticated it is a spam relay with\n * the library's return address on it.\n * @summary Create Report\n */\nexport const createReport = async (playbackReportWrite: PlaybackReportWrite, options?: Parameters<typeof request>[1]): Promise<PlaybackReportRead> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<PlaybackReportRead>(getCreateReportUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(playbackReportWrite)\n }\n);}\n\n\n\n\n\nexport const getCreateReportMutationKey = () => ['createReport'] as const;\n\nexport const getCreateReportMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createReport>>, TError,CreateReportMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof createReport>>, TError,CreateReportMutationVariables, TContext> => {\n\nconst mutationKey = getCreateReportMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof createReport>>, CreateReportMutationVariables> = (props) => {\n const {data} = props ?? {};\n\n return createReport(data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type CreateReportMutationResult = NonNullable<Awaited<ReturnType<typeof createReport>>>\n export type CreateReportMutationBody = BodyType<PlaybackReportWrite>\n export type CreateReportMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type CreateReportMutationVariables = {data: BodyType<PlaybackReportWrite>}\n\n /**\n * @summary Create Report\n */\nexport const useCreateReport = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createReport>>, TError,CreateReportMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof createReport>>,\n TError,\n CreateReportMutationVariables,\n TContext\n > => {\n return useMutation(getCreateReportMutationOptions(options), queryClient);\n }\n"],"mappings":";;;;;;;;;;;AA2CA,MAAM,gBAAqC,OAAU,aAAqC;CACxF,MAAM,SAAS,EAAE,SAAS;CAC1B,KAAK,MAAM,OAAO,OAAO,KAAK,KAAK,GAAG;EAGpC,IAAI,QAAQ,YAAY;EACxB,OAAO,eAAe,QAAQ,KAAK;GACjC,YAAY;GACZ,cAAc;GACd,WAAY,MAAkC;EAChD,CAAC;CACH;CACA,OAAO;AACT;AAEA,MAAa,2BAA2B,WAAsC;CAC5E,MAAM,mBAAmB,IAAI,gBAAgB;CAE7C,OAAO,QAAQ,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,WAAW;EAErD,IAAI,UAAU,KAAA,GACZ,iBAAiB,OAAO,KAAK,UAAU,OAAO,SAAS,OAAO,KAAK,CAAC;CAExE,CAAC;CAED,MAAM,oBAAoB,iBAAiB,SAAS;CAEpD,OAAO,kBAAkB,SAAS,IAAI,sBAAsB,sBAAsB;AACpF;;;;;;;;;;;;;;;AAgBA,MAAa,oBAAoB,OAAO,QAAkC,YAA2E;CAEnJ,OAAO,QAA8B,wBAAwB,MAAM,GACnE;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAMF,MAAa,gCAAgC,WAAsC;CAC/E,OAAO,CACP,sBAAsB,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAC/C;AACA;AAGJ,MAAa,oCAAgK,QAAkC,YAC1M;CAEL,MAAM,EAAC,OAAO,cAAc,SAAS,mBAAkB,WAAW,CAAC;CAEjE,MAAM,WAAY,cAAc,YAAY,6BAA6B,MAAM;CAI7E,MAAM,WAAyE,EA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S;CAKjD,MAAM,cAAyG,UAAU;EACrH,MAAM,EAAC,SAAQ,SAAS,CAAC;EAEzB,OAAQ,aAAa,MAAK,cAAc;CAC1C;CAON,OAAQ;EAAE;EAAY,GAAG;CAAgB;AAAC;;;;AAU5C,MAAa,mBACW,SACrB,gBAKQ;CACL,OAAO,YAAY,+BAA+B,OAAO,GAAG,WAAW;AACzE"}
|
|
1
|
+
{"version":3,"file":"cvs-app.js","names":[],"sources":["../../src/react/cvs-app/cvs-app.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.8.2\n */\nimport {\n useMutation,\n useQuery\n} from '@tanstack/react-query';\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n MutationFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseMutationOptions,\n UseMutationResult,\n UseQueryOptions,\n UseQueryResult\n} from '@tanstack/react-query';\n\nimport type {\n HTTPExceptionResponse,\n ListNotificationsParams,\n NotificationListRead,\n PlaybackReportRead,\n PlaybackReportWrite,\n ValidationErrorResponse\n} from '../../models';\n\nimport { request } from '../../client';\nimport type { ErrorType , BodyType } from '../../client';\n\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n\n\nconst withQueryKey = <T extends object, K>(query: T, queryKey: K): T & { queryKey: K } => {\n const result = { queryKey } as T & { queryKey: K };\n for (const key of Object.keys(query)) {\n // The explicit queryKey always wins, matching the previous\n // `{ ...query, queryKey }` spread where it was set last.\n if (key === 'queryKey') continue;\n Object.defineProperty(result, key, {\n enumerable: true,\n configurable: true,\n get: () => (query as Record<string, unknown>)[key],\n });\n }\n return result;\n};\n\nexport const getListNotificationsUrl = (params?: ListNotificationsParams,) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : String(value))\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/cvs/notifications?${stringifiedParams}` : `/cvs/notifications`\n}\n\n/**\n * Notifications published to this caller's library.\n *\n * **These are tenant broadcasts, not a per-user inbox.** ``app_notification``\n * has no user column and no read state — ``app_notification_bm`` links a\n * notification to a library and that is the whole model. So ``unread_count`` is\n * always ``0`` here and every notification is returned every time.\n *\n * Giving each member their own read state is a schema change (a\n * ``notification_read`` row per user and notification), not a query change. It\n * is worth doing — a broadcast list that never shrinks is one people stop\n * opening — but it is a decision rather than a port, so it is not made here.\n * @summary List Notifications\n */\nexport const listNotifications = async (params?: ListNotificationsParams, options?: Parameters<typeof request>[1]): Promise<NotificationListRead> => {\n\n return request<NotificationListRead>(getListNotificationsUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getListNotificationsQueryKey = (params?: ListNotificationsParams,) => {\n return [\n `/cvs/notifications`, ...(params ? [params] : [])\n ] as const;\n }\n\n\nexport const getListNotificationsQueryOptions = <TData = Awaited<ReturnType<typeof listNotifications>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params?: ListNotificationsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listNotifications>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getListNotificationsQueryKey(params);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof listNotifications>>> = ({ signal }) => listNotifications(params, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listNotifications>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ListNotificationsQueryResult = NonNullable<Awaited<ReturnType<typeof listNotifications>>>\nexport type ListNotificationsQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useListNotifications<TData = Awaited<ReturnType<typeof listNotifications>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params: undefined | ListNotificationsParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listNotifications>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof listNotifications>>,\n TError,\n Awaited<ReturnType<typeof listNotifications>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListNotifications<TData = Awaited<ReturnType<typeof listNotifications>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListNotificationsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listNotifications>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof listNotifications>>,\n TError,\n Awaited<ReturnType<typeof listNotifications>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListNotifications<TData = Awaited<ReturnType<typeof listNotifications>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListNotificationsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listNotifications>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary List Notifications\n */\n\nexport function useListNotifications<TData = Awaited<ReturnType<typeof listNotifications>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListNotificationsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listNotifications>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getListNotificationsQueryOptions(params,options)\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n return withQueryKey(query, queryOptions.queryKey);\n}\n\n\n\n\n\n\nexport const getCreateReportUrl = () => {\n\n\n\n\n return `/cvs/reports`\n}\n\n/**\n * Report a playback problem.\n *\n * The identifying fields are taken from the credential, not the body. The\n * legacy took ``adhId``, ``bmId`` and ``bmBibLocaleId`` from the query string\n * and declared no ``Authorization`` at all, so anyone holding the shared\n * ``api_key`` — which every deployed app binary contains — could file a report\n * in any patron's name, at any library. The DTO still carries those three\n * fields, marked transition-only, and this handler ignores every one of them.\n *\n * ``email`` is free text that ends up in a message. Authenticated and\n * rate-limited it is a support channel; unauthenticated it is a spam relay with\n * the library's return address on it.\n * @summary Create Report\n */\nexport const createReport = async (playbackReportWrite: PlaybackReportWrite, options?: Parameters<typeof request>[1]): Promise<PlaybackReportRead> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<PlaybackReportRead>(getCreateReportUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(playbackReportWrite)\n }\n);}\n\n\n\n\n\nexport const getCreateReportMutationKey = () => ['createReport'] as const;\n\nexport const getCreateReportMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createReport>>, TError,CreateReportMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof createReport>>, TError,CreateReportMutationVariables, TContext> => {\n\nconst mutationKey = getCreateReportMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof createReport>>, CreateReportMutationVariables> = (props) => {\n const {data} = props ?? {};\n\n return createReport(data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type CreateReportMutationResult = NonNullable<Awaited<ReturnType<typeof createReport>>>\n export type CreateReportMutationBody = BodyType<PlaybackReportWrite>\n export type CreateReportMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type CreateReportMutationVariables = {data: BodyType<PlaybackReportWrite>}\n\n /**\n * @summary Create Report\n */\nexport const useCreateReport = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createReport>>, TError,CreateReportMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof createReport>>,\n TError,\n CreateReportMutationVariables,\n TContext\n > => {\n return useMutation(getCreateReportMutationOptions(options), queryClient);\n }\n"],"mappings":";;;;;;;;;;;AA2CA,MAAM,gBAAqC,OAAU,aAAqC;CACxF,MAAM,SAAS,EAAE,SAAS;CAC1B,KAAK,MAAM,OAAO,OAAO,KAAK,KAAK,GAAG;EAGpC,IAAI,QAAQ,YAAY;EACxB,OAAO,eAAe,QAAQ,KAAK;GACjC,YAAY;GACZ,cAAc;GACd,WAA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,OAAO,OAAO,YAAY,EAAE,QAAQ,CAAC;EAC/D,IAAI,OAAO,YAAY,GACrB,OAAO,OAAO,YACZ,MAAM,KAAK,IAAkC,UAAU,MAAM,KAAK,KAAK,CAAqB,CAC9F;EAEF,MAAM,UAAsD,CAAC;EAC7D,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAgD,CAAC,GAClF,IAAI,UAAU,KAAA,GAAW,QAAQ,QAAQ;EAE3C,OAAO;CACT;CACF,OAAO,QAA4B,mBAAmB,GACpD;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,mBAAmB;CAC1C,CACF;AAAE;AAMF,MAAa,mCAAmC,CAAC,cAAc;AAE/D,MAAa,kCACW,YAC2F;CAEnH,MAAM,cAAc,2BAA2B;CAC/C,MAAM,EAAC,UAAU,iBAAiB,SAAS,mBAAkB,UACvD,QAAQ,YAAY,iBAAiB,QAAQ,YAAY,QAAQ,SAAS,cAC1E,UACE;EAAC,GAAG;EAAS,UAAU;GAAC,GAAG,QAAQ;GAAU;EAAW;CAAC,IACzD;EAAC,UAAU,EAAE,YAAa;EAAG,SAAS,KAAA;CAAS;CAKjD,MAAM,cAAyG,UAAU;EACrH,MAAM,EAAC,SAAQ,SAAS,CAAC;EAEzB,OAAQ,aAAa,MAAK,cAAc;CAC1C;CAON,OAAQ;EAAE;EAAY,GAAG;CAAgB;AAAC;;;;AAU5C,MAAa,mBACW,SACrB,gBAKQ;CACL,OAAO,YAAY,+BAA+B,OAAO,GAAG,WAAW;AACzE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { B as SupplierGrantRead, Ct as RatingUpdateWrite, Dr as HTTPExceptionResponse, Qr as DocumentRead, Zr as DocumentSearchWrite, mn as OpenAtSupplierParams, nt as ReviewRead, sr as LastPositionWrite, t as ValidationErrorResponse, ti as DocumentPage, tt as ReviewUpdateWrite } from "../chunks/index.js";
|
|
3
3
|
import { a as ErrorType, c as request, n as BodyType } from "../chunks/client.js";
|
|
4
4
|
import { DataTag, DefinedInitialDataOptions, DefinedUseQueryResult, QueryClient, QueryKey, UndefinedInitialDataOptions, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
|
|
5
5
|
//#region src/react/cvs-documents/cvs-documents.d.ts
|
|
@@ -7,7 +7,7 @@ import { useMutation, useQuery } from "@tanstack/react-query";
|
|
|
7
7
|
* Do not edit manually.
|
|
8
8
|
* Mozaik backend
|
|
9
9
|
* Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.
|
|
10
|
-
* OpenAPI spec version: 0.
|
|
10
|
+
* OpenAPI spec version: 0.8.2
|
|
11
11
|
*/
|
|
12
12
|
const withQueryKey = (query, queryKey) => {
|
|
13
13
|
const result = { queryKey };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cvs-documents.js","names":[],"sources":["../../src/react/cvs-documents/cvs-documents.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.7.0\n */\nimport {\n useMutation,\n useQuery\n} from '@tanstack/react-query';\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n MutationFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseMutationOptions,\n UseMutationResult,\n UseQueryOptions,\n UseQueryResult\n} from '@tanstack/react-query';\n\nimport type {\n DocumentPage,\n DocumentRead,\n DocumentSearchWrite,\n HTTPExceptionResponse,\n LastPositionWrite,\n OpenAtSupplierParams,\n RatingUpdateWrite,\n ReviewRead,\n ReviewUpdateWrite,\n SupplierGrantRead,\n ValidationErrorResponse\n} from '../../models';\n\nimport { request } from '../../client';\nimport type { ErrorType , BodyType } from '../../client';\n\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n\n\nconst withQueryKey = <T extends object, K>(query: T, queryKey: K): T & { queryKey: K } => {\n const result = { queryKey } as T & { queryKey: K };\n for (const key of Object.keys(query)) {\n // The explicit queryKey always wins, matching the previous\n // `{ ...query, queryKey }` spread where it was set last.\n if (key === 'queryKey') continue;\n Object.defineProperty(result, key, {\n enumerable: true,\n configurable: true,\n get: () => (query as Record<string, unknown>)[key],\n });\n }\n return result;\n};\n\nexport const getSearchDocumentsUrl = () => {\n\n\n\n\n return `/cvs/documents/search`\n}\n\n/**\n * Search the CVS catalogue.\n *\n * ``POST`` because the legacy put the query in the body and the mobile clients\n * send it that way. It is a read, so it stays safe: nothing here writes.\n *\n * Same division as ``/search``: the index ranks, PostgreSQL authorises. An\n * index outage degrades to no results rather than to an unfiltered catalogue.\n * @summary Search Documents\n */\nexport const searchDocuments = async (documentSearchWrite: DocumentSearchWrite, options?: Parameters<typeof request>[1]): Promise<DocumentPage> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<DocumentPage>(getSearchDocumentsUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(documentSearchWrite)\n }\n);}\n\n\n\n\n\nexport const getSearchDocumentsMutationKey = () => ['searchDocuments'] as const;\n\nexport const getSearchDocumentsMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof searchDocuments>>, TError,SearchDocumentsMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof searchDocuments>>, TError,SearchDocumentsMutationVariables, TContext> => {\n\nconst mutationKey = getSearchDocumentsMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof searchDocuments>>, SearchDocumentsMutationVariables> = (props) => {\n const {data} = props ?? {};\n\n return searchDocuments(data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type SearchDocumentsMutationResult = NonNullable<Awaited<ReturnType<typeof searchDocuments>>>\n export type SearchDocumentsMutationBody = BodyType<DocumentSearchWrite>\n export type SearchDocumentsMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type SearchDocumentsMutationVariables = {data: BodyType<DocumentSearchWrite>}\n\n /**\n * @summary Search Documents\n */\nexport const useSearchDocuments = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof searchDocuments>>, TError,SearchDocumentsMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof searchDocuments>>,\n TError,\n SearchDocumentsMutationVariables,\n TContext\n > => {\n return useMutation(getSearchDocumentsMutationOptions(options), queryClient);\n }\n export const getReadDocumentUrl = (docId: number,) => {\n\n\n\n\n return `/cvs/documents/${docId}`\n}\n\n/**\n * One work, if this caller's contract reaches it.\n *\n * Missing until now, which was an oversight rather than a decision: search,\n * rating, review and position all existed and there was no way to fetch the\n * thing they act on. The legacy has no equivalent either — the app assembles a\n * document sheet from whatever the menu endpoint already returned, which is why\n * a deep link into a title has never worked properly.\n * @summary Read Document\n */\nexport const readDocument = async (docId: number, options?: Parameters<typeof request>[1]): Promise<DocumentRead> => {\n\n return request<DocumentRead>(getReadDocumentUrl(docId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getReadDocumentQueryKey = (docId: number,) => {\n return [\n `/cvs/documents/${docId}`\n ] as const;\n }\n\n\nexport const getReadDocumentQueryOptions = <TData = Awaited<ReturnType<typeof readDocument>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(docId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readDocument>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getReadDocumentQueryKey(docId);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof readDocument>>> = ({ signal }) => readDocument(docId, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, enabled: docId !== null && docId !== undefined, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof readDocument>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ReadDocumentQueryResult = NonNullable<Awaited<ReturnType<typeof readDocument>>>\nexport type ReadDocumentQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useReadDocument<TData = Awaited<ReturnType<typeof readDocument>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n docId: number, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof readDocument>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof readDocument>>,\n TError,\n Awaited<ReturnType<typeof readDocument>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadDocument<TData = Awaited<ReturnType<typeof readDocument>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n docId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readDocument>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof readDocument>>,\n TError,\n Awaited<ReturnType<typeof readDocument>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadDocument<TData = Awaited<ReturnType<typeof readDocument>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n docId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readDocument>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Read Document\n */\n\nexport function useReadDocument<TData = Awaited<ReturnType<typeof readDocument>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n docId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readDocument>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getReadDocumentQueryOptions(docId,options)\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n return withQueryKey(query, queryOptions.queryKey);\n}\n\n\n\n\n\n\nexport const getOpenAtSupplierUrl = (docId: number,\n params?: OpenAtSupplierParams,) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : String(value))\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/cvs/documents/${docId}/grant?${stringifiedParams}` : `/cvs/documents/${docId}/grant`\n}\n\n/**\n * Authorise this patron to open one title at the supplier hosting it.\n *\n * Replaces the legacy ``wstoken``: 4,878 lines dispatching on\n * ``frn.plate_forme`` through 57 near-identical arms. The signing schemes\n * reduce to eight (:class:`~app.models.enums.TokenFormula`) and the platform\n * map to a table, so what is left here is the order of operations.\n *\n * **Entitle, seat, then sign** — the same order the streaming route uses, and\n * for the same reason. A signature is cheap to produce and impossible to\n * recall once it has left; a seat can be released. Signing first would mean a\n * refused request had already handed a patron something that works.\n *\n * ``404`` when the caller is not entitled or the title does not exist — the\n * two are deliberately indistinguishable, as everywhere else in this API.\n * ``409`` when every seat is taken: the caller *is* entitled and should be\n * offered \"try later\", not \"buy a subscription\". ``409`` too when the supplier\n * sits on a platform nobody implemented — four do, and the legacy cannot serve\n * them either, so the honest answer is that this title is not openable rather\n * than a 500 from a missing branch.\n *\n * ``mode`` is the legacy's ``$upload``: ``stream`` to consult in place,\n * ``download`` to take a copy away. It does two things, and both matter —\n *\n * * **The library is billed for the right act.** ``exemp`` records streaming\n * and download separately, and ``pret_download`` is the only column where a\n * loan duration ever appears. Granting a download as a view bills the wrong\n * quota.\n * * **Three platforms sign it.** Jeux CVS, CVS Livres and Komics Initiative\n * append the flag *after* the second key, so a stream and a download of the\n * same title by the same patron at the same second carry different\n * signatures. For the other platforms it is inert.\n *\n * The returned token is for the *supplier*, not for us. See\n * :class:`~app.datamodels.cvs.downloads.SupplierGrantRead`.\n * @summary Open At Supplier\n */\nexport const openAtSupplier = async (docId: number,\n params?: OpenAtSupplierParams, options?: Parameters<typeof request>[1]): Promise<SupplierGrantRead> => {\n\n return request<SupplierGrantRead>(getOpenAtSupplierUrl(docId,params),\n {\n ...options,\n method: 'POST'\n\n\n }\n);}\n\n\n\n\n\nexport const getOpenAtSupplierMutationKey = () => ['openAtSupplier'] as const;\n\nexport const getOpenAtSupplierMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof openAtSupplier>>, TError,OpenAtSupplierMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof openAtSupplier>>, TError,OpenAtSupplierMutationVariables, TContext> => {\n\nconst mutationKey = getOpenAtSupplierMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof openAtSupplier>>, OpenAtSupplierMutationVariables> = (props) => {\n const {docId,params} = props ?? {};\n\n return openAtSupplier(docId,params,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type OpenAtSupplierMutationResult = NonNullable<Awaited<ReturnType<typeof openAtSupplier>>>\n\n export type OpenAtSupplierMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type OpenAtSupplierMutationVariables = {docId: number;params?: OpenAtSupplierParams}\n\n /**\n * @summary Open At Supplier\n */\nexport const useOpenAtSupplier = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof openAtSupplier>>, TError,OpenAtSupplierMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof openAtSupplier>>,\n TError,\n OpenAtSupplierMutationVariables,\n TContext\n > => {\n return useMutation(getOpenAtSupplierMutationOptions(options), queryClient);\n }\n export const getReadLastPositionUrl = (docId: number,) => {\n\n\n\n\n return `/cvs/documents/${docId}/position`\n}\n\n/**\n * Where this patron got to, or ``0`` if they have not started.\n *\n * New: the legacy has no way to read the position back, so a client that lost\n * its local state could never resume. Absent means not started, which is why\n * the row is not created on read.\n * @summary Read Last Position\n */\nexport const readLastPosition = async (docId: number, options?: Parameters<typeof request>[1]): Promise<LastPositionWrite> => {\n\n return request<LastPositionWrite>(getReadLastPositionUrl(docId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getReadLastPositionQueryKey = (docId: number,) => {\n return [\n `/cvs/documents/${docId}/position`\n ] as const;\n }\n\n\nexport const getReadLastPositionQueryOptions = <TData = Awaited<ReturnType<typeof readLastPosition>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(docId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readLastPosition>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getReadLastPositionQueryKey(docId);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof readLastPosition>>> = ({ signal }) => readLastPosition(docId, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, enabled: docId !== null && docId !== undefined, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof readLastPosition>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ReadLastPositionQueryResult = NonNullable<Awaited<ReturnType<typeof readLastPosition>>>\nexport type ReadLastPositionQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useReadLastPosition<TData = Awaited<ReturnType<typeof readLastPosition>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n docId: number, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof readLastPosition>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof readLastPosition>>,\n TError,\n Awaited<ReturnType<typeof readLastPosition>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadLastPosition<TData = Awaited<ReturnType<typeof readLastPosition>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n docId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readLastPosition>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof readLastPosition>>,\n TError,\n Awaited<ReturnType<typeof readLastPosition>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadLastPosition<TData = Awaited<ReturnType<typeof readLastPosition>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n docId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readLastPosition>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Read Last Position\n */\n\nexport function useReadLastPosition<TData = Awaited<ReturnType<typeof readLastPosition>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n docId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readLastPosition>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getReadLastPositionQueryOptions(docId,options)\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n return withQueryKey(query, queryOptions.queryKey);\n}\n\n\n\n\n\n\nexport const getSetLastPositionUrl = (docId: number,) => {\n\n\n\n\n return `/cvs/documents/${docId}/position`\n}\n\n/**\n * Record where this patron got to.\n *\n * A write, and the legacy declares it ``GET`` with the position in the query\n * string — which makes resuming a book a cacheable idempotent read that mutates\n * state, and puts it outside the CSRF layer for free.\n *\n * Stored in :class:`~app.models.activity.ReadingPosition`, which the products\n * share — CVS and the partner reader today — so a member who reads across them\n * keeps their place in one shape.\n * @summary Set Last Position\n */\nexport const setLastPosition = async (docId: number,\n lastPositionWrite: LastPositionWrite, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<void>(getSetLastPositionUrl(docId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(lastPositionWrite)\n }\n);}\n\n\n\n\n\nexport const getSetLastPositionMutationKey = () => ['setLastPosition'] as const;\n\nexport const getSetLastPositionMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof setLastPosition>>, TError,SetLastPositionMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof setLastPosition>>, TError,SetLastPositionMutationVariables, TContext> => {\n\nconst mutationKey = getSetLastPositionMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof setLastPosition>>, SetLastPositionMutationVariables> = (props) => {\n const {docId,data} = props ?? {};\n\n return setLastPosition(docId,data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type SetLastPositionMutationResult = NonNullable<Awaited<ReturnType<typeof setLastPosition>>>\n export type SetLastPositionMutationBody = BodyType<LastPositionWrite>\n export type SetLastPositionMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type SetLastPositionMutationVariables = {docId: number;data: BodyType<LastPositionWrite>}\n\n /**\n * @summary Set Last Position\n */\nexport const useSetLastPosition = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof setLastPosition>>, TError,SetLastPositionMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof setLastPosition>>,\n TError,\n SetLastPositionMutationVariables,\n TContext\n > => {\n return useMutation(getSetLastPositionMutationOptions(options), queryClient);\n }\n export const getRateDocumentUrl = (docId: number,) => {\n\n\n\n\n return `/cvs/documents/${docId}/rating`\n}\n\n/**\n * Rate a document. Idempotent — rating again replaces the earlier score.\n *\n * ``PUT`` on the rating sub-resource rather than the legacy\n * ``POST /document/rating/update`` with the id in the body: the identifier\n * belongs in the path, and \"update\" in a path names an operation in a position\n * reserved for a resource.\n * @summary Rate Document\n */\nexport const rateDocument = async (docId: number,\n ratingUpdateWrite: RatingUpdateWrite, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<void>(getRateDocumentUrl(docId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(ratingUpdateWrite)\n }\n);}\n\n\n\n\n\nexport const getRateDocumentMutationKey = () => ['rateDocument'] as const;\n\nexport const getRateDocumentMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof rateDocument>>, TError,RateDocumentMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof rateDocument>>, TError,RateDocumentMutationVariables, TContext> => {\n\nconst mutationKey = getRateDocumentMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof rateDocument>>, RateDocumentMutationVariables> = (props) => {\n const {docId,data} = props ?? {};\n\n return rateDocument(docId,data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type RateDocumentMutationResult = NonNullable<Awaited<ReturnType<typeof rateDocument>>>\n export type RateDocumentMutationBody = BodyType<RatingUpdateWrite>\n export type RateDocumentMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type RateDocumentMutationVariables = {docId: number;data: BodyType<RatingUpdateWrite>}\n\n /**\n * @summary Rate Document\n */\nexport const useRateDocument = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof rateDocument>>, TError,RateDocumentMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof rateDocument>>,\n TError,\n RateDocumentMutationVariables,\n TContext\n > => {\n return useMutation(getRateDocumentMutationOptions(options), queryClient);\n }\n export const getWriteReviewUrl = (docId: number,) => {\n\n\n\n\n return `/cvs/documents/${docId}/review`\n}\n\n/**\n * Write or replace this patron's review of a document.\n *\n * One review per person per document, so this is a ``PUT`` on a singular\n * sub-resource rather than a ``POST`` to a collection. The legacy had two routes\n * — with and without an ``avisId`` — for what is one row.\n *\n * Every write resets the review to unpublished. An edit after moderation is a\n * new thing to moderate, and carrying the old approval forward is how an\n * approved review becomes a different text.\n * @summary Write Review\n */\nexport const writeReview = async (docId: number,\n reviewUpdateWrite: ReviewUpdateWrite, options?: Parameters<typeof request>[1]): Promise<ReviewRead> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<ReviewRead>(getWriteReviewUrl(docId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(reviewUpdateWrite)\n }\n);}\n\n\n\n\n\nexport const getWriteReviewMutationKey = () => ['writeReview'] as const;\n\nexport const getWriteReviewMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof writeReview>>, TError,WriteReviewMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof writeReview>>, TError,WriteReviewMutationVariables, TContext> => {\n\nconst mutationKey = getWriteReviewMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof writeReview>>, WriteReviewMutationVariables> = (props) => {\n const {docId,data} = props ?? {};\n\n return writeReview(docId,data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type WriteReviewMutationResult = NonNullable<Awaited<ReturnType<typeof writeReview>>>\n export type WriteReviewMutationBody = BodyType<ReviewUpdateWrite>\n export type WriteReviewMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type WriteReviewMutationVariables = {docId: number;data: BodyType<ReviewUpdateWrite>}\n\n /**\n * @summary Write Review\n */\nexport const useWriteReview = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof writeReview>>, TError,WriteReviewMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof writeReview>>,\n TError,\n WriteReviewMutationVariables,\n TContext\n > => {\n return useMutation(getWriteReviewMutationOptions(options), queryClient);\n }\n"],"mappings":";;;;;;;;;;;AAgDA,MAAM,gBAAqC,OAAU,aAAqC;CACxF,MAAM,SAAS,EAAE,SAAS;CAC1B,KAAK,MAAM,OAAO,OAAO,KAAK,KAAK,GAAG;EAGpC,IAAI,QAAQ,YAAY;EACxB,OAAO,eAAe,QAAQ,KAAK;GACjC,YAAY;GACZ,cAAc;GACd,WAAY,MAAkC;EAChD,CAAC;CACH;CACA,OAAO;AACT;AAEA,MAAa,8BAA8B;CAKzC,OAAO;AACT;;;;;;;;;;;AAYA,MAAa,kBAAkB,OAAO,qBAA0C,YAAmE;CAE/I,MAAM,cAAc,MAAwF;EAC5G,IAAI,CAAC,GAAG,OAAO,CAAC;EAChB,IAAI,aAAa,SAAS,OAAO,OAAO,YAAY,EAAE,QAAQ,CAAC;EAC/D,IAAI,OAAO,YAAY,GACrB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AAS,OAAO,OAAO,YAAY,EAAE,QAAQ,CAAC;EAC/D,IAAI,OAAO,YAAY,GACrB,OAAO,OAAO,YACZ,MAAM,KAAK,IAAkC,UAAU,MAAM,KAAK,KAAK,CAAqB,CAC9F;EAEF,MAAM,UAAsD,CAAC;EAC7D,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAgD,CAAC,GAClF,IAAI,UAAU,KAAA,GAAW,QAAQ,QAAQ;EAE3C,OAAO;CACT;CACF,OAAO,QAAoB,kBAAkB,KAAK,GAChD;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,iBAAiB;CACxC,CACF;AAAE;AAMF,MAAa,kCAAkC,CAAC,aAAa;AAE7D,MAAa,iCACW,YACyF;CAEjH,MAAM,cAAc,0BAA0B;CAC9C,MAAM,EAAC,UAAU,iBAAiB,SAAS,mBAAkB,UACvD,QAAQ,YAAY,iBAAiB,QAAQ,YAAY,QAAQ,SAAS,cAC1E,UACE;EAAC,GAAG;EAAS,UAAU;GAAC,GAAG,QAAQ;GAAU;EAAW;CAAC,IACzD;EAAC,UAAU,EAAE,YAAa;EAAG,SAAS,KAAA;CAAS;CAKjD,MAAM,cAAuG,UAAU;EACnH,MAAM,EAAC,OAAM,SAAQ,SAAS,CAAC;EAE/B,OAAQ,YAAY,OAAM,MAAK,cAAc;CAC/C;CAON,OAAQ;EAAE;EAAY,GAAG;CAAgB;AAAC;;;;AAU5C,MAAa,kBACW,SACrB,gBAKQ;CACL,OAAO,YAAY,8BAA8B,OAAO,GAAG,WAAW;AACxE"}
|
|
1
|
+
{"version":3,"file":"cvs-documents.js","names":[],"sources":["../../src/react/cvs-documents/cvs-documents.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.8.2\n */\nimport {\n useMutation,\n useQuery\n} from '@tanstack/react-query';\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n MutationFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseMutationOptions,\n UseMutationResult,\n UseQueryOptions,\n UseQueryResult\n} from '@tanstack/react-query';\n\nimport type {\n DocumentPage,\n DocumentRead,\n DocumentSearchWrite,\n HTTPExceptionResponse,\n LastPositionWrite,\n OpenAtSupplierParams,\n RatingUpdateWrite,\n ReviewRead,\n ReviewUpdateWrite,\n SupplierGrantRead,\n ValidationErrorResponse\n} from '../../models';\n\nimport { request } from '../../client';\nimport type { ErrorType , BodyType } from '../../client';\n\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n\n\nconst withQueryKey = <T extends object, K>(query: T, queryKey: K): T & { queryKey: K } => {\n const result = { queryKey } as T & { queryKey: K };\n for (const key of Object.keys(query)) {\n // The explicit queryKey always wins, matching the previous\n // `{ ...query, queryKey }` spread where it was set last.\n if (key === 'queryKey') continue;\n Object.defineProperty(result, key, {\n enumerable: true,\n configurable: true,\n get: () => (query as Record<string, unknown>)[key],\n });\n }\n return result;\n};\n\nexport const getSearchDocumentsUrl = () => {\n\n\n\n\n return `/cvs/documents/search`\n}\n\n/**\n * Search the CVS catalogue.\n *\n * ``POST`` because the legacy put the query in the body and the mobile clients\n * send it that way. It is a read, so it stays safe: nothing here writes.\n *\n * Same division as ``/search``: the index ranks, PostgreSQL authorises. An\n * index outage degrades to no results rather than to an unfiltered catalogue.\n * @summary Search Documents\n */\nexport const searchDocuments = async (documentSearchWrite: DocumentSearchWrite, options?: Parameters<typeof request>[1]): Promise<DocumentPage> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<DocumentPage>(getSearchDocumentsUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(documentSearchWrite)\n }\n);}\n\n\n\n\n\nexport const getSearchDocumentsMutationKey = () => ['searchDocuments'] as const;\n\nexport const getSearchDocumentsMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof searchDocuments>>, TError,SearchDocumentsMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof searchDocuments>>, TError,SearchDocumentsMutationVariables, TContext> => {\n\nconst mutationKey = getSearchDocumentsMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof searchDocuments>>, SearchDocumentsMutationVariables> = (props) => {\n const {data} = props ?? {};\n\n return searchDocuments(data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type SearchDocumentsMutationResult = NonNullable<Awaited<ReturnType<typeof searchDocuments>>>\n export type SearchDocumentsMutationBody = BodyType<DocumentSearchWrite>\n export type SearchDocumentsMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type SearchDocumentsMutationVariables = {data: BodyType<DocumentSearchWrite>}\n\n /**\n * @summary Search Documents\n */\nexport const useSearchDocuments = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof searchDocuments>>, TError,SearchDocumentsMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof searchDocuments>>,\n TError,\n SearchDocumentsMutationVariables,\n TContext\n > => {\n return useMutation(getSearchDocumentsMutationOptions(options), queryClient);\n }\n export const getReadDocumentUrl = (docId: number,) => {\n\n\n\n\n return `/cvs/documents/${docId}`\n}\n\n/**\n * One work, if this caller's contract reaches it.\n *\n * Missing until now, which was an oversight rather than a decision: search,\n * rating, review and position all existed and there was no way to fetch the\n * thing they act on. The legacy has no equivalent either — the app assembles a\n * document sheet from whatever the menu endpoint already returned, which is why\n * a deep link into a title has never worked properly.\n * @summary Read Document\n */\nexport const readDocument = async (docId: number, options?: Parameters<typeof request>[1]): Promise<DocumentRead> => {\n\n return request<DocumentRead>(getReadDocumentUrl(docId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getReadDocumentQueryKey = (docId: number,) => {\n return [\n `/cvs/documents/${docId}`\n ] as const;\n }\n\n\nexport const getReadDocumentQueryOptions = <TData = Awaited<ReturnType<typeof readDocument>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(docId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readDocument>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getReadDocumentQueryKey(docId);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof readDocument>>> = ({ signal }) => readDocument(docId, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, enabled: docId !== null && docId !== undefined, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof readDocument>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ReadDocumentQueryResult = NonNullable<Awaited<ReturnType<typeof readDocument>>>\nexport type ReadDocumentQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useReadDocument<TData = Awaited<ReturnType<typeof readDocument>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n docId: number, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof readDocument>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof readDocument>>,\n TError,\n Awaited<ReturnType<typeof readDocument>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadDocument<TData = Awaited<ReturnType<typeof readDocument>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n docId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readDocument>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof readDocument>>,\n TError,\n Awaited<ReturnType<typeof readDocument>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadDocument<TData = Awaited<ReturnType<typeof readDocument>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n docId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readDocument>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Read Document\n */\n\nexport function useReadDocument<TData = Awaited<ReturnType<typeof readDocument>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n docId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readDocument>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getReadDocumentQueryOptions(docId,options)\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n return withQueryKey(query, queryOptions.queryKey);\n}\n\n\n\n\n\n\nexport const getOpenAtSupplierUrl = (docId: number,\n params?: OpenAtSupplierParams,) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : String(value))\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/cvs/documents/${docId}/grant?${stringifiedParams}` : `/cvs/documents/${docId}/grant`\n}\n\n/**\n * Authorise this patron to open one title at the supplier hosting it.\n *\n * Replaces the legacy ``wstoken``: 4,878 lines dispatching on\n * ``frn.plate_forme`` through 57 near-identical arms. The signing schemes\n * reduce to eight (:class:`~app.models.enums.TokenFormula`) and the platform\n * map to a table, so what is left here is the order of operations.\n *\n * **Entitle, seat, then sign** — the same order the streaming route uses, and\n * for the same reason. A signature is cheap to produce and impossible to\n * recall once it has left; a seat can be released. Signing first would mean a\n * refused request had already handed a patron something that works.\n *\n * ``404`` when the caller is not entitled or the title does not exist — the\n * two are deliberately indistinguishable, as everywhere else in this API.\n * ``409`` when every seat is taken: the caller *is* entitled and should be\n * offered \"try later\", not \"buy a subscription\". ``409`` too when the supplier\n * sits on a platform nobody implemented — four do, and the legacy cannot serve\n * them either, so the honest answer is that this title is not openable rather\n * than a 500 from a missing branch.\n *\n * ``mode`` is the legacy's ``$upload``: ``stream`` to consult in place,\n * ``download`` to take a copy away. It does two things, and both matter —\n *\n * * **The library is billed for the right act.** ``exemp`` records streaming\n * and download separately, and ``pret_download`` is the only column where a\n * loan duration ever appears. Granting a download as a view bills the wrong\n * quota.\n * * **Three platforms sign it.** Jeux CVS, CVS Livres and Komics Initiative\n * append the flag *after* the second key, so a stream and a download of the\n * same title by the same patron at the same second carry different\n * signatures. For the other platforms it is inert.\n *\n * The returned token is for the *supplier*, not for us. See\n * :class:`~app.datamodels.cvs.downloads.SupplierGrantRead`.\n * @summary Open At Supplier\n */\nexport const openAtSupplier = async (docId: number,\n params?: OpenAtSupplierParams, options?: Parameters<typeof request>[1]): Promise<SupplierGrantRead> => {\n\n return request<SupplierGrantRead>(getOpenAtSupplierUrl(docId,params),\n {\n ...options,\n method: 'POST'\n\n\n }\n);}\n\n\n\n\n\nexport const getOpenAtSupplierMutationKey = () => ['openAtSupplier'] as const;\n\nexport const getOpenAtSupplierMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof openAtSupplier>>, TError,OpenAtSupplierMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof openAtSupplier>>, TError,OpenAtSupplierMutationVariables, TContext> => {\n\nconst mutationKey = getOpenAtSupplierMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof openAtSupplier>>, OpenAtSupplierMutationVariables> = (props) => {\n const {docId,params} = props ?? {};\n\n return openAtSupplier(docId,params,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type OpenAtSupplierMutationResult = NonNullable<Awaited<ReturnType<typeof openAtSupplier>>>\n\n export type OpenAtSupplierMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type OpenAtSupplierMutationVariables = {docId: number;params?: OpenAtSupplierParams}\n\n /**\n * @summary Open At Supplier\n */\nexport const useOpenAtSupplier = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof openAtSupplier>>, TError,OpenAtSupplierMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof openAtSupplier>>,\n TError,\n OpenAtSupplierMutationVariables,\n TContext\n > => {\n return useMutation(getOpenAtSupplierMutationOptions(options), queryClient);\n }\n export const getReadLastPositionUrl = (docId: number,) => {\n\n\n\n\n return `/cvs/documents/${docId}/position`\n}\n\n/**\n * Where this patron got to, or ``0`` if they have not started.\n *\n * New: the legacy has no way to read the position back, so a client that lost\n * its local state could never resume. Absent means not started, which is why\n * the row is not created on read.\n * @summary Read Last Position\n */\nexport const readLastPosition = async (docId: number, options?: Parameters<typeof request>[1]): Promise<LastPositionWrite> => {\n\n return request<LastPositionWrite>(getReadLastPositionUrl(docId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getReadLastPositionQueryKey = (docId: number,) => {\n return [\n `/cvs/documents/${docId}/position`\n ] as const;\n }\n\n\nexport const getReadLastPositionQueryOptions = <TData = Awaited<ReturnType<typeof readLastPosition>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(docId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readLastPosition>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getReadLastPositionQueryKey(docId);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof readLastPosition>>> = ({ signal }) => readLastPosition(docId, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, enabled: docId !== null && docId !== undefined, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof readLastPosition>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ReadLastPositionQueryResult = NonNullable<Awaited<ReturnType<typeof readLastPosition>>>\nexport type ReadLastPositionQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useReadLastPosition<TData = Awaited<ReturnType<typeof readLastPosition>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n docId: number, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof readLastPosition>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof readLastPosition>>,\n TError,\n Awaited<ReturnType<typeof readLastPosition>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadLastPosition<TData = Awaited<ReturnType<typeof readLastPosition>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n docId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readLastPosition>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof readLastPosition>>,\n TError,\n Awaited<ReturnType<typeof readLastPosition>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadLastPosition<TData = Awaited<ReturnType<typeof readLastPosition>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n docId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readLastPosition>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Read Last Position\n */\n\nexport function useReadLastPosition<TData = Awaited<ReturnType<typeof readLastPosition>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n docId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readLastPosition>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getReadLastPositionQueryOptions(docId,options)\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n return withQueryKey(query, queryOptions.queryKey);\n}\n\n\n\n\n\n\nexport const getSetLastPositionUrl = (docId: number,) => {\n\n\n\n\n return `/cvs/documents/${docId}/position`\n}\n\n/**\n * Record where this patron got to.\n *\n * A write, and the legacy declares it ``GET`` with the position in the query\n * string — which makes resuming a book a cacheable idempotent read that mutates\n * state, and puts it outside the CSRF layer for free.\n *\n * Stored in :class:`~app.models.activity.ReadingPosition`, which the products\n * share — CVS and the partner reader today — so a member who reads across them\n * keeps their place in one shape.\n * @summary Set Last Position\n */\nexport const setLastPosition = async (docId: number,\n lastPositionWrite: LastPositionWrite, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<void>(getSetLastPositionUrl(docId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(lastPositionWrite)\n }\n);}\n\n\n\n\n\nexport const getSetLastPositionMutationKey = () => ['setLastPosition'] as const;\n\nexport const getSetLastPositionMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof setLastPosition>>, TError,SetLastPositionMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof setLastPosition>>, TError,SetLastPositionMutationVariables, TContext> => {\n\nconst mutationKey = getSetLastPositionMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof setLastPosition>>, SetLastPositionMutationVariables> = (props) => {\n const {docId,data} = props ?? {};\n\n return setLastPosition(docId,data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type SetLastPositionMutationResult = NonNullable<Awaited<ReturnType<typeof setLastPosition>>>\n export type SetLastPositionMutationBody = BodyType<LastPositionWrite>\n export type SetLastPositionMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type SetLastPositionMutationVariables = {docId: number;data: BodyType<LastPositionWrite>}\n\n /**\n * @summary Set Last Position\n */\nexport const useSetLastPosition = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof setLastPosition>>, TError,SetLastPositionMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof setLastPosition>>,\n TError,\n SetLastPositionMutationVariables,\n TContext\n > => {\n return useMutation(getSetLastPositionMutationOptions(options), queryClient);\n }\n export const getRateDocumentUrl = (docId: number,) => {\n\n\n\n\n return `/cvs/documents/${docId}/rating`\n}\n\n/**\n * Rate a document. Idempotent — rating again replaces the earlier score.\n *\n * ``PUT`` on the rating sub-resource rather than the legacy\n * ``POST /document/rating/update`` with the id in the body: the identifier\n * belongs in the path, and \"update\" in a path names an operation in a position\n * reserved for a resource.\n * @summary Rate Document\n */\nexport const rateDocument = async (docId: number,\n ratingUpdateWrite: RatingUpdateWrite, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<void>(getRateDocumentUrl(docId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(ratingUpdateWrite)\n }\n);}\n\n\n\n\n\nexport const getRateDocumentMutationKey = () => ['rateDocument'] as const;\n\nexport const getRateDocumentMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof rateDocument>>, TError,RateDocumentMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof rateDocument>>, TError,RateDocumentMutationVariables, TContext> => {\n\nconst mutationKey = getRateDocumentMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof rateDocument>>, RateDocumentMutationVariables> = (props) => {\n const {docId,data} = props ?? {};\n\n return rateDocument(docId,data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type RateDocumentMutationResult = NonNullable<Awaited<ReturnType<typeof rateDocument>>>\n export type RateDocumentMutationBody = BodyType<RatingUpdateWrite>\n export type RateDocumentMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type RateDocumentMutationVariables = {docId: number;data: BodyType<RatingUpdateWrite>}\n\n /**\n * @summary Rate Document\n */\nexport const useRateDocument = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof rateDocument>>, TError,RateDocumentMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof rateDocument>>,\n TError,\n RateDocumentMutationVariables,\n TContext\n > => {\n return useMutation(getRateDocumentMutationOptions(options), queryClient);\n }\n export const getWriteReviewUrl = (docId: number,) => {\n\n\n\n\n return `/cvs/documents/${docId}/review`\n}\n\n/**\n * Write or replace this patron's review of a document.\n *\n * One review per person per document, so this is a ``PUT`` on a singular\n * sub-resource rather than a ``POST`` to a collection. The legacy had two routes\n * — with and without an ``avisId`` — for what is one row.\n *\n * Every write resets the review to unpublished. An edit after moderation is a\n * new thing to moderate, and carrying the old approval forward is how an\n * approved review becomes a different text.\n * @summary Write Review\n */\nexport const writeReview = async (docId: number,\n reviewUpdateWrite: ReviewUpdateWrite, options?: Parameters<typeof request>[1]): Promise<ReviewRead> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<ReviewRead>(getWriteReviewUrl(docId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(reviewUpdateWrite)\n }\n);}\n\n\n\n\n\nexport const getWriteReviewMutationKey = () => ['writeReview'] as const;\n\nexport const getWriteReviewMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof writeReview>>, TError,WriteReviewMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof writeReview>>, TError,WriteReviewMutationVariables, TContext> => {\n\nconst mutationKey = getWriteReviewMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof writeReview>>, WriteReviewMutationVariables> = (props) => {\n const {docId,data} = props ?? {};\n\n return writeReview(docId,data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type WriteReviewMutationResult = NonNullable<Awaited<ReturnType<typeof writeReview>>>\n export type WriteReviewMutationBody = BodyType<ReviewUpdateWrite>\n export type WriteReviewMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type WriteReviewMutationVariables = {docId: number;data: BodyType<ReviewUpdateWrite>}\n\n /**\n * @summary Write Review\n */\nexport const useWriteReview = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof writeReview>>, TError,WriteReviewMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof writeReview>>,\n TError,\n WriteReviewMutationVariables,\n TContext\n > => {\n return useMutation(getWriteReviewMutationOptions(options), queryClient);\n }\n"],"mappings":";;;;;;;;;;;AAgDA,MAAM,gBAAqC,OAAU,aAAqC;CACxF,MAAM,SAAS,EAAE,SAAS;CAC1B,KAAK,MAAM,OAAO,OAAO,KAAK,KAAK,GAAG;EAGp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/B,OAAQ,YAAY,OAAM,MAAK,cAAc;CAC/C;CAON,OAAQ;EAAE;EAAY,GAAG;CAAgB;AAAC;;;;AAU5C,MAAa,kBACW,SACrB,gBAKQ;CACL,OAAO,YAAY,8BAA8B,OAAO,GAAG,WAAW;AACxE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { Br as SelectionRead, Dr as HTTPExceptionResponse, Rr as FavoriteListRead, t as ValidationErrorResponse } from "../chunks/index.js";
|
|
3
3
|
import { a as ErrorType, c as request } from "../chunks/client.js";
|
|
4
4
|
import { DataTag, DefinedInitialDataOptions, DefinedUseQueryResult, QueryClient, QueryKey, UndefinedInitialDataOptions, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
|
|
5
5
|
//#region src/react/cvs-favorites/cvs-favorites.d.ts
|
|
@@ -7,7 +7,7 @@ import { useMutation, useQuery } from "@tanstack/react-query";
|
|
|
7
7
|
* Do not edit manually.
|
|
8
8
|
* Mozaik backend
|
|
9
9
|
* Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.
|
|
10
|
-
* OpenAPI spec version: 0.
|
|
10
|
+
* OpenAPI spec version: 0.8.2
|
|
11
11
|
*/
|
|
12
12
|
const withQueryKey = (query, queryKey) => {
|
|
13
13
|
const result = { queryKey };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cvs-favorites.js","names":[],"sources":["../../src/react/cvs-favorites/cvs-favorites.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.7.0\n */\nimport {\n useMutation,\n useQuery\n} from '@tanstack/react-query';\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n MutationFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseMutationOptions,\n UseMutationResult,\n UseQueryOptions,\n UseQueryResult\n} from '@tanstack/react-query';\n\nimport type {\n FavoriteListRead,\n HTTPExceptionResponse,\n SelectionRead,\n ValidationErrorResponse\n} from '../../models';\n\nimport { request } from '../../client';\nimport type { ErrorType } from '../../client';\n\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n\n\nconst withQueryKey = <T extends object, K>(query: T, queryKey: K): T & { queryKey: K } => {\n const result = { queryKey } as T & { queryKey: K };\n for (const key of Object.keys(query)) {\n // The explicit queryKey always wins, matching the previous\n // `{ ...query, queryKey }` spread where it was set last.\n if (key === 'queryKey') continue;\n Object.defineProperty(result, key, {\n enumerable: true,\n configurable: true,\n get: () => (query as Record<string, unknown>)[key],\n });\n }\n return result;\n};\n\nexport const getListCvsFavoritesUrl = () => {\n\n\n\n\n return `/cvs/favorites`\n}\n\n/**\n * The caller's favourites.\n *\n * Entitlement-filtered. A title the library has stopped licensing stays in the\n * list — removing it silently would lose the patron's own curation over a\n * contract change they had nothing to do with — but it is not returned here,\n * because a client cannot open it. When the licence comes back, so does the\n * entry.\n * @summary List Cvs Favorites\n */\nexport const listCvsFavorites = async ( options?: Parameters<typeof request>[1]): Promise<FavoriteListRead> => {\n\n return request<FavoriteListRead>(getListCvsFavoritesUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getListCvsFavoritesQueryKey = () => {\n return [\n `/cvs/favorites`\n ] as const;\n }\n\n\nexport const getListCvsFavoritesQueryOptions = <TData = Awaited<ReturnType<typeof listCvsFavorites>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listCvsFavorites>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getListCvsFavoritesQueryKey();\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof listCvsFavorites>>> = ({ signal }) => listCvsFavorites({ signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listCvsFavorites>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ListCvsFavoritesQueryResult = NonNullable<Awaited<ReturnType<typeof listCvsFavorites>>>\nexport type ListCvsFavoritesQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useListCvsFavorites<TData = Awaited<ReturnType<typeof listCvsFavorites>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listCvsFavorites>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof listCvsFavorites>>,\n TError,\n Awaited<ReturnType<typeof listCvsFavorites>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListCvsFavorites<TData = Awaited<ReturnType<typeof listCvsFavorites>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listCvsFavorites>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof listCvsFavorites>>,\n TError,\n Awaited<ReturnType<typeof listCvsFavorites>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListCvsFavorites<TData = Awaited<ReturnType<typeof listCvsFavorites>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listCvsFavorites>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary List Cvs Favorites\n */\n\nexport function useListCvsFavorites<TData = Awaited<ReturnType<typeof listCvsFavorites>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listCvsFavorites>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getListCvsFavoritesQueryOptions(options)\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n return withQueryKey(query, queryOptions.queryKey);\n}\n\n\n\n\n\n\nexport const getRemoveCvsFavoriteUrl = (docId: number,) => {\n\n\n\n\n return `/cvs/favorites/${docId}`\n}\n\n/**\n * Remove a work from the caller's list. Idempotent.\n *\n * Scoped to ``kind = 8`` through the list lookup, so this can never delete a\n * line out of the patron's loans or reservations — which live in the same two\n * tables and would look identical to a query that only matched on\n * ``(user_id, doc_id)``.\n * @summary Remove Cvs Favorite\n */\nexport const removeCvsFavorite = async (docId: number, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getRemoveCvsFavoriteUrl(docId),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\n\n\n\nexport const getRemoveCvsFavoriteMutationKey = () => ['removeCvsFavorite'] as const;\n\nexport const getRemoveCvsFavoriteMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof removeCvsFavorite>>, TError,RemoveCvsFavoriteMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof removeCvsFavorite>>, TError,RemoveCvsFavoriteMutationVariables, TContext> => {\n\nconst mutationKey = getRemoveCvsFavoriteMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof removeCvsFavorite>>, RemoveCvsFavoriteMutationVariables> = (props) => {\n const {docId} = props ?? {};\n\n return removeCvsFavorite(docId,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type RemoveCvsFavoriteMutationResult = NonNullable<Awaited<ReturnType<typeof removeCvsFavorite>>>\n\n export type RemoveCvsFavoriteMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type RemoveCvsFavoriteMutationVariables = {docId: number}\n\n /**\n * @summary Remove Cvs Favorite\n */\nexport const useRemoveCvsFavorite = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof removeCvsFavorite>>, TError,RemoveCvsFavoriteMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof removeCvsFavorite>>,\n TError,\n RemoveCvsFavoriteMutationVariables,\n TContext\n > => {\n return useMutation(getRemoveCvsFavoriteMutationOptions(options), queryClient);\n }\n export const getAddCvsFavoriteUrl = (docId: number,) => {\n\n\n\n\n return `/cvs/favorites/${docId}`\n}\n\n/**\n * Add a work to the caller's list. Idempotent.\n *\n * ``PUT`` and ``DELETE`` on the item, rather than the legacy's single route\n * answering both ``POST`` and ``DELETE`` on a path with a required\n * ``{selectionId}`` its own handler declares optional.\n *\n * Not entitlement-gated. A patron may bookmark something their library has not\n * licensed yet — that is a signal worth having, and it is what an acquisitions\n * request is made of. Reaching the work is gated, at the point of reaching it.\n * @summary Add Cvs Favorite\n */\nexport const addCvsFavorite = async (docId: number, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getAddCvsFavoriteUrl(docId),\n {\n ...options,\n method: 'PUT'\n\n\n }\n);}\n\n\n\n\n\nexport const getAddCvsFavoriteMutationKey = () => ['addCvsFavorite'] as const;\n\nexport const getAddCvsFavoriteMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addCvsFavorite>>, TError,AddCvsFavoriteMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof addCvsFavorite>>, TError,AddCvsFavoriteMutationVariables, TContext> => {\n\nconst mutationKey = getAddCvsFavoriteMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof addCvsFavorite>>, AddCvsFavoriteMutationVariables> = (props) => {\n const {docId} = props ?? {};\n\n return addCvsFavorite(docId,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type AddCvsFavoriteMutationResult = NonNullable<Awaited<ReturnType<typeof addCvsFavorite>>>\n\n export type AddCvsFavoriteMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type AddCvsFavoriteMutationVariables = {docId: number}\n\n /**\n * @summary Add Cvs Favorite\n */\nexport const useAddCvsFavorite = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addCvsFavorite>>, TError,AddCvsFavoriteMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof addCvsFavorite>>,\n TError,\n AddCvsFavoriteMutationVariables,\n TContext\n > => {\n return useMutation(getAddCvsFavoriteMutationOptions(options), queryClient);\n }\n export const getListSelectionsUrl = () => {\n\n\n\n\n return `/cvs/lists`\n}\n\n/**\n * Every list this patron holds, of every kind.\n *\n * Read-only and deliberately unfiltered: a client showing \"my loans\" and \"my\n * list\" side by side needs to know which is which, and hiding the ILS-mirrored\n * kinds would only make it guess.\n * @summary List Selections\n */\nexport const listSelections = async ( options?: Parameters<typeof request>[1]): Promise<SelectionRead[]> => {\n\n return request<SelectionRead[]>(getListSelectionsUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getListSelectionsQueryKey = () => {\n return [\n `/cvs/lists`\n ] as const;\n }\n\n\nexport const getListSelectionsQueryOptions = <TData = Awaited<ReturnType<typeof listSelections>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listSelections>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getListSelectionsQueryKey();\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof listSelections>>> = ({ signal }) => listSelections({ signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listSelections>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ListSelectionsQueryResult = NonNullable<Awaited<ReturnType<typeof listSelections>>>\nexport type ListSelectionsQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useListSelections<TData = Awaited<ReturnType<typeof listSelections>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listSelections>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof listSelections>>,\n TError,\n Awaited<ReturnType<typeof listSelections>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListSelections<TData = Awaited<ReturnType<typeof listSelections>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listSelections>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof listSelections>>,\n TError,\n Awaited<ReturnType<typeof listSelections>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListSelections<TData = Awaited<ReturnType<typeof listSelections>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listSelections>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary List Selections\n */\n\nexport function useListSelections<TData = Awaited<ReturnType<typeof listSelections>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listSelections>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getListSelectionsQueryOptions(options)\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n return withQueryKey(query, queryOptions.queryKey);\n}\n\n\n\n\n\n\n"],"mappings":";;;;;;;;;;;AAyCA,MAAM,gBAAqC,OAAU,aAAqC;CACxF,MAAM,SAAS,E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AAO,CACP,YACA;AACA;AAGJ,MAAa,iCAA2J,YACnK;CAEL,MAAM,EAAC,OAAO,cAAc,SAAS,mBAAkB,WAAW,CAAC;CAEjE,MAAM,WAAY,cAAc,YAAY,0BAA0B;CAIpE,MAAM,WAAsE,EAAE,aAAa,eAAe;EAAE;EAAQ,GAAG;CAAe,CAAC;CAMxI,OAAQ;EAAE;EAAU;EAAS,GAAG;CAAY;AAC/C;;;;AAkCA,SAAgB,kBACd,SACC,aACiF;CAElF,MAAM,eAAe,8BAA8B,OAAO;CAE1D,MAAM,QAAQ,SAAS,cAAc,WAAW;CAEhD,OAAO,aAAa,OAAO,aAAa,QAAQ;AAClD"}
|
|
1
|
+
{"version":3,"file":"cvs-favorites.js","names":[],"sources":["../../src/react/cvs-favorites/cvs-favorites.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.8.2\n */\nimport {\n useMutation,\n useQuery\n} from '@tanstack/react-query';\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n MutationFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseMutationOptions,\n UseMutationResult,\n UseQueryOptions,\n UseQueryResult\n} from '@tanstack/react-query';\n\nimport type {\n FavoriteListRead,\n HTTPExceptionResponse,\n SelectionRead,\n ValidationErrorResponse\n} from '../../models';\n\nimport { request } from '../../client';\nimport type { ErrorType } from '../../client';\n\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n\n\nconst withQueryKey = <T extends object, K>(query: T, queryKey: K): T & { queryKey: K } => {\n const result = { queryKey } as T & { queryKey: K };\n for (const key of Object.keys(query)) {\n // The explicit queryKey always wins, matching the previous\n // `{ ...query, queryKey }` spread where it was set last.\n if (key === 'queryKey') continue;\n Object.defineProperty(result, key, {\n enumerable: true,\n configurable: true,\n get: () => (query as Record<string, unknown>)[key],\n });\n }\n return result;\n};\n\nexport const getListCvsFavoritesUrl = () => {\n\n\n\n\n return `/cvs/favorites`\n}\n\n/**\n * The caller's favourites.\n *\n * Entitlement-filtered. A title the library has stopped licensing stays in the\n * list — removing it silently would lose the patron's own curation over a\n * contract change they had nothing to do with — but it is not returned here,\n * because a client cannot open it. When the licence comes back, so does the\n * entry.\n * @summary List Cvs Favorites\n */\nexport const listCvsFavorites = async ( options?: Parameters<typeof request>[1]): Promise<FavoriteListRead> => {\n\n return request<FavoriteListRead>(getListCvsFavoritesUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getListCvsFavoritesQueryKey = () => {\n return [\n `/cvs/favorites`\n ] as const;\n }\n\n\nexport const getListCvsFavoritesQueryOptions = <TData = Awaited<ReturnType<typeof listCvsFavorites>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listCvsFavorites>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getListCvsFavoritesQueryKey();\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof listCvsFavorites>>> = ({ signal }) => listCvsFavorites({ signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listCvsFavorites>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ListCvsFavoritesQueryResult = NonNullable<Awaited<ReturnType<typeof listCvsFavorites>>>\nexport type ListCvsFavoritesQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useListCvsFavorites<TData = Awaited<ReturnType<typeof listCvsFavorites>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listCvsFavorites>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof listCvsFavorites>>,\n TError,\n Awaited<ReturnType<typeof listCvsFavorites>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListCvsFavorites<TData = Awaited<ReturnType<typeof listCvsFavorites>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listCvsFavorites>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof listCvsFavorites>>,\n TError,\n Awaited<ReturnType<typeof listCvsFavorites>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListCvsFavorites<TData = Awaited<ReturnType<typeof listCvsFavorites>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listCvsFavorites>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary List Cvs Favorites\n */\n\nexport function useListCvsFavorites<TData = Awaited<ReturnType<typeof listCvsFavorites>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listCvsFavorites>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getListCvsFavoritesQueryOptions(options)\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n return withQueryKey(query, queryOptions.queryKey);\n}\n\n\n\n\n\n\nexport const getRemoveCvsFavoriteUrl = (docId: number,) => {\n\n\n\n\n return `/cvs/favorites/${docId}`\n}\n\n/**\n * Remove a work from the caller's list. Idempotent.\n *\n * Scoped to ``kind = 8`` through the list lookup, so this can never delete a\n * line out of the patron's loans or reservations — which live in the same two\n * tables and would look identical to a query that only matched on\n * ``(user_id, doc_id)``.\n * @summary Remove Cvs Favorite\n */\nexport const removeCvsFavorite = async (docId: number, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getRemoveCvsFavoriteUrl(docId),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\n\n\n\nexport const getRemoveCvsFavoriteMutationKey = () => ['removeCvsFavorite'] as const;\n\nexport const getRemoveCvsFavoriteMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof removeCvsFavorite>>, TError,RemoveCvsFavoriteMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof removeCvsFavorite>>, TError,RemoveCvsFavoriteMutationVariables, TContext> => {\n\nconst mutationKey = getRemoveCvsFavoriteMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof removeCvsFavorite>>, RemoveCvsFavoriteMutationVariables> = (props) => {\n const {docId} = props ?? {};\n\n return removeCvsFavorite(docId,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type RemoveCvsFavoriteMutationResult = NonNullable<Awaited<ReturnType<typeof removeCvsFavorite>>>\n\n export type RemoveCvsFavoriteMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type RemoveCvsFavoriteMutationVariables = {docId: number}\n\n /**\n * @summary Remove Cvs Favorite\n */\nexport const useRemoveCvsFavorite = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof removeCvsFavorite>>, TError,RemoveCvsFavoriteMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof removeCvsFavorite>>,\n TError,\n RemoveCvsFavoriteMutationVariables,\n TContext\n > => {\n return useMutation(getRemoveCvsFavoriteMutationOptions(options), queryClient);\n }\n export const getAddCvsFavoriteUrl = (docId: number,) => {\n\n\n\n\n return `/cvs/favorites/${docId}`\n}\n\n/**\n * Add a work to the caller's list. Idempotent.\n *\n * ``PUT`` and ``DELETE`` on the item, rather than the legacy's single route\n * answering both ``POST`` and ``DELETE`` on a path with a required\n * ``{selectionId}`` its own handler declares optional.\n *\n * Not entitlement-gated. A patron may bookmark something their library has not\n * licensed yet — that is a signal worth having, and it is what an acquisitions\n * request is made of. Reaching the work is gated, at the point of reaching it.\n * @summary Add Cvs Favorite\n */\nexport const addCvsFavorite = async (docId: number, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getAddCvsFavoriteUrl(docId),\n {\n ...options,\n method: 'PUT'\n\n\n }\n);}\n\n\n\n\n\nexport const getAddCvsFavoriteMutationKey = () => ['addCvsFavorite'] as const;\n\nexport const getAddCvsFavoriteMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addCvsFavorite>>, TError,AddCvsFavoriteMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof addCvsFavorite>>, TError,AddCvsFavoriteMutationVariables, TContext> => {\n\nconst mutationKey = getAddCvsFavoriteMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof addCvsFavorite>>, AddCvsFavoriteMutationVariables> = (props) => {\n const {docId} = props ?? {};\n\n return addCvsFavorite(docId,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type AddCvsFavoriteMutationResult = NonNullable<Awaited<ReturnType<typeof addCvsFavorite>>>\n\n export type AddCvsFavoriteMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type AddCvsFavoriteMutationVariables = {docId: number}\n\n /**\n * @summary Add Cvs Favorite\n */\nexport const useAddCvsFavorite = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addCvsFavorite>>, TError,AddCvsFavoriteMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof addCvsFavorite>>,\n TError,\n AddCvsFavoriteMutationVariables,\n TContext\n > => {\n return useMutation(getAddCvsFavoriteMutationOptions(options), queryClient);\n }\n export const getListSelectionsUrl = () => {\n\n\n\n\n return `/cvs/lists`\n}\n\n/**\n * Every list this patron holds, of every kind.\n *\n * Read-only and deliberately unfiltered: a client showing \"my loans\" and \"my\n * list\" side by side needs to know which is which, and hiding the ILS-mirrored\n * kinds would only make it guess.\n * @summary List Selections\n */\nexport const listSelections = async ( options?: Parameters<typeof request>[1]): Promise<SelectionRead[]> => {\n\n return request<SelectionRead[]>(getListSelectionsUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getListSelectionsQueryKey = () => {\n return [\n `/cvs/lists`\n ] as const;\n }\n\n\nexport const getListSelectionsQueryOptions = <TData = Awaited<ReturnType<typeof listSelections>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listSelections>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getListSelectionsQueryKey();\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof listSelections>>> = ({ signal }) => listSelections({ signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listSelections>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ListSelectionsQueryResult = NonNullable<Awaited<ReturnType<typeof listSelections>>>\nexport type ListSelectionsQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useListSelections<TData = Awaited<ReturnType<typeof listSelections>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listSelections>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof listSelections>>,\n TError,\n Awaited<ReturnType<typeof listSelections>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListSelections<TData = Awaited<ReturnType<typeof listSelections>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listSelections>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof listSelections>>,\n TError,\n Awaited<ReturnType<typeof listSelections>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListSelections<TData = Awaited<ReturnType<typeof listSelections>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listSelections>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary List Selections\n */\n\nexport function useListSelections<TData = Awaited<ReturnType<typeof listSelections>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listSelections>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getListSelectionsQueryOptions(options)\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n return withQueryKey(query, queryOptions.queryKey);\n}\n\n\n\n\n\n\n"],"mappings":";;;;;;;;;;;AAyCA,MAAM,gBAAqC,OAAU,aAAqC;CACxF,MAAM,SAAS,EAAE,SAAS;CAC1B,KAAK,MAAM,OAAO,OAAO,KAAK,KAAK,GAAG;EAGpC,IAAI,QAAQ,YAAY;EACxB,OAAO,eAAe,QAAQ,KAAK;GACjC,YAAY;GACZ,cAAc;GACd,WAAY,MAAkC;EAChD,CAAC;CACH;CACA,OAAO;AACT;AAEA,MAAa,+BAA+B;CAK1C,OAAO;AACT;;;;;;;;;;;AAYA,MAAa,mBAAmB,OAAQ,YAAuE;CAE7G,OAAO,QAA0B,uBAAuB,GACxD;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAMF,MAAa,oCAAoC;CAC7C,OAAO,CACP,gBACA;AACA;AAGJ,MAAa,mCAA+J,YACvK;CAEL,MAAM,EAAC,OAAO,cAAc,SAAS,mBAAkB,WAAW,CAAC;CAEjE,MAAM,WAAY,cAAc,YAAY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Cr as IlsHoldableRead, Dr as HTTPExceptionResponse, Tr as IlsAccountRead, Vn as ListIlsLoansParams, _t as ReadIlsHoldableParams, br as IlsHoldWrite, fr as IlsStatusRead, gr as IlsLocationListRead, hr as IlsPasswordWrite, lr as IlsTagWrite, mr as IlsReviewWrite, pr as IlsSignInWrite, t as ValidationErrorResponse, ur as IlsSuggestionOptionListRead, vr as IlsLoanListRead, wr as IlsActionRead, xr as IlsHoldListRead } from "../chunks/index.js";
|
|
3
3
|
import { a as ErrorType, c as request, n as BodyType } from "../chunks/client.js";
|
|
4
4
|
import { DataTag, DefinedInitialDataOptions, DefinedUseQueryResult, QueryClient, QueryKey, UndefinedInitialDataOptions, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
|
|
5
5
|
//#region src/react/cvs-ils/cvs-ils.d.ts
|
package/dist/react/cvs-ils.js
CHANGED
|
@@ -7,7 +7,7 @@ import { useMutation, useQuery } from "@tanstack/react-query";
|
|
|
7
7
|
* Do not edit manually.
|
|
8
8
|
* Mozaik backend
|
|
9
9
|
* Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.
|
|
10
|
-
* OpenAPI spec version: 0.
|
|
10
|
+
* OpenAPI spec version: 0.8.2
|
|
11
11
|
*/
|
|
12
12
|
const withQueryKey = (query, queryKey) => {
|
|
13
13
|
const result = { queryKey };
|