@learnorama/mozaik-sdk 0.20.4-staging.65.1 → 0.22.10-staging.78.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/FRONTEND-REQUESTS.md +5 -3
- package/README.md +24 -0
- package/dist/api/account.d.ts +16 -1
- package/dist/api/account.js +30 -1
- package/dist/api/account.js.map +1 -1
- package/dist/api/admin-catalogue.d.ts +1 -1
- package/dist/api/admin-catalogue.js.map +1 -1
- package/dist/api/admin-consumption.d.ts +1 -1
- package/dist/api/admin-consumption.js.map +1 -1
- package/dist/api/admin-contracts.d.ts +1 -1
- package/dist/api/admin-contracts.js.map +1 -1
- package/dist/api/admin-customer.d.ts +1 -1
- package/dist/api/admin-customer.js.map +1 -1
- package/dist/api/admin-desk.d.ts +7 -1
- package/dist/api/admin-desk.js +33 -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-partner-selections.d.ts +1 -1
- package/dist/api/admin-partner-selections.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/admin-vod.d.ts +1 -1
- package/dist/api/admin-vod.js.map +1 -1
- package/dist/api/auth-device.d.ts +1 -1
- package/dist/api/auth-device.js.map +1 -1
- package/dist/api/auth.d.ts +7 -1
- package/dist/api/auth.js +14 -1
- package/dist/api/auth.js.map +1 -1
- package/dist/api/biblio-billing-webhooks.d.ts +1 -1
- package/dist/api/biblio-billing-webhooks.js.map +1 -1
- package/dist/api/biblio-billing.d.ts +1 -1
- package/dist/api/biblio-billing.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-learning-author-profiles.d.ts +1 -1
- package/dist/api/biblio-learning-author-profiles.js.map +1 -1
- package/dist/api/biblio-learning-authoring.d.ts +1 -1
- package/dist/api/biblio-learning-authoring.js.map +1 -1
- package/dist/api/biblio-learning-editorial.d.ts +1 -1
- package/dist/api/biblio-learning-editorial.js.map +1 -1
- package/dist/api/biblio-learning-feedback.d.ts +1 -1
- package/dist/api/biblio-learning-feedback.js.map +1 -1
- package/dist/api/biblio-learning-finance.d.ts +1 -1
- package/dist/api/biblio-learning-finance.js.map +1 -1
- package/dist/api/biblio-learning-integrations.d.ts +1 -1
- package/dist/api/biblio-learning-integrations.js.map +1 -1
- package/dist/api/biblio-learning-membership.d.ts +1 -1
- package/dist/api/biblio-learning-membership.js.map +1 -1
- package/dist/api/biblio-learning.d.ts +1 -1
- package/dist/api/biblio-learning.js.map +1 -1
- package/dist/api/biblio-library.d.ts +1 -1
- package/dist/api/biblio-library.js.map +1 -1
- package/dist/api/biblio-nextory.d.ts +1 -1
- package/dist/api/biblio-nextory.js.map +1 -1
- package/dist/api/biblio-press.d.ts +1 -1
- package/dist/api/biblio-press.js.map +1 -1
- package/dist/api/biblio-search.d.ts +1 -1
- package/dist/api/biblio-search.js.map +1 -1
- package/dist/api/biblio-telemetry.d.ts +1 -1
- package/dist/api/biblio-telemetry.js.map +1 -1
- package/dist/api/biblio-youscribe.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 +4 -4
- package/dist/api/index.js +4 -4
- package/dist/api/partner-catalogue.d.ts +4 -1
- package/dist/api/partner-catalogue.js +3 -0
- package/dist/api/partner-catalogue.js.map +1 -1
- package/dist/api/partner-reader-nextory.d.ts +1 -1
- package/dist/api/partner-reader-nextory.js.map +1 -1
- package/dist/api/partner-reader-youscribe.d.ts +1 -1
- package/dist/api/partner-reader-youscribe.js.map +1 -1
- package/dist/api/partner-reading.d.ts +1 -1
- package/dist/api/partner-reading.js.map +1 -1
- package/dist/api/profiles.d.ts +1 -1
- package/dist/api/profiles.js.map +1 -1
- package/dist/api/search.d.ts +1 -1
- package/dist/api/search.js.map +1 -1
- package/dist/api/tutoring-catalogue.d.ts +1 -1
- package/dist/api/tutoring-catalogue.js.map +1 -1
- package/dist/api/tutoring-chat.d.ts +1 -1
- package/dist/api/tutoring-chat.js.map +1 -1
- package/dist/api/tutoring-dispatch.d.ts +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 +1116 -670
- package/dist/chunks/index2.d.ts +1 -1
- 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 +118 -2
- package/dist/models.js.map +1 -1
- package/dist/react/account.d.ts +60 -1
- package/dist/react/account.js +83 -2
- 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-contracts.d.ts +1 -1
- package/dist/react/admin-contracts.js +1 -1
- package/dist/react/admin-contracts.js.map +1 -1
- package/dist/react/admin-customer.d.ts +1 -1
- package/dist/react/admin-customer.js +1 -1
- package/dist/react/admin-customer.js.map +1 -1
- package/dist/react/admin-desk.d.ts +25 -1
- package/dist/react/admin-desk.js +62 -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-partner-selections.d.ts +1 -1
- package/dist/react/admin-partner-selections.js +1 -1
- package/dist/react/admin-partner-selections.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/admin-vod.d.ts +1 -1
- package/dist/react/admin-vod.js +1 -1
- package/dist/react/admin-vod.js.map +1 -1
- package/dist/react/auth-device.d.ts +1 -1
- package/dist/react/auth-device.js +1 -1
- package/dist/react/auth-device.js.map +1 -1
- package/dist/react/auth.d.ts +34 -1
- package/dist/react/auth.js +39 -2
- package/dist/react/auth.js.map +1 -1
- package/dist/react/biblio-billing-webhooks.d.ts +1 -1
- package/dist/react/biblio-billing-webhooks.js +1 -1
- package/dist/react/biblio-billing-webhooks.js.map +1 -1
- package/dist/react/biblio-billing.d.ts +1 -1
- package/dist/react/biblio-billing.js +1 -1
- package/dist/react/biblio-billing.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-learning-author-profiles.d.ts +1 -1
- package/dist/react/biblio-learning-author-profiles.js +1 -1
- package/dist/react/biblio-learning-author-profiles.js.map +1 -1
- package/dist/react/biblio-learning-authoring.d.ts +1 -1
- package/dist/react/biblio-learning-authoring.js +1 -1
- package/dist/react/biblio-learning-authoring.js.map +1 -1
- package/dist/react/biblio-learning-editorial.d.ts +1 -1
- package/dist/react/biblio-learning-editorial.js +1 -1
- package/dist/react/biblio-learning-editorial.js.map +1 -1
- package/dist/react/biblio-learning-feedback.d.ts +1 -1
- package/dist/react/biblio-learning-feedback.js +1 -1
- package/dist/react/biblio-learning-feedback.js.map +1 -1
- package/dist/react/biblio-learning-finance.d.ts +1 -1
- package/dist/react/biblio-learning-finance.js +1 -1
- package/dist/react/biblio-learning-finance.js.map +1 -1
- package/dist/react/biblio-learning-integrations.d.ts +1 -1
- package/dist/react/biblio-learning-integrations.js +1 -1
- package/dist/react/biblio-learning-integrations.js.map +1 -1
- package/dist/react/biblio-learning-membership.d.ts +1 -1
- package/dist/react/biblio-learning-membership.js +1 -1
- package/dist/react/biblio-learning-membership.js.map +1 -1
- package/dist/react/biblio-learning.d.ts +1 -1
- package/dist/react/biblio-learning.js +1 -1
- package/dist/react/biblio-learning.js.map +1 -1
- package/dist/react/biblio-library.d.ts +1 -1
- package/dist/react/biblio-library.js +1 -1
- package/dist/react/biblio-library.js.map +1 -1
- package/dist/react/biblio-nextory.d.ts +1 -1
- package/dist/react/biblio-nextory.js +1 -1
- package/dist/react/biblio-nextory.js.map +1 -1
- package/dist/react/biblio-press.d.ts +1 -1
- package/dist/react/biblio-press.js +1 -1
- package/dist/react/biblio-press.js.map +1 -1
- package/dist/react/biblio-search.d.ts +1 -1
- package/dist/react/biblio-search.js +1 -1
- package/dist/react/biblio-search.js.map +1 -1
- package/dist/react/biblio-telemetry.d.ts +1 -1
- package/dist/react/biblio-telemetry.js +1 -1
- package/dist/react/biblio-telemetry.js.map +1 -1
- package/dist/react/biblio-youscribe.d.ts +1 -1
- package/dist/react/biblio-youscribe.js +1 -1
- package/dist/react/biblio-youscribe.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 +4 -4
- package/dist/react/index.js +4 -4
- package/dist/react/partner-catalogue.d.ts +4 -1
- package/dist/react/partner-catalogue.js +4 -1
- package/dist/react/partner-catalogue.js.map +1 -1
- package/dist/react/partner-reader-nextory.d.ts +1 -1
- package/dist/react/partner-reader-nextory.js +1 -1
- package/dist/react/partner-reader-nextory.js.map +1 -1
- package/dist/react/partner-reader-youscribe.d.ts +1 -1
- package/dist/react/partner-reader-youscribe.js +1 -1
- package/dist/react/partner-reader-youscribe.js.map +1 -1
- package/dist/react/partner-reading.d.ts +1 -1
- package/dist/react/partner-reading.js +1 -1
- package/dist/react/partner-reading.js.map +1 -1
- package/dist/react/profiles.d.ts +1 -1
- package/dist/react/profiles.js +1 -1
- package/dist/react/profiles.js.map +1 -1
- package/dist/react/search.d.ts +1 -1
- package/dist/react/search.js +1 -1
- package/dist/react/search.js.map +1 -1
- package/dist/react/tutoring-catalogue.d.ts +1 -1
- package/dist/react/tutoring-catalogue.js +1 -1
- package/dist/react/tutoring-catalogue.js.map +1 -1
- package/dist/react/tutoring-chat.d.ts +1 -1
- package/dist/react/tutoring-chat.js +1 -1
- package/dist/react/tutoring-chat.js.map +1 -1
- package/dist/react/tutoring-dispatch.d.ts +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":"partner-reader-nextory.js","names":[],"sources":["../../src/react/partner-reader-nextory/partner-reader-nextory.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.20.4\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 BookReadingPositionWrite,\n HTTPExceptionResponse,\n NextoryPackageRead,\n NextoryUsageBlocksWrite,\n ReadPackageParams,\n ReadingPositionRead,\n ReadingPositionWrite,\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 getReadPackageUrl = (mediaId: number,\n params?: ReadPackageParams,) => {\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 ? `/partners/nextory/media/${mediaId}/package?${stringifiedParams}` : `/partners/nextory/media/${mediaId}/package`\n}\n\n/**\n * The package the local player opens, and the lease of this reading.\n *\n * The legacy's ``get-epub-package`` and ``get-audio-package``, by ``format``.\n * The package carries short-lived credentials: it is not cached here and\n * should not be stored by the client.\n *\n * The reading must have been opened through reader-access, which took the\n * lease: renew it with ``PUT /consumption/{eventId}`` and drop it with\n * ``DELETE`` when the reader closes. Fetching the package again returns the\n * lease already held, so a page reload does not leak a seat.\n * @summary Read Package\n */\nexport const readPackage = async (mediaId: number,\n params?: ReadPackageParams, options?: Parameters<typeof request>[1]): Promise<NextoryPackageRead> => {\n\n return request<NextoryPackageRead>(getReadPackageUrl(mediaId,params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getReadPackageQueryKey = (mediaId: number,\n params?: ReadPackageParams,) => {\n return [\n `/partners/nextory/media/${mediaId}/package`, ...(params ? [params] : [])\n ] as const;\n }\n\n\nexport const getReadPackageQueryOptions = <TData = Awaited<ReturnType<typeof readPackage>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(mediaId: number,\n params?: ReadPackageParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPackage>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getReadPackageQueryKey(mediaId,params);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof readPackage>>> = ({ signal }) => readPackage(mediaId,params, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, enabled: mediaId !== null && mediaId !== undefined, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof readPackage>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ReadPackageQueryResult = NonNullable<Awaited<ReturnType<typeof readPackage>>>\nexport type ReadPackageQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useReadPackage<TData = Awaited<ReturnType<typeof readPackage>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n mediaId: number,\n params: undefined | ReadPackageParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPackage>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof readPackage>>,\n TError,\n Awaited<ReturnType<typeof readPackage>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadPackage<TData = Awaited<ReturnType<typeof readPackage>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n mediaId: number,\n params?: ReadPackageParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPackage>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof readPackage>>,\n TError,\n Awaited<ReturnType<typeof readPackage>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadPackage<TData = Awaited<ReturnType<typeof readPackage>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n mediaId: number,\n params?: ReadPackageParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPackage>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Read Package\n */\n\nexport function useReadPackage<TData = Awaited<ReturnType<typeof readPackage>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n mediaId: number,\n params?: ReadPackageParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPackage>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getReadPackageQueryOptions(mediaId,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 getReadPositionUrl = (mediaId: number,) => {\n\n\n\n\n return `/partners/nextory/media/${mediaId}/position`\n}\n\n/**\n * The last synchronized local position, or the partner's when none is saved.\n *\n * The legacy's ``fetchBookReading``: when the partner holds no position, the\n * empty one, as the legacy answered it — ``percentage`` 0, ``reachedAt``\n * null — so the player starts at the beginning.\n * @summary Read Position\n */\nexport const readPosition = async (mediaId: number, options?: Parameters<typeof request>[1]): Promise<ReadingPositionRead> => {\n\n return request<ReadingPositionRead>(getReadPositionUrl(mediaId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getReadPositionQueryKey = (mediaId: number,) => {\n return [\n `/partners/nextory/media/${mediaId}/position`\n ] as const;\n }\n\n\nexport const getReadPositionQueryOptions = <TData = Awaited<ReturnType<typeof readPosition>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(mediaId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPosition>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getReadPositionQueryKey(mediaId);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof readPosition>>> = ({ signal }) => readPosition(mediaId, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, enabled: mediaId !== null && mediaId !== undefined, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof readPosition>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ReadPositionQueryResult = NonNullable<Awaited<ReturnType<typeof readPosition>>>\nexport type ReadPositionQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useReadPosition<TData = Awaited<ReturnType<typeof readPosition>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n mediaId: number, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPosition>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof readPosition>>,\n TError,\n Awaited<ReturnType<typeof readPosition>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadPosition<TData = Awaited<ReturnType<typeof readPosition>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n mediaId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPosition>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof readPosition>>,\n TError,\n Awaited<ReturnType<typeof readPosition>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadPosition<TData = Awaited<ReturnType<typeof readPosition>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n mediaId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPosition>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Read Position\n */\n\nexport function useReadPosition<TData = Awaited<ReturnType<typeof readPosition>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n mediaId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPosition>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getReadPositionQueryOptions(mediaId,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 getWritePositionUrl = (mediaId: number,) => {\n\n\n\n\n return `/partners/nextory/media/${mediaId}/position`\n}\n\n/**\n * 0.17's report: the legacy's ``patch-book-reading``, both kinds at once.\n *\n * Use ``PUT …/position`` and ``POST …/usage-blocks``; the legacy reader\n * itself never sent both in one call. Usage blocks first, then the position,\n * as before; answers the position now held.\n * @deprecated\n * @summary Write Position\n */\nexport const writePosition = async (mediaId: number,\n readingPositionWrite: ReadingPositionWrite, options?: Parameters<typeof request>[1]): Promise<ReadingPositionRead> => {\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<ReadingPositionRead>(getWritePositionUrl(mediaId),\n {\n ...options,\n method: 'PATCH',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(readingPositionWrite)\n }\n);}\n\n\n\n\n\nexport const getWritePositionMutationKey = () => ['writePosition'] as const;\n\nexport const getWritePositionMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof writePosition>>, TError,WritePositionMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof writePosition>>, TError,WritePositionMutationVariables, TContext> => {\n\nconst mutationKey = getWritePositionMutationKey();\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 writePosition>>, WritePositionMutationVariables> = (props) => {\n const {mediaId,data} = props ?? {};\n\n return writePosition(mediaId,data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type WritePositionMutationResult = NonNullable<Awaited<ReturnType<typeof writePosition>>>\n export type WritePositionMutationBody = BodyType<ReadingPositionWrite>\n export type WritePositionMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type WritePositionMutationVariables = {mediaId: number;data: BodyType<ReadingPositionWrite>}\n\n /**\n * @deprecated\n * @summary Write Position\n */\nexport const useWritePosition = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof writePosition>>, TError,WritePositionMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof writePosition>>,\n TError,\n WritePositionMutationVariables,\n TContext\n > => {\n return useMutation(getWritePositionMutationOptions(options), queryClient);\n }\n export const getSavePositionUrl = (mediaId: number,) => {\n\n\n\n\n return `/partners/nextory/media/${mediaId}/position`\n}\n\n/**\n * Where the reader is now: the legacy reader's ``book_reading.position``.\n *\n * Answers the position now held. Only a strictly newer ``reached_at``\n * replaces the saved one and goes to Nextory, so sending the same position\n * again changes nothing and calls nobody; an older one is ignored. A\n * different position at the same instant is a 409 before any call. Progress\n * is a resume point, not a measurement of time spent reading: that is what\n * usage blocks are for.\n * @summary Save Position\n */\nexport const savePosition = async (mediaId: number,\n bookReadingPositionWrite: BookReadingPositionWrite, options?: Parameters<typeof request>[1]): Promise<ReadingPositionRead> => {\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<ReadingPositionRead>(getSavePositionUrl(mediaId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(bookReadingPositionWrite)\n }\n);}\n\n\n\n\n\nexport const getSavePositionMutationKey = () => ['savePosition'] as const;\n\nexport const getSavePositionMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof savePosition>>, TError,SavePositionMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof savePosition>>, TError,SavePositionMutationVariables, TContext> => {\n\nconst mutationKey = getSavePositionMutationKey();\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 savePosition>>, SavePositionMutationVariables> = (props) => {\n const {mediaId,data} = props ?? {};\n\n return savePosition(mediaId,data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type SavePositionMutationResult = NonNullable<Awaited<ReturnType<typeof savePosition>>>\n export type SavePositionMutationBody = BodyType<BookReadingPositionWrite>\n export type SavePositionMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type SavePositionMutationVariables = {mediaId: number;data: BodyType<BookReadingPositionWrite>}\n\n /**\n * @summary Save Position\n */\nexport const useSavePosition = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof savePosition>>, TError,SavePositionMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof savePosition>>,\n TError,\n SavePositionMutationVariables,\n TContext\n > => {\n return useMutation(getSavePositionMutationOptions(options), queryClient);\n }\n export const getReportUsageBlocksUrl = (mediaId: number,) => {\n\n\n\n\n return `/partners/nextory/media/${mediaId}/usage-blocks`\n}\n\n/**\n * What was read or heard: the legacy reader's ``book_reading.usage_blocks``.\n *\n * Nextory measures each patron's consumption with these. Forwarded every\n * time, retries included, since Nextory's deduplication contract is unknown:\n * send a batch once. Blocks ending at an integer 0 are dropped, as the legacy\n * did, and a batch left empty calls nobody.\n * @summary Report Usage Blocks\n */\nexport const reportUsageBlocks = async (mediaId: number,\n nextoryUsageBlocksWrite: NextoryUsageBlocksWrite, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<void>(getReportUsageBlocksUrl(mediaId),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(nextoryUsageBlocksWrite)\n }\n);}\n\n\n\n\n\nexport const getReportUsageBlocksMutationKey = () => ['reportUsageBlocks'] as const;\n\nexport const getReportUsageBlocksMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof reportUsageBlocks>>, TError,ReportUsageBlocksMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof reportUsageBlocks>>, TError,ReportUsageBlocksMutationVariables, TContext> => {\n\nconst mutationKey = getReportUsageBlocksMutationKey();\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 reportUsageBlocks>>, ReportUsageBlocksMutationVariables> = (props) => {\n const {mediaId,data} = props ?? {};\n\n return reportUsageBlocks(mediaId,data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type ReportUsageBlocksMutationResult = NonNullable<Awaited<ReturnType<typeof reportUsageBlocks>>>\n export type ReportUsageBlocksMutationBody = BodyType<NextoryUsageBlocksWrite>\n export type ReportUsageBlocksMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type ReportUsageBlocksMutationVariables = {mediaId: number;data: BodyType<NextoryUsageBlocksWrite>}\n\n /**\n * @summary Report Usage Blocks\n */\nexport const useReportUsageBlocks = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof reportUsageBlocks>>, TError,ReportUsageBlocksMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof reportUsageBlocks>>,\n TError,\n ReportUsageBlocksMutationVariables,\n TContext\n > => {\n return useMutation(getReportUsageBlocksMutationOptions(options), queryClient);\n }\n"],"mappings":";;;;;;;;;;;AA6CA,MAAM,gBAAqC,OAAU,aAAqC;CACxF,MAAM,SAAS,EAAE,SAAS;CAC1B,KAAK,MA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,OAAO,QAAgD,CAAC,GAClF,IAAI,UAAU,KAAA,GAAW,QAAQ,QAAQ;EAE3C,OAAO;CACT;CACF,OAAO,QAAc,wBAAwB,OAAO,GAClD;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,uBAAuB;CAC9C,CACF;AAAE;AAMF,MAAa,wCAAwC,CAAC,mBAAmB;AAEzE,MAAa,uCACW,YACqG;CAE7H,MAAM,cAAc,gCAAgC;CACpD,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,cAAmH,UAAU;EAC/H,MAAM,EAAC,SAAQ,SAAQ,SAAS,CAAC;EAEjC,OAAQ,kBAAkB,SAAQ,MAAK,cAAc;CACvD;CAON,OAAQ;EAAE;EAAY,GAAG;CAAgB;AAAC;;;;AAU5C,MAAa,wBACW,SACrB,gBAKQ;CACL,OAAO,YAAY,oCAAoC,OAAO,GAAG,WAAW;AAC9E"}
|
|
1
|
+
{"version":3,"file":"partner-reader-nextory.js","names":[],"sources":["../../src/react/partner-reader-nextory/partner-reader-nextory.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.22.10\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 BookReadingPositionWrite,\n HTTPExceptionResponse,\n NextoryPackageRead,\n NextoryUsageBlocksWrite,\n ReadPackageParams,\n ReadingPositionRead,\n ReadingPositionWrite,\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 getReadPackageUrl = (mediaId: number,\n params?: ReadPackageParams,) => {\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 ? `/partners/nextory/media/${mediaId}/package?${stringifiedParams}` : `/partners/nextory/media/${mediaId}/package`\n}\n\n/**\n * The package the local player opens, and the lease of this reading.\n *\n * The legacy's ``get-epub-package`` and ``get-audio-package``, by ``format``.\n * The package carries short-lived credentials: it is not cached here and\n * should not be stored by the client.\n *\n * The reading must have been opened through reader-access, which took the\n * lease: renew it with ``PUT /consumption/{eventId}`` and drop it with\n * ``DELETE`` when the reader closes. Fetching the package again returns the\n * lease already held, so a page reload does not leak a seat.\n * @summary Read Package\n */\nexport const readPackage = async (mediaId: number,\n params?: ReadPackageParams, options?: Parameters<typeof request>[1]): Promise<NextoryPackageRead> => {\n\n return request<NextoryPackageRead>(getReadPackageUrl(mediaId,params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getReadPackageQueryKey = (mediaId: number,\n params?: ReadPackageParams,) => {\n return [\n `/partners/nextory/media/${mediaId}/package`, ...(params ? [params] : [])\n ] as const;\n }\n\n\nexport const getReadPackageQueryOptions = <TData = Awaited<ReturnType<typeof readPackage>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(mediaId: number,\n params?: ReadPackageParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPackage>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getReadPackageQueryKey(mediaId,params);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof readPackage>>> = ({ signal }) => readPackage(mediaId,params, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, enabled: mediaId !== null && mediaId !== undefined, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof readPackage>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ReadPackageQueryResult = NonNullable<Awaited<ReturnType<typeof readPackage>>>\nexport type ReadPackageQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useReadPackage<TData = Awaited<ReturnType<typeof readPackage>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n mediaId: number,\n params: undefined | ReadPackageParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPackage>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof readPackage>>,\n TError,\n Awaited<ReturnType<typeof readPackage>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadPackage<TData = Awaited<ReturnType<typeof readPackage>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n mediaId: number,\n params?: ReadPackageParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPackage>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof readPackage>>,\n TError,\n Awaited<ReturnType<typeof readPackage>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadPackage<TData = Awaited<ReturnType<typeof readPackage>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n mediaId: number,\n params?: ReadPackageParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPackage>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Read Package\n */\n\nexport function useReadPackage<TData = Awaited<ReturnType<typeof readPackage>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n mediaId: number,\n params?: ReadPackageParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPackage>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getReadPackageQueryOptions(mediaId,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 getReadPositionUrl = (mediaId: number,) => {\n\n\n\n\n return `/partners/nextory/media/${mediaId}/position`\n}\n\n/**\n * The last synchronized local position, or the partner's when none is saved.\n *\n * The legacy's ``fetchBookReading``: when the partner holds no position, the\n * empty one, as the legacy answered it — ``percentage`` 0, ``reachedAt``\n * null — so the player starts at the beginning.\n * @summary Read Position\n */\nexport const readPosition = async (mediaId: number, options?: Parameters<typeof request>[1]): Promise<ReadingPositionRead> => {\n\n return request<ReadingPositionRead>(getReadPositionUrl(mediaId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getReadPositionQueryKey = (mediaId: number,) => {\n return [\n `/partners/nextory/media/${mediaId}/position`\n ] as const;\n }\n\n\nexport const getReadPositionQueryOptions = <TData = Awaited<ReturnType<typeof readPosition>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(mediaId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPosition>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getReadPositionQueryKey(mediaId);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof readPosition>>> = ({ signal }) => readPosition(mediaId, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, enabled: mediaId !== null && mediaId !== undefined, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof readPosition>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ReadPositionQueryResult = NonNullable<Awaited<ReturnType<typeof readPosition>>>\nexport type ReadPositionQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useReadPosition<TData = Awaited<ReturnType<typeof readPosition>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n mediaId: number, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPosition>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof readPosition>>,\n TError,\n Awaited<ReturnType<typeof readPosition>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadPosition<TData = Awaited<ReturnType<typeof readPosition>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n mediaId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPosition>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof readPosition>>,\n TError,\n Awaited<ReturnType<typeof readPosition>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadPosition<TData = Awaited<ReturnType<typeof readPosition>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n mediaId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPosition>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Read Position\n */\n\nexport function useReadPosition<TData = Awaited<ReturnType<typeof readPosition>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n mediaId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPosition>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getReadPositionQueryOptions(mediaId,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 getWritePositionUrl = (mediaId: number,) => {\n\n\n\n\n return `/partners/nextory/media/${mediaId}/position`\n}\n\n/**\n * 0.17's report: the legacy's ``patch-book-reading``, both kinds at once.\n *\n * Use ``PUT …/position`` and ``POST …/usage-blocks``; the legacy reader\n * itself never sent both in one call. Usage blocks first, then the position,\n * as before; answers the position now held.\n * @deprecated\n * @summary Write Position\n */\nexport const writePosition = async (mediaId: number,\n readingPositionWrite: ReadingPositionWrite, options?: Parameters<typeof request>[1]): Promise<ReadingPositionRead> => {\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<ReadingPositionRead>(getWritePositionUrl(mediaId),\n {\n ...options,\n method: 'PATCH',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(readingPositionWrite)\n }\n);}\n\n\n\n\n\nexport const getWritePositionMutationKey = () => ['writePosition'] as const;\n\nexport const getWritePositionMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof writePosition>>, TError,WritePositionMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof writePosition>>, TError,WritePositionMutationVariables, TContext> => {\n\nconst mutationKey = getWritePositionMutationKey();\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 writePosition>>, WritePositionMutationVariables> = (props) => {\n const {mediaId,data} = props ?? {};\n\n return writePosition(mediaId,data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type WritePositionMutationResult = NonNullable<Awaited<ReturnType<typeof writePosition>>>\n export type WritePositionMutationBody = BodyType<ReadingPositionWrite>\n export type WritePositionMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type WritePositionMutationVariables = {mediaId: number;data: BodyType<ReadingPositionWrite>}\n\n /**\n * @deprecated\n * @summary Write Position\n */\nexport const useWritePosition = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof writePosition>>, TError,WritePositionMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof writePosition>>,\n TError,\n WritePositionMutationVariables,\n TContext\n > => {\n return useMutation(getWritePositionMutationOptions(options), queryClient);\n }\n export const getSavePositionUrl = (mediaId: number,) => {\n\n\n\n\n return `/partners/nextory/media/${mediaId}/position`\n}\n\n/**\n * Where the reader is now: the legacy reader's ``book_reading.position``.\n *\n * Answers the position now held. Only a strictly newer ``reached_at``\n * replaces the saved one and goes to Nextory, so sending the same position\n * again changes nothing and calls nobody; an older one is ignored. A\n * different position at the same instant is a 409 before any call. Progress\n * is a resume point, not a measurement of time spent reading: that is what\n * usage blocks are for.\n * @summary Save Position\n */\nexport const savePosition = async (mediaId: number,\n bookReadingPositionWrite: BookReadingPositionWrite, options?: Parameters<typeof request>[1]): Promise<ReadingPositionRead> => {\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<ReadingPositionRead>(getSavePositionUrl(mediaId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(bookReadingPositionWrite)\n }\n);}\n\n\n\n\n\nexport const getSavePositionMutationKey = () => ['savePosition'] as const;\n\nexport const getSavePositionMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof savePosition>>, TError,SavePositionMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof savePosition>>, TError,SavePositionMutationVariables, TContext> => {\n\nconst mutationKey = getSavePositionMutationKey();\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 savePosition>>, SavePositionMutationVariables> = (props) => {\n const {mediaId,data} = props ?? {};\n\n return savePosition(mediaId,data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type SavePositionMutationResult = NonNullable<Awaited<ReturnType<typeof savePosition>>>\n export type SavePositionMutationBody = BodyType<BookReadingPositionWrite>\n export type SavePositionMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type SavePositionMutationVariables = {mediaId: number;data: BodyType<BookReadingPositionWrite>}\n\n /**\n * @summary Save Position\n */\nexport const useSavePosition = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof savePosition>>, TError,SavePositionMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof savePosition>>,\n TError,\n SavePositionMutationVariables,\n TContext\n > => {\n return useMutation(getSavePositionMutationOptions(options), queryClient);\n }\n export const getReportUsageBlocksUrl = (mediaId: number,) => {\n\n\n\n\n return `/partners/nextory/media/${mediaId}/usage-blocks`\n}\n\n/**\n * What was read or heard: the legacy reader's ``book_reading.usage_blocks``.\n *\n * Nextory measures each patron's consumption with these. Forwarded every\n * time, retries included, since Nextory's deduplication contract is unknown:\n * send a batch once. Blocks ending at an integer 0 are dropped, as the legacy\n * did, and a batch left empty calls nobody.\n * @summary Report Usage Blocks\n */\nexport const reportUsageBlocks = async (mediaId: number,\n nextoryUsageBlocksWrite: NextoryUsageBlocksWrite, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<void>(getReportUsageBlocksUrl(mediaId),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(nextoryUsageBlocksWrite)\n }\n);}\n\n\n\n\n\nexport const getReportUsageBlocksMutationKey = () => ['reportUsageBlocks'] as const;\n\nexport const getReportUsageBlocksMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof reportUsageBlocks>>, TError,ReportUsageBlocksMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof reportUsageBlocks>>, TError,ReportUsageBlocksMutationVariables, TContext> => {\n\nconst mutationKey = getReportUsageBlocksMutationKey();\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 reportUsageBlocks>>, ReportUsageBlocksMutationVariables> = (props) => {\n const {mediaId,data} = props ?? {};\n\n return reportUsageBlocks(mediaId,data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type ReportUsageBlocksMutationResult = NonNullable<Awaited<ReturnType<typeof reportUsageBlocks>>>\n export type ReportUsageBlocksMutationBody = BodyType<NextoryUsageBlocksWrite>\n export type ReportUsageBlocksMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type ReportUsageBlocksMutationVariables = {mediaId: number;data: BodyType<NextoryUsageBlocksWrite>}\n\n /**\n * @summary Report Usage Blocks\n */\nexport const useReportUsageBlocks = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof reportUsageBlocks>>, TError,ReportUsageBlocksMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof reportUsageBlocks>>,\n TError,\n ReportUsageBlocksMutationVariables,\n TContext\n > => {\n return useMutation(getReportUsageBlocksMutationOptions(options), queryClient);\n }\n"],"mappings":";;;;;;;;;;;AA6CA,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,qBAAqB,SAC9B,WAAgC;CAClC,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,OAA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,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,cAAmH,UAAU;EAC/H,MAAM,EAAC,SAAQ,SAAQ,SAAS,CAAC;EAEjC,OAAQ,kBAAkB,SAAQ,MAAK,cAAc;CACvD;CAON,OAAQ;EAAE;EAAY,GAAG;CAAgB;AAAC;;;;AAU5C,MAAa,wBACW,SACrB,gBAKQ;CACL,OAAO,YAAY,oCAAoC,OAAO,GAAG,WAAW;AAC9E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { An as ReadHostedPackageParams, Dd as HTTPExceptionResponse, E as ValidationErrorResponse, Pn as ReaderPackageRead, Ra as OfflineVerificationKeyRead, i as YouScribeAuthRead, n as YouScribeDownloadRead, t as YouScribeReaderRead } from "../chunks/index.js";
|
|
3
3
|
import { a as ErrorType, c as request } from "../chunks/client.js";
|
|
4
4
|
import { DataTag, DefinedInitialDataOptions, DefinedUseQueryResult, QueryClient, QueryKey, UndefinedInitialDataOptions, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
|
|
5
5
|
//#region src/react/partner-reader-youscribe/partner-reader-youscribe.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.22.10
|
|
11
11
|
*/
|
|
12
12
|
const withQueryKey = (query, queryKey) => {
|
|
13
13
|
const result = { queryKey };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"partner-reader-youscribe.js","names":[],"sources":["../../src/react/partner-reader-youscribe/partner-reader-youscribe.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.20.4\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 OfflineVerificationKeyRead,\n ReadHostedPackageParams,\n ReaderPackageRead,\n ValidationErrorResponse,\n YouScribeAuthRead,\n YouScribeDownloadRead,\n YouScribeReaderRead\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 getReadYouscribeDownloadVerificationKeyUrl = () => {\n\n\n\n\n return `/partners/youscribe/download-verification-key`\n}\n\n/**\n * Fetch the current public verification key over the authenticated online channel.\n * @summary Read Youscribe Download Verification Key\n */\nexport const readYouscribeDownloadVerificationKey = async ( options?: Parameters<typeof request>[1]): Promise<OfflineVerificationKeyRead> => {\n\n return request<OfflineVerificationKeyRead>(getReadYouscribeDownloadVerificationKeyUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getReadYouscribeDownloadVerificationKeyQueryKey = () => {\n return [\n `/partners/youscribe/download-verification-key`\n ] as const;\n }\n\n\nexport const getReadYouscribeDownloadVerificationKeyQueryOptions = <TData = Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getReadYouscribeDownloadVerificationKeyQueryKey();\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>> = ({ signal }) => readYouscribeDownloadVerificationKey({ signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ReadYouscribeDownloadVerificationKeyQueryResult = NonNullable<Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>>\nexport type ReadYouscribeDownloadVerificationKeyQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useReadYouscribeDownloadVerificationKey<TData = Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>,\n TError,\n Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadYouscribeDownloadVerificationKey<TData = Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>,\n TError,\n Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadYouscribeDownloadVerificationKey<TData = Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Read Youscribe Download Verification Key\n */\n\nexport function useReadYouscribeDownloadVerificationKey<TData = Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getReadYouscribeDownloadVerificationKeyQueryOptions(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 getAcquireYouscribeDownloadUrl = (mediaId: number,) => {\n\n\n\n\n return `/partners/youscribe/media/${mediaId}/downloads`\n}\n\n/**\n * Authorize SDK acquisition for an existing seat. Creates neither a subscription nor a reading event.\n * @summary Acquire Youscribe Download\n */\nexport const acquireYouscribeDownload = async (mediaId: number, options?: Parameters<typeof request>[1]): Promise<YouScribeDownloadRead> => {\n\n return request<YouScribeDownloadRead>(getAcquireYouscribeDownloadUrl(mediaId),\n {\n ...options,\n method: 'POST'\n\n\n }\n);}\n\n\n\n\n\nexport const getAcquireYouscribeDownloadMutationKey = () => ['acquireYouscribeDownload'] as const;\n\nexport const getAcquireYouscribeDownloadMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof acquireYouscribeDownload>>, TError,AcquireYouscribeDownloadMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof acquireYouscribeDownload>>, TError,AcquireYouscribeDownloadMutationVariables, TContext> => {\n\nconst mutationKey = getAcquireYouscribeDownloadMutationKey();\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 acquireYouscribeDownload>>, AcquireYouscribeDownloadMutationVariables> = (props) => {\n const {mediaId} = props ?? {};\n\n return acquireYouscribeDownload(mediaId,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type AcquireYouscribeDownloadMutationResult = NonNullable<Awaited<ReturnType<typeof acquireYouscribeDownload>>>\n\n export type AcquireYouscribeDownloadMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type AcquireYouscribeDownloadMutationVariables = {mediaId: number}\n\n /**\n * @summary Acquire Youscribe Download\n */\nexport const useAcquireYouscribeDownload = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof acquireYouscribeDownload>>, TError,AcquireYouscribeDownloadMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof acquireYouscribeDownload>>,\n TError,\n AcquireYouscribeDownloadMutationVariables,\n TContext\n > => {\n return useMutation(getAcquireYouscribeDownloadMutationOptions(options), queryClient);\n }\n export const getReadHostedPackageUrl = (mediaId: number,\n params?: ReadHostedPackageParams,) => {\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 ? `/partners/youscribe/media/${mediaId}/package?${stringifiedParams}` : `/partners/youscribe/media/${mediaId}/package`\n}\n\n/**\n * **Deprecated**: the hosted reader's address and a lease. As in 0.13.0.\n *\n * Requires a seat already taken and never takes one: a GET does not buy a\n * subscription.\n * @deprecated\n * @summary Read Hosted Package\n */\nexport const readHostedPackage = async (mediaId: number,\n params?: ReadHostedPackageParams, options?: Parameters<typeof request>[1]): Promise<ReaderPackageRead> => {\n\n return request<ReaderPackageRead>(getReadHostedPackageUrl(mediaId,params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getReadHostedPackageQueryKey = (mediaId: number,\n params?: ReadHostedPackageParams,) => {\n return [\n `/partners/youscribe/media/${mediaId}/package`, ...(params ? [params] : [])\n ] as const;\n }\n\n\nexport const getReadHostedPackageQueryOptions = <TData = Awaited<ReturnType<typeof readHostedPackage>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(mediaId: number,\n params?: ReadHostedPackageParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readHostedPackage>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getReadHostedPackageQueryKey(mediaId,params);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof readHostedPackage>>> = ({ signal }) => readHostedPackage(mediaId,params, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, enabled: mediaId !== null && mediaId !== undefined, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof readHostedPackage>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ReadHostedPackageQueryResult = NonNullable<Awaited<ReturnType<typeof readHostedPackage>>>\nexport type ReadHostedPackageQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useReadHostedPackage<TData = Awaited<ReturnType<typeof readHostedPackage>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n mediaId: number,\n params: undefined | ReadHostedPackageParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof readHostedPackage>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof readHostedPackage>>,\n TError,\n Awaited<ReturnType<typeof readHostedPackage>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadHostedPackage<TData = Awaited<ReturnType<typeof readHostedPackage>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n mediaId: number,\n params?: ReadHostedPackageParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readHostedPackage>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof readHostedPackage>>,\n TError,\n Awaited<ReturnType<typeof readHostedPackage>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadHostedPackage<TData = Awaited<ReturnType<typeof readHostedPackage>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n mediaId: number,\n params?: ReadHostedPackageParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readHostedPackage>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @deprecated\n * @summary Read Hosted Package\n */\n\nexport function useReadHostedPackage<TData = Awaited<ReturnType<typeof readHostedPackage>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n mediaId: number,\n params?: ReadHostedPackageParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readHostedPackage>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getReadHostedPackageQueryOptions(mediaId,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 getOpenNativeReaderUrl = (mediaId: number,) => {\n\n\n\n\n return `/partners/youscribe/media/${mediaId}/reader-auth`\n}\n\n/**\n * **Deprecated**: ``POST …/reader-access/embedded``, which takes the seat too. As in 0.13.0.\n *\n * Credentials for one title, taking a seat on first use, and the consumption\n * lease that records the opening. Renew ``lease.eventId`` while the reader is\n * open and close it when it exits.\n * @deprecated\n * @summary Open Native Reader\n */\nexport const openNativeReader = async (mediaId: number, options?: Parameters<typeof request>[1]): Promise<YouScribeReaderRead> => {\n\n return request<YouScribeReaderRead>(getOpenNativeReaderUrl(mediaId),\n {\n ...options,\n method: 'POST'\n\n\n }\n);}\n\n\n\n\n\nexport const getOpenNativeReaderMutationKey = () => ['openNativeReader'] as const;\n\nexport const getOpenNativeReaderMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof openNativeReader>>, TError,OpenNativeReaderMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof openNativeReader>>, TError,OpenNativeReaderMutationVariables, TContext> => {\n\nconst mutationKey = getOpenNativeReaderMutationKey();\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 openNativeReader>>, OpenNativeReaderMutationVariables> = (props) => {\n const {mediaId} = props ?? {};\n\n return openNativeReader(mediaId,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type OpenNativeReaderMutationResult = NonNullable<Awaited<ReturnType<typeof openNativeReader>>>\n\n export type OpenNativeReaderMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type OpenNativeReaderMutationVariables = {mediaId: number}\n\n /**\n * @deprecated\n * @summary Open Native Reader\n */\nexport const useOpenNativeReader = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof openNativeReader>>, TError,OpenNativeReaderMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof openNativeReader>>,\n TError,\n OpenNativeReaderMutationVariables,\n TContext\n > => {\n return useMutation(getOpenNativeReaderMutationOptions(options), queryClient);\n }\n export const getReadNativeAuthUrl = () => {\n\n\n\n\n return `/partners/youscribe/user/auth`\n}\n\n/**\n * YouScribe native SDK credentials for the selected, authorized profile.\n *\n * **Deprecated.** ``POST /partners/youscribe/media/{id}/reader-access/embedded``\n * answers the same credentials with the opening, and records it. This stays\n * while the current mobile app migrates, then goes.\n *\n * The legacy's ``GET /api/v1/{catalog}/user/auth``, and the only YouScribe\n * credentials endpoint — because a YouScribe token is issued **per patron and\n * not per title**, so an authorization keyed by media was answering a question\n * nobody asked. ``POST /media/{id}/reader-auth`` and ``POST /user/auth`` were\n * both this endpoint again: the first added a ``mediaId`` the caller already\n * knew, the second provisioned a seat it no longer provisions.\n *\n * **This is an authentication, not a read.** It exchanges the patron's licence\n * for a session token on YouScribe's REST API, and nothing follows from it: a\n * caller may ask for a token and never open a title. So there is no licence to\n * create and no consumption to record here, not as a policy but because\n * nothing has been consumed.\n *\n * The reading itself happens in the partner's own player — hosted on the web,\n * through their SDK inside the mobile app — and that player reports its\n * consumption to YouScribe. Which is why the opening is recorded by\n * reader-access and not here: it is the one call a client makes on Read.\n *\n * The token is personal: never persist it, log it, or share it between\n * profiles.\n * @deprecated\n * @summary Read Native Auth\n */\nexport const readNativeAuth = async ( options?: Parameters<typeof request>[1]): Promise<YouScribeAuthRead> => {\n\n return request<YouScribeAuthRead>(getReadNativeAuthUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getReadNativeAuthQueryKey = () => {\n return [\n `/partners/youscribe/user/auth`\n ] as const;\n }\n\n\nexport const getReadNativeAuthQueryOptions = <TData = Awaited<ReturnType<typeof readNativeAuth>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readNativeAuth>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getReadNativeAuthQueryKey();\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof readNativeAuth>>> = ({ signal }) => readNativeAuth({ signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof readNativeAuth>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ReadNativeAuthQueryResult = NonNullable<Awaited<ReturnType<typeof readNativeAuth>>>\nexport type ReadNativeAuthQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useReadNativeAuth<TData = Awaited<ReturnType<typeof readNativeAuth>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof readNativeAuth>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof readNativeAuth>>,\n TError,\n Awaited<ReturnType<typeof readNativeAuth>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadNativeAuth<TData = Awaited<ReturnType<typeof readNativeAuth>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readNativeAuth>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof readNativeAuth>>,\n TError,\n Awaited<ReturnType<typeof readNativeAuth>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadNativeAuth<TData = Awaited<ReturnType<typeof readNativeAuth>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readNativeAuth>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @deprecated\n * @summary Read Native Auth\n */\n\nexport function useReadNativeAuth<TData = Awaited<ReturnType<typeof readNativeAuth>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readNativeAuth>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getReadNativeAuthQueryOptions(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 getOpenNativeAuthUrl = () => {\n\n\n\n\n return `/partners/youscribe/user/auth`\n}\n\n/**\n * **Deprecated**: ``POST …/reader-access/embedded``. As in 0.13.0.\n *\n * Credentials for this profile, taking a seat on first use. Call only on the\n * patron's explicit Read: it can create a paid subscription.\n * @deprecated\n * @summary Open Native Auth\n */\nexport const openNativeAuth = async ( options?: Parameters<typeof request>[1]): Promise<YouScribeAuthRead> => {\n\n return request<YouScribeAuthRead>(getOpenNativeAuthUrl(),\n {\n ...options,\n method: 'POST'\n\n\n }\n);}\n\n\n\n\n\nexport const getOpenNativeAuthMutationKey = () => ['openNativeAuth'] as const;\n\nexport const getOpenNativeAuthMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof openNativeAuth>>, TError,void, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof openNativeAuth>>, TError,void, TContext> => {\n\nconst mutationKey = getOpenNativeAuthMutationKey();\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 openNativeAuth>>, void> = () => {\n\n\n return openNativeAuth(requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type OpenNativeAuthMutationResult = NonNullable<Awaited<ReturnType<typeof openNativeAuth>>>\n\n export type OpenNativeAuthMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\n /**\n * @deprecated\n * @summary Open Native Auth\n */\nexport const useOpenNativeAuth = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof openNativeAuth>>, TError,void, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof openNativeAuth>>,\n TError,\n void,\n TContext\n > => {\n return useMutation(getOpenNativeAuthMutationOptions(options), queryClient);\n }\n"],"mappings":";;;;;;;;;;;AA6CA,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,mDAAmD;CAK9D,OAAO;AACT;;;;;AAMA,MAAa,uCAAuC,OAAQ,YAAiF;CAE3I,OAAO,QAAoC,2CAA2C,GACtF;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAMF,MAAa,wDAAwD;CACjE,OAAO,CACP,+CACA;AACA;AAGJ,MAAa,uDAAuM,YAC/M;CAEL,MAAM,EAAC,OAAO,cAAc,SAAS,mBAAkB,WAAW,CAAC;CAEjE,MAAM,WAAY,cAAc,YAAY,gDAAgD;CAI1F,MAAM,WAA4F,EAAE,aAAa,qCAAqC;EAAE;EAAQ,GAAG;CAAe,CAAC;CAMpL,OAAQ;EAAE;EA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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,mBAAuF;EAGzF,OAAQ,eAAe,cAAc;CACvC;CAON,OAAQ;EAAE;EAAY,GAAG;CAAgB;AAAC;;;;;AAW5C,MAAa,qBACW,SACrB,gBAKQ;CACL,OAAO,YAAY,iCAAiC,OAAO,GAAG,WAAW;AAC3E"}
|
|
1
|
+
{"version":3,"file":"partner-reader-youscribe.js","names":[],"sources":["../../src/react/partner-reader-youscribe/partner-reader-youscribe.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.22.10\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 OfflineVerificationKeyRead,\n ReadHostedPackageParams,\n ReaderPackageRead,\n ValidationErrorResponse,\n YouScribeAuthRead,\n YouScribeDownloadRead,\n YouScribeReaderRead\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 getReadYouscribeDownloadVerificationKeyUrl = () => {\n\n\n\n\n return `/partners/youscribe/download-verification-key`\n}\n\n/**\n * Fetch the current public verification key over the authenticated online channel.\n * @summary Read Youscribe Download Verification Key\n */\nexport const readYouscribeDownloadVerificationKey = async ( options?: Parameters<typeof request>[1]): Promise<OfflineVerificationKeyRead> => {\n\n return request<OfflineVerificationKeyRead>(getReadYouscribeDownloadVerificationKeyUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getReadYouscribeDownloadVerificationKeyQueryKey = () => {\n return [\n `/partners/youscribe/download-verification-key`\n ] as const;\n }\n\n\nexport const getReadYouscribeDownloadVerificationKeyQueryOptions = <TData = Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getReadYouscribeDownloadVerificationKeyQueryKey();\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>> = ({ signal }) => readYouscribeDownloadVerificationKey({ signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ReadYouscribeDownloadVerificationKeyQueryResult = NonNullable<Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>>\nexport type ReadYouscribeDownloadVerificationKeyQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useReadYouscribeDownloadVerificationKey<TData = Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>,\n TError,\n Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadYouscribeDownloadVerificationKey<TData = Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>,\n TError,\n Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadYouscribeDownloadVerificationKey<TData = Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Read Youscribe Download Verification Key\n */\n\nexport function useReadYouscribeDownloadVerificationKey<TData = Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readYouscribeDownloadVerificationKey>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getReadYouscribeDownloadVerificationKeyQueryOptions(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 getAcquireYouscribeDownloadUrl = (mediaId: number,) => {\n\n\n\n\n return `/partners/youscribe/media/${mediaId}/downloads`\n}\n\n/**\n * Authorize SDK acquisition for an existing seat. Creates neither a subscription nor a reading event.\n * @summary Acquire Youscribe Download\n */\nexport const acquireYouscribeDownload = async (mediaId: number, options?: Parameters<typeof request>[1]): Promise<YouScribeDownloadRead> => {\n\n return request<YouScribeDownloadRead>(getAcquireYouscribeDownloadUrl(mediaId),\n {\n ...options,\n method: 'POST'\n\n\n }\n);}\n\n\n\n\n\nexport const getAcquireYouscribeDownloadMutationKey = () => ['acquireYouscribeDownload'] as const;\n\nexport const getAcquireYouscribeDownloadMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof acquireYouscribeDownload>>, TError,AcquireYouscribeDownloadMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof acquireYouscribeDownload>>, TError,AcquireYouscribeDownloadMutationVariables, TContext> => {\n\nconst mutationKey = getAcquireYouscribeDownloadMutationKey();\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 acquireYouscribeDownload>>, AcquireYouscribeDownloadMutationVariables> = (props) => {\n const {mediaId} = props ?? {};\n\n return acquireYouscribeDownload(mediaId,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type AcquireYouscribeDownloadMutationResult = NonNullable<Awaited<ReturnType<typeof acquireYouscribeDownload>>>\n\n export type AcquireYouscribeDownloadMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type AcquireYouscribeDownloadMutationVariables = {mediaId: number}\n\n /**\n * @summary Acquire Youscribe Download\n */\nexport const useAcquireYouscribeDownload = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof acquireYouscribeDownload>>, TError,AcquireYouscribeDownloadMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof acquireYouscribeDownload>>,\n TError,\n AcquireYouscribeDownloadMutationVariables,\n TContext\n > => {\n return useMutation(getAcquireYouscribeDownloadMutationOptions(options), queryClient);\n }\n export const getReadHostedPackageUrl = (mediaId: number,\n params?: ReadHostedPackageParams,) => {\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 ? `/partners/youscribe/media/${mediaId}/package?${stringifiedParams}` : `/partners/youscribe/media/${mediaId}/package`\n}\n\n/**\n * **Deprecated**: the hosted reader's address and a lease. As in 0.13.0.\n *\n * Requires a seat already taken and never takes one: a GET does not buy a\n * subscription.\n * @deprecated\n * @summary Read Hosted Package\n */\nexport const readHostedPackage = async (mediaId: number,\n params?: ReadHostedPackageParams, options?: Parameters<typeof request>[1]): Promise<ReaderPackageRead> => {\n\n return request<ReaderPackageRead>(getReadHostedPackageUrl(mediaId,params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getReadHostedPackageQueryKey = (mediaId: number,\n params?: ReadHostedPackageParams,) => {\n return [\n `/partners/youscribe/media/${mediaId}/package`, ...(params ? [params] : [])\n ] as const;\n }\n\n\nexport const getReadHostedPackageQueryOptions = <TData = Awaited<ReturnType<typeof readHostedPackage>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(mediaId: number,\n params?: ReadHostedPackageParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readHostedPackage>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getReadHostedPackageQueryKey(mediaId,params);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof readHostedPackage>>> = ({ signal }) => readHostedPackage(mediaId,params, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, enabled: mediaId !== null && mediaId !== undefined, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof readHostedPackage>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ReadHostedPackageQueryResult = NonNullable<Awaited<ReturnType<typeof readHostedPackage>>>\nexport type ReadHostedPackageQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useReadHostedPackage<TData = Awaited<ReturnType<typeof readHostedPackage>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n mediaId: number,\n params: undefined | ReadHostedPackageParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof readHostedPackage>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof readHostedPackage>>,\n TError,\n Awaited<ReturnType<typeof readHostedPackage>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadHostedPackage<TData = Awaited<ReturnType<typeof readHostedPackage>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n mediaId: number,\n params?: ReadHostedPackageParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readHostedPackage>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof readHostedPackage>>,\n TError,\n Awaited<ReturnType<typeof readHostedPackage>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadHostedPackage<TData = Awaited<ReturnType<typeof readHostedPackage>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n mediaId: number,\n params?: ReadHostedPackageParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readHostedPackage>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @deprecated\n * @summary Read Hosted Package\n */\n\nexport function useReadHostedPackage<TData = Awaited<ReturnType<typeof readHostedPackage>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n mediaId: number,\n params?: ReadHostedPackageParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readHostedPackage>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getReadHostedPackageQueryOptions(mediaId,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 getOpenNativeReaderUrl = (mediaId: number,) => {\n\n\n\n\n return `/partners/youscribe/media/${mediaId}/reader-auth`\n}\n\n/**\n * **Deprecated**: ``POST …/reader-access/embedded``, which takes the seat too. As in 0.13.0.\n *\n * Credentials for one title, taking a seat on first use, and the consumption\n * lease that records the opening. Renew ``lease.eventId`` while the reader is\n * open and close it when it exits.\n * @deprecated\n * @summary Open Native Reader\n */\nexport const openNativeReader = async (mediaId: number, options?: Parameters<typeof request>[1]): Promise<YouScribeReaderRead> => {\n\n return request<YouScribeReaderRead>(getOpenNativeReaderUrl(mediaId),\n {\n ...options,\n method: 'POST'\n\n\n }\n);}\n\n\n\n\n\nexport const getOpenNativeReaderMutationKey = () => ['openNativeReader'] as const;\n\nexport const getOpenNativeReaderMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof openNativeReader>>, TError,OpenNativeReaderMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof openNativeReader>>, TError,OpenNativeReaderMutationVariables, TContext> => {\n\nconst mutationKey = getOpenNativeReaderMutationKey();\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 openNativeReader>>, OpenNativeReaderMutationVariables> = (props) => {\n const {mediaId} = props ?? {};\n\n return openNativeReader(mediaId,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type OpenNativeReaderMutationResult = NonNullable<Awaited<ReturnType<typeof openNativeReader>>>\n\n export type OpenNativeReaderMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type OpenNativeReaderMutationVariables = {mediaId: number}\n\n /**\n * @deprecated\n * @summary Open Native Reader\n */\nexport const useOpenNativeReader = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof openNativeReader>>, TError,OpenNativeReaderMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof openNativeReader>>,\n TError,\n OpenNativeReaderMutationVariables,\n TContext\n > => {\n return useMutation(getOpenNativeReaderMutationOptions(options), queryClient);\n }\n export const getReadNativeAuthUrl = () => {\n\n\n\n\n return `/partners/youscribe/user/auth`\n}\n\n/**\n * YouScribe native SDK credentials for the selected, authorized profile.\n *\n * **Deprecated.** ``POST /partners/youscribe/media/{id}/reader-access/embedded``\n * answers the same credentials with the opening, and records it. This stays\n * while the current mobile app migrates, then goes.\n *\n * The legacy's ``GET /api/v1/{catalog}/user/auth``, and the only YouScribe\n * credentials endpoint — because a YouScribe token is issued **per patron and\n * not per title**, so an authorization keyed by media was answering a question\n * nobody asked. ``POST /media/{id}/reader-auth`` and ``POST /user/auth`` were\n * both this endpoint again: the first added a ``mediaId`` the caller already\n * knew, the second provisioned a seat it no longer provisions.\n *\n * **This is an authentication, not a read.** It exchanges the patron's licence\n * for a session token on YouScribe's REST API, and nothing follows from it: a\n * caller may ask for a token and never open a title. So there is no licence to\n * create and no consumption to record here, not as a policy but because\n * nothing has been consumed.\n *\n * The reading itself happens in the partner's own player — hosted on the web,\n * through their SDK inside the mobile app — and that player reports its\n * consumption to YouScribe. Which is why the opening is recorded by\n * reader-access and not here: it is the one call a client makes on Read.\n *\n * The token is personal: never persist it, log it, or share it between\n * profiles.\n * @deprecated\n * @summary Read Native Auth\n */\nexport const readNativeAuth = async ( options?: Parameters<typeof request>[1]): Promise<YouScribeAuthRead> => {\n\n return request<YouScribeAuthRead>(getReadNativeAuthUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getReadNativeAuthQueryKey = () => {\n return [\n `/partners/youscribe/user/auth`\n ] as const;\n }\n\n\nexport const getReadNativeAuthQueryOptions = <TData = Awaited<ReturnType<typeof readNativeAuth>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readNativeAuth>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getReadNativeAuthQueryKey();\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof readNativeAuth>>> = ({ signal }) => readNativeAuth({ signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof readNativeAuth>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ReadNativeAuthQueryResult = NonNullable<Awaited<ReturnType<typeof readNativeAuth>>>\nexport type ReadNativeAuthQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useReadNativeAuth<TData = Awaited<ReturnType<typeof readNativeAuth>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof readNativeAuth>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof readNativeAuth>>,\n TError,\n Awaited<ReturnType<typeof readNativeAuth>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadNativeAuth<TData = Awaited<ReturnType<typeof readNativeAuth>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readNativeAuth>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof readNativeAuth>>,\n TError,\n Awaited<ReturnType<typeof readNativeAuth>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadNativeAuth<TData = Awaited<ReturnType<typeof readNativeAuth>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readNativeAuth>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @deprecated\n * @summary Read Native Auth\n */\n\nexport function useReadNativeAuth<TData = Awaited<ReturnType<typeof readNativeAuth>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readNativeAuth>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getReadNativeAuthQueryOptions(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 getOpenNativeAuthUrl = () => {\n\n\n\n\n return `/partners/youscribe/user/auth`\n}\n\n/**\n * **Deprecated**: ``POST …/reader-access/embedded``. As in 0.13.0.\n *\n * Credentials for this profile, taking a seat on first use. Call only on the\n * patron's explicit Read: it can create a paid subscription.\n * @deprecated\n * @summary Open Native Auth\n */\nexport const openNativeAuth = async ( options?: Parameters<typeof request>[1]): Promise<YouScribeAuthRead> => {\n\n return request<YouScribeAuthRead>(getOpenNativeAuthUrl(),\n {\n ...options,\n method: 'POST'\n\n\n }\n);}\n\n\n\n\n\nexport const getOpenNativeAuthMutationKey = () => ['openNativeAuth'] as const;\n\nexport const getOpenNativeAuthMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof openNativeAuth>>, TError,void, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof openNativeAuth>>, TError,void, TContext> => {\n\nconst mutationKey = getOpenNativeAuthMutationKey();\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 openNativeAuth>>, void> = () => {\n\n\n return openNativeAuth(requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type OpenNativeAuthMutationResult = NonNullable<Awaited<ReturnType<typeof openNativeAuth>>>\n\n export type OpenNativeAuthMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\n /**\n * @deprecated\n * @summary Open Native Auth\n */\nexport const useOpenNativeAuth = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof openNativeAuth>>, TError,void, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof openNativeAuth>>,\n TError,\n void,\n TContext\n > => {\n return useMutation(getOpenNativeAuthMutationOptions(options), queryClient);\n }\n"],"mappings":";;;;;;;;;;;AA6CA,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,mDAAmD;CAK9D,OAAO;AACT;;;;;AAMA,MAAa,uCAAuC,OAAQ,YAAiF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E1D,MAAM,QAAQ,SAAS,cAAc,WAAW;CAEhD,OAAO,aAAa,OAAO,aAAa,QAAQ;AAClD;AAOA,MAAa,6BAA6B;CAKxC,OAAO;AACT;;;;;;;;;AAUA,MAAa,iBAAiB,OAAQ,YAAwE;CAE5G,OAAO,QAA2B,qBAAqB,GACvD;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAMF,MAAa,qCAAqC,CAAC,gBAAgB;AAEnE,MAAa,oCACW,YACoE;CAE5F,MAAM,cAAc,6BAA6B;CACjD,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,mBAAuF;EAGzF,OAAQ,eAAe,cAAc;CACvC;CAON,OAAQ;EAAE;EAAY,GAAG;CAAgB;AAAC;;;;;AAW5C,MAAa,qBACW,SACrB,gBAKQ;CACL,OAAO,YAAY,iCAAiC,OAAO,GAAG,WAAW;AAC3E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { Dd as HTTPExceptionResponse, E as ValidationErrorResponse, TS as PartnerProvider, Xd as ReaderMode, aa as PartnerReaderAccessRead } 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/partner-reading/partner-reading.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.22.10
|
|
11
11
|
*/
|
|
12
12
|
const getOpenReaderAccessUrl = (provider, mediaId, mode) => {
|
|
13
13
|
return `/partners/${provider}/media/${mediaId}/reader-access/${mode}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"partner-reading.js","names":[],"sources":["../../src/react/partner-reading/partner-reading.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":"partner-reading.js","names":[],"sources":["../../src/react/partner-reading/partner-reading.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.22.10\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 PartnerProvider,\n PartnerReaderAccessRead,\n ReaderMode,\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 getOpenReaderAccessUrl = (provider: PartnerProvider,\n mediaId: number,\n mode: ReaderMode,) => {\n\n\n\n\n return `/partners/${provider}/media/${mediaId}/reader-access/${mode}`\n}\n\n/**\n * Start reading this title in ``mode``: takes a seat if needed, records the opening.\n *\n * ``external`` answers the partner's page to send the patron to.\n * ``embedded`` answers what the client's own reader needs, and ``open.reader``\n * names that reader: switch on ``kind``, then ``reader``. A mode the partner\n * does not offer answers ``403`` ``reader_unavailable``, which ``readerModes``\n * in the capabilities says beforehand.\n *\n * This is the Read click, so a profile holding no seat is given one here —\n * ``409`` with the counts when the household's are all taken, ``403`` when\n * the session's assurance is too low to subscribe the member at a partner.\n * Never on browsing: a seat is a paid subscription. ``POST\n * /biblio/me/{partner}/license`` still takes one on its own, for a client\n * that wants it separately.\n *\n * The order is deliberate. The right is settled first, then the seat and the\n * opening are produced — both cost money at YouScribe, and there is no sense\n * buying either for a refusal — and the lease is written last, once there is\n * something to read. A lease for an opening we could not produce would hold a reading\n * that never began.\n *\n * Re-opening the same title returns the lease already held rather than a\n * second one: \"this member is reading this title\" is true once however many\n * times it is asked, and a page reload must not orphan the first lease.\n * @summary Open Reader Access\n */\nexport const openReaderAccess = async (provider: PartnerProvider,\n mediaId: number,\n mode: ReaderMode, options?: Parameters<typeof request>[1]): Promise<PartnerReaderAccessRead> => {\n\n return request<PartnerReaderAccessRead>(getOpenReaderAccessUrl(provider,mediaId,mode),\n {\n ...options,\n method: 'POST'\n\n\n }\n);}\n\n\n\n\n\nexport const getOpenReaderAccessMutationKey = () => ['openReaderAccess'] as const;\n\nexport const getOpenReaderAccessMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof openReaderAccess>>, TError,OpenReaderAccessMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof openReaderAccess>>, TError,OpenReaderAccessMutationVariables, TContext> => {\n\nconst mutationKey = getOpenReaderAccessMutationKey();\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 openReaderAccess>>, OpenReaderAccessMutationVariables> = (props) => {\n const {provider,mediaId,mode} = props ?? {};\n\n return openReaderAccess(provider,mediaId,mode,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type OpenReaderAccessMutationResult = NonNullable<Awaited<ReturnType<typeof openReaderAccess>>>\n\n export type OpenReaderAccessMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type OpenReaderAccessMutationVariables = {provider: PartnerProvider;mediaId: number;mode: ReaderMode}\n\n /**\n * @summary Open Reader Access\n */\nexport const useOpenReaderAccess = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof openReaderAccess>>, TError,OpenReaderAccessMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof openReaderAccess>>,\n TError,\n OpenReaderAccessMutationVariables,\n TContext\n > => {\n return useMutation(getOpenReaderAccessMutationOptions(options), queryClient);\n }\n"],"mappings":";;;;;;;;;;;AAiCA,MAAa,0BAA0B,UACnC,SACA,SAAsB;CAKxB,OAAO,aAAa,SAAS,SAAS,QAAQ,iBAAiB;AACjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAa,mBAAmB,OAAO,UACnC,SACA,MAAkB,YAA8E;CAElG,OAAO,QAAiC,uBAAuB,UAAS,SAAQ,IAAI,GACpF;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAMF,MAAa,uCAAuC,CAAC,kBAAkB;AAEvE,MAAa,sCACW,YACmG;CAE3H,MAAM,cAAc,+BAA+B;CACnD,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,cAAiH,UAAU;EAC7H,MAAM,EAAC,UAAS,SAAQ,SAAQ,SAAS,CAAC;EAE1C,OAAQ,iBAAiB,UAAS,SAAQ,MAAK,cAAc;CAC/D;CAON,OAAQ;EAAE;EAAY,GAAG;CAAgB;AAAC;;;;AAU5C,MAAa,uBACW,SACrB,gBAKQ;CACL,OAAO,YAAY,mCAAmC,OAAO,GAAG,WAAW;AAC7E"}
|
package/dist/react/profiles.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { Ad as HouseholdInvitationRead, Dd as HTTPExceptionResponse, E as ValidationErrorResponse, Gd as GuardianPinWrite, Kd as GuardianPinResetWrite, Md as HouseholdInvitationAcceptWrite, Nd as HouseholdGuardianWrite, Od as HouseholdInvitationWrite, Pa as OpenChildProfileWrite, Pd as HouseholdGuardianListRead, _r as ProfileListRead, hr as ProfileSessionRead, kd as HouseholdInvitationListRead, pr as ProfileUpdateWrite, qd as GuardianPinResetRead, sd as IndependentInvitationWrite, vr as ProfileRead, xr as ProfileCreateWrite, yf as ExitChildProfileWrite } 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/profiles/profiles.d.ts
|
package/dist/react/profiles.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.22.10
|
|
11
11
|
*/
|
|
12
12
|
const withQueryKey = (query, queryKey) => {
|
|
13
13
|
const result = { queryKey };
|