@learnorama/mozaik-sdk 0.13.0-staging.48.1 → 0.14.1-staging.51.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 (262) hide show
  1. package/README.md +28 -4
  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 +76 -1
  5. package/dist/api/admin-catalogue.js +249 -1
  6. package/dist/api/admin-catalogue.js.map +1 -1
  7. package/dist/api/admin-consumption.d.ts +1 -1
  8. package/dist/api/admin-consumption.js.map +1 -1
  9. package/dist/api/admin-contracts.d.ts +1 -1
  10. package/dist/api/admin-contracts.js.map +1 -1
  11. package/dist/api/admin-desk.d.ts +1 -1
  12. package/dist/api/admin-desk.js.map +1 -1
  13. package/dist/api/admin-licenses.js.map +1 -1
  14. package/dist/api/admin-partner-selections.d.ts +1 -1
  15. package/dist/api/admin-partner-selections.js.map +1 -1
  16. package/dist/api/admin-patrons.d.ts +1 -1
  17. package/dist/api/admin-patrons.js.map +1 -1
  18. package/dist/api/admin-reviews.d.ts +1 -1
  19. package/dist/api/admin-reviews.js.map +1 -1
  20. package/dist/api/admin-roles.js.map +1 -1
  21. package/dist/api/admin-support.d.ts +1 -1
  22. package/dist/api/admin-support.js.map +1 -1
  23. package/dist/api/admin-tenants.d.ts +1 -1
  24. package/dist/api/admin-tenants.js.map +1 -1
  25. package/dist/api/admin-tutoring.d.ts +1 -1
  26. package/dist/api/admin-tutoring.js.map +1 -1
  27. package/dist/api/auth-device.d.ts +50 -0
  28. package/dist/api/auth-device.js +111 -0
  29. package/dist/api/auth-device.js.map +1 -0
  30. package/dist/api/auth.d.ts +1 -1
  31. package/dist/api/auth.js.map +1 -1
  32. package/dist/api/biblio-billing-webhooks.d.ts +1 -1
  33. package/dist/api/biblio-billing-webhooks.js.map +1 -1
  34. package/dist/api/biblio-billing.d.ts +1 -1
  35. package/dist/api/biblio-billing.js.map +1 -1
  36. package/dist/api/biblio-catalogue.d.ts +1 -1
  37. package/dist/api/biblio-catalogue.js.map +1 -1
  38. package/dist/api/biblio-home.d.ts +1 -1
  39. package/dist/api/biblio-home.js.map +1 -1
  40. package/dist/api/biblio-learning-author-profiles.d.ts +1 -1
  41. package/dist/api/biblio-learning-author-profiles.js.map +1 -1
  42. package/dist/api/biblio-learning-authoring.d.ts +1 -1
  43. package/dist/api/biblio-learning-authoring.js.map +1 -1
  44. package/dist/api/biblio-learning-editorial.d.ts +1 -1
  45. package/dist/api/biblio-learning-editorial.js.map +1 -1
  46. package/dist/api/biblio-learning-feedback.d.ts +1 -1
  47. package/dist/api/biblio-learning-feedback.js.map +1 -1
  48. package/dist/api/biblio-learning-finance.d.ts +1 -1
  49. package/dist/api/biblio-learning-finance.js.map +1 -1
  50. package/dist/api/biblio-learning-integrations.d.ts +1 -1
  51. package/dist/api/biblio-learning-integrations.js.map +1 -1
  52. package/dist/api/biblio-learning-membership.d.ts +1 -1
  53. package/dist/api/biblio-learning-membership.js.map +1 -1
  54. package/dist/api/biblio-learning.d.ts +1 -1
  55. package/dist/api/biblio-learning.js.map +1 -1
  56. package/dist/api/biblio-library.d.ts +1 -1
  57. package/dist/api/biblio-library.js.map +1 -1
  58. package/dist/api/biblio-nextory.d.ts +1 -1
  59. package/dist/api/biblio-nextory.js.map +1 -1
  60. package/dist/api/biblio-press.d.ts +63 -1
  61. package/dist/api/biblio-press.js +122 -1
  62. package/dist/api/biblio-press.js.map +1 -1
  63. package/dist/api/biblio-search.d.ts +1 -1
  64. package/dist/api/biblio-search.js.map +1 -1
  65. package/dist/api/biblio-telemetry.js.map +1 -1
  66. package/dist/api/consumption.d.ts +1 -1
  67. package/dist/api/consumption.js.map +1 -1
  68. package/dist/api/cvs-app.d.ts +1 -1
  69. package/dist/api/cvs-app.js.map +1 -1
  70. package/dist/api/cvs-documents.d.ts +1 -1
  71. package/dist/api/cvs-documents.js.map +1 -1
  72. package/dist/api/cvs-favorites.d.ts +1 -1
  73. package/dist/api/cvs-favorites.js.map +1 -1
  74. package/dist/api/cvs-ils.d.ts +1 -1
  75. package/dist/api/cvs-ils.js.map +1 -1
  76. package/dist/api/cvs-loans.d.ts +1 -1
  77. package/dist/api/cvs-loans.js.map +1 -1
  78. package/dist/api/cvs-payments.d.ts +1 -1
  79. package/dist/api/cvs-payments.js.map +1 -1
  80. package/dist/api/cvs-streaming.js.map +1 -1
  81. package/dist/api/index.d.ts +4 -3
  82. package/dist/api/index.js +4 -3
  83. package/dist/api/partner-catalogue.d.ts +1 -1
  84. package/dist/api/partner-catalogue.js.map +1 -1
  85. package/dist/api/partner-reader.d.ts +1 -1
  86. package/dist/api/partner-reader.js.map +1 -1
  87. package/dist/api/profiles.d.ts +1 -1
  88. package/dist/api/profiles.js.map +1 -1
  89. package/dist/api/search.d.ts +1 -1
  90. package/dist/api/search.js.map +1 -1
  91. package/dist/api/tutoring-catalogue.d.ts +1 -1
  92. package/dist/api/tutoring-catalogue.js.map +1 -1
  93. package/dist/api/tutoring-chat.d.ts +1 -1
  94. package/dist/api/tutoring-chat.js.map +1 -1
  95. package/dist/api/tutoring-dispatch.d.ts +1 -1
  96. package/dist/api/tutoring-dispatch.js.map +1 -1
  97. package/dist/api/tutoring-practitioner.js.map +1 -1
  98. package/dist/api/tutoring-requests.d.ts +1 -1
  99. package/dist/api/tutoring-requests.js.map +1 -1
  100. package/dist/auth.d.ts +26 -1
  101. package/dist/auth.js +135 -1
  102. package/dist/auth.js.map +1 -1
  103. package/dist/chunks/client2.d.ts +1 -1
  104. package/dist/chunks/connection.d.ts +1 -1
  105. package/dist/chunks/index.d.ts +1265 -520
  106. package/dist/index.d.ts +3 -3
  107. package/dist/index.js +3 -3
  108. package/dist/index.js.map +1 -1
  109. package/dist/models.d.ts +2 -2
  110. package/dist/models.js +93 -2
  111. package/dist/models.js.map +1 -1
  112. package/dist/react/account.d.ts +1 -1
  113. package/dist/react/account.js +1 -1
  114. package/dist/react/account.js.map +1 -1
  115. package/dist/react/admin-catalogue.d.ts +315 -1
  116. package/dist/react/admin-catalogue.js +544 -2
  117. package/dist/react/admin-catalogue.js.map +1 -1
  118. package/dist/react/admin-consumption.d.ts +1 -1
  119. package/dist/react/admin-consumption.js +1 -1
  120. package/dist/react/admin-consumption.js.map +1 -1
  121. package/dist/react/admin-contracts.d.ts +1 -1
  122. package/dist/react/admin-contracts.js +1 -1
  123. package/dist/react/admin-contracts.js.map +1 -1
  124. package/dist/react/admin-desk.d.ts +1 -1
  125. package/dist/react/admin-desk.js +1 -1
  126. package/dist/react/admin-desk.js.map +1 -1
  127. package/dist/react/admin-licenses.d.ts +1 -1
  128. package/dist/react/admin-licenses.js +1 -1
  129. package/dist/react/admin-licenses.js.map +1 -1
  130. package/dist/react/admin-partner-selections.d.ts +1 -1
  131. package/dist/react/admin-partner-selections.js +1 -1
  132. package/dist/react/admin-partner-selections.js.map +1 -1
  133. package/dist/react/admin-patrons.d.ts +1 -1
  134. package/dist/react/admin-patrons.js +1 -1
  135. package/dist/react/admin-patrons.js.map +1 -1
  136. package/dist/react/admin-reviews.d.ts +1 -1
  137. package/dist/react/admin-reviews.js +1 -1
  138. package/dist/react/admin-reviews.js.map +1 -1
  139. package/dist/react/admin-roles.d.ts +1 -1
  140. package/dist/react/admin-roles.js +1 -1
  141. package/dist/react/admin-roles.js.map +1 -1
  142. package/dist/react/admin-support.d.ts +1 -1
  143. package/dist/react/admin-support.js +1 -1
  144. package/dist/react/admin-support.js.map +1 -1
  145. package/dist/react/admin-tenants.d.ts +1 -1
  146. package/dist/react/admin-tenants.js +1 -1
  147. package/dist/react/admin-tenants.js.map +1 -1
  148. package/dist/react/admin-tutoring.d.ts +1 -1
  149. package/dist/react/admin-tutoring.js +1 -1
  150. package/dist/react/admin-tutoring.js.map +1 -1
  151. package/dist/react/auth-device.d.ts +106 -0
  152. package/dist/react/auth-device.js +203 -0
  153. package/dist/react/auth-device.js.map +1 -0
  154. package/dist/react/auth.d.ts +1 -1
  155. package/dist/react/auth.js +1 -1
  156. package/dist/react/auth.js.map +1 -1
  157. package/dist/react/biblio-billing-webhooks.d.ts +1 -1
  158. package/dist/react/biblio-billing-webhooks.js +1 -1
  159. package/dist/react/biblio-billing-webhooks.js.map +1 -1
  160. package/dist/react/biblio-billing.d.ts +1 -1
  161. package/dist/react/biblio-billing.js +1 -1
  162. package/dist/react/biblio-billing.js.map +1 -1
  163. package/dist/react/biblio-catalogue.d.ts +1 -1
  164. package/dist/react/biblio-catalogue.js +1 -1
  165. package/dist/react/biblio-catalogue.js.map +1 -1
  166. package/dist/react/biblio-home.d.ts +1 -1
  167. package/dist/react/biblio-home.js +1 -1
  168. package/dist/react/biblio-home.js.map +1 -1
  169. package/dist/react/biblio-learning-author-profiles.d.ts +1 -1
  170. package/dist/react/biblio-learning-author-profiles.js +1 -1
  171. package/dist/react/biblio-learning-author-profiles.js.map +1 -1
  172. package/dist/react/biblio-learning-authoring.d.ts +1 -1
  173. package/dist/react/biblio-learning-authoring.js +1 -1
  174. package/dist/react/biblio-learning-authoring.js.map +1 -1
  175. package/dist/react/biblio-learning-editorial.d.ts +1 -1
  176. package/dist/react/biblio-learning-editorial.js +1 -1
  177. package/dist/react/biblio-learning-editorial.js.map +1 -1
  178. package/dist/react/biblio-learning-feedback.d.ts +1 -1
  179. package/dist/react/biblio-learning-feedback.js +1 -1
  180. package/dist/react/biblio-learning-feedback.js.map +1 -1
  181. package/dist/react/biblio-learning-finance.d.ts +1 -1
  182. package/dist/react/biblio-learning-finance.js +1 -1
  183. package/dist/react/biblio-learning-finance.js.map +1 -1
  184. package/dist/react/biblio-learning-integrations.d.ts +1 -1
  185. package/dist/react/biblio-learning-integrations.js +1 -1
  186. package/dist/react/biblio-learning-integrations.js.map +1 -1
  187. package/dist/react/biblio-learning-membership.d.ts +1 -1
  188. package/dist/react/biblio-learning-membership.js +1 -1
  189. package/dist/react/biblio-learning-membership.js.map +1 -1
  190. package/dist/react/biblio-learning.d.ts +1 -1
  191. package/dist/react/biblio-learning.js +1 -1
  192. package/dist/react/biblio-learning.js.map +1 -1
  193. package/dist/react/biblio-library.d.ts +1 -1
  194. package/dist/react/biblio-library.js +1 -1
  195. package/dist/react/biblio-library.js.map +1 -1
  196. package/dist/react/biblio-nextory.d.ts +1 -1
  197. package/dist/react/biblio-nextory.js +1 -1
  198. package/dist/react/biblio-nextory.js.map +1 -1
  199. package/dist/react/biblio-press.d.ts +232 -1
  200. package/dist/react/biblio-press.js +301 -2
  201. package/dist/react/biblio-press.js.map +1 -1
  202. package/dist/react/biblio-search.d.ts +1 -1
  203. package/dist/react/biblio-search.js +1 -1
  204. package/dist/react/biblio-search.js.map +1 -1
  205. package/dist/react/biblio-telemetry.d.ts +1 -1
  206. package/dist/react/biblio-telemetry.js +1 -1
  207. package/dist/react/biblio-telemetry.js.map +1 -1
  208. package/dist/react/chat.d.ts +1 -1
  209. package/dist/react/consumption.d.ts +1 -1
  210. package/dist/react/consumption.js +1 -1
  211. package/dist/react/consumption.js.map +1 -1
  212. package/dist/react/cvs-app.d.ts +1 -1
  213. package/dist/react/cvs-app.js +1 -1
  214. package/dist/react/cvs-app.js.map +1 -1
  215. package/dist/react/cvs-documents.d.ts +1 -1
  216. package/dist/react/cvs-documents.js +1 -1
  217. package/dist/react/cvs-documents.js.map +1 -1
  218. package/dist/react/cvs-favorites.d.ts +1 -1
  219. package/dist/react/cvs-favorites.js +1 -1
  220. package/dist/react/cvs-favorites.js.map +1 -1
  221. package/dist/react/cvs-ils.d.ts +1 -1
  222. package/dist/react/cvs-ils.js +1 -1
  223. package/dist/react/cvs-ils.js.map +1 -1
  224. package/dist/react/cvs-loans.d.ts +1 -1
  225. package/dist/react/cvs-loans.js +1 -1
  226. package/dist/react/cvs-loans.js.map +1 -1
  227. package/dist/react/cvs-payments.d.ts +1 -1
  228. package/dist/react/cvs-payments.js +1 -1
  229. package/dist/react/cvs-payments.js.map +1 -1
  230. package/dist/react/cvs-streaming.d.ts +1 -1
  231. package/dist/react/cvs-streaming.js +1 -1
  232. package/dist/react/cvs-streaming.js.map +1 -1
  233. package/dist/react/index.d.ts +4 -3
  234. package/dist/react/index.js +4 -3
  235. package/dist/react/partner-catalogue.d.ts +1 -1
  236. package/dist/react/partner-catalogue.js +1 -1
  237. package/dist/react/partner-catalogue.js.map +1 -1
  238. package/dist/react/partner-reader.d.ts +1 -1
  239. package/dist/react/partner-reader.js +1 -1
  240. package/dist/react/partner-reader.js.map +1 -1
  241. package/dist/react/profiles.d.ts +1 -1
  242. package/dist/react/profiles.js +1 -1
  243. package/dist/react/profiles.js.map +1 -1
  244. package/dist/react/search.d.ts +1 -1
  245. package/dist/react/search.js +1 -1
  246. package/dist/react/search.js.map +1 -1
  247. package/dist/react/tutoring-catalogue.d.ts +1 -1
  248. package/dist/react/tutoring-catalogue.js +1 -1
  249. package/dist/react/tutoring-catalogue.js.map +1 -1
  250. package/dist/react/tutoring-chat.d.ts +1 -1
  251. package/dist/react/tutoring-chat.js +1 -1
  252. package/dist/react/tutoring-chat.js.map +1 -1
  253. package/dist/react/tutoring-dispatch.d.ts +1 -1
  254. package/dist/react/tutoring-dispatch.js +1 -1
  255. package/dist/react/tutoring-dispatch.js.map +1 -1
  256. package/dist/react/tutoring-practitioner.d.ts +1 -1
  257. package/dist/react/tutoring-practitioner.js +1 -1
  258. package/dist/react/tutoring-practitioner.js.map +1 -1
  259. package/dist/react/tutoring-requests.d.ts +1 -1
  260. package/dist/react/tutoring-requests.js +1 -1
  261. package/dist/react/tutoring-requests.js.map +1 -1
  262. package/package.json +7 -7
