@learnorama/mozaik-sdk 0.1.0 → 0.3.2-staging.19.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/README.md +186 -5
- package/dist/api/account.d.ts +2 -2
- package/dist/api/account.js +1 -1
- package/dist/api/account.js.map +1 -1
- package/dist/api/admin-catalogue.d.ts +2 -2
- package/dist/api/admin-catalogue.js +1 -1
- package/dist/api/admin-catalogue.js.map +1 -1
- package/dist/api/admin-consumption.d.ts +7 -2
- package/dist/api/admin-consumption.js +6 -1
- package/dist/api/admin-consumption.js.map +1 -1
- package/dist/api/admin-licenses.d.ts +2 -2
- package/dist/api/admin-licenses.js +1 -1
- package/dist/api/admin-licenses.js.map +1 -1
- package/dist/api/admin-patrons.d.ts +3 -3
- package/dist/api/admin-patrons.js +2 -2
- package/dist/api/admin-patrons.js.map +1 -1
- package/dist/api/admin-reviews.d.ts +2 -2
- package/dist/api/admin-reviews.js +1 -1
- package/dist/api/admin-reviews.js.map +1 -1
- package/dist/api/admin-roles.d.ts +3 -3
- package/dist/api/admin-roles.js +2 -2
- package/dist/api/admin-roles.js.map +1 -1
- package/dist/api/admin-support.d.ts +2 -2
- package/dist/api/admin-support.js +1 -1
- package/dist/api/admin-support.js.map +1 -1
- package/dist/api/admin-tenants.d.ts +8 -2
- package/dist/api/admin-tenants.js +20 -2
- package/dist/api/admin-tenants.js.map +1 -1
- package/dist/api/admin-tutoring.d.ts +2 -2
- package/dist/api/admin-tutoring.js +1 -1
- package/dist/api/admin-tutoring.js.map +1 -1
- package/dist/api/auth.d.ts +2 -2
- package/dist/api/auth.js +1 -1
- package/dist/api/auth.js.map +1 -1
- package/dist/api/biblio-catalogue.d.ts +2 -2
- package/dist/api/biblio-catalogue.js +1 -1
- package/dist/api/biblio-catalogue.js.map +1 -1
- package/dist/api/biblio-home.d.ts +2 -2
- package/dist/api/biblio-home.js +1 -1
- package/dist/api/biblio-home.js.map +1 -1
- package/dist/api/biblio-library.d.ts +2 -2
- package/dist/api/biblio-library.js +1 -1
- package/dist/api/biblio-library.js.map +1 -1
- package/dist/api/biblio-nextory.d.ts +2 -2
- package/dist/api/biblio-nextory.js +1 -1
- package/dist/api/biblio-nextory.js.map +1 -1
- package/dist/api/biblio-press.d.ts +2 -2
- package/dist/api/biblio-press.js +1 -1
- package/dist/api/biblio-press.js.map +1 -1
- package/dist/api/biblio-search.d.ts +2 -2
- package/dist/api/biblio-search.js +1 -1
- package/dist/api/biblio-search.js.map +1 -1
- package/dist/api/biblio-telemetry.d.ts +2 -2
- package/dist/api/biblio-telemetry.js +1 -1
- package/dist/api/biblio-telemetry.js.map +1 -1
- package/dist/api/consumption.d.ts +2 -2
- package/dist/api/consumption.js +1 -1
- package/dist/api/consumption.js.map +1 -1
- package/dist/api/cvs-app.d.ts +2 -2
- package/dist/api/cvs-app.js +1 -1
- package/dist/api/cvs-app.js.map +1 -1
- package/dist/api/cvs-documents.d.ts +16 -4
- package/dist/api/cvs-documents.js +22 -5
- package/dist/api/cvs-documents.js.map +1 -1
- package/dist/api/cvs-favorites.d.ts +2 -2
- package/dist/api/cvs-favorites.js +1 -1
- package/dist/api/cvs-favorites.js.map +1 -1
- package/dist/api/cvs-ils.d.ts +167 -0
- package/dist/api/cvs-ils.js +362 -0
- package/dist/api/cvs-ils.js.map +1 -0
- package/dist/api/cvs-loans.d.ts +2 -2
- package/dist/api/cvs-loans.js +1 -1
- package/dist/api/cvs-loans.js.map +1 -1
- package/dist/api/cvs-payments.d.ts +49 -0
- package/dist/api/cvs-payments.js +84 -0
- package/dist/api/cvs-payments.js.map +1 -0
- package/dist/api/cvs-streaming.d.ts +2 -2
- package/dist/api/cvs-streaming.js +1 -1
- package/dist/api/cvs-streaming.js.map +1 -1
- package/dist/api/index.d.ts +5 -2
- package/dist/api/index.js +7 -4
- package/dist/api/partner-catalogue.d.ts +2 -2
- package/dist/api/partner-catalogue.js +1 -1
- package/dist/api/partner-catalogue.js.map +1 -1
- package/dist/api/partner-reader.d.ts +2 -2
- package/dist/api/partner-reader.js +1 -1
- package/dist/api/partner-reader.js.map +1 -1
- package/dist/api/profiles.d.ts +2 -2
- package/dist/api/profiles.js +1 -1
- package/dist/api/profiles.js.map +1 -1
- package/dist/api/search.d.ts +18 -0
- package/dist/api/search.js +37 -0
- package/dist/api/search.js.map +1 -0
- package/dist/api/tutoring-catalogue.d.ts +2 -2
- package/dist/api/tutoring-catalogue.js +1 -1
- package/dist/api/tutoring-catalogue.js.map +1 -1
- package/dist/api/tutoring-chat.d.ts +2 -2
- package/dist/api/tutoring-chat.js +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 +2 -2
- package/dist/api/tutoring-practitioner.js +1 -1
- package/dist/api/tutoring-practitioner.js.map +1 -1
- package/dist/api/tutoring-requests.d.ts +2 -2
- package/dist/api/tutoring-requests.js +1 -1
- package/dist/api/tutoring-requests.js.map +1 -1
- package/dist/auth.d.ts +10 -0
- package/dist/auth.js +451 -0
- package/dist/auth.js.map +1 -0
- package/dist/chat.d.ts +3 -0
- package/dist/chat.js +3 -0
- package/dist/{client-BDwBZYB0.d.ts → chunks/client.d.ts} +1 -1
- package/dist/{client-D3kMOcIr.js → chunks/client.js} +1 -1
- package/dist/chunks/client.js.map +1 -0
- package/dist/chunks/client2.d.ts +53 -0
- package/dist/chunks/connection.d.ts +28 -0
- package/dist/chunks/connection.js +141 -0
- package/dist/chunks/connection.js.map +1 -0
- package/dist/{index-wL_20vR8.d.ts → chunks/index.d.ts} +901 -128
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +2 -2
- package/dist/models.js +44 -1
- package/dist/models.js.map +1 -1
- package/dist/react/account.d.ts +2 -2
- package/dist/react/account.js +2 -2
- package/dist/react/account.js.map +1 -1
- package/dist/react/admin-catalogue.d.ts +2 -2
- package/dist/react/admin-catalogue.js +2 -2
- package/dist/react/admin-catalogue.js.map +1 -1
- package/dist/react/admin-consumption.d.ts +7 -2
- package/dist/react/admin-consumption.js +7 -2
- package/dist/react/admin-consumption.js.map +1 -1
- package/dist/react/admin-licenses.d.ts +2 -2
- package/dist/react/admin-licenses.js +2 -2
- package/dist/react/admin-licenses.js.map +1 -1
- package/dist/react/admin-patrons.d.ts +3 -3
- package/dist/react/admin-patrons.js +3 -3
- package/dist/react/admin-patrons.js.map +1 -1
- package/dist/react/admin-reviews.d.ts +2 -2
- package/dist/react/admin-reviews.js +2 -2
- package/dist/react/admin-reviews.js.map +1 -1
- package/dist/react/admin-roles.d.ts +3 -3
- package/dist/react/admin-roles.js +3 -3
- package/dist/react/admin-roles.js.map +1 -1
- package/dist/react/admin-support.d.ts +2 -2
- package/dist/react/admin-support.js +2 -2
- package/dist/react/admin-support.js.map +1 -1
- package/dist/react/admin-tenants.d.ts +35 -2
- package/dist/react/admin-tenants.js +45 -3
- package/dist/react/admin-tenants.js.map +1 -1
- package/dist/react/admin-tutoring.d.ts +2 -2
- package/dist/react/admin-tutoring.js +2 -2
- package/dist/react/admin-tutoring.js.map +1 -1
- package/dist/react/auth.d.ts +2 -2
- package/dist/react/auth.js +2 -2
- package/dist/react/auth.js.map +1 -1
- package/dist/react/biblio-catalogue.d.ts +2 -2
- package/dist/react/biblio-catalogue.js +2 -2
- package/dist/react/biblio-catalogue.js.map +1 -1
- package/dist/react/biblio-home.d.ts +2 -2
- package/dist/react/biblio-home.js +2 -2
- package/dist/react/biblio-home.js.map +1 -1
- package/dist/react/biblio-library.d.ts +2 -2
- package/dist/react/biblio-library.js +2 -2
- package/dist/react/biblio-library.js.map +1 -1
- package/dist/react/biblio-nextory.d.ts +2 -2
- package/dist/react/biblio-nextory.js +2 -2
- package/dist/react/biblio-nextory.js.map +1 -1
- package/dist/react/biblio-press.d.ts +2 -2
- package/dist/react/biblio-press.js +2 -2
- package/dist/react/biblio-press.js.map +1 -1
- package/dist/react/biblio-search.d.ts +2 -2
- package/dist/react/biblio-search.js +2 -2
- package/dist/react/biblio-search.js.map +1 -1
- package/dist/react/biblio-telemetry.d.ts +2 -2
- package/dist/react/biblio-telemetry.js +2 -2
- package/dist/react/biblio-telemetry.js.map +1 -1
- package/dist/react/chat.d.ts +36 -0
- package/dist/react/chat.js +234 -0
- package/dist/react/chat.js.map +1 -0
- package/dist/react/consumption.d.ts +2 -2
- package/dist/react/consumption.js +2 -2
- package/dist/react/consumption.js.map +1 -1
- package/dist/react/cvs-app.d.ts +2 -2
- package/dist/react/cvs-app.js +2 -2
- package/dist/react/cvs-app.js.map +1 -1
- package/dist/react/cvs-documents.d.ts +17 -4
- package/dist/react/cvs-documents.js +25 -8
- package/dist/react/cvs-documents.js.map +1 -1
- package/dist/react/cvs-favorites.d.ts +2 -2
- package/dist/react/cvs-favorites.js +2 -2
- package/dist/react/cvs-favorites.js.map +1 -1
- package/dist/react/cvs-ils.d.ts +552 -0
- package/dist/react/cvs-ils.js +822 -0
- package/dist/react/cvs-ils.js.map +1 -0
- package/dist/react/cvs-loans.d.ts +2 -2
- package/dist/react/cvs-loans.js +2 -2
- package/dist/react/cvs-loans.js.map +1 -1
- package/dist/react/cvs-payments.d.ts +123 -0
- package/dist/react/cvs-payments.js +181 -0
- package/dist/react/cvs-payments.js.map +1 -0
- package/dist/react/cvs-streaming.d.ts +2 -2
- package/dist/react/cvs-streaming.js +2 -2
- package/dist/react/cvs-streaming.js.map +1 -1
- package/dist/react/index.d.ts +5 -2
- package/dist/react/index.js +5 -2
- package/dist/react/partner-catalogue.d.ts +2 -2
- package/dist/react/partner-catalogue.js +2 -2
- package/dist/react/partner-catalogue.js.map +1 -1
- package/dist/react/partner-reader.d.ts +2 -2
- package/dist/react/partner-reader.js +2 -2
- package/dist/react/partner-reader.js.map +1 -1
- package/dist/react/profiles.d.ts +2 -2
- package/dist/react/profiles.js +2 -2
- package/dist/react/profiles.js.map +1 -1
- package/dist/react/search.d.ts +47 -0
- package/dist/react/search.js +81 -0
- package/dist/react/search.js.map +1 -0
- package/dist/react/sso.d.ts +15 -0
- package/dist/react/sso.js +48 -0
- package/dist/react/sso.js.map +1 -0
- package/dist/react/tutoring-catalogue.d.ts +2 -2
- package/dist/react/tutoring-catalogue.js +2 -2
- package/dist/react/tutoring-catalogue.js.map +1 -1
- package/dist/react/tutoring-chat.d.ts +2 -2
- package/dist/react/tutoring-chat.js +2 -2
- 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 +2 -2
- package/dist/react/tutoring-practitioner.js +2 -2
- package/dist/react/tutoring-practitioner.js.map +1 -1
- package/dist/react/tutoring-requests.d.ts +2 -2
- package/dist/react/tutoring-requests.js +2 -2
- package/dist/react/tutoring-requests.js.map +1 -1
- package/package.json +29 -1
- package/dist/client-D3kMOcIr.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"biblio-library.js","names":[],"sources":["../../src/react/biblio-library/biblio-library.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.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 CategoryListRead,\n CategoryPreferencesWrite,\n FavoriteAddWrite,\n FavoritePage,\n HTTPExceptionResponse,\n HistoryPage,\n ListBiblioFavoritesParams,\n ListHistoryParams,\n PackListRead,\n PreferencesRead,\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 getListBiblioCategoriesUrl = () => {\n\n\n\n\n return `/biblio/me/categories`\n}\n\n/**\n * The categories this account can reach (E26).\n *\n * Two independent gates, and both have to pass. Entitlement answers \"did the\n * company buy this\"; ``access_level`` answers \"is this person allowed it\" — an\n * ordinal on the account compared against one on the category, which is how a\n * child profile is kept out of the adult catalogue. Neither substitutes for the\n * other.\n * @summary List Biblio Categories\n */\nexport const listBiblioCategories = async ( options?: Parameters<typeof request>[1]): Promise<CategoryListRead> => {\n\n return request<CategoryListRead>(getListBiblioCategoriesUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getListBiblioCategoriesQueryKey = () => {\n return [\n `/biblio/me/categories`\n ] as const;\n }\n\n\nexport const getListBiblioCategoriesQueryOptions = <TData = Awaited<ReturnType<typeof listBiblioCategories>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listBiblioCategories>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getListBiblioCategoriesQueryKey();\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof listBiblioCategories>>> = ({ signal }) => listBiblioCategories({ signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listBiblioCategories>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ListBiblioCategoriesQueryResult = NonNullable<Awaited<ReturnType<typeof listBiblioCategories>>>\nexport type ListBiblioCategoriesQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useListBiblioCategories<TData = Awaited<ReturnType<typeof listBiblioCategories>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listBiblioCategories>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof listBiblioCategories>>,\n TError,\n Awaited<ReturnType<typeof listBiblioCategories>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListBiblioCategories<TData = Awaited<ReturnType<typeof listBiblioCategories>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listBiblioCategories>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof listBiblioCategories>>,\n TError,\n Awaited<ReturnType<typeof listBiblioCategories>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListBiblioCategories<TData = Awaited<ReturnType<typeof listBiblioCategories>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listBiblioCategories>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary List Biblio Categories\n */\n\nexport function useListBiblioCategories<TData = Awaited<ReturnType<typeof listBiblioCategories>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listBiblioCategories>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getListBiblioCategoriesQueryOptions(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 getListBiblioFavoritesUrl = (params?: ListBiblioFavoritesParams,) => {\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 ? `/biblio/me/favorites?${stringifiedParams}` : `/biblio/me/favorites`\n}\n\n/**\n * The caller's favourites (E30), newest first.\n * @summary List Biblio Favorites\n */\nexport const listBiblioFavorites = async (params?: ListBiblioFavoritesParams, options?: Parameters<typeof request>[1]): Promise<FavoritePage> => {\n\n return request<FavoritePage>(getListBiblioFavoritesUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getListBiblioFavoritesQueryKey = (params?: ListBiblioFavoritesParams,) => {\n return [\n `/biblio/me/favorites`, ...(params ? [params] : [])\n ] as const;\n }\n\n\nexport const getListBiblioFavoritesQueryOptions = <TData = Awaited<ReturnType<typeof listBiblioFavorites>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params?: ListBiblioFavoritesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listBiblioFavorites>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getListBiblioFavoritesQueryKey(params);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof listBiblioFavorites>>> = ({ signal }) => listBiblioFavorites(params, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listBiblioFavorites>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ListBiblioFavoritesQueryResult = NonNullable<Awaited<ReturnType<typeof listBiblioFavorites>>>\nexport type ListBiblioFavoritesQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useListBiblioFavorites<TData = Awaited<ReturnType<typeof listBiblioFavorites>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params: undefined | ListBiblioFavoritesParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listBiblioFavorites>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof listBiblioFavorites>>,\n TError,\n Awaited<ReturnType<typeof listBiblioFavorites>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListBiblioFavorites<TData = Awaited<ReturnType<typeof listBiblioFavorites>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListBiblioFavoritesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listBiblioFavorites>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof listBiblioFavorites>>,\n TError,\n Awaited<ReturnType<typeof listBiblioFavorites>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListBiblioFavorites<TData = Awaited<ReturnType<typeof listBiblioFavorites>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListBiblioFavoritesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listBiblioFavorites>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary List Biblio Favorites\n */\n\nexport function useListBiblioFavorites<TData = Awaited<ReturnType<typeof listBiblioFavorites>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListBiblioFavoritesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listBiblioFavorites>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getListBiblioFavoritesQueryOptions(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 getRemoveBiblioFavoriteUrl = (contentId: number,) => {\n\n\n\n\n return `/biblio/me/favorites/${contentId}`\n}\n\n/**\n * Remove a favourite (E32). Idempotent — absent is already the desired state.\n * @summary Remove Biblio Favorite\n */\nexport const removeBiblioFavorite = async (contentId: number, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getRemoveBiblioFavoriteUrl(contentId),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\n\n\n\nexport const getRemoveBiblioFavoriteMutationKey = () => ['removeBiblioFavorite'] as const;\n\nexport const getRemoveBiblioFavoriteMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof removeBiblioFavorite>>, TError,RemoveBiblioFavoriteMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof removeBiblioFavorite>>, TError,RemoveBiblioFavoriteMutationVariables, TContext> => {\n\nconst mutationKey = getRemoveBiblioFavoriteMutationKey();\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 removeBiblioFavorite>>, RemoveBiblioFavoriteMutationVariables> = (props) => {\n const {contentId} = props ?? {};\n\n return removeBiblioFavorite(contentId,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type RemoveBiblioFavoriteMutationResult = NonNullable<Awaited<ReturnType<typeof removeBiblioFavorite>>>\n\n export type RemoveBiblioFavoriteMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type RemoveBiblioFavoriteMutationVariables = {contentId: number}\n\n /**\n * @summary Remove Biblio Favorite\n */\nexport const useRemoveBiblioFavorite = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof removeBiblioFavorite>>, TError,RemoveBiblioFavoriteMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof removeBiblioFavorite>>,\n TError,\n RemoveBiblioFavoriteMutationVariables,\n TContext\n > => {\n return useMutation(getRemoveBiblioFavoriteMutationOptions(options), queryClient);\n }\n export const getAddBiblioFavoriteUrl = (contentId: number,) => {\n\n\n\n\n return `/biblio/me/favorites/${contentId}`\n}\n\n/**\n * Mark content as a favourite (E31). Idempotent.\n *\n * ``PUT`` and :func:`remove_favorite`'s ``DELETE`` replace one\n * ``POST /favorites`` carrying an ``enabled`` boolean — the verb encoded as\n * data. A retry after a timeout reversed the user's intent; a repeated ``PUT``\n * cannot (§4, consequence 3).\n *\n * Favouriting is not consumption, so it is not entitlement-gated: a member may\n * bookmark something their library has not licensed *yet*. Reaching the content\n * is gated, at the point of reaching it.\n * @summary Add Biblio Favorite\n */\nexport const addBiblioFavorite = async (contentId: number,\n favoriteAddWrite: FavoriteAddWrite, 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>(getAddBiblioFavoriteUrl(contentId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(favoriteAddWrite)\n }\n);}\n\n\n\n\n\nexport const getAddBiblioFavoriteMutationKey = () => ['addBiblioFavorite'] as const;\n\nexport const getAddBiblioFavoriteMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addBiblioFavorite>>, TError,AddBiblioFavoriteMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof addBiblioFavorite>>, TError,AddBiblioFavoriteMutationVariables, TContext> => {\n\nconst mutationKey = getAddBiblioFavoriteMutationKey();\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 addBiblioFavorite>>, AddBiblioFavoriteMutationVariables> = (props) => {\n const {contentId,data} = props ?? {};\n\n return addBiblioFavorite(contentId,data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type AddBiblioFavoriteMutationResult = NonNullable<Awaited<ReturnType<typeof addBiblioFavorite>>>\n export type AddBiblioFavoriteMutationBody = BodyType<FavoriteAddWrite>\n export type AddBiblioFavoriteMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type AddBiblioFavoriteMutationVariables = {contentId: number;data: BodyType<FavoriteAddWrite>}\n\n /**\n * @summary Add Biblio Favorite\n */\nexport const useAddBiblioFavorite = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addBiblioFavorite>>, TError,AddBiblioFavoriteMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof addBiblioFavorite>>,\n TError,\n AddBiblioFavoriteMutationVariables,\n TContext\n > => {\n return useMutation(getAddBiblioFavoriteMutationOptions(options), queryClient);\n }\n export const getListHistoryUrl = (params?: ListHistoryParams,) => {\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 ? `/biblio/me/history?${stringifiedParams}` : `/biblio/me/history`\n}\n\n/**\n * What this account has consumed, most recent first (E33).\n *\n * One row per content item, not one per view: the caller wants \"what have I\n * been reading\", and ``consumption_event`` is append-only with a row per act.\n * The last access is therefore a MAX, and progress comes from\n * ``content_progress``, which is LEFT JOINed because an absent row means \"not\n * started\" rather than zero.\n * @summary List History\n */\nexport const listHistory = async (params?: ListHistoryParams, options?: Parameters<typeof request>[1]): Promise<HistoryPage> => {\n\n return request<HistoryPage>(getListHistoryUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getListHistoryQueryKey = (params?: ListHistoryParams,) => {\n return [\n `/biblio/me/history`, ...(params ? [params] : [])\n ] as const;\n }\n\n\nexport const getListHistoryQueryOptions = <TData = Awaited<ReturnType<typeof listHistory>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params?: ListHistoryParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listHistory>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getListHistoryQueryKey(params);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof listHistory>>> = ({ signal }) => listHistory(params, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listHistory>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ListHistoryQueryResult = NonNullable<Awaited<ReturnType<typeof listHistory>>>\nexport type ListHistoryQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useListHistory<TData = Awaited<ReturnType<typeof listHistory>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params: undefined | ListHistoryParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listHistory>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof listHistory>>,\n TError,\n Awaited<ReturnType<typeof listHistory>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListHistory<TData = Awaited<ReturnType<typeof listHistory>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListHistoryParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listHistory>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof listHistory>>,\n TError,\n Awaited<ReturnType<typeof listHistory>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListHistory<TData = Awaited<ReturnType<typeof listHistory>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListHistoryParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listHistory>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary List History\n */\n\nexport function useListHistory<TData = Awaited<ReturnType<typeof listHistory>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListHistoryParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listHistory>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getListHistoryQueryOptions(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 getListPacksUrl = () => {\n\n\n\n\n return `/biblio/me/packs`\n}\n\n/**\n * The content packs this account can navigate (E25).\n *\n * A pack is a :class:`~app.models.biblio.catalogue.CatalogSection`, and one is\n * reachable when the contract reaches at least one category inside it. Deriving\n * it that way rather than granting packs directly means a pack cannot advertise\n * itself while every category under it is out of contract.\n *\n * Empty is a correct answer, not a broken one: an account whose contract has\n * lapsed reaches nothing.\n * @summary List Packs\n */\nexport const listPacks = async ( options?: Parameters<typeof request>[1]): Promise<PackListRead> => {\n\n return request<PackListRead>(getListPacksUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getListPacksQueryKey = () => {\n return [\n `/biblio/me/packs`\n ] as const;\n }\n\n\nexport const getListPacksQueryOptions = <TData = Awaited<ReturnType<typeof listPacks>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listPacks>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getListPacksQueryKey();\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof listPacks>>> = ({ signal }) => listPacks({ signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listPacks>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ListPacksQueryResult = NonNullable<Awaited<ReturnType<typeof listPacks>>>\nexport type ListPacksQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useListPacks<TData = Awaited<ReturnType<typeof listPacks>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listPacks>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof listPacks>>,\n TError,\n Awaited<ReturnType<typeof listPacks>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListPacks<TData = Awaited<ReturnType<typeof listPacks>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listPacks>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof listPacks>>,\n TError,\n Awaited<ReturnType<typeof listPacks>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListPacks<TData = Awaited<ReturnType<typeof listPacks>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listPacks>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary List Packs\n */\n\nexport function useListPacks<TData = Awaited<ReturnType<typeof listPacks>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listPacks>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getListPacksQueryOptions(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 getReadPreferencesUrl = () => {\n\n\n\n\n return `/biblio/me/preferences`\n}\n\n/**\n * The caller's own preferences (E28).\n *\n * An object with one key rather than a bare array, so a second preference can\n * be added later without breaking every client.\n * @summary Read Preferences\n */\nexport const readPreferences = async ( options?: Parameters<typeof request>[1]): Promise<PreferencesRead> => {\n\n return request<PreferencesRead>(getReadPreferencesUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getReadPreferencesQueryKey = () => {\n return [\n `/biblio/me/preferences`\n ] as const;\n }\n\n\nexport const getReadPreferencesQueryOptions = <TData = Awaited<ReturnType<typeof readPreferences>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPreferences>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getReadPreferencesQueryKey();\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof readPreferences>>> = ({ signal }) => readPreferences({ signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof readPreferences>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ReadPreferencesQueryResult = NonNullable<Awaited<ReturnType<typeof readPreferences>>>\nexport type ReadPreferencesQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useReadPreferences<TData = Awaited<ReturnType<typeof readPreferences>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPreferences>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof readPreferences>>,\n TError,\n Awaited<ReturnType<typeof readPreferences>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadPreferences<TData = Awaited<ReturnType<typeof readPreferences>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPreferences>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof readPreferences>>,\n TError,\n Awaited<ReturnType<typeof readPreferences>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadPreferences<TData = Awaited<ReturnType<typeof readPreferences>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPreferences>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Read Preferences\n */\n\nexport function useReadPreferences<TData = Awaited<ReturnType<typeof readPreferences>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPreferences>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getReadPreferencesQueryOptions(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 getReplaceCategoryPreferencesUrl = () => {\n\n\n\n\n return `/biblio/me/preferences/categories`\n}\n\n/**\n * Replace the favourite-category set wholesale (E29).\n *\n * ``PUT`` because the legacy handler already replaced the whole set; the verb\n * now says so. An empty array clears the set and is valid input — the legacy\n * left that path uncaught and returned ``500``.\n *\n * A category the account cannot reach is ``422``, listing the offending ids.\n * Silently dropping them would leave the client believing it had saved\n * something it had not.\n * @summary Replace Category Preferences\n */\nexport const replaceCategoryPreferences = async (categoryPreferencesWrite: CategoryPreferencesWrite, 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>(getReplaceCategoryPreferencesUrl(),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(categoryPreferencesWrite)\n }\n);}\n\n\n\n\n\nexport const getReplaceCategoryPreferencesMutationKey = () => ['replaceCategoryPreferences'] as const;\n\nexport const getReplaceCategoryPreferencesMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof replaceCategoryPreferences>>, TError,ReplaceCategoryPreferencesMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof replaceCategoryPreferences>>, TError,ReplaceCategoryPreferencesMutationVariables, TContext> => {\n\nconst mutationKey = getReplaceCategoryPreferencesMutationKey();\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 replaceCategoryPreferences>>, ReplaceCategoryPreferencesMutationVariables> = (props) => {\n const {data} = props ?? {};\n\n return replaceCategoryPreferences(data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type ReplaceCategoryPreferencesMutationResult = NonNullable<Awaited<ReturnType<typeof replaceCategoryPreferences>>>\n export type ReplaceCategoryPreferencesMutationBody = BodyType<CategoryPreferencesWrite>\n export type ReplaceCategoryPreferencesMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type ReplaceCategoryPreferencesMutationVariables = {data: BodyType<CategoryPreferencesWrite>}\n\n /**\n * @summary Replace Category Preferences\n */\nexport const useReplaceCategoryPreferences = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof replaceCategoryPreferences>>, TError,ReplaceCategoryPreferencesMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof replaceCategoryPreferences>>,\n TError,\n ReplaceCategoryPreferencesMutationVariables,\n TContext\n > => {\n return useMutation(getReplaceCategoryPreferencesMutationOptions(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,mCAAmC;CAK9C,OAAO;AACT;;;;;;;;;;;AAYA,MAAa,uBAAuB,OAAQ,YAAuE;CAEjH,OAAO,QAA0B,2BAA2B,GAC5D;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAMF,MAAa,wCAAwC;CACjD,OAAO,CACP,uBACA;AACA;AAGJ,MAAa,uCAAuK,YAC/K;CAEL,MAAM,EAAC,OAAO,cAAc,SAAS,mBAAkB,WAAW,CAAC;CAEjE,MAAM,WAAY,cAAc,YAAY,gCAAgC;CAI1E,MAAM,WAA4E,EAAE,aAAa,qBAAqB;EAAE;EAAQ,GAAG;CAAe,CAAC;CAMpJ,OAAQ;EAAE;EAAU;EAAS,GAAG;CAAY;AAC/C;;;;AAkCA,SAAgB,wBACd,SACC,aACiF;CAElF,MAAM,eAAe,oCAAoC,OAAO;CAEhE,MAAM,QAAQ,SAAS,cAAc,WAAW;CAEhD,OAAO,aAAa,OAAO,aAAa,QAAQ;AAClD;AAOA,MAAa,6BAA6B,WAAwC;CAChF,MAAM,mBAAmB,IAAI,gBAAgB;CAE7C,OAAO,QAAQ,UAAU,CAAC,CAAC,CA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,MAAa,iCACW,SACrB,gBAKQ;CACL,OAAO,YAAY,6CAA6C,OAAO,GAAG,WAAW;AACvF"}
|
|
1
|
+
{"version":3,"file":"biblio-library.js","names":[],"sources":["../../src/react/biblio-library/biblio-library.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.3.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 CategoryListRead,\n CategoryPreferencesWrite,\n FavoriteAddWrite,\n FavoritePage,\n HTTPExceptionResponse,\n HistoryPage,\n ListBiblioFavoritesParams,\n ListHistoryParams,\n PackListRead,\n PreferencesRead,\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 getListBiblioCategoriesUrl = () => {\n\n\n\n\n return `/biblio/me/categories`\n}\n\n/**\n * The categories this account can reach (E26).\n *\n * Two independent gates, and both have to pass. Entitlement answers \"did the\n * company buy this\"; ``access_level`` answers \"is this person allowed it\" — an\n * ordinal on the account compared against one on the category, which is how a\n * child profile is kept out of the adult catalogue. Neither substitutes for the\n * other.\n * @summary List Biblio Categories\n */\nexport const listBiblioCategories = async ( options?: Parameters<typeof request>[1]): Promise<CategoryListRead> => {\n\n return request<CategoryListRead>(getListBiblioCategoriesUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getListBiblioCategoriesQueryKey = () => {\n return [\n `/biblio/me/categories`\n ] as const;\n }\n\n\nexport const getListBiblioCategoriesQueryOptions = <TData = Awaited<ReturnType<typeof listBiblioCategories>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listBiblioCategories>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getListBiblioCategoriesQueryKey();\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof listBiblioCategories>>> = ({ signal }) => listBiblioCategories({ signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listBiblioCategories>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ListBiblioCategoriesQueryResult = NonNullable<Awaited<ReturnType<typeof listBiblioCategories>>>\nexport type ListBiblioCategoriesQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useListBiblioCategories<TData = Awaited<ReturnType<typeof listBiblioCategories>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listBiblioCategories>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof listBiblioCategories>>,\n TError,\n Awaited<ReturnType<typeof listBiblioCategories>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListBiblioCategories<TData = Awaited<ReturnType<typeof listBiblioCategories>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listBiblioCategories>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof listBiblioCategories>>,\n TError,\n Awaited<ReturnType<typeof listBiblioCategories>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListBiblioCategories<TData = Awaited<ReturnType<typeof listBiblioCategories>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listBiblioCategories>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary List Biblio Categories\n */\n\nexport function useListBiblioCategories<TData = Awaited<ReturnType<typeof listBiblioCategories>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listBiblioCategories>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getListBiblioCategoriesQueryOptions(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 getListBiblioFavoritesUrl = (params?: ListBiblioFavoritesParams,) => {\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 ? `/biblio/me/favorites?${stringifiedParams}` : `/biblio/me/favorites`\n}\n\n/**\n * The caller's favourites (E30), newest first.\n * @summary List Biblio Favorites\n */\nexport const listBiblioFavorites = async (params?: ListBiblioFavoritesParams, options?: Parameters<typeof request>[1]): Promise<FavoritePage> => {\n\n return request<FavoritePage>(getListBiblioFavoritesUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getListBiblioFavoritesQueryKey = (params?: ListBiblioFavoritesParams,) => {\n return [\n `/biblio/me/favorites`, ...(params ? [params] : [])\n ] as const;\n }\n\n\nexport const getListBiblioFavoritesQueryOptions = <TData = Awaited<ReturnType<typeof listBiblioFavorites>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params?: ListBiblioFavoritesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listBiblioFavorites>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getListBiblioFavoritesQueryKey(params);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof listBiblioFavorites>>> = ({ signal }) => listBiblioFavorites(params, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listBiblioFavorites>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ListBiblioFavoritesQueryResult = NonNullable<Awaited<ReturnType<typeof listBiblioFavorites>>>\nexport type ListBiblioFavoritesQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useListBiblioFavorites<TData = Awaited<ReturnType<typeof listBiblioFavorites>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params: undefined | ListBiblioFavoritesParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listBiblioFavorites>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof listBiblioFavorites>>,\n TError,\n Awaited<ReturnType<typeof listBiblioFavorites>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListBiblioFavorites<TData = Awaited<ReturnType<typeof listBiblioFavorites>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListBiblioFavoritesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listBiblioFavorites>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof listBiblioFavorites>>,\n TError,\n Awaited<ReturnType<typeof listBiblioFavorites>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListBiblioFavorites<TData = Awaited<ReturnType<typeof listBiblioFavorites>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListBiblioFavoritesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listBiblioFavorites>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary List Biblio Favorites\n */\n\nexport function useListBiblioFavorites<TData = Awaited<ReturnType<typeof listBiblioFavorites>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListBiblioFavoritesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listBiblioFavorites>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getListBiblioFavoritesQueryOptions(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 getRemoveBiblioFavoriteUrl = (contentId: number,) => {\n\n\n\n\n return `/biblio/me/favorites/${contentId}`\n}\n\n/**\n * Remove a favourite (E32). Idempotent — absent is already the desired state.\n * @summary Remove Biblio Favorite\n */\nexport const removeBiblioFavorite = async (contentId: number, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getRemoveBiblioFavoriteUrl(contentId),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\n\n\n\nexport const getRemoveBiblioFavoriteMutationKey = () => ['removeBiblioFavorite'] as const;\n\nexport const getRemoveBiblioFavoriteMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof removeBiblioFavorite>>, TError,RemoveBiblioFavoriteMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof removeBiblioFavorite>>, TError,RemoveBiblioFavoriteMutationVariables, TContext> => {\n\nconst mutationKey = getRemoveBiblioFavoriteMutationKey();\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 removeBiblioFavorite>>, RemoveBiblioFavoriteMutationVariables> = (props) => {\n const {contentId} = props ?? {};\n\n return removeBiblioFavorite(contentId,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type RemoveBiblioFavoriteMutationResult = NonNullable<Awaited<ReturnType<typeof removeBiblioFavorite>>>\n\n export type RemoveBiblioFavoriteMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type RemoveBiblioFavoriteMutationVariables = {contentId: number}\n\n /**\n * @summary Remove Biblio Favorite\n */\nexport const useRemoveBiblioFavorite = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof removeBiblioFavorite>>, TError,RemoveBiblioFavoriteMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof removeBiblioFavorite>>,\n TError,\n RemoveBiblioFavoriteMutationVariables,\n TContext\n > => {\n return useMutation(getRemoveBiblioFavoriteMutationOptions(options), queryClient);\n }\n export const getAddBiblioFavoriteUrl = (contentId: number,) => {\n\n\n\n\n return `/biblio/me/favorites/${contentId}`\n}\n\n/**\n * Mark content as a favourite (E31). Idempotent.\n *\n * ``PUT`` and :func:`remove_favorite`'s ``DELETE`` replace one\n * ``POST /favorites`` carrying an ``enabled`` boolean — the verb encoded as\n * data. A retry after a timeout reversed the user's intent; a repeated ``PUT``\n * cannot (§4, consequence 3).\n *\n * Favouriting is not consumption, so it is not entitlement-gated: a member may\n * bookmark something their library has not licensed *yet*. Reaching the content\n * is gated, at the point of reaching it.\n * @summary Add Biblio Favorite\n */\nexport const addBiblioFavorite = async (contentId: number,\n favoriteAddWrite: FavoriteAddWrite, 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>(getAddBiblioFavoriteUrl(contentId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(favoriteAddWrite)\n }\n);}\n\n\n\n\n\nexport const getAddBiblioFavoriteMutationKey = () => ['addBiblioFavorite'] as const;\n\nexport const getAddBiblioFavoriteMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addBiblioFavorite>>, TError,AddBiblioFavoriteMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof addBiblioFavorite>>, TError,AddBiblioFavoriteMutationVariables, TContext> => {\n\nconst mutationKey = getAddBiblioFavoriteMutationKey();\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 addBiblioFavorite>>, AddBiblioFavoriteMutationVariables> = (props) => {\n const {contentId,data} = props ?? {};\n\n return addBiblioFavorite(contentId,data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type AddBiblioFavoriteMutationResult = NonNullable<Awaited<ReturnType<typeof addBiblioFavorite>>>\n export type AddBiblioFavoriteMutationBody = BodyType<FavoriteAddWrite>\n export type AddBiblioFavoriteMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type AddBiblioFavoriteMutationVariables = {contentId: number;data: BodyType<FavoriteAddWrite>}\n\n /**\n * @summary Add Biblio Favorite\n */\nexport const useAddBiblioFavorite = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addBiblioFavorite>>, TError,AddBiblioFavoriteMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof addBiblioFavorite>>,\n TError,\n AddBiblioFavoriteMutationVariables,\n TContext\n > => {\n return useMutation(getAddBiblioFavoriteMutationOptions(options), queryClient);\n }\n export const getListHistoryUrl = (params?: ListHistoryParams,) => {\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 ? `/biblio/me/history?${stringifiedParams}` : `/biblio/me/history`\n}\n\n/**\n * What this account has consumed, most recent first (E33).\n *\n * One row per content item, not one per view: the caller wants \"what have I\n * been reading\", and ``consumption_event`` is append-only with a row per act.\n * The last access is therefore a MAX, and progress comes from\n * ``content_progress``, which is LEFT JOINed because an absent row means \"not\n * started\" rather than zero.\n * @summary List History\n */\nexport const listHistory = async (params?: ListHistoryParams, options?: Parameters<typeof request>[1]): Promise<HistoryPage> => {\n\n return request<HistoryPage>(getListHistoryUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getListHistoryQueryKey = (params?: ListHistoryParams,) => {\n return [\n `/biblio/me/history`, ...(params ? [params] : [])\n ] as const;\n }\n\n\nexport const getListHistoryQueryOptions = <TData = Awaited<ReturnType<typeof listHistory>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params?: ListHistoryParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listHistory>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getListHistoryQueryKey(params);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof listHistory>>> = ({ signal }) => listHistory(params, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listHistory>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ListHistoryQueryResult = NonNullable<Awaited<ReturnType<typeof listHistory>>>\nexport type ListHistoryQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useListHistory<TData = Awaited<ReturnType<typeof listHistory>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params: undefined | ListHistoryParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listHistory>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof listHistory>>,\n TError,\n Awaited<ReturnType<typeof listHistory>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListHistory<TData = Awaited<ReturnType<typeof listHistory>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListHistoryParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listHistory>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof listHistory>>,\n TError,\n Awaited<ReturnType<typeof listHistory>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListHistory<TData = Awaited<ReturnType<typeof listHistory>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListHistoryParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listHistory>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary List History\n */\n\nexport function useListHistory<TData = Awaited<ReturnType<typeof listHistory>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListHistoryParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listHistory>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getListHistoryQueryOptions(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 getListPacksUrl = () => {\n\n\n\n\n return `/biblio/me/packs`\n}\n\n/**\n * The content packs this account can navigate (E25).\n *\n * A pack is a :class:`~app.models.biblio.catalogue.CatalogSection`, and one is\n * reachable when the contract reaches at least one category inside it. Deriving\n * it that way rather than granting packs directly means a pack cannot advertise\n * itself while every category under it is out of contract.\n *\n * Empty is a correct answer, not a broken one: an account whose contract has\n * lapsed reaches nothing.\n * @summary List Packs\n */\nexport const listPacks = async ( options?: Parameters<typeof request>[1]): Promise<PackListRead> => {\n\n return request<PackListRead>(getListPacksUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getListPacksQueryKey = () => {\n return [\n `/biblio/me/packs`\n ] as const;\n }\n\n\nexport const getListPacksQueryOptions = <TData = Awaited<ReturnType<typeof listPacks>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listPacks>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getListPacksQueryKey();\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof listPacks>>> = ({ signal }) => listPacks({ signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listPacks>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ListPacksQueryResult = NonNullable<Awaited<ReturnType<typeof listPacks>>>\nexport type ListPacksQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useListPacks<TData = Awaited<ReturnType<typeof listPacks>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listPacks>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof listPacks>>,\n TError,\n Awaited<ReturnType<typeof listPacks>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListPacks<TData = Awaited<ReturnType<typeof listPacks>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listPacks>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof listPacks>>,\n TError,\n Awaited<ReturnType<typeof listPacks>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListPacks<TData = Awaited<ReturnType<typeof listPacks>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listPacks>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary List Packs\n */\n\nexport function useListPacks<TData = Awaited<ReturnType<typeof listPacks>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listPacks>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getListPacksQueryOptions(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 getReadPreferencesUrl = () => {\n\n\n\n\n return `/biblio/me/preferences`\n}\n\n/**\n * The caller's own preferences (E28).\n *\n * An object with one key rather than a bare array, so a second preference can\n * be added later without breaking every client.\n * @summary Read Preferences\n */\nexport const readPreferences = async ( options?: Parameters<typeof request>[1]): Promise<PreferencesRead> => {\n\n return request<PreferencesRead>(getReadPreferencesUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getReadPreferencesQueryKey = () => {\n return [\n `/biblio/me/preferences`\n ] as const;\n }\n\n\nexport const getReadPreferencesQueryOptions = <TData = Awaited<ReturnType<typeof readPreferences>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPreferences>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getReadPreferencesQueryKey();\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof readPreferences>>> = ({ signal }) => readPreferences({ signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof readPreferences>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ReadPreferencesQueryResult = NonNullable<Awaited<ReturnType<typeof readPreferences>>>\nexport type ReadPreferencesQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useReadPreferences<TData = Awaited<ReturnType<typeof readPreferences>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPreferences>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof readPreferences>>,\n TError,\n Awaited<ReturnType<typeof readPreferences>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadPreferences<TData = Awaited<ReturnType<typeof readPreferences>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPreferences>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof readPreferences>>,\n TError,\n Awaited<ReturnType<typeof readPreferences>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadPreferences<TData = Awaited<ReturnType<typeof readPreferences>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPreferences>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Read Preferences\n */\n\nexport function useReadPreferences<TData = Awaited<ReturnType<typeof readPreferences>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPreferences>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getReadPreferencesQueryOptions(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 getReplaceCategoryPreferencesUrl = () => {\n\n\n\n\n return `/biblio/me/preferences/categories`\n}\n\n/**\n * Replace the favourite-category set wholesale (E29).\n *\n * ``PUT`` because the legacy handler already replaced the whole set; the verb\n * now says so. An empty array clears the set and is valid input — the legacy\n * left that path uncaught and returned ``500``.\n *\n * A category the account cannot reach is ``422``, listing the offending ids.\n * Silently dropping them would leave the client believing it had saved\n * something it had not.\n * @summary Replace Category Preferences\n */\nexport const replaceCategoryPreferences = async (categoryPreferencesWrite: CategoryPreferencesWrite, 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>(getReplaceCategoryPreferencesUrl(),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(categoryPreferencesWrite)\n }\n);}\n\n\n\n\n\nexport const getReplaceCategoryPreferencesMutationKey = () => ['replaceCategoryPreferences'] as const;\n\nexport const getReplaceCategoryPreferencesMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof replaceCategoryPreferences>>, TError,ReplaceCategoryPreferencesMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof replaceCategoryPreferences>>, TError,ReplaceCategoryPreferencesMutationVariables, TContext> => {\n\nconst mutationKey = getReplaceCategoryPreferencesMutationKey();\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 replaceCategoryPreferences>>, ReplaceCategoryPreferencesMutationVariables> = (props) => {\n const {data} = props ?? {};\n\n return replaceCategoryPreferences(data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type ReplaceCategoryPreferencesMutationResult = NonNullable<Awaited<ReturnType<typeof replaceCategoryPreferences>>>\n export type ReplaceCategoryPreferencesMutationBody = BodyType<CategoryPreferencesWrite>\n export type ReplaceCategoryPreferencesMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type ReplaceCategoryPreferencesMutationVariables = {data: BodyType<CategoryPreferencesWrite>}\n\n /**\n * @summary Replace Category Preferences\n */\nexport const useReplaceCategoryPreferences = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof replaceCategoryPreferences>>, TError,ReplaceCategoryPreferencesMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof replaceCategoryPreferences>>,\n TError,\n ReplaceCategoryPreferencesMutationVariables,\n TContext\n > => {\n return useMutation(getReplaceCategoryPreferencesMutationOptions(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,mCAAmC;CAK9C,OAAO;AACT;;;;;;;;;;;AAYA,MAAa,uBAAuB,OAAQ,YAAuE;CAEjH,O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GACpD;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,wBAAwB;CAC/C,CACF;AAAE;AAMF,MAAa,iDAAiD,CAAC,4BAA4B;AAE3F,MAAa,gDACW,YACuH;CAE/I,MAAM,cAAc,yCAAyC;CAC7D,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,cAAqI,UAAU;EACjJ,MAAM,EAAC,SAAQ,SAAS,CAAC;EAEzB,OAAQ,2BAA2B,MAAK,cAAc;CACxD;CAON,OAAQ;EAAE;EAAY,GAAG;CAAgB;AAAC;;;;AAU5C,MAAa,iCACW,SACrB,gBAKQ;CACL,OAAO,YAAY,6CAA6C,OAAO,GAAG,WAAW;AACvF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import { a as ErrorType, c as request } from "../client
|
|
2
|
+
import { Cr as HTTPExceptionResponse, Kn as LicenseRead, t as ValidationErrorResponse } from "../chunks/index.js";
|
|
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/biblio-nextory/biblio-nextory.d.ts
|
|
6
6
|
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { r as request } from "../client
|
|
2
|
+
import { r as request } from "../chunks/client.js";
|
|
3
3
|
import { useMutation, useQuery } from "@tanstack/react-query";
|
|
4
4
|
//#region src/react/biblio-nextory/biblio-nextory.ts
|
|
5
5
|
/**
|
|
@@ -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.3.2
|
|
11
11
|
*/
|
|
12
12
|
const withQueryKey = (query, queryKey) => {
|
|
13
13
|
const result = { queryKey };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"biblio-nextory.js","names":[],"sources":["../../src/react/biblio-nextory/biblio-nextory.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.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 LicenseRead,\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 getDeleteLicenseUrl = () => {\n\n\n\n\n return `/biblio/me/nextory/license`\n}\n\n/**\n * Release this member's seat back to the household pool.\n *\n * Not in the legacy's member surface — releasing was staff-only, so a household\n * at its cap had to call support. The seat stays claimed by this member rather\n * than orphaned, so their next allocation gets the same number back and their\n * reading positions with it.\n *\n * ``204`` whether or not a licence was held: the desired end state is \"no\n * seat\", and reporting ``404`` would only tell a caller something they cannot\n * act on.\n * @summary Delete License\n */\nexport const deleteLicense = async ( options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getDeleteLicenseUrl(),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\n\n\n\nexport const getDeleteLicenseMutationKey = () => ['deleteLicense'] as const;\n\nexport const getDeleteLicenseMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteLicense>>, TError,void, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof deleteLicense>>, TError,void, TContext> => {\n\nconst mutationKey = getDeleteLicenseMutationKey();\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 deleteLicense>>, void> = () => {\n\n\n return deleteLicense(requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DeleteLicenseMutationResult = NonNullable<Awaited<ReturnType<typeof deleteLicense>>>\n\n export type DeleteLicenseMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\n /**\n * @summary Delete License\n */\nexport const useDeleteLicense = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteLicense>>, TError,void, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof deleteLicense>>,\n TError,\n void,\n TContext\n > => {\n return useMutation(getDeleteLicenseMutationOptions(options), queryClient);\n }\n export const getReadLicenseUrl = () => {\n\n\n\n\n return `/biblio/me/nextory/license`\n}\n\n/**\n * The seat this member holds (E49). ``404`` when they hold none.\n *\n * Safe, and that is the entire point of the endpoint existing separately.\n * @summary Read License\n */\nexport const readLicense = async ( options?: Parameters<typeof request>[1]): Promise<LicenseRead> => {\n\n return request<LicenseRead>(getReadLicenseUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getReadLicenseQueryKey = () => {\n return [\n `/biblio/me/nextory/license`\n ] as const;\n }\n\n\nexport const getReadLicenseQueryOptions = <TData = Awaited<ReturnType<typeof readLicense>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readLicense>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getReadLicenseQueryKey();\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof readLicense>>> = ({ signal }) => readLicense({ signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof readLicense>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ReadLicenseQueryResult = NonNullable<Awaited<ReturnType<typeof readLicense>>>\nexport type ReadLicenseQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useReadLicense<TData = Awaited<ReturnType<typeof readLicense>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof readLicense>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof readLicense>>,\n TError,\n Awaited<ReturnType<typeof readLicense>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadLicense<TData = Awaited<ReturnType<typeof readLicense>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readLicense>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof readLicense>>,\n TError,\n Awaited<ReturnType<typeof readLicense>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadLicense<TData = Awaited<ReturnType<typeof readLicense>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readLicense>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Read License\n */\n\nexport function useReadLicense<TData = Awaited<ReturnType<typeof readLicense>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readLicense>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getReadLicenseQueryOptions(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 getCreateLicenseUrl = () => {\n\n\n\n\n return `/biblio/me/nextory/license`\n}\n\n/**\n * Allocate or reactivate this member's seat (E50).\n *\n * Idempotent: a member who already holds one gets it back with ``200``, and the\n * call doubles as a repair — a subscription that lapsed at the partner is\n * reopened against the same number, so reading positions survive.\n *\n * Medium assurance: this creates an account for the member at a third party\n * under their identity, which is not something a session established by a\n * partner handing over a static URL key should be able to do.\n * @summary Create License\n */\nexport const createLicense = async ( options?: Parameters<typeof request>[1]): Promise<LicenseRead> => {\n\n return request<LicenseRead>(getCreateLicenseUrl(),\n {\n ...options,\n method: 'POST'\n\n\n }\n);}\n\n\n\n\n\nexport const getCreateLicenseMutationKey = () => ['createLicense'] as const;\n\nexport const getCreateLicenseMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createLicense>>, TError,void, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof createLicense>>, TError,void, TContext> => {\n\nconst mutationKey = getCreateLicenseMutationKey();\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 createLicense>>, void> = () => {\n\n\n return createLicense(requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type CreateLicenseMutationResult = NonNullable<Awaited<ReturnType<typeof createLicense>>>\n\n export type CreateLicenseMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\n /**\n * @summary Create License\n */\nexport const useCreateLicense = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createLicense>>, TError,void, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof createLicense>>,\n TError,\n void,\n TContext\n > => {\n return useMutation(getCreateLicenseMutationOptions(options), queryClient);\n }\n"],"mappings":";;;;;;;;;;;AAwCA,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,4BAA4B;CAKvC,OAAO;AACT;;;;;;;;;;;;;;AAeA,MAAa,gBAAgB,OAAQ,YAA2D;CAE9F,OAAO,QAAc,oBAAoB,GACzC;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAMF,MAAa,oCAAoC,CAAC,eAAe;AAEjE,MAAa,mCACW,YACmE;CAE3F,MAAM,cAAc,4BAA4B;CAChD,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,mBAAsF;EAGxF,OAAQ,cAAc,cAAc;CACtC;CAON,OAAQ;EAAE;EAAY,GAAG;CAAgB;AAAC;;;;AAU5C,MAAa,oBACW,SACrB,gBAKQ;CACL,OAAO,YAAY,gCAAgC,OAAO,GAAG,WAAW;AAC1E;AACA,MAAa,0BAA0B;CAKzC,OAAO;AACT;;;;;;;AAQA,MAAa,cAAc,OAAQ,YAAkE;CAEnG,OA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-nextory/biblio-nextory.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.3.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 LicenseRead,\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 getDeleteLicenseUrl = () => {\n\n\n\n\n return `/biblio/me/nextory/license`\n}\n\n/**\n * Release this member's seat back to the household pool.\n *\n * Not in the legacy's member surface — releasing was staff-only, so a household\n * at its cap had to call support. The seat stays claimed by this member rather\n * than orphaned, so their next allocation gets the same number back and their\n * reading positions with it.\n *\n * ``204`` whether or not a licence was held: the desired end state is \"no\n * seat\", and reporting ``404`` would only tell a caller something they cannot\n * act on.\n * @summary Delete License\n */\nexport const deleteLicense = async ( options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getDeleteLicenseUrl(),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\n\n\n\nexport const getDeleteLicenseMutationKey = () => ['deleteLicense'] as const;\n\nexport const getDeleteLicenseMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteLicense>>, TError,void, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof deleteLicense>>, TError,void, TContext> => {\n\nconst mutationKey = getDeleteLicenseMutationKey();\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 deleteLicense>>, void> = () => {\n\n\n return deleteLicense(requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DeleteLicenseMutationResult = NonNullable<Awaited<ReturnType<typeof deleteLicense>>>\n\n export type DeleteLicenseMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\n /**\n * @summary Delete License\n */\nexport const useDeleteLicense = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteLicense>>, TError,void, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof deleteLicense>>,\n TError,\n void,\n TContext\n > => {\n return useMutation(getDeleteLicenseMutationOptions(options), queryClient);\n }\n export const getReadLicenseUrl = () => {\n\n\n\n\n return `/biblio/me/nextory/license`\n}\n\n/**\n * The seat this member holds (E49). ``404`` when they hold none.\n *\n * Safe, and that is the entire point of the endpoint existing separately.\n * @summary Read License\n */\nexport const readLicense = async ( options?: Parameters<typeof request>[1]): Promise<LicenseRead> => {\n\n return request<LicenseRead>(getReadLicenseUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getReadLicenseQueryKey = () => {\n return [\n `/biblio/me/nextory/license`\n ] as const;\n }\n\n\nexport const getReadLicenseQueryOptions = <TData = Awaited<ReturnType<typeof readLicense>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readLicense>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getReadLicenseQueryKey();\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof readLicense>>> = ({ signal }) => readLicense({ signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof readLicense>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ReadLicenseQueryResult = NonNullable<Awaited<ReturnType<typeof readLicense>>>\nexport type ReadLicenseQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useReadLicense<TData = Awaited<ReturnType<typeof readLicense>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof readLicense>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof readLicense>>,\n TError,\n Awaited<ReturnType<typeof readLicense>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadLicense<TData = Awaited<ReturnType<typeof readLicense>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readLicense>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof readLicense>>,\n TError,\n Awaited<ReturnType<typeof readLicense>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadLicense<TData = Awaited<ReturnType<typeof readLicense>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readLicense>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Read License\n */\n\nexport function useReadLicense<TData = Awaited<ReturnType<typeof readLicense>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readLicense>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getReadLicenseQueryOptions(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 getCreateLicenseUrl = () => {\n\n\n\n\n return `/biblio/me/nextory/license`\n}\n\n/**\n * Allocate or reactivate this member's seat (E50).\n *\n * Idempotent: a member who already holds one gets it back with ``200``, and the\n * call doubles as a repair — a subscription that lapsed at the partner is\n * reopened against the same number, so reading positions survive.\n *\n * Medium assurance: this creates an account for the member at a third party\n * under their identity, which is not something a session established by a\n * partner handing over a static URL key should be able to do.\n * @summary Create License\n */\nexport const createLicense = async ( options?: Parameters<typeof request>[1]): Promise<LicenseRead> => {\n\n return request<LicenseRead>(getCreateLicenseUrl(),\n {\n ...options,\n method: 'POST'\n\n\n }\n);}\n\n\n\n\n\nexport const getCreateLicenseMutationKey = () => ['createLicense'] as const;\n\nexport const getCreateLicenseMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createLicense>>, TError,void, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof createLicense>>, TError,void, TContext> => {\n\nconst mutationKey = getCreateLicenseMutationKey();\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 createLicense>>, void> = () => {\n\n\n return createLicense(requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type CreateLicenseMutationResult = NonNullable<Awaited<ReturnType<typeof createLicense>>>\n\n export type CreateLicenseMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\n /**\n * @summary Create License\n */\nexport const useCreateLicense = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createLicense>>, TError,void, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof createLicense>>,\n TError,\n void,\n TContext\n > => {\n return useMutation(getCreateLicenseMutationOptions(options), queryClient);\n }\n"],"mappings":";;;;;;;;;;;AAwCA,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,4BAA4B;CAKvC,OAAO;AACT;;;;;;;;;;;;;;AAeA,MAAa,gBAAgB,OAA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;;AAcA,MAAa,gBAAgB,OAAQ,YAAkE;CAErG,OAAO,QAAqB,oBAAoB,GAChD;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAMF,MAAa,oCAAoC,CAAC,eAAe;AAEjE,MAAa,mCACW,YACmE;CAE3F,MAAM,cAAc,4BAA4B;CAChD,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,mBAAsF;EAGxF,OAAQ,cAAc,cAAc;CACtC;CAON,OAAQ;EAAE;EAAY,GAAG;CAAgB;AAAC;;;;AAU5C,MAAa,oBACW,SACrB,gBAKQ;CACL,OAAO,YAAY,gCAAgC,OAAO,GAAG,WAAW;AAC1E"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import { a as ErrorType, c as request } from "../client
|
|
2
|
+
import { Cr as HTTPExceptionResponse, Et as PressArticleListRead, Tr as PressReviewRead, Tt as PressArticleRead, nt as ReadPressReviewParams, t as ValidationErrorResponse, wn as ListPressArticlesParams } from "../chunks/index.js";
|
|
3
|
+
import { a as ErrorType, c as request } from "../chunks/client.js";
|
|
4
4
|
import { DataTag, DefinedInitialDataOptions, DefinedUseQueryResult, QueryClient, QueryKey, UndefinedInitialDataOptions, UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
|
|
5
5
|
//#region src/react/biblio-press/biblio-press.d.ts
|
|
6
6
|
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { r as request } from "../client
|
|
2
|
+
import { r as request } from "../chunks/client.js";
|
|
3
3
|
import { useQuery } from "@tanstack/react-query";
|
|
4
4
|
//#region src/react/biblio-press/biblio-press.ts
|
|
5
5
|
/**
|
|
@@ -7,7 +7,7 @@ import { 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.3.2
|
|
11
11
|
*/
|
|
12
12
|
const withQueryKey = (query, queryKey) => {
|
|
13
13
|
const result = { queryKey };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"biblio-press.js","names":[],"sources":["../../src/react/biblio-press/biblio-press.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.0\n */\nimport {\n useQuery\n} from '@tanstack/react-query';\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseQueryOptions,\n UseQueryResult\n} from '@tanstack/react-query';\n\nimport type {\n HTTPExceptionResponse,\n ListPressArticlesParams,\n PressArticleListRead,\n PressArticleRead,\n PressReviewRead,\n ReadPressReviewParams,\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 getListPressArticlesUrl = (params?: ListPressArticlesParams,) => {\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 ? `/biblio/press-articles?${stringifiedParams}` : `/biblio/press-articles`\n}\n\n/**\n * Press articles, filtered (E41).\n *\n * ``theme_id`` unifies the legacy's two separate parameters ``themeId`` and\n * ``themePk``, which named the same thing. ``order`` is resolved against a\n * whitelist; anything else is ``422`` rather than a surprise ordering.\n * @summary List Press Articles\n */\nexport const listPressArticles = async (params?: ListPressArticlesParams, options?: Parameters<typeof request>[1]): Promise<PressArticleListRead> => {\n\n return request<PressArticleListRead>(getListPressArticlesUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getListPressArticlesQueryKey = (params?: ListPressArticlesParams,) => {\n return [\n `/biblio/press-articles`, ...(params ? [params] : [])\n ] as const;\n }\n\n\nexport const getListPressArticlesQueryOptions = <TData = Awaited<ReturnType<typeof listPressArticles>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params?: ListPressArticlesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listPressArticles>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getListPressArticlesQueryKey(params);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof listPressArticles>>> = ({ signal }) => listPressArticles(params, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listPressArticles>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ListPressArticlesQueryResult = NonNullable<Awaited<ReturnType<typeof listPressArticles>>>\nexport type ListPressArticlesQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useListPressArticles<TData = Awaited<ReturnType<typeof listPressArticles>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params: undefined | ListPressArticlesParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listPressArticles>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof listPressArticles>>,\n TError,\n Awaited<ReturnType<typeof listPressArticles>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListPressArticles<TData = Awaited<ReturnType<typeof listPressArticles>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListPressArticlesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listPressArticles>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof listPressArticles>>,\n TError,\n Awaited<ReturnType<typeof listPressArticles>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListPressArticles<TData = Awaited<ReturnType<typeof listPressArticles>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListPressArticlesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listPressArticles>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary List Press Articles\n */\n\nexport function useListPressArticles<TData = Awaited<ReturnType<typeof listPressArticles>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListPressArticlesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listPressArticles>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getListPressArticlesQueryOptions(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 getReadPressArticleUrl = (articleId: number,) => {\n\n\n\n\n return `/biblio/press-articles/${articleId}`\n}\n\n/**\n * One press article (E42). ``404`` when unknown *or* not entitled.\n * @summary Read Press Article\n */\nexport const readPressArticle = async (articleId: number, options?: Parameters<typeof request>[1]): Promise<PressArticleRead> => {\n\n return request<PressArticleRead>(getReadPressArticleUrl(articleId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getReadPressArticleQueryKey = (articleId: number,) => {\n return [\n `/biblio/press-articles/${articleId}`\n ] as const;\n }\n\n\nexport const getReadPressArticleQueryOptions = <TData = Awaited<ReturnType<typeof readPressArticle>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(articleId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressArticle>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getReadPressArticleQueryKey(articleId);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof readPressArticle>>> = ({ signal }) => readPressArticle(articleId, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, enabled: articleId !== null && articleId !== undefined, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof readPressArticle>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ReadPressArticleQueryResult = NonNullable<Awaited<ReturnType<typeof readPressArticle>>>\nexport type ReadPressArticleQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useReadPressArticle<TData = Awaited<ReturnType<typeof readPressArticle>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n articleId: number, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressArticle>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof readPressArticle>>,\n TError,\n Awaited<ReturnType<typeof readPressArticle>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadPressArticle<TData = Awaited<ReturnType<typeof readPressArticle>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n articleId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressArticle>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof readPressArticle>>,\n TError,\n Awaited<ReturnType<typeof readPressArticle>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadPressArticle<TData = Awaited<ReturnType<typeof readPressArticle>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n articleId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressArticle>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Read Press Article\n */\n\nexport function useReadPressArticle<TData = Awaited<ReturnType<typeof readPressArticle>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n articleId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressArticle>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getReadPressArticleQueryOptions(articleId,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 getReadPressReviewUrl = (params?: ReadPressReviewParams,) => {\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 ? `/biblio/press-review?${stringifiedParams}` : `/biblio/press-review`\n}\n\n/**\n * The curated press review (E43). An explicit aggregate (§5.2).\n *\n * New as an endpoint; the legacy composed it into two pages and never exposed\n * it. There is no curation table, so a section is a theme and its members are\n * that theme's most recent entitled articles — which is what the rendered page\n * amounted to. When a real curation model appears this is the one place that has\n * to change.\n *\n * A theme with nothing the caller may read is omitted rather than returned\n * empty: an empty section is a hole in a page, and the client cannot tell\n * \"nothing new\" from \"not licensed\".\n * @summary Read Press Review\n */\nexport const readPressReview = async (params?: ReadPressReviewParams, options?: Parameters<typeof request>[1]): Promise<PressReviewRead> => {\n\n return request<PressReviewRead>(getReadPressReviewUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getReadPressReviewQueryKey = (params?: ReadPressReviewParams,) => {\n return [\n `/biblio/press-review`, ...(params ? [params] : [])\n ] as const;\n }\n\n\nexport const getReadPressReviewQueryOptions = <TData = Awaited<ReturnType<typeof readPressReview>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params?: ReadPressReviewParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressReview>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getReadPressReviewQueryKey(params);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof readPressReview>>> = ({ signal }) => readPressReview(params, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof readPressReview>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ReadPressReviewQueryResult = NonNullable<Awaited<ReturnType<typeof readPressReview>>>\nexport type ReadPressReviewQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useReadPressReview<TData = Awaited<ReturnType<typeof readPressReview>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params: undefined | ReadPressReviewParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressReview>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof readPressReview>>,\n TError,\n Awaited<ReturnType<typeof readPressReview>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadPressReview<TData = Awaited<ReturnType<typeof readPressReview>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ReadPressReviewParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressReview>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof readPressReview>>,\n TError,\n Awaited<ReturnType<typeof readPressReview>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadPressReview<TData = Awaited<ReturnType<typeof readPressReview>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ReadPressReviewParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressReview>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Read Press Review\n */\n\nexport function useReadPressReview<TData = Awaited<ReturnType<typeof readPressReview>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ReadPressReviewParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressReview>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getReadPressReviewQueryOptions(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\n"],"mappings":";;;;;;;;;;;AAwCA,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,0BAA0B,sBAAsB;AACxF;;;;;;;;;AAUA,MAAa,oBAAoB,OAAO,QAAk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AM,eAAe,gCAAgC,WAAU,OAAO;CAEtE,MAAM,QAAQ,SAAS,cAAc,WAAW;CAEhD,OAAO,aAAa,OAAO,aAAa,QAAQ;AAClD;AAOA,MAAa,yBAAyB,WAAoC;CACxE,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,wBAAwB,sBAAsB;AACtF;;;;;;;;;;;;;;;AAgBA,MAAa,kBAAkB,OAAO,QAAgC,YAAsE;CAE1I,OAAO,QAAyB,sBAAsB,MAAM,GAC5D;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAMF,MAAa,8BAA8B,WAAoC;CAC3E,OAAO,CACP,wBAAwB,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CACjD;AACA;AAGJ,MAAa,kCAA4J,QAAgC,YACpM;CAEL,MAAM,EAAC,OAAO,cAAc,SAAS,mBAAkB,WAAW,CAAC;CAEjE,MAAM,WAAY,cAAc,YAAY,2BAA2B,MAAM;CAI3E,MAAM,WAAuE,EAAE,aAAa,gBAAgB,QAAQ;EAAE;EAAQ,GAAG;CAAe,CAAC;CAMlJ,OAAQ;EAAE;EAAU;EAAS,GAAG;CAAY;AAC/C;;;;AAkCA,SAAgB,mBACf,QAAgC,SAC9B,aACiF;CAElF,MAAM,eAAe,+BAA+B,QAAO,OAAO;CAElE,MAAM,QAAQ,SAAS,cAAc,WAAW;CAEhD,OAAO,aAAa,OAAO,aAAa,QAAQ;AAClD"}
|
|
1
|
+
{"version":3,"file":"biblio-press.js","names":[],"sources":["../../src/react/biblio-press/biblio-press.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.3.2\n */\nimport {\n useQuery\n} from '@tanstack/react-query';\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseQueryOptions,\n UseQueryResult\n} from '@tanstack/react-query';\n\nimport type {\n HTTPExceptionResponse,\n ListPressArticlesParams,\n PressArticleListRead,\n PressArticleRead,\n PressReviewRead,\n ReadPressReviewParams,\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 getListPressArticlesUrl = (params?: ListPressArticlesParams,) => {\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 ? `/biblio/press-articles?${stringifiedParams}` : `/biblio/press-articles`\n}\n\n/**\n * Press articles, filtered (E41).\n *\n * ``theme_id`` unifies the legacy's two separate parameters ``themeId`` and\n * ``themePk``, which named the same thing. ``order`` is resolved against a\n * whitelist; anything else is ``422`` rather than a surprise ordering.\n * @summary List Press Articles\n */\nexport const listPressArticles = async (params?: ListPressArticlesParams, options?: Parameters<typeof request>[1]): Promise<PressArticleListRead> => {\n\n return request<PressArticleListRead>(getListPressArticlesUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getListPressArticlesQueryKey = (params?: ListPressArticlesParams,) => {\n return [\n `/biblio/press-articles`, ...(params ? [params] : [])\n ] as const;\n }\n\n\nexport const getListPressArticlesQueryOptions = <TData = Awaited<ReturnType<typeof listPressArticles>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params?: ListPressArticlesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listPressArticles>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getListPressArticlesQueryKey(params);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof listPressArticles>>> = ({ signal }) => listPressArticles(params, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listPressArticles>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ListPressArticlesQueryResult = NonNullable<Awaited<ReturnType<typeof listPressArticles>>>\nexport type ListPressArticlesQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useListPressArticles<TData = Awaited<ReturnType<typeof listPressArticles>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params: undefined | ListPressArticlesParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listPressArticles>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof listPressArticles>>,\n TError,\n Awaited<ReturnType<typeof listPressArticles>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListPressArticles<TData = Awaited<ReturnType<typeof listPressArticles>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListPressArticlesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listPressArticles>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof listPressArticles>>,\n TError,\n Awaited<ReturnType<typeof listPressArticles>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListPressArticles<TData = Awaited<ReturnType<typeof listPressArticles>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListPressArticlesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listPressArticles>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary List Press Articles\n */\n\nexport function useListPressArticles<TData = Awaited<ReturnType<typeof listPressArticles>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListPressArticlesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listPressArticles>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getListPressArticlesQueryOptions(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 getReadPressArticleUrl = (articleId: number,) => {\n\n\n\n\n return `/biblio/press-articles/${articleId}`\n}\n\n/**\n * One press article (E42). ``404`` when unknown *or* not entitled.\n * @summary Read Press Article\n */\nexport const readPressArticle = async (articleId: number, options?: Parameters<typeof request>[1]): Promise<PressArticleRead> => {\n\n return request<PressArticleRead>(getReadPressArticleUrl(articleId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getReadPressArticleQueryKey = (articleId: number,) => {\n return [\n `/biblio/press-articles/${articleId}`\n ] as const;\n }\n\n\nexport const getReadPressArticleQueryOptions = <TData = Awaited<ReturnType<typeof readPressArticle>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(articleId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressArticle>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getReadPressArticleQueryKey(articleId);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof readPressArticle>>> = ({ signal }) => readPressArticle(articleId, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, enabled: articleId !== null && articleId !== undefined, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof readPressArticle>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ReadPressArticleQueryResult = NonNullable<Awaited<ReturnType<typeof readPressArticle>>>\nexport type ReadPressArticleQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useReadPressArticle<TData = Awaited<ReturnType<typeof readPressArticle>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n articleId: number, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressArticle>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof readPressArticle>>,\n TError,\n Awaited<ReturnType<typeof readPressArticle>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadPressArticle<TData = Awaited<ReturnType<typeof readPressArticle>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n articleId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressArticle>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof readPressArticle>>,\n TError,\n Awaited<ReturnType<typeof readPressArticle>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadPressArticle<TData = Awaited<ReturnType<typeof readPressArticle>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n articleId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressArticle>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Read Press Article\n */\n\nexport function useReadPressArticle<TData = Awaited<ReturnType<typeof readPressArticle>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n articleId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressArticle>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getReadPressArticleQueryOptions(articleId,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 getReadPressReviewUrl = (params?: ReadPressReviewParams,) => {\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 ? `/biblio/press-review?${stringifiedParams}` : `/biblio/press-review`\n}\n\n/**\n * The curated press review (E43). An explicit aggregate (§5.2).\n *\n * New as an endpoint; the legacy composed it into two pages and never exposed\n * it. There is no curation table, so a section is a theme and its members are\n * that theme's most recent entitled articles — which is what the rendered page\n * amounted to. When a real curation model appears this is the one place that has\n * to change.\n *\n * A theme with nothing the caller may read is omitted rather than returned\n * empty: an empty section is a hole in a page, and the client cannot tell\n * \"nothing new\" from \"not licensed\".\n * @summary Read Press Review\n */\nexport const readPressReview = async (params?: ReadPressReviewParams, options?: Parameters<typeof request>[1]): Promise<PressReviewRead> => {\n\n return request<PressReviewRead>(getReadPressReviewUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getReadPressReviewQueryKey = (params?: ReadPressReviewParams,) => {\n return [\n `/biblio/press-review`, ...(params ? [params] : [])\n ] as const;\n }\n\n\nexport const getReadPressReviewQueryOptions = <TData = Awaited<ReturnType<typeof readPressReview>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params?: ReadPressReviewParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressReview>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getReadPressReviewQueryKey(params);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof readPressReview>>> = ({ signal }) => readPressReview(params, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof readPressReview>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ReadPressReviewQueryResult = NonNullable<Awaited<ReturnType<typeof readPressReview>>>\nexport type ReadPressReviewQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useReadPressReview<TData = Awaited<ReturnType<typeof readPressReview>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params: undefined | ReadPressReviewParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressReview>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof readPressReview>>,\n TError,\n Awaited<ReturnType<typeof readPressReview>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadPressReview<TData = Awaited<ReturnType<typeof readPressReview>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ReadPressReviewParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressReview>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof readPressReview>>,\n TError,\n Awaited<ReturnType<typeof readPressReview>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadPressReview<TData = Awaited<ReturnType<typeof readPressReview>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ReadPressReviewParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressReview>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Read Press Review\n */\n\nexport function useReadPressReview<TData = Awaited<ReturnType<typeof readPressReview>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ReadPressReviewParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressReview>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getReadPressReviewQueryOptions(params,options)\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n return withQ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H,QAAQ;CAGV,CACF;AAAE;AAMF,MAAa,8BAA8B,WAAoC;CAC3E,OAAO,CACP,wBAAwB,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CACjD;AACA;AAGJ,MAAa,kCAA4J,QAAgC,YACpM;CAEL,MAAM,EAAC,OAAO,cAAc,SAAS,mBAAkB,WAAW,CAAC;CAEjE,MAAM,WAAY,cAAc,YAAY,2BAA2B,MAAM;CAI3E,MAAM,WAAuE,EAAE,aAAa,gBAAgB,QAAQ;EAAE;EAAQ,GAAG;CAAe,CAAC;CAMlJ,OAAQ;EAAE;EAAU;EAAS,GAAG;CAAY;AAC/C;;;;AAkCA,SAAgB,mBACf,QAAgC,SAC9B,aACiF;CAElF,MAAM,eAAe,+BAA+B,QAAO,OAAO;CAElE,MAAM,QAAQ,SAAS,cAAc,WAAW;CAEhD,OAAO,aAAa,OAAO,aAAa,QAAQ;AAClD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import { a as ErrorType, c as request } from "../client
|
|
2
|
+
import { Cr as HTTPExceptionResponse, G as SearchResultsRead, K as SearchParams, t as ValidationErrorResponse } from "../chunks/index.js";
|
|
3
|
+
import { a as ErrorType, c as request } from "../chunks/client.js";
|
|
4
4
|
import { DataTag, DefinedInitialDataOptions, DefinedUseQueryResult, QueryClient, QueryKey, UndefinedInitialDataOptions, UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
|
|
5
5
|
//#region src/react/biblio-search/biblio-search.d.ts
|
|
6
6
|
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { r as request } from "../client
|
|
2
|
+
import { r as request } from "../chunks/client.js";
|
|
3
3
|
import { useQuery } from "@tanstack/react-query";
|
|
4
4
|
//#region src/react/biblio-search/biblio-search.ts
|
|
5
5
|
/**
|
|
@@ -7,7 +7,7 @@ import { 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.3.2
|
|
11
11
|
*/
|
|
12
12
|
const withQueryKey = (query, queryKey) => {
|
|
13
13
|
const result = { queryKey };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"biblio-search.js","names":[],"sources":["../../src/react/biblio-search/biblio-search.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":"biblio-search.js","names":[],"sources":["../../src/react/biblio-search/biblio-search.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.3.2\n */\nimport {\n useQuery\n} from '@tanstack/react-query';\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseQueryOptions,\n UseQueryResult\n} from '@tanstack/react-query';\n\nimport type {\n HTTPExceptionResponse,\n SearchParams,\n SearchResultsRead,\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 getSearchUrl = (params?: SearchParams,) => {\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 ? `/biblio/search?${stringifiedParams}` : `/biblio/search`\n}\n\n/**\n * Search the catalogue (E46).\n *\n * An empty ``q`` returns an empty ``data`` with ``200``. It is not an error: a\n * client clearing its search box should get an empty result, not a failure.\n *\n * An unrecognised ``type`` is ``422``, naming the families that exist.\n * @summary Search\n */\nexport const search = async (params?: SearchParams, options?: Parameters<typeof request>[1]): Promise<SearchResultsRead> => {\n\n return request<SearchResultsRead>(getSearchUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getSearchQueryKey = (params?: SearchParams,) => {\n return [\n `/biblio/search`, ...(params ? [params] : [])\n ] as const;\n }\n\n\nexport const getSearchQueryOptions = <TData = Awaited<ReturnType<typeof search>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params?: SearchParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof search>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getSearchQueryKey(params);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof search>>> = ({ signal }) => search(params, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof search>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type SearchQueryResult = NonNullable<Awaited<ReturnType<typeof search>>>\nexport type SearchQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useSearch<TData = Awaited<ReturnType<typeof search>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params: undefined | SearchParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof search>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof search>>,\n TError,\n Awaited<ReturnType<typeof search>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useSearch<TData = Awaited<ReturnType<typeof search>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: SearchParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof search>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof search>>,\n TError,\n Awaited<ReturnType<typeof search>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useSearch<TData = Awaited<ReturnType<typeof search>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: SearchParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof search>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Search\n */\n\nexport function useSearch<TData = Awaited<ReturnType<typeof search>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: SearchParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof search>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getSearchQueryOptions(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\n"],"mappings":";;;;;;;;;;;AAqCA,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,gBAAgB,WAA2B;CACtD,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,kBAAkB,sBAAsB;AAChF;;;;;;;;;;AAWA,MAAa,SAAS,OAAO,QAAuB,YAAwE;CAE1H,OAAO,QAA2B,aAAa,MAAM,GACrD;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAMF,MAAa,qBAAqB,WAA2B;CACzD,OAAO,CACP,kBAAkB,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAC3C;AACA;AAGJ,MAAa,yBAA0I,QAAuB,YACzK;CAEL,MAAM,EAAC,OAAO,cAAc,SAAS,mBAAkB,WAAW,CAAC;CAEjE,MAAM,WAAY,cAAc,YAAY,kBAAkB,MAAM;CAIlE,MAAM,WAA8D,EAAE,aAAa,OAAO,QAAQ;EAAE;EAAQ,GAAG;CAAe,CAAC;CAMhI,OAAQ;EAAE;EAAU;EAAS,GAAG;CAAY;AAC/C;;;;AAkCA,SAAgB,UACf,QAAuB,SACrB,aACiF;CAElF,MAAM,eAAe,sBAAsB,QAAO,OAAO;CAEzD,MAAM,QAAQ,SAAS,cAAc,WAAW;CAEhD,OAAO,aAAa,OAAO,aAAa,QAAQ;AAClD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import { a as ErrorType, c as request, n as BodyType } from "../client
|
|
2
|
+
import { Cr as HTTPExceptionResponse, ot as ReadingSessionWrite, st as ReadingSessionRead, t as ValidationErrorResponse } from "../chunks/index.js";
|
|
3
|
+
import { a as ErrorType, c as request, n as BodyType } from "../chunks/client.js";
|
|
4
4
|
import { QueryClient, UseMutationOptions, UseMutationResult } from "@tanstack/react-query";
|
|
5
5
|
//#region src/react/biblio-telemetry/biblio-telemetry.d.ts
|
|
6
6
|
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { r as request } from "../client
|
|
2
|
+
import { r as request } from "../chunks/client.js";
|
|
3
3
|
import { useMutation } from "@tanstack/react-query";
|
|
4
4
|
//#region src/react/biblio-telemetry/biblio-telemetry.ts
|
|
5
5
|
/**
|
|
@@ -7,7 +7,7 @@ import { useMutation } 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.3.2
|
|
11
11
|
*/
|
|
12
12
|
const getRecordReadingSessionUrl = (sessionTag) => {
|
|
13
13
|
return `/biblio/reading-sessions/${sessionTag}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"biblio-telemetry.js","names":[],"sources":["../../src/react/biblio-telemetry/biblio-telemetry.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":"biblio-telemetry.js","names":[],"sources":["../../src/react/biblio-telemetry/biblio-telemetry.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.3.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 ReadingSessionRead,\n ReadingSessionWrite,\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\nexport const getRecordReadingSessionUrl = (sessionTag: string,) => {\n\n\n\n\n return `/biblio/reading-sessions/${sessionTag}`\n}\n\n/**\n * Record one content-consumption session (E54). Idempotent on ``session_tag``.\n *\n * **There is no ``user_id`` and no ``client_id`` in the body, and there must\n * never be.** The legacy endpoint was unauthenticated and took both from the\n * request without checking either against a credential, so consumption records\n * — which is to say the billing record — were forgeable for any account\n * (defect D3). Both come from the token here.\n *\n * ``PUT`` because the legacy handler already checked whether the tag existed and\n * returned success rather than duplicating: that is an upsert keyed by a\n * client-supplied identifier, and the verb now says so. The tag becomes\n * ``ConsumptionEvent.request_key``, so a retried request after a timeout costs\n * one unit rather than two — enforced by a partial unique index, not by\n * checking first and hoping.\n *\n * ``201`` on the first write for a tag, ``200`` when it already existed. Never\n * an error for a repeat: that is what idempotent means (§2.6).\n * @summary Record Reading Session\n */\nexport const recordReadingSession = async (sessionTag: string,\n readingSessionWrite: ReadingSessionWrite, options?: Parameters<typeof request>[1]): Promise<ReadingSessionRead> => {\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<ReadingSessionRead>(getRecordReadingSessionUrl(sessionTag),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(readingSessionWrite)\n }\n);}\n\n\n\n\n\nexport const getRecordReadingSessionMutationKey = () => ['recordReadingSession'] as const;\n\nexport const getRecordReadingSessionMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof recordReadingSession>>, TError,RecordReadingSessionMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof recordReadingSession>>, TError,RecordReadingSessionMutationVariables, TContext> => {\n\nconst mutationKey = getRecordReadingSessionMutationKey();\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 recordReadingSession>>, RecordReadingSessionMutationVariables> = (props) => {\n const {sessionTag,data} = props ?? {};\n\n return recordReadingSession(sessionTag,data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type RecordReadingSessionMutationResult = NonNullable<Awaited<ReturnType<typeof recordReadingSession>>>\n export type RecordReadingSessionMutationBody = BodyType<ReadingSessionWrite>\n export type RecordReadingSessionMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type RecordReadingSessionMutationVariables = {sessionTag: string;data: BodyType<ReadingSessionWrite>}\n\n /**\n * @summary Record Reading Session\n */\nexport const useRecordReadingSession = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof recordReadingSession>>, TError,RecordReadingSessionMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof recordReadingSession>>,\n TError,\n RecordReadingSessionMutationVariables,\n TContext\n > => {\n return useMutation(getRecordReadingSessionMutationOptions(options), queryClient);\n }\n"],"mappings":";;;;;;;;;;;AAgCA,MAAa,8BAA8B,eAAwB;CAKjE,OAAO,4BAA4B;AACrC;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAa,uBAAuB,OAAO,YACvC,qBAA0C,YAAyE;CAEnH,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,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,2BAA2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