@learnorama/mozaik-sdk 0.17.2-staging.58.1 → 0.18.0-staging.59.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.
Files changed (288) hide show
  1. package/CVS-PLAYBACK.md +25 -0
  2. package/dist/api/account.d.ts +1 -1
  3. package/dist/api/account.js.map +1 -1
  4. package/dist/api/admin-catalogue.d.ts +1 -1
  5. package/dist/api/admin-catalogue.js.map +1 -1
  6. package/dist/api/admin-consumption.d.ts +1 -1
  7. package/dist/api/admin-consumption.js.map +1 -1
  8. package/dist/api/admin-contracts.d.ts +1 -1
  9. package/dist/api/admin-contracts.js.map +1 -1
  10. package/dist/api/admin-customer.d.ts +1 -1
  11. package/dist/api/admin-customer.js.map +1 -1
  12. package/dist/api/admin-desk.d.ts +54 -1
  13. package/dist/api/admin-desk.js +158 -1
  14. package/dist/api/admin-desk.js.map +1 -1
  15. package/dist/api/admin-licenses.d.ts +1 -1
  16. package/dist/api/admin-licenses.js.map +1 -1
  17. package/dist/api/admin-partner-selections.d.ts +1 -1
  18. package/dist/api/admin-partner-selections.js.map +1 -1
  19. package/dist/api/admin-patrons.d.ts +1 -1
  20. package/dist/api/admin-patrons.js.map +1 -1
  21. package/dist/api/admin-reviews.d.ts +1 -1
  22. package/dist/api/admin-reviews.js.map +1 -1
  23. package/dist/api/admin-roles.d.ts +1 -1
  24. package/dist/api/admin-roles.js.map +1 -1
  25. package/dist/api/admin-support.d.ts +1 -1
  26. package/dist/api/admin-support.js.map +1 -1
  27. package/dist/api/admin-tenants.d.ts +1 -1
  28. package/dist/api/admin-tenants.js.map +1 -1
  29. package/dist/api/admin-tutoring.d.ts +1 -1
  30. package/dist/api/admin-tutoring.js.map +1 -1
  31. package/dist/api/admin-vod.d.ts +13 -1
  32. package/dist/api/admin-vod.js +40 -1
  33. package/dist/api/admin-vod.js.map +1 -1
  34. package/dist/api/auth-device.d.ts +1 -1
  35. package/dist/api/auth-device.js.map +1 -1
  36. package/dist/api/auth.d.ts +1 -1
  37. package/dist/api/auth.js.map +1 -1
  38. package/dist/api/biblio-billing-webhooks.d.ts +1 -1
  39. package/dist/api/biblio-billing-webhooks.js.map +1 -1
  40. package/dist/api/biblio-billing.d.ts +1 -1
  41. package/dist/api/biblio-billing.js.map +1 -1
  42. package/dist/api/biblio-catalogue.d.ts +1 -1
  43. package/dist/api/biblio-catalogue.js.map +1 -1
  44. package/dist/api/biblio-home.d.ts +1 -1
  45. package/dist/api/biblio-home.js.map +1 -1
  46. package/dist/api/biblio-learning-author-profiles.d.ts +1 -1
  47. package/dist/api/biblio-learning-author-profiles.js.map +1 -1
  48. package/dist/api/biblio-learning-authoring.d.ts +1 -1
  49. package/dist/api/biblio-learning-authoring.js.map +1 -1
  50. package/dist/api/biblio-learning-editorial.d.ts +1 -1
  51. package/dist/api/biblio-learning-editorial.js.map +1 -1
  52. package/dist/api/biblio-learning-feedback.d.ts +1 -1
  53. package/dist/api/biblio-learning-feedback.js.map +1 -1
  54. package/dist/api/biblio-learning-finance.d.ts +1 -1
  55. package/dist/api/biblio-learning-finance.js.map +1 -1
  56. package/dist/api/biblio-learning-integrations.d.ts +1 -1
  57. package/dist/api/biblio-learning-integrations.js.map +1 -1
  58. package/dist/api/biblio-learning-membership.d.ts +1 -1
  59. package/dist/api/biblio-learning-membership.js.map +1 -1
  60. package/dist/api/biblio-learning.d.ts +1 -1
  61. package/dist/api/biblio-learning.js.map +1 -1
  62. package/dist/api/biblio-library.d.ts +1 -1
  63. package/dist/api/biblio-library.js.map +1 -1
  64. package/dist/api/biblio-nextory.d.ts +1 -1
  65. package/dist/api/biblio-nextory.js.map +1 -1
  66. package/dist/api/biblio-press.d.ts +1 -1
  67. package/dist/api/biblio-press.js.map +1 -1
  68. package/dist/api/biblio-search.d.ts +1 -1
  69. package/dist/api/biblio-search.js.map +1 -1
  70. package/dist/api/biblio-telemetry.d.ts +1 -1
  71. package/dist/api/biblio-telemetry.js.map +1 -1
  72. package/dist/api/biblio-youscribe.js.map +1 -1
  73. package/dist/api/consumption.d.ts +1 -1
  74. package/dist/api/consumption.js.map +1 -1
  75. package/dist/api/cvs-app.d.ts +1 -1
  76. package/dist/api/cvs-app.js.map +1 -1
  77. package/dist/api/cvs-documents.d.ts +1 -1
  78. package/dist/api/cvs-documents.js.map +1 -1
  79. package/dist/api/cvs-favorites.d.ts +1 -1
  80. package/dist/api/cvs-favorites.js.map +1 -1
  81. package/dist/api/cvs-ils.d.ts +1 -1
  82. package/dist/api/cvs-ils.js.map +1 -1
  83. package/dist/api/cvs-loans.d.ts +1 -1
  84. package/dist/api/cvs-loans.js.map +1 -1
  85. package/dist/api/cvs-payments.d.ts +1 -1
  86. package/dist/api/cvs-payments.js.map +1 -1
  87. package/dist/api/cvs-streaming.d.ts +1 -1
  88. package/dist/api/cvs-streaming.js.map +1 -1
  89. package/dist/api/index.d.ts +3 -3
  90. package/dist/api/index.js +3 -3
  91. package/dist/api/partner-catalogue.d.ts +1 -1
  92. package/dist/api/partner-catalogue.js.map +1 -1
  93. package/dist/api/partner-reader-nextory.d.ts +1 -1
  94. package/dist/api/partner-reader-nextory.js.map +1 -1
  95. package/dist/api/partner-reader-youscribe.d.ts +1 -1
  96. package/dist/api/partner-reader-youscribe.js.map +1 -1
  97. package/dist/api/partner-reading.d.ts +1 -1
  98. package/dist/api/partner-reading.js.map +1 -1
  99. package/dist/api/profiles.d.ts +1 -1
  100. package/dist/api/profiles.js.map +1 -1
  101. package/dist/api/search.d.ts +1 -1
  102. package/dist/api/search.js.map +1 -1
  103. package/dist/api/tutoring-catalogue.d.ts +1 -1
  104. package/dist/api/tutoring-catalogue.js.map +1 -1
  105. package/dist/api/tutoring-chat.d.ts +1 -1
  106. package/dist/api/tutoring-chat.js.map +1 -1
  107. package/dist/api/tutoring-dispatch.d.ts +1 -1
  108. package/dist/api/tutoring-dispatch.js.map +1 -1
  109. package/dist/api/tutoring-practitioner.d.ts +1 -1
  110. package/dist/api/tutoring-practitioner.js.map +1 -1
  111. package/dist/api/tutoring-requests.d.ts +1 -1
  112. package/dist/api/tutoring-requests.js.map +1 -1
  113. package/dist/auth.d.ts +1 -1
  114. package/dist/chunks/client2.d.ts +1 -1
  115. package/dist/chunks/connection.d.ts +1 -1
  116. package/dist/chunks/index.d.ts +1069 -582
  117. package/dist/index.d.ts +3 -3
  118. package/dist/index.js +3 -3
  119. package/dist/index.js.map +1 -1
  120. package/dist/models.d.ts +2 -2
  121. package/dist/models.js +49 -2
  122. package/dist/models.js.map +1 -1
  123. package/dist/react/account.d.ts +1 -1
  124. package/dist/react/account.js +1 -1
  125. package/dist/react/account.js.map +1 -1
  126. package/dist/react/admin-catalogue.d.ts +1 -1
  127. package/dist/react/admin-catalogue.js +1 -1
  128. package/dist/react/admin-catalogue.js.map +1 -1
  129. package/dist/react/admin-consumption.d.ts +1 -1
  130. package/dist/react/admin-consumption.js +1 -1
  131. package/dist/react/admin-consumption.js.map +1 -1
  132. package/dist/react/admin-contracts.d.ts +1 -1
  133. package/dist/react/admin-contracts.js +1 -1
  134. package/dist/react/admin-contracts.js.map +1 -1
  135. package/dist/react/admin-customer.d.ts +1 -1
  136. package/dist/react/admin-customer.js +1 -1
  137. package/dist/react/admin-customer.js.map +1 -1
  138. package/dist/react/admin-desk.d.ts +182 -3
  139. package/dist/react/admin-desk.js +320 -3
  140. package/dist/react/admin-desk.js.map +1 -1
  141. package/dist/react/admin-licenses.d.ts +1 -1
  142. package/dist/react/admin-licenses.js +1 -1
  143. package/dist/react/admin-licenses.js.map +1 -1
  144. package/dist/react/admin-partner-selections.d.ts +1 -1
  145. package/dist/react/admin-partner-selections.js +1 -1
  146. package/dist/react/admin-partner-selections.js.map +1 -1
  147. package/dist/react/admin-patrons.d.ts +1 -1
  148. package/dist/react/admin-patrons.js +1 -1
  149. package/dist/react/admin-patrons.js.map +1 -1
  150. package/dist/react/admin-reviews.d.ts +1 -1
  151. package/dist/react/admin-reviews.js +1 -1
  152. package/dist/react/admin-reviews.js.map +1 -1
  153. package/dist/react/admin-roles.d.ts +1 -1
  154. package/dist/react/admin-roles.js +1 -1
  155. package/dist/react/admin-roles.js.map +1 -1
  156. package/dist/react/admin-support.d.ts +1 -1
  157. package/dist/react/admin-support.js +1 -1
  158. package/dist/react/admin-support.js.map +1 -1
  159. package/dist/react/admin-tenants.d.ts +1 -1
  160. package/dist/react/admin-tenants.js +1 -1
  161. package/dist/react/admin-tenants.js.map +1 -1
  162. package/dist/react/admin-tutoring.d.ts +1 -1
  163. package/dist/react/admin-tutoring.js +1 -1
  164. package/dist/react/admin-tutoring.js.map +1 -1
  165. package/dist/react/admin-vod.d.ts +48 -1
  166. package/dist/react/admin-vod.js +97 -2
  167. package/dist/react/admin-vod.js.map +1 -1
  168. package/dist/react/auth-device.d.ts +1 -1
  169. package/dist/react/auth-device.js +1 -1
  170. package/dist/react/auth-device.js.map +1 -1
  171. package/dist/react/auth.d.ts +1 -1
  172. package/dist/react/auth.js +1 -1
  173. package/dist/react/auth.js.map +1 -1
  174. package/dist/react/biblio-billing-webhooks.d.ts +1 -1
  175. package/dist/react/biblio-billing-webhooks.js +1 -1
  176. package/dist/react/biblio-billing-webhooks.js.map +1 -1
  177. package/dist/react/biblio-billing.d.ts +1 -1
  178. package/dist/react/biblio-billing.js +1 -1
  179. package/dist/react/biblio-billing.js.map +1 -1
  180. package/dist/react/biblio-catalogue.d.ts +1 -1
  181. package/dist/react/biblio-catalogue.js +1 -1
  182. package/dist/react/biblio-catalogue.js.map +1 -1
  183. package/dist/react/biblio-home.d.ts +1 -1
  184. package/dist/react/biblio-home.js +1 -1
  185. package/dist/react/biblio-home.js.map +1 -1
  186. package/dist/react/biblio-learning-author-profiles.d.ts +1 -1
  187. package/dist/react/biblio-learning-author-profiles.js +1 -1
  188. package/dist/react/biblio-learning-author-profiles.js.map +1 -1
  189. package/dist/react/biblio-learning-authoring.d.ts +1 -1
  190. package/dist/react/biblio-learning-authoring.js +1 -1
  191. package/dist/react/biblio-learning-authoring.js.map +1 -1
  192. package/dist/react/biblio-learning-editorial.d.ts +1 -1
  193. package/dist/react/biblio-learning-editorial.js +1 -1
  194. package/dist/react/biblio-learning-editorial.js.map +1 -1
  195. package/dist/react/biblio-learning-feedback.d.ts +1 -1
  196. package/dist/react/biblio-learning-feedback.js +1 -1
  197. package/dist/react/biblio-learning-feedback.js.map +1 -1
  198. package/dist/react/biblio-learning-finance.d.ts +1 -1
  199. package/dist/react/biblio-learning-finance.js +1 -1
  200. package/dist/react/biblio-learning-finance.js.map +1 -1
  201. package/dist/react/biblio-learning-integrations.d.ts +1 -1
  202. package/dist/react/biblio-learning-integrations.js +1 -1
  203. package/dist/react/biblio-learning-integrations.js.map +1 -1
  204. package/dist/react/biblio-learning-membership.d.ts +1 -1
  205. package/dist/react/biblio-learning-membership.js +1 -1
  206. package/dist/react/biblio-learning-membership.js.map +1 -1
  207. package/dist/react/biblio-learning.d.ts +1 -1
  208. package/dist/react/biblio-learning.js +1 -1
  209. package/dist/react/biblio-learning.js.map +1 -1
  210. package/dist/react/biblio-library.d.ts +1 -1
  211. package/dist/react/biblio-library.js +1 -1
  212. package/dist/react/biblio-library.js.map +1 -1
  213. package/dist/react/biblio-nextory.d.ts +1 -1
  214. package/dist/react/biblio-nextory.js +1 -1
  215. package/dist/react/biblio-nextory.js.map +1 -1
  216. package/dist/react/biblio-press.d.ts +1 -1
  217. package/dist/react/biblio-press.js +1 -1
  218. package/dist/react/biblio-press.js.map +1 -1
  219. package/dist/react/biblio-search.d.ts +1 -1
  220. package/dist/react/biblio-search.js +1 -1
  221. package/dist/react/biblio-search.js.map +1 -1
  222. package/dist/react/biblio-telemetry.d.ts +1 -1
  223. package/dist/react/biblio-telemetry.js +1 -1
  224. package/dist/react/biblio-telemetry.js.map +1 -1
  225. package/dist/react/biblio-youscribe.d.ts +1 -1
  226. package/dist/react/biblio-youscribe.js +1 -1
  227. package/dist/react/biblio-youscribe.js.map +1 -1
  228. package/dist/react/chat.d.ts +1 -1
  229. package/dist/react/consumption.d.ts +1 -1
  230. package/dist/react/consumption.js +1 -1
  231. package/dist/react/consumption.js.map +1 -1
  232. package/dist/react/cvs-app.d.ts +1 -1
  233. package/dist/react/cvs-app.js +1 -1
  234. package/dist/react/cvs-app.js.map +1 -1
  235. package/dist/react/cvs-documents.d.ts +1 -1
  236. package/dist/react/cvs-documents.js +1 -1
  237. package/dist/react/cvs-documents.js.map +1 -1
  238. package/dist/react/cvs-favorites.d.ts +1 -1
  239. package/dist/react/cvs-favorites.js +1 -1
  240. package/dist/react/cvs-favorites.js.map +1 -1
  241. package/dist/react/cvs-ils.d.ts +1 -1
  242. package/dist/react/cvs-ils.js +1 -1
  243. package/dist/react/cvs-ils.js.map +1 -1
  244. package/dist/react/cvs-loans.d.ts +1 -1
  245. package/dist/react/cvs-loans.js +1 -1
  246. package/dist/react/cvs-loans.js.map +1 -1
  247. package/dist/react/cvs-payments.d.ts +1 -1
  248. package/dist/react/cvs-payments.js +1 -1
  249. package/dist/react/cvs-payments.js.map +1 -1
  250. package/dist/react/cvs-streaming.d.ts +1 -1
  251. package/dist/react/cvs-streaming.js +1 -1
  252. package/dist/react/cvs-streaming.js.map +1 -1
  253. package/dist/react/index.d.ts +3 -3
  254. package/dist/react/index.js +3 -3
  255. package/dist/react/partner-catalogue.d.ts +1 -1
  256. package/dist/react/partner-catalogue.js +1 -1
  257. package/dist/react/partner-catalogue.js.map +1 -1
  258. package/dist/react/partner-reader-nextory.d.ts +1 -1
  259. package/dist/react/partner-reader-nextory.js +1 -1
  260. package/dist/react/partner-reader-nextory.js.map +1 -1
  261. package/dist/react/partner-reader-youscribe.d.ts +1 -1
  262. package/dist/react/partner-reader-youscribe.js +1 -1
  263. package/dist/react/partner-reader-youscribe.js.map +1 -1
  264. package/dist/react/partner-reading.d.ts +1 -1
  265. package/dist/react/partner-reading.js +1 -1
  266. package/dist/react/partner-reading.js.map +1 -1
  267. package/dist/react/profiles.d.ts +1 -1
  268. package/dist/react/profiles.js +1 -1
  269. package/dist/react/profiles.js.map +1 -1
  270. package/dist/react/search.d.ts +1 -1
  271. package/dist/react/search.js +1 -1
  272. package/dist/react/search.js.map +1 -1
  273. package/dist/react/tutoring-catalogue.d.ts +1 -1
  274. package/dist/react/tutoring-catalogue.js +1 -1
  275. package/dist/react/tutoring-catalogue.js.map +1 -1
  276. package/dist/react/tutoring-chat.d.ts +1 -1
  277. package/dist/react/tutoring-chat.js +1 -1
  278. package/dist/react/tutoring-chat.js.map +1 -1
  279. package/dist/react/tutoring-dispatch.d.ts +1 -1
  280. package/dist/react/tutoring-dispatch.js +1 -1
  281. package/dist/react/tutoring-dispatch.js.map +1 -1
  282. package/dist/react/tutoring-practitioner.d.ts +1 -1
  283. package/dist/react/tutoring-practitioner.js +1 -1
  284. package/dist/react/tutoring-practitioner.js.map +1 -1
  285. package/dist/react/tutoring-requests.d.ts +1 -1
  286. package/dist/react/tutoring-requests.js +1 -1
  287. package/dist/react/tutoring-requests.js.map +1 -1
  288. package/package.json +7 -7