package/README.md CHANGED
@@ -213,10 +213,11 @@ onboarding, the press feed and the home feed. Clear profile-scoped query caches
213
213
  when switching accounts or profiles. HTTP responses containing these selections
214
214
  are private and non-cacheable; application query caches still need this handling.
215
215
 
216
- This is a breaking contract: `/press-articles` and `/press-review` have been
217
- removed. Use `/press-titles` and `/press-feed`; `articleId` on a catalogue card
218
- becomes `contentId`, `articles` in sections becomes `titles`, and home
219
- `pressReview` becomes `pressFeed`. Regenerate/update the SDK with the backend.
216
+ Actual articles are exposed through `/biblio/press-articles` and the personalised
217
+ `/biblio/press-review`. These return article records, distinct from publication
218
+ cards in `/press-titles` and `/press-feed`. Their `articleId` is a native article
219
+ identifier; open it through its returned POST reader URL. See [the press guide](PRESS.md)
220
+ for pagination, access, publisher codes and SDK examples.
220
221
 
221
222
  ## Google Workspace and partner SSO
222
223
 
@@ -314,6 +315,29 @@ Here `client` is a `createClient({ baseUrl })` transport. Store tokens using the
314
315
  native platform's secure storage, and replace the refresh token after rotation.
315
316
  Omitting the client ID selects `mozaik-web` for existing browser callers.
316
317
 
318
+ ## TV sign-in by QR or code
319
+
320
+ `startTvLogin` generates PKCE and manages one cancellable polling loop, including
321
+ pending approval, slow-down responses, expiry and temporary outages:
322
+
323
+ ```ts
324
+ import { startTvLogin } from '@learnorama/mozaik-sdk/auth';
325
+
326
+ const login = await startTvLogin({ baseUrl: 'https://api.stg.mozaik.co' });
327
+ // Display login.qrCodeDataUrl, login.userCode and login.verificationUri.
328
+ try {
329
+ const session = await login.waitForSession();
330
+ // Install session in the TV's auth store. Refresh/logout use login.clientId.
331
+ } finally {
332
+ login.cancel();
333
+ }
334
+ ```
335
+
336
+ The phone/computer opens the frontend's `/activate` page, signs in through the
337
+ existing SSO flow, and explicitly approves in Keycloak. The QR never contains
338
+ the private device credential or verifier. See [the TV integration guide](TV-LOGIN.md)
339
+ for the activation page, endpoint contract and profile isolation.
340
+
317
341
  ## React SSO shortcut
318
342
 
319
343
  `MozaikAuthProvider` supplies both authentication and its own TanStack Query
@@ -1,5 +1,5 @@
1
1
 
2
- import { $ as ServiceListRead, bh as AccountDetailRead, dr as OnboardingRead, jc as FrontendCapabilitiesRead, vh as AccountUpdateWrite } from "../chunks/index.js";
2
+ import { Q as ServiceListRead, Vr as OnboardingRead, cg as AccountUpdateWrite, ll as FrontendCapabilitiesRead, ug as AccountDetailRead } from "../chunks/index.js";
3
3
  import { c as request } from "../chunks/client.js";
4
4
  //#region src/api/account/account.d.ts
5
5
  export declare const getDeleteAccountUrl: () => string;
