@learnorama/mozaik-sdk 0.1.0-staging.13.1 → 0.3.2-staging.19.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 (197) hide show
  1. package/README.md +10 -7
  2. package/dist/api/account.d.ts +1 -1
  3. package/dist/api/account.js.map +1 -1
  4. package/dist/api/admin-catalogue.d.ts +1 -1
  5. package/dist/api/admin-catalogue.js.map +1 -1
  6. package/dist/api/admin-consumption.d.ts +6 -1
  7. package/dist/api/admin-consumption.js +5 -0
  8. package/dist/api/admin-consumption.js.map +1 -1
  9. package/dist/api/admin-licenses.d.ts +1 -1
  10. package/dist/api/admin-licenses.js.map +1 -1
  11. package/dist/api/admin-patrons.d.ts +2 -2
  12. package/dist/api/admin-patrons.js +1 -1
  13. package/dist/api/admin-patrons.js.map +1 -1
  14. package/dist/api/admin-reviews.d.ts +1 -1
  15. package/dist/api/admin-reviews.js.map +1 -1
  16. package/dist/api/admin-roles.d.ts +2 -2
  17. package/dist/api/admin-roles.js +1 -1
  18. package/dist/api/admin-roles.js.map +1 -1
  19. package/dist/api/admin-support.d.ts +1 -1
  20. package/dist/api/admin-support.js.map +1 -1
  21. package/dist/api/admin-tenants.d.ts +7 -1
  22. package/dist/api/admin-tenants.js +19 -1
  23. package/dist/api/admin-tenants.js.map +1 -1
  24. package/dist/api/admin-tutoring.d.ts +1 -1
  25. package/dist/api/admin-tutoring.js.map +1 -1
  26. package/dist/api/auth.d.ts +1 -1
  27. package/dist/api/auth.js.map +1 -1
  28. package/dist/api/biblio-catalogue.d.ts +1 -1
  29. package/dist/api/biblio-catalogue.js.map +1 -1
  30. package/dist/api/biblio-home.d.ts +1 -1
  31. package/dist/api/biblio-home.js.map +1 -1
  32. package/dist/api/biblio-library.d.ts +1 -1
  33. package/dist/api/biblio-library.js.map +1 -1
  34. package/dist/api/biblio-nextory.d.ts +1 -1
  35. package/dist/api/biblio-nextory.js.map +1 -1
  36. package/dist/api/biblio-press.d.ts +1 -1
  37. package/dist/api/biblio-press.js.map +1 -1
  38. package/dist/api/biblio-search.d.ts +1 -1
  39. package/dist/api/biblio-search.js.map +1 -1
  40. package/dist/api/biblio-telemetry.d.ts +1 -1
  41. package/dist/api/biblio-telemetry.js.map +1 -1
  42. package/dist/api/consumption.d.ts +1 -1
  43. package/dist/api/consumption.js.map +1 -1
  44. package/dist/api/cvs-app.d.ts +1 -1
  45. package/dist/api/cvs-app.js.map +1 -1
  46. package/dist/api/cvs-documents.d.ts +15 -3
  47. package/dist/api/cvs-documents.js +21 -4
  48. package/dist/api/cvs-documents.js.map +1 -1
  49. package/dist/api/cvs-favorites.d.ts +1 -1
  50. package/dist/api/cvs-favorites.js.map +1 -1
  51. package/dist/api/cvs-ils.d.ts +167 -0
  52. package/dist/api/cvs-ils.js +362 -0
  53. package/dist/api/cvs-ils.js.map +1 -0
  54. package/dist/api/cvs-loans.d.ts +1 -1
  55. package/dist/api/cvs-loans.js.map +1 -1
  56. package/dist/api/cvs-payments.d.ts +1 -1
  57. package/dist/api/cvs-payments.js.map +1 -1
  58. package/dist/api/cvs-streaming.d.ts +1 -1
  59. package/dist/api/cvs-streaming.js.map +1 -1
  60. package/dist/api/index.d.ts +4 -2
  61. package/dist/api/index.js +4 -2
  62. package/dist/api/partner-catalogue.d.ts +1 -1
  63. package/dist/api/partner-catalogue.js.map +1 -1
  64. package/dist/api/partner-reader.d.ts +1 -1
  65. package/dist/api/partner-reader.js.map +1 -1
  66. package/dist/api/profiles.d.ts +1 -1
  67. package/dist/api/profiles.js.map +1 -1
  68. package/dist/api/search.d.ts +18 -0
  69. package/dist/api/search.js +37 -0
  70. package/dist/api/search.js.map +1 -0
  71. package/dist/api/tutoring-catalogue.d.ts +1 -1
  72. package/dist/api/tutoring-catalogue.js.map +1 -1
  73. package/dist/api/tutoring-chat.d.ts +1 -1
  74. package/dist/api/tutoring-chat.js.map +1 -1
  75. package/dist/api/tutoring-dispatch.d.ts +1 -1
  76. package/dist/api/tutoring-dispatch.js.map +1 -1
  77. package/dist/api/tutoring-practitioner.js.map +1 -1
  78. package/dist/api/tutoring-requests.d.ts +1 -1
  79. package/dist/api/tutoring-requests.js.map +1 -1
  80. package/dist/chunks/client2.d.ts +1 -1
  81. package/dist/chunks/connection.d.ts +1 -1
  82. package/dist/chunks/index.d.ts +707 -131
  83. package/dist/index.d.ts +3 -3
  84. package/dist/index.js +3 -3
  85. package/dist/index.js.map +1 -1
  86. package/dist/models.d.ts +2 -2
  87. package/dist/models.js +29 -1
  88. package/dist/models.js.map +1 -1
  89. package/dist/react/account.d.ts +1 -1
  90. package/dist/react/account.js +1 -1
  91. package/dist/react/account.js.map +1 -1
  92. package/dist/react/admin-catalogue.d.ts +1 -1
  93. package/dist/react/admin-catalogue.js +1 -1
  94. package/dist/react/admin-catalogue.js.map +1 -1
  95. package/dist/react/admin-consumption.d.ts +6 -1
  96. package/dist/react/admin-consumption.js +6 -1
  97. package/dist/react/admin-consumption.js.map +1 -1
  98. package/dist/react/admin-licenses.d.ts +1 -1
  99. package/dist/react/admin-licenses.js +1 -1
  100. package/dist/react/admin-licenses.js.map +1 -1
  101. package/dist/react/admin-patrons.d.ts +2 -2
  102. package/dist/react/admin-patrons.js +2 -2
  103. package/dist/react/admin-patrons.js.map +1 -1
  104. package/dist/react/admin-reviews.d.ts +1 -1
  105. package/dist/react/admin-reviews.js +1 -1
  106. package/dist/react/admin-reviews.js.map +1 -1
  107. package/dist/react/admin-roles.d.ts +2 -2
  108. package/dist/react/admin-roles.js +2 -2
  109. package/dist/react/admin-roles.js.map +1 -1
  110. package/dist/react/admin-support.d.ts +1 -1
  111. package/dist/react/admin-support.js +1 -1
  112. package/dist/react/admin-support.js.map +1 -1
  113. package/dist/react/admin-tenants.d.ts +34 -1
  114. package/dist/react/admin-tenants.js +44 -2
  115. package/dist/react/admin-tenants.js.map +1 -1
  116. package/dist/react/admin-tutoring.d.ts +1 -1
  117. package/dist/react/admin-tutoring.js +1 -1
  118. package/dist/react/admin-tutoring.js.map +1 -1
  119. package/dist/react/auth.d.ts +1 -1
  120. package/dist/react/auth.js +1 -1
  121. package/dist/react/auth.js.map +1 -1
  122. package/dist/react/biblio-catalogue.d.ts +1 -1
  123. package/dist/react/biblio-catalogue.js +1 -1
  124. package/dist/react/biblio-catalogue.js.map +1 -1
  125. package/dist/react/biblio-home.d.ts +1 -1
  126. package/dist/react/biblio-home.js +1 -1
  127. package/dist/react/biblio-home.js.map +1 -1
  128. package/dist/react/biblio-library.d.ts +1 -1
  129. package/dist/react/biblio-library.js +1 -1
  130. package/dist/react/biblio-library.js.map +1 -1
  131. package/dist/react/biblio-nextory.d.ts +1 -1
  132. package/dist/react/biblio-nextory.js +1 -1
  133. package/dist/react/biblio-nextory.js.map +1 -1
  134. package/dist/react/biblio-press.d.ts +1 -1
  135. package/dist/react/biblio-press.js +1 -1
  136. package/dist/react/biblio-press.js.map +1 -1
  137. package/dist/react/biblio-search.d.ts +1 -1
  138. package/dist/react/biblio-search.js +1 -1
  139. package/dist/react/biblio-search.js.map +1 -1
  140. package/dist/react/biblio-telemetry.d.ts +1 -1
  141. package/dist/react/biblio-telemetry.js +1 -1
  142. package/dist/react/biblio-telemetry.js.map +1 -1
  143. package/dist/react/chat.d.ts +1 -1
  144. package/dist/react/consumption.d.ts +1 -1
  145. package/dist/react/consumption.js +1 -1
  146. package/dist/react/consumption.js.map +1 -1
  147. package/dist/react/cvs-app.d.ts +1 -1
  148. package/dist/react/cvs-app.js +1 -1
  149. package/dist/react/cvs-app.js.map +1 -1
  150. package/dist/react/cvs-documents.d.ts +16 -3
  151. package/dist/react/cvs-documents.js +24 -7
  152. package/dist/react/cvs-documents.js.map +1 -1
  153. package/dist/react/cvs-favorites.d.ts +1 -1
  154. package/dist/react/cvs-favorites.js +1 -1
  155. package/dist/react/cvs-favorites.js.map +1 -1
  156. package/dist/react/cvs-ils.d.ts +552 -0
  157. package/dist/react/cvs-ils.js +822 -0
  158. package/dist/react/cvs-ils.js.map +1 -0
  159. package/dist/react/cvs-loans.d.ts +1 -1
  160. package/dist/react/cvs-loans.js +1 -1
  161. package/dist/react/cvs-loans.js.map +1 -1
  162. package/dist/react/cvs-payments.d.ts +1 -1
  163. package/dist/react/cvs-payments.js +1 -1
  164. package/dist/react/cvs-payments.js.map +1 -1
  165. package/dist/react/cvs-streaming.d.ts +1 -1
  166. package/dist/react/cvs-streaming.js +1 -1
  167. package/dist/react/cvs-streaming.js.map +1 -1
  168. package/dist/react/index.d.ts +4 -2
  169. package/dist/react/index.js +4 -2
  170. package/dist/react/partner-catalogue.d.ts +1 -1
  171. package/dist/react/partner-catalogue.js +1 -1
  172. package/dist/react/partner-catalogue.js.map +1 -1
  173. package/dist/react/partner-reader.d.ts +1 -1
  174. package/dist/react/partner-reader.js +1 -1
  175. package/dist/react/partner-reader.js.map +1 -1
  176. package/dist/react/profiles.d.ts +1 -1
  177. package/dist/react/profiles.js +1 -1
  178. package/dist/react/profiles.js.map +1 -1
  179. package/dist/react/search.d.ts +47 -0
  180. package/dist/react/search.js +81 -0
  181. package/dist/react/search.js.map +1 -0
  182. package/dist/react/tutoring-catalogue.d.ts +1 -1
  183. package/dist/react/tutoring-catalogue.js +1 -1
  184. package/dist/react/tutoring-catalogue.js.map +1 -1
  185. package/dist/react/tutoring-chat.d.ts +1 -1
  186. package/dist/react/tutoring-chat.js +1 -1
  187. package/dist/react/tutoring-chat.js.map +1 -1
  188. package/dist/react/tutoring-dispatch.d.ts +1 -1
  189. package/dist/react/tutoring-dispatch.js +1 -1
  190. package/dist/react/tutoring-dispatch.js.map +1 -1
  191. package/dist/react/tutoring-practitioner.d.ts +1 -1
  192. package/dist/react/tutoring-practitioner.js +1 -1
  193. package/dist/react/tutoring-practitioner.js.map +1 -1
  194. package/dist/react/tutoring-requests.d.ts +1 -1
  195. package/dist/react/tutoring-requests.js +1 -1
  196. package/dist/react/tutoring-requests.js.map +1 -1
  197. package/package.json +7 -7
