@learnorama/mozaik-sdk 0.22.10-staging.78.1 → 0.23.0-staging.79.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (288) hide show
  1. package/CUSTOMER-ADMIN.md +18 -2
  2. package/FRONTEND-REQUESTS.md +130 -0
  3. package/dist/api/account.d.ts +1 -1
  4. package/dist/api/account.js.map +1 -1
  5. package/dist/api/admin-catalogue.d.ts +1 -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-customer.d.ts +176 -3
  12. package/dist/api/admin-customer.js +470 -5
  13. package/dist/api/admin-customer.js.map +1 -1
  14. package/dist/api/admin-desk.d.ts +1 -1
  15. package/dist/api/admin-desk.js.map +1 -1
  16. package/dist/api/admin-licenses.d.ts +1 -1
  17. package/dist/api/admin-licenses.js.map +1 -1
  18. package/dist/api/admin-partner-selections.d.ts +1 -1
  19. package/dist/api/admin-partner-selections.js.map +1 -1
  20. package/dist/api/admin-patrons.d.ts +1 -1
  21. package/dist/api/admin-patrons.js.map +1 -1
  22. package/dist/api/admin-reviews.d.ts +1 -1
  23. package/dist/api/admin-reviews.js.map +1 -1
  24. package/dist/api/admin-roles.d.ts +1 -1
  25. package/dist/api/admin-roles.js.map +1 -1
  26. package/dist/api/admin-support.d.ts +1 -1
  27. package/dist/api/admin-support.js.map +1 -1
  28. package/dist/api/admin-tenants.d.ts +61 -1
  29. package/dist/api/admin-tenants.js +222 -1
  30. package/dist/api/admin-tenants.js.map +1 -1
  31. package/dist/api/admin-tutoring.d.ts +1 -1
  32. package/dist/api/admin-tutoring.js.map +1 -1
  33. package/dist/api/admin-vod.d.ts +1 -1
  34. package/dist/api/admin-vod.js.map +1 -1
  35. package/dist/api/auth-device.d.ts +1 -1
  36. package/dist/api/auth-device.js.map +1 -1
  37. package/dist/api/auth.d.ts +1 -1
  38. package/dist/api/auth.js.map +1 -1
  39. package/dist/api/biblio-billing-webhooks.d.ts +1 -1
  40. package/dist/api/biblio-billing-webhooks.js.map +1 -1
  41. package/dist/api/biblio-billing.d.ts +1 -1
  42. package/dist/api/biblio-billing.js.map +1 -1
  43. package/dist/api/biblio-catalogue.d.ts +1 -1
  44. package/dist/api/biblio-catalogue.js.map +1 -1
  45. package/dist/api/biblio-home.d.ts +1 -1
  46. package/dist/api/biblio-home.js.map +1 -1
  47. package/dist/api/biblio-learning-author-profiles.d.ts +1 -1
  48. package/dist/api/biblio-learning-author-profiles.js.map +1 -1
  49. package/dist/api/biblio-learning-authoring.d.ts +1 -1
  50. package/dist/api/biblio-learning-authoring.js.map +1 -1
  51. package/dist/api/biblio-learning-editorial.d.ts +1 -1
  52. package/dist/api/biblio-learning-editorial.js.map +1 -1
  53. package/dist/api/biblio-learning-feedback.d.ts +1 -1
  54. package/dist/api/biblio-learning-feedback.js.map +1 -1
  55. package/dist/api/biblio-learning-finance.d.ts +1 -1
  56. package/dist/api/biblio-learning-finance.js.map +1 -1
  57. package/dist/api/biblio-learning-integrations.d.ts +1 -1
  58. package/dist/api/biblio-learning-integrations.js.map +1 -1
  59. package/dist/api/biblio-learning-membership.d.ts +1 -1
  60. package/dist/api/biblio-learning-membership.js.map +1 -1
  61. package/dist/api/biblio-learning.d.ts +1 -1
  62. package/dist/api/biblio-learning.js.map +1 -1
  63. package/dist/api/biblio-library.d.ts +1 -1
  64. package/dist/api/biblio-library.js.map +1 -1
  65. package/dist/api/biblio-nextory.d.ts +1 -1
  66. package/dist/api/biblio-nextory.js.map +1 -1
  67. package/dist/api/biblio-press.d.ts +1 -1
  68. package/dist/api/biblio-press.js.map +1 -1
  69. package/dist/api/biblio-search.d.ts +1 -1
  70. package/dist/api/biblio-search.js.map +1 -1
  71. package/dist/api/biblio-telemetry.d.ts +1 -1
  72. package/dist/api/biblio-telemetry.js.map +1 -1
  73. package/dist/api/biblio-youscribe.js.map +1 -1
  74. package/dist/api/consumption.d.ts +1 -1
  75. package/dist/api/consumption.js.map +1 -1
  76. package/dist/api/cvs-app.d.ts +1 -1
  77. package/dist/api/cvs-app.js.map +1 -1
  78. package/dist/api/cvs-documents.d.ts +1 -1
  79. package/dist/api/cvs-documents.js.map +1 -1
  80. package/dist/api/cvs-favorites.d.ts +1 -1
  81. package/dist/api/cvs-favorites.js.map +1 -1
  82. package/dist/api/cvs-ils.d.ts +1 -1
  83. package/dist/api/cvs-ils.js.map +1 -1
  84. package/dist/api/cvs-loans.d.ts +1 -1
  85. package/dist/api/cvs-loans.js.map +1 -1
  86. package/dist/api/cvs-payments.d.ts +1 -1
  87. package/dist/api/cvs-payments.js.map +1 -1
  88. package/dist/api/cvs-streaming.d.ts +1 -1
  89. package/dist/api/cvs-streaming.js.map +1 -1
  90. package/dist/api/index.d.ts +3 -3
  91. package/dist/api/index.js +3 -3
  92. package/dist/api/partner-catalogue.d.ts +1 -1
  93. package/dist/api/partner-catalogue.js.map +1 -1
  94. package/dist/api/partner-reader-nextory.d.ts +1 -1
  95. package/dist/api/partner-reader-nextory.js.map +1 -1
  96. package/dist/api/partner-reader-youscribe.d.ts +1 -1
  97. package/dist/api/partner-reader-youscribe.js.map +1 -1
  98. package/dist/api/partner-reading.d.ts +1 -1
  99. package/dist/api/partner-reading.js.map +1 -1
  100. package/dist/api/profiles.d.ts +1 -1
  101. package/dist/api/profiles.js.map +1 -1
  102. package/dist/api/search.d.ts +1 -1
  103. package/dist/api/search.js.map +1 -1
  104. package/dist/api/tutoring-catalogue.d.ts +1 -1
  105. package/dist/api/tutoring-catalogue.js.map +1 -1
  106. package/dist/api/tutoring-chat.d.ts +1 -1
  107. package/dist/api/tutoring-chat.js.map +1 -1
  108. package/dist/api/tutoring-dispatch.d.ts +1 -1
  109. package/dist/api/tutoring-dispatch.js.map +1 -1
  110. package/dist/api/tutoring-practitioner.js.map +1 -1
  111. package/dist/api/tutoring-requests.d.ts +1 -1
  112. package/dist/api/tutoring-requests.js.map +1 -1
  113. package/dist/chunks/client2.d.ts +1 -1
  114. package/dist/chunks/connection.d.ts +1 -1
  115. package/dist/chunks/index.d.ts +2047 -840
  116. package/dist/chunks/index2.d.ts +1 -1
  117. package/dist/index.d.ts +3 -3
  118. package/dist/index.js +3 -3
  119. package/dist/index.js.map +1 -1
  120. package/dist/models.d.ts +2 -2
  121. package/dist/models.js +236 -3
  122. package/dist/models.js.map +1 -1
  123. package/dist/react/account.d.ts +1 -1
  124. package/dist/react/account.js +1 -1
  125. package/dist/react/account.js.map +1 -1
  126. package/dist/react/admin-catalogue.d.ts +1 -1
  127. package/dist/react/admin-catalogue.js +1 -1
  128. package/dist/react/admin-catalogue.js.map +1 -1
  129. package/dist/react/admin-consumption.d.ts +1 -1
  130. package/dist/react/admin-consumption.js +1 -1
  131. package/dist/react/admin-consumption.js.map +1 -1
  132. package/dist/react/admin-contracts.d.ts +1 -1
  133. package/dist/react/admin-contracts.js +1 -1
  134. package/dist/react/admin-contracts.js.map +1 -1
  135. package/dist/react/admin-customer.d.ts +690 -3
  136. package/dist/react/admin-customer.js +1128 -97
  137. package/dist/react/admin-customer.js.map +1 -1
  138. package/dist/react/admin-desk.d.ts +1 -1
  139. package/dist/react/admin-desk.js +1 -1
  140. package/dist/react/admin-desk.js.map +1 -1
  141. package/dist/react/admin-licenses.d.ts +1 -1
  142. package/dist/react/admin-licenses.js +1 -1
  143. package/dist/react/admin-licenses.js.map +1 -1
  144. package/dist/react/admin-partner-selections.d.ts +1 -1
  145. package/dist/react/admin-partner-selections.js +1 -1
  146. package/dist/react/admin-partner-selections.js.map +1 -1
  147. package/dist/react/admin-patrons.d.ts +1 -1
  148. package/dist/react/admin-patrons.js +1 -1
  149. package/dist/react/admin-patrons.js.map +1 -1
  150. package/dist/react/admin-reviews.d.ts +1 -1
  151. package/dist/react/admin-reviews.js +1 -1
  152. package/dist/react/admin-reviews.js.map +1 -1
  153. package/dist/react/admin-roles.d.ts +1 -1
  154. package/dist/react/admin-roles.js +1 -1
  155. package/dist/react/admin-roles.js.map +1 -1
  156. package/dist/react/admin-support.d.ts +1 -1
  157. package/dist/react/admin-support.js +1 -1
  158. package/dist/react/admin-support.js.map +1 -1
  159. package/dist/react/admin-tenants.d.ts +257 -1
  160. package/dist/react/admin-tenants.js +499 -2
  161. package/dist/react/admin-tenants.js.map +1 -1
  162. package/dist/react/admin-tutoring.d.ts +1 -1
  163. package/dist/react/admin-tutoring.js +1 -1
  164. package/dist/react/admin-tutoring.js.map +1 -1
  165. package/dist/react/admin-vod.d.ts +1 -1
  166. package/dist/react/admin-vod.js +1 -1
  167. package/dist/react/admin-vod.js.map +1 -1
  168. package/dist/react/auth-device.d.ts +1 -1
  169. package/dist/react/auth-device.js +1 -1
  170. package/dist/react/auth-device.js.map +1 -1
  171. package/dist/react/auth.d.ts +1 -1
  172. package/dist/react/auth.js +1 -1
  173. package/dist/react/auth.js.map +1 -1
  174. package/dist/react/biblio-billing-webhooks.d.ts +1 -1
  175. package/dist/react/biblio-billing-webhooks.js +1 -1
  176. package/dist/react/biblio-billing-webhooks.js.map +1 -1
  177. package/dist/react/biblio-billing.d.ts +1 -1
  178. package/dist/react/biblio-billing.js +1 -1
  179. package/dist/react/biblio-billing.js.map +1 -1
  180. package/dist/react/biblio-catalogue.d.ts +1 -1
  181. package/dist/react/biblio-catalogue.js +1 -1
  182. package/dist/react/biblio-catalogue.js.map +1 -1
  183. package/dist/react/biblio-home.d.ts +1 -1
  184. package/dist/react/biblio-home.js +1 -1
  185. package/dist/react/biblio-home.js.map +1 -1
  186. package/dist/react/biblio-learning-author-profiles.d.ts +1 -1
  187. package/dist/react/biblio-learning-author-profiles.js +1 -1
  188. package/dist/react/biblio-learning-author-profiles.js.map +1 -1
  189. package/dist/react/biblio-learning-authoring.d.ts +1 -1
  190. package/dist/react/biblio-learning-authoring.js +1 -1
  191. package/dist/react/biblio-learning-authoring.js.map +1 -1
  192. package/dist/react/biblio-learning-editorial.d.ts +1 -1
  193. package/dist/react/biblio-learning-editorial.js +1 -1
  194. package/dist/react/biblio-learning-editorial.js.map +1 -1
  195. package/dist/react/biblio-learning-feedback.d.ts +1 -1
  196. package/dist/react/biblio-learning-feedback.js +1 -1
  197. package/dist/react/biblio-learning-feedback.js.map +1 -1
  198. package/dist/react/biblio-learning-finance.d.ts +1 -1
  199. package/dist/react/biblio-learning-finance.js +1 -1
  200. package/dist/react/biblio-learning-finance.js.map +1 -1
  201. package/dist/react/biblio-learning-integrations.d.ts +1 -1
  202. package/dist/react/biblio-learning-integrations.js +1 -1
  203. package/dist/react/biblio-learning-integrations.js.map +1 -1
  204. package/dist/react/biblio-learning-membership.d.ts +1 -1
  205. package/dist/react/biblio-learning-membership.js +1 -1
  206. package/dist/react/biblio-learning-membership.js.map +1 -1
  207. package/dist/react/biblio-learning.d.ts +1 -1
  208. package/dist/react/biblio-learning.js +1 -1
  209. package/dist/react/biblio-learning.js.map +1 -1
  210. package/dist/react/biblio-library.d.ts +1 -1
  211. package/dist/react/biblio-library.js +1 -1
  212. package/dist/react/biblio-library.js.map +1 -1
  213. package/dist/react/biblio-nextory.d.ts +1 -1
  214. package/dist/react/biblio-nextory.js +1 -1
  215. package/dist/react/biblio-nextory.js.map +1 -1
  216. package/dist/react/biblio-press.d.ts +1 -1
  217. package/dist/react/biblio-press.js +1 -1
  218. package/dist/react/biblio-press.js.map +1 -1
  219. package/dist/react/biblio-search.d.ts +1 -1
  220. package/dist/react/biblio-search.js +1 -1
  221. package/dist/react/biblio-search.js.map +1 -1
  222. package/dist/react/biblio-telemetry.d.ts +1 -1
  223. package/dist/react/biblio-telemetry.js +1 -1
  224. package/dist/react/biblio-telemetry.js.map +1 -1
  225. package/dist/react/biblio-youscribe.d.ts +1 -1
  226. package/dist/react/biblio-youscribe.js +1 -1
  227. package/dist/react/biblio-youscribe.js.map +1 -1
  228. package/dist/react/chat.d.ts +1 -1
  229. package/dist/react/consumption.d.ts +1 -1
  230. package/dist/react/consumption.js +1 -1
  231. package/dist/react/consumption.js.map +1 -1
  232. package/dist/react/cvs-app.d.ts +1 -1
  233. package/dist/react/cvs-app.js +1 -1
  234. package/dist/react/cvs-app.js.map +1 -1
  235. package/dist/react/cvs-documents.d.ts +1 -1
  236. package/dist/react/cvs-documents.js +1 -1
  237. package/dist/react/cvs-documents.js.map +1 -1
  238. package/dist/react/cvs-favorites.d.ts +1 -1
  239. package/dist/react/cvs-favorites.js +1 -1
  240. package/dist/react/cvs-favorites.js.map +1 -1
  241. package/dist/react/cvs-ils.d.ts +1 -1
  242. package/dist/react/cvs-ils.js +1 -1
  243. package/dist/react/cvs-ils.js.map +1 -1
  244. package/dist/react/cvs-loans.d.ts +1 -1
  245. package/dist/react/cvs-loans.js +1 -1
  246. package/dist/react/cvs-loans.js.map +1 -1
  247. package/dist/react/cvs-payments.d.ts +1 -1
  248. package/dist/react/cvs-payments.js +1 -1
  249. package/dist/react/cvs-payments.js.map +1 -1
  250. package/dist/react/cvs-streaming.d.ts +1 -1
  251. package/dist/react/cvs-streaming.js +1 -1
  252. package/dist/react/cvs-streaming.js.map +1 -1
  253. package/dist/react/index.d.ts +3 -3
  254. package/dist/react/index.js +3 -3
  255. package/dist/react/partner-catalogue.d.ts +1 -1
  256. package/dist/react/partner-catalogue.js +1 -1
  257. package/dist/react/partner-catalogue.js.map +1 -1
  258. package/dist/react/partner-reader-nextory.d.ts +1 -1
  259. package/dist/react/partner-reader-nextory.js +1 -1
  260. package/dist/react/partner-reader-nextory.js.map +1 -1
  261. package/dist/react/partner-reader-youscribe.d.ts +1 -1
  262. package/dist/react/partner-reader-youscribe.js +1 -1
  263. package/dist/react/partner-reader-youscribe.js.map +1 -1
  264. package/dist/react/partner-reading.d.ts +1 -1
  265. package/dist/react/partner-reading.js +1 -1
  266. package/dist/react/partner-reading.js.map +1 -1
  267. package/dist/react/profiles.d.ts +1 -1
  268. package/dist/react/profiles.js +1 -1
  269. package/dist/react/profiles.js.map +1 -1
  270. package/dist/react/search.d.ts +1 -1
  271. package/dist/react/search.js +1 -1
  272. package/dist/react/search.js.map +1 -1
  273. package/dist/react/tutoring-catalogue.d.ts +1 -1
  274. package/dist/react/tutoring-catalogue.js +1 -1
  275. package/dist/react/tutoring-catalogue.js.map +1 -1
  276. package/dist/react/tutoring-chat.d.ts +1 -1
  277. package/dist/react/tutoring-chat.js +1 -1
  278. package/dist/react/tutoring-chat.js.map +1 -1
  279. package/dist/react/tutoring-dispatch.d.ts +1 -1
  280. package/dist/react/tutoring-dispatch.js +1 -1
  281. package/dist/react/tutoring-dispatch.js.map +1 -1
  282. package/dist/react/tutoring-practitioner.d.ts +1 -1
  283. package/dist/react/tutoring-practitioner.js +1 -1
  284. package/dist/react/tutoring-practitioner.js.map +1 -1
  285. package/dist/react/tutoring-requests.d.ts +1 -1
  286. package/dist/react/tutoring-requests.js +1 -1
  287. package/dist/react/tutoring-requests.js.map +1 -1
  288. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"admin-reviews.js","names":[],"sources":["../../src/react/admin-reviews/admin-reviews.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.22.10\n */\nimport {\n useMutation,\n useQuery\n} from '@tanstack/react-query';\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n MutationFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseMutationOptions,\n UseMutationResult,\n UseQueryOptions,\n UseQueryResult\n} from '@tanstack/react-query';\n\nimport type {\n HTTPExceptionResponse,\n ListReviewsParams,\n ModerationWrite,\n ReviewModerationRead,\n ReviewPage,\n ValidationErrorResponse\n} from '../../models';\n\nimport { request } from '../../client';\nimport type { ErrorType , BodyType } from '../../client';\n\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n\n\nconst withQueryKey = <T extends object, K>(query: T, queryKey: K): T & { queryKey: K } => {\n const result = { queryKey } as T & { queryKey: K };\n for (const key of Object.keys(query)) {\n // The explicit queryKey always wins, matching the previous\n // `{ ...query, queryKey }` spread where it was set last.\n if (key === 'queryKey') continue;\n Object.defineProperty(result, key, {\n enumerable: true,\n configurable: true,\n get: () => (query as Record<string, unknown>)[key],\n });\n }\n return result;\n};\n\nexport const getListReviewsUrl = (params?: ListReviewsParams,) => {\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/reviews?${stringifiedParams}` : `/admin/reviews`\n}\n\n/**\n * Reviews awaiting a decision, oldest first.\n *\n * Oldest first on purpose: a moderation queue sorted newest-first starves its\n * tail, and the review that has waited longest is the one whose author is\n * wondering what happened.\n * @summary List Reviews\n */\nexport const listReviews = async (params?: ListReviewsParams, options?: Parameters<typeof request>[1]): Promise<ReviewPage> => {\n\n return request<ReviewPage>(getListReviewsUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getListReviewsQueryKey = (params?: ListReviewsParams,) => {\n return [\n `/admin/reviews`, ...(params ? [params] : [])\n ] as const;\n }\n\n\nexport const getListReviewsQueryOptions = <TData = Awaited<ReturnType<typeof listReviews>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params?: ListReviewsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listReviews>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getListReviewsQueryKey(params);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof listReviews>>> = ({ signal }) => listReviews(params, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listReviews>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ListReviewsQueryResult = NonNullable<Awaited<ReturnType<typeof listReviews>>>\nexport type ListReviewsQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useListReviews<TData = Awaited<ReturnType<typeof listReviews>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params: undefined | ListReviewsParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listReviews>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof listReviews>>,\n TError,\n Awaited<ReturnType<typeof listReviews>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListReviews<TData = Awaited<ReturnType<typeof listReviews>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListReviewsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listReviews>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof listReviews>>,\n TError,\n Awaited<ReturnType<typeof listReviews>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListReviews<TData = Awaited<ReturnType<typeof listReviews>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListReviewsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listReviews>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary List Reviews\n */\n\nexport function useListReviews<TData = Awaited<ReturnType<typeof listReviews>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListReviewsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listReviews>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getListReviewsQueryOptions(params,options)\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n return withQueryKey(query, queryOptions.queryKey);\n}\n\n\n\n\n\n\nexport const getModerateReviewUrl = (reviewId: number,) => {\n\n\n\n\n return `/admin/reviews/${reviewId}/moderation`\n}\n\n/**\n * Publish or reject one review.\n *\n * ``PUT`` on a moderation sub-resource rather than ``POST /approve`` and\n * ``POST /reject``: the outcome is a state the review is *in*, not two different\n * events, and a repeated decision must be harmless.\n *\n * Rejecting requires a reason. The author is owed one, and the moderator is the\n * only person who has it — the audit row is where it survives after the queue\n * has moved on.\n * @summary Moderate Review\n */\nexport const moderateReview = async (reviewId: number,\n moderationWrite: ModerationWrite, options?: Parameters<typeof request>[1]): Promise<ReviewModerationRead> => {\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<ReviewModerationRead>(getModerateReviewUrl(reviewId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(moderationWrite)\n }\n);}\n\n\n\n\n\nexport const getModerateReviewMutationKey = () => ['moderateReview'] as const;\n\nexport const getModerateReviewMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof moderateReview>>, TError,ModerateReviewMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof moderateReview>>, TError,ModerateReviewMutationVariables, TContext> => {\n\nconst mutationKey = getModerateReviewMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof moderateReview>>, ModerateReviewMutationVariables> = (props) => {\n const {reviewId,data} = props ?? {};\n\n return moderateReview(reviewId,data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type ModerateReviewMutationResult = NonNullable<Awaited<ReturnType<typeof moderateReview>>>\n export type ModerateReviewMutationBody = BodyType<ModerationWrite>\n export type ModerateReviewMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type ModerateReviewMutationVariables = {reviewId: number;data: BodyType<ModerationWrite>}\n\n /**\n * @summary Moderate Review\n */\nexport const useModerateReview = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof moderateReview>>, TError,ModerateReviewMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof moderateReview>>,\n TError,\n ModerateReviewMutationVariables,\n TContext\n > => {\n return useMutation(getModerateReviewMutationOptions(options), queryClient);\n }\n"],"mappings":";;;;;;;;;;;AA2CA,MAAM,gBAAqC,OAAU,aAAqC;CACxF,MAAM,SAAS,EA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in-reviews/admin-reviews.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.23.0\n */\nimport {\n useMutation,\n useQuery\n} from '@tanstack/react-query';\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n MutationFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseMutationOptions,\n UseMutationResult,\n UseQueryOptions,\n UseQueryResult\n} from '@tanstack/react-query';\n\nimport type {\n HTTPExceptionResponse,\n ListReviewsParams,\n ModerationWrite,\n ReviewModerationRead,\n ReviewPage,\n ValidationErrorResponse\n} from '../../models';\n\nimport { request } from '../../client';\nimport type { ErrorType , BodyType } from '../../client';\n\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n\n\nconst withQueryKey = <T extends object, K>(query: T, queryKey: K): T & { queryKey: K } => {\n const result = { queryKey } as T & { queryKey: K };\n for (const key of Object.keys(query)) {\n // The explicit queryKey always wins, matching the previous\n // `{ ...query, queryKey }` spread where it was set last.\n if (key === 'queryKey') continue;\n Object.defineProperty(result, key, {\n enumerable: true,\n configurable: true,\n get: () => (query as Record<string, unknown>)[key],\n });\n }\n return result;\n};\n\nexport const getListReviewsUrl = (params?: ListReviewsParams,) => {\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/reviews?${stringifiedParams}` : `/admin/reviews`\n}\n\n/**\n * Reviews awaiting a decision, oldest first.\n *\n * Oldest first on purpose: a moderation queue sorted newest-first starves its\n * tail, and the review that has waited longest is the one whose author is\n * wondering what happened.\n * @summary List Reviews\n */\nexport const listReviews = async (params?: ListReviewsParams, options?: Parameters<typeof request>[1]): Promise<ReviewPage> => {\n\n return request<ReviewPage>(getListReviewsUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getListReviewsQueryKey = (params?: ListReviewsParams,) => {\n return [\n `/admin/reviews`, ...(params ? [params] : [])\n ] as const;\n }\n\n\nexport const getListReviewsQueryOptions = <TData = Awaited<ReturnType<typeof listReviews>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params?: ListReviewsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listReviews>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getListReviewsQueryKey(params);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof listReviews>>> = ({ signal }) => listReviews(params, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listReviews>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ListReviewsQueryResult = NonNullable<Awaited<ReturnType<typeof listReviews>>>\nexport type ListReviewsQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useListReviews<TData = Awaited<ReturnType<typeof listReviews>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params: undefined | ListReviewsParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listReviews>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof listReviews>>,\n TError,\n Awaited<ReturnType<typeof listReviews>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListReviews<TData = Awaited<ReturnType<typeof listReviews>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListReviewsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listReviews>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof listReviews>>,\n TError,\n Awaited<ReturnType<typeof listReviews>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListReviews<TData = Awaited<ReturnType<typeof listReviews>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListReviewsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listReviews>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary List Reviews\n */\n\nexport function useListReviews<TData = Awaited<ReturnType<typeof listReviews>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListReviewsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listReviews>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getListReviewsQueryOptions(params,options)\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n return withQueryKey(query, queryOptions.queryKey);\n}\n\n\n\n\n\n\nexport const getModerateReviewUrl = (reviewId: number,) => {\n\n\n\n\n return `/admin/reviews/${reviewId}/moderation`\n}\n\n/**\n * Publish or reject one review.\n *\n * ``PUT`` on a moderation sub-resource rather than ``POST /approve`` and\n * ``POST /reject``: the outcome is a state the review is *in*, not two different\n * events, and a repeated decision must be harmless.\n *\n * Rejecting requires a reason. The author is owed one, and the moderator is the\n * only person who has it — the audit row is where it survives after the queue\n * has moved on.\n * @summary Moderate Review\n */\nexport const moderateReview = async (reviewId: number,\n moderationWrite: ModerationWrite, options?: Parameters<typeof request>[1]): Promise<ReviewModerationRead> => {\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<ReviewModerationRead>(getModerateReviewUrl(reviewId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(moderationWrite)\n }\n);}\n\n\n\n\n\nexport const getModerateReviewMutationKey = () => ['moderateReview'] as const;\n\nexport const getModerateReviewMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof moderateReview>>, TError,ModerateReviewMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof moderateReview>>, TError,ModerateReviewMutationVariables, TContext> => {\n\nconst mutationKey = getModerateReviewMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof moderateReview>>, ModerateReviewMutationVariables> = (props) => {\n const {reviewId,data} = props ?? {};\n\n return moderateReview(reviewId,data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type ModerateReviewMutationResult = NonNullable<Awaited<ReturnType<typeof moderateReview>>>\n export type ModerateReviewMutationBody = BodyType<ModerationWrite>\n export type ModerateReviewMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type ModerateReviewMutationVariables = {reviewId: number;data: BodyType<ModerationWrite>}\n\n /**\n * @summary Moderate Review\n */\nexport const useModerateReview = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof moderateReview>>, TError,ModerateReviewMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof moderateReview>>,\n TError,\n ModerateReviewMutationVariables,\n TContext\n > => {\n return useMutation(getModerateReviewMutationOptions(options), queryClient);\n }\n"],"mappings":";;;;;;;;;;;AA2CA,MAAM,gBAAqC,OAAU,aAAqC;CACxF,MAAM,SAAS,EAAE,SAAS;CAC1B,KAAK,MAAM,OAAO,OAAO,KAAK,KAAK,GAAG;EAGpC,IAAI,QAAQ,YAAY;EACxB,OAAO,eAAe,QAAQ,KAAK;GACjC,YAAY;GACZ,cAAc;GACd,WAAY,MAAkC;EAChD,CAAC;CACH;CACA,OAAO;AACT;AAEA,MAAa,qBAAqB,WAAgC;CAChE,MAAM,mBAAmB,IAAI,gBAAgB;CAE7C,OAAO,QAAQ,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,WAAW;EAErD,IAAI,UAAU,KAAA,GACZ,iBAAiB,OAAO,KAAK,UAAU,OAAO,SAAS,OAAO,KAAK,CAAC;CAExE,CAAC;CAED,MAAM,oBAAoB,iBAAiB,SAAS;CAEpD,OAAO,kBAAkB,SAAS,IAAI,kBAAkB,sBAAsB;AAChF;;;;;;;;;AAUA,MAAa,cAAc,OAAO,QAA4B,YAAiE;CAE7H,OAAO,QAAoB,kBAAkB,MAAM,GACnD;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAMF,MAAa,0BAA0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AAa,oCACW,YAC+F;CAEvH,MAAM,cAAc,6BAA6B;CACjD,MAAM,EAAC,UAAU,iBAAiB,SAAS,mBAAkB,UACvD,QAAQ,YAAY,iBAAiB,QAAQ,YAAY,QAAQ,SAAS,cAC1E,UACE;EAAC,GAAG;EAAS,UAAU;GAAC,GAAG,QAAQ;GAAU;EAAW;CAAC,IACzD;EAAC,UAAU,EAAE,YAAa;EAAG,SAAS,KAAA;CAAS;CAKjD,MAAM,cAA6G,UAAU;EACzH,MAAM,EAAC,UAAS,SAAQ,SAAS,CAAC;EAElC,OAAQ,eAAe,UAAS,MAAK,cAAc;CACrD;CAON,OAAQ;EAAE;EAAY,GAAG;CAAgB;AAAC;;;;AAU5C,MAAa,qBACW,SACrB,gBAKQ;CACL,OAAO,YAAY,iCAAiC,OAAO,GAAG,WAAW;AAC3E"}