@@ -1 +1 @@
1
- {"version":3,"file":"account.js","names":[],"sources":["../../src/api/account/account.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.13.0\n */\nimport type {\n AccountDetailRead,\n AccountUpdateWrite,\n FrontendCapabilitiesRead,\n OnboardingRead,\n ServiceListRead\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getDeleteAccountUrl = () => {\n\n\n\n\n return `/me`\n}\n\n/**\n * Erase this authenticated identity while retaining its historical rows.\n *\n * Other independently authenticated household members are never erased by\n * this operation. The holder must first remove active/pending memberships;\n * an adult who is a child's final guardian must assign another guardian first.\n * All household writes take the same beneficiary lock, including invitations.\n * @summary Delete Account\n */\nexport const deleteAccount = async ( options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getDeleteAccountUrl(),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\nexport const getReadAccountUrl = () => {\n\n\n\n\n return `/me`\n}\n\n/**\n * The authenticated account (E15).\n *\n * No query, no join: ``CurrentUserDep`` has already resolved the row behind the\n * token. The endpoint the legacy should have had here has been returning ``500``\n * on every request for as long as anyone has looked (defect D1).\n *\n * ``isNameEditable`` exists so a client need not discover the answer by being\n * refused. A member signing in through their establishment cannot change their\n * own name here — the realm rewrites it at every login — and until now the\n * only way to find that out was to type one and receive a ``403``. The field\n * says it before the form is drawn.\n * @summary Read Account\n */\nexport const readAccount = async ( options?: Parameters<typeof request>[1]): Promise<AccountDetailRead> => {\n\n return request<AccountDetailRead>(getReadAccountUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getUpdateAccountUrl = () => {\n\n\n\n\n return `/me`\n}\n\n/**\n * Partially update the account (E16).\n *\n * ``exclude_unset`` is what separates PATCH from PUT here: a field the client\n * omitted is left alone, which is not the same as a field it sent as null. The\n * response is built from the persisted row rather than the submitted body.\n * @summary Update Account\n */\nexport const updateAccount = async (accountUpdateWrite: AccountUpdateWrite, options?: Parameters<typeof request>[1]): Promise<AccountDetailRead> => {\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<AccountDetailRead>(getUpdateAccountUrl(),\n {\n ...options,\n method: 'PATCH',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(accountUpdateWrite)\n }\n);}\n\n\nexport const getReadCapabilitiesUrl = () => {\n\n\n\n\n return `/me/capabilities`\n}\n\n/**\n * Current profile's universes, provider access and navigation paths.\n *\n * Does not allocate a licence or contact a provider. ``readingAllowed`` is a\n * local permission snapshot; configuration and upstream health are separate.\n * The reader always authorizes again when opening a title.\n * @summary Read Capabilities\n */\nexport const readCapabilities = async ( options?: Parameters<typeof request>[1]): Promise<FrontendCapabilitiesRead> => {\n\n return request<FrontendCapabilitiesRead>(getReadCapabilitiesUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getReadOnboardingUrl = () => {\n\n\n\n\n return `/me/onboarding`\n}\n\n/**\n * State for optional profile setup, with existing write-resource paths.\n *\n * The signed-in adult updates their own fields using PATCH /me. A guardian\n * manages a child through /me/profiles. Category selections use\n * PUT /biblio/me/preferences/categories in the effective profile context.\n * Press-title choices use pressTitlesUrl and pressFavoritesUrl; they are the\n * profile's press_title favourites, not additional catalogue categories.\n * No terms acceptance or mandatory onboarding completion is invented here.\n * @summary Read Onboarding\n */\nexport const readOnboarding = async ( options?: Parameters<typeof request>[1]): Promise<OnboardingRead> => {\n\n return request<OnboardingRead>(getReadOnboardingUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getListServicesUrl = () => {\n\n\n\n\n return `/me/services`\n}\n\n/**\n * Third-party services this account's establishment offers (E27).\n *\n * Under ``/me`` rather than ``/biblio/me`` because it is not a catalogue: these\n * are the establishment's own service tiles, and they belong to the tenant\n * whichever catalogue that tenant reads from. It is also the one place the\n * biblio spec describes something the *CVS* schema models, which is why it sat\n * in the wrong module until the prefixes made the mismatch visible.\n *\n * Date-windowed. A service outside its window is absent rather than disabled:\n * the client should not have to know the difference, and a visible dead link is\n * worse than no link.\n * @summary List Services\n */\nexport const listServices = async ( options?: Parameters<typeof request>[1]): Promise<ServiceListRead> => {\n\n return request<ServiceListRead>(getListServicesUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n"],"mappings":";;;AAiBA,MAAa,4BAA4B;CAKvC,OAAO;AACT;;;;;;;;;;AAWA,MAAa,gBAAgB,OAAQ,YAA2D;CAE9F,OAAO,QAAc,oBAAoB,GACzC;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,0BAA0B;CAKrC,OAAO;AACT;;;;;;;;;;;;;;;AAgBA,MAAa,cAAc,OAAQ,YAAwE;CAEzG,OAAO,QAA2B,kBAAkB,GACpD;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,4BAA4B;CAKvC,OAAO;AACT;;;;;;;;;AAUA,MAAa,gBAAgB,OAAO,oBAAwC,YAAwE;CAEhJ,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,QAA2B,oBAAoB,GACpD;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,kBAAkB;CACzC,CACF;AAAE;AAGF,MAAa,+BAA+B;CAK1C,OAAO;AACT;;;;;;;;;AAUA,MAAa,mBAAmB,OAAQ,YAA+E;CAErH,OAAO,QAAkC,uBAAuB,GAChE;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,6BAA6B;CAKxC,OAAO;AACT;;;;;;;;;;;;AAaA,MAAa,iBAAiB,OAAQ,YAAqE;CAEzG,OAAO,QAAwB,qBAAqB,GACpD;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,2BAA2B;CAKtC,OAAO;AACT;;;;;;;;;;;;;;;AAgBA,MAAa,eAAe,OAAQ,YAAsE;CAExG,OAAO,QAAyB,mBAAmB,GACnD;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE"}
1
+ {"version":3,"file":"account.js","names":[],"sources":["../../src/api/account/account.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.14.1\n */\nimport type {\n AccountDetailRead,\n AccountUpdateWrite,\n FrontendCapabilitiesRead,\n OnboardingRead,\n ServiceListRead\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getDeleteAccountUrl = () => {\n\n\n\n\n return `/me`\n}\n\n/**\n * Erase this authenticated identity while retaining its historical rows.\n *\n * Other independently authenticated household members are never erased by\n * this operation. The holder must first remove active/pending memberships;\n * an adult who is a child's final guardian must assign another guardian first.\n * All household writes take the same beneficiary lock, including invitations.\n * @summary Delete Account\n */\nexport const deleteAccount = async ( options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getDeleteAccountUrl(),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\nexport const getReadAccountUrl = () => {\n\n\n\n\n return `/me`\n}\n\n/**\n * The authenticated account (E15).\n *\n * No query, no join: ``CurrentUserDep`` has already resolved the row behind the\n * token. The endpoint the legacy should have had here has been returning ``500``\n * on every request for as long as anyone has looked (defect D1).\n *\n * ``isNameEditable`` exists so a client need not discover the answer by being\n * refused. A member signing in through their establishment cannot change their\n * own name here — the realm rewrites it at every login — and until now the\n * only way to find that out was to type one and receive a ``403``. The field\n * says it before the form is drawn.\n * @summary Read Account\n */\nexport const readAccount = async ( options?: Parameters<typeof request>[1]): Promise<AccountDetailRead> => {\n\n return request<AccountDetailRead>(getReadAccountUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getUpdateAccountUrl = () => {\n\n\n\n\n return `/me`\n}\n\n/**\n * Partially update the account (E16).\n *\n * ``exclude_unset`` is what separates PATCH from PUT here: a field the client\n * omitted is left alone, which is not the same as a field it sent as null. The\n * response is built from the persisted row rather than the submitted body.\n * @summary Update Account\n */\nexport const updateAccount = async (accountUpdateWrite: AccountUpdateWrite, options?: Parameters<typeof request>[1]): Promise<AccountDetailRead> => {\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<AccountDetailRead>(getUpdateAccountUrl(),\n {\n ...options,\n method: 'PATCH',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(accountUpdateWrite)\n }\n);}\n\n\nexport const getReadCapabilitiesUrl = () => {\n\n\n\n\n return `/me/capabilities`\n}\n\n/**\n * Current profile's universes, provider access and navigation paths.\n *\n * Does not allocate a licence or contact a provider. ``readingAllowed`` is a\n * local permission snapshot; configuration and upstream health are separate.\n * The reader always authorizes again when opening a title.\n * @summary Read Capabilities\n */\nexport const readCapabilities = async ( options?: Parameters<typeof request>[1]): Promise<FrontendCapabilitiesRead> => {\n\n return request<FrontendCapabilitiesRead>(getReadCapabilitiesUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getReadOnboardingUrl = () => {\n\n\n\n\n return `/me/onboarding`\n}\n\n/**\n * State for optional profile setup, with existing write-resource paths.\n *\n * The signed-in adult updates their own fields using PATCH /me. A guardian\n * manages a child through /me/profiles. Category selections use\n * PUT /biblio/me/preferences/categories in the effective profile context.\n * Press-title choices use pressTitlesUrl and pressFavoritesUrl; they are the\n * profile's press_title favourites, not additional catalogue categories.\n * No terms acceptance or mandatory onboarding completion is invented here.\n * @summary Read Onboarding\n */\nexport const readOnboarding = async ( options?: Parameters<typeof request>[1]): Promise<OnboardingRead> => {\n\n return request<OnboardingRead>(getReadOnboardingUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getListServicesUrl = () => {\n\n\n\n\n return `/me/services`\n}\n\n/**\n * Third-party services this account's establishment offers (E27).\n *\n * Under ``/me`` rather than ``/biblio/me`` because it is not a catalogue: these\n * are the establishment's own service tiles, and they belong to the tenant\n * whichever catalogue that tenant reads from. It is also the one place the\n * biblio spec describes something the *CVS* schema models, which is why it sat\n * in the wrong module until the prefixes made the mismatch visible.\n *\n * Date-windowed. A service outside its window is absent rather than disabled:\n * the client should not have to know the difference, and a visible dead link is\n * worse than no link.\n * @summary List Services\n */\nexport const listServices = async ( options?: Parameters<typeof request>[1]): Promise<ServiceListRead> => {\n\n return request<ServiceListRead>(getListServicesUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n"],"mappings":";;;AAiBA,MAAa,4BAA4B;CAKvC,OAAO;AACT;;;;;;;;;;AAWA,MAAa,gBAAgB,OAAQ,YAA2D;CAE9F,OAAO,QAAc,oBAAoB,GACzC;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,0BAA0B;CAKrC,OAAO;AACT;;;;;;;;;;;;;;;AAgBA,MAAa,cAAc,OAAQ,YAAwE;CAEzG,OAAO,QAA2B,kBAAkB,GACpD;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,4BAA4B;CAKvC,OAAO;AACT;;;;;;;;;AAUA,MAAa,gBAAgB,OAAO,oBAAwC,YAAwE;CAEhJ,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,QAA2B,oBAAoB,GACpD;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,kBAAkB;CACzC,CACF;AAAE;AAGF,MAAa,+BAA+B;CAK1C,OAAO;AACT;;;;;;;;;AAUA,MAAa,mBAAmB,OAAQ,YAA+E;CAErH,OAAO,QAAkC,uBAAuB,GAChE;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,6BAA6B;CAKxC,OAAO;AACT;;;;;;;;;;;;AAaA,MAAa,iBAAiB,OAAQ,YAAqE;CAEzG,OAAO,QAAwB,qBAAqB,GACpD;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,2BAA2B;CAKtC,OAAO;AACT;;;;;;;;;;;;;;;AAgBA,MAAa,eAAe,OAAQ,YAAsE;CAExG,OAAO,QAAyB,mBAAmB,GACnD;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE"}
@@ -1,7 +1,82 @@
1
1
 