@@ -1,5 +1,5 @@
1
1
 
2
- import { Cr as DocumentRead, Er as DocumentPage, G as ReviewUpdateWrite, K as ReviewRead, M as SupplierGrantRead, Sr as DocumentSearchWrite, Xn as LastPositionWrite, ft as RatingUpdateWrite } from "../chunks/index.js";
2
+ import { Jr as DocumentRead, P as SupplierGrantRead, X as ReviewRead, Y as ReviewUpdateWrite, Zr as DocumentPage, _t as RatingUpdateWrite, in as OpenAtSupplierParams, qr as DocumentSearchWrite, rr as LastPositionWrite } from "../chunks/index.js";
3
3
  import { c as request } from "../chunks/client.js";
4
4
  //#region src/api/cvs-documents/cvs-documents.d.ts
5
5
  export declare const getSearchDocumentsUrl: () => string;
@@ -26,7 +26,7 @@ export declare const getReadDocumentUrl: (docId: number) => string;
26
26
  * @summary Read Document
27
27
  */
28
28
  export declare const readDocument: (docId: number, options?: Parameters<typeof request>[1]) => Promise<DocumentRead>;
29
- export declare const getOpenAtSupplierUrl: (docId: number) => string;
29
+ export declare const getOpenAtSupplierUrl: (docId: number, params?: OpenAtSupplierParams) => string;
30
30
  /**
31
31
  * Authorise this patron to open one title at the supplier hosting it.
32
32
  *
@@ -48,11 +48,23 @@ export declare const getOpenAtSupplierUrl: (docId: number) => string;
48
48
  * them either, so the honest answer is that this title is not openable rather
49
49
  * than a 500 from a missing branch.
50
50
  *
51
+ * ``mode`` is the legacy's ``$upload``: ``stream`` to consult in place,
52
+ * ``download`` to take a copy away. It does two things, and both matter —
53
+ *
54
+ * * **The library is billed for the right act.** ``exemp`` records streaming
55
+ * and download separately, and ``pret_download`` is the only column where a
56
+ * loan duration ever appears. Granting a download as a view bills the wrong
57
+ * quota.
58
+ * * **Three platforms sign it.** Jeux CVS, CVS Livres and Komics Initiative
59
+ * append the flag *after* the second key, so a stream and a download of the
60
+ * same title by the same patron at the same second carry different
61
+ * signatures. For the other platforms it is inert.
62
+ *
51
63
  * The returned token is for the *supplier*, not for us. See
52
64
  * :class:`~app.datamodels.cvs.downloads.SupplierGrantRead`.
53
65
  * @summary Open At Supplier
54
66
  */