@@ -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.17.2
10
+ * OpenAPI spec version: 0.18.0
11
11
  */
12
12
  const withQueryKey = (query, queryKey) => {
13
13
  const result = { queryKey };
@@ -447,7 +447,102 @@ const getPublishVodAssetMutationOptions = (options) => {
447
447
  const usePublishVodAsset = (options, queryClient) => {
448
448
  return useMutation(getPublishVodAssetMutationOptions(options), queryClient);
449
449
  };
450
+ const getImportVodPreviewUrl = () => {
451
+ return `/admin/vod/previews/import`;
452
+ };
453
+ /**
454
+ * Register a verified free, clear trailer. No key, licence or credit is created.
455
+ * @summary Import Vod Preview
456
+ */
457
+ const importVodPreview = async (vodPreviewImportWrite, options) => {
458
+ const getHeaders = (h) => {
459
+ if (!h) return {};
460
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
461
+ if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
462
+ const headers = {};
463
+ for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
464
+ return headers;
465
+ };
466
+ return request(getImportVodPreviewUrl(), {
467
+ ...options,
468
+ method: "POST",
469
+ headers: {
470
+ "Content-Type": "application/json",
471
+ ...getHeaders(options?.headers)
472
+ },
473
+ body: JSON.stringify(vodPreviewImportWrite)
474
+ });
475
+ };
476
+ const getImportVodPreviewMutationKey = () => ["importVodPreview"];
477
+ const getImportVodPreviewMutationOptions = (options) => {
478
+ const mutationKey = getImportVodPreviewMutationKey();
479
+ const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : {
480
+ ...options,
481
+ mutation: {
482
+ ...options.mutation,
483
+ mutationKey
484
+ }
485
+ } : {
486
+ mutation: { mutationKey },
487
+ request: void 0
488
+ };
489
+ const mutationFn = (props) => {
490
+ const { data } = props ?? {};
491
+ return importVodPreview(data, requestOptions);
492
+ };
493
+ return {
494
+ mutationFn,
495
+ ...mutationOptions
496
+ };
497
+ };
498
+ /**
499
+ * @summary Import Vod Preview
500
+ */
501
+ const useImportVodPreview = (options, queryClient) => {
502
+ return useMutation(getImportVodPreviewMutationOptions(options), queryClient);
503
+ };
504
+ const getDisableVodPreviewUrl = (previewId) => {
505
+ return `/admin/vod/previews/${previewId}`;
506
+ };
507
+ /**
508
+ * Stop exposing a trailer in catalogue reads without deleting source media.
509
+ * @summary Disable Vod Preview
510
+ */
511
+ const disableVodPreview = async (previewId, options) => {
512
+ return request(getDisableVodPreviewUrl(previewId), {
513
+ ...options,
514
+ method: "DELETE"
515
+ });
516
+ };
517
+ const getDisableVodPreviewMutationKey = () => ["disableVodPreview"];
518
+ const getDisableVodPreviewMutationOptions = (options) => {
519
+ const mutationKey = getDisableVodPreviewMutationKey();
520
+ const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : {
521
+ ...options,
522
+ mutation: {
523
+ ...options.mutation,
524
+ mutationKey
525
+ }
526
+ } : {
527
+ mutation: { mutationKey },
528
+ request: void 0
529
+ };
530
+ const mutationFn = (props) => {
531
+ const { previewId } = props ?? {};
532
+ return disableVodPreview(previewId, requestOptions);
533
+ };
534
+ return {
535
+ mutationFn,
536
+ ...mutationOptions
537
+ };
538
+ };
539
+ /**
540
+ * @summary Disable Vod Preview
541
+ */
542
+ const useDisableVodPreview = (options, queryClient) => {
543
+ return useMutation(getDisableVodPreviewMutationOptions(options), queryClient);
544
+ };
450
545
  //#endregion
451
- export { activateVodAsset, disableVodAsset, exportVodAsset, getActivateVodAssetMutationKey, getActivateVodAssetMutationOptions, getActivateVodAssetUrl, getDisableVodAssetMutationKey, getDisableVodAssetMutationOptions, getDisableVodAssetUrl, getExportVodAssetQueryKey, getExportVodAssetQueryOptions, getExportVodAssetUrl, getImportVodAssetMutationKey, getImportVodAssetMutationOptions, getImportVodAssetUrl, getListVodAssetsQueryKey, getListVodAssetsQueryOptions, getListVodAssetsUrl, getPublishVodAssetMutationKey, getPublishVodAssetMutationOptions, getPublishVodAssetUrl, getReadVodAssetQueryKey, getReadVodAssetQueryOptions, getReadVodAssetUrl, getReadVodEncryptionQueryKey, getReadVodEncryptionQueryOptions, getReadVodEncryptionUrl, getRegisterVodAssetMutationKey, getRegisterVodAssetMutationOptions, getRegisterVodAssetUrl, importVodAsset, listVodAssets, publishVodAsset, readVodAsset, readVodEncryption, registerVodAsset, useActivateVodAsset, useDisableVodAsset, useExportVodAsset, useImportVodAsset, useListVodAssets, usePublishVodAsset, useReadVodAsset, useReadVodEncryption, useRegisterVodAsset };
546
+ export { activateVodAsset, disableVodAsset, disableVodPreview, exportVodAsset, getActivateVodAssetMutationKey, getActivateVodAssetMutationOptions, getActivateVodAssetUrl, getDisableVodAssetMutationKey, getDisableVodAssetMutationOptions, getDisableVodAssetUrl, getDisableVodPreviewMutationKey, getDisableVodPreviewMutationOptions, getDisableVodPreviewUrl, getExportVodAssetQueryKey, getExportVodAssetQueryOptions, getExportVodAssetUrl, getImportVodAssetMutationKey, getImportVodAssetMutationOptions, getImportVodAssetUrl, getImportVodPreviewMutationKey, getImportVodPreviewMutationOptions, getImportVodPreviewUrl, getListVodAssetsQueryKey, getListVodAssetsQueryOptions, getListVodAssetsUrl, getPublishVodAssetMutationKey, getPublishVodAssetMutationOptions, getPublishVodAssetUrl, getReadVodAssetQueryKey, getReadVodAssetQueryOptions, getReadVodAssetUrl, getReadVodEncryptionQueryKey, getReadVodEncryptionQueryOptions, getReadVodEncryptionUrl, getRegisterVodAssetMutationKey, getRegisterVodAssetMutationOptions, getRegisterVodAssetUrl, importVodAsset, importVodPreview, listVodAssets, publishVodAsset, readVodAsset, readVodEncryption, registerVodAsset, useActivateVodAsset, useDisableVodAsset, useDisableVodPreview, useExportVodAsset, useImportVodAsset, useImportVodPreview, useListVodAssets, usePublishVodAsset, useReadVodAsset, useReadVodEncryption, useRegisterVodAsset };
452
547
 
453
548
  //# sourceMappingURL=admin-vod.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"admin-vod.js","names":[],"sources":["../../src/react/admin-vod/admin-vod.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.17.2\n */\nimport {\n useMutation,\n useQuery\n} from '@tanstack/react-query';\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n MutationFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseMutationOptions,\n UseMutationResult,\n UseQueryOptions,\n UseQueryResult\n} from '@tanstack/react-query';\n\nimport type {\n HTTPExceptionResponse,\n ListVodAssetsParams,\n ValidationErrorResponse,\n VodAssetBackupRead,\n VodAssetImportWrite,\n VodAssetListRead,\n VodAssetPublishWrite,\n VodAssetRead,\n VodAssetWrite,\n VodEncryptionRead\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 getListVodAssetsUrl = (params: ListVodAssetsParams,) => {\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 ? `/admin/vod/assets?${stringifiedParams}` : `/admin/vod/assets`\n}\n\n/**\n * List up to 100 revisions of one film; no key ciphertext is included.\n * @summary List Vod Assets\n */\nexport const listVodAssets = async (params: ListVodAssetsParams, options?: Parameters<typeof request>[1]): Promise<VodAssetListRead> => {\n\n return request<VodAssetListRead>(getListVodAssetsUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getListVodAssetsQueryKey = (params?: ListVodAssetsParams,) => {\n return [\n `/admin/vod/assets`, ...(params ? [params] : [])\n ] as const;\n }\n\n\nexport const getListVodAssetsQueryOptions = <TData = Awaited<ReturnType<typeof listVodAssets>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params: ListVodAssetsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listVodAssets>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getListVodAssetsQueryKey(params);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof listVodAssets>>> = ({ signal }) => listVodAssets(params, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listVodAssets>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ListVodAssetsQueryResult = NonNullable<Awaited<ReturnType<typeof listVodAssets>>>\nexport type ListVodAssetsQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useListVodAssets<TData = Awaited<ReturnType<typeof listVodAssets>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params: ListVodAssetsParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listVodAssets>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof listVodAssets>>,\n TError,\n Awaited<ReturnType<typeof listVodAssets>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListVodAssets<TData = Awaited<ReturnType<typeof listVodAssets>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params: ListVodAssetsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listVodAssets>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof listVodAssets>>,\n TError,\n Awaited<ReturnType<typeof listVodAssets>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListVodAssets<TData = Awaited<ReturnType<typeof listVodAssets>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params: ListVodAssetsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listVodAssets>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary List Vod Assets\n */\n\nexport function useListVodAssets<TData = Awaited<ReturnType<typeof listVodAssets>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params: ListVodAssetsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listVodAssets>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getListVodAssetsQueryOptions(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 getRegisterVodAssetUrl = () => {\n\n\n\n\n return `/admin/vod/assets`\n}\n\n/**\n * Reserve an immutable film revision and generate its KMS-wrapped AES-128 key.\n *\n * Repeating the same work/version/source/prefix returns the original record;\n * it never replaces its key. The film remains on its existing playback path\n * until an independently verified receipt is published and activation is explicit.\n * No plaintext key is returned or stored in PostgreSQL.\n * @summary Register Vod Asset\n */\nexport const registerVodAsset = async (vodAssetWrite: VodAssetWrite, options?: Parameters<typeof request>[1]): Promise<VodAssetRead> => {\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<VodAssetRead>(getRegisterVodAssetUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(vodAssetWrite)\n }\n);}\n\n\n\n\n\nexport const getRegisterVodAssetMutationKey = () => ['registerVodAsset'] as const;\n\nexport const getRegisterVodAssetMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof registerVodAsset>>, TError,RegisterVodAssetMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof registerVodAsset>>, TError,RegisterVodAssetMutationVariables, TContext> => {\n\nconst mutationKey = getRegisterVodAssetMutationKey();\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 registerVodAsset>>, RegisterVodAssetMutationVariables> = (props) => {\n const {data} = props ?? {};\n\n return registerVodAsset(data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type RegisterVodAssetMutationResult = NonNullable<Awaited<ReturnType<typeof registerVodAsset>>>\n export type RegisterVodAssetMutationBody = BodyType<VodAssetWrite>\n export type RegisterVodAssetMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type RegisterVodAssetMutationVariables = {data: BodyType<VodAssetWrite>}\n\n /**\n * @summary Register Vod Asset\n */\nexport const useRegisterVodAsset = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof registerVodAsset>>, TError,RegisterVodAssetMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof registerVodAsset>>,\n TError,\n RegisterVodAssetMutationVariables,\n TContext\n > => {\n return useMutation(getRegisterVodAssetMutationOptions(options), queryClient);\n }\n export const getImportVodAssetUrl = () => {\n\n\n\n\n return `/admin/vod/assets/import`\n}\n\n/**\n * Import an existing package's KID, IV and KMS-encrypted key.\n *\n * The ciphertext must use the configured KMS key and the exact authenticated\n * context documented in VOD.md. The backend verifies the context and AES-128\n * key length before committing it. Existing revisions cannot change KID or IV.\n * @summary Import Vod Asset\n */\nexport const importVodAsset = async (vodAssetImportWrite: VodAssetImportWrite, options?: Parameters<typeof request>[1]): Promise<VodAssetRead> => {\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<VodAssetRead>(getImportVodAssetUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(vodAssetImportWrite)\n }\n);}\n\n\n\n\n\nexport const getImportVodAssetMutationKey = () => ['importVodAsset'] as const;\n\nexport const getImportVodAssetMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof importVodAsset>>, TError,ImportVodAssetMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof importVodAsset>>, TError,ImportVodAssetMutationVariables, TContext> => {\n\nconst mutationKey = getImportVodAssetMutationKey();\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 importVodAsset>>, ImportVodAssetMutationVariables> = (props) => {\n const {data} = props ?? {};\n\n return importVodAsset(data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type ImportVodAssetMutationResult = NonNullable<Awaited<ReturnType<typeof importVodAsset>>>\n export type ImportVodAssetMutationBody = BodyType<VodAssetImportWrite>\n export type ImportVodAssetMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type ImportVodAssetMutationVariables = {data: BodyType<VodAssetImportWrite>}\n\n /**\n * @summary Import Vod Asset\n */\nexport const useImportVodAsset = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof importVodAsset>>, TError,ImportVodAssetMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof importVodAsset>>,\n TError,\n ImportVodAssetMutationVariables,\n TContext\n > => {\n return useMutation(getImportVodAssetMutationOptions(options), queryClient);\n }\n export const getReadVodAssetUrl = (assetId: string,) => {\n\n\n\n\n return `/admin/vod/assets/${assetId}`\n}\n\n/**\n * Read one immutable packaging revision and its publication state.\n * @summary Read Vod Asset\n */\nexport const readVodAsset = async (assetId: string, options?: Parameters<typeof request>[1]): Promise<VodAssetRead> => {\n\n return request<VodAssetRead>(getReadVodAssetUrl(assetId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getReadVodAssetQueryKey = (assetId: string,) => {\n return [\n `/admin/vod/assets/${assetId}`\n ] as const;\n }\n\n\nexport const getReadVodAssetQueryOptions = <TData = Awaited<ReturnType<typeof readVodAsset>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(assetId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readVodAsset>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getReadVodAssetQueryKey(assetId);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof readVodAsset>>> = ({ signal }) => readVodAsset(assetId, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, enabled: assetId !== null && assetId !== undefined, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof readVodAsset>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ReadVodAssetQueryResult = NonNullable<Awaited<ReturnType<typeof readVodAsset>>>\nexport type ReadVodAssetQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useReadVodAsset<TData = Awaited<ReturnType<typeof readVodAsset>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n assetId: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof readVodAsset>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof readVodAsset>>,\n TError,\n Awaited<ReturnType<typeof readVodAsset>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadVodAsset<TData = Awaited<ReturnType<typeof readVodAsset>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n assetId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readVodAsset>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof readVodAsset>>,\n TError,\n Awaited<ReturnType<typeof readVodAsset>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadVodAsset<TData = Awaited<ReturnType<typeof readVodAsset>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n assetId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readVodAsset>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Read Vod Asset\n */\n\nexport function useReadVodAsset<TData = Awaited<ReturnType<typeof readVodAsset>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n assetId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readVodAsset>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getReadVodAssetQueryOptions(assetId,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 getActivateVodAssetUrl = (assetId: string,) => {\n\n\n\n\n return `/admin/vod/assets/${assetId}/activation`\n}\n\n/**\n * Atomically select a verified revision for new playback sessions.\n *\n * Requires owned playback configuration. Existing sessions retain their previous\n * asset revision; switching versions does not change their content key.\n * @summary Activate Vod Asset\n */\nexport const activateVodAsset = async (assetId: string, options?: Parameters<typeof request>[1]): Promise<VodAssetRead> => {\n\n return request<VodAssetRead>(getActivateVodAssetUrl(assetId),\n {\n ...options,\n method: 'PUT'\n\n\n }\n);}\n\n\n\n\n\nexport const getActivateVodAssetMutationKey = () => ['activateVodAsset'] as const;\n\nexport const getActivateVodAssetMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof activateVodAsset>>, TError,ActivateVodAssetMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof activateVodAsset>>, TError,ActivateVodAssetMutationVariables, TContext> => {\n\nconst mutationKey = getActivateVodAssetMutationKey();\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 activateVodAsset>>, ActivateVodAssetMutationVariables> = (props) => {\n const {assetId} = props ?? {};\n\n return activateVodAsset(assetId,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type ActivateVodAssetMutationResult = NonNullable<Awaited<ReturnType<typeof activateVodAsset>>>\n\n export type ActivateVodAssetMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type ActivateVodAssetMutationVariables = {assetId: string}\n\n /**\n * @summary Activate Vod Asset\n */\nexport const useActivateVodAsset = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof activateVodAsset>>, TError,ActivateVodAssetMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof activateVodAsset>>,\n TError,\n ActivateVodAssetMutationVariables,\n TContext\n > => {\n return useMutation(getActivateVodAssetMutationOptions(options), queryClient);\n }\n export const getExportVodAssetUrl = (assetId: string,) => {\n\n\n\n\n return `/admin/vod/assets/${assetId}/backup`\n}\n\n/**\n * Export encrypted key material, context and verification inventory for backup.\n *\n * KMS encrypt/decrypt access is not exercised by this read. Restoring the encrypted\n * records requires continued access to their wrapping key; no master key is exported.\n * @summary Export Vod Asset\n */\nexport const exportVodAsset = async (assetId: string, options?: Parameters<typeof request>[1]): Promise<VodAssetBackupRead> => {\n\n return request<VodAssetBackupRead>(getExportVodAssetUrl(assetId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getExportVodAssetQueryKey = (assetId: string,) => {\n return [\n `/admin/vod/assets/${assetId}/backup`\n ] as const;\n }\n\n\nexport const getExportVodAssetQueryOptions = <TData = Awaited<ReturnType<typeof exportVodAsset>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(assetId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof exportVodAsset>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getExportVodAssetQueryKey(assetId);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof exportVodAsset>>> = ({ signal }) => exportVodAsset(assetId, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, enabled: assetId !== null && assetId !== undefined, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof exportVodAsset>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ExportVodAssetQueryResult = NonNullable<Awaited<ReturnType<typeof exportVodAsset>>>\nexport type ExportVodAssetQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useExportVodAsset<TData = Awaited<ReturnType<typeof exportVodAsset>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n assetId: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof exportVodAsset>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof exportVodAsset>>,\n TError,\n Awaited<ReturnType<typeof exportVodAsset>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useExportVodAsset<TData = Awaited<ReturnType<typeof exportVodAsset>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n assetId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof exportVodAsset>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof exportVodAsset>>,\n TError,\n Awaited<ReturnType<typeof exportVodAsset>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useExportVodAsset<TData = Awaited<ReturnType<typeof exportVodAsset>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n assetId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof exportVodAsset>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Export Vod Asset\n */\n\nexport function useExportVodAsset<TData = Awaited<ReturnType<typeof exportVodAsset>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n assetId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof exportVodAsset>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getExportVodAssetQueryOptions(assetId,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 getDisableVodAssetUrl = (assetId: string,) => {\n\n\n\n\n return `/admin/vod/assets/${assetId}/disable`\n}\n\n/**\n * Refuse new licence requests for this revision while preserving its key record.\n *\n * Already-issued DRM licences remain subject to their provider validity window;\n * this endpoint cannot retract a licence already delivered to a device.\n * @summary Disable Vod Asset\n */\nexport const disableVodAsset = async (assetId: string, options?: Parameters<typeof request>[1]): Promise<VodAssetRead> => {\n\n return request<VodAssetRead>(getDisableVodAssetUrl(assetId),\n {\n ...options,\n method: 'PUT'\n\n\n }\n);}\n\n\n\n\n\nexport const getDisableVodAssetMutationKey = () => ['disableVodAsset'] as const;\n\nexport const getDisableVodAssetMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof disableVodAsset>>, TError,DisableVodAssetMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof disableVodAsset>>, TError,DisableVodAssetMutationVariables, TContext> => {\n\nconst mutationKey = getDisableVodAssetMutationKey();\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 disableVodAsset>>, DisableVodAssetMutationVariables> = (props) => {\n const {assetId} = props ?? {};\n\n return disableVodAsset(assetId,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DisableVodAssetMutationResult = NonNullable<Awaited<ReturnType<typeof disableVodAsset>>>\n\n export type DisableVodAssetMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type DisableVodAssetMutationVariables = {assetId: string}\n\n /**\n * @summary Disable Vod Asset\n */\nexport const useDisableVodAsset = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof disableVodAsset>>, TError,DisableVodAssetMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof disableVodAsset>>,\n TError,\n DisableVodAssetMutationVariables,\n TContext\n > => {\n return useMutation(getDisableVodAssetMutationOptions(options), queryClient);\n }\n export const getReadVodEncryptionUrl = (assetId: string,) => {\n\n\n\n\n return `/admin/vod/assets/${assetId}/encryption`\n}\n\n/**\n * Read the wrapped key/context/IV for the authorized migration worker.\n *\n * This is a database read only. It neither creates a key nor calls KMS. The\n * worker must independently have KMS decrypt permission and must pass the IV\n * explicitly to the packager. No raw key endpoint exists.\n * @summary Read Vod Encryption\n */\nexport const readVodEncryption = async (assetId: string, options?: Parameters<typeof request>[1]): Promise<VodEncryptionRead> => {\n\n return request<VodEncryptionRead>(getReadVodEncryptionUrl(assetId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getReadVodEncryptionQueryKey = (assetId: string,) => {\n return [\n `/admin/vod/assets/${assetId}/encryption`\n ] as const;\n }\n\n\nexport const getReadVodEncryptionQueryOptions = <TData = Awaited<ReturnType<typeof readVodEncryption>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(assetId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readVodEncryption>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getReadVodEncryptionQueryKey(assetId);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof readVodEncryption>>> = ({ signal }) => readVodEncryption(assetId, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, enabled: assetId !== null && assetId !== undefined, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof readVodEncryption>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ReadVodEncryptionQueryResult = NonNullable<Awaited<ReturnType<typeof readVodEncryption>>>\nexport type ReadVodEncryptionQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useReadVodEncryption<TData = Awaited<ReturnType<typeof readVodEncryption>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n assetId: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof readVodEncryption>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof readVodEncryption>>,\n TError,\n Awaited<ReturnType<typeof readVodEncryption>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadVodEncryption<TData = Awaited<ReturnType<typeof readVodEncryption>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n assetId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readVodEncryption>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof readVodEncryption>>,\n TError,\n Awaited<ReturnType<typeof readVodEncryption>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadVodEncryption<TData = Awaited<ReturnType<typeof readVodEncryption>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n assetId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readVodEncryption>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Read Vod Encryption\n */\n\nexport function useReadVodEncryption<TData = Awaited<ReturnType<typeof readVodEncryption>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n assetId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readVodEncryption>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getReadVodEncryptionQueryOptions(assetId,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 getPublishVodAssetUrl = (assetId: string,) => {\n\n\n\n\n return `/admin/vod/assets/${assetId}/publication`\n}\n\n/**\n * Record a trusted importer's verification receipt without changing playback.\n *\n * The importer attests complete destination read-back and whole-track integrity.\n * The backend validates the inventory/key binding; it does not download the\n * catalogue again. Repeated identical receipts are idempotent; changes conflict.\n * @summary Publish Vod Asset\n */\nexport const publishVodAsset = async (assetId: string,\n vodAssetPublishWrite: VodAssetPublishWrite, options?: Parameters<typeof request>[1]): Promise<VodAssetRead> => {\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<VodAssetRead>(getPublishVodAssetUrl(assetId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(vodAssetPublishWrite)\n }\n);}\n\n\n\n\n\nexport const getPublishVodAssetMutationKey = () => ['publishVodAsset'] as const;\n\nexport const getPublishVodAssetMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof publishVodAsset>>, TError,PublishVodAssetMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof publishVodAsset>>, TError,PublishVodAssetMutationVariables, TContext> => {\n\nconst mutationKey = getPublishVodAssetMutationKey();\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 publishVodAsset>>, PublishVodAssetMutationVariables> = (props) => {\n const {assetId,data} = props ?? {};\n\n return publishVodAsset(assetId,data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type PublishVodAssetMutationResult = NonNullable<Awaited<ReturnType<typeof publishVodAsset>>>\n export type PublishVodAssetMutationBody = BodyType<VodAssetPublishWrite>\n export type PublishVodAssetMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type PublishVodAssetMutationVariables = {assetId: string;data: BodyType<VodAssetPublishWrite>}\n\n /**\n * @summary Publish Vod Asset\n */\nexport const usePublishVodAsset = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof publishVodAsset>>, TError,PublishVodAssetMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof publishVodAsset>>,\n TError,\n PublishVodAssetMutationVariables,\n TContext\n > => {\n return useMutation(getPublishVodAssetMutationOptions(options), queryClient);\n }\n"],"mappings":";;;;;;;;;;;AA+CA,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,uBAAuB,WAAiC;CACnE,MAAM,mBAAmB,IAAI,gBAAgB;CAE7C,OAAO,QAAQ,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,WAAW;EAErD,IAAI,UAAU,KAAA,GACZ,iBAAiB,OAAO,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EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,oBAAoB;CAC3C,CACF;AAAE;AAMF,MAAa,sCAAsC,CAAC,iBAAiB;AAErE,MAAa,qCACW,YACiG;CAEzH,MAAM,cAAc,8BAA8B;CAClD,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,cAA+G,UAAU;EAC3H,MAAM,EAAC,SAAQ,SAAQ,SAAS,CAAC;EAEjC,OAAQ,gBAAgB,SAAQ,MAAK,cAAc;CACrD;CAON,OAAQ;EAAE;EAAY,GAAG;CAAgB;AAAC;;;;AAU5C,MAAa,sBACW,SACrB,gBAKQ;CACL,OAAO,YAAY,kCAAkC,OAAO,GAAG,WAAW;AAC5E"}
1
+ {"version":3,"file":"admin-vod.js","names":[],"sources":["../../src/react/admin-vod/admin-vod.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.18.0\n */\nimport {\n useMutation,\n useQuery\n} from '@tanstack/react-query';\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n MutationFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseMutationOptions,\n UseMutationResult,\n UseQueryOptions,\n UseQueryResult\n} from '@tanstack/react-query';\n\nimport type {\n HTTPExceptionResponse,\n ListVodAssetsParams,\n ValidationErrorResponse,\n VodAssetBackupRead,\n VodAssetImportWrite,\n VodAssetListRead,\n VodAssetPublishWrite,\n VodAssetRead,\n VodAssetWrite,\n VodEncryptionRead,\n VodPreviewImportWrite,\n VodPreviewRegistryRead\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 getListVodAssetsUrl = (params: ListVodAssetsParams,) => {\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 ? `/admin/vod/assets?${stringifiedParams}` : `/admin/vod/assets`\n}\n\n/**\n * List up to 100 revisions of one film; no key ciphertext is included.\n * @summary List Vod Assets\n */\nexport const listVodAssets = async (params: ListVodAssetsParams, options?: Parameters<typeof request>[1]): Promise<VodAssetListRead> => {\n\n return request<VodAssetListRead>(getListVodAssetsUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getListVodAssetsQueryKey = (params?: ListVodAssetsParams,) => {\n return [\n `/admin/vod/assets`, ...(params ? [params] : [])\n ] as const;\n }\n\n\nexport const getListVodAssetsQueryOptions = <TData = Awaited<ReturnType<typeof listVodAssets>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params: ListVodAssetsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listVodAssets>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getListVodAssetsQueryKey(params);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof listVodAssets>>> = ({ signal }) => listVodAssets(params, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listVodAssets>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ListVodAssetsQueryResult = NonNullable<Awaited<ReturnType<typeof listVodAssets>>>\nexport type ListVodAssetsQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useListVodAssets<TData = Awaited<ReturnType<typeof listVodAssets>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params: ListVodAssetsParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listVodAssets>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof listVodAssets>>,\n TError,\n Awaited<ReturnType<typeof listVodAssets>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListVodAssets<TData = Awaited<ReturnType<typeof listVodAssets>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params: ListVodAssetsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listVodAssets>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof listVodAssets>>,\n TError,\n Awaited<ReturnType<typeof listVodAssets>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListVodAssets<TData = Awaited<ReturnType<typeof listVodAssets>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params: ListVodAssetsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listVodAssets>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary List Vod Assets\n */\n\nexport function useListVodAssets<TData = Awaited<ReturnType<typeof listVodAssets>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params: ListVodAssetsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listVodAssets>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getListVodAssetsQueryOptions(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 getRegisterVodAssetUrl = () => {\n\n\n\n\n return `/admin/vod/assets`\n}\n\n/**\n * Reserve an immutable film revision and generate its KMS-wrapped AES-128 key.\n *\n * Repeating the same work/version/source/prefix returns the original record;\n * it never replaces its key. The film remains on its existing playback path\n * until an independently verified receipt is published and activation is explicit.\n * No plaintext key is returned or stored in PostgreSQL.\n * @summary Register Vod Asset\n */\nexport const registerVodAsset = async (vodAssetWrite: VodAssetWrite, options?: Parameters<typeof request>[1]): Promise<VodAssetRead> => {\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<VodAssetRead>(getRegisterVodAssetUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(vodAssetWrite)\n }\n);}\n\n\n\n\n\nexport const getRegisterVodAssetMutationKey = () => ['registerVodAsset'] as const;\n\nexport const getRegisterVodAssetMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof registerVodAsset>>, TError,RegisterVodAssetMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof registerVodAsset>>, TError,RegisterVodAssetMutationVariables, TContext> => {\n\nconst mutationKey = getRegisterVodAssetMutationKey();\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 registerVodAsset>>, RegisterVodAssetMutationVariables> = (props) => {\n const {data} = props ?? {};\n\n return registerVodAsset(data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type RegisterVodAssetMutationResult = NonNullable<Awaited<ReturnType<typeof registerVodAsset>>>\n export type RegisterVodAssetMutationBody = BodyType<VodAssetWrite>\n export type RegisterVodAssetMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type RegisterVodAssetMutationVariables = {data: BodyType<VodAssetWrite>}\n\n /**\n * @summary Register Vod Asset\n */\nexport const useRegisterVodAsset = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof registerVodAsset>>, TError,RegisterVodAssetMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof registerVodAsset>>,\n TError,\n RegisterVodAssetMutationVariables,\n TContext\n > => {\n return useMutation(getRegisterVodAssetMutationOptions(options), queryClient);\n }\n export const getImportVodAssetUrl = () => {\n\n\n\n\n return `/admin/vod/assets/import`\n}\n\n/**\n * Import an existing package's KID, IV and KMS-encrypted key.\n *\n * The ciphertext must use the configured KMS key and the exact authenticated\n * context documented in VOD.md. The backend verifies the context and AES-128\n * key length before committing it. Existing revisions cannot change KID or IV.\n * @summary Import Vod Asset\n */\nexport const importVodAsset = async (vodAssetImportWrite: VodAssetImportWrite, options?: Parameters<typeof request>[1]): Promise<VodAssetRead> => {\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<VodAssetRead>(getImportVodAssetUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(vodAssetImportWrite)\n }\n);}\n\n\n\n\n\nexport const getImportVodAssetMutationKey = () => ['importVodAsset'] as const;\n\nexport const getImportVodAssetMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof importVodAsset>>, TError,ImportVodAssetMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof importVodAsset>>, TError,ImportVodAssetMutationVariables, TContext> => {\n\nconst mutationKey = getImportVodAssetMutationKey();\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 importVodAsset>>, ImportVodAssetMutationVariables> = (props) => {\n const {data} = props ?? {};\n\n return importVodAsset(data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type ImportVodAssetMutationResult = NonNullable<Awaited<ReturnType<typeof importVodAsset>>>\n export type ImportVodAssetMutationBody = BodyType<VodAssetImportWrite>\n export type ImportVodAssetMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type ImportVodAssetMutationVariables = {data: BodyType<VodAssetImportWrite>}\n\n /**\n * @summary Import Vod Asset\n */\nexport const useImportVodAsset = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof importVodAsset>>, TError,ImportVodAssetMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof importVodAsset>>,\n TError,\n ImportVodAssetMutationVariables,\n TContext\n > => {\n return useMutation(getImportVodAssetMutationOptions(options), queryClient);\n }\n export const getReadVodAssetUrl = (assetId: string,) => {\n\n\n\n\n return `/admin/vod/assets/${assetId}`\n}\n\n/**\n * Read one immutable packaging revision and its publication state.\n * @summary Read Vod Asset\n */\nexport const readVodAsset = async (assetId: string, options?: Parameters<typeof request>[1]): Promise<VodAssetRead> => {\n\n return request<VodAssetRead>(getReadVodAssetUrl(assetId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getReadVodAssetQueryKey = (assetId: string,) => {\n return [\n `/admin/vod/assets/${assetId}`\n ] as const;\n }\n\n\nexport const getReadVodAssetQueryOptions = <TData = Awaited<ReturnType<typeof readVodAsset>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(assetId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readVodAsset>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getReadVodAssetQueryKey(assetId);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof readVodAsset>>> = ({ signal }) => readVodAsset(assetId, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, enabled: assetId !== null && assetId !== undefined, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof readVodAsset>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ReadVodAssetQueryResult = NonNullable<Awaited<ReturnType<typeof readVodAsset>>>\nexport type ReadVodAssetQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useReadVodAsset<TData = Awaited<ReturnType<typeof readVodAsset>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n assetId: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof readVodAsset>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof readVodAsset>>,\n TError,\n Awaited<ReturnType<typeof readVodAsset>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadVodAsset<TData = Awaited<ReturnType<typeof readVodAsset>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n assetId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readVodAsset>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof readVodAsset>>,\n TError,\n Awaited<ReturnType<typeof readVodAsset>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadVodAsset<TData = Awaited<ReturnType<typeof readVodAsset>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n assetId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readVodAsset>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Read Vod Asset\n */\n\nexport function useReadVodAsset<TData = Awaited<ReturnType<typeof readVodAsset>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n assetId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readVodAsset>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getReadVodAssetQueryOptions(assetId,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 getActivateVodAssetUrl = (assetId: string,) => {\n\n\n\n\n return `/admin/vod/assets/${assetId}/activation`\n}\n\n/**\n * Atomically select a verified revision for new playback sessions.\n *\n * Requires owned playback configuration. Existing sessions retain their previous\n * asset revision; switching versions does not change their content key.\n * @summary Activate Vod Asset\n */\nexport const activateVodAsset = async (assetId: string, options?: Parameters<typeof request>[1]): Promise<VodAssetRead> => {\n\n return request<VodAssetRead>(getActivateVodAssetUrl(assetId),\n {\n ...options,\n method: 'PUT'\n\n\n }\n);}\n\n\n\n\n\nexport const getActivateVodAssetMutationKey = () => ['activateVodAsset'] as const;\n\nexport const getActivateVodAssetMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof activateVodAsset>>, TError,ActivateVodAssetMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof activateVodAsset>>, TError,ActivateVodAssetMutationVariables, TContext> => {\n\nconst mutationKey = getActivateVodAssetMutationKey();\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 activateVodAsset>>, ActivateVodAssetMutationVariables> = (props) => {\n const {assetId} = props ?? {};\n\n return activateVodAsset(assetId,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type ActivateVodAssetMutationResult = NonNullable<Awaited<ReturnType<typeof activateVodAsset>>>\n\n export type ActivateVodAssetMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type ActivateVodAssetMutationVariables = {assetId: string}\n\n /**\n * @summary Activate Vod Asset\n */\nexport const useActivateVodAsset = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof activateVodAsset>>, TError,ActivateVodAssetMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof activateVodAsset>>,\n TError,\n ActivateVodAssetMutationVariables,\n TContext\n > => {\n return useMutation(getActivateVodAssetMutationOptions(options), queryClient);\n }\n export const getExportVodAssetUrl = (assetId: string,) => {\n\n\n\n\n return `/admin/vod/assets/${assetId}/backup`\n}\n\n/**\n * Export encrypted key material, context and verification inventory for backup.\n *\n * KMS encrypt/decrypt access is not exercised by this read. Restoring the encrypted\n * records requires continued access to their wrapping key; no master key is exported.\n * @summary Export Vod Asset\n */\nexport const exportVodAsset = async (assetId: string, options?: Parameters<typeof request>[1]): Promise<VodAssetBackupRead> => {\n\n return request<VodAssetBackupRead>(getExportVodAssetUrl(assetId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getExportVodAssetQueryKey = (assetId: string,) => {\n return [\n `/admin/vod/assets/${assetId}/backup`\n ] as const;\n }\n\n\nexport const getExportVodAssetQueryOptions = <TData = Awaited<ReturnType<typeof exportVodAsset>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(assetId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof exportVodAsset>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getExportVodAssetQueryKey(assetId);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof exportVodAsset>>> = ({ signal }) => exportVodAsset(assetId, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, enabled: assetId !== null && assetId !== undefined, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof exportVodAsset>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ExportVodAssetQueryResult = NonNullable<Awaited<ReturnType<typeof exportVodAsset>>>\nexport type ExportVodAssetQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useExportVodAsset<TData = Awaited<ReturnType<typeof exportVodAsset>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n assetId: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof exportVodAsset>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof exportVodAsset>>,\n TError,\n Awaited<ReturnType<typeof exportVodAsset>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useExportVodAsset<TData = Awaited<ReturnType<typeof exportVodAsset>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n assetId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof exportVodAsset>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof exportVodAsset>>,\n TError,\n Awaited<ReturnType<typeof exportVodAsset>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useExportVodAsset<TData = Awaited<ReturnType<typeof exportVodAsset>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n assetId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof exportVodAsset>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Export Vod Asset\n */\n\nexport function useExportVodAsset<TData = Awaited<ReturnType<typeof exportVodAsset>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n assetId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof exportVodAsset>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getExportVodAssetQueryOptions(assetId,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 getDisableVodAssetUrl = (assetId: string,) => {\n\n\n\n\n return `/admin/vod/assets/${assetId}/disable`\n}\n\n/**\n * Refuse new licence requests for this revision while preserving its key record.\n *\n * Already-issued DRM licences remain subject to their provider validity window;\n * this endpoint cannot retract a licence already delivered to a device.\n * @summary Disable Vod Asset\n */\nexport const disableVodAsset = async (assetId: string, options?: Parameters<typeof request>[1]): Promise<VodAssetRead> => {\n\n return request<VodAssetRead>(getDisableVodAssetUrl(assetId),\n {\n ...options,\n method: 'PUT'\n\n\n }\n);}\n\n\n\n\n\nexport const getDisableVodAssetMutationKey = () => ['disableVodAsset'] as const;\n\nexport const getDisableVodAssetMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof disableVodAsset>>, TError,DisableVodAssetMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof disableVodAsset>>, TError,DisableVodAssetMutationVariables, TContext> => {\n\nconst mutationKey = getDisableVodAssetMutationKey();\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 disableVodAsset>>, DisableVodAssetMutationVariables> = (props) => {\n const {assetId} = props ?? {};\n\n return disableVodAsset(assetId,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DisableVodAssetMutationResult = NonNullable<Awaited<ReturnType<typeof disableVodAsset>>>\n\n export type DisableVodAssetMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type DisableVodAssetMutationVariables = {assetId: string}\n\n /**\n * @summary Disable Vod Asset\n */\nexport const useDisableVodAsset = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof disableVodAsset>>, TError,DisableVodAssetMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof disableVodAsset>>,\n TError,\n DisableVodAssetMutationVariables,\n TContext\n > => {\n return useMutation(getDisableVodAssetMutationOptions(options), queryClient);\n }\n export const getReadVodEncryptionUrl = (assetId: string,) => {\n\n\n\n\n return `/admin/vod/assets/${assetId}/encryption`\n}\n\n/**\n * Read the wrapped key/context/IV for the authorized migration worker.\n *\n * This is a database read only. It neither creates a key nor calls KMS. The\n * worker must independently have KMS decrypt permission and must pass the IV\n * explicitly to the packager. No raw key endpoint exists.\n * @summary Read Vod Encryption\n */\nexport const readVodEncryption = async (assetId: string, options?: Parameters<typeof request>[1]): Promise<VodEncryptionRead> => {\n\n return request<VodEncryptionRead>(getReadVodEncryptionUrl(assetId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getReadVodEncryptionQueryKey = (assetId: string,) => {\n return [\n `/admin/vod/assets/${assetId}/encryption`\n ] as const;\n }\n\n\nexport const getReadVodEncryptionQueryOptions = <TData = Awaited<ReturnType<typeof readVodEncryption>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(assetId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readVodEncryption>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getReadVodEncryptionQueryKey(assetId);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof readVodEncryption>>> = ({ signal }) => readVodEncryption(assetId, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, enabled: assetId !== null && assetId !== undefined, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof readVodEncryption>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ReadVodEncryptionQueryResult = NonNullable<Awaited<ReturnType<typeof readVodEncryption>>>\nexport type ReadVodEncryptionQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useReadVodEncryption<TData = Awaited<ReturnType<typeof readVodEncryption>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n assetId: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof readVodEncryption>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof readVodEncryption>>,\n TError,\n Awaited<ReturnType<typeof readVodEncryption>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadVodEncryption<TData = Awaited<ReturnType<typeof readVodEncryption>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n assetId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readVodEncryption>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof readVodEncryption>>,\n TError,\n Awaited<ReturnType<typeof readVodEncryption>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadVodEncryption<TData = Awaited<ReturnType<typeof readVodEncryption>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n assetId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readVodEncryption>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Read Vod Encryption\n */\n\nexport function useReadVodEncryption<TData = Awaited<ReturnType<typeof readVodEncryption>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n assetId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readVodEncryption>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getReadVodEncryptionQueryOptions(assetId,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 getPublishVodAssetUrl = (assetId: string,) => {\n\n\n\n\n return `/admin/vod/assets/${assetId}/publication`\n}\n\n/**\n * Record a trusted importer's verification receipt without changing playback.\n *\n * The importer attests complete destination read-back and whole-track integrity.\n * The backend validates the inventory/key binding; it does not download the\n * catalogue again. Repeated identical receipts are idempotent; changes conflict.\n * @summary Publish Vod Asset\n */\nexport const publishVodAsset = async (assetId: string,\n vodAssetPublishWrite: VodAssetPublishWrite, options?: Parameters<typeof request>[1]): Promise<VodAssetRead> => {\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<VodAssetRead>(getPublishVodAssetUrl(assetId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(vodAssetPublishWrite)\n }\n);}\n\n\n\n\n\nexport const getPublishVodAssetMutationKey = () => ['publishVodAsset'] as const;\n\nexport const getPublishVodAssetMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof publishVodAsset>>, TError,PublishVodAssetMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof publishVodAsset>>, TError,PublishVodAssetMutationVariables, TContext> => {\n\nconst mutationKey = getPublishVodAssetMutationKey();\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 publishVodAsset>>, PublishVodAssetMutationVariables> = (props) => {\n const {assetId,data} = props ?? {};\n\n return publishVodAsset(assetId,data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type PublishVodAssetMutationResult = NonNullable<Awaited<ReturnType<typeof publishVodAsset>>>\n export type PublishVodAssetMutationBody = BodyType<VodAssetPublishWrite>\n export type PublishVodAssetMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type PublishVodAssetMutationVariables = {assetId: string;data: BodyType<VodAssetPublishWrite>}\n\n /**\n * @summary Publish Vod Asset\n */\nexport const usePublishVodAsset = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof publishVodAsset>>, TError,PublishVodAssetMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof publishVodAsset>>,\n TError,\n PublishVodAssetMutationVariables,\n TContext\n > => {\n return useMutation(getPublishVodAssetMutationOptions(options), queryClient);\n }\n export const getImportVodPreviewUrl = () => {\n\n\n\n\n return `/admin/vod/previews/import`\n}\n\n/**\n * Register a verified free, clear trailer. No key, licence or credit is created.\n * @summary Import Vod Preview\n */\nexport const importVodPreview = async (vodPreviewImportWrite: VodPreviewImportWrite, options?: Parameters<typeof request>[1]): Promise<VodPreviewRegistryRead> => {\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<VodPreviewRegistryRead>(getImportVodPreviewUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(vodPreviewImportWrite)\n }\n);}\n\n\n\n\n\nexport const getImportVodPreviewMutationKey = () => ['importVodPreview'] as const;\n\nexport const getImportVodPreviewMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof importVodPreview>>, TError,ImportVodPreviewMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof importVodPreview>>, TError,ImportVodPreviewMutationVariables, TContext> => {\n\nconst mutationKey = getImportVodPreviewMutationKey();\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 importVodPreview>>, ImportVodPreviewMutationVariables> = (props) => {\n const {data} = props ?? {};\n\n return importVodPreview(data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type ImportVodPreviewMutationResult = NonNullable<Awaited<ReturnType<typeof importVodPreview>>>\n export type ImportVodPreviewMutationBody = BodyType<VodPreviewImportWrite>\n export type ImportVodPreviewMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type ImportVodPreviewMutationVariables = {data: BodyType<VodPreviewImportWrite>}\n\n /**\n * @summary Import Vod Preview\n */\nexport const useImportVodPreview = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof importVodPreview>>, TError,ImportVodPreviewMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof importVodPreview>>,\n TError,\n ImportVodPreviewMutationVariables,\n TContext\n > => {\n return useMutation(getImportVodPreviewMutationOptions(options), queryClient);\n }\n export const getDisableVodPreviewUrl = (previewId: string,) => {\n\n\n\n\n return `/admin/vod/previews/${previewId}`\n}\n\n/**\n * Stop exposing a trailer in catalogue reads without deleting source media.\n * @summary Disable Vod Preview\n */\nexport const disableVodPreview = async (previewId: string, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getDisableVodPreviewUrl(previewId),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\n\n\n\nexport const getDisableVodPreviewMutationKey = () => ['disableVodPreview'] as const;\n\nexport const getDisableVodPreviewMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof disableVodPreview>>, TError,DisableVodPreviewMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof disableVodPreview>>, TError,DisableVodPreviewMutationVariables, TContext> => {\n\nconst mutationKey = getDisableVodPreviewMutationKey();\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 disableVodPreview>>, DisableVodPreviewMutationVariables> = (props) => {\n const {previewId} = props ?? {};\n\n return disableVodPreview(previewId,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DisableVodPreviewMutationResult = NonNullable<Awaited<ReturnType<typeof disableVodPreview>>>\n\n export type DisableVodPreviewMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type DisableVodPreviewMutationVariables = {previewId: string}\n\n /**\n * @summary Disable Vod Preview\n */\nexport const useDisableVodPreview = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof disableVodPreview>>, TError,DisableVodPreviewMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof disableVodPreview>>,\n TError,\n DisableVodPreviewMutationVariables,\n TContext\n > => {\n return useMutation(getDisableVodPreviewMutationOptions(options), queryClient);\n }\n"],"mappings":";;;;;;;;;;;AAiDA,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,uBAAuB,WAAiC;CACnE,MAAM,mBAAmB,IAAI,gBAAgB;CAE7C,OAAO,QAAQ,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,WAAW;EAErD,IAAI,UAAU,KAAA,GACZ,iBAAiB,OAAO,KAAK,UAAU,OAAO,SAAS,OAAO,KAAK,CAAC;CAExE,CAAC;CAED,MAAM,oBAAoB,iBAAiB,SAAS;CAEpD,OAAO,kBAAkB,SAAS,IAAI,qBAAqB,sBAAsB;AACnF;;;;;AAMA,MAAa,gBAAgB,OAAO,QAA6B,YAAuE;CAEtI,OAAO,QAA0B,oBAAoB,MAAM,GAC3D;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAMF,MAAa,4BAA4B,WAAkC;CACvE,OAAO,CACP,qBAAqB,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAC9C;AACA;AAGJ,MAAa,gCAAwJ,QAA6B,YAC7L;CAEL,MAAM,EAAC,OAAO,cAAc,SAAS,mBAAkB,W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AAQ,SAAS,CAAC;EAEzB,OAAQ,iBAAiB,MAAK,cAAc;CAC9C;CAON,OAAQ;EAAE;EAAY,GAAG;CAAgB;AAAC;;;;AAU5C,MAAa,uBACW,SACrB,gBAKQ;CACL,OAAO,YAAY,mCAAmC,OAAO,GAAG,WAAW;AAC7E;AACA,MAAa,2BAA2B,cAAuB;CAKjE,OAAO,uBAAuB;AAChC;;;;;AAMA,MAAa,oBAAoB,OAAO,WAAmB,YAA2D;CAEpH,OAAO,QAAc,wBAAwB,SAAS,GACtD;EACE,GAAG;EACH,QAAQ;CAGV,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,cAAa,SAAS,CAAC;EAE9B,OAAQ,kBAAkB,WAAU,cAAc;CACpD;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 { Cd as DeviceRefusedRead, Ed as DevicePendingRead, Md as DeviceAuthorizationRead, Od as DeviceAuthorizedRead, Sd as DeviceVerificationRead, Td as DevicePollWrite, jd as DeviceAuthorizationWrite, v as ValidationErrorResponse, xd as DeviceVerificationWrite, yu as HTTPExceptionResponse } from "../chunks/index.js";
2
+ import { Ad as DeviceVerificationRead, Bd as DeviceAuthorizationRead, Id as DeviceAuthorizedRead, Nd as DevicePollWrite, Pd as DevicePendingRead, S as ValidationErrorResponse, Tu as HTTPExceptionResponse, jd as DeviceRefusedRead, kd as DeviceVerificationWrite, zd as DeviceAuthorizationWrite } from "../chunks/index.js";
3
3
  import { a as ErrorType, c as request, n as BodyType } from "../chunks/client.js";
4
4
  import { QueryClient, UseMutationOptions, UseMutationResult } from "@tanstack/react-query";
5
5
  //#region src/react/auth-device/auth-device.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.17.2
10
+ * OpenAPI spec version: 0.18.0
11
11
  */
12
12
  const getCreateDeviceAuthorizationUrl = () => {
13
13
  return `/auth/device-authorizations`;
@@ -1 +1 @@
1
- {"version":3,"file":"auth-device.js","names":[],"sources":["../../src/react/auth-device/auth-device.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.17.2\n */\nimport {\n useMutation\n} from '@tanstack/react-query';\nimport type {\n MutationFunction,\n QueryClient,\n UseMutationOptions,\n UseMutationResult\n} from '@tanstack/react-query';\n\nimport type {\n DeviceAuthorizationRead,\n DeviceAuthorizationWrite,\n DeviceAuthorizedRead,\n DevicePendingRead,\n DevicePollWrite,\n DeviceRefusedRead,\n DeviceVerificationRead,\n DeviceVerificationWrite,\n HTTPExceptionResponse,\n ValidationErrorResponse\n} from '../../models';\n\nimport { request } from '../../client';\nimport type { ErrorType , BodyType } from '../../client';\n\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n\n\nexport const getCreateDeviceAuthorizationUrl = () => {\n\n\n\n\n return `/auth/device-authorizations`\n}\n\n/**\n * Start TV login and return its QR, manual code and private polling credential.\n *\n * The TV generates a PKCE verifier, keeps it secret and sends its S256 challenge.\n * Show the QR image and userCode beside verificationUri. The QR opens the\n * frontend's /activate page with user_code prefilled. That page signs the user\n * in through the existing SSO flow and then requests the Keycloak verification\n * URL. Keycloak asks for explicit confirmation before releasing any tokens.\n *\n * Neither the private deviceCode nor the verifier belongs in the displayed QR.\n * Wait at least interval seconds before polling POST /auth/sessions/device.\n * @summary Create Device Authorization\n */\nexport const createDeviceAuthorization = async (deviceAuthorizationWrite: DeviceAuthorizationWrite, options?: Parameters<typeof request>[1]): Promise<DeviceAuthorizationRead> => {\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<DeviceAuthorizationRead>(getCreateDeviceAuthorizationUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(deviceAuthorizationWrite)\n }\n);}\n\n\n\n\n\nexport const getCreateDeviceAuthorizationMutationKey = () => ['createDeviceAuthorization'] as const;\n\nexport const getCreateDeviceAuthorizationMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createDeviceAuthorization>>, TError,CreateDeviceAuthorizationMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof createDeviceAuthorization>>, TError,CreateDeviceAuthorizationMutationVariables, TContext> => {\n\nconst mutationKey = getCreateDeviceAuthorizationMutationKey();\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 createDeviceAuthorization>>, CreateDeviceAuthorizationMutationVariables> = (props) => {\n const {data} = props ?? {};\n\n return createDeviceAuthorization(data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type CreateDeviceAuthorizationMutationResult = NonNullable<Awaited<ReturnType<typeof createDeviceAuthorization>>>\n export type CreateDeviceAuthorizationMutationBody = BodyType<DeviceAuthorizationWrite>\n export type CreateDeviceAuthorizationMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse | void>\n export type CreateDeviceAuthorizationMutationVariables = {data: BodyType<DeviceAuthorizationWrite>}\n\n /**\n * @summary Create Device Authorization\n */\nexport const useCreateDeviceAuthorization = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createDeviceAuthorization>>, TError,CreateDeviceAuthorizationMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof createDeviceAuthorization>>,\n TError,\n CreateDeviceAuthorizationMutationVariables,\n TContext\n > => {\n return useMutation(getCreateDeviceAuthorizationMutationOptions(options), queryClient);\n }\n export const getPrepareDeviceVerificationUrl = () => {\n\n\n\n\n return `/auth/device-authorizations/verification`\n}\n\n/**\n * Continue from the signed-in web activation page to Keycloak confirmation.\n *\n * Call from /activate after normal sign-in (preserving user_code across the\n * login redirect). Open verificationUrl in that same browser. Keycloak checks\n * the code, displays the requesting TV client and asks the user to approve or\n * deny it. This endpoint returns navigation only: it never approves a device\n * or exchanges the browser's tokens. Invalid/expired codes are shown by Keycloak.\n *\n * A support impersonation or dependent profile cannot initiate verification.\n * @summary Prepare Device Verification\n */\nexport const prepareDeviceVerification = async (deviceVerificationWrite: DeviceVerificationWrite, options?: Parameters<typeof request>[1]): Promise<DeviceVerificationRead> => {\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<DeviceVerificationRead>(getPrepareDeviceVerificationUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(deviceVerificationWrite)\n }\n);}\n\n\n\n\n\nexport const getPrepareDeviceVerificationMutationKey = () => ['prepareDeviceVerification'] as const;\n\nexport const getPrepareDeviceVerificationMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof prepareDeviceVerification>>, TError,PrepareDeviceVerificationMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof prepareDeviceVerification>>, TError,PrepareDeviceVerificationMutationVariables, TContext> => {\n\nconst mutationKey = getPrepareDeviceVerificationMutationKey();\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 prepareDeviceVerification>>, PrepareDeviceVerificationMutationVariables> = (props) => {\n const {data} = props ?? {};\n\n return prepareDeviceVerification(data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type PrepareDeviceVerificationMutationResult = NonNullable<Awaited<ReturnType<typeof prepareDeviceVerification>>>\n export type PrepareDeviceVerificationMutationBody = BodyType<DeviceVerificationWrite>\n export type PrepareDeviceVerificationMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type PrepareDeviceVerificationMutationVariables = {data: BodyType<DeviceVerificationWrite>}\n\n /**\n * @summary Prepare Device Verification\n */\nexport const usePrepareDeviceVerification = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof prepareDeviceVerification>>, TError,PrepareDeviceVerificationMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof prepareDeviceVerification>>,\n TError,\n PrepareDeviceVerificationMutationVariables,\n TContext\n > => {\n return useMutation(getPrepareDeviceVerificationMutationOptions(options), queryClient);\n }\n export const getPollDeviceAuthorizationUrl = () => {\n\n\n\n\n return `/auth/sessions/device`\n}\n\n/**\n * Poll TV login without blocking the request or bypassing broker approval.\n *\n * pending: wait the advertised interval. slow_down: increase the previous\n * interval by at least five seconds and keep that longer interval. denied and\n * expired are terminal: stop polling. authorized contains the ordinary verified\n * SessionRead; store it on the TV and use clientId=mozaik-tv for refresh/logout.\n *\n * Keycloak enforces expiry, polling limits, PKCE and single-use redemption.\n * A lost successful response cannot be replayed; start a new pairing in that\n * case. No token is returned until the normal local-account checks also pass.\n * @summary Poll Device Authorization\n */\nexport const pollDeviceAuthorization = async (devicePollWrite: DevicePollWrite, options?: Parameters<typeof request>[1]): Promise<DevicePendingRead | DeviceRefusedRead | DeviceAuthorizedRead> => {\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<DevicePendingRead | DeviceRefusedRead | DeviceAuthorizedRead>(getPollDeviceAuthorizationUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(devicePollWrite)\n }\n);}\n\n\n\n\n\nexport const getPollDeviceAuthorizationMutationKey = () => ['pollDeviceAuthorization'] as const;\n\nexport const getPollDeviceAuthorizationMutationOptions = <TError = ErrorType<void | HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof pollDeviceAuthorization>>, TError,PollDeviceAuthorizationMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof pollDeviceAuthorization>>, TError,PollDeviceAuthorizationMutationVariables, TContext> => {\n\nconst mutationKey = getPollDeviceAuthorizationMutationKey();\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 pollDeviceAuthorization>>, PollDeviceAuthorizationMutationVariables> = (props) => {\n const {data} = props ?? {};\n\n return pollDeviceAuthorization(data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type PollDeviceAuthorizationMutationResult = NonNullable<Awaited<ReturnType<typeof pollDeviceAuthorization>>>\n export type PollDeviceAuthorizationMutationBody = BodyType<DevicePollWrite>\n export type PollDeviceAuthorizationMutationError = ErrorType<void | HTTPExceptionResponse | ValidationErrorResponse>\n export type PollDeviceAuthorizationMutationVariables = {data: BodyType<DevicePollWrite>}\n\n /**\n * @summary Poll Device Authorization\n */\nexport const usePollDeviceAuthorization = <TError = ErrorType<void | HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof pollDeviceAuthorization>>, TError,PollDeviceAuthorizationMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof pollDeviceAuthorization>>,\n TError,\n PollDeviceAuthorizationMutationVariables,\n TContext\n > => {\n return useMutation(getPollDeviceAuthorizationMutationOptions(options), queryClient);\n }\n"],"mappings":";;;;;;;;;;;AAsCA,MAAa,wCAAwC;CAKnD,OAAO;AACT;;;;;;;;;;;;;;AAeA,MAAa,4BAA4B,OAAO,0BAAoD,YAA8E;CAE9K,MAAM,cAAc,MAAwF;EAC5G,IAAI,CAAC,GAAG,OAAO,CAAC;EAChB,IAAI,aAAa,SAAS,OAAO,OAAO,YAAY,EAAE,QAAQ,CAAC;EAC/D,IAAI,OAAO,YAAY,GACrB,OAAO,OAAO,YACZ,MAAM,KAAK,IAAkC,UAAU,MAAM,KAAK,KAAK,CAAqB,CAC9F;EAEF,MAAM,UAAsD,CAAC;EAC7D,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAgD,CAAC,GAClF,IAAI,UAAU,KAAA,GAAW,QAAQ,QAAQ;EAE3C,OAAO;CACT;CACF,OAAO,QAAiC,gCAAgC,GACtE;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,wBAAwB;CAC/C,CACF;AAAE;AAMF,MAAa,gDAAgD,CAAC,2BAA2B;AAEzF,MAAa,+CACW,YACqH;CAE7I,MAAM,cAAc,wCAAwC;CAC5D,MAAM,EAAC,UAAU,iBAAiB,SAAS,mBAAkB,UACvD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AAU;GAAC,GAAG,QAAQ;GAAU;EAAW;CAAC,IACzD;EAAC,UAAU,EAAE,YAAa;EAAG,SAAS,KAAA;CAAS;CAKjD,MAAM,cAA+H,UAAU;EAC3I,MAAM,EAAC,SAAQ,SAAS,CAAC;EAEzB,OAAQ,wBAAwB,MAAK,cAAc;CACrD;CAON,OAAQ;EAAE;EAAY,GAAG;CAAgB;AAAC;;;;AAU5C,MAAa,8BACW,SACrB,gBAKQ;CACL,OAAO,YAAY,0CAA0C,OAAO,GAAG,WAAW;AACpF"}
1
+ {"version":3,"file":"auth-device.js","names":[],"sources":["../../src/react/auth-device/auth-device.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.18.0\n */\nimport {\n useMutation\n} from '@tanstack/react-query';\nimport type {\n MutationFunction,\n QueryClient,\n UseMutationOptions,\n UseMutationResult\n} from '@tanstack/react-query';\n\nimport type {\n DeviceAuthorizationRead,\n DeviceAuthorizationWrite,\n DeviceAuthorizedRead,\n DevicePendingRead,\n DevicePollWrite,\n DeviceRefusedRead,\n DeviceVerificationRead,\n DeviceVerificationWrite,\n HTTPExceptionResponse,\n ValidationErrorResponse\n} from '../../models';\n\nimport { request } from '../../client';\nimport type { ErrorType , BodyType } from '../../client';\n\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n\n\nexport const getCreateDeviceAuthorizationUrl = () => {\n\n\n\n\n return `/auth/device-authorizations`\n}\n\n/**\n * Start TV login and return its QR, manual code and private polling credential.\n *\n * The TV generates a PKCE verifier, keeps it secret and sends its S256 challenge.\n * Show the QR image and userCode beside verificationUri. The QR opens the\n * frontend's /activate page with user_code prefilled. That page signs the user\n * in through the existing SSO flow and then requests the Keycloak verification\n * URL. Keycloak asks for explicit confirmation before releasing any tokens.\n *\n * Neither the private deviceCode nor the verifier belongs in the displayed QR.\n * Wait at least interval seconds before polling POST /auth/sessions/device.\n * @summary Create Device Authorization\n */\nexport const createDeviceAuthorization = async (deviceAuthorizationWrite: DeviceAuthorizationWrite, options?: Parameters<typeof request>[1]): Promise<DeviceAuthorizationRead> => {\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<DeviceAuthorizationRead>(getCreateDeviceAuthorizationUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(deviceAuthorizationWrite)\n }\n);}\n\n\n\n\n\nexport const getCreateDeviceAuthorizationMutationKey = () => ['createDeviceAuthorization'] as const;\n\nexport const getCreateDeviceAuthorizationMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createDeviceAuthorization>>, TError,CreateDeviceAuthorizationMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof createDeviceAuthorization>>, TError,CreateDeviceAuthorizationMutationVariables, TContext> => {\n\nconst mutationKey = getCreateDeviceAuthorizationMutationKey();\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 createDeviceAuthorization>>, CreateDeviceAuthorizationMutationVariables> = (props) => {\n const {data} = props ?? {};\n\n return createDeviceAuthorization(data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type CreateDeviceAuthorizationMutationResult = NonNullable<Awaited<ReturnType<typeof createDeviceAuthorization>>>\n export type CreateDeviceAuthorizationMutationBody = BodyType<DeviceAuthorizationWrite>\n export type CreateDeviceAuthorizationMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse | void>\n export type CreateDeviceAuthorizationMutationVariables = {data: BodyType<DeviceAuthorizationWrite>}\n\n /**\n * @summary Create Device Authorization\n */\nexport const useCreateDeviceAuthorization = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createDeviceAuthorization>>, TError,CreateDeviceAuthorizationMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof createDeviceAuthorization>>,\n TError,\n CreateDeviceAuthorizationMutationVariables,\n TContext\n > => {\n return useMutation(getCreateDeviceAuthorizationMutationOptions(options), queryClient);\n }\n export const getPrepareDeviceVerificationUrl = () => {\n\n\n\n\n return `/auth/device-authorizations/verification`\n}\n\n/**\n * Continue from the signed-in web activation page to Keycloak confirmation.\n *\n * Call from /activate after normal sign-in (preserving user_code across the\n * login redirect). Open verificationUrl in that same browser. Keycloak checks\n * the code, displays the requesting TV client and asks the user to approve or\n * deny it. This endpoint returns navigation only: it never approves a device\n * or exchanges the browser's tokens. Invalid/expired codes are shown by Keycloak.\n *\n * A support impersonation or dependent profile cannot initiate verification.\n * @summary Prepare Device Verification\n */\nexport const prepareDeviceVerification = async (deviceVerificationWrite: DeviceVerificationWrite, options?: Parameters<typeof request>[1]): Promise<DeviceVerificationRead> => {\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<DeviceVerificationRead>(getPrepareDeviceVerificationUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(deviceVerificationWrite)\n }\n);}\n\n\n\n\n\nexport const getPrepareDeviceVerificationMutationKey = () => ['prepareDeviceVerification'] as const;\n\nexport const getPrepareDeviceVerificationMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof prepareDeviceVerification>>, TError,PrepareDeviceVerificationMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof prepareDeviceVerification>>, TError,PrepareDeviceVerificationMutationVariables, TContext> => {\n\nconst mutationKey = getPrepareDeviceVerificationMutationKey();\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 prepareDeviceVerification>>, PrepareDeviceVerificationMutationVariables> = (props) => {\n const {data} = props ?? {};\n\n return prepareDeviceVerification(data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type PrepareDeviceVerificationMutationResult = NonNullable<Awaited<ReturnType<typeof prepareDeviceVerification>>>\n export type PrepareDeviceVerificationMutationBody = BodyType<DeviceVerificationWrite>\n export type PrepareDeviceVerificationMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type PrepareDeviceVerificationMutationVariables = {data: BodyType<DeviceVerificationWrite>}\n\n /**\n * @summary Prepare Device Verification\n */\nexport const usePrepareDeviceVerification = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof prepareDeviceVerification>>, TError,PrepareDeviceVerificationMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof prepareDeviceVerification>>,\n TError,\n PrepareDeviceVerificationMutationVariables,\n TContext\n > => {\n return useMutation(getPrepareDeviceVerificationMutationOptions(options), queryClient);\n }\n export const getPollDeviceAuthorizationUrl = () => {\n\n\n\n\n return `/auth/sessions/device`\n}\n\n/**\n * Poll TV login without blocking the request or bypassing broker approval.\n *\n * pending: wait the advertised interval. slow_down: increase the previous\n * interval by at least five seconds and keep that longer interval. denied and\n * expired are terminal: stop polling. authorized contains the ordinary verified\n * SessionRead; store it on the TV and use clientId=mozaik-tv for refresh/logout.\n *\n * Keycloak enforces expiry, polling limits, PKCE and single-use redemption.\n * A lost successful response cannot be replayed; start a new pairing in that\n * case. No token is returned until the normal local-account checks also pass.\n * @summary Poll Device Authorization\n */\nexport const pollDeviceAuthorization = async (devicePollWrite: DevicePollWrite, options?: Parameters<typeof request>[1]): Promise<DevicePendingRead | DeviceRefusedRead | DeviceAuthorizedRead> => {\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<DevicePendingRead | DeviceRefusedRead | DeviceAuthorizedRead>(getPollDeviceAuthorizationUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(devicePollWrite)\n }\n);}\n\n\n\n\n\nexport const getPollDeviceAuthorizationMutationKey = () => ['pollDeviceAuthorization'] as const;\n\nexport const getPollDeviceAuthorizationMutationOptions = <TError = ErrorType<void | HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof pollDeviceAuthorization>>, TError,PollDeviceAuthorizationMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof pollDeviceAuthorization>>, TError,PollDeviceAuthorizationMutationVariables, TContext> => {\n\nconst mutationKey = getPollDeviceAuthorizationMutationKey();\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 pollDeviceAuthorization>>, PollDeviceAuthorizationMutationVariables> = (props) => {\n const {data} = props ?? {};\n\n return pollDeviceAuthorization(data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type PollDeviceAuthorizationMutationResult = NonNullable<Awaited<ReturnType<typeof pollDeviceAuthorization>>>\n export type PollDeviceAuthorizationMutationBody = BodyType<DevicePollWrite>\n export type PollDeviceAuthorizationMutationError = ErrorType<void | HTTPExceptionResponse | ValidationErrorResponse>\n export type PollDeviceAuthorizationMutationVariables = {data: BodyType<DevicePollWrite>}\n\n /**\n * @summary Poll Device Authorization\n */\nexport const usePollDeviceAuthorization = <TError = ErrorType<void | HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof pollDeviceAuthorization>>, TError,PollDeviceAuthorizationMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof pollDeviceAuthorization>>,\n TError,\n PollDeviceAuthorizationMutationVariables,\n TContext\n > => {\n return useMutation(getPollDeviceAuthorizationMutationOptions(options), queryClient);\n }\n"],"mappings":";;;;;;;;;;;AAsCA,MAAa,wCAAwC;CAKnD,OAAO;AACT;;;;;;;;;;;;;;AAeA,MAAa,4BAA4B,OAAO,0BAAoD,YAA8E;CAE9K,MAAM,cAAc,MAAwF;EAC5G,IAAI,CAAC,GAAG,OAAO,CAAC;EAChB,IAAI,aAAa,SAAS,OAAO,OAAO,YAAY,EAAE,QAAQ,CAAC;EAC/D,IAAI,OAAO,YAAY,GACrB,OAAO,OAAO,YACZ,MAAM,KAAK,IAAkC,UAAU,MAAM,KAAK,KAAK,CAAqB,CAC9F;EAEF,MAAM,UAAsD,CAAC;EAC7D,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAgD,CAAC,GAClF,IAAI,UAAU,KAAA,GAAW,QAAQ,QAAQ;EAE3C,OAAO;CACT;CACF,OAAO,QAAiC,gCAAgC,GACtE;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,wBAAwB;CAC/C,CACF;AAAE;AAMF,MAAa,gDAAgD,CAAC,2BAA2B;AAEzF,MAAa,+CACW,YACqH;CAE7I,MAAM,cAAc,wCAAwC;CAC5D,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,cAAmI,UAAU;EAC/I,MAAM,EAAC,SAAQ,SAAS,CAA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AAAC;;;;AAU5C,MAAa,8BACW,SACrB,gBAKQ;CACL,OAAO,YAAY,0CAA0C,OAAO,GAAG,WAAW;AACpF"}
@@ -1,5 +1,5 @@
1
1
 
2
- import { Nt as RefreshWrite, Xh as CredentialsWrite, Xl as InvitationSetupWrite, Zl as InvitationSetupRead, ca as MeRead, hy as AuthorizationParams, kd as SessionRead, la as LogoutWrite, my as AuthorizationRead, o_ as CodeExchangeWrite, v as ValidationErrorResponse, yu as HTTPExceptionResponse } from "../chunks/index.js";
2
+ import { Iy as AuthorizationRead, Ld as SessionRead, Lt as RefreshWrite, Ly as AuthorizationParams, O_ as CodeExchangeWrite, S as ValidationErrorResponse, Tu as HTTPExceptionResponse, ma as LogoutWrite, nu as InvitationSetupWrite, pa as MeRead, ru as InvitationSetupRead, vg as CredentialsWrite } 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/auth/auth.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.17.2
10
+ * OpenAPI spec version: 0.18.0
11
11
  */
12
12
  const withQueryKey = (query, queryKey) => {
13
13
  const result = { queryKey };