2
- import { A as ThemeWrite, Dr as ListThemesParams, M as ThemeListRead, N as ThemeRead, j as ThemeOrderWrite } from "../chunks/index.js";
2
+ import { A as ThemeWrite, An as PressVoucherCodesWrite, Hn as PressRefreshRead, M as ThemeListRead, N as ThemeRead, On as PressVoucherImportRead, Sn as PressVoucherOfferRead, Vn as PressRefreshWrite, bn as PressVoucherOfferWrite, gn as PressVoucherUsageRead, j as ThemeOrderWrite, jn as PressVoucherActivationReportWrite, kn as PressVoucherDisableWrite, li as ListPressArticleRefreshesParams, ni as ListThemesParams, qn as PressDiscoveryJobRead, vn as PressVoucherPoolWrite, yn as PressVoucherPoolRead } from "../chunks/index.js";
3
3
  import { c as request } from "../chunks/client.js";
4
4
  //#region src/api/admin-catalogue/admin-catalogue.d.ts
5
+ export declare const getListPressArticleRefreshesUrl: (params?: ListPressArticleRefreshesParams) => string;
6
+ /**
7
+ * Recent refresh progress and safe error codes; no provider credentials or response dumps.
8
+ * @summary List Press Article Refreshes
9
+ */
10
+ export declare const listPressArticleRefreshes: (params?: ListPressArticleRefreshesParams, options?: Parameters<typeof request>[1]) => Promise<PressDiscoveryJobRead[]>;
11
+ export declare const getRequestPressArticleRefreshUrl: () => string;
12
+ /**
13
+ * Queue a bounded, idempotent metadata refresh; workers fetch one page per task.
14
+ * @summary Request Press Article Refresh
15
+ */
16
+ export declare const requestPressArticleRefresh: (pressRefreshWrite: PressRefreshWrite, options?: Parameters<typeof request>[1]) => Promise<PressRefreshRead>;
17
+ export declare const getListPressVoucherOffersUrl: () => string;
18
+ /**
19
+ * Global code-offer configuration; no code values are returned.
20
+ * @summary List Press Voucher Offers
21
+ */
22
+ export declare const listPressVoucherOffers: (options?: Parameters<typeof request>[1]) => Promise<PressVoucherOfferRead[]>;
23
+ export declare const getConfigurePressVoucherOfferUrl: () => string;
24
+ /**
25
+ * Configure a known newspaper offer and explicit native publication bindings.
26
+ * @summary Configure Press Voucher Offer
27
+ */
28
+ export declare const configurePressVoucherOffer: (pressVoucherOfferWrite: PressVoucherOfferWrite, options?: Parameters<typeof request>[1]) => Promise<PressVoucherOfferRead>;
29
+ export declare const getListPressVoucherPoolsUrl: (offerId: number) => string;
30
+ /**
31
+ * Stock, allocations and confirmed activations. No private codes are listed.
32
+ * @summary List Press Voucher Pools
33
+ */
34
+ export declare const listPressVoucherPools: (offerId: number, options?: Parameters<typeof request>[1]) => Promise<PressVoucherPoolRead[]>;
35
+ export declare const getCreatePressVoucherPoolUrl: (offerId: number) => string;
36
+ /**
37
+ * Create a bank with explicit availability and calendar-based benefit/renewal rules.
38
+ * @summary Create Press Voucher Pool
39
+ */
40
+ export declare const createPressVoucherPool: (offerId: number, pressVoucherPoolWrite: PressVoucherPoolWrite, options?: Parameters<typeof request>[1]) => Promise<PressVoucherPoolRead>;
41
+ export declare const getReadPressVoucherUsageUrl: (offerId: number) => string;
42
+ /**
43
+ * Allocation and confirmed-activation counts, with legacy reported evidence separate.
44
+ *
45
+ * No per-reader sessions or durations are fabricated from legacy averages.
46
+ * @summary Read Press Voucher Usage
47
+ */
48
+ export declare const readPressVoucherUsage: (offerId: number, options?: Parameters<typeof request>[1]) => Promise<PressVoucherUsageRead>;
49
+ export declare const getUpdatePressVoucherPoolUrl: (poolId: number) => string;
50
+ /**
51
+ * Enable/close stock; an allocated bank's benefit policy cannot change retroactively.
52
+ * @summary Update Press Voucher Pool
53
+ */
54
+ export declare const updatePressVoucherPool: (poolId: number, pressVoucherPoolWrite: PressVoucherPoolWrite, options?: Parameters<typeof request>[1]) => Promise<PressVoucherPoolRead>;
55
+ export declare const getImportPressVoucherActivationsUrl: (poolId: number) => string;
56
+ /**
57
+ * Apply publisher-confirmed dates; never infer activation from allocation.
58
+ *
59
+ * Matching repeats are harmless. Unknown codes, conflicting confirmations and
60
+ * future activation dates are refused atomically. An already-used unallocated
61
+ * code is quarantined so it cannot be handed to another household.
62
+ * @summary Import Press Voucher Activations
63
+ */
64
+ export declare const importPressVoucherActivations: (poolId: number, pressVoucherActivationReportWrite: PressVoucherActivationReportWrite, options?: Parameters<typeof request>[1]) => Promise<PressVoucherImportRead>;
65
+ export declare const getImportPressVoucherCodesUrl: (poolId: number) => string;
66
+ /**
67
+ * Import at most 500 private codes atomically. Same-bank repeats are idempotent.
68
+ *
69
+ * A code already in another bank is refused; existing owners are never changed.
70
+ * Values are encrypted at rest and omitted from responses and audit details.
71
+ * @summary Import Press Voucher Codes
72
+ */
73
+ export declare const importPressVoucherCodes: (poolId: number, pressVoucherCodesWrite: PressVoucherCodesWrite, options?: Parameters<typeof request>[1]) => Promise<PressVoucherImportRead>;
74
+ export declare const getDisablePressVoucherCodesUrl: (poolId: number) => string;
75
+ /**
76
+ * Disable local issuance/retrieval without clearing ownership or cancelling publisher accounts.
77
+ * @summary Disable Press Voucher Codes
78
+ */
79
+ export declare const disablePressVoucherCodes: (poolId: number, pressVoucherDisableWrite: PressVoucherDisableWrite, options?: Parameters<typeof request>[1]) => Promise<PressVoucherImportRead>;
5
80
  export declare const getListThemesUrl: (params?: ListThemesParams) => string;