55
- export declare const openAtSupplier: (docId: number, options?: Parameters<typeof request>[1]) => Promise<SupplierGrantRead>;
67
+ export declare const openAtSupplier: (docId: number, params?: OpenAtSupplierParams, options?: Parameters<typeof request>[1]) => Promise<SupplierGrantRead>;
56
68
  export declare const getReadLastPositionUrl: (docId: number) => string;
57
69
  /**
58
70
  * Where this patron got to, or ``0`` if they have not started.
@@ -52,8 +52,13 @@ const readDocument = async (docId, options) => {
52
52
  method: "GET"
53
53
  });
54
54
  };
55
- const getOpenAtSupplierUrl = (docId) => {
56
- return `/cvs/documents/${docId}/grant`;
55
+ const getOpenAtSupplierUrl = (docId, params) => {
56
+ const normalizedParams = new URLSearchParams();
57
+ Object.entries(params || {}).forEach(([key, value]) => {
58
+ if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
59
+ });
60
+ const stringifiedParams = normalizedParams.toString();
61
+ return stringifiedParams.length > 0 ? `/cvs/documents/${docId}/grant?${stringifiedParams}` : `/cvs/documents/${docId}/grant`;
57
62
  };
58
63
  /**
59
64
  * Authorise this patron to open one title at the supplier hosting it.
@@ -76,12 +81,24 @@ const getOpenAtSupplierUrl = (docId) => {
76
81
  * them either, so the honest answer is that this title is not openable rather
77
82
  * than a 500 from a missing branch.
78
83
  *
84
+ * ``mode`` is the legacy's ``$upload``: ``stream`` to consult in place,
85
+ * ``download`` to take a copy away. It does two things, and both matter —
86
+ *
87
+ * * **The library is billed for the right act.** ``exemp`` records streaming
88
+ * and download separately, and ``pret_download`` is the only column where a
89
+ * loan duration ever appears. Granting a download as a view bills the wrong
90
+ * quota.
91
+ * * **Three platforms sign it.** Jeux CVS, CVS Livres and Komics Initiative
92
+ * append the flag *after* the second key, so a stream and a download of the
93
+ * same title by the same patron at the same second carry different
94
+ * signatures. For the other platforms it is inert.
95
+ *
79
96
  * The returned token is for the *supplier*, not for us. See
80
97
  * :class:`~app.datamodels.cvs.downloads.SupplierGrantRead`.
81
98
  * @summary Open At Supplier
82
99
  */