@@ -1,5 +1,5 @@
1
1
 
2
- import { Cr as ProductGrantWrite, Dd as HTTPExceptionResponse, E as ValidationErrorResponse, wr as ProductGrantListRead } from "../chunks/index.js";
2
+ import { E as ValidationErrorResponse, Mr as ProductGrantListRead, jr as ProductGrantWrite, qd as HTTPExceptionResponse } from "../chunks/index.js";
3
3
  import { a as ErrorType, c as request, n as BodyType } from "../chunks/client.js";
4
4
  import { DataTag, DefinedInitialDataOptions, DefinedUseQueryResult, QueryClient, QueryKey, UndefinedInitialDataOptions, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
5
5
  //#region src/react/admin-roles/admin-roles.d.ts
@@ -7,7 +7,7 @@ import { useMutation, useQuery } from "@tanstack/react-query";
7
7
  * Do not edit manually.
8
8
  * Mozaik backend
9
9
  * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.
10
- * OpenAPI spec version: 0.22.10
10
+ * OpenAPI spec version: 0.23.0
11
11
  */
12
12
  const withQueryKey = (query, queryKey) => {
13
13
  const result = { queryKey };
@@ -1 +1 @@
1
- {"version":3,"file":"admin-roles.js","names":[],"sources":["../../src/react/admin-roles/admin-roles.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.22.10\n */\nimport {\n useMutation,\n useQuery\n} from '@tanstack/react-query';\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n MutationFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseMutationOptions,\n UseMutationResult,\n UseQueryOptions,\n UseQueryResult\n} from '@tanstack/react-query';\n\nimport type {\n HTTPExceptionResponse,\n ProductGrantListRead,\n ProductGrantWrite,\n ValidationErrorResponse\n} from '../../models';\n\nimport { request } from '../../client';\nimport type { ErrorType , BodyType } from '../../client';\n\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n\n\nconst withQueryKey = <T extends object, K>(query: T, queryKey: K): T & { queryKey: K } => {\n const result = { queryKey } as T & { queryKey: K };\n for (const key of Object.keys(query)) {\n // The explicit queryKey always wins, matching the previous\n // `{ ...query, queryKey }` spread where it was set last.\n if (key === 'queryKey') continue;\n Object.defineProperty(result, key, {\n enumerable: true,\n configurable: true,\n get: () => (query as Record<string, unknown>)[key],\n });\n }\n return result;\n};\n\nexport const getListGrantsUrl = (userId: number,) => {\n\n\n\n\n return `/admin/users/${userId}/product-roles`\n}\n\n/**\n * This account's grants within the caller's organisation scope.\n *\n * Readable by SUPPORT as well as ADMIN: knowing what somebody is, is part of\n * helping them. Changing it is not.\n * @summary List Grants\n */\nexport const listGrants = async (userId: number, options?: Parameters<typeof request>[1]): Promise<ProductGrantListRead> => {\n\n return request<ProductGrantListRead>(getListGrantsUrl(userId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getListGrantsQueryKey = (userId: number,) => {\n return [\n `/admin/users/${userId}/product-roles`\n ] as const;\n }\n\n\nexport const getListGrantsQueryOptions = <TData = Awaited<ReturnType<typeof listGrants>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(userId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listGrants>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getListGrantsQueryKey(userId);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof listGrants>>> = ({ signal }) => listGrants(userId, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, enabled: userId !== null && userId !== undefined, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listGrants>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ListGrantsQueryResult = NonNullable<Awaited<ReturnType<typeof listGrants>>>\nexport type ListGrantsQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useListGrants<TData = Awaited<ReturnType<typeof listGrants>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n userId: number, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listGrants>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof listGrants>>,\n TError,\n Awaited<ReturnType<typeof listGrants>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListGrants<TData = Awaited<ReturnType<typeof listGrants>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n userId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listGrants>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof listGrants>>,\n TError,\n Awaited<ReturnType<typeof listGrants>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListGrants<TData = Awaited<ReturnType<typeof listGrants>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n userId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listGrants>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary List Grants\n */\n\nexport function useListGrants<TData = Awaited<ReturnType<typeof listGrants>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n userId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listGrants>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getListGrantsQueryOptions(userId,options)\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n return withQueryKey(query, queryOptions.queryKey);\n}\n\n\n\n\n\n\nexport const getReplaceGrantsUrl = (userId: number,) => {\n\n\n\n\n return `/admin/users/${userId}/product-roles`\n}\n\n/**\n * Replace this account's roles for one product at one organisation.\n *\n * ``PUT`` because it is idempotent and the body is the whole desired state for\n * that ``(tenant, product)`` slice — sending it twice leaves the same grants.\n *\n * Two scope checks, and both are needed. The *subject* must be an account the\n * operator reaches, and the ``tenantId`` being granted at must be one they\n * reach too: without the second, an operator could grant a remit at an\n * organisation they have no authority over, which is how a scoped\n * administrator becomes an unscoped one.\n *\n * ``422`` for a role the product does not recognise —\n * :data:`~app.models.enums.PRODUCT_ROLES` decides, so ``student`` for biblio is\n * refused rather than stored and puzzled over later.\n * @summary Replace Grants\n */\nexport const replaceGrants = async (userId: number,\n productGrantWrite: ProductGrantWrite, options?: Parameters<typeof request>[1]): Promise<ProductGrantListRead> => {\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<ProductGrantListRead>(getReplaceGrantsUrl(userId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(productGrantWrite)\n }\n);}\n\n\n\n\n\nexport const getReplaceGrantsMutationKey = () => ['replaceGrants'] as const;\n\nexport const getReplaceGrantsMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof replaceGrants>>, TError,ReplaceGrantsMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof replaceGrants>>, TError,ReplaceGrantsMutationVariables, TContext> => {\n\nconst mutationKey = getReplaceGrantsMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof replaceGrants>>, ReplaceGrantsMutationVariables> = (props) => {\n const {userId,data} = props ?? {};\n\n return replaceGrants(userId,data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type ReplaceGrantsMutationResult = NonNullable<Awaited<ReturnType<typeof replaceGrants>>>\n export type ReplaceGrantsMutationBody = BodyType<ProductGrantWrite>\n export type ReplaceGrantsMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type ReplaceGrantsMutationVariables = {userId: number;data: BodyType<ProductGrantWrite>}\n\n /**\n * @summary Replace Grants\n */\nexport const useReplaceGrants = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof replaceGrants>>, TError,ReplaceGrantsMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof replaceGrants>>,\n TError,\n ReplaceGrantsMutationVariables,\n TContext\n > => {\n return useMutation(getReplaceGrantsMutationOptions(options), queryClient);\n }\n"],"mappings":";;;;;;;;;;;AAyCA,MAAM,gBAAqC,OAAU,aAAqC;CACxF,MAAM,SAAS,EAAE,SAAS;CAC1B,KAAK,MAAM,OAAO,OAAO,KAAK,KAAK,GAAG;EAGpC,IAAI,QAAQ,YAAY;EACxB,OAAO,eAAe,QAAQ,KAAK;GACjC,YAAY;GACZ,cAAc;GACd,WAAY,MAAkC;EAChD,CAAC;CACH;CACA,OAAO;AACT;AAEA,MAAa,oBAAoB,WAAoB;CAKnD,OAAO,gBAAgB,OAAO;AAChC;;;;;;;;AASA,MAAa,aAAa,OAAO,QAAgB,YAA2E;CAE1H,OAAO,QAA8B,iBAAiB,MAAM,GAC5D;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAMF,MAAa,yBAAyB,WAAoB;CACtD,OAAO,CACP,gBAAgB,OAAO,eACvB;AACA;AAGJ,MAAa,6BAAkJ,QAAgB,YAC1K;CAEL,MAAM,EAAC,OAAO,cAAc,SAAS,mBAAkB,WAAW,CAAC;CAEjE,MAAM,WAAY,cAAc,YAAY,sBAAsB,MAAM;CAItE,MAAM,WAAkE,EAAE,aAAa,WAAW,QAAQ;EAAE;EAAQ,GAAG;CAAe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AAG,SAAS,KAAA;CAAS;CAKjD,MAAM,cAA2G,UAAU;EACvH,MAAM,EAAC,QAAO,SAAQ,SAAS,CAAC;EAEhC,OAAQ,cAAc,QAAO,MAAK,cAAc;CAClD;CAON,OAAQ;EAAE;EAAY,GAAG;CAAgB;AAAC;;;;AAU5C,MAAa,oBACW,SACrB,gBAKQ;CACL,OAAO,YAAY,gCAAgC,OAAO,GAAG,WAAW;AAC1E"}
1
+ {"version":3,"file":"admin-roles.js","names":[],"sources":["../../src/react/admin-roles/admin-roles.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.23.0\n */\nimport {\n useMutation,\n useQuery\n} from '@tanstack/react-query';\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n MutationFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseMutationOptions,\n UseMutationResult,\n UseQueryOptions,\n UseQueryResult\n} from '@tanstack/react-query';\n\nimport type {\n HTTPExceptionResponse,\n ProductGrantListRead,\n ProductGrantWrite,\n ValidationErrorResponse\n} from '../../models';\n\nimport { request } from '../../client';\nimport type { ErrorType , BodyType } from '../../client';\n\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n\n\nconst withQueryKey = <T extends object, K>(query: T, queryKey: K): T & { queryKey: K } => {\n const result = { queryKey } as T & { queryKey: K };\n for (const key of Object.keys(query)) {\n // The explicit queryKey always wins, matching the previous\n // `{ ...query, queryKey }` spread where it was set last.\n if (key === 'queryKey') continue;\n Object.defineProperty(result, key, {\n enumerable: true,\n configurable: true,\n get: () => (query as Record<string, unknown>)[key],\n });\n }\n return result;\n};\n\nexport const getListGrantsUrl = (userId: number,) => {\n\n\n\n\n return `/admin/users/${userId}/product-roles`\n}\n\n/**\n * This account's grants within the caller's organisation scope.\n *\n * Readable by SUPPORT as well as ADMIN: knowing what somebody is, is part of\n * helping them. Changing it is not.\n * @summary List Grants\n */\nexport const listGrants = async (userId: number, options?: Parameters<typeof request>[1]): Promise<ProductGrantListRead> => {\n\n return request<ProductGrantListRead>(getListGrantsUrl(userId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getListGrantsQueryKey = (userId: number,) => {\n return [\n `/admin/users/${userId}/product-roles`\n ] as const;\n }\n\n\nexport const getListGrantsQueryOptions = <TData = Awaited<ReturnType<typeof listGrants>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(userId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listGrants>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getListGrantsQueryKey(userId);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof listGrants>>> = ({ signal }) => listGrants(userId, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, enabled: userId !== null && userId !== undefined, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listGrants>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ListGrantsQueryResult = NonNullable<Awaited<ReturnType<typeof listGrants>>>\nexport type ListGrantsQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useListGrants<TData = Awaited<ReturnType<typeof listGrants>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n userId: number, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listGrants>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof listGrants>>,\n TError,\n Awaited<ReturnType<typeof listGrants>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListGrants<TData = Awaited<ReturnType<typeof listGrants>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n userId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listGrants>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof listGrants>>,\n TError,\n Awaited<ReturnType<typeof listGrants>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListGrants<TData = Awaited<ReturnType<typeof listGrants>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n userId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listGrants>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary List Grants\n */\n\nexport function useListGrants<TData = Awaited<ReturnType<typeof listGrants>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n userId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listGrants>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getListGrantsQueryOptions(userId,options)\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n return withQueryKey(query, queryOptions.queryKey);\n}\n\n\n\n\n\n\nexport const getReplaceGrantsUrl = (userId: number,) => {\n\n\n\n\n return `/admin/users/${userId}/product-roles`\n}\n\n/**\n * Replace this account's roles for one product at one organisation.\n *\n * ``PUT`` because it is idempotent and the body is the whole desired state for\n * that ``(tenant, product)`` slice — sending it twice leaves the same grants.\n *\n * Two scope checks, and both are needed. The *subject* must be an account the\n * operator reaches, and the ``tenantId`` being granted at must be one they\n * reach too: without the second, an operator could grant a remit at an\n * organisation they have no authority over, which is how a scoped\n * administrator becomes an unscoped one.\n *\n * ``422`` for a role the product does not recognise —\n * :data:`~app.models.enums.PRODUCT_ROLES` decides, so ``student`` for biblio is\n * refused rather than stored and puzzled over later.\n * @summary Replace Grants\n */\nexport const replaceGrants = async (userId: number,\n productGrantWrite: ProductGrantWrite, options?: Parameters<typeof request>[1]): Promise<ProductGrantListRead> => {\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<ProductGrantListRead>(getReplaceGrantsUrl(userId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(productGrantWrite)\n }\n);}\n\n\n\n\n\nexport const getReplaceGrantsMutationKey = () => ['replaceGrants'] as const;\n\nexport const getReplaceGrantsMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof replaceGrants>>, TError,ReplaceGrantsMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof replaceGrants>>, TError,ReplaceGrantsMutationVariables, TContext> => {\n\nconst mutationKey = getReplaceGrantsMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof replaceGrants>>, ReplaceGrantsMutationVariables> = (props) => {\n const {userId,data} = props ?? {};\n\n return replaceGrants(userId,data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type ReplaceGrantsMutationResult = NonNullable<Awaited<ReturnType<typeof replaceGrants>>>\n export type ReplaceGrantsMutationBody = BodyType<ProductGrantWrite>\n export type ReplaceGrantsMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type ReplaceGrantsMutationVariables = {userId: number;data: BodyType<ProductGrantWrite>}\n\n /**\n * @summary Replace Grants\n */\nexport const useReplaceGrants = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof replaceGrants>>, TError,ReplaceGrantsMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof replaceGrants>>,\n TError,\n ReplaceGrantsMutationVariables,\n TContext\n > => {\n return useMutation(getReplaceGrantsMutationOptions(options), queryClient);\n }\n"],"mappings":";;;;;;;;;;;AAyCA,MAAM,gBAAqC,OAAU,aAAqC;CACxF,MAAM,SAAS,EAAE,SAAS;CAC1B,KAAK,MAAM,OAAO,OAAO,KAAK,KAAK,GAAG;EAGpC,IAAI,QAAQ,YAAY;EACxB,OAAO,eAAe,QAAQ,KAAK;GACjC,YAAY;GACZ,cAAc;GACd,WAAY,MAAkC;EAChD,CAAC;CACH;CACA,OAAO;AACT;AAEA,MAAa,oBAAoB,WAAoB;CAKnD,OAAO,gBAAgB,OAAO;AAChC;;;;;;;;AASA,MAAa,aAAa,OAAO,QAAgB,YAA2E;CAE1H,OAAO,QAA8B,iBAAiB,MAAM,GAC5D;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAMF,MAAa,yBAAyB,WAAoB;CACtD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mCACW,YAC6F;CAErH,MAAM,cAAc,4BAA4B;CAChD,MAAM,EAAC,UAAU,iBAAiB,SAAS,mBAAkB,UACvD,QAAQ,YAAY,iBAAiB,QAAQ,YAAY,QAAQ,SAAS,cAC1E,UACE;EAAC,GAAG;EAAS,UAAU;GAAC,GAAG,QAAQ;GAAU;EAAW;CAAC,IACzD;EAAC,UAAU,EAAE,YAAa;EAAG,SAAS,KAAA;CAAS;CAKjD,MAAM,cAA2G,UAAU;EACvH,MAAM,EAAC,QAAO,SAAQ,SAAS,CAAC;EAEhC,OAAQ,cAAc,QAAO,MAAK,cAAc;CAClD;CAON,OAAQ;EAAE;EAAY,GAAG;CAAgB;AAAC;;;;AAU5C,MAAa,oBACW,SACrB,gBAKQ;CACL,OAAO,YAAY,gCAAgC,OAAO,GAAG,WAAW;AAC1E"}
@@ -1,5 +1,5 @@
1
1
 
2
- import { D_ as DemoUserRead, Dd as HTTPExceptionResponse, E as ValidationErrorResponse, E_ as DemoUserWrite, cd as ImpersonationWrite, ft as SupportSessionRead } from "../chunks/index.js";
2
+ import { E as ValidationErrorResponse, Od as ImpersonationWrite, X_ as DemoUserWrite, Z_ as DemoUserRead, ft as SupportSessionRead, qd as HTTPExceptionResponse } from "../chunks/index.js";
3
3
  import { a as ErrorType, c as request, n as BodyType } from "../chunks/client.js";
4
4
  import { QueryClient, UseMutationOptions, UseMutationResult } from "@tanstack/react-query";
5
5
  //#region src/react/admin-support/admin-support.d.ts
@@ -7,7 +7,7 @@ import { useMutation } from "@tanstack/react-query";
7
7
  * Do not edit manually.
8
8
  * Mozaik backend
9
9
  * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.
10
- * OpenAPI spec version: 0.22.10
10
+ * OpenAPI spec version: 0.23.0
11
11
  */
12
12
  const getCreateDemoUserUrl = () => {
13
13
  return `/admin/demo-users`;
@@ -1 +1 @@
1
- {"version":3,"file":"admin-support.js","names":[],"sources":["../../src/react/admin-support/admin-support.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.22.10\n */\nimport {\n useMutation\n} from '@tanstack/react-query';\nimport type {\n MutationFunction,\n QueryClient,\n UseMutationOptions,\n UseMutationResult\n} from '@tanstack/react-query';\n\nimport type {\n DemoUserRead,\n DemoUserWrite,\n HTTPExceptionResponse,\n ImpersonationWrite,\n SupportSessionRead,\n ValidationErrorResponse\n} from '../../models';\n\nimport { request } from '../../client';\nimport type { ErrorType , BodyType } from '../../client';\n\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n\n\nexport const getCreateDemoUserUrl = () => {\n\n\n\n\n return `/admin/demo-users`\n}\n\n/**\n * Create, or return, a demonstration account for an establishment (E57).\n *\n * ``RequireAdmin`` rather than ``RequireStaff``: this creates an account inside\n * a customer's tenant, which is a change to what the customer has, not an\n * assistance to one of their members.\n *\n * **The account has no password and cannot be signed into directly.** The\n * legacy derived one from the establishment id alone — ``Etab{id padded}$``,\n * at ``etab_{id}@ta.com`` — and then redirected into the impersonation route\n * (defect D15). Anyone who noticed the pattern held a working credential for\n * every establishment. Here the row is created without a credential and is\n * reached through E56, which is audited.\n *\n * ``201`` when created, ``200`` when it already existed. Idempotent, because a\n * salesperson clicking twice should not end up with two demo accounts.\n * @summary Create Demo User\n */\nexport const createDemoUser = async (demoUserWrite: DemoUserWrite, options?: Parameters<typeof request>[1]): Promise<DemoUserRead> => {\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<DemoUserRead>(getCreateDemoUserUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(demoUserWrite)\n }\n);}\n\n\n\n\n\nexport const getCreateDemoUserMutationKey = () => ['createDemoUser'] as const;\n\nexport const getCreateDemoUserMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createDemoUser>>, TError,CreateDemoUserMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof createDemoUser>>, TError,CreateDemoUserMutationVariables, TContext> => {\n\nconst mutationKey = getCreateDemoUserMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof createDemoUser>>, CreateDemoUserMutationVariables> = (props) => {\n const {data} = props ?? {};\n\n return createDemoUser(data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type CreateDemoUserMutationResult = NonNullable<Awaited<ReturnType<typeof createDemoUser>>>\n export type CreateDemoUserMutationBody = BodyType<DemoUserWrite>\n export type CreateDemoUserMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type CreateDemoUserMutationVariables = {data: BodyType<DemoUserWrite>}\n\n /**\n * @summary Create Demo User\n */\nexport const useCreateDemoUser = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createDemoUser>>, TError,CreateDemoUserMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof createDemoUser>>,\n TError,\n CreateDemoUserMutationVariables,\n TContext\n > => {\n return useMutation(getCreateDemoUserMutationOptions(options), queryClient);\n }\n export const getOpenSupportSessionUrl = () => {\n\n\n\n\n return `/admin/impersonations`\n}\n\n/**\n * Open a support session acting as another account (E56).\n *\n * ``reason`` is mandatory and exists to be logged. A support action with no\n * stated reason cannot be told apart from an abuse of the same endpoint.\n *\n * **This returns no tokens.** It used to: a Keycloak token-exchange session for\n * the subject, on the reasoning that the platform should mint no credentials and\n * that the subject's own assurance level would keep privileged operations out of\n * reach. Both halves turned out to be wrong. The exchanged token carried no\n * actor claim, so it was indistinguishable from the patron's own and the trail\n * stopped at this row; and it carried no ``assurance`` claim either, which\n * ``clamp_assurance`` reads as *unconstrained* — so the operator resolved to\n * ``HIGH`` and could close the account, the single thing the design promised to\n * prevent. Keycloak 26 also rejects the grant outright.\n *\n * So the operator keeps their own token and sends ``X-Acting-As`` with the id\n * returned here. Nothing is minted, the authenticated identity stays the\n * operator, and the session is clamped to the lowest assurance by\n * :func:`app.core.security.acting_as` — which makes E14 and E17 unreachable\n * through the guard that already exists rather than through a special case.\n *\n * Ending it early is ``DELETE /admin/impersonations/{id}``, which must be sent\n * *without* the header: a support session holds no staff roles.\n * @summary Open Support Session\n */\nexport const openSupportSession = async (impersonationWrite: ImpersonationWrite, options?: Parameters<typeof request>[1]): Promise<SupportSessionRead> => {\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<SupportSessionRead>(getOpenSupportSessionUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(impersonationWrite)\n }\n);}\n\n\n\n\n\nexport const getOpenSupportSessionMutationKey = () => ['openSupportSession'] as const;\n\nexport const getOpenSupportSessionMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof openSupportSession>>, TError,OpenSupportSessionMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof openSupportSession>>, TError,OpenSupportSessionMutationVariables, TContext> => {\n\nconst mutationKey = getOpenSupportSessionMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof openSupportSession>>, OpenSupportSessionMutationVariables> = (props) => {\n const {data} = props ?? {};\n\n return openSupportSession(data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type OpenSupportSessionMutationResult = NonNullable<Awaited<ReturnType<typeof openSupportSession>>>\n export type OpenSupportSessionMutationBody = BodyType<ImpersonationWrite>\n export type OpenSupportSessionMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type OpenSupportSessionMutationVariables = {data: BodyType<ImpersonationWrite>}\n\n /**\n * @summary Open Support Session\n */\nexport const useOpenSupportSession = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof openSupportSession>>, TError,OpenSupportSessionMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof openSupportSession>>,\n TError,\n OpenSupportSessionMutationVariables,\n TContext\n > => {\n return useMutation(getOpenSupportSessionMutationOptions(options), queryClient);\n }\n export const getCloseSupportSessionUrl = (supportSessionId: number,) => {\n\n\n\n\n return `/admin/impersonations/${supportSessionId}`\n}\n\n/**\n * End a support session early. Idempotent.\n *\n * Must be called *without* ``X-Acting-As``: a session in progress carries no\n * staff roles, so a request made through one cannot reach this endpoint. That\n * is deliberate — the operator steps out before they can close it, and simply\n * dropping the header ends the session's effect immediately either way.\n *\n * ``204`` whether or not the row was still open, and whether or not it was\n * theirs. A support session id is a bare integer and must not be an oracle.\n * @summary Close Support Session\n */\nexport const closeSupportSession = async (supportSessionId: number, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getCloseSupportSessionUrl(supportSessionId),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\n\n\n\nexport const getCloseSupportSessionMutationKey = () => ['closeSupportSession'] as const;\n\nexport const getCloseSupportSessionMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof closeSupportSession>>, TError,CloseSupportSessionMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof closeSupportSession>>, TError,CloseSupportSessionMutationVariables, TContext> => {\n\nconst mutationKey = getCloseSupportSessionMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof closeSupportSession>>, CloseSupportSessionMutationVariables> = (props) => {\n const {supportSessionId} = props ?? {};\n\n return closeSupportSession(supportSessionId,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type CloseSupportSessionMutationResult = NonNullable<Awaited<ReturnType<typeof closeSupportSession>>>\n\n export type CloseSupportSessionMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type CloseSupportSessionMutationVariables = {supportSessionId: number}\n\n /**\n * @summary Close Support Session\n */\nexport const useCloseSupportSession = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof closeSupportSession>>, TError,CloseSupportSessionMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof closeSupportSession>>,\n TError,\n CloseSupportSessionMutationVariables,\n TContext\n > => {\n return useMutation(getCloseSupportSessionMutationOptions(options), queryClient);\n }\n"],"mappings":";;;;;;;;;;;AAkCA,MAAa,6BAA6B;CAKxC,OAAO;AACT;;;;;;;;;;;;;;;;;;;AAoBA,MAAa,iBAAiB,OAAO,eAA8B,YAAmE;CAElI,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,QAAsB,qBAAqB,GAChD;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,aAAa;CACpC,CACF;AAAE;AAMF,MAAa,qCAAqC,CAAC,gBAAgB;AAEnE,MAAa,oCACW,YAC+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version":3,"file":"admin-support.js","names":[],"sources":["../../src/react/admin-support/admin-support.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.23.0\n */\nimport {\n useMutation\n} from '@tanstack/react-query';\nimport type {\n MutationFunction,\n QueryClient,\n UseMutationOptions,\n UseMutationResult\n} from '@tanstack/react-query';\n\nimport type {\n DemoUserRead,\n DemoUserWrite,\n HTTPExceptionResponse,\n ImpersonationWrite,\n SupportSessionRead,\n ValidationErrorResponse\n} from '../../models';\n\nimport { request } from '../../client';\nimport type { ErrorType , BodyType } from '../../client';\n\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n\n\nexport const getCreateDemoUserUrl = () => {\n\n\n\n\n return `/admin/demo-users`\n}\n\n/**\n * Create, or return, a demonstration account for an establishment (E57).\n *\n * ``RequireAdmin`` rather than ``RequireStaff``: this creates an account inside\n * a customer's tenant, which is a change to what the customer has, not an\n * assistance to one of their members.\n *\n * **The account has no password and cannot be signed into directly.** The\n * legacy derived one from the establishment id alone — ``Etab{id padded}$``,\n * at ``etab_{id}@ta.com`` — and then redirected into the impersonation route\n * (defect D15). Anyone who noticed the pattern held a working credential for\n * every establishment. Here the row is created without a credential and is\n * reached through E56, which is audited.\n *\n * ``201`` when created, ``200`` when it already existed. Idempotent, because a\n * salesperson clicking twice should not end up with two demo accounts.\n * @summary Create Demo User\n */\nexport const createDemoUser = async (demoUserWrite: DemoUserWrite, options?: Parameters<typeof request>[1]): Promise<DemoUserRead> => {\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<DemoUserRead>(getCreateDemoUserUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(demoUserWrite)\n }\n);}\n\n\n\n\n\nexport const getCreateDemoUserMutationKey = () => ['createDemoUser'] as const;\n\nexport const getCreateDemoUserMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createDemoUser>>, TError,CreateDemoUserMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof createDemoUser>>, TError,CreateDemoUserMutationVariables, TContext> => {\n\nconst mutationKey = getCreateDemoUserMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof createDemoUser>>, CreateDemoUserMutationVariables> = (props) => {\n const {data} = props ?? {};\n\n return createDemoUser(data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type CreateDemoUserMutationResult = NonNullable<Awaited<ReturnType<typeof createDemoUser>>>\n export type CreateDemoUserMutationBody = BodyType<DemoUserWrite>\n export type CreateDemoUserMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type CreateDemoUserMutationVariables = {data: BodyType<DemoUserWrite>}\n\n /**\n * @summary Create Demo User\n */\nexport const useCreateDemoUser = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createDemoUser>>, TError,CreateDemoUserMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof createDemoUser>>,\n TError,\n CreateDemoUserMutationVariables,\n TContext\n > => {\n return useMutation(getCreateDemoUserMutationOptions(options), queryClient);\n }\n export const getOpenSupportSessionUrl = () => {\n\n\n\n\n return `/admin/impersonations`\n}\n\n/**\n * Open a support session acting as another account (E56).\n *\n * ``reason`` is mandatory and exists to be logged. A support action with no\n * stated reason cannot be told apart from an abuse of the same endpoint.\n *\n * **This returns no tokens.** It used to: a Keycloak token-exchange session for\n * the subject, on the reasoning that the platform should mint no credentials and\n * that the subject's own assurance level would keep privileged operations out of\n * reach. Both halves turned out to be wrong. The exchanged token carried no\n * actor claim, so it was indistinguishable from the patron's own and the trail\n * stopped at this row; and it carried no ``assurance`` claim either, which\n * ``clamp_assurance`` reads as *unconstrained* — so the operator resolved to\n * ``HIGH`` and could close the account, the single thing the design promised to\n * prevent. Keycloak 26 also rejects the grant outright.\n *\n * So the operator keeps their own token and sends ``X-Acting-As`` with the id\n * returned here. Nothing is minted, the authenticated identity stays the\n * operator, and the session is clamped to the lowest assurance by\n * :func:`app.core.security.acting_as` — which makes E14 and E17 unreachable\n * through the guard that already exists rather than through a special case.\n *\n * Ending it early is ``DELETE /admin/impersonations/{id}``, which must be sent\n * *without* the header: a support session holds no staff roles.\n * @summary Open Support Session\n */\nexport const openSupportSession = async (impersonationWrite: ImpersonationWrite, options?: Parameters<typeof request>[1]): Promise<SupportSessionRead> => {\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<SupportSessionRead>(getOpenSupportSessionUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(impersonationWrite)\n }\n);}\n\n\n\n\n\nexport const getOpenSupportSessionMutationKey = () => ['openSupportSession'] as const;\n\nexport const getOpenSupportSessionMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof openSupportSession>>, TError,OpenSupportSessionMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof openSupportSession>>, TError,OpenSupportSessionMutationVariables, TContext> => {\n\nconst mutationKey = getOpenSupportSessionMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof openSupportSession>>, OpenSupportSessionMutationVariables> = (props) => {\n const {data} = props ?? {};\n\n return openSupportSession(data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type OpenSupportSessionMutationResult = NonNullable<Awaited<ReturnType<typeof openSupportSession>>>\n export type OpenSupportSessionMutationBody = BodyType<ImpersonationWrite>\n export type OpenSupportSessionMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type OpenSupportSessionMutationVariables = {data: BodyType<ImpersonationWrite>}\n\n /**\n * @summary Open Support Session\n */\nexport const useOpenSupportSession = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof openSupportSession>>, TError,OpenSupportSessionMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof openSupportSession>>,\n TError,\n OpenSupportSessionMutationVariables,\n TContext\n > => {\n return useMutation(getOpenSupportSessionMutationOptions(options), queryClient);\n }\n export const getCloseSupportSessionUrl = (supportSessionId: number,) => {\n\n\n\n\n return `/admin/impersonations/${supportSessionId}`\n}\n\n/**\n * End a support session early. Idempotent.\n *\n * Must be called *without* ``X-Acting-As``: a session in progress carries no\n * staff roles, so a request made through one cannot reach this endpoint. That\n * is deliberate — the operator steps out before they can close it, and simply\n * dropping the header ends the session's effect immediately either way.\n *\n * ``204`` whether or not the row was still open, and whether or not it was\n * theirs. A support session id is a bare integer and must not be an oracle.\n * @summary Close Support Session\n */\nexport const closeSupportSession = async (supportSessionId: number, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getCloseSupportSessionUrl(supportSessionId),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\n\n\n\nexport const getCloseSupportSessionMutationKey = () => ['closeSupportSession'] as const;\n\nexport const getCloseSupportSessionMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof closeSupportSession>>, TError,CloseSupportSessionMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof closeSupportSession>>, TError,CloseSupportSessionMutationVariables, TContext> => {\n\nconst mutationKey = getCloseSupportSessionMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof closeSupportSession>>, CloseSupportSessionMutationVariables> = (props) => {\n const {supportSessionId} = props ?? {};\n\n return closeSupportSession(supportSessionId,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type CloseSupportSessionMutationResult = NonNullable<Awaited<ReturnType<typeof closeSupportSession>>>\n\n export type CloseSupportSessionMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type CloseSupportSessionMutationVariables = {supportSessionId: number}\n\n /**\n * @summary Close Support Session\n */\nexport const useCloseSupportSession = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof closeSupportSession>>, TError,CloseSupportSessionMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof closeSupportSession>>,\n TError,\n CloseSupportSessionMutationVariables,\n TContext\n > => {\n return useMutation(getCloseSupportSessionMutationOptions(options), queryClient);\n }\n"],"mappings":";;;;;;;;;;;AAkCA,MAAa,6BAA6B;CAKxC,OAAO;AACT;;;;;;;;;;;;;;;;;;;AAoBA,MAAa,iBAAiB,OAAO,eAA8B,YAAmE;CAElI,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,QAAsB,qBAAqB,GAChD;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,aAAa;CACpC,CACF;AAAE;AAMF,MAAa,qCAAqC,CAAC,gBAAgB;AAEnE,MAAa,oCACW,YA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1,9 +1,114 @@
1
1
 
2
- import { $_ as CustomerHelpWrite, Cv as CustomerActivationWrite, Dd as HTTPExceptionResponse, E as ValidationErrorResponse, Ev as CustomerActivationRead, I_ as CustomerRequestPage, Jt as ServiceCredentialWrite, Kt as ServiceRead, L_ as CustomerRequestRead, Lb as CapabilityProvider, P_ as CustomerRequestUpdateWrite, Qt as SearchTenantsParams, Rb as BrandingWrite, Ut as ServiceSettingsWrite, bo as ListStaffCustomerRequestsParams, it as TenantSettingsRead, k as UniversePaletteWrite, nt as TenantSettingsUpdateWrite, ot as TenantSearchPage, ut as TenantDirectoryParams, zb as BrandingRead } from "../chunks/index.js";
2
+ import { $x as CapabilityProvider, Ao as ListStaffCustomerRequestsParams, Av as CustomerSegmentWrite, Ay as CustomerActivationWrite, Dv as CustomerSingleUseBatchRead, E as ValidationErrorResponse, Ev as CustomerSingleUseBatchWrite, Ht as StaffConsoleItemRead, Iv as CustomerRequestUpdateWrite, Nv as CustomerSegmentRead, Ny as CustomerActivationRead, Qt as ServiceRead, Rv as CustomerRequestPage, Vt as StaffConsoleItemListRead, Yt as ServiceSettingsWrite, aS as BrandingRead, en as ServiceCredentialWrite, ex as ConsoleItemWrite, iS as BrandingWrite, in as SearchTenantsParams, it as TenantSettingsRead, iy as CustomerHelpWrite, jv as CustomerSegmentUpdateWrite, k as UniversePaletteWrite, nS as CalendarEventRead, nt as TenantSettingsUpdateWrite, ot as TenantSearchPage, qd as HTTPExceptionResponse, qt as StaffCalendarEventWrite, ut as TenantDirectoryParams, zv as CustomerRequestRead } from "../chunks/index.js";
3
3
  import { a as ErrorType, c as request, n as BodyType } from "../chunks/client.js";
4
4
  import { DataTag, DefinedInitialDataOptions, DefinedUseQueryResult, QueryClient, QueryKey, UndefinedInitialDataOptions, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
5
5
  //#region src/react/admin-tenants/admin-tenants.d.ts
6
6
  type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
7
+ export declare const getListConsoleItemsUrl: () => string;
8
+ /**
9
+ * Every console item, shown or not, with its audience and display window.
10
+ * @summary List Console Items
11
+ */
12
+ export declare const listConsoleItems: (options?: Parameters<typeof request>[1]) => Promise<StaffConsoleItemListRead>;
13
+ export declare const getListConsoleItemsQueryKey: () => readonly [`/admin/customer-console/items`];
14
+ export declare const getListConsoleItemsQueryOptions: <TData = Awaited<ReturnType<typeof listConsoleItems>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(options?: {
15
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof listConsoleItems>>, TError, TData>>;
16
+ request?: SecondParameter<typeof request>;
17
+ }) => UseQueryOptions<Awaited<ReturnType<typeof listConsoleItems>>, TError, TData> & {
18
+ queryKey: DataTag<QueryKey, TData, TError>;
19
+ };
20
+ export type ListConsoleItemsQueryResult = NonNullable<Awaited<ReturnType<typeof listConsoleItems>>>;
21
+ export type ListConsoleItemsQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>;
22
+ export declare function useListConsoleItems<TData = Awaited<ReturnType<typeof listConsoleItems>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(options: {
23
+ query: Partial<UseQueryOptions<Awaited<ReturnType<typeof listConsoleItems>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof listConsoleItems>>, TError, Awaited<ReturnType<typeof listConsoleItems>>>, 'initialData'>;
24
+ request?: SecondParameter<typeof request>;
25
+ }, queryClient?: QueryClient): DefinedUseQueryResult<TData, TError> & {
26
+ queryKey: DataTag<QueryKey, TData, TError>;
27
+ };
28
+ export declare function useListConsoleItems<TData = Awaited<ReturnType<typeof listConsoleItems>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(options?: {
29
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof listConsoleItems>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof listConsoleItems>>, TError, Awaited<ReturnType<typeof listConsoleItems>>>, 'initialData'>;
30
+ request?: SecondParameter<typeof request>;
31
+ }, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
32
+ queryKey: DataTag<QueryKey, TData, TError>;
33
+ };
34
+ export declare function useListConsoleItems<TData = Awaited<ReturnType<typeof listConsoleItems>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(options?: {
35
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof listConsoleItems>>, TError, TData>>;
36
+ request?: SecondParameter<typeof request>;
37
+ }, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
38
+ queryKey: DataTag<QueryKey, TData, TError>;
39
+ };
40
+ export declare const getCreateConsoleItemUrl: () => string;
41
+ /**
42
+ * Publish a webinar, event, news, banner, kit support or orderable paper support to customer administrators.
43
+ * @summary Create Console Item
44
+ */
45
+ export declare const createConsoleItem: (consoleItemWrite: ConsoleItemWrite, options?: Parameters<typeof request>[1]) => Promise<StaffConsoleItemRead>;
46
+ export declare const getCreateConsoleItemMutationKey: () => readonly ['createConsoleItem'];
47
+ export declare const getCreateConsoleItemMutationOptions: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
48
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof createConsoleItem>>, TError, CreateConsoleItemMutationVariables, TContext>;
49
+ request?: SecondParameter<typeof request>;
50
+ }) => UseMutationOptions<Awaited<ReturnType<typeof createConsoleItem>>, TError, CreateConsoleItemMutationVariables, TContext>;
51
+ export type CreateConsoleItemMutationResult = NonNullable<Awaited<ReturnType<typeof createConsoleItem>>>;
52
+ export type CreateConsoleItemMutationBody = BodyType<ConsoleItemWrite>;
53
+ export type CreateConsoleItemMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>;
54
+ export type CreateConsoleItemMutationVariables = {
55
+ data: BodyType<ConsoleItemWrite>;
56
+ };
57
+ /**
58
+ * @summary Create Console Item
59
+ */
60
+ export declare const useCreateConsoleItem: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
61
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof createConsoleItem>>, TError, CreateConsoleItemMutationVariables, TContext>;
62
+ request?: SecondParameter<typeof request>;
63
+ }, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof createConsoleItem>>, TError, CreateConsoleItemMutationVariables, TContext>;
64
+ export declare const getRemoveConsoleItemUrl: (itemId: number) => string;
65
+ /**
66
+ * Withdraw a console item. Orders already placed keep their wording.
67
+ * @summary Remove Console Item
68
+ */
69
+ export declare const removeConsoleItem: (itemId: number, options?: Parameters<typeof request>[1]) => Promise<void>;
70
+ export declare const getRemoveConsoleItemMutationKey: () => readonly ['removeConsoleItem'];
71
+ export declare const getRemoveConsoleItemMutationOptions: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
72
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof removeConsoleItem>>, TError, RemoveConsoleItemMutationVariables, TContext>;
73
+ request?: SecondParameter<typeof request>;
74
+ }) => UseMutationOptions<Awaited<ReturnType<typeof removeConsoleItem>>, TError, RemoveConsoleItemMutationVariables, TContext>;
75
+ export type RemoveConsoleItemMutationResult = NonNullable<Awaited<ReturnType<typeof removeConsoleItem>>>;
76
+ export type RemoveConsoleItemMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>;
77
+ export type RemoveConsoleItemMutationVariables = {
78
+ itemId: number;
79
+ };
80
+ /**
81
+ * @summary Remove Console Item
82
+ */
83
+ export declare const useRemoveConsoleItem: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
84
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof removeConsoleItem>>, TError, RemoveConsoleItemMutationVariables, TContext>;
85
+ request?: SecondParameter<typeof request>;
86
+ }, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof removeConsoleItem>>, TError, RemoveConsoleItemMutationVariables, TContext>;
87
+ export declare const getReplaceConsoleItemUrl: (itemId: number) => string;
88
+ /**
89
+ * Replace a console item with the complete desired content.
90
+ * @summary Replace Console Item
91
+ */
92
+ export declare const replaceConsoleItem: (itemId: number, consoleItemWrite: ConsoleItemWrite, options?: Parameters<typeof request>[1]) => Promise<StaffConsoleItemRead>;
93
+ export declare const getReplaceConsoleItemMutationKey: () => readonly ['replaceConsoleItem'];
94
+ export declare const getReplaceConsoleItemMutationOptions: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
95
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof replaceConsoleItem>>, TError, ReplaceConsoleItemMutationVariables, TContext>;
96
+ request?: SecondParameter<typeof request>;
97
+ }) => UseMutationOptions<Awaited<ReturnType<typeof replaceConsoleItem>>, TError, ReplaceConsoleItemMutationVariables, TContext>;
98
+ export type ReplaceConsoleItemMutationResult = NonNullable<Awaited<ReturnType<typeof replaceConsoleItem>>>;
99
+ export type ReplaceConsoleItemMutationBody = BodyType<ConsoleItemWrite>;
100
+ export type ReplaceConsoleItemMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>;
101
+ export type ReplaceConsoleItemMutationVariables = {
102
+ itemId: number;
103
+ data: BodyType<ConsoleItemWrite>;
104
+ };
105
+ /**
106
+ * @summary Replace Console Item
107
+ */
108
+ export declare const useReplaceConsoleItem: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
109
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof replaceConsoleItem>>, TError, ReplaceConsoleItemMutationVariables, TContext>;
110
+ request?: SecondParameter<typeof request>;
111
+ }, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof replaceConsoleItem>>, TError, ReplaceConsoleItemMutationVariables, TContext>;
7
112
  export declare const getListStaffCustomerRequestsUrl: (params?: ListStaffCustomerRequestsParams) => string;