6
81
  /**
7
82
  * Every theme, or one pillar's, in display order.
@@ -1,6 +1,254 @@
1
1
 
2
2
  import { r as request } from "../chunks/client.js";
3
3
  //#region src/api/admin-catalogue/admin-catalogue.ts
4
+ const getListPressArticleRefreshesUrl = (params) => {
5
+ const normalizedParams = new URLSearchParams();
6
+ Object.entries(params || {}).forEach(([key, value]) => {
7
+ if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
8
+ });
9
+ const stringifiedParams = normalizedParams.toString();
10
+ return stringifiedParams.length > 0 ? `/admin/press/article-refreshes?${stringifiedParams}` : `/admin/press/article-refreshes`;
11
+ };
12
+ /**
13
+ * Recent refresh progress and safe error codes; no provider credentials or response dumps.
14
+ * @summary List Press Article Refreshes
15
+ */
16
+ const listPressArticleRefreshes = async (params, options) => {
17
+ return request(getListPressArticleRefreshesUrl(params), {
18
+ ...options,
19
+ method: "GET"
20
+ });
21
+ };
22
+ const getRequestPressArticleRefreshUrl = () => {
23
+ return `/admin/press/article-refreshes`;
24
+ };
25
+ /**
26
+ * Queue a bounded, idempotent metadata refresh; workers fetch one page per task.
27
+ * @summary Request Press Article Refresh
28
+ */
29
+ const requestPressArticleRefresh = async (pressRefreshWrite, options) => {
30
+ const getHeaders = (h) => {
31
+ if (!h) return {};
32
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
33
+ if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
34
+ const headers = {};
35
+ for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
36
+ return headers;
37
+ };
38
+ return request(getRequestPressArticleRefreshUrl(), {
39
+ ...options,
40
+ method: "POST",
41
+ headers: {
42
+ "Content-Type": "application/json",
43
+ ...getHeaders(options?.headers)
44
+ },
45
+ body: JSON.stringify(pressRefreshWrite)
46
+ });
47
+ };
48
+ const getListPressVoucherOffersUrl = () => {
49
+ return `/admin/press/voucher-offers`;
50
+ };
51
+ /**
52
+ * Global code-offer configuration; no code values are returned.
53
+ * @summary List Press Voucher Offers
54
+ */
55
+ const listPressVoucherOffers = async (options) => {
56
+ return request(getListPressVoucherOffersUrl(), {
57
+ ...options,
58
+ method: "GET"
59
+ });
60
+ };
61
+ const getConfigurePressVoucherOfferUrl = () => {
62
+ return `/admin/press/voucher-offers`;
63
+ };
64
+ /**
65
+ * Configure a known newspaper offer and explicit native publication bindings.
66
+ * @summary Configure Press Voucher Offer
67
+ */
68
+ const configurePressVoucherOffer = async (pressVoucherOfferWrite, options) => {
69
+ const getHeaders = (h) => {
70
+ if (!h) return {};
71
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
72
+ if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
73
+ const headers = {};
74
+ for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
75
+ return headers;
76
+ };
77
+ return request(getConfigurePressVoucherOfferUrl(), {
78
+ ...options,
79
+ method: "PUT",
80
+ headers: {
81
+ "Content-Type": "application/json",
82
+ ...getHeaders(options?.headers)
83
+ },
84
+ body: JSON.stringify(pressVoucherOfferWrite)
85
+ });
86
+ };
87
+ const getListPressVoucherPoolsUrl = (offerId) => {
88
+ return `/admin/press/voucher-offers/${offerId}/pools`;
89
+ };
90
+ /**
91
+ * Stock, allocations and confirmed activations. No private codes are listed.
92
+ * @summary List Press Voucher Pools
93
+ */
94
+ const listPressVoucherPools = async (offerId, options) => {
95
+ return request(getListPressVoucherPoolsUrl(offerId), {
96
+ ...options,
97
+ method: "GET"
98
+ });
99
+ };
100
+ const getCreatePressVoucherPoolUrl = (offerId) => {
101
+ return `/admin/press/voucher-offers/${offerId}/pools`;
102
+ };
103
+ /**
104
+ * Create a bank with explicit availability and calendar-based benefit/renewal rules.
105
+ * @summary Create Press Voucher Pool
106
+ */
107
+ const createPressVoucherPool = async (offerId, pressVoucherPoolWrite, options) => {
108
+ const getHeaders = (h) => {
109
+ if (!h) return {};
110
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
111
+ if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
112
+ const headers = {};
113
+ for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
114
+ return headers;
115
+ };
116
+ return request(getCreatePressVoucherPoolUrl(offerId), {
117
+ ...options,
118
+ method: "POST",
119
+ headers: {
120
+ "Content-Type": "application/json",
121
+ ...getHeaders(options?.headers)
122
+ },
123
+ body: JSON.stringify(pressVoucherPoolWrite)
124
+ });
125
+ };
126
+ const getReadPressVoucherUsageUrl = (offerId) => {
127
+ return `/admin/press/voucher-offers/${offerId}/usage`;
128
+ };
129
+ /**
130
+ * Allocation and confirmed-activation counts, with legacy reported evidence separate.
131
+ *
132
+ * No per-reader sessions or durations are fabricated from legacy averages.
133
+ * @summary Read Press Voucher Usage
134
+ */
135
+ const readPressVoucherUsage = async (offerId, options) => {
136
+ return request(getReadPressVoucherUsageUrl(offerId), {
137
+ ...options,
138
+ method: "GET"
139
+ });
140
+ };
141
+ const getUpdatePressVoucherPoolUrl = (poolId) => {
142
+ return `/admin/press/voucher-pools/${poolId}`;
143
+ };
144
+ /**
145
+ * Enable/close stock; an allocated bank's benefit policy cannot change retroactively.
146
+ * @summary Update Press Voucher Pool
147
+ */
148
+ const updatePressVoucherPool = async (poolId, pressVoucherPoolWrite, options) => {
149
+ const getHeaders = (h) => {
150
+ if (!h) return {};
151
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
152
+ if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
153
+ const headers = {};
154
+ for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
155
+ return headers;
156
+ };
157
+ return request(getUpdatePressVoucherPoolUrl(poolId), {
158
+ ...options,
159
+ method: "PUT",
160
+ headers: {
161
+ "Content-Type": "application/json",
162
+ ...getHeaders(options?.headers)
163
+ },
164
+ body: JSON.stringify(pressVoucherPoolWrite)
165
+ });
166
+ };
167
+ const getImportPressVoucherActivationsUrl = (poolId) => {
168
+ return `/admin/press/voucher-pools/${poolId}/activations`;
169
+ };
170
+ /**
171
+ * Apply publisher-confirmed dates; never infer activation from allocation.
172
+ *
173
+ * Matching repeats are harmless. Unknown codes, conflicting confirmations and
174
+ * future activation dates are refused atomically. An already-used unallocated
175
+ * code is quarantined so it cannot be handed to another household.
176
+ * @summary Import Press Voucher Activations
177
+ */
178
+ const importPressVoucherActivations = async (poolId, pressVoucherActivationReportWrite, options) => {
179
+ const getHeaders = (h) => {
180
+ if (!h) return {};
181
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
182
+ if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
183
+ const headers = {};
184
+ for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
185
+ return headers;
186
+ };
187
+ return request(getImportPressVoucherActivationsUrl(poolId), {
188
+ ...options,
189
+ method: "POST",
190
+ headers: {
191
+ "Content-Type": "application/json",
192
+ ...getHeaders(options?.headers)
193
+ },
194
+ body: JSON.stringify(pressVoucherActivationReportWrite)
195
+ });
196
+ };
197
+ const getImportPressVoucherCodesUrl = (poolId) => {
198
+ return `/admin/press/voucher-pools/${poolId}/codes`;
199
+ };
200
+ /**
201
+ * Import at most 500 private codes atomically. Same-bank repeats are idempotent.
202
+ *
203
+ * A code already in another bank is refused; existing owners are never changed.
204
+ * Values are encrypted at rest and omitted from responses and audit details.
205
+ * @summary Import Press Voucher Codes
206
+ */
207
+ const importPressVoucherCodes = async (poolId, pressVoucherCodesWrite, options) => {
208
+ const getHeaders = (h) => {
209
+ if (!h) return {};
210
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
211
+ if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
212
+ const headers = {};
213
+ for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
214
+ return headers;
215
+ };
216
+ return request(getImportPressVoucherCodesUrl(poolId), {
217
+ ...options,
218
+ method: "POST",
219
+ headers: {
220
+ "Content-Type": "application/json",
221
+ ...getHeaders(options?.headers)
222
+ },
223
+ body: JSON.stringify(pressVoucherCodesWrite)
224
+ });
225
+ };
226
+ const getDisablePressVoucherCodesUrl = (poolId) => {
227
+ return `/admin/press/voucher-pools/${poolId}/codes/disable`;
228
+ };
229
+ /**
230
+ * Disable local issuance/retrieval without clearing ownership or cancelling publisher accounts.
231
+ * @summary Disable Press Voucher Codes
232
+ */
233
+ const disablePressVoucherCodes = async (poolId, pressVoucherDisableWrite, options) => {
234
+ const getHeaders = (h) => {
235
+ if (!h) return {};
236
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
237
+ if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
238
+ const headers = {};
239
+ for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
240
+ return headers;
241
+ };
242
+ return request(getDisablePressVoucherCodesUrl(poolId), {
243
+ ...options,
244
+ method: "POST",
245
+ headers: {
246
+ "Content-Type": "application/json",
247
+ ...getHeaders(options?.headers)
248
+ },
249
+ body: JSON.stringify(pressVoucherDisableWrite)
250
+ });
251
+ };
4
252
  const getListThemesUrl = (params) => {
5
253
  const normalizedParams = new URLSearchParams();
6
254
  Object.entries(params || {}).forEach(([key, value]) => {
@@ -150,6 +398,6 @@ const amendTheme = async (themeId, themeWrite, options) => {
150
398
  });
151
399
  };
152
400
  //#endregion
153
- export { amendTheme, createTheme, deleteTheme, getAmendThemeUrl, getCreateThemeUrl, getDeleteThemeUrl, getListThemesUrl, getReadThemeUrl, getReorderThemesUrl, listThemes, readTheme, reorderThemes };
401
+ export { amendTheme, configurePressVoucherOffer, createPressVoucherPool, createTheme, deleteTheme, disablePressVoucherCodes, getAmendThemeUrl, getConfigurePressVoucherOfferUrl, getCreatePressVoucherPoolUrl, getCreateThemeUrl, getDeleteThemeUrl, getDisablePressVoucherCodesUrl, getImportPressVoucherActivationsUrl, getImportPressVoucherCodesUrl, getListPressArticleRefreshesUrl, getListPressVoucherOffersUrl, getListPressVoucherPoolsUrl, getListThemesUrl, getReadPressVoucherUsageUrl, getReadThemeUrl, getReorderThemesUrl, getRequestPressArticleRefreshUrl, getUpdatePressVoucherPoolUrl, importPressVoucherActivations, importPressVoucherCodes, listPressArticleRefreshes, listPressVoucherOffers, listPressVoucherPools, listThemes, readPressVoucherUsage, readTheme, reorderThemes, requestPressArticleRefresh, updatePressVoucherPool };
154
402
 
155
403
  //# sourceMappingURL=admin-catalogue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"admin-catalogue.js","names":[],"sources":["../../src/api/admin-catalogue/admin-catalogue.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.13.0\n */\nimport type {\n ListThemesParams,\n ThemeListRead,\n ThemeOrderWrite,\n ThemeRead,\n ThemeWrite\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getListThemesUrl = (params?: ListThemesParams,) => {\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/themes?${stringifiedParams}` : `/admin/themes`\n}\n\n/**\n * Every theme, or one pillar's, in display order.\n *\n * Not paginated. There are 27 of them, and a client that has to page through\n * a list it is about to reorder cannot reorder it.\n * @summary List Themes\n */\nexport const listThemes = async (params?: ListThemesParams, options?: Parameters<typeof request>[1]): Promise<ThemeListRead> => {\n\n return request<ThemeListRead>(getListThemesUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getCreateThemeUrl = () => {\n\n\n\n\n return `/admin/themes`\n}\n\n/**\n * Add a theme.\n *\n * ``409`` on a duplicate ``(pillar, title)``: that pair is unique in the\n * schema, and two themes with the same name in the same pillar are\n * indistinguishable to everyone downstream.\n *\n * With no ``sortOrder`` it goes last, which is what the legacy's form does by\n * defaulting the field to the current maximum plus one.\n * @summary Create Theme\n */\nexport const createTheme = async (themeWrite: ThemeWrite, options?: Parameters<typeof request>[1]): Promise<ThemeRead> => {\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<ThemeRead>(getCreateThemeUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(themeWrite)\n }\n);}\n\n\nexport const getReorderThemesUrl = () => {\n\n\n\n\n return `/admin/themes/order`\n}\n\n/**\n * Set the display order for a set of themes, in one transaction.\n *\n * The legacy renumbers one theme per request, so dragging an item in a list of\n * thirty was thirty requests — and closing the tab halfway left the order\n * half-applied, with two themes claiming the same position and the listing\n * silently choosing between them.\n *\n * Ids not named keep their relative order after the ones that are, so a client\n * may send only what moved. An unknown id is ``404`` and nothing is written:\n * a partially applied reorder is the failure this endpoint exists to prevent.\n * @summary Reorder Themes\n */\nexport const reorderThemes = async (themeOrderWrite: ThemeOrderWrite, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<void>(getReorderThemesUrl(),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(themeOrderWrite)\n }\n);}\n\n\nexport const getDeleteThemeUrl = (themeId: number,) => {\n\n\n\n\n return `/admin/themes/${themeId}`\n}\n\n/**\n * Remove a theme.\n *\n * ``409`` when works still carry it. The legacy deletes and leaves the\n * references dangling, which is how a catalogue ends up with items filed under\n * a theme that no longer exists and no screen that can find them.\n *\n * Idempotent otherwise: deleting something already gone is ``204``, because\n * the caller wanted it gone and it is gone.\n * @summary Delete Theme\n */\nexport const deleteTheme = async (themeId: number, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getDeleteThemeUrl(themeId),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\nexport const getReadThemeUrl = (themeId: number,) => {\n\n\n\n\n return `/admin/themes/${themeId}`\n}\n\n/**\n * One theme.\n * @summary Read Theme\n */\nexport const readTheme = async (themeId: number, options?: Parameters<typeof request>[1]): Promise<ThemeRead> => {\n\n return request<ThemeRead>(getReadThemeUrl(themeId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getAmendThemeUrl = (themeId: number,) => {\n\n\n\n\n return `/admin/themes/${themeId}`\n}\n\n/**\n * Amend a theme. Same uniqueness rule as creating one.\n * @summary Amend Theme\n */\nexport const amendTheme = async (themeId: number,\n themeWrite: ThemeWrite, options?: Parameters<typeof request>[1]): Promise<ThemeRead> => {\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<ThemeRead>(getAmendThemeUrl(themeId),\n {\n ...options,\n method: 'PATCH',\n headers: { 'Content-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AK,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,QAAmB,iBAAiB,OAAO,GAChD;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,UAAU;CACjC,CACF;AAAE"}
1
+ {"version":3,"file":"admin-catalogue.js","names":[],"sources":["../../src/api/admin-catalogue/admin-catalogue.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.14.1\n */\nimport type {\n ListPressArticleRefreshesParams,\n ListThemesParams,\n PressDiscoveryJobRead,\n PressRefreshRead,\n PressRefreshWrite,\n PressVoucherActivationReportWrite,\n PressVoucherCodesWrite,\n PressVoucherDisableWrite,\n PressVoucherImportRead,\n PressVoucherOfferRead,\n PressVoucherOfferWrite,\n PressVoucherPoolRead,\n PressVoucherPoolWrite,\n PressVoucherUsageRead,\n ThemeListRead,\n ThemeOrderWrite,\n ThemeRead,\n ThemeWrite\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getListPressArticleRefreshesUrl = (params?: ListPressArticleRefreshesParams,) => {\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/press/article-refreshes?${stringifiedParams}` : `/admin/press/article-refreshes`\n}\n\n/**\n * Recent refresh progress and safe error codes; no provider credentials or response dumps.\n * @summary List Press Article Refreshes\n */\nexport const listPressArticleRefreshes = async (params?: ListPressArticleRefreshesParams, options?: Parameters<typeof request>[1]): Promise<PressDiscoveryJobRead[]> => {\n\n return request<PressDiscoveryJobRead[]>(getListPressArticleRefreshesUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getRequestPressArticleRefreshUrl = () => {\n\n\n\n\n return `/admin/press/article-refreshes`\n}\n\n/**\n * Queue a bounded, idempotent metadata refresh; workers fetch one page per task.\n * @summary Request Press Article Refresh\n */\nexport const requestPressArticleRefresh = async (pressRefreshWrite: PressRefreshWrite, options?: Parameters<typeof request>[1]): Promise<PressRefreshRead> => {\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<PressRefreshRead>(getRequestPressArticleRefreshUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(pressRefreshWrite)\n }\n);}\n\n\nexport const getListPressVoucherOffersUrl = () => {\n\n\n\n\n return `/admin/press/voucher-offers`\n}\n\n/**\n * Global code-offer configuration; no code values are returned.\n * @summary List Press Voucher Offers\n */\nexport const listPressVoucherOffers = async ( options?: Parameters<typeof request>[1]): Promise<PressVoucherOfferRead[]> => {\n\n return request<PressVoucherOfferRead[]>(getListPressVoucherOffersUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getConfigurePressVoucherOfferUrl = () => {\n\n\n\n\n return `/admin/press/voucher-offers`\n}\n\n/**\n * Configure a known newspaper offer and explicit native publication bindings.\n * @summary Configure Press Voucher Offer\n */\nexport const configurePressVoucherOffer = async (pressVoucherOfferWrite: PressVoucherOfferWrite, options?: Parameters<typeof request>[1]): Promise<PressVoucherOfferRead> => {\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<PressVoucherOfferRead>(getConfigurePressVoucherOfferUrl(),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(pressVoucherOfferWrite)\n }\n);}\n\n\nexport const getListPressVoucherPoolsUrl = (offerId: number,) => {\n\n\n\n\n return `/admin/press/voucher-offers/${offerId}/pools`\n}\n\n/**\n * Stock, allocations and confirmed activations. No private codes are listed.\n * @summary List Press Voucher Pools\n */\nexport const listPressVoucherPools = async (offerId: number, options?: Parameters<typeof request>[1]): Promise<PressVoucherPoolRead[]> => {\n\n return request<PressVoucherPoolRead[]>(getListPressVoucherPoolsUrl(offerId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getCreatePressVoucherPoolUrl = (offerId: number,) => {\n\n\n\n\n return `/admin/press/voucher-offers/${offerId}/pools`\n}\n\n/**\n * Create a bank with explicit availability and calendar-based benefit/renewal rules.\n * @summary Create Press Voucher Pool\n */\nexport const createPressVoucherPool = async (offerId: number,\n pressVoucherPoolWrite: PressVoucherPoolWrite, options?: Parameters<typeof request>[1]): Promise<PressVoucherPoolRead> => {\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<PressVoucherPoolRead>(getCreatePressVoucherPoolUrl(offerId),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(pressVoucherPoolWrite)\n }\n);}\n\n\nexport const getReadPressVoucherUsageUrl = (offerId: number,) => {\n\n\n\n\n return `/admin/press/voucher-offers/${offerId}/usage`\n}\n\n/**\n * Allocation and confirmed-activation counts, with legacy reported evidence separate.\n *\n * No per-reader sessions or durations are fabricated from legacy averages.\n * @summary Read Press Voucher Usage\n */\nexport const readPressVoucherUsage = async (offerId: number, options?: Parameters<typeof request>[1]): Promise<PressVoucherUsageRead> => {\n\n return request<PressVoucherUsageRead>(getReadPressVoucherUsageUrl(offerId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getUpdatePressVoucherPoolUrl = (poolId: number,) => {\n\n\n\n\n return `/admin/press/voucher-pools/${poolId}`\n}\n\n/**\n * Enable/close stock; an allocated bank's benefit policy cannot change retroactively.\n * @summary Update Press Voucher Pool\n */\nexport const updatePressVoucherPool = async (poolId: number,\n pressVoucherPoolWrite: PressVoucherPoolWrite, options?: Parameters<typeof request>[1]): Promise<PressVoucherPoolRead> => {\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<PressVoucherPoolRead>(getUpdatePressVoucherPoolUrl(poolId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(pressVoucherPoolWrite)\n }\n);}\n\n\nexport const getImportPressVoucherActivationsUrl = (poolId: number,) => {\n\n\n\n\n return `/admin/press/voucher-pools/${poolId}/activations`\n}\n\n/**\n * Apply publisher-confirmed dates; never infer activation from allocation.\n *\n * Matching repeats are harmless. Unknown codes, conflicting confirmations and\n * future activation dates are refused atomically. An already-used unallocated\n * code is quarantined so it cannot be handed to another household.\n * @summary Import Press Voucher Activations\n */\nexport const importPressVoucherActivations = async (poolId: number,\n pressVoucherActivationReportWrite: PressVoucherActivationReportWrite, options?: Parameters<typeof request>[1]): Promise<PressVoucherImportRead> => {\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<PressVoucherImportRead>(getImportPressVoucherActivationsUrl(poolId),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(pressVoucherActivationReportWrite)\n }\n);}\n\n\nexport const getImportPressVoucherCodesUrl = (poolId: number,) => {\n\n\n\n\n return `/admin/press/voucher-pools/${poolId}/codes`\n}\n\n/**\n * Import at most 500 private codes atomically. Same-bank repeats are idempotent.\n *\n * A code already in another bank is refused; existing owners are never changed.\n * Values are encrypted at rest and omitted from responses and audit details.\n * @summary Import Press Voucher Codes\n */\nexport const importPressVoucherCodes = async (poolId: number,\n pressVoucherCodesWrite: PressVoucherCodesWrite, options?: Parameters<typeof request>[1]): Promise<PressVoucherImportRead> => {\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<PressVoucherImportRead>(getImportPressVoucherCodesUrl(poolId),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(pressVoucherCodesWrite)\n }\n);}\n\n\nexport const getDisablePressVoucherCodesUrl = (poolId: number,) => {\n\n\n\n\n return `/admin/press/voucher-pools/${poolId}/codes/disable`\n}\n\n/**\n * Disable local issuance/retrieval without clearing ownership or cancelling publisher accounts.\n * @summary Disable Press Voucher Codes\n */\nexport const disablePressVoucherCodes = async (poolId: number,\n pressVoucherDisableWrite: PressVoucherDisableWrite, options?: Parameters<typeof request>[1]): Promise<PressVoucherImportRead> => {\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<PressVoucherImportRead>(getDisablePressVoucherCodesUrl(poolId),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(pressVoucherDisableWrite)\n }\n);}\n\n\nexport const getListThemesUrl = (params?: ListThemesParams,) => {\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/themes?${stringifiedParams}` : `/admin/themes`\n}\n\n/**\n * Every theme, or one pillar's, in display order.\n *\n * Not paginated. There are 27 of them, and a client that has to page through\n * a list it is about to reorder cannot reorder it.\n * @summary List Themes\n */\nexport const listThemes = async (params?: ListThemesParams, options?: Parameters<typeof request>[1]): Promise<ThemeListRead> => {\n\n return request<ThemeListRead>(getListThemesUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getCreateThemeUrl = () => {\n\n\n\n\n return `/admin/themes`\n}\n\n/**\n * Add a theme.\n *\n * ``409`` on a duplicate ``(pillar, title)``: that pair is unique in the\n * schema, and two themes with the same name in the same pillar are\n * indistinguishable to everyone downstream.\n *\n * With no ``sortOrder`` it goes last, which is what the legacy's form does by\n * defaulting the field to the current maximum plus one.\n * @summary Create Theme\n */\nexport const createTheme = async (themeWrite: ThemeWrite, options?: Parameters<typeof request>[1]): Promise<ThemeRead> => {\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<ThemeRead>(getCreateThemeUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(themeWrite)\n }\n);}\n\n\nexport const getReorderThemesUrl = () => {\n\n\n\n\n return `/admin/themes/order`\n}\n\n/**\n * Set the display order for a set of themes, in one transaction.\n *\n * The legacy renumbers one theme per request, so dragging an item in a list of\n * thirty was thirty requests — and closing the tab halfway left the order\n * half-applied, with two themes claiming the same position and the listing\n * silently choosing between them.\n *\n * Ids not named keep their relative order after the ones that are, so a client\n * may send only what moved. An unknown id is ``404`` and nothing is written:\n * a partially applied reorder is the failure this endpoint exists to prevent.\n * @summary Reorder Themes\n */\nexport const reorderThemes = async (themeOrderWrite: ThemeOrderWrite, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<void>(getReorderThemesUrl(),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(themeOrderWrite)\n }\n);}\n\n\nexport const getDeleteThemeUrl = (themeId: number,) => {\n\n\n\n\n return `/admin/themes/${themeId}`\n}\n\n/**\n * Remove a theme.\n *\n * ``409`` when works still carry it. The legacy deletes and leaves the\n * references dangling, which is how a catalogue ends up with items filed under\n * a theme that no longer exists and no screen that can find them.\n *\n * Idempotent otherwise: deleting something already gone is ``204``, because\n * the caller wanted it gone and it is gone.\n * @summary Delete Theme\n */\nexport const deleteTheme = async (themeId: number, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getDeleteThemeUrl(themeId),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\nexport const getReadThemeUrl = (themeId: number,) => {\n\n\n\n\n return `/admin/themes/${themeId}`\n}\n\n/**\n * One theme.\n * @summary Read Theme\n */\nexport const readTheme = async (themeId: number, options?: Parameters<typeof request>[1]): Promise<ThemeRead> => {\n\n return request<ThemeRead>(getReadThemeUrl(themeId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getAmendThemeUrl = (themeId: number,) => {\n\n\n\n\n return `/admin/themes/${themeId}`\n}\n\n/**\n * Amend a theme. Same uniqueness rule as creating one.\n * @summary Amend Theme\n */\nexport const amendTheme = async (themeId: number,\n themeWrite: ThemeWrite, options?: Parameters<typeof request>[1]): Promise<ThemeRead> => {\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<ThemeRead>(getAmendThemeUrl(themeId),\n {\n ...options,\n method: 'PATCH',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(themeWrite)\n }\n);}\n\n\n"],"mappings":";;;AA8BA,MAAa,mCAAmC,WAA8C;CAC5F,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,kCAAkC,sBAAsB;AAChG;;;;;AA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AO,iBAAiB;AAC1B;;;;;AAMA,MAAa,aAAa,OAAO,SAC7B,YAAwB,YAAgE;CAExF,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,QAAmB,iBAAiB,OAAO,GAChD;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,UAAU;CACjC,CACF;AAAE"}
@@ -1,5 +1,5 @@
1
1
 
2
- import { Tr as LiveLeaseListRead, oi as LeaseCloseWrite } from "../chunks/index.js";
2
+ import { Ri as LeaseCloseWrite, ei as LiveLeaseListRead } from "../chunks/index.js";
3
3
  import { c as request } from "../chunks/client.js";
4
4
  //#region src/api/admin-consumption/admin-consumption.d.ts
5
5
  export declare const getListLiveLeasesUrl: () => string;
@@ -1 +1 @@
1
- {"version":3,"file":"admin-consumption.js","names":[],"sources":["../../src/api/admin-consumption/admin-consumption.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.13.0\n */\nimport type {\n LeaseCloseWrite,\n LiveLeaseListRead\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getListLiveLeasesUrl = () => {\n\n\n\n\n return `/admin/consumption/live`\n}\n\n/**\n * What is open right now, within the caller's tenant scope.\n *\n * Read from the ledger rather than the Redis live set: this is a diagnostic and\n * must show the truth even when the cache is cold, and it runs once when\n * somebody opens a screen rather than on every read.\n *\n * Shares :func:`~app.services.entitlement.is_live` with the two seat counts.\n * An earlier version of this route filtered on ``returned_at`` alone and so\n * listed every lapsed-but-unreaped lease as live — which made the screen look\n * exactly like a stuck reaper even when the reaper was fine.\n * @summary List Live Leases\n */\nexport const listLiveLeases = async ( options?: Parameters<typeof request>[1]): Promise<LiveLeaseListRead> => {\n\n return request<LiveLeaseListRead>(getListLiveLeasesUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getForceCloseLeaseUrl = (eventId: number,) => {\n\n\n\n\n return `/admin/consumption/${eventId}`\n}\n\n/**\n * Force-close somebody else's lease. The legacy's ``FermeSessionAdherent``.\n *\n * Audited, which the legacy's was not: a button that ends a stranger's reading\n * session and leaves no trace is indistinguishable from abuse of the same\n * button. Tenant-scoped like every staff action, so a lease outside the\n * caller's scope is ``404`` rather than ``403``.\n * @summary Force Close Lease\n */\nexport const forceCloseLease = async (eventId: number,\n leaseCloseWrite: LeaseCloseWrite, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<void>(getForceCloseLeaseUrl(eventId),\n {\n ...options,\n method: 'DELETE',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(leaseCloseWrite)\n }\n);}\n\n\n"],"mappings":";;;AAcA,MAAa,6BAA6B;CAKxC,OAAO;AACT;;;;;;;;;;;;;;AAeA,MAAa,iBAAiB,OAAQ,YAAwE;CAE5G,OAAO,QAA2B,qBAAqB,GACvD;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,yBAAyB,YAAqB;CAKzD,OAAO,sBAAsB;AAC/B;;;;;;;;;;AAWA,MAAa,kBAAkB,OAAO,SAClC,iBAAkC,YAA2D;CAE7F,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,QAAc,sBAAsB,OAAO,GAChD;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,eAAe;CACtC,CACF;AAAE"}
1
+ {"version":3,"file":"admin-consumption.js","names":[],"sources":["../../src/api/admin-consumption/admin-consumption.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.14.1\n */\nimport type {\n LeaseCloseWrite,\n LiveLeaseListRead\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getListLiveLeasesUrl = () => {\n\n\n\n\n return `/admin/consumption/live`\n}\n\n/**\n * What is open right now, within the caller's tenant scope.\n *\n * Read from the ledger rather than the Redis live set: this is a diagnostic and\n * must show the truth even when the cache is cold, and it runs once when\n * somebody opens a screen rather than on every read.\n *\n * Shares :func:`~app.services.entitlement.is_live` with the two seat counts.\n * An earlier version of this route filtered on ``returned_at`` alone and so\n * listed every lapsed-but-unreaped lease as live — which made the screen look\n * exactly like a stuck reaper even when the reaper was fine.\n * @summary List Live Leases\n */\nexport const listLiveLeases = async ( options?: Parameters<typeof request>[1]): Promise<LiveLeaseListRead> => {\n\n return request<LiveLeaseListRead>(getListLiveLeasesUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getForceCloseLeaseUrl = (eventId: number,) => {\n\n\n\n\n return `/admin/consumption/${eventId}`\n}\n\n/**\n * Force-close somebody else's lease. The legacy's ``FermeSessionAdherent``.\n *\n * Audited, which the legacy's was not: a button that ends a stranger's reading\n * session and leaves no trace is indistinguishable from abuse of the same\n * button. Tenant-scoped like every staff action, so a lease outside the\n * caller's scope is ``404`` rather than ``403``.\n * @summary Force Close Lease\n */\nexport const forceCloseLease = async (eventId: number,\n leaseCloseWrite: LeaseCloseWrite, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<void>(getForceCloseLeaseUrl(eventId),\n {\n ...options,\n method: 'DELETE',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(leaseCloseWrite)\n }\n);}\n\n\n"],"mappings":";;;AAcA,MAAa,6BAA6B;CAKxC,OAAO;AACT;;;;;;;;;;;;;;AAeA,MAAa,iBAAiB,OAAQ,YAAwE;CAE5G,OAAO,QAA2B,qBAAqB,GACvD;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,yBAAyB,YAAqB;CAKzD,OAAO,sBAAsB;AAC/B;;;;;;;;;;AAWA,MAAa,kBAAkB,OAAO,SAClC,iBAAkC,YAA2D;CAE7F,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,QAAc,sBAAsB,OAAO,GAChD;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,eAAe;CACtC,CACF;AAAE"}
@@ -1,5 +1,5 @@
1
1
 
2
- import { Ep as ContractProviderWrite, Hp as CategoryExclusionWrite, Op as ContractCategoryGrantWrite, Up as CategoryExclusionRead, kp as ContractCategoryGrantRead } from "../chunks/index.js";
2
+ import { Mm as CategoryExclusionWrite, Nm as CategoryExclusionRead, gm as ContractProviderWrite, vm as ContractCategoryGrantWrite, ym as ContractCategoryGrantRead } from "../chunks/index.js";
3
3
  import { c as request } from "../chunks/client.js";
4
4
  //#region src/api/admin-contracts/admin-contracts.d.ts
5
5
  export declare const getCreateContractCategoryGrantUrl: (contractId: number) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"admin-contracts.js","names":[],"sources":["../../src/api/admin-contracts/admin-contracts.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.13.0\n */\nimport type {\n CategoryExclusionRead,\n CategoryExclusionWrite,\n ContractCategoryGrantRead,\n ContractCategoryGrantWrite,\n ContractProviderWrite\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getCreateContractCategoryGrantUrl = (contractId: number,) => {\n\n\n\n\n return `/admin/contracts/${contractId}/category-grants`\n}\n\n/**\n * Grant VIEW on one category and optional provider; null is explicitly unrestricted.\n *\n * This changes permission only. No paid licence or external account is created.\n * Existing contract/beneficiary windows and provider seat checks still apply.\n * @summary Create Contract Category Grant\n */\nexport const createContractCategoryGrant = async (contractId: number,\n contractCategoryGrantWrite: ContractCategoryGrantWrite, options?: Parameters<typeof request>[1]): Promise<ContractCategoryGrantRead> => {\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<ContractCategoryGrantRead>(getCreateContractCategoryGrantUrl(contractId),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(contractCategoryGrantWrite)\n }\n);}\n\n\nexport const getRevokeContractCategoryGrantUrl = (contractId: number,\n grantId: number,) => {\n\n\n\n\n return `/admin/contracts/${contractId}/category-grants/${grantId}`\n}\n\n/**\n * Deactivate a line without deleting its consumption/audit references.\n * @summary Revoke Contract Category Grant\n */\nexport const revokeContractCategoryGrant = async (contractId: number,\n grantId: number, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getRevokeContractCategoryGrantUrl(contractId,grantId),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\nexport const getSetContractGrantProviderUrl = (contractId: number,\n grantId: number,) => {\n\n\n\n\n return `/admin/contracts/${contractId}/category-grants/${grantId}/provider`\n}\n\n/**\n * Restrict this existing line, retaining its ID, acts, history and dates.\n *\n * Other unrestricted/overlapping lines can still permit a provider. Inspect\n * the contract's complete grant list before claiming it is YouScribe-only.\n * @summary Set Contract Grant Provider\n */\nexport const setContractGrantProvider = async (contractId: number,\n grantId: number,\n contractProviderWrite: ContractProviderWrite, options?: Parameters<typeof request>[1]): Promise<ContractCategoryGrantRead> => {\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<ContractCategoryGrantRead>(getSetContractGrantProviderUrl(contractId,grantId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(contractProviderWrite)\n }\n);}\n\n\nexport const getCreateCategoryProviderExclusionUrl = (tenantId: number,) => {\n\n\n\n\n return `/admin/tenants/${tenantId}/entitlement-exclusions`\n}\n\n/**\n * Deny a category/provider pair; userId narrows the deny to that profile.\n *\n * The exclusion applies across the customer's contracts and can only reduce\n * access. Other profiles, including other household members, are unaffected\n * when userId is set. Null provider explicitly covers every applicable provider.\n * @summary Create Category Provider Exclusion\n */\nexport const createCategoryProviderExclusion = async (tenantId: number,\n categoryExclusionWrite: CategoryExclusionWrite, options?: Parameters<typeof request>[1]): Promise<CategoryExclusionRead> => {\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<CategoryExclusionRead>(getCreateCategoryProviderExclusionUrl(tenantId),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(categoryExclusionWrite)\n }\n);}\n\n\nexport const getRemoveCategoryProviderExclusionUrl = (tenantId: number,\n exclusionId: number,) => {\n\n\n\n\n return `/admin/tenants/${tenantId}/entitlement-exclusions/${exclusionId}`\n}\n\n/**\n * Remove this restriction; a valid contract grant is still required.\n * @summary Remove Category Provider Exclusion\n */\nexport const removeCategoryProviderExclusion = async (tenantId: number,\n exclusionId: number, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getRemoveCategoryProviderExclusionUrl(tenantId,exclusionId),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\n"],"mappings":";;;AAiBA,MAAa,qCAAqC,eAAwB;CAKxE,OAAO,oBAAoB,WAAW;AACxC;;;;;;;;AASA,MAAa,8BAA8B,OAAO,YAC9C,4BAAwD,YAAgF;CAExI,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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K,UAAU,qBAAqB;CAC5C,CACF;AAAE;AAGF,MAAa,yCAAyC,aAAsB;CAK1E,OAAO,kBAAkB,SAAS;AACpC;;;;;;;;;AAUA,MAAa,kCAAkC,OAAO,UAClD,wBAAgD,YAA4E;CAE5H,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,QAA+B,sCAAsC,QAAQ,GAClF;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,sBAAsB;CAC7C,CACF;AAAE;AAGF,MAAa,yCAAyC,UAClD,gBAAyB;CAK3B,OAAO,kBAAkB,SAAS,0BAA0B;AAC9D;;;;;AAMA,MAAa,kCAAkC,OAAO,UAClD,aAAqB,YAA2D;CAElF,OAAO,QAAc,sCAAsC,UAAS,WAAW,GAC/E;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE"}
