@learnorama/mozaik-sdk 0.1.0

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 (208) hide show
  1. package/README.md +94 -0
  2. package/dist/api/account.d.ts +75 -0
  3. package/dist/api/account.js +117 -0
  4. package/dist/api/account.js.map +1 -0
  5. package/dist/api/admin-catalogue.d.ts +68 -0
  6. package/dist/api/admin-catalogue.js +155 -0
  7. package/dist/api/admin-catalogue.js.map +1 -0
  8. package/dist/api/admin-consumption.d.ts +27 -0
  9. package/dist/api/admin-consumption.js +55 -0
  10. package/dist/api/admin-consumption.js.map +1 -0
  11. package/dist/api/admin-licenses.d.ts +21 -0
  12. package/dist/api/admin-licenses.js +34 -0
  13. package/dist/api/admin-licenses.js.map +1 -0
  14. package/dist/api/admin-patrons.d.ts +36 -0
  15. package/dist/api/admin-patrons.js +76 -0
  16. package/dist/api/admin-patrons.js.map +1 -0
  17. package/dist/api/admin-reviews.d.ts +30 -0
  18. package/dist/api/admin-reviews.js +63 -0
  19. package/dist/api/admin-reviews.js.map +1 -0
  20. package/dist/api/admin-roles.d.ts +34 -0
  21. package/dist/api/admin-roles.js +62 -0
  22. package/dist/api/admin-roles.js.map +1 -0
  23. package/dist/api/admin-support.d.ts +68 -0
  24. package/dist/api/admin-support.js +116 -0
  25. package/dist/api/admin-support.js.map +1 -0
  26. package/dist/api/admin-tenants.d.ts +33 -0
  27. package/dist/api/admin-tenants.js +68 -0
  28. package/dist/api/admin-tenants.js.map +1 -0
  29. package/dist/api/admin-tutoring.d.ts +159 -0
  30. package/dist/api/admin-tutoring.js +455 -0
  31. package/dist/api/admin-tutoring.js.map +1 -0
  32. package/dist/api/auth.d.ts +92 -0
  33. package/dist/api/auth.js +192 -0
  34. package/dist/api/auth.js.map +1 -0
  35. package/dist/api/biblio-catalogue.d.ts +122 -0
  36. package/dist/api/biblio-catalogue.js +223 -0
  37. package/dist/api/biblio-catalogue.js.map +1 -0
  38. package/dist/api/biblio-home.d.ts +18 -0
  39. package/dist/api/biblio-home.js +31 -0
  40. package/dist/api/biblio-home.js.map +1 -0
  41. package/dist/api/biblio-library.d.ts +94 -0
  42. package/dist/api/biblio-library.js +187 -0
  43. package/dist/api/biblio-library.js.map +1 -0
  44. package/dist/api/biblio-nextory.d.ts +43 -0
  45. package/dist/api/biblio-nextory.js +65 -0
  46. package/dist/api/biblio-nextory.js.map +1 -0
  47. package/dist/api/biblio-press.d.ts +38 -0
  48. package/dist/api/biblio-press.js +70 -0
  49. package/dist/api/biblio-press.js.map +1 -0
  50. package/dist/api/biblio-search.d.ts +17 -0
  51. package/dist/api/biblio-search.js +30 -0
  52. package/dist/api/biblio-search.js.map +1 -0
  53. package/dist/api/biblio-telemetry.d.ts +28 -0
  54. package/dist/api/biblio-telemetry.js +49 -0
  55. package/dist/api/biblio-telemetry.js.map +1 -0
  56. package/dist/api/consumption.d.ts +30 -0
  57. package/dist/api/consumption.js +45 -0
  58. package/dist/api/consumption.js.map +1 -0
  59. package/dist/api/cvs-app.d.ts +39 -0
  60. package/dist/api/cvs-app.js +72 -0
  61. package/dist/api/cvs-app.js.map +1 -0
  62. package/dist/api/cvs-documents.d.ts +106 -0
  63. package/dist/api/cvs-documents.js +208 -0
  64. package/dist/api/cvs-documents.js.map +1 -0
  65. package/dist/api/cvs-favorites.d.ts +53 -0
  66. package/dist/api/cvs-favorites.js +82 -0
  67. package/dist/api/cvs-favorites.js.map +1 -0
  68. package/dist/api/cvs-loans.d.ts +59 -0
  69. package/dist/api/cvs-loans.js +106 -0
  70. package/dist/api/cvs-loans.js.map +1 -0
  71. package/dist/api/cvs-streaming.d.ts +40 -0
  72. package/dist/api/cvs-streaming.js +68 -0
  73. package/dist/api/cvs-streaming.js.map +1 -0
  74. package/dist/api/index.d.ts +34 -0
  75. package/dist/api/index.js +34 -0
  76. package/dist/api/partner-catalogue.d.ts +77 -0
  77. package/dist/api/partner-catalogue.js +125 -0
  78. package/dist/api/partner-catalogue.js.map +1 -0
  79. package/dist/api/partner-reader.d.ts +56 -0
  80. package/dist/api/partner-reader.js +103 -0
  81. package/dist/api/partner-reader.js.map +1 -0
  82. package/dist/api/profiles.d.ts +64 -0
  83. package/dist/api/profiles.js +126 -0
  84. package/dist/api/profiles.js.map +1 -0
  85. package/dist/api/tutoring-catalogue.d.ts +32 -0
  86. package/dist/api/tutoring-catalogue.js +59 -0
  87. package/dist/api/tutoring-catalogue.js.map +1 -0
  88. package/dist/api/tutoring-chat.d.ts +31 -0
  89. package/dist/api/tutoring-chat.js +71 -0
  90. package/dist/api/tutoring-chat.js.map +1 -0
  91. package/dist/api/tutoring-dispatch.d.ts +37 -0
  92. package/dist/api/tutoring-dispatch.js +83 -0
  93. package/dist/api/tutoring-dispatch.js.map +1 -0
  94. package/dist/api/tutoring-practitioner.d.ts +55 -0
  95. package/dist/api/tutoring-practitioner.js +110 -0
  96. package/dist/api/tutoring-practitioner.js.map +1 -0
  97. package/dist/api/tutoring-requests.d.ts +86 -0
  98. package/dist/api/tutoring-requests.js +176 -0
  99. package/dist/api/tutoring-requests.js.map +1 -0
  100. package/dist/client-BDwBZYB0.d.ts +28 -0
  101. package/dist/client-D3kMOcIr.js +61 -0
  102. package/dist/client-D3kMOcIr.js.map +1 -0
  103. package/dist/index-wL_20vR8.d.ts +4566 -0
  104. package/dist/index.d.ts +9 -0
  105. package/dist/index.js +10 -0
  106. package/dist/index.js.map +1 -0
  107. package/dist/models.d.ts +3 -0
  108. package/dist/models.js +175 -0
  109. package/dist/models.js.map +1 -0
  110. package/dist/react/account.d.ts +163 -0
  111. package/dist/react/account.js +240 -0
  112. package/dist/react/account.js.map +1 -0
  113. package/dist/react/admin-catalogue.d.ts +196 -0
  114. package/dist/react/admin-catalogue.js +336 -0
  115. package/dist/react/admin-catalogue.js.map +1 -0
  116. package/dist/react/admin-consumption.d.ts +75 -0
  117. package/dist/react/admin-consumption.js +127 -0
  118. package/dist/react/admin-consumption.js.map +1 -0
  119. package/dist/react/admin-licenses.d.ts +50 -0
  120. package/dist/react/admin-licenses.js +78 -0
  121. package/dist/react/admin-licenses.js.map +1 -0
  122. package/dist/react/admin-patrons.d.ts +111 -0
  123. package/dist/react/admin-patrons.js +173 -0
  124. package/dist/react/admin-patrons.js.map +1 -0
  125. package/dist/react/admin-reviews.d.ts +78 -0
  126. package/dist/react/admin-reviews.js +135 -0
  127. package/dist/react/admin-reviews.js.map +1 -0
  128. package/dist/react/admin-roles.d.ts +82 -0
  129. package/dist/react/admin-roles.js +135 -0
  130. package/dist/react/admin-roles.js.map +1 -0
  131. package/dist/react/admin-support.d.ts +123 -0
  132. package/dist/react/admin-support.js +208 -0
  133. package/dist/react/admin-support.js.map +1 -0
  134. package/dist/react/admin-tenants.d.ts +108 -0
  135. package/dist/react/admin-tenants.js +165 -0
  136. package/dist/react/admin-tenants.js.map +1 -0
  137. package/dist/react/admin-tutoring.d.ts +556 -0
  138. package/dist/react/admin-tutoring.js +954 -0
  139. package/dist/react/admin-tutoring.js.map +1 -0
  140. package/dist/react/auth.d.ts +220 -0
  141. package/dist/react/auth.js +372 -0
  142. package/dist/react/auth.js.map +1 -0
  143. package/dist/react/biblio-catalogue.d.ts +374 -0
  144. package/dist/react/biblio-catalogue.js +498 -0
  145. package/dist/react/biblio-catalogue.js.map +1 -0
  146. package/dist/react/biblio-home.d.ts +47 -0
  147. package/dist/react/biblio-home.js +75 -0
  148. package/dist/react/biblio-home.js.map +1 -0
  149. package/dist/react/biblio-library.d.ts +285 -0
  150. package/dist/react/biblio-library.js +411 -0
  151. package/dist/react/biblio-library.js.map +1 -0
  152. package/dist/react/biblio-nextory.d.ts +100 -0
  153. package/dist/react/biblio-nextory.js +163 -0
  154. package/dist/react/biblio-nextory.js.map +1 -0
  155. package/dist/react/biblio-press.d.ts +121 -0
  156. package/dist/react/biblio-press.js +163 -0
  157. package/dist/react/biblio-press.js.map +1 -0
  158. package/dist/react/biblio-search.d.ts +46 -0
  159. package/dist/react/biblio-search.js +74 -0
  160. package/dist/react/biblio-search.js.map +1 -0
  161. package/dist/react/biblio-telemetry.d.ts +49 -0
  162. package/dist/react/biblio-telemetry.js +85 -0
  163. package/dist/react/biblio-telemetry.js.map +1 -0
  164. package/dist/react/consumption.d.ts +66 -0
  165. package/dist/react/consumption.js +109 -0
  166. package/dist/react/consumption.js.map +1 -0
  167. package/dist/react/cvs-app.d.ts +86 -0
  168. package/dist/react/cvs-app.js +144 -0
  169. package/dist/react/cvs-app.js.map +1 -0
  170. package/dist/react/cvs-documents.d.ts +254 -0
  171. package/dist/react/cvs-documents.js +418 -0
  172. package/dist/react/cvs-documents.js.map +1 -0
  173. package/dist/react/cvs-favorites.d.ts +143 -0
  174. package/dist/react/cvs-favorites.js +206 -0
  175. package/dist/react/cvs-favorites.js.map +1 -0
  176. package/dist/react/cvs-loans.d.ts +140 -0
  177. package/dist/react/cvs-loans.js +234 -0
  178. package/dist/react/cvs-loans.js.map +1 -0
  179. package/dist/react/cvs-streaming.d.ts +87 -0
  180. package/dist/react/cvs-streaming.js +141 -0
  181. package/dist/react/cvs-streaming.js.map +1 -0
  182. package/dist/react/index.d.ts +34 -0
  183. package/dist/react/index.js +34 -0
  184. package/dist/react/partner-catalogue.d.ts +223 -0
  185. package/dist/react/partner-catalogue.js +301 -0
  186. package/dist/react/partner-catalogue.js.map +1 -0
  187. package/dist/react/partner-reader.d.ts +159 -0
  188. package/dist/react/partner-reader.js +226 -0
  189. package/dist/react/partner-reader.js.map +1 -0
  190. package/dist/react/profiles.d.ts +174 -0
  191. package/dist/react/profiles.js +279 -0
  192. package/dist/react/profiles.js.map +1 -0
  193. package/dist/react/tutoring-catalogue.d.ts +115 -0
  194. package/dist/react/tutoring-catalogue.js +151 -0
  195. package/dist/react/tutoring-catalogue.js.map +1 -0
  196. package/dist/react/tutoring-chat.d.ts +96 -0
  197. package/dist/react/tutoring-chat.js +172 -0
  198. package/dist/react/tutoring-chat.js.map +1 -0
  199. package/dist/react/tutoring-dispatch.d.ts +102 -0
  200. package/dist/react/tutoring-dispatch.js +183 -0
  201. package/dist/react/tutoring-dispatch.js.map +1 -0
  202. package/dist/react/tutoring-practitioner.d.ts +129 -0
  203. package/dist/react/tutoring-practitioner.js +230 -0
  204. package/dist/react/tutoring-practitioner.js.map +1 -0
  205. package/dist/react/tutoring-requests.d.ts +233 -0
  206. package/dist/react/tutoring-requests.js +385 -0
  207. package/dist/react/tutoring-requests.js.map +1 -0
  208. package/package.json +58 -0