83
- const openAtSupplier = async (docId, options) => {
84
- return request(getOpenAtSupplierUrl(docId), {
100
+ const openAtSupplier = async (docId, params, options) => {
101
+ return request(getOpenAtSupplierUrl(docId, params), {
85
102
  ...options,
86
103
  method: "POST"
87
104
  });
@@ -1 +1 @@
1
- {"version":3,"file":"cvs-documents.js","names":[],"sources":["../../src/api/cvs-documents/cvs-documents.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 DocumentPage,\n DocumentRead,\n DocumentSearchWrite,\n LastPositionWrite,\n RatingUpdateWrite,\n ReviewRead,\n ReviewUpdateWrite,\n SupplierGrantRead\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getSearchDocumentsUrl = () => {\n\n\n\n\n return `/cvs/documents/search`\n}\n\n/**\n * Search the CVS catalogue.\n *\n * ``POST`` because the legacy put the query in the body and the mobile clients\n * send it that way. It is a read, so it stays safe: nothing here writes.\n *\n * Same division as ``/search``: the index ranks, PostgreSQL authorises. An\n * index outage degrades to no results rather than to an unfiltered catalogue.\n * @summary Search Documents\n */\nexport const searchDocuments = async (documentSearchWrite: DocumentSearchWrite, options?: Parameters<typeof request>[1]): Promise<DocumentPage> => {\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<DocumentPage>(getSearchDocumentsUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(documentSearchWrite)\n }\n);}\n\n\nexport const getReadDocumentUrl = (docId: number,) => {\n\n\n\n\n return `/cvs/documents/${docId}`\n}\n\n/**\n * One work, if this caller's contract reaches it.\n *\n * Missing until now, which was an oversight rather than a decision: search,\n * rating, review and position all existed and there was no way to fetch the\n * thing they act on. The legacy has no equivalent either — the app assembles a\n * document sheet from whatever the menu endpoint already returned, which is why\n * a deep link into a title has never worked properly.\n * @summary Read Document\n */\nexport const readDocument = async (docId: number, options?: Parameters<typeof request>[1]): Promise<DocumentRead> => {\n\n return request<DocumentRead>(getReadDocumentUrl(docId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getOpenAtSupplierUrl = (docId: number,) => {\n\n\n\n\n return `/cvs/documents/${docId}/grant`\n}\n\n/**\n * Authorise this patron to open one title at the supplier hosting it.\n *\n * Replaces the legacy ``wstoken``: 4,878 lines dispatching on\n * ``frn.plate_forme`` through 57 near-identical arms. The signing schemes\n * reduce to eight (:class:`~app.models.enums.TokenFormula`) and the platform\n * map to a table, so what is left here is the order of operations.\n *\n * **Entitle, seat, then sign** — the same order the streaming route uses, and\n * for the same reason. A signature is cheap to produce and impossible to\n * recall once it has left; a seat can be released. Signing first would mean a\n * refused request had already handed a patron something that works.\n *\n * ``404`` when the caller is not entitled or the title does not exist — the\n * two are deliberately indistinguishable, as everywhere else in this API.\n * ``409`` when every seat is taken: the caller *is* entitled and should be\n * offered \"try later\", not \"buy a subscription\". ``409`` too when the supplier\n * sits on a platform nobody implemented — four do, and the legacy cannot serve\n * them either, so the honest answer is that this title is not openable rather\n * than a 500 from a missing branch.\n *\n * The returned token is for the *supplier*, not for us. See\n * :class:`~app.datamodels.cvs.downloads.SupplierGrantRead`.\n * @summary Open At Supplier\n */\nexport const openAtSupplier = async (docId: number, options?: Parameters<typeof request>[1]): Promise<SupplierGrantRead> => {\n\n return request<SupplierGrantRead>(getOpenAtSupplierUrl(docId),\n {\n ...options,\n method: 'POST'\n\n\n }\n);}\n\n\nexport const getReadLastPositionUrl = (docId: number,) => {\n\n\n\n\n return `/cvs/documents/${docId}/position`\n}\n\n/**\n * Where this patron got to, or ``0`` if they have not started.\n *\n * New: the legacy has no way to read the position back, so a client that lost\n * its local state could never resume. Absent means not started, which is why\n * the row is not created on read.\n * @summary Read Last Position\n */\nexport const readLastPosition = async (docId: number, options?: Parameters<typeof request>[1]): Promise<LastPositionWrite> => {\n\n return request<LastPositionWrite>(getReadLastPositionUrl(docId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getSetLastPositionUrl = (docId: number,) => {\n\n\n\n\n return `/cvs/documents/${docId}/position`\n}\n\n/**\n * Record where this patron got to.\n *\n * A write, and the legacy declares it ``GET`` with the position in the query\n * string — which makes resuming a book a cacheable idempotent read that mutates\n * state, and puts it outside the CSRF layer for free.\n *\n * Stored in :class:`~app.models.activity.ReadingPosition`, which the products\n * share — CVS and the partner reader today — so a member who reads across them\n * keeps their place in one shape.\n * @summary Set Last Position\n */\nexport const setLastPosition = async (docId: number,\n lastPositionWrite: LastPositionWrite, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<void>(getSetLastPositionUrl(docId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(lastPositionWrite)\n }\n);}\n\n\nexport const getRateDocumentUrl = (docId: number,) => {\n\n\n\n\n return `/cvs/documents/${docId}/rating`\n}\n\n/**\n * Rate a document. Idempotent — rating again replaces the earlier score.\n *\n * ``PUT`` on the rating sub-resource rather than the legacy\n * ``POST /document/rating/update`` with the id in the body: the identifier\n * belongs in the path, and \"update\" in a path names an operation in a position\n * reserved for a resource.\n * @summary Rate Document\n */\nexport const rateDocument = async (docId: number,\n ratingUpdateWrite: RatingUpdateWrite, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<void>(getRateDocumentUrl(docId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(ratingUpdateWrite)\n }\n);}\n\n\nexport const getWriteReviewUrl = (docId: number,) => {\n\n\n\n\n return `/cvs/documents/${docId}/review`\n}\n\n/**\n * Write or replace this patron's review of a document.\n *\n * One review per person per document, so this is a ``PUT`` on a singular\n * sub-resource rather than a ``POST`` to a collection. The legacy had two routes\n * — with and without an ``avisId`` — for what is one row.\n *\n * Every write resets the review to unpublished. An edit after moderation is a\n * new thing to moderate, and carrying the old approval forward is how an\n * approved review becomes a different text.\n * @summary Write Review\n */\nexport const writeReview = async (docId: number,\n reviewUpdateWrite: ReviewUpdateWrite, options?: Parameters<typeof request>[1]): Promise<ReviewRead> => {\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<ReviewRead>(getWriteReviewUrl(docId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(reviewUpdateWrite)\n }\n);}\n\n\n"],"mappings":";;;AAoBA,MAAa,8BAA8B;CAKzC,OAAO;AACT;;;;;;;;;;;AAYA,MAAa,kBAAkB,OAAO,qBAA0C,YAAmE;CAE/I,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,sBAAsB,GACjD;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,mBAAmB;CAC1C,CACF;AAAE;AAGF,MAAa,sBAAsB,UAAmB;CAKpD,OAAO,kBAAkB;AAC3B;;;;;;;;;;;AAYA,MAAa,eAAe,OAAO,OAAe,YAAmE;CAEnH,OAAO,QAAsB,mBAAmB,KAAK,GACrD;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,wBAAwB,UAAmB;CAKtD,OAAO,kBAAkB,MAAM;AACjC;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAa,iBAAiB,OAAO,OAAe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,OAAO,OAAO,YACZ,MAAM,KAAK,IAAkC,UAAU,MAAM,KAAK,KAAK,CAAqB,CAC9F;EAEF,MAAM,UAAsD,CAAC;EAC7D,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAgD,CAAC,GAClF,IAAI,UAAU,KAAA,GAAW,QAAQ,QAAQ;EAE3C,OAAO;CACT;CACF,OAAO,QAAc,mBAAmB,KAAK,GAC3C;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,iBAAiB;CACxC,CACF;AAAE;AAGF,MAAa,qBAAqB,UAAmB;CAKnD,OAAO,kBAAkB,MAAM;AACjC;;;;;;;;;;;;;AAcA,MAAa,cAAc,OAAO,OAC9B,mBAAsC,YAAiE;CAEvG,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,QAAoB,kBAAkB,KAAK,GAChD;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,iBAAiB;CACxC,CACF;AAAE"}
1
+ {"version":3,"file":"cvs-documents.js","names":[],"sources":["../../src/api/cvs-documents/cvs-documents.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.3.2\n */\nimport type {\n DocumentPage,\n DocumentRead,\n DocumentSearchWrite,\n LastPositionWrite,\n OpenAtSupplierParams,\n RatingUpdateWrite,\n ReviewRead,\n ReviewUpdateWrite,\n SupplierGrantRead\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getSearchDocumentsUrl = () => {\n\n\n\n\n return `/cvs/documents/search`\n}\n\n/**\n * Search the CVS catalogue.\n *\n * ``POST`` because the legacy put the query in the body and the mobile clients\n * send it that way. It is a read, so it stays safe: nothing here writes.\n *\n * Same division as ``/search``: the index ranks, PostgreSQL authorises. An\n * index outage degrades to no results rather than to an unfiltered catalogue.\n * @summary Search Documents\n */\nexport const searchDocuments = async (documentSearchWrite: DocumentSearchWrite, options?: Parameters<typeof request>[1]): Promise<DocumentPage> => {\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<DocumentPage>(getSearchDocumentsUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(documentSearchWrite)\n }\n);}\n\n\nexport const getReadDocumentUrl = (docId: number,) => {\n\n\n\n\n return `/cvs/documents/${docId}`\n}\n\n/**\n * One work, if this caller's contract reaches it.\n *\n * Missing until now, which was an oversight rather than a decision: search,\n * rating, review and position all existed and there was no way to fetch the\n * thing they act on. The legacy has no equivalent either — the app assembles a\n * document sheet from whatever the menu endpoint already returned, which is why\n * a deep link into a title has never worked properly.\n * @summary Read Document\n */\nexport const readDocument = async (docId: number, options?: Parameters<typeof request>[1]): Promise<DocumentRead> => {\n\n return request<DocumentRead>(getReadDocumentUrl(docId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getOpenAtSupplierUrl = (docId: number,\n params?: OpenAtSupplierParams,) => {\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 ? `/cvs/documents/${docId}/grant?${stringifiedParams}` : `/cvs/documents/${docId}/grant`\n}\n\n/**\n * Authorise this patron to open one title at the supplier hosting it.\n *\n * Replaces the legacy ``wstoken``: 4,878 lines dispatching on\n * ``frn.plate_forme`` through 57 near-identical arms. The signing schemes\n * reduce to eight (:class:`~app.models.enums.TokenFormula`) and the platform\n * map to a table, so what is left here is the order of operations.\n *\n * **Entitle, seat, then sign** — the same order the streaming route uses, and\n * for the same reason. A signature is cheap to produce and impossible to\n * recall once it has left; a seat can be released. Signing first would mean a\n * refused request had already handed a patron something that works.\n *\n * ``404`` when the caller is not entitled or the title does not exist — the\n * two are deliberately indistinguishable, as everywhere else in this API.\n * ``409`` when every seat is taken: the caller *is* entitled and should be\n * offered \"try later\", not \"buy a subscription\". ``409`` too when the supplier\n * sits on a platform nobody implemented — four do, and the legacy cannot serve\n * them either, so the honest answer is that this title is not openable rather\n * than a 500 from a missing branch.\n *\n * ``mode`` is the legacy's ``$upload``: ``stream`` to consult in place,\n * ``download`` to take a copy away. It does two things, and both matter —\n *\n * * **The library is billed for the right act.** ``exemp`` records streaming\n * and download separately, and ``pret_download`` is the only column where a\n * loan duration ever appears. Granting a download as a view bills the wrong\n * quota.\n * * **Three platforms sign it.** Jeux CVS, CVS Livres and Komics Initiative\n * append the flag *after* the second key, so a stream and a download of the\n * same title by the same patron at the same second carry different\n * signatures. For the other platforms it is inert.\n *\n * The returned token is for the *supplier*, not for us. See\n * :class:`~app.datamodels.cvs.downloads.SupplierGrantRead`.\n * @summary Open At Supplier\n */\nexport const openAtSupplier = async (docId: number,\n params?: OpenAtSupplierParams, options?: Parameters<typeof request>[1]): Promise<SupplierGrantRead> => {\n\n return request<SupplierGrantRead>(getOpenAtSupplierUrl(docId,params),\n {\n ...options,\n method: 'POST'\n\n\n }\n);}\n\n\nexport const getReadLastPositionUrl = (docId: number,) => {\n\n\n\n\n return `/cvs/documents/${docId}/position`\n}\n\n/**\n * Where this patron got to, or ``0`` if they have not started.\n *\n * New: the legacy has no way to read the position back, so a client that lost\n * its local state could never resume. Absent means not started, which is why\n * the row is not created on read.\n * @summary Read Last Position\n */\nexport const readLastPosition = async (docId: number, options?: Parameters<typeof request>[1]): Promise<LastPositionWrite> => {\n\n return request<LastPositionWrite>(getReadLastPositionUrl(docId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getSetLastPositionUrl = (docId: number,) => {\n\n\n\n\n return `/cvs/documents/${docId}/position`\n}\n\n/**\n * Record where this patron got to.\n *\n * A write, and the legacy declares it ``GET`` with the position in the query\n * string — which makes resuming a book a cacheable idempotent read that mutates\n * state, and puts it outside the CSRF layer for free.\n *\n * Stored in :class:`~app.models.activity.ReadingPosition`, which the products\n * share — CVS and the partner reader today — so a member who reads across them\n * keeps their place in one shape.\n * @summary Set Last Position\n */\nexport const setLastPosition = async (docId: number,\n lastPositionWrite: LastPositionWrite, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<void>(getSetLastPositionUrl(docId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(lastPositionWrite)\n }\n);}\n\n\nexport const getRateDocumentUrl = (docId: number,) => {\n\n\n\n\n return `/cvs/documents/${docId}/rating`\n}\n\n/**\n * Rate a document. Idempotent — rating again replaces the earlier score.\n *\n * ``PUT`` on the rating sub-resource rather than the legacy\n * ``POST /document/rating/update`` with the id in the body: the identifier\n * belongs in the path, and \"update\" in a path names an operation in a position\n * reserved for a resource.\n * @summary Rate Document\n */\nexport const rateDocument = async (docId: number,\n ratingUpdateWrite: RatingUpdateWrite, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<void>(getRateDocumentUrl(docId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(ratingUpdateWrite)\n }\n);}\n\n\nexport const getWriteReviewUrl = (docId: number,) => {\n\n\n\n\n return `/cvs/documents/${docId}/review`\n}\n\n/**\n * Write or replace this patron's review of a document.\n *\n * One review per person per document, so this is a ``PUT`` on a singular\n * sub-resource rather than a ``POST`` to a collection. The legacy had two routes\n * — with and without an ``avisId`` — for what is one row.\n *\n * Every write resets the review to unpublished. An edit after moderation is a\n * new thing to moderate, and carrying the old approval forward is how an\n * approved review becomes a different text.\n * @summary Write Review\n */\nexport const writeReview = async (docId: number,\n reviewUpdateWrite: ReviewUpdateWrite, options?: Parameters<typeof request>[1]): Promise<ReviewRead> => {\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<ReviewRead>(getWriteReviewUrl(docId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(reviewUpdateWrite)\n }\n);}\n\n\n"],"mappings":";;;AAqBA,MAAa,8BAA8B;CAKzC,OAAO;AACT;;;;;;;;;;;AAYA,MAAa,kBAAkB,OAAO,qBAA0C,YAAmE;CAE/I,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,sBAAsB,GACjD;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,mBAAmB;CAC1C,CACF;AAAE;AAGF,MAAa,sBAAsB,UAAmB;CAKpD,OAAO,kBAAkB;AAC3B;;;;;;;;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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,QAAoB,kBAAkB,KAAK,GAChD;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,iBAAiB;CACxC,CACF;AAAE"}
@@ -1,5 +1,5 @@
1
1
 
2
- import { dr as SelectionRead, lr as FavoriteListRead } from "../chunks/index.js";
2
+ import { Ir as SelectionRead, Pr as FavoriteListRead } from "../chunks/index.js";
3
3
  import { c as request } from "../chunks/client.js";
4
4
  //#region src/api/cvs-favorites/cvs-favorites.d.ts
5
5
  export declare const getListCvsFavoritesUrl: () => string;
@@ -1 +1 @@
1
- {"version":3,"file":"cvs-favorites.js","names":[],"sources":["../../src/api/cvs-favorites/cvs-favorites.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 FavoriteListRead,\n SelectionRead\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getListCvsFavoritesUrl = () => {\n\n\n\n\n return `/cvs/favorites`\n}\n\n/**\n * The caller's favourites.\n *\n * Entitlement-filtered. A title the library has stopped licensing stays in the\n * list — removing it silently would lose the patron's own curation over a\n * contract change they had nothing to do with — but it is not returned here,\n * because a client cannot open it. When the licence comes back, so does the\n * entry.\n * @summary List Cvs Favorites\n */\nexport const listCvsFavorites = async ( options?: Parameters<typeof request>[1]): Promise<FavoriteListRead> => {\n\n return request<FavoriteListRead>(getListCvsFavoritesUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getRemoveCvsFavoriteUrl = (docId: number,) => {\n\n\n\n\n return `/cvs/favorites/${docId}`\n}\n\n/**\n * Remove a work from the caller's list. Idempotent.\n *\n * Scoped to ``kind = 8`` through the list lookup, so this can never delete a\n * line out of the patron's loans or reservations — which live in the same two\n * tables and would look identical to a query that only matched on\n * ``(user_id, doc_id)``.\n * @summary Remove Cvs Favorite\n */\nexport const removeCvsFavorite = async (docId: number, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getRemoveCvsFavoriteUrl(docId),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\nexport const getAddCvsFavoriteUrl = (docId: number,) => {\n\n\n\n\n return `/cvs/favorites/${docId}`\n}\n\n/**\n * Add a work to the caller's list. Idempotent.\n *\n * ``PUT`` and ``DELETE`` on the item, rather than the legacy's single route\n * answering both ``POST`` and ``DELETE`` on a path with a required\n * ``{selectionId}`` its own handler declares optional.\n *\n * Not entitlement-gated. A patron may bookmark something their library has not\n * licensed yet — that is a signal worth having, and it is what an acquisitions\n * request is made of. Reaching the work is gated, at the point of reaching it.\n * @summary Add Cvs Favorite\n */\nexport const addCvsFavorite = async (docId: number, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getAddCvsFavoriteUrl(docId),\n {\n ...options,\n method: 'PUT'\n\n\n }\n);}\n\n\nexport const getListSelectionsUrl = () => {\n\n\n\n\n return `/cvs/lists`\n}\n\n/**\n * Every list this patron holds, of every kind.\n *\n * Read-only and deliberately unfiltered: a client showing \"my loans\" and \"my\n * list\" side by side needs to know which is which, and hiding the ILS-mirrored\n * kinds would only make it guess.\n * @summary List Selections\n */\nexport const listSelections = async ( options?: Parameters<typeof request>[1]): Promise<SelectionRead[]> => {\n\n return request<SelectionRead[]>(getListSelectionsUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n"],"mappings":";;;AAcA,MAAa,+BAA+B;CAK1C,OAAO;AACT;;;;;;;;;;;AAYA,MAAa,mBAAmB,OAAQ,YAAuE;CAE7G,OAAO,QAA0B,uBAAuB,GACxD;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,2BAA2B,UAAmB;CAKzD,OAAO,kBAAkB;AAC3B;;;;;;;;;;AAWA,MAAa,oBAAoB,OAAO,OAAe,YAA2D;CAEhH,OAAO,QAAc,wBAAwB,KAAK,GAClD;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,wBAAwB,UAAmB;CAKtD,OAAO,kBAAkB;AAC3B;;;;;;;;;;;;;AAcA,MAAa,iBAAiB,OAAO,OAAe,YAA2D;CAE7G,OAAO,QAAc,qBAAqB,KAAK,GAC/C;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,6BAA6B;CAKxC,OAAO;AACT;;;;;;;;;AAUA,MAAa,iBAAiB,OAAQ,YAAsE;CAE1G,OAAO,QAAyB,qBAAqB,GACrD;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE"}
1
+ {"version":3,"file":"cvs-favorites.js","names":[],"sources":["../../src/api/cvs-favorites/cvs-favorites.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.3.2\n */\nimport type {\n FavoriteListRead,\n SelectionRead\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getListCvsFavoritesUrl = () => {\n\n\n\n\n return `/cvs/favorites`\n}\n\n/**\n * The caller's favourites.\n *\n * Entitlement-filtered. A title the library has stopped licensing stays in the\n * list — removing it silently would lose the patron's own curation over a\n * contract change they had nothing to do with — but it is not returned here,\n * because a client cannot open it. When the licence comes back, so does the\n * entry.\n * @summary List Cvs Favorites\n */\nexport const listCvsFavorites = async ( options?: Parameters<typeof request>[1]): Promise<FavoriteListRead> => {\n\n return request<FavoriteListRead>(getListCvsFavoritesUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getRemoveCvsFavoriteUrl = (docId: number,) => {\n\n\n\n\n return `/cvs/favorites/${docId}`\n}\n\n/**\n * Remove a work from the caller's list. Idempotent.\n *\n * Scoped to ``kind = 8`` through the list lookup, so this can never delete a\n * line out of the patron's loans or reservations — which live in the same two\n * tables and would look identical to a query that only matched on\n * ``(user_id, doc_id)``.\n * @summary Remove Cvs Favorite\n */\nexport const removeCvsFavorite = async (docId: number, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getRemoveCvsFavoriteUrl(docId),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\nexport const getAddCvsFavoriteUrl = (docId: number,) => {\n\n\n\n\n return `/cvs/favorites/${docId}`\n}\n\n/**\n * Add a work to the caller's list. Idempotent.\n *\n * ``PUT`` and ``DELETE`` on the item, rather than the legacy's single route\n * answering both ``POST`` and ``DELETE`` on a path with a required\n * ``{selectionId}`` its own handler declares optional.\n *\n * Not entitlement-gated. A patron may bookmark something their library has not\n * licensed yet — that is a signal worth having, and it is what an acquisitions\n * request is made of. Reaching the work is gated, at the point of reaching it.\n * @summary Add Cvs Favorite\n */\nexport const addCvsFavorite = async (docId: number, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getAddCvsFavoriteUrl(docId),\n {\n ...options,\n method: 'PUT'\n\n\n }\n);}\n\n\nexport const getListSelectionsUrl = () => {\n\n\n\n\n return `/cvs/lists`\n}\n\n/**\n * Every list this patron holds, of every kind.\n *\n * Read-only and deliberately unfiltered: a client showing \"my loans\" and \"my\n * list\" side by side needs to know which is which, and hiding the ILS-mirrored\n * kinds would only make it guess.\n * @summary List Selections\n */\nexport const listSelections = async ( options?: Parameters<typeof request>[1]): Promise<SelectionRead[]> => {\n\n return request<SelectionRead[]>(getListSelectionsUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n"],"mappings":";;;AAcA,MAAa,+BAA+B;CAK1C,OAAO;AACT;;;;;;;;;;;AAYA,MAAa,mBAAmB,OAAQ,YAAuE;CAE7G,OAAO,QAA0B,uBAAuB,GACxD;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,2BAA2B,UAAmB;CAKzD,OAAO,kBAAkB;AAC3B;;;;;;;;;;AAWA,MAAa,oBAAoB,OAAO,OAAe,YAA2D;CAEhH,OAAO,QAAc,wBAAwB,KAAK,GAClD;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,wBAAwB,UAAmB;CAKtD,OAAO,kBAAkB;AAC3B;;;;;;;;;;;;;AAcA,MAAa,iBAAiB,OAAO,OAAe,YAA2D;CAE7G,OAAO,QAAc,qBAAqB,KAAK,GAC/C;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,6BAA6B;CAKxC,OAAO;AACT;;;;;;;;;AAUA,MAAa,iBAAiB,OAAQ,YAAsE;CAE1G,OAAO,QAAyB,qBAAqB,GACrD;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE"}
@@ -0,0 +1,167 @@
1
+
2
+ import { Nn as ListIlsLoansParams, _r as IlsHoldListRead, ar as IlsTagWrite, br as IlsActionRead, cr as IlsStatusRead, dr as IlsPasswordWrite, dt as ReadIlsHoldableParams, fr as IlsLocationListRead, gr as IlsHoldWrite, lr as IlsSignInWrite, mr as IlsLoanListRead, or as IlsSuggestionOptionListRead, ur as IlsReviewWrite, xr as IlsAccountRead, yr as IlsHoldableRead } from "../chunks/index.js";
3
+ import { c as request } from "../chunks/client.js";
4
+ //#region src/api/cvs-ils/cvs-ils.d.ts
5
+ export declare const getReadIlsAccountUrl: () => string;
6
+ /**
7
+ * The borrower record held by the library.
8
+ *
9
+ * Passed through unmodelled — PMB documents no shape for this call and the
10
+ * four libraries run different versions, so a fixed schema would drop exactly
11
+ * the fine and expiry fields a patron most needs.
12
+ * @summary Read Ils Account
13
+ */
14
+ export declare const readIlsAccount: (options?: Parameters<typeof request>[1]) => Promise<IlsAccountRead>;
15
+ export declare const getListIlsHoldLocationsUrl: () => string;
16
+ /**
17
+ * Branches a reservation may be collected from.
18
+ *
19
+ * A separate call from ``/ils/locations`` because it is a different list —
20
+ * not every branch accepts collections, and offering one that does not
21
+ * produces a hold the patron can never pick up.
22
+ * @summary List Ils Hold Locations
23
+ */
24
+ export declare const listIlsHoldLocations: (options?: Parameters<typeof request>[1]) => Promise<IlsLocationListRead>;
25
+ export declare const getListIlsHoldsUrl: () => string;
26
+ /**
27
+ * This patron's reservations, with their place in each queue.
28
+ * @summary List Ils Holds
29
+ */
30
+ export declare const listIlsHolds: (options?: Parameters<typeof request>[1]) => Promise<IlsHoldListRead>;
31
+ export declare const getPlaceIlsHoldUrl: () => string;
32
+ /**
33
+ * Reserve a record, for collection at a branch.
34
+ *
35
+ * Check ``GET /ils/records/{record_id}/holdable`` first if you want to show
36
+ * the patron why not before they try — this returns the library's refusal
37
+ * either way.
38
+ * @summary Place Ils Hold
39
+ */
40
+ export declare const placeIlsHold: (ilsHoldWrite: IlsHoldWrite, options?: Parameters<typeof request>[1]) => Promise<IlsActionRead>;
41
+ export declare const getCancelIlsHoldUrl: (holdId: number) => string;
42
+ /**
43
+ * Cancel a reservation. The library decides whether it may still be.
44
+ * @summary Cancel Ils Hold
45
+ */
46
+ export declare const cancelIlsHold: (holdId: number, options?: Parameters<typeof request>[1]) => Promise<IlsActionRead>;
47
+ export declare const getListIlsLoansUrl: (params?: ListIlsLoansParams) => string;
48
+ /**
49
+ * What this patron has out from their library.
50
+ *
51
+ * ``state`` replaces PMB's integer ``loan_type``. The wire values were 0, 1
52
+ * and 2 with the meanings in the vendor's documentation and nowhere in the
53
+ * URL; a client should not have to know that 2 means overdue.
54
+ * @summary List Ils Loans
55
+ */
56
+ export declare const listIlsLoans: (params?: ListIlsLoansParams, options?: Parameters<typeof request>[1]) => Promise<IlsLoanListRead>;
57
+ export declare const getRenewIlsLoanUrl: (barcode: string) => string;
58
+ /**
59
+ * Extend one loan.
60
+ *
61
+ * Keyed on the **item barcode**, not a loan id, because that is what PMB
62
+ * renews — a physical copy — and it is the number printed on the book. It is
63
+ * also what ``GET /ils/loans`` returns as ``barcode``.
64
+ *
65
+ * A refusal is a ``200`` with ``ok: false``, not an error: "this cannot be
66
+ * renewed again" is the library's answer to a valid question, and the reason
67
+ * it gives is worth showing the patron.
68
+ * @summary Renew Ils Loan
69
+ */
70
+ export declare const renewIlsLoan: (barcode: string, options?: Parameters<typeof request>[1]) => Promise<IlsActionRead>;
71
+ export declare const getListIlsLocationsUrl: () => string;
72
+ /**
73
+ * Every branch in the library's catalogue.
74
+ * @summary List Ils Locations
75
+ */
76
+ export declare const listIlsLocations: (options?: Parameters<typeof request>[1]) => Promise<IlsLocationListRead>;
77
+ export declare const getChangeIlsPasswordUrl: () => string;
78
+ /**
79
+ * Change the password on the **library's** system.
80
+ *
81
+ * Not the Mozaik one. A patron who changes it here still signs in to this
82
+ * platform with their Mozaik credentials, and saying so in the UI avoids the
83
+ * support ticket.
84
+ * @summary Change Ils Password
85
+ */
86
+ export declare const changeIlsPassword: (ilsPasswordWrite: IlsPasswordWrite, options?: Parameters<typeof request>[1]) => Promise<IlsActionRead>;
87
+ export declare const getReadIlsHoldableUrl: (recordId: number, params?: ReadIlsHoldableParams) => string;
88
+ /**
89
+ * Whether this patron may reserve this record, and the library's reason.
90
+ * @summary Read Ils Holdable
91
+ */
92
+ export declare const readIlsHoldable: (recordId: number, params?: ReadIlsHoldableParams, options?: Parameters<typeof request>[1]) => Promise<IlsHoldableRead>;
93
+ export declare const getAddIlsReviewUrl: (recordId: number) => string;
94
+ /**
95
+ * Post a review to the library's OPAC, where its other borrowers see it.
96
+ *
97
+ * Distinct from a Mozaik review: this one lives on the library's system and
98
+ * is not moderated here.
99
+ * @summary Add Ils Review
100
+ */
101
+ export declare const addIlsReview: (recordId: number, ilsReviewWrite: IlsReviewWrite, options?: Parameters<typeof request>[1]) => Promise<IlsActionRead>;
102
+ export declare const getAddIlsTagUrl: (recordId: number) => string;
103
+ /**
104
+ * Tag a record in the library's catalogue.
105
+ * @summary Add Ils Tag
106
+ */
107
+ export declare const addIlsTag: (recordId: number, ilsTagWrite: IlsTagWrite, options?: Parameters<typeof request>[1]) => Promise<IlsActionRead>;
108
+ export declare const getSignOutOfIlsUrl: () => string;
109
+ /**
110
+ * Drop the link. Idempotent, and never fails on the library's account.
111
+ *
112
+ * Our copy of the session goes first. Telling PMB is best-effort: if the
113
+ * library is down, the patron is still signed out here, which is the part
114
+ * they asked for and the part that matters for a shared device.
115
+ * @summary Sign Out Of Ils
116
+ */
117
+ export declare const signOutOfIls: (options?: Parameters<typeof request>[1]) => Promise<void>;
118
+ export declare const getSignInToIlsUrl: () => string;
119
+ /**
120
+ * Link this patron to their library account with their card credentials.
121
+ *
122
+ * Replaces ``login``, ``login-md5`` and ``login-aes``: those are three ways to
123
+ * carry one password to a server of unknown vintage, and the connector
124
+ * negotiates between them — AES first, because it is the only one that does
125
+ * not hand the library a password it can replay.
126
+ *
127
+ * **The credentials are not stored.** They open an upstream session and are
128
+ * discarded; the session is what persists, and it expires. That is why there
129
+ * is no silent re-login anywhere below — a patron whose session lapses is
130
+ * asked again, because we deliberately cannot do it for them.
131
+ *
132
+ * ``401`` for a wrong card number or password — the patron's, at their
133
+ * library, not their Mozaik credentials.
134
+ * @summary Sign In To Ils
135
+ */
136
+ export declare const signInToIls: (ilsSignInWrite: IlsSignInWrite, options?: Parameters<typeof request>[1]) => Promise<IlsStatusRead>;
137
+ export declare const getReadIlsStatusUrl: () => string;
138
+ /**
139
+ * Whether this library has a catalogue system, and whether we speak it.
140
+ *
141
+ * **Read this first.** Most libraries have no ILS, and a client that assumes
142
+ * otherwise renders a "my loans" tab that can only ever answer ``409``.
143
+ *
144
+ * Never 409s itself — "there is no integration" is the answer, not an error.
145
+ * @summary Read Ils Status
146
+ */
147
+ export declare const readIlsStatus: (options?: Parameters<typeof request>[1]) => Promise<IlsStatusRead>;
148
+ export declare const getListIlsSuggestionCategoriesUrl: () => string;
149
+ /**
150
+ * Categories a purchase suggestion may name.
151
+ *
152
+ * The suggestion itself is not submitted here: PMB's OPAC borrower services
153
+ * expose the two vocabularies and no ``add_suggestion``, so the legacy could
154
+ * not submit one either. Carried because a client building a suggestion form
155
+ * needs them, and their absence would look like an oversight rather than the
156
+ * vendor's.
157
+ * @summary List Ils Suggestion Categories
158
+ */
159
+ export declare const listIlsSuggestionCategories: (options?: Parameters<typeof request>[1]) => Promise<IlsSuggestionOptionListRead>;
160
+ export declare const getListIlsSuggestionSourcesUrl: () => string;
161
+ /**
162
+ * Sources a purchase suggestion may cite. See the note on categories.
163
+ * @summary List Ils Suggestion Sources
164
+ */
165
+ export declare const listIlsSuggestionSources: (options?: Parameters<typeof request>[1]) => Promise<IlsSuggestionOptionListRead>;
166
+ //#endregion
167
+ //# sourceMappingURL=cvs-ils.d.ts.map