1
+ {"version":3,"file":"admin-contracts.js","names":[],"sources":["../../src/api/admin-contracts/admin-contracts.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.14.1\n */\nimport type {\n CategoryExclusionRead,\n CategoryExclusionWrite,\n ContractCategoryGrantRead,\n ContractCategoryGrantWrite,\n ContractProviderWrite\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getCreateContractCategoryGrantUrl = (contractId: number,) => {\n\n\n\n\n return `/admin/contracts/${contractId}/category-grants`\n}\n\n/**\n * Grant VIEW on one category and optional provider; null is explicitly unrestricted.\n *\n * This changes permission only. No paid licence or external account is created.\n * Existing contract/beneficiary windows and provider seat checks still apply.\n * @summary Create Contract Category Grant\n */\nexport const createContractCategoryGrant = async (contractId: number,\n contractCategoryGrantWrite: ContractCategoryGrantWrite, options?: Parameters<typeof request>[1]): Promise<ContractCategoryGrantRead> => {\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<ContractCategoryGrantRead>(getCreateContractCategoryGrantUrl(contractId),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(contractCategoryGrantWrite)\n }\n);}\n\n\nexport const getRevokeContractCategoryGrantUrl = (contractId: number,\n grantId: number,) => {\n\n\n\n\n return `/admin/contracts/${contractId}/category-grants/${grantId}`\n}\n\n/**\n * Deactivate a line without deleting its consumption/audit references.\n * @summary Revoke Contract Category Grant\n */\nexport const revokeContractCategoryGrant = async (contractId: number,\n grantId: number, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getRevokeContractCategoryGrantUrl(contractId,grantId),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\nexport const getSetContractGrantProviderUrl = (contractId: number,\n grantId: number,) => {\n\n\n\n\n return `/admin/contracts/${contractId}/category-grants/${grantId}/provider`\n}\n\n/**\n * Restrict this existing line, retaining its ID, acts, history and dates.\n *\n * Other unrestricted/overlapping lines can still permit a provider. Inspect\n * the contract's complete grant list before claiming it is YouScribe-only.\n * @summary Set Contract Grant Provider\n */\nexport const setContractGrantProvider = async (contractId: number,\n grantId: number,\n contractProviderWrite: ContractProviderWrite, options?: Parameters<typeof request>[1]): Promise<ContractCategoryGrantRead> => {\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<ContractCategoryGrantRead>(getSetContractGrantProviderUrl(contractId,grantId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(contractProviderWrite)\n }\n);}\n\n\nexport const getCreateCategoryProviderExclusionUrl = (tenantId: number,) => {\n\n\n\n\n return `/admin/tenants/${tenantId}/entitlement-exclusions`\n}\n\n/**\n * Deny a category/provider pair; userId narrows the deny to that profile.\n *\n * The exclusion applies across the customer's contracts and can only reduce\n * access. Other profiles, including other household members, are unaffected\n * when userId is set. Null provider explicitly covers every applicable provider.\n * @summary Create Category Provider Exclusion\n */\nexport const createCategoryProviderExclusion = async (tenantId: number,\n categoryExclusionWrite: CategoryExclusionWrite, options?: Parameters<typeof request>[1]): Promise<CategoryExclusionRead> => {\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<CategoryExclusionRead>(getCreateCategoryProviderExclusionUrl(tenantId),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(categoryExclusionWrite)\n }\n);}\n\n\nexport const getRemoveCategoryProviderExclusionUrl = (tenantId: number,\n exclusionId: number,) => {\n\n\n\n\n return `/admin/tenants/${tenantId}/entitlement-exclusions/${exclusionId}`\n}\n\n/**\n * Remove this restriction; a valid contract grant is still required.\n * @summary Remove Category Provider Exclusion\n */\nexport const removeCategoryProviderExclusion = async (tenantId: number,\n exclusionId: number, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getRemoveCategoryProviderExclusionUrl(tenantId,exclusionId),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\n"],"mappings":";;;AAiBA,MAAa,qCAAqC,eAAwB;CAKxE,OAAO,oBAAoB,WAAW;AACxC;;;;;;;;AASA,MAAa,8BAA8B,OAAO,YAC9C,4BAAwD,YAAgF;CAExI,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,QAAmC,kCAAkC,UAAU,GACpF;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,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