@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 @@
1
+ {"version":3,"file":"cvs-loans.js","names":[],"sources":["../../src/api/cvs-loans/cvs-loans.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 BorrowWrite,\n ListLoansParams,\n LoanPage,\n LoanRead\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getListLoansUrl = (params?: ListLoansParams,) => {\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/loans?${stringifiedParams}` : `/cvs/loans`\n}\n\n/**\n * What this caller currently holds (and optionally what they have returned).\n *\n * Replaces ``/download/details``, which took a ``downloadid`` and answered about\n * one loan at a time — so a client rebuilding its shelf after reinstalling made\n * one request per title, and had no way to discover the ids in the first place.\n * @summary List Loans\n */\nexport const listLoans = async (params?: ListLoansParams, options?: Parameters<typeof request>[1]): Promise<LoanPage> => {\n\n return request<LoanPage>(getListLoansUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getBorrowUrl = () => {\n\n\n\n\n return `/cvs/loans`\n}\n\n/**\n * Borrow a work.\n *\n * The order matters and is the whole point of the entitlement model:\n *\n * 1. **Entitled?** — is this act permitted on this work under a live contract.\n * 2. **A seat free?** — ``max_concurrent`` counted from unreturned loans.\n * 3. **Units left?** — reserved in Redis *before* the row is written, so a\n * refusal costs no database work.\n * 4. **Append.** The ledger row is the loan.\n *\n * Idempotent on ``request_key``: a retried borrow returns the loan the first\n * attempt created rather than taking a second copy of the same title.\n * @summary Borrow\n */\nexport const borrow = async (borrowWrite: BorrowWrite, options?: Parameters<typeof request>[1]): Promise<LoanRead> => {\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<LoanRead>(getBorrowUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(borrowWrite)\n }\n);}\n\n\nexport const getReturnLoanUrl = (loanId: number,) => {\n\n\n\n\n return `/cvs/loans/${loanId}`\n}\n\n/**\n * Give a loan back early, freeing its seat. Idempotent.\n *\n * Returning something already returned is ``204``: the caller wanted it back on\n * the shelf and it is on the shelf. The legacy answered an error, which meant a\n * retried return looked like a failure and clients stopped retrying.\n *\n * The unit stays spent — see the module docstring. Only the seat comes back.\n * @summary Return Loan\n */\nexport const returnLoan = async (loanId: number, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getReturnLoanUrl(loanId),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\nexport const getExtendLoanUrl = (loanId: number,) => {\n\n\n\n\n return `/cvs/loans/${loanId}/extensions`\n}\n\n/**\n * Prolong a loan.\n *\n * Bounded by the grant's ``max_extensions`` — the legacy's ``nb_extend`` — and\n * refused once the loan has been returned or has lapsed. Extending something\n * that already expired is not an extension, it is a new loan, and it should\n * spend a new unit rather than quietly avoid one.\n *\n * Not idempotent, deliberately: two extension requests mean two extensions, and\n * a client that wants exactly one should not send two.\n * @summary Extend Loan\n */\nexport const extendLoan = async (loanId: number, options?: Parameters<typeof request>[1]): Promise<LoanRead> => {\n\n return request<LoanRead>(getExtendLoanUrl(loanId),\n {\n ...options,\n method: 'POST'\n\n\n }\n);}\n\n\n"],"mappings":";;;AAgBA,MAAa,mBAAmB,WAA8B;CAC5D,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,cAAc,sBAAsB;AAC5E;;;;;;;;;AAUA,MAAa,YAAY,OAAO,QAA0B,YAA+D;CAEvH,OAAO,QAAkB,gBAAgB,MAAM,GAC/C;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,qBAAqB;CAKhC,OAAO;AACT;;;;;;;;;;;;;;;;AAiBA,MAAa,SAAS,OAAO,aAA0B,YAA+D;CAElH,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,QAAkB,aAAa,GACpC;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,WAAW;CAClC,CACF;AAAE;AAGF,MAAa,oBAAoB,WAAoB;CAKnD,OAAO,cAAc;AACvB;;;;;;;;;;;AAYA,MAAa,aAAa,OAAO,QAAgB,YAA2D;CAE1G,OAAO,QAAc,iBAAiB,MAAM,GAC5C;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,oBAAoB,WAAoB;CAKnD,OAAO,cAAc,OAAO;AAC9B;;;;;;;;;;;;;AAcA,MAAa,aAAa,OAAO,QAAgB,YAA+D;CAE9G,OAAO,QAAkB,iBAAiB,MAAM,GAChD;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE"}
@@ -0,0 +1,40 @@
1
+
2
+ import { I as StreamingStartQuery, L as StreamingSessionRead } from "../index-wL_20vR8.js";
3
+ import { c as request } from "../client-BDwBZYB0.js";
4
+ //#region src/api/cvs-streaming/cvs-streaming.d.ts
5
+ export declare const getStartSessionUrl: () => string;
6
+ /**
7
+ * Begin playing a title. Returns the manifests and, if encrypted, a licence.
8
+ *
9
+ * ``409`` when every seat is taken, ``404`` when the caller is not entitled or
10
+ * the title has no video, ``503`` when the DRM broker cannot be reached.
11
+ *
12
+ * **404 and not 403 for an entitlement refusal**, consistently with the rest
13
+ * of the API: whether a particular library licensed a particular film is not
14
+ * something an unentitled caller gets to enumerate.
15
+ *
16
+ * **The seat is taken before the licence is minted.** A licence is a real cost
17
+ * with a third party and cannot be un-minted; a lease can be closed. So the
18
+ * order is entitle, seat, then mint — and a client that gets a 409 has cost
19
+ * the library nothing.
20
+ *
21
+ * Not idempotent on its own, but honours ``Idempotency-Key``: a retried start
22
+ * returns the lease the first attempt opened rather than taking a second seat.
23
+ * A licence is re-minted on the retry, which is correct — the first response
24
+ * may never have arrived, and a licence is cheap to replace while a seat is
25
+ * not.
26
+ * @summary Start Session
27
+ */
28
+ export declare const startSession: (streamingStartQuery: StreamingStartQuery, options?: Parameters<typeof request>[1]) => Promise<StreamingSessionRead>;
29
+ export declare const getStreamingDetailsUrl: (docId: number) => string;
30
+ /**
31
+ * What a title needs in order to play, without starting anything.
32
+ *
33
+ * No lease, no licence, no unit — a client rendering a "play" button should not
34
+ * have to spend a view to find out whether the button should be enabled.
35
+ * ``404`` when there is no playable video.
36
+ * @summary Streaming Details
37
+ */
38
+ export declare const streamingDetails: (docId: number, options?: Parameters<typeof request>[1]) => Promise<StreamingSessionRead>;
39
+ //#endregion
40
+ //# sourceMappingURL=cvs-streaming.d.ts.map
@@ -0,0 +1,68 @@
1
+
2
+ import { r as request } from "../client-D3kMOcIr.js";
3
+ //#region src/api/cvs-streaming/cvs-streaming.ts
4
+ const getStartSessionUrl = () => {
5
+ return `/streaming/sessions`;
6
+ };
7
+ /**
8
+ * Begin playing a title. Returns the manifests and, if encrypted, a licence.
9
+ *
10
+ * ``409`` when every seat is taken, ``404`` when the caller is not entitled or
11
+ * the title has no video, ``503`` when the DRM broker cannot be reached.
12
+ *
13
+ * **404 and not 403 for an entitlement refusal**, consistently with the rest
14
+ * of the API: whether a particular library licensed a particular film is not
15
+ * something an unentitled caller gets to enumerate.
16
+ *
17
+ * **The seat is taken before the licence is minted.** A licence is a real cost
18
+ * with a third party and cannot be un-minted; a lease can be closed. So the
19
+ * order is entitle, seat, then mint — and a client that gets a 409 has cost
20
+ * the library nothing.
21
+ *
22
+ * Not idempotent on its own, but honours ``Idempotency-Key``: a retried start
23
+ * returns the lease the first attempt opened rather than taking a second seat.
24
+ * A licence is re-minted on the retry, which is correct — the first response
25
+ * may never have arrived, and a licence is cheap to replace while a seat is
26
+ * not.
27
+ * @summary Start Session
28
+ */
29
+ const startSession = async (streamingStartQuery, options) => {
30
+ const getHeaders = (h) => {
31
+ if (!h) return {};
32
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
33
+ if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
34
+ const headers = {};
35
+ for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
36
+ return headers;
37
+ };
38
+ return request(getStartSessionUrl(), {
39
+ ...options,
40
+ method: "POST",
41
+ headers: {
42
+ "Content-Type": "application/json",
43
+ ...getHeaders(options?.headers)
44
+ },
45
+ body: JSON.stringify(streamingStartQuery)
46
+ });
47
+ };
48
+ const getStreamingDetailsUrl = (docId) => {
49
+ return `/streaming/${docId}/details`;
50
+ };
51
+ /**
52
+ * What a title needs in order to play, without starting anything.
53
+ *
54
+ * No lease, no licence, no unit — a client rendering a "play" button should not
55
+ * have to spend a view to find out whether the button should be enabled.
56
+ * ``404`` when there is no playable video.
57
+ * @summary Streaming Details
58
+ */
59
+ const streamingDetails = async (docId, options) => {
60
+ return request(getStreamingDetailsUrl(docId), {
61
+ ...options,
62
+ method: "GET"
63
+ });
64
+ };
65
+ //#endregion
66
+ export { getStartSessionUrl, getStreamingDetailsUrl, startSession, streamingDetails };
67
+
68
+ //# sourceMappingURL=cvs-streaming.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cvs-streaming.js","names":[],"sources":["../../src/api/cvs-streaming/cvs-streaming.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 StreamingSessionRead,\n StreamingStartQuery\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getStartSessionUrl = () => {\n\n\n\n\n return `/streaming/sessions`\n}\n\n/**\n * Begin playing a title. Returns the manifests and, if encrypted, a licence.\n *\n * ``409`` when every seat is taken, ``404`` when the caller is not entitled or\n * the title has no video, ``503`` when the DRM broker cannot be reached.\n *\n * **404 and not 403 for an entitlement refusal**, consistently with the rest\n * of the API: whether a particular library licensed a particular film is not\n * something an unentitled caller gets to enumerate.\n *\n * **The seat is taken before the licence is minted.** A licence is a real cost\n * with a third party and cannot be un-minted; a lease can be closed. So the\n * order is entitle, seat, then mint — and a client that gets a 409 has cost\n * the library nothing.\n *\n * Not idempotent on its own, but honours ``Idempotency-Key``: a retried start\n * returns the lease the first attempt opened rather than taking a second seat.\n * A licence is re-minted on the retry, which is correct — the first response\n * may never have arrived, and a licence is cheap to replace while a seat is\n * not.\n * @summary Start Session\n */\nexport const startSession = async (streamingStartQuery: StreamingStartQuery, options?: Parameters<typeof request>[1]): Promise<StreamingSessionRead> => {\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<StreamingSessionRead>(getStartSessionUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(streamingStartQuery)\n }\n);}\n\n\nexport const getStreamingDetailsUrl = (docId: number,) => {\n\n\n\n\n return `/streaming/${docId}/details`\n}\n\n/**\n * What a title needs in order to play, without starting anything.\n *\n * No lease, no licence, no unit — a client rendering a \"play\" button should not\n * have to spend a view to find out whether the button should be enabled.\n * ``404`` when there is no playable video.\n * @summary Streaming Details\n */\nexport const streamingDetails = async (docId: number, options?: Parameters<typeof request>[1]): Promise<StreamingSessionRead> => {\n\n return request<StreamingSessionRead>(getStreamingDetailsUrl(docId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n"],"mappings":";;;AAcA,MAAa,2BAA2B;CAKtC,OAAO;AACT;;;;;;;;;;;;;;;;;;;;;;;AAwBA,MAAa,eAAe,OAAO,qBAA0C,YAA2E;CAEpJ,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,mBAAmB,GACtD;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,0BAA0B,UAAmB;CAKxD,OAAO,cAAc,MAAM;AAC7B;;;;;;;;;AAUA,MAAa,mBAAmB,OAAO,OAAe,YAA2E;CAE/H,OAAO,QAA8B,uBAAuB,KAAK,GACjE;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE"}
@@ -0,0 +1,34 @@
1
+
2
+ import { deleteAccount, getDeleteAccountUrl, getListServicesUrl, getReadAccountUrl, getUpdateAccountUrl, listServices, readAccount, updateAccount } from "./account.js";
3
+ import { amendTheme, createTheme, deleteTheme, getAmendThemeUrl, getCreateThemeUrl, getDeleteThemeUrl, getListThemesUrl, getReadThemeUrl, getReorderThemesUrl, listThemes, readTheme, reorderThemes } from "./admin-catalogue.js";
4
+ import { forceCloseLease, getForceCloseLeaseUrl, getListLiveLeasesUrl, listLiveLeases } from "./admin-consumption.js";
5
+ import { getReadPatronLicenseUrl, readPatronLicense } from "./admin-licenses.js";
6
+ import { getListPatronsUrl, getReadPatronUrl, getUpdatePatronUrl, listPatrons, readPatron, updatePatron } from "./admin-patrons.js";
7
+ import { getListReviewsUrl, getModerateReviewUrl, listReviews, moderateReview } from "./admin-reviews.js";
8
+ import { getListGrantsUrl, getReplaceGrantsUrl, listGrants, replaceGrants } from "./admin-roles.js";
9
+ import { closeSupportSession, createDemoUser, getCloseSupportSessionUrl, getCreateDemoUserUrl, getOpenSupportSessionUrl, openSupportSession } from "./admin-support.js";
10
+ import { getListTenantsUrl, getReadTenantUrl, getUpdateTenantUrl, listTenants, readTenant, updateTenant } from "./admin-tenants.js";
11
+ import { adminCloseRequest, amendGoal, amendLevel, amendPractitioner, amendRequest, amendSubject, createGoal, createLevel, createSubject, getAdminCloseRequestUrl, getAmendGoalUrl, getAmendLevelUrl, getAmendPractitionerUrl, getAmendRequestUrl, getAmendSubjectUrl, getCreateGoalUrl, getCreateLevelUrl, getCreateSubjectUrl, getListAllRequestsUrl, getListExpiringDocumentsUrl, getListFeedbackUrl, getListPractitionerDocumentsUrl, getListPractitionersUrl, getModerateFeedbackUrl, getReadDraftUrl, getReadRequestUrl, getReviewDraftUrl, listAllRequests, listExpiringDocuments, listFeedback, listPractitionerDocuments, listPractitioners, moderateFeedback, readDraft, readRequest, reviewDraft } from "./admin-tutoring.js";
12
+ import { authorization, createSessionFromCode, createSessionFromCredentials, deleteSession, getAuthorizationUrl, getCreateSessionFromCodeUrl, getCreateSessionFromCredentialsUrl, getDeleteSessionUrl, getReadMeUrl, getRefreshSessionUrl, readMe, refreshSession } from "./auth.js";
13
+ import { getLikeContentUrl, getListEditorsUrl, getReadCatalogThemeUrl, getReadCatalogUrl, getReadContentUrl, getReadEditorUrl, getReadLearningPathUrl, getReadPackUrl, getReadRecommendationsUrl, getUnlikeContentUrl, likeContent, listEditors, readCatalog, readCatalogTheme, readContent, readEditor, readLearningPath, readPack, readRecommendations, unlikeContent } from "./biblio-catalogue.js";
14
+ import { getReadHomeFeedUrl, readHomeFeed } from "./biblio-home.js";
15
+ import { addBiblioFavorite, getAddBiblioFavoriteUrl, getListBiblioCategoriesUrl, getListBiblioFavoritesUrl, getListHistoryUrl, getListPacksUrl, getReadPreferencesUrl, getRemoveBiblioFavoriteUrl, getReplaceCategoryPreferencesUrl, listBiblioCategories, listBiblioFavorites, listHistory, listPacks, readPreferences, removeBiblioFavorite, replaceCategoryPreferences } from "./biblio-library.js";
16
+ import { createLicense, deleteLicense, getCreateLicenseUrl, getDeleteLicenseUrl, getReadLicenseUrl, readLicense } from "./biblio-nextory.js";
17
+ import { getListPressArticlesUrl, getReadPressArticleUrl, getReadPressReviewUrl, listPressArticles, readPressArticle, readPressReview } from "./biblio-press.js";
18
+ import { getSearchUrl, search } from "./biblio-search.js";
19
+ import { getRecordReadingSessionUrl, recordReadingSession } from "./biblio-telemetry.js";
20
+ import { closeLease, getCloseLeaseUrl, getRenewLeaseUrl, renewLease } from "./consumption.js";
21
+ import { createReport, getCreateReportUrl, getListNotificationsUrl, listNotifications } from "./cvs-app.js";
22
+ import { getOpenAtSupplierUrl, getRateDocumentUrl, getReadDocumentUrl, getReadLastPositionUrl, getSearchDocumentsUrl, getSetLastPositionUrl, getWriteReviewUrl, openAtSupplier, rateDocument, readDocument, readLastPosition, searchDocuments, setLastPosition, writeReview } from "./cvs-documents.js";
23
+ import { addCvsFavorite, getAddCvsFavoriteUrl, getListCvsFavoritesUrl, getListSelectionsUrl, getRemoveCvsFavoriteUrl, listCvsFavorites, listSelections, removeCvsFavorite } from "./cvs-favorites.js";
24
+ import { borrow, extendLoan, getBorrowUrl, getExtendLoanUrl, getListLoansUrl, getReturnLoanUrl, listLoans, returnLoan } from "./cvs-loans.js";
25
+ import { getStartSessionUrl, getStreamingDetailsUrl, startSession, streamingDetails } from "./cvs-streaming.js";
26
+ import { addPartnerFavorite, getAddPartnerFavoriteUrl, getListMediaUrl, getListPartnerCategoriesUrl, getListPartnerFavoritesUrl, getReadMediaUrl, getRemovePartnerFavoriteUrl, listMedia, listPartnerCategories, listPartnerFavorites, readMedia, removePartnerFavorite } from "./partner-catalogue.js";
27
+ import { getListCurrentReadingsUrl, getReadPackageUrl, getReadPositionUrl, getWritePositionUrl, listCurrentReadings, readPackage, readPosition, writePosition } from "./partner-reader.js";
28
+ import { createProfile, deleteProfile, getCreateProfileUrl, getDeleteProfileUrl, getListProfilesUrl, getReadProfileUrl, getUpdateProfileUrl, listProfiles, readProfile, updateProfile } from "./profiles.js";
29
+ import { getListGoalsUrl, getListLevelsUrl, getListSubjectsUrl, listGoals, listLevels, listSubjects } from "./tutoring-catalogue.js";
30
+ import { getListMessagesUrl, getMintChatTicketUrl, getSendMessageUrl, listMessages, mintChatTicket, sendMessage } from "./tutoring-chat.js";
31
+ import { dispatchRequest, getDispatchRequestUrl, getListQueueUrl, getTriageRequestUrl, listQueue, triageRequest } from "./tutoring-dispatch.js";
32
+ import { answerRequest, claimRequest, closeRequest, getAnswerRequestUrl, getClaimRequestUrl, getCloseRequestUrl, getOpenRoomUrl, openRoom } from "./tutoring-practitioner.js";
33
+ import { cancelRequest, deleteAttachment, getCancelRequestUrl, getDeleteAttachmentUrl, getGetRequestUrl, getListMyRequestsUrl, getRateRequestUrl, getRequest, getSubmitRequestUrl, getUploadAttachmentUrl, listMyRequests, rateRequest, submitRequest, uploadAttachment } from "./tutoring-requests.js";
34
+ export { addBiblioFavorite, addCvsFavorite, addPartnerFavorite, adminCloseRequest, amendGoal, amendLevel, amendPractitioner, amendRequest, amendSubject, amendTheme, answerRequest, authorization, borrow, cancelRequest, claimRequest, closeLease, closeRequest, closeSupportSession, createDemoUser, createGoal, createLevel, createLicense, createProfile, createReport, createSessionFromCode, createSessionFromCredentials, createSubject, createTheme, deleteAccount, deleteAttachment, deleteLicense, deleteProfile, deleteSession, deleteTheme, dispatchRequest, extendLoan, forceCloseLease, getAddBiblioFavoriteUrl, getAddCvsFavoriteUrl, getAddPartnerFavoriteUrl, getAdminCloseRequestUrl, getAmendGoalUrl, getAmendLevelUrl, getAmendPractitionerUrl, getAmendRequestUrl, getAmendSubjectUrl, getAmendThemeUrl, getAnswerRequestUrl, getAuthorizationUrl, getBorrowUrl, getCancelRequestUrl, getClaimRequestUrl, getCloseLeaseUrl, getCloseRequestUrl, getCloseSupportSessionUrl, getCreateDemoUserUrl, getCreateGoalUrl, getCreateLevelUrl, getCreateLicenseUrl, getCreateProfileUrl, getCreateReportUrl, getCreateSessionFromCodeUrl, getCreateSessionFromCredentialsUrl, getCreateSubjectUrl, getCreateThemeUrl, getDeleteAccountUrl, getDeleteAttachmentUrl, getDeleteLicenseUrl, getDeleteProfileUrl, getDeleteSessionUrl, getDeleteThemeUrl, getDispatchRequestUrl, getExtendLoanUrl, getForceCloseLeaseUrl, getGetRequestUrl, getLikeContentUrl, getListAllRequestsUrl, getListBiblioCategoriesUrl, getListBiblioFavoritesUrl, getListCurrentReadingsUrl, getListCvsFavoritesUrl, getListEditorsUrl, getListExpiringDocumentsUrl, getListFeedbackUrl, getListGoalsUrl, getListGrantsUrl, getListHistoryUrl, getListLevelsUrl, getListLiveLeasesUrl, getListLoansUrl, getListMediaUrl, getListMessagesUrl, getListMyRequestsUrl, getListNotificationsUrl, getListPacksUrl, getListPartnerCategoriesUrl, getListPartnerFavoritesUrl, getListPatronsUrl, getListPractitionerDocumentsUrl, getListPractitionersUrl, getListPressArticlesUrl, getListProfilesUrl, getListQueueUrl, getListReviewsUrl, getListSelectionsUrl, getListServicesUrl, getListSubjectsUrl, getListTenantsUrl, getListThemesUrl, getMintChatTicketUrl, getModerateFeedbackUrl, getModerateReviewUrl, getOpenAtSupplierUrl, getOpenRoomUrl, getOpenSupportSessionUrl, getRateDocumentUrl, getRateRequestUrl, getReadAccountUrl, getReadCatalogThemeUrl, getReadCatalogUrl, getReadContentUrl, getReadDocumentUrl, getReadDraftUrl, getReadEditorUrl, getReadHomeFeedUrl, getReadLastPositionUrl, getReadLearningPathUrl, getReadLicenseUrl, getReadMeUrl, getReadMediaUrl, getReadPackUrl, getReadPackageUrl, getReadPatronLicenseUrl, getReadPatronUrl, getReadPositionUrl, getReadPreferencesUrl, getReadPressArticleUrl, getReadPressReviewUrl, getReadProfileUrl, getReadRecommendationsUrl, getReadRequestUrl, getReadTenantUrl, getReadThemeUrl, getRecordReadingSessionUrl, getRefreshSessionUrl, getRemoveBiblioFavoriteUrl, getRemoveCvsFavoriteUrl, getRemovePartnerFavoriteUrl, getRenewLeaseUrl, getReorderThemesUrl, getReplaceCategoryPreferencesUrl, getReplaceGrantsUrl, getRequest, getReturnLoanUrl, getReviewDraftUrl, getSearchDocumentsUrl, getSearchUrl, getSendMessageUrl, getSetLastPositionUrl, getStartSessionUrl, getStreamingDetailsUrl, getSubmitRequestUrl, getTriageRequestUrl, getUnlikeContentUrl, getUpdateAccountUrl, getUpdatePatronUrl, getUpdateProfileUrl, getUpdateTenantUrl, getUploadAttachmentUrl, getWritePositionUrl, getWriteReviewUrl, likeContent, listAllRequests, listBiblioCategories, listBiblioFavorites, listCurrentReadings, listCvsFavorites, listEditors, listExpiringDocuments, listFeedback, listGoals, listGrants, listHistory, listLevels, listLiveLeases, listLoans, listMedia, listMessages, listMyRequests, listNotifications, listPacks, listPartnerCategories, listPartnerFavorites, listPatrons, listPractitionerDocuments, listPractitioners, listPressArticles, listProfiles, listQueue, listReviews, listSelections, listServices, listSubjects, listTenants, listThemes, mintChatTicket, moderateFeedback, moderateReview, openAtSupplier, openRoom, openSupportSession, rateDocument, rateRequest, readAccount, readCatalog, readCatalogTheme, readContent, readDocument, readDraft, readEditor, readHomeFeed, readLastPosition, readLearningPath, readLicense, readMe, readMedia, readPack, readPackage, readPatron, readPatronLicense, readPosition, readPreferences, readPressArticle, readPressReview, readProfile, readRecommendations, readRequest, readTenant, readTheme, recordReadingSession, refreshSession, removeBiblioFavorite, removeCvsFavorite, removePartnerFavorite, renewLease, reorderThemes, replaceCategoryPreferences, replaceGrants, returnLoan, reviewDraft, search, searchDocuments, sendMessage, setLastPosition, startSession, streamingDetails, submitRequest, triageRequest, unlikeContent, updateAccount, updatePatron, updateProfile, updateTenant, uploadAttachment, writePosition, writeReview };
@@ -0,0 +1,34 @@
1
+
2
+ import { deleteAccount, getDeleteAccountUrl, getListServicesUrl, getReadAccountUrl, getUpdateAccountUrl, listServices, readAccount, updateAccount } from "./account.js";
3
+ import { amendTheme, createTheme, deleteTheme, getAmendThemeUrl, getCreateThemeUrl, getDeleteThemeUrl, getListThemesUrl, getReadThemeUrl, getReorderThemesUrl, listThemes, readTheme, reorderThemes } from "./admin-catalogue.js";
4
+ import { forceCloseLease, getForceCloseLeaseUrl, getListLiveLeasesUrl, listLiveLeases } from "./admin-consumption.js";
5
+ import { getReadPatronLicenseUrl, readPatronLicense } from "./admin-licenses.js";
6
+ import { getListPatronsUrl, getReadPatronUrl, getUpdatePatronUrl, listPatrons, readPatron, updatePatron } from "./admin-patrons.js";
7
+ import { getListReviewsUrl, getModerateReviewUrl, listReviews, moderateReview } from "./admin-reviews.js";
8
+ import { getListGrantsUrl, getReplaceGrantsUrl, listGrants, replaceGrants } from "./admin-roles.js";
9
+ import { closeSupportSession, createDemoUser, getCloseSupportSessionUrl, getCreateDemoUserUrl, getOpenSupportSessionUrl, openSupportSession } from "./admin-support.js";
10
+ import { getListTenantsUrl, getReadTenantUrl, getUpdateTenantUrl, listTenants, readTenant, updateTenant } from "./admin-tenants.js";
11
+ import { adminCloseRequest, amendGoal, amendLevel, amendPractitioner, amendRequest, amendSubject, createGoal, createLevel, createSubject, getAdminCloseRequestUrl, getAmendGoalUrl, getAmendLevelUrl, getAmendPractitionerUrl, getAmendRequestUrl, getAmendSubjectUrl, getCreateGoalUrl, getCreateLevelUrl, getCreateSubjectUrl, getListAllRequestsUrl, getListExpiringDocumentsUrl, getListFeedbackUrl, getListPractitionerDocumentsUrl, getListPractitionersUrl, getModerateFeedbackUrl, getReadDraftUrl, getReadRequestUrl, getReviewDraftUrl, listAllRequests, listExpiringDocuments, listFeedback, listPractitionerDocuments, listPractitioners, moderateFeedback, readDraft, readRequest, reviewDraft } from "./admin-tutoring.js";
12
+ import { authorization, createSessionFromCode, createSessionFromCredentials, deleteSession, getAuthorizationUrl, getCreateSessionFromCodeUrl, getCreateSessionFromCredentialsUrl, getDeleteSessionUrl, getReadMeUrl, getRefreshSessionUrl, readMe, refreshSession } from "./auth.js";
13
+ import { getLikeContentUrl, getListEditorsUrl, getReadCatalogThemeUrl, getReadCatalogUrl, getReadContentUrl, getReadEditorUrl, getReadLearningPathUrl, getReadPackUrl, getReadRecommendationsUrl, getUnlikeContentUrl, likeContent, listEditors, readCatalog, readCatalogTheme, readContent, readEditor, readLearningPath, readPack, readRecommendations, unlikeContent } from "./biblio-catalogue.js";
14
+ import { getReadHomeFeedUrl, readHomeFeed } from "./biblio-home.js";
15
+ import { addBiblioFavorite, getAddBiblioFavoriteUrl, getListBiblioCategoriesUrl, getListBiblioFavoritesUrl, getListHistoryUrl, getListPacksUrl, getReadPreferencesUrl, getRemoveBiblioFavoriteUrl, getReplaceCategoryPreferencesUrl, listBiblioCategories, listBiblioFavorites, listHistory, listPacks, readPreferences, removeBiblioFavorite, replaceCategoryPreferences } from "./biblio-library.js";
16
+ import { createLicense, deleteLicense, getCreateLicenseUrl, getDeleteLicenseUrl, getReadLicenseUrl, readLicense } from "./biblio-nextory.js";
17
+ import { getListPressArticlesUrl, getReadPressArticleUrl, getReadPressReviewUrl, listPressArticles, readPressArticle, readPressReview } from "./biblio-press.js";
18
+ import { getSearchUrl, search } from "./biblio-search.js";
19
+ import { getRecordReadingSessionUrl, recordReadingSession } from "./biblio-telemetry.js";
20
+ import { closeLease, getCloseLeaseUrl, getRenewLeaseUrl, renewLease } from "./consumption.js";
21
+ import { createReport, getCreateReportUrl, getListNotificationsUrl, listNotifications } from "./cvs-app.js";
22
+ import { getOpenAtSupplierUrl, getRateDocumentUrl, getReadDocumentUrl, getReadLastPositionUrl, getSearchDocumentsUrl, getSetLastPositionUrl, getWriteReviewUrl, openAtSupplier, rateDocument, readDocument, readLastPosition, searchDocuments, setLastPosition, writeReview } from "./cvs-documents.js";
23
+ import { addCvsFavorite, getAddCvsFavoriteUrl, getListCvsFavoritesUrl, getListSelectionsUrl, getRemoveCvsFavoriteUrl, listCvsFavorites, listSelections, removeCvsFavorite } from "./cvs-favorites.js";
24
+ import { borrow, extendLoan, getBorrowUrl, getExtendLoanUrl, getListLoansUrl, getReturnLoanUrl, listLoans, returnLoan } from "./cvs-loans.js";
25
+ import { getStartSessionUrl, getStreamingDetailsUrl, startSession, streamingDetails } from "./cvs-streaming.js";
26
+ import { addPartnerFavorite, getAddPartnerFavoriteUrl, getListMediaUrl, getListPartnerCategoriesUrl, getListPartnerFavoritesUrl, getReadMediaUrl, getRemovePartnerFavoriteUrl, listMedia, listPartnerCategories, listPartnerFavorites, readMedia, removePartnerFavorite } from "./partner-catalogue.js";
27
+ import { getListCurrentReadingsUrl, getReadPackageUrl, getReadPositionUrl, getWritePositionUrl, listCurrentReadings, readPackage, readPosition, writePosition } from "./partner-reader.js";
28
+ import { createProfile, deleteProfile, getCreateProfileUrl, getDeleteProfileUrl, getListProfilesUrl, getReadProfileUrl, getUpdateProfileUrl, listProfiles, readProfile, updateProfile } from "./profiles.js";
29
+ import { getListGoalsUrl, getListLevelsUrl, getListSubjectsUrl, listGoals, listLevels, listSubjects } from "./tutoring-catalogue.js";
30
+ import { getListMessagesUrl, getMintChatTicketUrl, getSendMessageUrl, listMessages, mintChatTicket, sendMessage } from "./tutoring-chat.js";
31
+ import { dispatchRequest, getDispatchRequestUrl, getListQueueUrl, getTriageRequestUrl, listQueue, triageRequest } from "./tutoring-dispatch.js";
32
+ import { answerRequest, claimRequest, closeRequest, getAnswerRequestUrl, getClaimRequestUrl, getCloseRequestUrl, getOpenRoomUrl, openRoom } from "./tutoring-practitioner.js";
33
+ import { cancelRequest, deleteAttachment, getCancelRequestUrl, getDeleteAttachmentUrl, getGetRequestUrl, getListMyRequestsUrl, getRateRequestUrl, getRequest, getSubmitRequestUrl, getUploadAttachmentUrl, listMyRequests, rateRequest, submitRequest, uploadAttachment } from "./tutoring-requests.js";
34
+ export { addBiblioFavorite, addCvsFavorite, addPartnerFavorite, adminCloseRequest, amendGoal, amendLevel, amendPractitioner, amendRequest, amendSubject, amendTheme, answerRequest, authorization, borrow, cancelRequest, claimRequest, closeLease, closeRequest, closeSupportSession, createDemoUser, createGoal, createLevel, createLicense, createProfile, createReport, createSessionFromCode, createSessionFromCredentials, createSubject, createTheme, deleteAccount, deleteAttachment, deleteLicense, deleteProfile, deleteSession, deleteTheme, dispatchRequest, extendLoan, forceCloseLease, getAddBiblioFavoriteUrl, getAddCvsFavoriteUrl, getAddPartnerFavoriteUrl, getAdminCloseRequestUrl, getAmendGoalUrl, getAmendLevelUrl, getAmendPractitionerUrl, getAmendRequestUrl, getAmendSubjectUrl, getAmendThemeUrl, getAnswerRequestUrl, getAuthorizationUrl, getBorrowUrl, getCancelRequestUrl, getClaimRequestUrl, getCloseLeaseUrl, getCloseRequestUrl, getCloseSupportSessionUrl, getCreateDemoUserUrl, getCreateGoalUrl, getCreateLevelUrl, getCreateLicenseUrl, getCreateProfileUrl, getCreateReportUrl, getCreateSessionFromCodeUrl, getCreateSessionFromCredentialsUrl, getCreateSubjectUrl, getCreateThemeUrl, getDeleteAccountUrl, getDeleteAttachmentUrl, getDeleteLicenseUrl, getDeleteProfileUrl, getDeleteSessionUrl, getDeleteThemeUrl, getDispatchRequestUrl, getExtendLoanUrl, getForceCloseLeaseUrl, getGetRequestUrl, getLikeContentUrl, getListAllRequestsUrl, getListBiblioCategoriesUrl, getListBiblioFavoritesUrl, getListCurrentReadingsUrl, getListCvsFavoritesUrl, getListEditorsUrl, getListExpiringDocumentsUrl, getListFeedbackUrl, getListGoalsUrl, getListGrantsUrl, getListHistoryUrl, getListLevelsUrl, getListLiveLeasesUrl, getListLoansUrl, getListMediaUrl, getListMessagesUrl, getListMyRequestsUrl, getListNotificationsUrl, getListPacksUrl, getListPartnerCategoriesUrl, getListPartnerFavoritesUrl, getListPatronsUrl, getListPractitionerDocumentsUrl, getListPractitionersUrl, getListPressArticlesUrl, getListProfilesUrl, getListQueueUrl, getListReviewsUrl, getListSelectionsUrl, getListServicesUrl, getListSubjectsUrl, getListTenantsUrl, getListThemesUrl, getMintChatTicketUrl, getModerateFeedbackUrl, getModerateReviewUrl, getOpenAtSupplierUrl, getOpenRoomUrl, getOpenSupportSessionUrl, getRateDocumentUrl, getRateRequestUrl, getReadAccountUrl, getReadCatalogThemeUrl, getReadCatalogUrl, getReadContentUrl, getReadDocumentUrl, getReadDraftUrl, getReadEditorUrl, getReadHomeFeedUrl, getReadLastPositionUrl, getReadLearningPathUrl, getReadLicenseUrl, getReadMeUrl, getReadMediaUrl, getReadPackUrl, getReadPackageUrl, getReadPatronLicenseUrl, getReadPatronUrl, getReadPositionUrl, getReadPreferencesUrl, getReadPressArticleUrl, getReadPressReviewUrl, getReadProfileUrl, getReadRecommendationsUrl, getReadRequestUrl, getReadTenantUrl, getReadThemeUrl, getRecordReadingSessionUrl, getRefreshSessionUrl, getRemoveBiblioFavoriteUrl, getRemoveCvsFavoriteUrl, getRemovePartnerFavoriteUrl, getRenewLeaseUrl, getReorderThemesUrl, getReplaceCategoryPreferencesUrl, getReplaceGrantsUrl, getRequest, getReturnLoanUrl, getReviewDraftUrl, getSearchDocumentsUrl, getSearchUrl, getSendMessageUrl, getSetLastPositionUrl, getStartSessionUrl, getStreamingDetailsUrl, getSubmitRequestUrl, getTriageRequestUrl, getUnlikeContentUrl, getUpdateAccountUrl, getUpdatePatronUrl, getUpdateProfileUrl, getUpdateTenantUrl, getUploadAttachmentUrl, getWritePositionUrl, getWriteReviewUrl, likeContent, listAllRequests, listBiblioCategories, listBiblioFavorites, listCurrentReadings, listCvsFavorites, listEditors, listExpiringDocuments, listFeedback, listGoals, listGrants, listHistory, listLevels, listLiveLeases, listLoans, listMedia, listMessages, listMyRequests, listNotifications, listPacks, listPartnerCategories, listPartnerFavorites, listPatrons, listPractitionerDocuments, listPractitioners, listPressArticles, listProfiles, listQueue, listReviews, listSelections, listServices, listSubjects, listTenants, listThemes, mintChatTicket, moderateFeedback, moderateReview, openAtSupplier, openRoom, openSupportSession, rateDocument, rateRequest, readAccount, readCatalog, readCatalogTheme, readContent, readDocument, readDraft, readEditor, readHomeFeed, readLastPosition, readLearningPath, readLicense, readMe, readMedia, readPack, readPackage, readPatron, readPatronLicense, readPosition, readPreferences, readPressArticle, readPressReview, readProfile, readRecommendations, readRequest, readTenant, readTheme, recordReadingSession, refreshSession, removeBiblioFavorite, removeCvsFavorite, removePartnerFavorite, renewLease, reorderThemes, replaceCategoryPreferences, replaceGrants, returnLoan, reviewDraft, search, searchDocuments, sendMessage, setLastPosition, startSession, streamingDetails, submitRequest, triageRequest, unlikeContent, updateAccount, updatePatron, updateProfile, updateTenant, uploadAttachment, writePosition, writeReview };
@@ -0,0 +1,77 @@
1
+
2
+ import { Bt as PartnerCategoryListRead, It as PartnerMediaRead, Lt as PartnerMediaPage, Nn as PartnerProvider, Rt as PartnerFavoriteListRead, _n as ListMediaParams } from "../index-wL_20vR8.js";
3
+ import { c as request } from "../client-BDwBZYB0.js";
4
+ //#region src/api/partner-catalogue/partner-catalogue.d.ts
5
+ export declare const getListPartnerCategoriesUrl: (provider: PartnerProvider) => string;
6
+ /**
7
+ * The provider's taxonomy, with a count per node for this caller's slice.
8
+ *
9
+ * Counts come from ``partner_category_total`` and are summed across languages,
10
+ * because the menu shows one number and the rollup is keyed per language. A
11
+ * node with no matching rollup row reports ``0`` rather than being hidden: the
12
+ * tree shape is stable, and a branch that vanishes because today's import found
13
+ * nothing in it is harder to reason about than one that reads zero.
14
+ * @summary List Partner Categories
15
+ */
16
+ export declare const listPartnerCategories: (provider: PartnerProvider, options?: Parameters<typeof request>[1]) => Promise<PartnerCategoryListRead>;
17
+ export declare const getListPartnerFavoritesUrl: (provider: PartnerProvider) => string;
18
+ /**
19
+ * This reader's bookmarks, filtered to what they may still see.
20
+ *
21
+ * The filter matters: a title can become adult-only, or leave the plan, between
22
+ * being bookmarked and being listed. The legacy joined favourites to media with
23
+ * no visibility predicate at all.
24
+ * @summary List Partner Favorites
25
+ */
26
+ export declare const listPartnerFavorites: (provider: PartnerProvider, options?: Parameters<typeof request>[1]) => Promise<PartnerFavoriteListRead>;
27
+ export declare const getRemovePartnerFavoriteUrl: (provider: PartnerProvider, mediaId: number) => string;
28
+ /**
29
+ * Remove a bookmark. Idempotent, and deliberately not visibility-filtered.
30
+ *
31
+ * A reader must be able to unbookmark a title they can no longer see —
32
+ * otherwise a media leaving their plan strands a row they have no way to
33
+ * remove.
34
+ * @summary Remove Partner Favorite
35
+ */
36
+ export declare const removePartnerFavorite: (provider: PartnerProvider, mediaId: number, options?: Parameters<typeof request>[1]) => Promise<void>;
37
+ export declare const getAddPartnerFavoriteUrl: (provider: PartnerProvider, mediaId: number) => string;
38
+ /**
39
+ * Bookmark a title. Idempotent.
40
+ *
41
+ * ``PUT``/``DELETE`` rather than the legacy's ``POST /toggle-favorite.json``. A
42
+ * toggle is not idempotent, and the legacy's had no uniqueness behind it: two
43
+ * tabs toggling at once left two rows, and un-toggling then removed one of
44
+ * them, so the title stayed bookmarked.
45
+ * @summary Add Partner Favorite
46
+ */
47
+ export declare const addPartnerFavorite: (provider: PartnerProvider, mediaId: number, options?: Parameters<typeof request>[1]) => Promise<void>;
48
+ export declare const getListMediaUrl: (provider: PartnerProvider, params?: ListMediaParams) => string;
49
+ /**
50
+ * A page of the catalogue.
51
+ *
52
+ * ``q`` ranks through Elasticsearch and then **intersects** with the same
53
+ * visibility subquery as an unfiltered listing — the index knows nothing about
54
+ * plans or ages, so authorisation happens here whatever the index returns. An
55
+ * index that is missing or unreachable yields no candidates, which reads as an
56
+ * empty page rather than an unfiltered one.
57
+ *
58
+ * A search result keeps the index's ranking rather than applying ``order``:
59
+ * re-sorting relevance by publication date discards the only thing the search
60
+ * contributed. That is why ``order`` is ignored when ``q`` is present, not
61
+ * silently combined with it.
62
+ * @summary List Media
63
+ */
64
+ export declare const listMedia: (provider: PartnerProvider, params?: ListMediaParams, options?: Parameters<typeof request>[1]) => Promise<PartnerMediaPage>;
65
+ export declare const getReadMediaUrl: (provider: PartnerProvider, mediaId: number) => string;
66
+ /**
67
+ * One title.
68
+ *
69
+ * A media outside the caller's slice is ``404``, not ``403``: whether an adult
70
+ * title exists is itself something a minor's client should not be able to
71
+ * determine, and the legacy's detail page dereferenced an unknown id straight
72
+ * into a 500.
73
+ * @summary Read Media
74
+ */
75
+ export declare const readMedia: (provider: PartnerProvider, mediaId: number, options?: Parameters<typeof request>[1]) => Promise<PartnerMediaRead>;
76
+ //#endregion
77
+ //# sourceMappingURL=partner-catalogue.d.ts.map
@@ -0,0 +1,125 @@
1
+
2
+ import { r as request } from "../client-D3kMOcIr.js";
3
+ //#region src/api/partner-catalogue/partner-catalogue.ts
4
+ const getListPartnerCategoriesUrl = (provider) => {
5
+ return `/partners/${provider}/categories`;
6
+ };
7
+ /**
8
+ * The provider's taxonomy, with a count per node for this caller's slice.
9
+ *
10
+ * Counts come from ``partner_category_total`` and are summed across languages,
11
+ * because the menu shows one number and the rollup is keyed per language. A
12
+ * node with no matching rollup row reports ``0`` rather than being hidden: the
13
+ * tree shape is stable, and a branch that vanishes because today's import found
14
+ * nothing in it is harder to reason about than one that reads zero.
15
+ * @summary List Partner Categories
16
+ */
17
+ const listPartnerCategories = async (provider, options) => {
18
+ return request(getListPartnerCategoriesUrl(provider), {
19
+ ...options,
20
+ method: "GET"
21
+ });
22
+ };
23
+ const getListPartnerFavoritesUrl = (provider) => {
24
+ return `/partners/${provider}/favorites`;
25
+ };
26
+ /**
27
+ * This reader's bookmarks, filtered to what they may still see.
28
+ *
29
+ * The filter matters: a title can become adult-only, or leave the plan, between
30
+ * being bookmarked and being listed. The legacy joined favourites to media with
31
+ * no visibility predicate at all.
32
+ * @summary List Partner Favorites
33
+ */
34
+ const listPartnerFavorites = async (provider, options) => {
35
+ return request(getListPartnerFavoritesUrl(provider), {
36
+ ...options,
37
+ method: "GET"
38
+ });
39
+ };
40
+ const getRemovePartnerFavoriteUrl = (provider, mediaId) => {
41
+ return `/partners/${provider}/favorites/${mediaId}`;
42
+ };
43
+ /**
44
+ * Remove a bookmark. Idempotent, and deliberately not visibility-filtered.
45
+ *
46
+ * A reader must be able to unbookmark a title they can no longer see —
47
+ * otherwise a media leaving their plan strands a row they have no way to
48
+ * remove.
49
+ * @summary Remove Partner Favorite
50
+ */
51
+ const removePartnerFavorite = async (provider, mediaId, options) => {
52
+ return request(getRemovePartnerFavoriteUrl(provider, mediaId), {
53
+ ...options,
54
+ method: "DELETE"
55
+ });
56
+ };
57
+ const getAddPartnerFavoriteUrl = (provider, mediaId) => {
58
+ return `/partners/${provider}/favorites/${mediaId}`;
59
+ };
60
+ /**
61
+ * Bookmark a title. Idempotent.
62
+ *
63
+ * ``PUT``/``DELETE`` rather than the legacy's ``POST /toggle-favorite.json``. A
64
+ * toggle is not idempotent, and the legacy's had no uniqueness behind it: two
65
+ * tabs toggling at once left two rows, and un-toggling then removed one of
66
+ * them, so the title stayed bookmarked.
67
+ * @summary Add Partner Favorite
68
+ */
69
+ const addPartnerFavorite = async (provider, mediaId, options) => {
70
+ return request(getAddPartnerFavoriteUrl(provider, mediaId), {
71
+ ...options,
72
+ method: "PUT"
73
+ });
74
+ };
75
+ const getListMediaUrl = (provider, params) => {
76
+ const normalizedParams = new URLSearchParams();
77
+ Object.entries(params || {}).forEach(([key, value]) => {
78
+ if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
79
+ });
80
+ const stringifiedParams = normalizedParams.toString();
81
+ return stringifiedParams.length > 0 ? `/partners/${provider}/media?${stringifiedParams}` : `/partners/${provider}/media`;
82
+ };
83
+ /**
84
+ * A page of the catalogue.
85
+ *
86
+ * ``q`` ranks through Elasticsearch and then **intersects** with the same
87
+ * visibility subquery as an unfiltered listing — the index knows nothing about
88
+ * plans or ages, so authorisation happens here whatever the index returns. An
89
+ * index that is missing or unreachable yields no candidates, which reads as an
90
+ * empty page rather than an unfiltered one.
91
+ *
92
+ * A search result keeps the index's ranking rather than applying ``order``:
93
+ * re-sorting relevance by publication date discards the only thing the search
94
+ * contributed. That is why ``order`` is ignored when ``q`` is present, not
95
+ * silently combined with it.
96
+ * @summary List Media
97
+ */
98
+ const listMedia = async (provider, params, options) => {
99
+ return request(getListMediaUrl(provider, params), {
100
+ ...options,
101
+ method: "GET"
102
+ });
103
+ };
104
+ const getReadMediaUrl = (provider, mediaId) => {
105
+ return `/partners/${provider}/media/${mediaId}`;
106
+ };
107
+ /**
108
+ * One title.
109
+ *
110
+ * A media outside the caller's slice is ``404``, not ``403``: whether an adult
111
+ * title exists is itself something a minor's client should not be able to
112
+ * determine, and the legacy's detail page dereferenced an unknown id straight
113
+ * into a 500.
114
+ * @summary Read Media
115
+ */
116
+ const readMedia = async (provider, mediaId, options) => {
117
+ return request(getReadMediaUrl(provider, mediaId), {
118
+ ...options,
119
+ method: "GET"
120
+ });
121
+ };
122
+ //#endregion
123
+ export { addPartnerFavorite, getAddPartnerFavoriteUrl, getListMediaUrl, getListPartnerCategoriesUrl, getListPartnerFavoritesUrl, getReadMediaUrl, getRemovePartnerFavoriteUrl, listMedia, listPartnerCategories, listPartnerFavorites, readMedia, removePartnerFavorite };
124
+
125
+ //# sourceMappingURL=partner-catalogue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"partner-catalogue.js","names":[],"sources":["../../src/api/partner-catalogue/partner-catalogue.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.1.0\n */\nimport type {\n ListMediaParams,\n PartnerCategoryListRead,\n PartnerFavoriteListRead,\n PartnerMediaPage,\n PartnerMediaRead,\n PartnerProvider\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getListPartnerCategoriesUrl = (provider: PartnerProvider,) => {\n\n\n\n\n return `/partners/${provider}/categories`\n}\n\n/**\n * The provider's taxonomy, with a count per node for this caller's slice.\n *\n * Counts come from ``partner_category_total`` and are summed across languages,\n * because the menu shows one number and the rollup is keyed per language. A\n * node with no matching rollup row reports ``0`` rather than being hidden: the\n * tree shape is stable, and a branch that vanishes because today's import found\n * nothing in it is harder to reason about than one that reads zero.\n * @summary List Partner Categories\n */\nexport const listPartnerCategories = async (provider: PartnerProvider, options?: Parameters<typeof request>[1]): Promise<PartnerCategoryListRead> => {\n\n return request<PartnerCategoryListRead>(getListPartnerCategoriesUrl(provider),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getListPartnerFavoritesUrl = (provider: PartnerProvider,) => {\n\n\n\n\n return `/partners/${provider}/favorites`\n}\n\n/**\n * This reader's bookmarks, filtered to what they may still see.\n *\n * The filter matters: a title can become adult-only, or leave the plan, between\n * being bookmarked and being listed. The legacy joined favourites to media with\n * no visibility predicate at all.\n * @summary List Partner Favorites\n */\nexport const listPartnerFavorites = async (provider: PartnerProvider, options?: Parameters<typeof request>[1]): Promise<PartnerFavoriteListRead> => {\n\n return request<PartnerFavoriteListRead>(getListPartnerFavoritesUrl(provider),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getRemovePartnerFavoriteUrl = (provider: PartnerProvider,\n mediaId: number,) => {\n\n\n\n\n return `/partners/${provider}/favorites/${mediaId}`\n}\n\n/**\n * Remove a bookmark. Idempotent, and deliberately not visibility-filtered.\n *\n * A reader must be able to unbookmark a title they can no longer see —\n * otherwise a media leaving their plan strands a row they have no way to\n * remove.\n * @summary Remove Partner Favorite\n */\nexport const removePartnerFavorite = async (provider: PartnerProvider,\n mediaId: number, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getRemovePartnerFavoriteUrl(provider,mediaId),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\nexport const getAddPartnerFavoriteUrl = (provider: PartnerProvider,\n mediaId: number,) => {\n\n\n\n\n return `/partners/${provider}/favorites/${mediaId}`\n}\n\n/**\n * Bookmark a title. Idempotent.\n *\n * ``PUT``/``DELETE`` rather than the legacy's ``POST /toggle-favorite.json``. A\n * toggle is not idempotent, and the legacy's had no uniqueness behind it: two\n * tabs toggling at once left two rows, and un-toggling then removed one of\n * them, so the title stayed bookmarked.\n * @summary Add Partner Favorite\n */\nexport const addPartnerFavorite = async (provider: PartnerProvider,\n mediaId: number, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getAddPartnerFavoriteUrl(provider,mediaId),\n {\n ...options,\n method: 'PUT'\n\n\n }\n);}\n\n\nexport const getListMediaUrl = (provider: PartnerProvider,\n params?: ListMediaParams,) => {\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 ? `/partners/${provider}/media?${stringifiedParams}` : `/partners/${provider}/media`\n}\n\n/**\n * A page of the catalogue.\n *\n * ``q`` ranks through Elasticsearch and then **intersects** with the same\n * visibility subquery as an unfiltered listing — the index knows nothing about\n * plans or ages, so authorisation happens here whatever the index returns. An\n * index that is missing or unreachable yields no candidates, which reads as an\n * empty page rather than an unfiltered one.\n *\n * A search result keeps the index's ranking rather than applying ``order``:\n * re-sorting relevance by publication date discards the only thing the search\n * contributed. That is why ``order`` is ignored when ``q`` is present, not\n * silently combined with it.\n * @summary List Media\n */\nexport const listMedia = async (provider: PartnerProvider,\n params?: ListMediaParams, options?: Parameters<typeof request>[1]): Promise<PartnerMediaPage> => {\n\n return request<PartnerMediaPage>(getListMediaUrl(provider,params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getReadMediaUrl = (provider: PartnerProvider,\n mediaId: number,) => {\n\n\n\n\n return `/partners/${provider}/media/${mediaId}`\n}\n\n/**\n * One title.\n *\n * A media outside the caller's slice is ``404``, not ``403``: whether an adult\n * title exists is itself something a minor's client should not be able to\n * determine, and the legacy's detail page dereferenced an unknown id straight\n * into a 500.\n * @summary Read Media\n */\nexport const readMedia = async (provider: PartnerProvider,\n mediaId: number, options?: Parameters<typeof request>[1]): Promise<PartnerMediaRead> => {\n\n return request<PartnerMediaRead>(getReadMediaUrl(provider,mediaId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n"],"mappings":";;;AAkBA,MAAa,+BAA+B,aAA+B;CAKzE,OAAO,aAAa,SAAS;AAC/B;;;;;;;;;;;AAYA,MAAa,wBAAwB,OAAO,UAA2B,YAA8E;CAEnJ,OAAO,QAAiC,4BAA4B,QAAQ,GAC5E;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,8BAA8B,aAA+B;CAKxE,OAAO,aAAa,SAAS;AAC/B;;;;;;;;;AAUA,MAAa,uBAAuB,OAAO,UAA2B,YAA8E;CAElJ,OAAO,QAAiC,2BAA2B,QAAQ,GAC3E;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,+BAA+B,UACxC,YAAqB;CAKvB,OAAO,aAAa,SAAS,aAAa;AAC5C;;;;;;;;;AAUA,MAAa,wBAAwB,OAAO,UACxC,SAAiB,YAA2D;CAE9E,OAAO,QAAc,4BAA4B,UAAS,OAAO,GACjE;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,4BAA4B,UACrC,YAAqB;CAKvB,OAAO,aAAa,SAAS,aAAa;AAC5C;;;;;;;;;;AAWA,MAAa,qBAAqB,OAAO,UACrC,SAAiB,YAA2D;CAE9E,OAAO,QAAc,yBAAyB,UAAS,OAAO,GAC9D;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,mBAAmB,UAC5B,WAA8B;CAChC,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,aAAa,SAAS,SAAS,sBAAsB,aAAa,SAAS;AACnH;;;;;;;;;;;;;;;;AAiBA,MAAa,YAAY,OAAO,UAC5B,QAA0B,YAAuE;CAEnG,OAAO,QAA0B,gBAAgB,UAAS,MAAM,GAChE;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,mBAAmB,UAC5B,YAAqB;CAKvB,OAAO,aAAa,SAAS,SAAS;AACxC;;;;;;;;;;AAWA,MAAa,YAAY,OAAO,UAC5B,SAAiB,YAAuE;CAE1F,OAAO,QAA0B,gBAAgB,UAAS,OAAO,GACjE;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE"}
@@ -0,0 +1,56 @@
1
+
2
+ import { Nn as PartnerProvider, Tr as CurrentReadingListRead, ct as ReaderPackageRead, it as ReadingPositionWrite, ot as ReadingPositionRead, tt as ReadPackageParams } from "../index-wL_20vR8.js";
3
+ import { c as request } from "../client-BDwBZYB0.js";
4
+ //#region src/api/partner-reader/partner-reader.d.ts
5
+ export declare const getReadPackageUrl: (provider: PartnerProvider, mediaId: number, params?: ReadPackageParams) => string;
6
+ /**
7
+ * Where to fetch the content itself.
8
+ *
9
+ * The returned URL is a short-lived DRM-wrapped credential. It is not cached
10
+ * here and should not be stored by the client.
11
+ *
12
+ * Opens a consumption lease, so the read appears in the ledger and counts
13
+ * against the establishment's live seats like any other. Its id comes back in
14
+ * ``lease``: keep it alive with ``PUT /consumption/{eventId}`` and drop it with
15
+ * ``DELETE`` when the reader closes. A client that does neither is not broken
16
+ * — the reaper closes the lease about a minute after the last heartbeat — but
17
+ * every such read is a seat held past the end of it.
18
+ *
19
+ * Re-opening the same title returns the lease already held rather than a
20
+ * second one, so a page reload does not leak a seat.
21
+ * @summary Read Package
22
+ */
23
+ export declare const readPackage: (provider: PartnerProvider, mediaId: number, params?: ReadPackageParams, options?: Parameters<typeof request>[1]) => Promise<ReaderPackageRead>;
24
+ export declare const getReadPositionUrl: (provider: PartnerProvider, mediaId: number) => string;
25
+ /**
26
+ * Where this reader last was, according to the partner.
27
+ *
28
+ * ``404`` when the partner holds no position — a book never opened has no
29
+ * place to return to, and reporting zero would make a client jump a reader who
30
+ * *is* mid-book back to the start if the call ever failed soft.
31
+ * @summary Read Position
32
+ */
33
+ export declare const readPosition: (provider: PartnerProvider, mediaId: number, options?: Parameters<typeof request>[1]) => Promise<ReadingPositionRead>;
34
+ export declare const getWritePositionUrl: (provider: PartnerProvider, mediaId: number) => string;
35
+ /**
36
+ * Record progress, and report the partner's own metering alongside it.
37
+ *
38
+ * ``usage_blocks`` is forwarded first when present, because the legacy did and
39
+ * the partner treats the two as one act: metering after a position update
40
+ * records consumption against a page the reader has already left.
41
+ * @summary Write Position
42
+ */
43
+ export declare const writePosition: (provider: PartnerProvider, mediaId: number, readingPositionWrite: ReadingPositionWrite, options?: Parameters<typeof request>[1]) => Promise<ReadingPositionRead>;
44
+ export declare const getListCurrentReadingsUrl: (provider: PartnerProvider) => string;
45
+ /**
46
+ * The partner's own "continue reading" list, joined back to our catalogue.
47
+ *
48
+ * Entries the partner knows and our catalogue does not are dropped rather than
49
+ * surfaced with a null id: the import runs nightly and the partner's list is
50
+ * live, so a title added today is genuinely not browsable here yet, and a card
51
+ * that cannot be opened is worse than one that is absent.
52
+ * @summary List Current Readings
53
+ */
54
+ export declare const listCurrentReadings: (provider: PartnerProvider, options?: Parameters<typeof request>[1]) => Promise<CurrentReadingListRead>;
55
+ //#endregion
56
+ //# sourceMappingURL=partner-reader.d.ts.map
@@ -0,0 +1,103 @@
1
+
2
+ import { r as request } from "../client-D3kMOcIr.js";
3
+ //#region src/api/partner-reader/partner-reader.ts
4
+ const getReadPackageUrl = (provider, mediaId, 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 ? `/partners/${provider}/media/${mediaId}/package?${stringifiedParams}` : `/partners/${provider}/media/${mediaId}/package`;
11
+ };
12
+ /**
13
+ * Where to fetch the content itself.
14
+ *
15
+ * The returned URL is a short-lived DRM-wrapped credential. It is not cached
16
+ * here and should not be stored by the client.
17
+ *
18
+ * Opens a consumption lease, so the read appears in the ledger and counts
19
+ * against the establishment's live seats like any other. Its id comes back in
20
+ * ``lease``: keep it alive with ``PUT /consumption/{eventId}`` and drop it with
21
+ * ``DELETE`` when the reader closes. A client that does neither is not broken
22
+ * — the reaper closes the lease about a minute after the last heartbeat — but
23
+ * every such read is a seat held past the end of it.
24
+ *
25
+ * Re-opening the same title returns the lease already held rather than a
26
+ * second one, so a page reload does not leak a seat.
27
+ * @summary Read Package
28
+ */
29
+ const readPackage = async (provider, mediaId, params, options) => {
30
+ return request(getReadPackageUrl(provider, mediaId, params), {
31
+ ...options,
32
+ method: "GET"
33
+ });
34
+ };
35
+ const getReadPositionUrl = (provider, mediaId) => {
36
+ return `/partners/${provider}/media/${mediaId}/position`;
37
+ };
38
+ /**
39
+ * Where this reader last was, according to the partner.
40
+ *
41
+ * ``404`` when the partner holds no position — a book never opened has no
42
+ * place to return to, and reporting zero would make a client jump a reader who
43
+ * *is* mid-book back to the start if the call ever failed soft.
44
+ * @summary Read Position
45
+ */
46
+ const readPosition = async (provider, mediaId, options) => {
47
+ return request(getReadPositionUrl(provider, mediaId), {
48
+ ...options,
49
+ method: "GET"
50
+ });
51
+ };
52
+ const getWritePositionUrl = (provider, mediaId) => {
53
+ return `/partners/${provider}/media/${mediaId}/position`;
54
+ };
55
+ /**
56
+ * Record progress, and report the partner's own metering alongside it.
57
+ *
58
+ * ``usage_blocks`` is forwarded first when present, because the legacy did and
59
+ * the partner treats the two as one act: metering after a position update
60
+ * records consumption against a page the reader has already left.
61
+ * @summary Write Position
62
+ */
63
+ const writePosition = async (provider, mediaId, readingPositionWrite, options) => {
64
+ const getHeaders = (h) => {
65
+ if (!h) return {};
66
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
67
+ if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
68
+ const headers = {};
69
+ for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
70
+ return headers;
71
+ };
72
+ return request(getWritePositionUrl(provider, mediaId), {
73
+ ...options,
74
+ method: "PATCH",
75
+ headers: {
76
+ "Content-Type": "application/json",
77
+ ...getHeaders(options?.headers)
78
+ },
79
+ body: JSON.stringify(readingPositionWrite)
80
+ });
81
+ };
82
+ const getListCurrentReadingsUrl = (provider) => {
83
+ return `/partners/${provider}/readings`;
84
+ };
85
+ /**
86
+ * The partner's own "continue reading" list, joined back to our catalogue.
87
+ *
88
+ * Entries the partner knows and our catalogue does not are dropped rather than
89
+ * surfaced with a null id: the import runs nightly and the partner's list is
90
+ * live, so a title added today is genuinely not browsable here yet, and a card
91
+ * that cannot be opened is worse than one that is absent.
92
+ * @summary List Current Readings
93
+ */
94
+ const listCurrentReadings = async (provider, options) => {
95
+ return request(getListCurrentReadingsUrl(provider), {
96
+ ...options,
97
+ method: "GET"
98
+ });
99
+ };
100
+ //#endregion
101
+ export { getListCurrentReadingsUrl, getReadPackageUrl, getReadPositionUrl, getWritePositionUrl, listCurrentReadings, readPackage, readPosition, writePosition };
102
+
103
+ //# sourceMappingURL=partner-reader.js.map