8
113
  /**
9
114
  * @summary List Staff Customer Requests
@@ -299,6 +404,82 @@ export declare const useUpdateTenant: <TError = ErrorType<HTTPExceptionResponse
299
404
  mutation?: UseMutationOptions<Awaited<ReturnType<typeof updateTenant>>, TError, UpdateTenantMutationVariables, TContext>;
300
405
  request?: SecondParameter<typeof request>;
301
406
  }, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof updateTenant>>, TError, UpdateTenantMutationVariables, TContext>;
407
+ export declare const getCreateCustomerSegmentUrl: (tenantId: number) => string;
408
+ /**
409
+ * Mozaik staff create a segment with its own registration code and cap.
410
+ * @summary Create Customer Segment
411
+ */
412
+ export declare const createCustomerSegment: (tenantId: number, customerSegmentWrite: CustomerSegmentWrite, options?: Parameters<typeof request>[1]) => Promise<CustomerSegmentRead>;
413
+ export declare const getCreateCustomerSegmentMutationKey: () => readonly ['createCustomerSegment'];
414
+ export declare const getCreateCustomerSegmentMutationOptions: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
415
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof createCustomerSegment>>, TError, CreateCustomerSegmentMutationVariables, TContext>;
416
+ request?: SecondParameter<typeof request>;
417
+ }) => UseMutationOptions<Awaited<ReturnType<typeof createCustomerSegment>>, TError, CreateCustomerSegmentMutationVariables, TContext>;
418
+ export type CreateCustomerSegmentMutationResult = NonNullable<Awaited<ReturnType<typeof createCustomerSegment>>>;
419
+ export type CreateCustomerSegmentMutationBody = BodyType<CustomerSegmentWrite>;
420
+ export type CreateCustomerSegmentMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>;
421
+ export type CreateCustomerSegmentMutationVariables = {
422
+ tenantId: number;
423
+ data: BodyType<CustomerSegmentWrite>;
424
+ };
425
+ /**
426
+ * @summary Create Customer Segment
427
+ */
428
+ export declare const useCreateCustomerSegment: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
429
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof createCustomerSegment>>, TError, CreateCustomerSegmentMutationVariables, TContext>;
430
+ request?: SecondParameter<typeof request>;
431
+ }, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof createCustomerSegment>>, TError, CreateCustomerSegmentMutationVariables, TContext>;
432
+ export declare const getUpdateCustomerSegmentUrl: (tenantId: number, segmentId: number) => string;
433
+ /**
434
+ * Rename a segment, change its cap or validity, or withdraw its code. A cap never drops below registrations already made.
435
+ * @summary Update Customer Segment
436
+ */
437
+ export declare const updateCustomerSegment: (tenantId: number, segmentId: number, customerSegmentUpdateWrite: CustomerSegmentUpdateWrite, options?: Parameters<typeof request>[1]) => Promise<CustomerSegmentRead>;
438
+ export declare const getUpdateCustomerSegmentMutationKey: () => readonly ['updateCustomerSegment'];
439
+ export declare const getUpdateCustomerSegmentMutationOptions: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
440
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof updateCustomerSegment>>, TError, UpdateCustomerSegmentMutationVariables, TContext>;
441
+ request?: SecondParameter<typeof request>;
442
+ }) => UseMutationOptions<Awaited<ReturnType<typeof updateCustomerSegment>>, TError, UpdateCustomerSegmentMutationVariables, TContext>;
443
+ export type UpdateCustomerSegmentMutationResult = NonNullable<Awaited<ReturnType<typeof updateCustomerSegment>>>;
444
+ export type UpdateCustomerSegmentMutationBody = BodyType<CustomerSegmentUpdateWrite>;
445
+ export type UpdateCustomerSegmentMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>;
446
+ export type UpdateCustomerSegmentMutationVariables = {
447
+ tenantId: number;
448
+ segmentId: number;
449
+ data: BodyType<CustomerSegmentUpdateWrite>;
450
+ };
451
+ /**
452
+ * @summary Update Customer Segment
453
+ */
454
+ export declare const useUpdateCustomerSegment: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
455
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof updateCustomerSegment>>, TError, UpdateCustomerSegmentMutationVariables, TContext>;
456
+ request?: SecondParameter<typeof request>;
457
+ }, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof updateCustomerSegment>>, TError, UpdateCustomerSegmentMutationVariables, TContext>;
458
+ export declare const getCreateCustomerSingleUseCodesUrl: (tenantId: number) => string;
459
+ /**
460
+ * Mozaik staff add a batch of codes, each admitting one registration.
461
+ * @summary Create Customer Single Use Codes
462
+ */
463
+ export declare const createCustomerSingleUseCodes: (tenantId: number, customerSingleUseBatchWrite: CustomerSingleUseBatchWrite, options?: Parameters<typeof request>[1]) => Promise<CustomerSingleUseBatchRead>;
464
+ export declare const getCreateCustomerSingleUseCodesMutationKey: () => readonly ['createCustomerSingleUseCodes'];
465
+ export declare const getCreateCustomerSingleUseCodesMutationOptions: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
466
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof createCustomerSingleUseCodes>>, TError, CreateCustomerSingleUseCodesMutationVariables, TContext>;
467
+ request?: SecondParameter<typeof request>;
468
+ }) => UseMutationOptions<Awaited<ReturnType<typeof createCustomerSingleUseCodes>>, TError, CreateCustomerSingleUseCodesMutationVariables, TContext>;
469
+ export type CreateCustomerSingleUseCodesMutationResult = NonNullable<Awaited<ReturnType<typeof createCustomerSingleUseCodes>>>;
470
+ export type CreateCustomerSingleUseCodesMutationBody = BodyType<CustomerSingleUseBatchWrite>;
471
+ export type CreateCustomerSingleUseCodesMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>;
472
+ export type CreateCustomerSingleUseCodesMutationVariables = {
473
+ tenantId: number;
474
+ data: BodyType<CustomerSingleUseBatchWrite>;
475
+ };
476
+ /**
477
+ * @summary Create Customer Single Use Codes
478
+ */
479
+ export declare const useCreateCustomerSingleUseCodes: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
480
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof createCustomerSingleUseCodes>>, TError, CreateCustomerSingleUseCodesMutationVariables, TContext>;
481
+ request?: SecondParameter<typeof request>;
482
+ }, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof createCustomerSingleUseCodes>>, TError, CreateCustomerSingleUseCodesMutationVariables, TContext>;
302
483
  export declare const getConfigureCustomerActivationUrl: (tenantId: number) => string;
