@learnorama/mozaik-sdk 0.8.2-staging.31.1 → 0.9.0-staging.35.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/account.d.ts +27 -28
- package/dist/api/account.js +41 -28
- package/dist/api/account.js.map +1 -1
- package/dist/api/admin-catalogue.d.ts +1 -1
- package/dist/api/admin-catalogue.js.map +1 -1
- package/dist/api/admin-consumption.d.ts +1 -1
- package/dist/api/admin-consumption.js.map +1 -1
- package/dist/api/admin-desk.d.ts +23 -1
- package/dist/api/admin-desk.js +59 -1
- package/dist/api/admin-desk.js.map +1 -1
- package/dist/api/admin-licenses.d.ts +1 -1
- package/dist/api/admin-licenses.js.map +1 -1
- package/dist/api/admin-patrons.d.ts +1 -1
- package/dist/api/admin-patrons.js.map +1 -1
- package/dist/api/admin-reviews.d.ts +1 -1
- package/dist/api/admin-reviews.js.map +1 -1
- package/dist/api/admin-roles.d.ts +1 -1
- package/dist/api/admin-roles.js.map +1 -1
- package/dist/api/admin-support.d.ts +1 -1
- package/dist/api/admin-support.js.map +1 -1
- package/dist/api/admin-tenants.d.ts +1 -1
- package/dist/api/admin-tenants.js.map +1 -1
- package/dist/api/admin-tutoring.d.ts +1 -1
- package/dist/api/admin-tutoring.js.map +1 -1
- package/dist/api/auth.d.ts +11 -1
- package/dist/api/auth.js +31 -1
- package/dist/api/auth.js.map +1 -1
- package/dist/api/biblio-catalogue.d.ts +1 -1
- package/dist/api/biblio-catalogue.js.map +1 -1
- package/dist/api/biblio-home.d.ts +1 -1
- package/dist/api/biblio-home.js.map +1 -1
- package/dist/api/biblio-library.d.ts +1 -1
- package/dist/api/biblio-library.js.map +1 -1
- package/dist/api/biblio-nextory.d.ts +1 -1
- package/dist/api/biblio-nextory.js.map +1 -1
- package/dist/api/biblio-press.d.ts +17 -1
- package/dist/api/biblio-press.js +49 -1
- package/dist/api/biblio-press.js.map +1 -1
- package/dist/api/biblio-search.d.ts +1 -1
- package/dist/api/biblio-search.js.map +1 -1
- package/dist/api/biblio-telemetry.d.ts +1 -1
- package/dist/api/biblio-telemetry.js.map +1 -1
- package/dist/api/consumption.d.ts +1 -1
- package/dist/api/consumption.js.map +1 -1
- package/dist/api/cvs-app.d.ts +1 -1
- package/dist/api/cvs-app.js.map +1 -1
- package/dist/api/cvs-documents.d.ts +1 -1
- package/dist/api/cvs-documents.js.map +1 -1
- package/dist/api/cvs-favorites.d.ts +1 -1
- package/dist/api/cvs-favorites.js.map +1 -1
- package/dist/api/cvs-ils.d.ts +1 -1
- package/dist/api/cvs-ils.js.map +1 -1
- package/dist/api/cvs-loans.d.ts +1 -1
- package/dist/api/cvs-loans.js.map +1 -1
- package/dist/api/cvs-payments.d.ts +1 -1
- package/dist/api/cvs-payments.js.map +1 -1
- package/dist/api/cvs-streaming.d.ts +1 -1
- package/dist/api/cvs-streaming.js.map +1 -1
- package/dist/api/index.d.ts +8 -8
- package/dist/api/index.js +8 -8
- package/dist/api/partner-catalogue.d.ts +20 -1
- package/dist/api/partner-catalogue.js +44 -1
- package/dist/api/partner-catalogue.js.map +1 -1
- package/dist/api/partner-reader.d.ts +34 -6
- package/dist/api/partner-reader.js +48 -6
- package/dist/api/partner-reader.js.map +1 -1
- package/dist/api/profiles.d.ts +86 -33
- package/dist/api/profiles.js +302 -33
- package/dist/api/profiles.js.map +1 -1
- package/dist/api/search.d.ts +1 -1
- package/dist/api/search.js.map +1 -1
- package/dist/api/tutoring-catalogue.d.ts +1 -1
- package/dist/api/tutoring-catalogue.js.map +1 -1
- package/dist/api/tutoring-chat.d.ts +1 -1
- package/dist/api/tutoring-chat.js.map +1 -1
- package/dist/api/tutoring-dispatch.d.ts +1 -1
- package/dist/api/tutoring-dispatch.js.map +1 -1
- package/dist/api/tutoring-practitioner.d.ts +1 -1
- package/dist/api/tutoring-practitioner.js.map +1 -1
- package/dist/api/tutoring-requests.d.ts +1 -1
- package/dist/api/tutoring-requests.js.map +1 -1
- package/dist/chunks/client2.d.ts +1 -1
- package/dist/chunks/connection.d.ts +1 -1
- package/dist/chunks/index.d.ts +1183 -347
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +2 -2
- package/dist/models.js +95 -2
- package/dist/models.js.map +1 -1
- package/dist/react/account.d.ts +81 -28
- package/dist/react/account.js +90 -29
- package/dist/react/account.js.map +1 -1
- package/dist/react/admin-catalogue.d.ts +1 -1
- package/dist/react/admin-catalogue.js +1 -1
- package/dist/react/admin-catalogue.js.map +1 -1
- package/dist/react/admin-consumption.d.ts +1 -1
- package/dist/react/admin-consumption.js +1 -1
- package/dist/react/admin-consumption.js.map +1 -1
- package/dist/react/admin-desk.d.ts +104 -1
- package/dist/react/admin-desk.js +132 -2
- package/dist/react/admin-desk.js.map +1 -1
- package/dist/react/admin-licenses.d.ts +1 -1
- package/dist/react/admin-licenses.js +1 -1
- package/dist/react/admin-licenses.js.map +1 -1
- package/dist/react/admin-patrons.d.ts +1 -1
- package/dist/react/admin-patrons.js +1 -1
- package/dist/react/admin-patrons.js.map +1 -1
- package/dist/react/admin-reviews.d.ts +1 -1
- package/dist/react/admin-reviews.js +1 -1
- package/dist/react/admin-reviews.js.map +1 -1
- package/dist/react/admin-roles.d.ts +1 -1
- package/dist/react/admin-roles.js +1 -1
- package/dist/react/admin-roles.js.map +1 -1
- package/dist/react/admin-support.d.ts +1 -1
- package/dist/react/admin-support.js +1 -1
- package/dist/react/admin-support.js.map +1 -1
- package/dist/react/admin-tenants.d.ts +1 -1
- package/dist/react/admin-tenants.js +1 -1
- package/dist/react/admin-tenants.js.map +1 -1
- package/dist/react/admin-tutoring.d.ts +1 -1
- package/dist/react/admin-tutoring.js +1 -1
- package/dist/react/admin-tutoring.js.map +1 -1
- package/dist/react/auth.d.ts +29 -1
- package/dist/react/auth.js +60 -2
- package/dist/react/auth.js.map +1 -1
- package/dist/react/biblio-catalogue.d.ts +1 -1
- package/dist/react/biblio-catalogue.js +1 -1
- package/dist/react/biblio-catalogue.js.map +1 -1
- package/dist/react/biblio-home.d.ts +1 -1
- package/dist/react/biblio-home.js +1 -1
- package/dist/react/biblio-home.js.map +1 -1
- package/dist/react/biblio-library.d.ts +1 -1
- package/dist/react/biblio-library.js +1 -1
- package/dist/react/biblio-library.js.map +1 -1
- package/dist/react/biblio-nextory.d.ts +1 -1
- package/dist/react/biblio-nextory.js +1 -1
- package/dist/react/biblio-nextory.js.map +1 -1
- package/dist/react/biblio-press.d.ts +65 -3
- package/dist/react/biblio-press.js +104 -3
- package/dist/react/biblio-press.js.map +1 -1
- package/dist/react/biblio-search.d.ts +1 -1
- package/dist/react/biblio-search.js +1 -1
- package/dist/react/biblio-search.js.map +1 -1
- package/dist/react/biblio-telemetry.d.ts +1 -1
- package/dist/react/biblio-telemetry.js +1 -1
- package/dist/react/biblio-telemetry.js.map +1 -1
- package/dist/react/chat.d.ts +1 -1
- package/dist/react/consumption.d.ts +1 -1
- package/dist/react/consumption.js +1 -1
- package/dist/react/consumption.js.map +1 -1
- package/dist/react/cvs-app.d.ts +1 -1
- package/dist/react/cvs-app.js +1 -1
- package/dist/react/cvs-app.js.map +1 -1
- package/dist/react/cvs-documents.d.ts +1 -1
- package/dist/react/cvs-documents.js +1 -1
- package/dist/react/cvs-documents.js.map +1 -1
- package/dist/react/cvs-favorites.d.ts +1 -1
- package/dist/react/cvs-favorites.js +1 -1
- package/dist/react/cvs-favorites.js.map +1 -1
- package/dist/react/cvs-ils.d.ts +1 -1
- package/dist/react/cvs-ils.js +1 -1
- package/dist/react/cvs-ils.js.map +1 -1
- package/dist/react/cvs-loans.d.ts +1 -1
- package/dist/react/cvs-loans.js +1 -1
- package/dist/react/cvs-loans.js.map +1 -1
- package/dist/react/cvs-payments.d.ts +1 -1
- package/dist/react/cvs-payments.js +1 -1
- package/dist/react/cvs-payments.js.map +1 -1
- package/dist/react/cvs-streaming.d.ts +1 -1
- package/dist/react/cvs-streaming.js +1 -1
- package/dist/react/cvs-streaming.js.map +1 -1
- package/dist/react/index.d.ts +8 -8
- package/dist/react/index.js +8 -8
- package/dist/react/partner-catalogue.d.ts +74 -1
- package/dist/react/partner-catalogue.js +95 -2
- package/dist/react/partner-catalogue.js.map +1 -1
- package/dist/react/partner-reader.d.ts +79 -6
- package/dist/react/partner-reader.js +102 -7
- package/dist/react/partner-reader.js.map +1 -1
- package/dist/react/profiles.d.ts +406 -33
- package/dist/react/profiles.js +760 -59
- package/dist/react/profiles.js.map +1 -1
- package/dist/react/search.d.ts +1 -1
- package/dist/react/search.js +1 -1
- package/dist/react/search.js.map +1 -1
- package/dist/react/tutoring-catalogue.d.ts +1 -1
- package/dist/react/tutoring-catalogue.js +1 -1
- package/dist/react/tutoring-catalogue.js.map +1 -1
- package/dist/react/tutoring-chat.d.ts +1 -1
- package/dist/react/tutoring-chat.js +1 -1
- package/dist/react/tutoring-chat.js.map +1 -1
- package/dist/react/tutoring-dispatch.d.ts +1 -1
- package/dist/react/tutoring-dispatch.js +1 -1
- package/dist/react/tutoring-dispatch.js.map +1 -1
- package/dist/react/tutoring-practitioner.d.ts +1 -1
- package/dist/react/tutoring-practitioner.js +1 -1
- package/dist/react/tutoring-practitioner.js.map +1 -1
- package/dist/react/tutoring-requests.d.ts +1 -1
- package/dist/react/tutoring-requests.js +1 -1
- package/dist/react/tutoring-requests.js.map +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"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.8.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 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;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Y,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.9.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 ListPressArticlesParams,\n PressArticleListRead,\n PressArticleRead,\n PressIssuePage,\n PressReaderAccessRead,\n PressReaderAccessWrite,\n PressReviewRead,\n ReadIssuesParams,\n ReadPressReviewParams,\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 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 getReadIssuesUrl = (articleId: number,\n params?: ReadIssuesParams,) => {\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/${articleId}/issues?${stringifiedParams}` : `/biblio/press-articles/${articleId}/issues`\n}\n\n/**\n * Entitled publication editions and covers. Never creates reader access.\n * @summary Read Issues\n */\nexport const readIssues = async (articleId: number,\n params?: ReadIssuesParams, options?: Parameters<typeof request>[1]): Promise<PressIssuePage> => {\n\n return request<PressIssuePage>(getReadIssuesUrl(articleId,params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getReadIssuesQueryKey = (articleId: number,\n params?: ReadIssuesParams,) => {\n return [\n `/biblio/press-articles/${articleId}/issues`, ...(params ? [params] : [])\n ] as const;\n }\n\n\nexport const getReadIssuesQueryOptions = <TData = Awaited<ReturnType<typeof readIssues>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(articleId: number,\n params?: ReadIssuesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readIssues>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getReadIssuesQueryKey(articleId,params);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof readIssues>>> = ({ signal }) => readIssues(articleId,params, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, enabled: articleId !== null && articleId !== undefined, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof readIssues>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ReadIssuesQueryResult = NonNullable<Awaited<ReturnType<typeof readIssues>>>\nexport type ReadIssuesQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useReadIssues<TData = Awaited<ReturnType<typeof readIssues>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n articleId: number,\n params: undefined | ReadIssuesParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof readIssues>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof readIssues>>,\n TError,\n Awaited<ReturnType<typeof readIssues>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadIssues<TData = Awaited<ReturnType<typeof readIssues>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n articleId: number,\n params?: ReadIssuesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readIssues>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof readIssues>>,\n TError,\n Awaited<ReturnType<typeof readIssues>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadIssues<TData = Awaited<ReturnType<typeof readIssues>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n articleId: number,\n params?: ReadIssuesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readIssues>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Read Issues\n */\n\nexport function useReadIssues<TData = Awaited<ReturnType<typeof readIssues>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n articleId: number,\n params?: ReadIssuesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readIssues>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getReadIssuesQueryOptions(articleId,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 getOpenReaderUrl = (articleId: number,) => {\n\n\n\n\n return `/biblio/press-articles/${articleId}/reader-access`\n}\n\n/**\n * Open a PressReader edition under this profile's current content grant.\n *\n * URL and token authorize gifted access, not the deployment catalogue API.\n * Keep lease.eventId alive with PUT /consumption/{id}; close with DELETE.\n * The date selects an edition; a missing edition is reported by PressReader.\n * @summary Open Reader\n */\nexport const openReader = async (articleId: number,\n pressReaderAccessWrite: PressReaderAccessWrite, options?: Parameters<typeof request>[1]): Promise<PressReaderAccessRead> => {\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<PressReaderAccessRead>(getOpenReaderUrl(articleId),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(pressReaderAccessWrite)\n }\n);}\n\n\n\n\n\nexport const getOpenReaderMutationKey = () => ['openReader'] as const;\n\nexport const getOpenReaderMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof openReader>>, TError,OpenReaderMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof openReader>>, TError,OpenReaderMutationVariables, TContext> => {\n\nconst mutationKey = getOpenReaderMutationKey();\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 openReader>>, OpenReaderMutationVariables> = (props) => {\n const {articleId,data} = props ?? {};\n\n return openReader(articleId,data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type OpenReaderMutationResult = NonNullable<Awaited<ReturnType<typeof openReader>>>\n export type OpenReaderMutationBody = BodyType<PressReaderAccessWrite>\n export type OpenReaderMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type OpenReaderMutationVariables = {articleId: number;data: BodyType<PressReaderAccessWrite>}\n\n /**\n * @summary Open Reader\n */\nexport const useOpenReader = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof openReader>>, TError,OpenReaderMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof openReader>>,\n TError,\n OpenReaderMutationVariables,\n TContext\n > => {\n return useMutation(getOpenReaderMutationOptions(options), queryClient);\n }\n export 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":";;;;;;;;;;;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,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,QAAkC,YAA2E;CAEnJ,OAAO,QAA8B,wBAAwB,MAAM,GACnE;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAMF,MAAa,gCAAgC,WAAsC;CAC/E,OAAO,CACP,0BAA0B,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CACnD;AACA;AAGJ,MAAa,oCAAgK,QAAkC,YAC1M;CAEL,MAAM,EAAC,OAAO,cAAc,SAAS,mBAAkB,WAAW,CAAC;CAEjE,MAAM,WAAY,cAAc,YAAY,6BAA6B,MAAM;CAI7E,MAAM,WAAyE,EAAE,aAAa,kBAAkB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AgC,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,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { $ as SearchResultsRead, $r as HTTPExceptionResponse, et as SearchParams, r as ValidationErrorResponse } from "../chunks/index.js";
|
|
3
3
|
import { a as ErrorType, c as request } from "../chunks/client.js";
|
|
4
4
|
import { DataTag, DefinedInitialDataOptions, DefinedUseQueryResult, QueryClient, QueryKey, UndefinedInitialDataOptions, UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
|
|
5
5
|
//#region src/react/biblio-search/biblio-search.d.ts
|
|
@@ -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.9.0
|
|
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.9.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 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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a,OAAO,aAAa,QAAQ;AAClD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { $r as HTTPExceptionResponse, _t as ReadingSessionWrite, r as ValidationErrorResponse, vt as ReadingSessionRead } from "../chunks/index.js";
|
|
3
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
|
|
@@ -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.9.0
|
|
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.9.0\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,2BAA2B,UAAU,GACtE;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,mBAAmB;CAC1C,CACF;AAAE;AAMF,MAAa,2CAA2C,CAAC,sBAAsB;AAE/E,MAAa,0CACW,YAC2G;CAEnI,MAAM,cAAc,mCAAmC;CACvD,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,cAAyH,UAAU;EACrI,MAAM,EAAC,YAAW,SAAQ,SAAS,CAAC;EAEpC,OAAQ,qBAAqB,YAAW,MAAK,cAAc;CAC7D;CAON,OAAQ;EAAE;EAAY,GAAG;CAAgB;AAAC;;;;AAU5C,MAAa,2BACW,SACrB,gBAKQ;CACL,OAAO,YAAY,uCAAuC,OAAO,GAAG,WAAW;AACjF"}
|
package/dist/react/chat.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { Un as MessageRead, Vn as MessageWrite } from "../chunks/index.js";
|
|
3
3
|
import { r as Client } from "../chunks/client.js";
|
|
4
4
|
import { n as ChatConnectionOptions, r as ChatStatus } from "../chunks/connection.js";
|
|
5
5
|
//#region src/chat/react.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { $r as HTTPExceptionResponse, r as ValidationErrorResponse, wr as LeaseRead } from "../chunks/index.js";
|
|
3
3
|
import { a as ErrorType, c as request } from "../chunks/client.js";
|
|
4
4
|
import { QueryClient, UseMutationOptions, UseMutationResult } from "@tanstack/react-query";
|
|
5
5
|
//#region src/react/consumption/consumption.d.ts
|
|
@@ -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.9.0
|
|
11
11
|
*/
|
|
12
12
|
const getCloseLeaseUrl = (eventId) => {
|
|
13
13
|
return `/consumption/${eventId}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consumption.js","names":[],"sources":["../../src/react/consumption/consumption.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.
|
|
1
|
+
{"version":3,"file":"consumption.js","names":[],"sources":["../../src/react/consumption/consumption.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.9.0\n */\nimport {\n useMutation\n} from '@tanstack/react-query';\nimport type {\n MutationFunction,\n QueryClient,\n UseMutationOptions,\n UseMutationResult\n} from '@tanstack/react-query';\n\nimport type {\n HTTPExceptionResponse,\n LeaseRead,\n ValidationErrorResponse\n} from '../../models';\n\nimport { request } from '../../client';\nimport type { ErrorType } from '../../client';\n\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n\n\nexport const getCloseLeaseUrl = (eventId: number,) => {\n\n\n\n\n return `/consumption/${eventId}`\n}\n\n/**\n * Finish reading. Returns the seat immediately rather than at lapse.\n *\n * ``204`` whether or not the lease was still open: the desired end state is\n * \"closed\", and a client that lost its connection and retried should not get an\n * error for succeeding twice.\n * @summary Close Lease\n */\nexport const closeLease = async (eventId: number, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getCloseLeaseUrl(eventId),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\n\n\n\nexport const getCloseLeaseMutationKey = () => ['closeLease'] as const;\n\nexport const getCloseLeaseMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof closeLease>>, TError,CloseLeaseMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof closeLease>>, TError,CloseLeaseMutationVariables, TContext> => {\n\nconst mutationKey = getCloseLeaseMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof closeLease>>, CloseLeaseMutationVariables> = (props) => {\n const {eventId} = props ?? {};\n\n return closeLease(eventId,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type CloseLeaseMutationResult = NonNullable<Awaited<ReturnType<typeof closeLease>>>\n\n export type CloseLeaseMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type CloseLeaseMutationVariables = {eventId: number}\n\n /**\n * @summary Close Lease\n */\nexport const useCloseLease = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof closeLease>>, TError,CloseLeaseMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof closeLease>>,\n TError,\n CloseLeaseMutationVariables,\n TContext\n > => {\n return useMutation(getCloseLeaseMutationOptions(options), queryClient);\n }\n export const getRenewLeaseUrl = (eventId: number,) => {\n\n\n\n\n return `/consumption/${eventId}`\n}\n\n/**\n * Heartbeat. Push the lease out; the client repeats before it lapses.\n *\n * ``404`` when the lease is closed, reaped, or somebody else's — the three are\n * deliberately indistinguishable, because a lease id is a bare integer and\n * guessing one must not reveal whether it exists.\n *\n * This does not write the ledger. A reader refreshing every thirty seconds for\n * an hour would be 120 UPDATEs on the table we bill from, for a value that only\n * matters while it is current; the durable extent is settled once, at close.\n * @summary Renew Lease\n */\nexport const renewLease = async (eventId: number, options?: Parameters<typeof request>[1]): Promise<LeaseRead> => {\n\n return request<LeaseRead>(getRenewLeaseUrl(eventId),\n {\n ...options,\n method: 'PUT'\n\n\n }\n);}\n\n\n\n\n\nexport const getRenewLeaseMutationKey = () => ['renewLease'] as const;\n\nexport const getRenewLeaseMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof renewLease>>, TError,RenewLeaseMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof renewLease>>, TError,RenewLeaseMutationVariables, TContext> => {\n\nconst mutationKey = getRenewLeaseMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof renewLease>>, RenewLeaseMutationVariables> = (props) => {\n const {eventId} = props ?? {};\n\n return renewLease(eventId,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type RenewLeaseMutationResult = NonNullable<Awaited<ReturnType<typeof renewLease>>>\n\n export type RenewLeaseMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type RenewLeaseMutationVariables = {eventId: number}\n\n /**\n * @summary Renew Lease\n */\nexport const useRenewLease = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof renewLease>>, TError,RenewLeaseMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof renewLease>>,\n TError,\n RenewLeaseMutationVariables,\n TContext\n > => {\n return useMutation(getRenewLeaseMutationOptions(options), queryClient);\n }\n"],"mappings":";;;;;;;;;;;AA+BA,MAAa,oBAAoB,YAAqB;CAKpD,OAAO,gBAAgB;AACzB;;;;;;;;;AAUA,MAAa,aAAa,OAAO,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AQ,cAAc;CAC3C;CAON,OAAQ;EAAE;EAAY,GAAG;CAAgB;AAAC;;;;AAU5C,MAAa,iBACW,SACrB,gBAKQ;CACL,OAAO,YAAY,6BAA6B,OAAO,GAAG,WAAW;AACvE"}
|
package/dist/react/cvs-app.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { $r as HTTPExceptionResponse, Rn as NotificationListRead, in as PlaybackReportRead, ir as ListNotificationsParams, r as ValidationErrorResponse, rn as PlaybackReportWrite } from "../chunks/index.js";
|
|
3
3
|
import { a as ErrorType, c as request, n as BodyType } from "../chunks/client.js";
|
|
4
4
|
import { DataTag, DefinedInitialDataOptions, DefinedUseQueryResult, QueryClient, QueryKey, UndefinedInitialDataOptions, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
|
|
5
5
|
//#region src/react/cvs-app/cvs-app.d.ts
|
package/dist/react/cvs-app.js
CHANGED
|
@@ -7,7 +7,7 @@ import { useMutation, useQuery } from "@tanstack/react-query";
|
|
|
7
7
|
* Do not edit manually.
|
|
8
8
|
* Mozaik backend
|
|
9
9
|
* Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.
|
|
10
|
-
* OpenAPI spec version: 0.
|
|
10
|
+
* OpenAPI spec version: 0.9.0
|
|
11
11
|
*/
|
|
12
12
|
const withQueryKey = (query, queryKey) => {
|
|
13
13
|
const result = { queryKey };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cvs-app.js","names":[],"sources":["../../src/react/cvs-app/cvs-app.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.8.2\n */\nimport {\n useMutation,\n useQuery\n} from '@tanstack/react-query';\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n MutationFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseMutationOptions,\n UseMutationResult,\n UseQueryOptions,\n UseQueryResult\n} from '@tanstack/react-query';\n\nimport type {\n HTTPExceptionResponse,\n ListNotificationsParams,\n NotificationListRead,\n PlaybackReportRead,\n PlaybackReportWrite,\n ValidationErrorResponse\n} from '../../models';\n\nimport { request } from '../../client';\nimport type { ErrorType , BodyType } from '../../client';\n\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n\n\nconst withQueryKey = <T extends object, K>(query: T, queryKey: K): T & { queryKey: K } => {\n const result = { queryKey } as T & { queryKey: K };\n for (const key of Object.keys(query)) {\n // The explicit queryKey always wins, matching the previous\n // `{ ...query, queryKey }` spread where it was set last.\n if (key === 'queryKey') continue;\n Object.defineProperty(result, key, {\n enumerable: true,\n configurable: true,\n get: () => (query as Record<string, unknown>)[key],\n });\n }\n return result;\n};\n\nexport const getListNotificationsUrl = (params?: ListNotificationsParams,) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : String(value))\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/cvs/notifications?${stringifiedParams}` : `/cvs/notifications`\n}\n\n/**\n * Notifications published to this caller's library.\n *\n * **These are tenant broadcasts, not a per-user inbox.** ``app_notification``\n * has no user column and no read state — ``app_notification_bm`` links a\n * notification to a library and that is the whole model. So ``unread_count`` is\n * always ``0`` here and every notification is returned every time.\n *\n * Giving each member their own read state is a schema change (a\n * ``notification_read`` row per user and notification), not a query change. It\n * is worth doing — a broadcast list that never shrinks is one people stop\n * opening — but it is a decision rather than a port, so it is not made here.\n * @summary List Notifications\n */\nexport const listNotifications = async (params?: ListNotificationsParams, options?: Parameters<typeof request>[1]): Promise<NotificationListRead> => {\n\n return request<NotificationListRead>(getListNotificationsUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getListNotificationsQueryKey = (params?: ListNotificationsParams,) => {\n return [\n `/cvs/notifications`, ...(params ? [params] : [])\n ] as const;\n }\n\n\nexport const getListNotificationsQueryOptions = <TData = Awaited<ReturnType<typeof listNotifications>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params?: ListNotificationsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listNotifications>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getListNotificationsQueryKey(params);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof listNotifications>>> = ({ signal }) => listNotifications(params, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listNotifications>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ListNotificationsQueryResult = NonNullable<Awaited<ReturnType<typeof listNotifications>>>\nexport type ListNotificationsQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useListNotifications<TData = Awaited<ReturnType<typeof listNotifications>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params: undefined | ListNotificationsParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listNotifications>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof listNotifications>>,\n TError,\n Awaited<ReturnType<typeof listNotifications>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListNotifications<TData = Awaited<ReturnType<typeof listNotifications>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListNotificationsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listNotifications>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof listNotifications>>,\n TError,\n Awaited<ReturnType<typeof listNotifications>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListNotifications<TData = Awaited<ReturnType<typeof listNotifications>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListNotificationsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listNotifications>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary List Notifications\n */\n\nexport function useListNotifications<TData = Awaited<ReturnType<typeof listNotifications>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListNotificationsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listNotifications>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getListNotificationsQueryOptions(params,options)\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n return withQueryKey(query, queryOptions.queryKey);\n}\n\n\n\n\n\n\nexport const getCreateReportUrl = () => {\n\n\n\n\n return `/cvs/reports`\n}\n\n/**\n * Report a playback problem.\n *\n * The identifying fields are taken from the credential, not the body. The\n * legacy took ``adhId``, ``bmId`` and ``bmBibLocaleId`` from the query string\n * and declared no ``Authorization`` at all, so anyone holding the shared\n * ``api_key`` — which every deployed app binary contains — could file a report\n * in any patron's name, at any library. The DTO still carries those three\n * fields, marked transition-only, and this handler ignores every one of them.\n *\n * ``email`` is free text that ends up in a message. Authenticated and\n * rate-limited it is a support channel; unauthenticated it is a spam relay with\n * the library's return address on it.\n * @summary Create Report\n */\nexport const createReport = async (playbackReportWrite: PlaybackReportWrite, options?: Parameters<typeof request>[1]): Promise<PlaybackReportRead> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<PlaybackReportRead>(getCreateReportUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(playbackReportWrite)\n }\n);}\n\n\n\n\n\nexport const getCreateReportMutationKey = () => ['createReport'] as const;\n\nexport const getCreateReportMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createReport>>, TError,CreateReportMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof createReport>>, TError,CreateReportMutationVariables, TContext> => {\n\nconst mutationKey = getCreateReportMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof createReport>>, CreateReportMutationVariables> = (props) => {\n const {data} = props ?? {};\n\n return createReport(data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type CreateReportMutationResult = NonNullable<Awaited<ReturnType<typeof createReport>>>\n export type CreateReportMutationBody = BodyType<PlaybackReportWrite>\n export type CreateReportMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type CreateReportMutationVariables = {data: BodyType<PlaybackReportWrite>}\n\n /**\n * @summary Create Report\n */\nexport const useCreateReport = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createReport>>, TError,CreateReportMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof createReport>>,\n TError,\n CreateReportMutationVariables,\n TContext\n > => {\n return useMutation(getCreateReportMutationOptions(options), queryClient);\n }\n"],"mappings":";;;;;;;;;;;AA2CA,MAAM,gBAAqC,OAAU,aAAqC;CACxF,MAAM,SAAS,EAAE,SAAS;CAC1B,KAAK,MAAM,OAAO,OAAO,KAAK,KAAK,GAAG;EAGpC,IAAI,QAAQ,YAAY;EACxB,OAAO,eAAe,QAAQ,KAAK;GACjC,YAAY;GACZ,cAAc;GACd,WAAY,MAAkC;EAChD,CAAC;CACH;CACA,OAAO;AACT;AAEA,MAAa,2BAA2B,WAAsC;CAC5E,MAAM,mBAAmB,IAAI,gBAAgB;CAE7C,OAAO,QAAQ,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,WAAW;EAErD,IAAI,UAAU,KAAA,GACZ,iBAAiB,OAAO,KAAK,UAAU,OAAO,SAAS,OAAO,KAAK,CAAC;CAExE,CAAC;CAED,MAAM,oBAAoB,iBAAiB,SAAS;CAEpD,OAAO,kBAAkB,SAAS,IAAI,sBAAsB,sBAAsB;AACpF;;;;;;;;;;;;;;;AAgBA,MAAa,oBAAoB,OAAO,QAAkC,YAA2E;CAEnJ,OAAO,QAA8B,wBAAwB,MAAM,GACnE;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,mCAAmC,CAAC,cAAc;AAE/D,MAAa,kCACW,YAC2F;CAEnH,MAAM,cAAc,2BAA2B;CAC/C,MAAM,EAAC,UAAU,iBAAiB,SAAS,mBAAkB,UACvD,QAAQ,YAAY,iBAAiB,QAAQ,YAAY,QAAQ,SAAS,cAC1E,UACE;EAAC,GAAG;EAAS,UAAU;GAAC,GAAG,QAAQ;GAAU;EAAW;CAAC,IACzD;EAAC,UAAU,EAAE,YAAa;EAAG,SAAS,KAAA;CAAS;CAKjD,MAAM,cAAyG,UAAU;EACrH,MAAM,EAAC,SAAQ,SAAS,CAAC;EAEzB,OAAQ,aAAa,MAAK,cAAc;CAC1C;CAON,OAAQ;EAAE;EAAY,GAAG;CAAgB;AAAC;;;;AAU5C,MAAa,mBACW,SACrB,gBAKQ;CACL,OAAO,YAAY,+BAA+B,OAAO,GAAG,WAAW;AACzE"}
|
|
1
|
+
{"version":3,"file":"cvs-app.js","names":[],"sources":["../../src/react/cvs-app/cvs-app.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.9.0\n */\nimport {\n useMutation,\n useQuery\n} from '@tanstack/react-query';\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n MutationFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseMutationOptions,\n UseMutationResult,\n UseQueryOptions,\n UseQueryResult\n} from '@tanstack/react-query';\n\nimport type {\n HTTPExceptionResponse,\n ListNotificationsParams,\n NotificationListRead,\n PlaybackReportRead,\n PlaybackReportWrite,\n ValidationErrorResponse\n} from '../../models';\n\nimport { request } from '../../client';\nimport type { ErrorType , BodyType } from '../../client';\n\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n\n\nconst withQueryKey = <T extends object, K>(query: T, queryKey: K): T & { queryKey: K } => {\n const result = { queryKey } as T & { queryKey: K };\n for (const key of Object.keys(query)) {\n // The explicit queryKey always wins, matching the previous\n // `{ ...query, queryKey }` spread where it was set last.\n if (key === 'queryKey') continue;\n Object.defineProperty(result, key, {\n enumerable: true,\n configurable: true,\n get: () => (query as Record<string, unknown>)[key],\n });\n }\n return result;\n};\n\nexport const getListNotificationsUrl = (params?: ListNotificationsParams,) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : String(value))\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/cvs/notifications?${stringifiedParams}` : `/cvs/notifications`\n}\n\n/**\n * Notifications published to this caller's library.\n *\n * **These are tenant broadcasts, not a per-user inbox.** ``app_notification``\n * has no user column and no read state — ``app_notification_bm`` links a\n * notification to a library and that is the whole model. So ``unread_count`` is\n * always ``0`` here and every notification is returned every time.\n *\n * Giving each member their own read state is a schema change (a\n * ``notification_read`` row per user and notification), not a query change. It\n * is worth doing — a broadcast list that never shrinks is one people stop\n * opening — but it is a decision rather than a port, so it is not made here.\n * @summary List Notifications\n */\nexport const listNotifications = async (params?: ListNotificationsParams, options?: Parameters<typeof request>[1]): Promise<NotificationListRead> => {\n\n return request<NotificationListRead>(getListNotificationsUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getListNotificationsQueryKey = (params?: ListNotificationsParams,) => {\n return [\n `/cvs/notifications`, ...(params ? [params] : [])\n ] as const;\n }\n\n\nexport const getListNotificationsQueryOptions = <TData = Awaited<ReturnType<typeof listNotifications>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params?: ListNotificationsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listNotifications>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getListNotificationsQueryKey(params);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof listNotifications>>> = ({ signal }) => listNotifications(params, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listNotifications>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ListNotificationsQueryResult = NonNullable<Awaited<ReturnType<typeof listNotifications>>>\nexport type ListNotificationsQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useListNotifications<TData = Awaited<ReturnType<typeof listNotifications>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params: undefined | ListNotificationsParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listNotifications>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof listNotifications>>,\n TError,\n Awaited<ReturnType<typeof listNotifications>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListNotifications<TData = Awaited<ReturnType<typeof listNotifications>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListNotificationsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listNotifications>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof listNotifications>>,\n TError,\n Awaited<ReturnType<typeof listNotifications>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListNotifications<TData = Awaited<ReturnType<typeof listNotifications>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListNotificationsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listNotifications>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary List Notifications\n */\n\nexport function useListNotifications<TData = Awaited<ReturnType<typeof listNotifications>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListNotificationsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listNotifications>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getListNotificationsQueryOptions(params,options)\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n return withQueryKey(query, queryOptions.queryKey);\n}\n\n\n\n\n\n\nexport const getCreateReportUrl = () => {\n\n\n\n\n return `/cvs/reports`\n}\n\n/**\n * Report a playback problem.\n *\n * The identifying fields are taken from the credential, not the body. The\n * legacy took ``adhId``, ``bmId`` and ``bmBibLocaleId`` from the query string\n * and declared no ``Authorization`` at all, so anyone holding the shared\n * ``api_key`` — which every deployed app binary contains — could file a report\n * in any patron's name, at any library. The DTO still carries those three\n * fields, marked transition-only, and this handler ignores every one of them.\n *\n * ``email`` is free text that ends up in a message. Authenticated and\n * rate-limited it is a support channel; unauthenticated it is a spam relay with\n * the library's return address on it.\n * @summary Create Report\n */\nexport const createReport = async (playbackReportWrite: PlaybackReportWrite, options?: Parameters<typeof request>[1]): Promise<PlaybackReportRead> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<PlaybackReportRead>(getCreateReportUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(playbackReportWrite)\n }\n);}\n\n\n\n\n\nexport const getCreateReportMutationKey = () => ['createReport'] as const;\n\nexport const getCreateReportMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createReport>>, TError,CreateReportMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof createReport>>, TError,CreateReportMutationVariables, TContext> => {\n\nconst mutationKey = getCreateReportMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof createReport>>, CreateReportMutationVariables> = (props) => {\n const {data} = props ?? {};\n\n return createReport(data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type CreateReportMutationResult = NonNullable<Awaited<ReturnType<typeof createReport>>>\n export type CreateReportMutationBody = BodyType<PlaybackReportWrite>\n export type CreateReportMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type CreateReportMutationVariables = {data: BodyType<PlaybackReportWrite>}\n\n /**\n * @summary Create Report\n */\nexport const useCreateReport = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createReport>>, TError,CreateReportMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof createReport>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U5C,MAAa,mBACW,SACrB,gBAKQ;CACL,OAAO,YAAY,+BAA+B,OAAO,GAAG,WAAW;AACzE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { $r as HTTPExceptionResponse, Fn as OpenAtSupplierParams, H as SupplierGrantRead, Hi as DocumentPage, Ot as RatingUpdateWrite, Ri as DocumentSearchWrite, it as ReviewRead, kr as LastPositionWrite, r as ValidationErrorResponse, rt as ReviewUpdateWrite, zi as DocumentRead } from "../chunks/index.js";
|
|
3
3
|
import { a as ErrorType, c as request, n as BodyType } from "../chunks/client.js";
|
|
4
4
|
import { DataTag, DefinedInitialDataOptions, DefinedUseQueryResult, QueryClient, QueryKey, UndefinedInitialDataOptions, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
|
|
5
5
|
//#region src/react/cvs-documents/cvs-documents.d.ts
|
|
@@ -7,7 +7,7 @@ import { useMutation, useQuery } from "@tanstack/react-query";
|
|
|
7
7
|
* Do not edit manually.
|
|
8
8
|
* Mozaik backend
|
|
9
9
|
* Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.
|
|
10
|
-
* OpenAPI spec version: 0.
|
|
10
|
+
* OpenAPI spec version: 0.9.0
|
|
11
11
|
*/
|
|
12
12
|
const withQueryKey = (query, queryKey) => {
|
|
13
13
|
const result = { queryKey };
|