@@ -0,0 +1,34 @@
1
+
2
+ import { r as request } from "../client-D3kMOcIr.js";
3
+ //#region src/api/admin-licenses/admin-licenses.ts
4
+ const getReadPatronLicenseUrl = (params) => {
5
+ const normalizedParams = new URLSearchParams();
6
+ Object.entries(params || {}).forEach(([key, value]) => {
7
+ if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
8
+ });
9
+ const stringifiedParams = normalizedParams.toString();
10
+ return stringifiedParams.length > 0 ? `/admin/nextory-licenses?${stringifiedParams}` : `/admin/nextory-licenses`;
11
+ };
12
+ /**
13
+ * Report one account's licence state. Never allocates, never repairs.
14
+ *
15
+ * Scoped like every other staff read: an agent who cannot see the account gets
16
+ * ``404``, the same answer as for an address nobody holds, so the endpoint
17
+ * cannot be used to test whether a member exists elsewhere.
18
+ *
19
+ * ``partner_active`` is ``None`` when the partner could not be reached. That is
20
+ * deliberately distinct from ``False`` — "we could not ask" and "they said the
21
+ * subscription is closed" lead a support agent to different actions, and
22
+ * collapsing them is how a working account gets re-provisioned.
23
+ * @summary Read Patron License
24
+ */
25
+ const readPatronLicense = async (params, options) => {
26
+ return request(getReadPatronLicenseUrl(params), {
27
+ ...options,
28
+ method: "GET"
29
+ });
30
+ };
31
+ //#endregion
32
+ export { getReadPatronLicenseUrl, readPatronLicense };
33
+
34
+ //# sourceMappingURL=admin-licenses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin-licenses.js","names":[],"sources":["../../src/api/admin-licenses/admin-licenses.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.1.0\n */\nimport type {\n ReadPatronLicenseParams,\n StaffLicenseRead\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getReadPatronLicenseUrl = (params: ReadPatronLicenseParams,) => {\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/nextory-licenses?${stringifiedParams}` : `/admin/nextory-licenses`\n}\n\n/**\n * Report one account's licence state. Never allocates, never repairs.\n *\n * Scoped like every other staff read: an agent who cannot see the account gets\n * ``404``, the same answer as for an address nobody holds, so the endpoint\n * cannot be used to test whether a member exists elsewhere.\n *\n * ``partner_active`` is ``None`` when the partner could not be reached. That is\n * deliberately distinct from ``False`` — \"we could not ask\" and \"they said the\n * subscription is closed\" lead a support agent to different actions, and\n * collapsing them is how a working account gets re-provisioned.\n * @summary Read Patron License\n */\nexport const readPatronLicense = async (params: ReadPatronLicenseParams, options?: Parameters<typeof request>[1]): Promise<StaffLicenseRead> => {\n\n return request<StaffLicenseRead>(getReadPatronLicenseUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n"],"mappings":";;;AAcA,MAAa,2BAA2B,WAAqC;CAC3E,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,2BAA2B,sBAAsB;AACzF;;;;;;;;;;;;;;AAeA,MAAa,oBAAoB,OAAO,QAAiC,YAAuE;CAE9I,OAAO,QAA0B,wBAAwB,MAAM,GAC/D;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE"}
@@ -0,0 +1,36 @@
1
+
2
+ import { Ft as PatronDetailRead, Mt as PatronUpdateWrite, Nt as PatronPage, pn as ListPatronsParams } from "../index-wL_20vR8.js";
3
+ import { c as request } from "../client-BDwBZYB0.js";
4
+ //#region src/api/admin-patrons/admin-patrons.d.ts
5
+ export declare const getListPatronsUrl: (params?: ListPatronsParams) => string;
6
+ /**
7
+ * Patrons of the libraries this caller administers.
8
+ *
9
+ * ``q`` matches login, name and email with a prefix-friendly ``ILIKE``.
10
+ * Deliberately not a full-text search: an operator looking somebody up has a
11
+ * surname or a card number, and ranking would only make the exact match harder
12
+ * to find.
13
+ * @summary List Patrons
14
+ */
15
+ export declare const listPatrons: (params?: ListPatronsParams, options?: Parameters<typeof request>[1]) => Promise<PatronPage>;
16
+ export declare const getReadPatronUrl: (patronId: number) => string;
17
+ /**
18
+ * One patron, including the email the listing withholds.
19
+ * @summary Read Patron
20
+ */
21
+ export declare const readPatron: (patronId: number, options?: Parameters<typeof request>[1]) => Promise<PatronDetailRead>;
22
+ export declare const getUpdatePatronUrl: (patronId: number) => string;
23
+ /**
24
+ * Change what staff may change about a patron.
25
+ *
26
+ * Audited, because these are the changes somebody may have to account for:
27
+ * suspending an account, raising an access level, extending a subscription past
28
+ * what was paid for. The legacy records none of them.
29
+ *
30
+ * Nothing here can move a patron between tenants — see
31
+ * :class:`~app.datamodels.admin.patrons.PatronUpdateWrite`.
32
+ * @summary Update Patron
33
+ */
34
+ export declare const updatePatron: (patronId: number, patronUpdateWrite: PatronUpdateWrite, options?: Parameters<typeof request>[1]) => Promise<PatronDetailRead>;
35
+ //#endregion
36
+ //# sourceMappingURL=admin-patrons.d.ts.map
@@ -0,0 +1,76 @@
1
+
2
+ import { r as request } from "../client-D3kMOcIr.js";
3
+ //#region src/api/admin-patrons/admin-patrons.ts
4
+ const getListPatronsUrl = (params) => {
5
+ const normalizedParams = new URLSearchParams();
6
+ Object.entries(params || {}).forEach(([key, value]) => {
7
+ if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
8
+ });
9
+ const stringifiedParams = normalizedParams.toString();
10
+ return stringifiedParams.length > 0 ? `/admin/patrons?${stringifiedParams}` : `/admin/patrons`;
11
+ };
12
+ /**
13
+ * Patrons of the libraries this caller administers.
14
+ *
15
+ * ``q`` matches login, name and email with a prefix-friendly ``ILIKE``.
16
+ * Deliberately not a full-text search: an operator looking somebody up has a
17
+ * surname or a card number, and ranking would only make the exact match harder
18
+ * to find.
19
+ * @summary List Patrons
20
+ */
21
+ const listPatrons = async (params, options) => {
22
+ return request(getListPatronsUrl(params), {
23
+ ...options,
24
+ method: "GET"
25
+ });
26
+ };
27
+ const getReadPatronUrl = (patronId) => {
28
+ return `/admin/patrons/${patronId}`;
29
+ };
30
+ /**
31
+ * One patron, including the email the listing withholds.
32
+ * @summary Read Patron
33
+ */
34
+ const readPatron = async (patronId, options) => {
35
+ return request(getReadPatronUrl(patronId), {
36
+ ...options,
37
+ method: "GET"
38
+ });
39
+ };
40
+ const getUpdatePatronUrl = (patronId) => {
41
+ return `/admin/patrons/${patronId}`;
42
+ };
43
+ /**
44
+ * Change what staff may change about a patron.
45
+ *
46
+ * Audited, because these are the changes somebody may have to account for:
47
+ * suspending an account, raising an access level, extending a subscription past
48
+ * what was paid for. The legacy records none of them.
49
+ *
50
+ * Nothing here can move a patron between tenants — see
51
+ * :class:`~app.datamodels.admin.patrons.PatronUpdateWrite`.
52
+ * @summary Update Patron
53
+ */
54
+ const updatePatron = async (patronId, patronUpdateWrite, options) => {
55
+ const getHeaders = (h) => {
56
+ if (!h) return {};
57
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
58
+ if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
59
+ const headers = {};
60
+ for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
61
+ return headers;
62
+ };
63
+ return request(getUpdatePatronUrl(patronId), {
64
+ ...options,
65
+ method: "PATCH",
66
+ headers: {
67
+ "Content-Type": "application/json",
68
+ ...getHeaders(options?.headers)
69
+ },
70
+ body: JSON.stringify(patronUpdateWrite)
71
+ });
72
+ };
73
+ //#endregion
74
+ export { getListPatronsUrl, getReadPatronUrl, getUpdatePatronUrl, listPatrons, readPatron, updatePatron };
75
+
76
+ //# sourceMappingURL=admin-patrons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin-patrons.js","names":[],"sources":["../../src/api/admin-patrons/admin-patrons.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.1.0\n */\nimport type {\n ListPatronsParams,\n PatronDetailRead,\n PatronPage,\n PatronUpdateWrite\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getListPatronsUrl = (params?: ListPatronsParams,) => {\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/patrons?${stringifiedParams}` : `/admin/patrons`\n}\n\n/**\n * Patrons of the libraries this caller administers.\n *\n * ``q`` matches login, name and email with a prefix-friendly ``ILIKE``.\n * Deliberately not a full-text search: an operator looking somebody up has a\n * surname or a card number, and ranking would only make the exact match harder\n * to find.\n * @summary List Patrons\n */\nexport const listPatrons = async (params?: ListPatronsParams, options?: Parameters<typeof request>[1]): Promise<PatronPage> => {\n\n return request<PatronPage>(getListPatronsUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getReadPatronUrl = (patronId: number,) => {\n\n\n\n\n return `/admin/patrons/${patronId}`\n}\n\n/**\n * One patron, including the email the listing withholds.\n * @summary Read Patron\n */\nexport const readPatron = async (patronId: number, options?: Parameters<typeof request>[1]): Promise<PatronDetailRead> => {\n\n return request<PatronDetailRead>(getReadPatronUrl(patronId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getUpdatePatronUrl = (patronId: number,) => {\n\n\n\n\n return `/admin/patrons/${patronId}`\n}\n\n/**\n * Change what staff may change about a patron.\n *\n * Audited, because these are the changes somebody may have to account for:\n * suspending an account, raising an access level, extending a subscription past\n * what was paid for. The legacy records none of them.\n *\n * Nothing here can move a patron between tenants — see\n * :class:`~app.datamodels.admin.patrons.PatronUpdateWrite`.\n * @summary Update Patron\n */\nexport const updatePatron = async (patronId: number,\n patronUpdateWrite: PatronUpdateWrite, options?: Parameters<typeof request>[1]): Promise<PatronDetailRead> => {\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<PatronDetailRead>(getUpdatePatronUrl(patronId),\n {\n ...options,\n method: 'PATCH',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(patronUpdateWrite)\n }\n);}\n\n\n"],"mappings":";;;AAgBA,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;;;;;;;;;;AAWA,MAAa,cAAc,OAAO,QAA4B,YAAiE;CAE7H,OAAO,QAAoB,kBAAkB,MAAM,GACnD;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,oBAAoB,aAAsB;CAKrD,OAAO,kBAAkB;AAC3B;;;;;AAMA,MAAa,aAAa,OAAO,UAAkB,YAAuE;CAExH,OAAO,QAA0B,iBAAiB,QAAQ,GAC1D;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,sBAAsB,aAAsB;CAKvD,OAAO,kBAAkB;AAC3B;;;;;;;;;;;;AAaA,MAAa,eAAe,OAAO,UAC/B,mBAAsC,YAAuE;CAE7G,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,QAA0B,mBAAmB,QAAQ,GAC1D;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,iBAAiB;CACxC,CACF;AAAE"}
@@ -0,0 +1,30 @@
1
+
2
+ import { J as ReviewModerationRead, Jt as ModerationWrite, cn as ListReviewsParams, q as ReviewPage } from "../index-wL_20vR8.js";
3
+ import { c as request } from "../client-BDwBZYB0.js";
4
+ //#region src/api/admin-reviews/admin-reviews.d.ts
5
+ export declare const getListReviewsUrl: (params?: ListReviewsParams) => string;
6
+ /**
7
+ * Reviews awaiting a decision, oldest first.
8
+ *
9
+ * Oldest first on purpose: a moderation queue sorted newest-first starves its
10
+ * tail, and the review that has waited longest is the one whose author is
11
+ * wondering what happened.
12
+ * @summary List Reviews
13
+ */
14
+ export declare const listReviews: (params?: ListReviewsParams, options?: Parameters<typeof request>[1]) => Promise<ReviewPage>;
15
+ export declare const getModerateReviewUrl: (reviewId: number) => string;
16
+ /**
17
+ * Publish or reject one review.
18
+ *
19
+ * ``PUT`` on a moderation sub-resource rather than ``POST /approve`` and
20
+ * ``POST /reject``: the outcome is a state the review is *in*, not two different
21
+ * events, and a repeated decision must be harmless.
22
+ *
23
+ * Rejecting requires a reason. The author is owed one, and the moderator is the
24
+ * only person who has it — the audit row is where it survives after the queue
25
+ * has moved on.
26
+ * @summary Moderate Review
27
+ */
28
+ export declare const moderateReview: (reviewId: number, moderationWrite: ModerationWrite, options?: Parameters<typeof request>[1]) => Promise<ReviewModerationRead>;
29
+ //#endregion
30
+ //# sourceMappingURL=admin-reviews.d.ts.map
@@ -0,0 +1,63 @@
1
+
2
+ import { r as request } from "../client-D3kMOcIr.js";
3
+ //#region src/api/admin-reviews/admin-reviews.ts
4
+ const getListReviewsUrl = (params) => {
5
+ const normalizedParams = new URLSearchParams();
6
+ Object.entries(params || {}).forEach(([key, value]) => {
7
+ if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
8
+ });
9
+ const stringifiedParams = normalizedParams.toString();
10
+ return stringifiedParams.length > 0 ? `/admin/reviews?${stringifiedParams}` : `/admin/reviews`;
11
+ };
12
+ /**
13
+ * Reviews awaiting a decision, oldest first.
14
+ *
15
+ * Oldest first on purpose: a moderation queue sorted newest-first starves its
16
+ * tail, and the review that has waited longest is the one whose author is
17
+ * wondering what happened.
18
+ * @summary List Reviews
19
+ */
20
+ const listReviews = async (params, options) => {
21
+ return request(getListReviewsUrl(params), {
22
+ ...options,
23
+ method: "GET"
24
+ });
25
+ };
26
+ const getModerateReviewUrl = (reviewId) => {
27
+ return `/admin/reviews/${reviewId}/moderation`;
28
+ };
29
+ /**
30
+ * Publish or reject one review.
31
+ *
32
+ * ``PUT`` on a moderation sub-resource rather than ``POST /approve`` and
33
+ * ``POST /reject``: the outcome is a state the review is *in*, not two different
34
+ * events, and a repeated decision must be harmless.
35
+ *
36
+ * Rejecting requires a reason. The author is owed one, and the moderator is the
37
+ * only person who has it — the audit row is where it survives after the queue
38
+ * has moved on.
39
+ * @summary Moderate Review
40
+ */
41
+ const moderateReview = async (reviewId, moderationWrite, options) => {
42
+ const getHeaders = (h) => {
43
+ if (!h) return {};
44
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
45
+ if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
46
+ const headers = {};
47
+ for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
48
+ return headers;
49
+ };
50
+ return request(getModerateReviewUrl(reviewId), {
51
+ ...options,
52
+ method: "PUT",
53
+ headers: {
54
+ "Content-Type": "application/json",
55
+ ...getHeaders(options?.headers)
56
+ },
57
+ body: JSON.stringify(moderationWrite)
58
+ });
59
+ };
60
+ //#endregion
61
+ export { getListReviewsUrl, getModerateReviewUrl, listReviews, moderateReview };
62
+
63
+ //# sourceMappingURL=admin-reviews.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin-reviews.js","names":[],"sources":["../../src/api/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.1.0\n */\nimport type {\n ListReviewsParams,\n ModerationWrite,\n ReviewModerationRead,\n ReviewPage\n} from '../../models';\n\nimport { request } from '../../client';\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\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"],"mappings":";;;AAgBA,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;AAGF,MAAa,wBAAwB,aAAsB;CAKzD,OAAO,kBAAkB,SAAS;AACpC;;;;;;;;;;;;;AAcA,MAAa,iBAAiB,OAAO,UACjC,iBAAkC,YAA2E;CAE7G,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,QAA8B,qBAAqB,QAAQ,GAChE;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,eAAe;CACtC,CACF;AAAE"}
@@ -0,0 +1,34 @@
1
+
2
+ import { _t as ProductGrantWrite, vt as ProductGrantListRead } from "../index-wL_20vR8.js";
3
+ import { c as request } from "../client-BDwBZYB0.js";
4
+ //#region src/api/admin-roles/admin-roles.d.ts
5
+ export declare const getListGrantsUrl: (userId: number) => string;
6
+ /**
7
+ * Everything this account is, across products and organisations.
8
+ *
9
+ * Readable by SUPPORT as well as ADMIN: knowing what somebody is, is part of
10
+ * helping them. Changing it is not.
11
+ * @summary List Grants
12
+ */
13
+ export declare const listGrants: (userId: number, options?: Parameters<typeof request>[1]) => Promise<ProductGrantListRead>;
14
+ export declare const getReplaceGrantsUrl: (userId: number) => string;
15
+ /**
16
+ * Replace this account's roles for one product at one organisation.
17
+ *
18
+ * ``PUT`` because it is idempotent and the body is the whole desired state for
19
+ * that ``(tenant, product)`` slice — sending it twice leaves the same grants.
20
+ *
21
+ * Two scope checks, and both are needed. The *subject* must be an account the
22
+ * operator reaches, and the ``tenantId`` being granted at must be one they
23
+ * reach too: without the second, an operator could grant a remit at an
24
+ * organisation they have no authority over, which is how a scoped
25
+ * administrator becomes an unscoped one.
26
+ *
27
+ * ``422`` for a role the product does not recognise —
28
+ * :data:`~app.models.enums.PRODUCT_ROLES` decides, so ``student`` for biblio is
29
+ * refused rather than stored and puzzled over later.
30
+ * @summary Replace Grants
31
+ */
32
+ export declare const replaceGrants: (userId: number, productGrantWrite: ProductGrantWrite, options?: Parameters<typeof request>[1]) => Promise<ProductGrantListRead>;
33
+ //#endregion
34
+ //# sourceMappingURL=admin-roles.d.ts.map
@@ -0,0 +1,62 @@
1
+
2
+ import { r as request } from "../client-D3kMOcIr.js";
3
+ //#region src/api/admin-roles/admin-roles.ts
4
+ const getListGrantsUrl = (userId) => {
5
+ return `/admin/users/${userId}/product-roles`;
6
+ };
7
+ /**
8
+ * Everything this account is, across products and organisations.
9
+ *
10
+ * Readable by SUPPORT as well as ADMIN: knowing what somebody is, is part of
11
+ * helping them. Changing it is not.
12
+ * @summary List Grants
13
+ */
14
+ const listGrants = async (userId, options) => {
15
+ return request(getListGrantsUrl(userId), {
16
+ ...options,
17
+ method: "GET"
18
+ });
19
+ };
20
+ const getReplaceGrantsUrl = (userId) => {
21
+ return `/admin/users/${userId}/product-roles`;
22
+ };
23
+ /**
24
+ * Replace this account's roles for one product at one organisation.
25
+ *
26
+ * ``PUT`` because it is idempotent and the body is the whole desired state for
27
+ * that ``(tenant, product)`` slice — sending it twice leaves the same grants.
28
+ *
29
+ * Two scope checks, and both are needed. The *subject* must be an account the
30
+ * operator reaches, and the ``tenantId`` being granted at must be one they
31
+ * reach too: without the second, an operator could grant a remit at an
32
+ * organisation they have no authority over, which is how a scoped
33
+ * administrator becomes an unscoped one.
34
+ *
35
+ * ``422`` for a role the product does not recognise —
36
+ * :data:`~app.models.enums.PRODUCT_ROLES` decides, so ``student`` for biblio is
37
+ * refused rather than stored and puzzled over later.
38
+ * @summary Replace Grants
39
+ */
40
+ const replaceGrants = async (userId, productGrantWrite, options) => {
41
+ const getHeaders = (h) => {
42
+ if (!h) return {};
43
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
44
+ if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
45
+ const headers = {};
46
+ for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
47
+ return headers;
48
+ };
49
+ return request(getReplaceGrantsUrl(userId), {
50
+ ...options,
51
+ method: "PUT",
52
+ headers: {
53
+ "Content-Type": "application/json",
54
+ ...getHeaders(options?.headers)
55
+ },
56
+ body: JSON.stringify(productGrantWrite)
57
+ });
58
+ };
59
+ //#endregion
60
+ export { getListGrantsUrl, getReplaceGrantsUrl, listGrants, replaceGrants };
61
+
62
+ //# sourceMappingURL=admin-roles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin-roles.js","names":[],"sources":["../../src/api/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.1.0\n */\nimport type {\n ProductGrantListRead,\n ProductGrantWrite\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getListGrantsUrl = (userId: number,) => {\n\n\n\n\n return `/admin/users/${userId}/product-roles`\n}\n\n/**\n * Everything this account is, across products and organisations.\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\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"],"mappings":";;;AAcA,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;AAGF,MAAa,uBAAuB,WAAoB;CAKtD,OAAO,gBAAgB,OAAO;AAChC;;;;;;;;;;;;;;;;;;AAmBA,MAAa,gBAAgB,OAAO,QAChC,mBAAsC,YAA2E;CAEjH,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,QAA8B,oBAAoB,MAAM,GAC7D;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,iBAAiB;CACxC,CACF;AAAE"}
@@ -0,0 +1,68 @@
1
+
2
+ import { Cr as DemoUserWrite, Wn as ImpersonationWrite, j as SupportSessionRead, wr as DemoUserRead } from "../index-wL_20vR8.js";
3
+ import { c as request } from "../client-BDwBZYB0.js";
4
+ //#region src/api/admin-support/admin-support.d.ts
5
+ export declare const getCreateDemoUserUrl: () => string;
6
+ /**
7
+ * Create, or return, a demonstration account for an establishment (E57).
8
+ *
9
+ * ``RequireAdmin`` rather than ``RequireStaff``: this creates an account inside
10
+ * a customer's tenant, which is a change to what the customer has, not an
11
+ * assistance to one of their members.
12
+ *
13
+ * **The account has no password and cannot be signed into directly.** The
14
+ * legacy derived one from the establishment id alone — ``Etab{id padded}$``,
15
+ * at ``etab_{id}@ta.com`` — and then redirected into the impersonation route
16
+ * (defect D15). Anyone who noticed the pattern held a working credential for
17
+ * every establishment. Here the row is created without a credential and is
18
+ * reached through E56, which is audited.
19
+ *
20
+ * ``201`` when created, ``200`` when it already existed. Idempotent, because a
21
+ * salesperson clicking twice should not end up with two demo accounts.
22
+ * @summary Create Demo User
23
+ */
24
+ export declare const createDemoUser: (demoUserWrite: DemoUserWrite, options?: Parameters<typeof request>[1]) => Promise<DemoUserRead>;
25
+ export declare const getOpenSupportSessionUrl: () => string;
26
+ /**
27
+ * Open a support session acting as another account (E56).
28
+ *
29
+ * ``reason`` is mandatory and exists to be logged. A support action with no
30
+ * stated reason cannot be told apart from an abuse of the same endpoint.
31
+ *
32
+ * **This returns no tokens.** It used to: a Keycloak token-exchange session for
33
+ * the subject, on the reasoning that the platform should mint no credentials and
34
+ * that the subject's own assurance level would keep privileged operations out of
35
+ * reach. Both halves turned out to be wrong. The exchanged token carried no
36
+ * actor claim, so it was indistinguishable from the patron's own and the trail
37
+ * stopped at this row; and it carried no ``assurance`` claim either, which
38
+ * ``clamp_assurance`` reads as *unconstrained* — so the operator resolved to
39
+ * ``HIGH`` and could close the account, the single thing the design promised to
40
+ * prevent. Keycloak 26 also rejects the grant outright.
41
+ *
42
+ * So the operator keeps their own token and sends ``X-Acting-As`` with the id
43
+ * returned here. Nothing is minted, the authenticated identity stays the
44
+ * operator, and the session is clamped to the lowest assurance by
45
+ * :func:`app.core.security.acting_as` — which makes E14 and E17 unreachable
46
+ * through the guard that already exists rather than through a special case.
47
+ *
48
+ * Ending it early is ``DELETE /admin/impersonations/{id}``, which must be sent
49
+ * *without* the header: a support session holds no staff roles.
50
+ * @summary Open Support Session
51
+ */
52
+ export declare const openSupportSession: (impersonationWrite: ImpersonationWrite, options?: Parameters<typeof request>[1]) => Promise<SupportSessionRead>;
53
+ export declare const getCloseSupportSessionUrl: (supportSessionId: number) => string;
54
+ /**
55
+ * End a support session early. Idempotent.
56
+ *
57
+ * Must be called *without* ``X-Acting-As``: a session in progress carries no
58
+ * staff roles, so a request made through one cannot reach this endpoint. That
59
+ * is deliberate — the operator steps out before they can close it, and simply
60
+ * dropping the header ends the session's effect immediately either way.
61
+ *
62
+ * ``204`` whether or not the row was still open, and whether or not it was
63
+ * theirs. A support session id is a bare integer and must not be an oracle.
64
+ * @summary Close Support Session
65
+ */
66
+ export declare const closeSupportSession: (supportSessionId: number, options?: Parameters<typeof request>[1]) => Promise<void>;
67
+ //#endregion
68
+ //# sourceMappingURL=admin-support.d.ts.map
@@ -0,0 +1,116 @@
1
+
2
+ import { r as request } from "../client-D3kMOcIr.js";
3
+ //#region src/api/admin-support/admin-support.ts
4
+ const getCreateDemoUserUrl = () => {
5
+ return `/admin/demo-users`;
6
+ };
7
+ /**
8
+ * Create, or return, a demonstration account for an establishment (E57).
9
+ *
10
+ * ``RequireAdmin`` rather than ``RequireStaff``: this creates an account inside
11
+ * a customer's tenant, which is a change to what the customer has, not an
12
+ * assistance to one of their members.
13
+ *
14
+ * **The account has no password and cannot be signed into directly.** The
15
+ * legacy derived one from the establishment id alone — ``Etab{id padded}$``,
16
+ * at ``etab_{id}@ta.com`` — and then redirected into the impersonation route
17
+ * (defect D15). Anyone who noticed the pattern held a working credential for
18
+ * every establishment. Here the row is created without a credential and is
19
+ * reached through E56, which is audited.
20
+ *
21
+ * ``201`` when created, ``200`` when it already existed. Idempotent, because a
22
+ * salesperson clicking twice should not end up with two demo accounts.
23
+ * @summary Create Demo User
24
+ */
25
+ const createDemoUser = async (demoUserWrite, options) => {
26
+ const getHeaders = (h) => {
27
+ if (!h) return {};
28
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
29
+ if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
30
+ const headers = {};
31
+ for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
32
+ return headers;
33
+ };
34
+ return request(getCreateDemoUserUrl(), {
35
+ ...options,
36
+ method: "POST",
37
+ headers: {
38
+ "Content-Type": "application/json",
39
+ ...getHeaders(options?.headers)
40
+ },
41
+ body: JSON.stringify(demoUserWrite)
42
+ });
43
+ };
44
+ const getOpenSupportSessionUrl = () => {
45
+ return `/admin/impersonations`;
46
+ };
47
+ /**
48
+ * Open a support session acting as another account (E56).
49
+ *
50
+ * ``reason`` is mandatory and exists to be logged. A support action with no
51
+ * stated reason cannot be told apart from an abuse of the same endpoint.
52
+ *
53
+ * **This returns no tokens.** It used to: a Keycloak token-exchange session for
54
+ * the subject, on the reasoning that the platform should mint no credentials and
55
+ * that the subject's own assurance level would keep privileged operations out of
56
+ * reach. Both halves turned out to be wrong. The exchanged token carried no
57
+ * actor claim, so it was indistinguishable from the patron's own and the trail
58
+ * stopped at this row; and it carried no ``assurance`` claim either, which
59
+ * ``clamp_assurance`` reads as *unconstrained* — so the operator resolved to
60
+ * ``HIGH`` and could close the account, the single thing the design promised to
61
+ * prevent. Keycloak 26 also rejects the grant outright.
62
+ *
63
+ * So the operator keeps their own token and sends ``X-Acting-As`` with the id
64
+ * returned here. Nothing is minted, the authenticated identity stays the
65
+ * operator, and the session is clamped to the lowest assurance by
66
+ * :func:`app.core.security.acting_as` — which makes E14 and E17 unreachable
67
+ * through the guard that already exists rather than through a special case.
68
+ *
69
+ * Ending it early is ``DELETE /admin/impersonations/{id}``, which must be sent
70
+ * *without* the header: a support session holds no staff roles.
71
+ * @summary Open Support Session
72
+ */
73
+ const openSupportSession = async (impersonationWrite, options) => {
74
+ const getHeaders = (h) => {
75
+ if (!h) return {};
76
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
77
+ if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
78
+ const headers = {};
79
+ for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
80
+ return headers;
81
+ };
82
+ return request(getOpenSupportSessionUrl(), {
83
+ ...options,
84
+ method: "POST",
85
+ headers: {
86
+ "Content-Type": "application/json",
87
+ ...getHeaders(options?.headers)
88
+ },
89
+ body: JSON.stringify(impersonationWrite)
90
+ });
91
+ };
92
+ const getCloseSupportSessionUrl = (supportSessionId) => {
93
+ return `/admin/impersonations/${supportSessionId}`;
94
+ };
95
+ /**
96
+ * End a support session early. Idempotent.
97
+ *
98
+ * Must be called *without* ``X-Acting-As``: a session in progress carries no
99
+ * staff roles, so a request made through one cannot reach this endpoint. That
100
+ * is deliberate — the operator steps out before they can close it, and simply
101
+ * dropping the header ends the session's effect immediately either way.
102
+ *
103
+ * ``204`` whether or not the row was still open, and whether or not it was
104
+ * theirs. A support session id is a bare integer and must not be an oracle.
105
+ * @summary Close Support Session
106
+ */
107
+ const closeSupportSession = async (supportSessionId, options) => {
108
+ return request(getCloseSupportSessionUrl(supportSessionId), {
109
+ ...options,
110
+ method: "DELETE"
111
+ });
112
+ };
113
+ //#endregion
114
+ export { closeSupportSession, createDemoUser, getCloseSupportSessionUrl, getCreateDemoUserUrl, getOpenSupportSessionUrl, openSupportSession };
115
+
116
+ //# sourceMappingURL=admin-support.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin-support.js","names":[],"sources":["../../src/api/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.1.0\n */\nimport type {\n DemoUserRead,\n DemoUserWrite,\n ImpersonationWrite,\n SupportSessionRead\n} from '../../models';\n\nimport { request } from '../../client';\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\nexport 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\nexport 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"],"mappings":";;;AAgBA,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;AAGF,MAAa,iCAAiC;CAK5C,OAAO;AACT;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAa,qBAAqB,OAAO,oBAAwC,YAAyE;CAEtJ,MAAM,cAAc,MAAwF;EAC5G,IAAI,CAAC,GAAG,OAAO,CAAC;EAChB,IAAI,aAAa,SAAS,OAAO,OAAO,YAAY,EAAE,QAAQ,CAAC;EAC/D,IAAI,OAAO,YAAY,GACrB,OAAO,OAAO,YACZ,MAAM,KAAK,IAAkC,UAAU,MAAM,KAAK,KAAK,CAAqB,CAC9F;EAEF,MAAM,UAAsD,CAAC;EAC7D,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAgD,CAAC,GAClF,IAAI,UAAU,KAAA,GAAW,QAAQ,QAAQ;EAE3C,OAAO;CACT;CACF,OAAO,QAA4B,yBAAyB,GAC1D;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,kBAAkB;CACzC,CACF;AAAE;AAGF,MAAa,6BAA6B,qBAA8B;CAKtE,OAAO,yBAAyB;AAClC;;;;;;;;;;;;;AAcA,MAAa,sBAAsB,OAAO,kBAA0B,YAA2D;CAE7H,OAAO,QAAc,0BAA0B,gBAAgB,GAC/D;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE"}
@@ -0,0 +1,33 @@
1
+
2
+ import { D as TenantSettingsUpdateWrite, k as TenantSettingsRead } from "../index-wL_20vR8.js";
3
+ import { c as request } from "../client-BDwBZYB0.js";
4
+ //#region src/api/admin-tenants/admin-tenants.d.ts
5
+ export declare const getListTenantsUrl: () => string;
6
+ /**
7
+ * The tenants this operator administers.
8
+ *
9
+ * For a library administrator that is one row, and returning a list of one is
10
+ * better than a bare object: the client renders the same picker whether it is
11
+ * talking to a library, a consortium or the vendor.
12
+ * @summary List Tenants
13
+ */
14
+ export declare const listTenants: (options?: Parameters<typeof request>[1]) => Promise<TenantSettingsRead[]>;
15
+ export declare const getReadTenantUrl: (tenantId: number) => string;
16
+ /**
17
+ * One tenant's configuration.
18
+ * @summary Read Tenant
19
+ */
20
+ export declare const readTenant: (tenantId: number, options?: Parameters<typeof request>[1]) => Promise<TenantSettingsRead>;
21
+ export declare const getUpdateTenantUrl: (tenantId: number) => string;
22
+ /**
23
+ * Change a tenant's configuration. Audited.
24
+ *
25
+ * The two membership flags are mutually exclusive and the database says so —
26
+ * ``ck_tenant_individual_accounts_exclusive``. Checked here too, because a
27
+ * constraint violation surfaces as a 500 and this is a 422: the operator sent
28
+ * something contradictory and can fix it.
29
+ * @summary Update Tenant
30
+ */
31
+ export declare const updateTenant: (tenantId: number, tenantSettingsUpdateWrite: TenantSettingsUpdateWrite, options?: Parameters<typeof request>[1]) => Promise<TenantSettingsRead>;
32
+ //#endregion
33
+ //# sourceMappingURL=admin-tenants.d.ts.map