303
484
  /**
304
485
  * Mozaik staff set registration quota/expiry; customers cannot refill their own budget.
@@ -324,6 +505,81 @@ export declare const useConfigureCustomerActivation: <TError = ErrorType<HTTPExc
324
505
  mutation?: UseMutationOptions<Awaited<ReturnType<typeof configureCustomerActivation>>, TError, ConfigureCustomerActivationMutationVariables, TContext>;
325
506
  request?: SecondParameter<typeof request>;
326
507
  }, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof configureCustomerActivation>>, TError, ConfigureCustomerActivationMutationVariables, TContext>;
508
+ export declare const getPlanCustomerCalendarStepUrl: (tenantId: number) => string;
509
+ /**
510
+ * Add a step to the communication plan Mozaik writes for one customer.
511
+ * @summary Plan Customer Calendar Step
512
+ */
513
+ export declare const planCustomerCalendarStep: (tenantId: number, staffCalendarEventWrite: StaffCalendarEventWrite, options?: Parameters<typeof request>[1]) => Promise<CalendarEventRead>;
514
+ export declare const getPlanCustomerCalendarStepMutationKey: () => readonly ['planCustomerCalendarStep'];
515
+ export declare const getPlanCustomerCalendarStepMutationOptions: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
516
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof planCustomerCalendarStep>>, TError, PlanCustomerCalendarStepMutationVariables, TContext>;
517
+ request?: SecondParameter<typeof request>;
518
+ }) => UseMutationOptions<Awaited<ReturnType<typeof planCustomerCalendarStep>>, TError, PlanCustomerCalendarStepMutationVariables, TContext>;
519
+ export type PlanCustomerCalendarStepMutationResult = NonNullable<Awaited<ReturnType<typeof planCustomerCalendarStep>>>;
520
+ export type PlanCustomerCalendarStepMutationBody = BodyType<StaffCalendarEventWrite>;
521
+ export type PlanCustomerCalendarStepMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>;
522
+ export type PlanCustomerCalendarStepMutationVariables = {
523
+ tenantId: number;
524
+ data: BodyType<StaffCalendarEventWrite>;
525
+ };
526
+ /**
527
+ * @summary Plan Customer Calendar Step
528
+ */
529
+ export declare const usePlanCustomerCalendarStep: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
530
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof planCustomerCalendarStep>>, TError, PlanCustomerCalendarStepMutationVariables, TContext>;
531
+ request?: SecondParameter<typeof request>;
532
+ }, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof planCustomerCalendarStep>>, TError, PlanCustomerCalendarStepMutationVariables, TContext>;
533
+ export declare const getRemoveCustomerCalendarStepUrl: (tenantId: number, eventId: number) => string;
534
+ /**
535
+ * Withdraw a step of the plan Mozaik wrote for one customer.
536
+ * @summary Remove Customer Calendar Step
537
+ */
538
+ export declare const removeCustomerCalendarStep: (tenantId: number, eventId: number, options?: Parameters<typeof request>[1]) => Promise<void>;
539
+ export declare const getRemoveCustomerCalendarStepMutationKey: () => readonly ['removeCustomerCalendarStep'];
540
+ export declare const getRemoveCustomerCalendarStepMutationOptions: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
541
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof removeCustomerCalendarStep>>, TError, RemoveCustomerCalendarStepMutationVariables, TContext>;
542
+ request?: SecondParameter<typeof request>;
543
+ }) => UseMutationOptions<Awaited<ReturnType<typeof removeCustomerCalendarStep>>, TError, RemoveCustomerCalendarStepMutationVariables, TContext>;
544
+ export type RemoveCustomerCalendarStepMutationResult = NonNullable<Awaited<ReturnType<typeof removeCustomerCalendarStep>>>;
545
+ export type RemoveCustomerCalendarStepMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>;
546
+ export type RemoveCustomerCalendarStepMutationVariables = {
547
+ tenantId: number;
548
+ eventId: number;
549
+ };
550
+ /**
551
+ * @summary Remove Customer Calendar Step
552
+ */
553
+ export declare const useRemoveCustomerCalendarStep: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
554
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof removeCustomerCalendarStep>>, TError, RemoveCustomerCalendarStepMutationVariables, TContext>;
555
+ request?: SecondParameter<typeof request>;
556
+ }, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof removeCustomerCalendarStep>>, TError, RemoveCustomerCalendarStepMutationVariables, TContext>;
557
+ export declare const getChangeCustomerCalendarStepUrl: (tenantId: number, eventId: number) => string;
558
+ /**
559
+ * Change a step of the plan. The customer's own internal events are not staff's to change (404).
560
+ * @summary Change Customer Calendar Step
561
+ */
562
+ export declare const changeCustomerCalendarStep: (tenantId: number, eventId: number, staffCalendarEventWrite: StaffCalendarEventWrite, options?: Parameters<typeof request>[1]) => Promise<CalendarEventRead>;
563
+ export declare const getChangeCustomerCalendarStepMutationKey: () => readonly ['changeCustomerCalendarStep'];
564
+ export declare const getChangeCustomerCalendarStepMutationOptions: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
565
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof changeCustomerCalendarStep>>, TError, ChangeCustomerCalendarStepMutationVariables, TContext>;
566
+ request?: SecondParameter<typeof request>;
567
+ }) => UseMutationOptions<Awaited<ReturnType<typeof changeCustomerCalendarStep>>, TError, ChangeCustomerCalendarStepMutationVariables, TContext>;
568
+ export type ChangeCustomerCalendarStepMutationResult = NonNullable<Awaited<ReturnType<typeof changeCustomerCalendarStep>>>;
569
+ export type ChangeCustomerCalendarStepMutationBody = BodyType<StaffCalendarEventWrite>;
570
+ export type ChangeCustomerCalendarStepMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>;
571
+ export type ChangeCustomerCalendarStepMutationVariables = {
572
+ tenantId: number;
573
+ eventId: number;
574
+ data: BodyType<StaffCalendarEventWrite>;
575
+ };
576
+ /**
577
+ * @summary Change Customer Calendar Step
578
+ */
579
+ export declare const useChangeCustomerCalendarStep: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
580
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof changeCustomerCalendarStep>>, TError, ChangeCustomerCalendarStepMutationVariables, TContext>;
581
+ request?: SecondParameter<typeof request>;
582
+ }, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof changeCustomerCalendarStep>>, TError, ChangeCustomerCalendarStepMutationVariables, TContext>;
327
583
  export declare const getConfigureCustomerHelpUrl: (tenantId: number) => string;
328
584
  /**
329
585
  * @summary Configure Customer Help