@learnorama/mozaik-sdk 0.8.2-staging.31.1 → 0.9.0-staging.35.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.
- package/dist/api/account.d.ts +27 -28
- package/dist/api/account.js +41 -28
- package/dist/api/account.js.map +1 -1
- package/dist/api/admin-catalogue.d.ts +1 -1
- package/dist/api/admin-catalogue.js.map +1 -1
- package/dist/api/admin-consumption.d.ts +1 -1
- package/dist/api/admin-consumption.js.map +1 -1
- package/dist/api/admin-desk.d.ts +23 -1
- package/dist/api/admin-desk.js +59 -1
- package/dist/api/admin-desk.js.map +1 -1
- package/dist/api/admin-licenses.d.ts +1 -1
- package/dist/api/admin-licenses.js.map +1 -1
- package/dist/api/admin-patrons.d.ts +1 -1
- package/dist/api/admin-patrons.js.map +1 -1
- package/dist/api/admin-reviews.d.ts +1 -1
- package/dist/api/admin-reviews.js.map +1 -1
- package/dist/api/admin-roles.d.ts +1 -1
- package/dist/api/admin-roles.js.map +1 -1
- package/dist/api/admin-support.d.ts +1 -1
- package/dist/api/admin-support.js.map +1 -1
- package/dist/api/admin-tenants.d.ts +1 -1
- package/dist/api/admin-tenants.js.map +1 -1
- package/dist/api/admin-tutoring.d.ts +1 -1
- package/dist/api/admin-tutoring.js.map +1 -1
- package/dist/api/auth.d.ts +11 -1
- package/dist/api/auth.js +31 -1
- package/dist/api/auth.js.map +1 -1
- package/dist/api/biblio-catalogue.d.ts +1 -1
- package/dist/api/biblio-catalogue.js.map +1 -1
- package/dist/api/biblio-home.d.ts +1 -1
- package/dist/api/biblio-home.js.map +1 -1
- package/dist/api/biblio-library.d.ts +1 -1
- package/dist/api/biblio-library.js.map +1 -1
- package/dist/api/biblio-nextory.d.ts +1 -1
- package/dist/api/biblio-nextory.js.map +1 -1
- package/dist/api/biblio-press.d.ts +17 -1
- package/dist/api/biblio-press.js +49 -1
- package/dist/api/biblio-press.js.map +1 -1
- package/dist/api/biblio-search.d.ts +1 -1
- package/dist/api/biblio-search.js.map +1 -1
- package/dist/api/biblio-telemetry.d.ts +1 -1
- package/dist/api/biblio-telemetry.js.map +1 -1
- package/dist/api/consumption.d.ts +1 -1
- package/dist/api/consumption.js.map +1 -1
- package/dist/api/cvs-app.d.ts +1 -1
- package/dist/api/cvs-app.js.map +1 -1
- package/dist/api/cvs-documents.d.ts +1 -1
- package/dist/api/cvs-documents.js.map +1 -1
- package/dist/api/cvs-favorites.d.ts +1 -1
- package/dist/api/cvs-favorites.js.map +1 -1
- package/dist/api/cvs-ils.d.ts +1 -1
- package/dist/api/cvs-ils.js.map +1 -1
- package/dist/api/cvs-loans.d.ts +1 -1
- package/dist/api/cvs-loans.js.map +1 -1
- package/dist/api/cvs-payments.d.ts +1 -1
- package/dist/api/cvs-payments.js.map +1 -1
- package/dist/api/cvs-streaming.d.ts +1 -1
- package/dist/api/cvs-streaming.js.map +1 -1
- package/dist/api/index.d.ts +8 -8
- package/dist/api/index.js +8 -8
- package/dist/api/partner-catalogue.d.ts +20 -1
- package/dist/api/partner-catalogue.js +44 -1
- package/dist/api/partner-catalogue.js.map +1 -1
- package/dist/api/partner-reader.d.ts +34 -6
- package/dist/api/partner-reader.js +48 -6
- package/dist/api/partner-reader.js.map +1 -1
- package/dist/api/profiles.d.ts +86 -33
- package/dist/api/profiles.js +302 -33
- package/dist/api/profiles.js.map +1 -1
- package/dist/api/search.d.ts +1 -1
- package/dist/api/search.js.map +1 -1
- package/dist/api/tutoring-catalogue.d.ts +1 -1
- package/dist/api/tutoring-catalogue.js.map +1 -1
- package/dist/api/tutoring-chat.d.ts +1 -1
- package/dist/api/tutoring-chat.js.map +1 -1
- package/dist/api/tutoring-dispatch.d.ts +1 -1
- package/dist/api/tutoring-dispatch.js.map +1 -1
- package/dist/api/tutoring-practitioner.d.ts +1 -1
- package/dist/api/tutoring-practitioner.js.map +1 -1
- package/dist/api/tutoring-requests.d.ts +1 -1
- package/dist/api/tutoring-requests.js.map +1 -1
- package/dist/chunks/client2.d.ts +1 -1
- package/dist/chunks/connection.d.ts +1 -1
- package/dist/chunks/index.d.ts +1183 -347
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +2 -2
- package/dist/models.js +95 -2
- package/dist/models.js.map +1 -1
- package/dist/react/account.d.ts +81 -28
- package/dist/react/account.js +90 -29
- package/dist/react/account.js.map +1 -1
- package/dist/react/admin-catalogue.d.ts +1 -1
- package/dist/react/admin-catalogue.js +1 -1
- package/dist/react/admin-catalogue.js.map +1 -1
- package/dist/react/admin-consumption.d.ts +1 -1
- package/dist/react/admin-consumption.js +1 -1
- package/dist/react/admin-consumption.js.map +1 -1
- package/dist/react/admin-desk.d.ts +104 -1
- package/dist/react/admin-desk.js +132 -2
- package/dist/react/admin-desk.js.map +1 -1
- package/dist/react/admin-licenses.d.ts +1 -1
- package/dist/react/admin-licenses.js +1 -1
- package/dist/react/admin-licenses.js.map +1 -1
- package/dist/react/admin-patrons.d.ts +1 -1
- package/dist/react/admin-patrons.js +1 -1
- package/dist/react/admin-patrons.js.map +1 -1
- package/dist/react/admin-reviews.d.ts +1 -1
- package/dist/react/admin-reviews.js +1 -1
- package/dist/react/admin-reviews.js.map +1 -1
- package/dist/react/admin-roles.d.ts +1 -1
- package/dist/react/admin-roles.js +1 -1
- package/dist/react/admin-roles.js.map +1 -1
- package/dist/react/admin-support.d.ts +1 -1
- package/dist/react/admin-support.js +1 -1
- package/dist/react/admin-support.js.map +1 -1
- package/dist/react/admin-tenants.d.ts +1 -1
- package/dist/react/admin-tenants.js +1 -1
- package/dist/react/admin-tenants.js.map +1 -1
- package/dist/react/admin-tutoring.d.ts +1 -1
- package/dist/react/admin-tutoring.js +1 -1
- package/dist/react/admin-tutoring.js.map +1 -1
- package/dist/react/auth.d.ts +29 -1
- package/dist/react/auth.js +60 -2
- package/dist/react/auth.js.map +1 -1
- package/dist/react/biblio-catalogue.d.ts +1 -1
- package/dist/react/biblio-catalogue.js +1 -1
- package/dist/react/biblio-catalogue.js.map +1 -1
- package/dist/react/biblio-home.d.ts +1 -1
- package/dist/react/biblio-home.js +1 -1
- package/dist/react/biblio-home.js.map +1 -1
- package/dist/react/biblio-library.d.ts +1 -1
- package/dist/react/biblio-library.js +1 -1
- package/dist/react/biblio-library.js.map +1 -1
- package/dist/react/biblio-nextory.d.ts +1 -1
- package/dist/react/biblio-nextory.js +1 -1
- package/dist/react/biblio-nextory.js.map +1 -1
- package/dist/react/biblio-press.d.ts +65 -3
- package/dist/react/biblio-press.js +104 -3
- package/dist/react/biblio-press.js.map +1 -1
- package/dist/react/biblio-search.d.ts +1 -1
- package/dist/react/biblio-search.js +1 -1
- package/dist/react/biblio-search.js.map +1 -1
- package/dist/react/biblio-telemetry.d.ts +1 -1
- package/dist/react/biblio-telemetry.js +1 -1
- package/dist/react/biblio-telemetry.js.map +1 -1
- package/dist/react/chat.d.ts +1 -1
- package/dist/react/consumption.d.ts +1 -1
- package/dist/react/consumption.js +1 -1
- package/dist/react/consumption.js.map +1 -1
- package/dist/react/cvs-app.d.ts +1 -1
- package/dist/react/cvs-app.js +1 -1
- package/dist/react/cvs-app.js.map +1 -1
- package/dist/react/cvs-documents.d.ts +1 -1
- package/dist/react/cvs-documents.js +1 -1
- package/dist/react/cvs-documents.js.map +1 -1
- package/dist/react/cvs-favorites.d.ts +1 -1
- package/dist/react/cvs-favorites.js +1 -1
- package/dist/react/cvs-favorites.js.map +1 -1
- package/dist/react/cvs-ils.d.ts +1 -1
- package/dist/react/cvs-ils.js +1 -1
- package/dist/react/cvs-ils.js.map +1 -1
- package/dist/react/cvs-loans.d.ts +1 -1
- package/dist/react/cvs-loans.js +1 -1
- package/dist/react/cvs-loans.js.map +1 -1
- package/dist/react/cvs-payments.d.ts +1 -1
- package/dist/react/cvs-payments.js +1 -1
- package/dist/react/cvs-payments.js.map +1 -1
- package/dist/react/cvs-streaming.d.ts +1 -1
- package/dist/react/cvs-streaming.js +1 -1
- package/dist/react/cvs-streaming.js.map +1 -1
- package/dist/react/index.d.ts +8 -8
- package/dist/react/index.js +8 -8
- package/dist/react/partner-catalogue.d.ts +74 -1
- package/dist/react/partner-catalogue.js +95 -2
- package/dist/react/partner-catalogue.js.map +1 -1
- package/dist/react/partner-reader.d.ts +79 -6
- package/dist/react/partner-reader.js +102 -7
- package/dist/react/partner-reader.js.map +1 -1
- package/dist/react/profiles.d.ts +406 -33
- package/dist/react/profiles.js +760 -59
- package/dist/react/profiles.js.map +1 -1
- package/dist/react/search.d.ts +1 -1
- package/dist/react/search.js +1 -1
- package/dist/react/search.js.map +1 -1
- package/dist/react/tutoring-catalogue.d.ts +1 -1
- package/dist/react/tutoring-catalogue.js +1 -1
- package/dist/react/tutoring-catalogue.js.map +1 -1
- package/dist/react/tutoring-chat.d.ts +1 -1
- package/dist/react/tutoring-chat.js +1 -1
- package/dist/react/tutoring-chat.js.map +1 -1
- package/dist/react/tutoring-dispatch.d.ts +1 -1
- package/dist/react/tutoring-dispatch.js +1 -1
- package/dist/react/tutoring-dispatch.js.map +1 -1
- package/dist/react/tutoring-practitioner.d.ts +1 -1
- package/dist/react/tutoring-practitioner.js +1 -1
- package/dist/react/tutoring-practitioner.js.map +1 -1
- package/dist/react/tutoring-requests.d.ts +1 -1
- package/dist/react/tutoring-requests.js +1 -1
- package/dist/react/tutoring-requests.js.map +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-support.js","names":[],"sources":["../../src/api/admin-support/admin-support.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.
|
|
1
|
+
{"version":3,"file":"admin-support.js","names":[],"sources":["../../src/api/admin-support/admin-support.ts"],"sourcesContent":["/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Mozaik backend\n * Four products behind one API — Biblio, Médiathèques, the partner catalogues (Nextory and YouScribe) and Prof Express. Authentication is Keycloak SSO only, once, for all of them: see the **auth** section below for the browser flow and the three failure modes.\n * OpenAPI spec version: 0.9.0\n */\nimport type {\n DemoUserRead,\n DemoUserWrite,\n ImpersonationWrite,\n SupportSessionRead\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getCreateDemoUserUrl = () => {\n\n\n\n\n return `/admin/demo-users`\n}\n\n/**\n * Create, or return, a demonstration account for an establishment (E57).\n *\n * ``RequireAdmin`` rather than ``RequireStaff``: this creates an account inside\n * a customer's tenant, which is a change to what the customer has, not an\n * assistance to one of their members.\n *\n * **The account has no password and cannot be signed into directly.** The\n * legacy derived one from the establishment id alone — ``Etab{id padded}$``,\n * at ``etab_{id}@ta.com`` — and then redirected into the impersonation route\n * (defect D15). Anyone who noticed the pattern held a working credential for\n * every establishment. Here the row is created without a credential and is\n * reached through E56, which is audited.\n *\n * ``201`` when created, ``200`` when it already existed. Idempotent, because a\n * salesperson clicking twice should not end up with two demo accounts.\n * @summary Create Demo User\n */\nexport const createDemoUser = async (demoUserWrite: DemoUserWrite, options?: Parameters<typeof request>[1]): Promise<DemoUserRead> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<DemoUserRead>(getCreateDemoUserUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(demoUserWrite)\n }\n);}\n\n\nexport const getOpenSupportSessionUrl = () => {\n\n\n\n\n return `/admin/impersonations`\n}\n\n/**\n * Open a support session acting as another account (E56).\n *\n * ``reason`` is mandatory and exists to be logged. A support action with no\n * stated reason cannot be told apart from an abuse of the same endpoint.\n *\n * **This returns no tokens.** It used to: a Keycloak token-exchange session for\n * the subject, on the reasoning that the platform should mint no credentials and\n * that the subject's own assurance level would keep privileged operations out of\n * reach. Both halves turned out to be wrong. The exchanged token carried no\n * actor claim, so it was indistinguishable from the patron's own and the trail\n * stopped at this row; and it carried no ``assurance`` claim either, which\n * ``clamp_assurance`` reads as *unconstrained* — so the operator resolved to\n * ``HIGH`` and could close the account, the single thing the design promised to\n * prevent. Keycloak 26 also rejects the grant outright.\n *\n * So the operator keeps their own token and sends ``X-Acting-As`` with the id\n * returned here. Nothing is minted, the authenticated identity stays the\n * operator, and the session is clamped to the lowest assurance by\n * :func:`app.core.security.acting_as` — which makes E14 and E17 unreachable\n * through the guard that already exists rather than through a special case.\n *\n * Ending it early is ``DELETE /admin/impersonations/{id}``, which must be sent\n * *without* the header: a support session holds no staff roles.\n * @summary Open Support Session\n */\nexport const openSupportSession = async (impersonationWrite: ImpersonationWrite, options?: Parameters<typeof request>[1]): Promise<SupportSessionRead> => {\n\n const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {\n if (!h) return {};\n if (h instanceof Headers) return Object.fromEntries(h.entries());\n if (Symbol.iterator in h) {\n return Object.fromEntries(\n Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),\n );\n }\n const headers: Record<string, string | readonly string[]> = {};\n for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {\n if (value !== undefined) headers[name] = value;\n }\n return headers;\n };\nreturn request<SupportSessionRead>(getOpenSupportSessionUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(impersonationWrite)\n }\n);}\n\n\nexport const getCloseSupportSessionUrl = (supportSessionId: number,) => {\n\n\n\n\n return `/admin/impersonations/${supportSessionId}`\n}\n\n/**\n * End a support session early. Idempotent.\n *\n * Must be called *without* ``X-Acting-As``: a session in progress carries no\n * staff roles, so a request made through one cannot reach this endpoint. That\n * is deliberate — the operator steps out before they can close it, and simply\n * dropping the header ends the session's effect immediately either way.\n *\n * ``204`` whether or not the row was still open, and whether or not it was\n * theirs. A support session id is a bare integer and must not be an oracle.\n * @summary Close Support Session\n */\nexport const closeSupportSession = async (supportSessionId: number, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getCloseSupportSessionUrl(supportSessionId),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\n"],"mappings":";;;AAgBA,MAAa,6BAA6B;CAKxC,OAAO;AACT;;;;;;;;;;;;;;;;;;;AAoBA,MAAa,iBAAiB,OAAO,eAA8B,YAAmE;CAElI,MAAM,cAAc,MAAwF;EAC5G,IAAI,CAAC,GAAG,OAAO,CAAC;EAChB,IAAI,aAAa,SAAS,OAAO,OAAO,YAAY,EAAE,QAAQ,CAAC;EAC/D,IAAI,OAAO,YAAY,GACrB,OAAO,OAAO,YACZ,MAAM,KAAK,IAAkC,UAAU,MAAM,KAAK,KAAK,CAAqB,CAC9F;EAEF,MAAM,UAAsD,CAAC;EAC7D,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAgD,CAAC,GAClF,IAAI,UAAU,KAAA,GAAW,QAAQ,QAAQ;EAE3C,OAAO;CACT;CACF,OAAO,QAAsB,qBAAqB,GAChD;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,aAAa;CACpC,CACF;AAAE;AAGF,MAAa,iCAAiC;CAK5C,OAAO;AACT;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAa,qBAAqB,OAAO,oBAAwC,YAAyE;CAEtJ,MAAM,cAAc,MAAwF;EAC5G,IAAI,CAAC,GAAG,OAAO,CAAC;EAChB,IAAI,aAAa,SAAS,OAAO,OAAO,YAAY,EAAE,QAAQ,CAAC;EAC/D,IAAI,OAAO,YAAY,GACrB,OAAO,OAAO,YACZ,MAAM,KAAK,IAAkC,UAAU,MAAM,KAAK,KAAK,CAAqB,CAC9F;EAEF,MAAM,UAAsD,CAAC;EAC7D,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAgD,CAAC,GAClF,IAAI,UAAU,KAAA,GAAW,QAAQ,QAAQ;EAE3C,OAAO;CACT;CACF,OAAO,QAA4B,yBAAyB,GAC1D;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,kBAAkB;CACzC,CACF;AAAE;AAGF,MAAa,6BAA6B,qBAA8B;CAKtE,OAAO,yBAAyB;AAClC;;;;;;;;;;;;;AAcA,MAAa,sBAAsB,OAAO,kBAA0B,YAA2D;CAE7H,OAAO,QAAc,0BAA0B,gBAAgB,GAC/D;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { B as TenantDirectoryParams, I as TenantSearchPage, M as TenantSettingsUpdateWrite, P as TenantSettingsRead, Q as SearchTenantsParams } from "../chunks/index.js";
|
|
3
3
|
import { c as request } from "../chunks/client.js";
|
|
4
4
|
//#region src/api/admin-tenants/admin-tenants.d.ts
|
|
5
5
|
export declare const getListTenantsUrl: () => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-tenants.js","names":[],"sources":["../../src/api/admin-tenants/admin-tenants.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
|
+
{"version":3,"file":"admin-tenants.js","names":[],"sources":["../../src/api/admin-tenants/admin-tenants.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.9.0\n */\nimport type {\n SearchTenantsParams,\n TenantDirectoryParams,\n TenantSearchPage,\n TenantSettingsRead,\n TenantSettingsUpdateWrite\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getListTenantsUrl = () => {\n\n\n\n\n return `/admin/tenants`\n}\n\n/**\n * The tenants this operator administers.\n *\n * For a library administrator that is one row, and returning a list of one is\n * better than a bare object: the client renders the same picker whether it is\n * talking to a library, a consortium or the vendor.\n * @summary List Tenants\n */\nexport const listTenants = async ( options?: Parameters<typeof request>[1]): Promise<TenantSettingsRead[]> => {\n\n return request<TenantSettingsRead[]>(getListTenantsUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getTenantDirectoryUrl = (params?: TenantDirectoryParams,) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : String(value))\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/admin/tenants/directory?${stringifiedParams}` : `/admin/tenants/directory`\n}\n\n/**\n * Browse tenant summaries within the employee's scope, one bounded page.\n * @summary Tenant Directory\n */\nexport const tenantDirectory = async (params?: TenantDirectoryParams, options?: Parameters<typeof request>[1]): Promise<TenantSearchPage> => {\n\n return request<TenantSearchPage>(getTenantDirectoryUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getSearchTenantsUrl = (params: SearchTenantsParams,) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : String(value))\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/admin/tenants/search?${stringifiedParams}` : `/admin/tenants/search`\n}\n\n/**\n * Find tenants using Elasticsearch within the employee's tenant scope.\n * @summary Search Tenants\n */\nexport const searchTenants = async (params: SearchTenantsParams, options?: Parameters<typeof request>[1]): Promise<TenantSearchPage> => {\n\n return request<TenantSearchPage>(getSearchTenantsUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getReadTenantUrl = (tenantId: number,) => {\n\n\n\n\n return `/admin/tenants/${tenantId}`\n}\n\n/**\n * One tenant's configuration.\n * @summary Read Tenant\n */\nexport const readTenant = async (tenantId: number, options?: Parameters<typeof request>[1]): Promise<TenantSettingsRead> => {\n\n return request<TenantSettingsRead>(getReadTenantUrl(tenantId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getUpdateTenantUrl = (tenantId: number,) => {\n\n\n\n\n return `/admin/tenants/${tenantId}`\n}\n\n/**\n * Change a tenant's configuration. Audited.\n *\n * The two membership flags are mutually exclusive and the database says so —\n * ``ck_tenant_individual_accounts_exclusive``. Checked here too, because a\n * constraint violation surfaces as a 500 and this is a 422: the operator sent\n * something contradictory and can fix it.\n * @summary Update Tenant\n */\nexport const updateTenant = async (tenantId: number,\n tenantSettingsUpdateWrite: TenantSettingsUpdateWrite, options?: Parameters<typeof request>[1]): Promise<TenantSettingsRead> => {\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<TenantSettingsRead>(getUpdateTenantUrl(tenantId),\n {\n ...options,\n method: 'PATCH',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(tenantSettingsUpdateWrite)\n }\n);}\n\n\n"],"mappings":";;;AAiBA,MAAa,0BAA0B;CAKrC,OAAO;AACT;;;;;;;;;AAUA,MAAa,cAAc,OAAQ,YAA2E;CAE5G,OAAO,QAA8B,kBAAkB,GACvD;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,yBAAyB,WAAoC;CACxE,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,4BAA4B,sBAAsB;AAC1F;;;;;AAMA,MAAa,kBAAkB,OAAO,QAAgC,YAAuE;CAE3I,OAAO,QAA0B,sBAAsB,MAAM,GAC7D;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,uBAAuB,WAAiC;CACnE,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,yBAAyB,sBAAsB;AACvF;;;;;AAMA,MAAa,gBAAgB,OAAO,QAA6B,YAAuE;CAEtI,OAAO,QAA0B,oBAAoB,MAAM,GAC3D;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,oBAAoB,aAAsB;CAKrD,OAAO,kBAAkB;AAC3B;;;;;AAMA,MAAa,aAAa,OAAO,UAAkB,YAAyE;CAE1H,OAAO,QAA4B,iBAAiB,QAAQ,GAC5D;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,sBAAsB,aAAsB;CAKvD,OAAO,kBAAkB;AAC3B;;;;;;;;;;AAWA,MAAa,eAAe,OAAO,UAC/B,2BAAsD,YAAyE;CAE/H,MAAM,cAAc,MAAwF;EAC5G,IAAI,CAAC,GAAG,OAAO,CAAC;EAChB,IAAI,aAAa,SAAS,OAAO,OAAO,YAAY,EAAE,QAAQ,CAAC;EAC/D,IAAI,OAAO,YAAY,GACrB,OAAO,OAAO,YACZ,MAAM,KAAK,IAAkC,UAAU,MAAM,KAAK,KAAK,CAAqB,CAC9F;EAEF,MAAM,UAAsD,CAAC;EAC7D,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAgD,CAAC,GAClF,IAAI,UAAU,KAAA,GAAW,QAAQ,QAAQ;EAE3C,OAAO;CACT;CACF,OAAO,QAA4B,mBAAmB,QAAQ,GAC5D;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,yBAAyB;CAChD,CACF;AAAE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { $t as PractitionerRead, Ai as EducationalGoalWrite, G as SubjectRead, Mi as EducationalGoalRead, Qt as PractitionerPage, Sr as LevelRead, U as SubjectWrite, Xc as AiDraftReviewWrite, Xt as PractitionerWrite, Zc as AiDraftRead, b as TutoringFeedbackModerationWrite, br as LevelWrite, en as PractitionerDocumentListRead, f as TutoringRequestAdminWrite, fr as ListFeedbackParams, gr as ListAllRequestsParams, l as TutoringRequestStaffRead, m as TutoringQueuePage, nr as ListPractitionersParams, p as TutoringRequestAdminCloseWrite, pr as ListExpiringDocumentsParams, v as TutoringFeedbackPage } from "../chunks/index.js";
|
|
3
3
|
import { c as request } from "../chunks/client.js";
|
|
4
4
|
//#region src/api/admin-tutoring/admin-tutoring.d.ts
|
|
5
5
|
export declare const getListExpiringDocumentsUrl: (params?: ListExpiringDocumentsParams) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-tutoring.js","names":[],"sources":["../../src/api/admin-tutoring/admin-tutoring.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.8.2\n */\nimport type {\n AiDraftRead,\n AiDraftReviewWrite,\n EducationalGoalRead,\n EducationalGoalWrite,\n LevelRead,\n LevelWrite,\n ListAllRequestsParams,\n ListExpiringDocumentsParams,\n ListFeedbackParams,\n ListPractitionersParams,\n PractitionerDocumentListRead,\n PractitionerPage,\n PractitionerRead,\n PractitionerWrite,\n SubjectRead,\n SubjectWrite,\n TutoringFeedbackModerationWrite,\n TutoringFeedbackPage,\n TutoringQueuePage,\n TutoringRequestAdminCloseWrite,\n TutoringRequestAdminWrite,\n TutoringRequestStaffRead\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getListExpiringDocumentsUrl = (params?: ListExpiringDocumentsParams,) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : String(value))\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/admin/tutoring/documents/expiring?${stringifiedParams}` : `/admin/tutoring/documents/expiring`\n}\n\n/**\n * Whose attestation lapses soon, as a query rather than a filing cabinet.\n *\n * An URSSAF *attestation de vigilance* is valid for six months and a lapsed one\n * is a compliance problem. The legacy stores it as a ``text`` column with one\n * ``ursaff_date`` beside it, so this question has no answer there at all.\n * @summary List Expiring Documents\n */\nexport const listExpiringDocuments = async (params?: ListExpiringDocumentsParams, options?: Parameters<typeof request>[1]): Promise<PractitionerDocumentListRead> => {\n\n return request<PractitionerDocumentListRead>(getListExpiringDocumentsUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getListFeedbackUrl = (params?: ListFeedbackParams,) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : String(value))\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/admin/tutoring/feedback?${stringifiedParams}` : `/admin/tutoring/feedback`\n}\n\n/**\n * Ratings, newest first. ``?publishable=false`` is the moderation queue.\n *\n * Tenant-scoped through the request it belongs to: a rating is a child's free\n * text, so it is reachable only by an operator who reaches the tenant.\n * @summary List Feedback\n */\nexport const listFeedback = async (params?: ListFeedbackParams, options?: Parameters<typeof request>[1]): Promise<TutoringFeedbackPage> => {\n\n return request<TutoringFeedbackPage>(getListFeedbackUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getModerateFeedbackUrl = (feedbackId: number,) => {\n\n\n\n\n return `/admin/tutoring/feedback/${feedbackId}/moderation`\n}\n\n/**\n * Clear a rating for the public showcase, or withhold it.\n *\n * ``PUT`` on a sub-resource rather than ``PATCH`` on the rating, mirroring\n * ``/admin/reviews/{id}/moderation``: the decision is the resource, and it is\n * idempotent.\n * @summary Moderate Feedback\n */\nexport const moderateFeedback = async (feedbackId: number,\n tutoringFeedbackModerationWrite: TutoringFeedbackModerationWrite, 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>(getModerateFeedbackUrl(feedbackId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(tutoringFeedbackModerationWrite)\n }\n);}\n\n\nexport const getCreateGoalUrl = () => {\n\n\n\n\n return `/admin/tutoring/goals`\n}\n\n/**\n * @summary Create Goal\n */\nexport const createGoal = async (educationalGoalWrite: EducationalGoalWrite, options?: Parameters<typeof request>[1]): Promise<EducationalGoalRead> => {\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<EducationalGoalRead>(getCreateGoalUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(educationalGoalWrite)\n }\n);}\n\n\nexport const getAmendGoalUrl = (goalId: number,) => {\n\n\n\n\n return `/admin/tutoring/goals/${goalId}`\n}\n\n/**\n * @summary Amend Goal\n */\nexport const amendGoal = async (goalId: number,\n educationalGoalWrite: EducationalGoalWrite, options?: Parameters<typeof request>[1]): Promise<EducationalGoalRead> => {\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<EducationalGoalRead>(getAmendGoalUrl(goalId),\n {\n ...options,\n method: 'PATCH',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(educationalGoalWrite)\n }\n);}\n\n\nexport const getCreateLevelUrl = () => {\n\n\n\n\n return `/admin/tutoring/levels`\n}\n\n/**\n * @summary Create Level\n */\nexport const createLevel = async (levelWrite: LevelWrite, options?: Parameters<typeof request>[1]): Promise<LevelRead> => {\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<LevelRead>(getCreateLevelUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(levelWrite)\n }\n);}\n\n\nexport const getAmendLevelUrl = (levelId: number,) => {\n\n\n\n\n return `/admin/tutoring/levels/${levelId}`\n}\n\n/**\n * @summary Amend Level\n */\nexport const amendLevel = async (levelId: number,\n levelWrite: LevelWrite, options?: Parameters<typeof request>[1]): Promise<LevelRead> => {\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<LevelRead>(getAmendLevelUrl(levelId),\n {\n ...options,\n method: 'PATCH',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(levelWrite)\n }\n);}\n\n\nexport const getListPractitionersUrl = (params?: ListPractitionersParams,) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : String(value))\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/admin/tutoring/practitioners?${stringifiedParams}` : `/admin/tutoring/practitioners`\n}\n\n/**\n * Who can take work, filtered the way the question is actually asked.\n *\n * ``role``, ``capability``, ``subjectId`` and ``levelId`` together answer \"who\n * can take *this* request\", which is the only thing anybody wants from this\n * list. The legacy answers it with a different screen per role — nine of them,\n * plus two more for pelite.\n * @summary List Practitioners\n */\nexport const listPractitioners = async (params?: ListPractitionersParams, options?: Parameters<typeof request>[1]): Promise<PractitionerPage> => {\n\n return request<PractitionerPage>(getListPractitionersUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getAmendPractitionerUrl = (userId: number,) => {\n\n\n\n\n return `/admin/tutoring/practitioners/${userId}`\n}\n\n/**\n * Availability, capabilities and competencies in one call.\n *\n * Competencies are replaced wholesale rather than diffed: the screen shows a\n * checklist and submits it. Absent means unchanged; an empty list means none,\n * which is a real instruction and has to be distinguishable from absence —\n * hence ``exclude_unset``.\n * @summary Amend Practitioner\n */\nexport const amendPractitioner = async (userId: number,\n practitionerWrite: PractitionerWrite, options?: Parameters<typeof request>[1]): Promise<PractitionerRead> => {\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<PractitionerRead>(getAmendPractitionerUrl(userId),\n {\n ...options,\n method: 'PATCH',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(practitionerWrite)\n }\n);}\n\n\nexport const getListPractitionerDocumentsUrl = (userId: number,) => {\n\n\n\n\n return `/admin/tutoring/practitioners/${userId}/documents`\n}\n\n/**\n * One practitioner's compliance paperwork. Metadata only, never the file.\n * @summary List Practitioner Documents\n */\nexport const listPractitionerDocuments = async (userId: number, options?: Parameters<typeof request>[1]): Promise<PractitionerDocumentListRead> => {\n\n return request<PractitionerDocumentListRead>(getListPractitionerDocumentsUrl(userId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getListAllRequestsUrl = (params?: ListAllRequestsParams,) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n const explodeParameters = [\"status\"];\n\n if (Array.isArray(value) && explodeParameters.includes(key)) {\n value.forEach((v) => {\n normalizedParams.append(key, v === null ? 'null' : String(v));\n });\n return;\n }\n\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : String(value))\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/admin/tutoring/requests?${stringifiedParams}` : `/admin/tutoring/requests`\n}\n\n/**\n * Every request in the tenants this operator reaches.\n *\n * Returns the queue shape rather than the staff shape on purpose: this is the\n * list screen, and a list of five hundred requests should not carry five hundred\n * statements. The staff detail shape is on the single-request route.\n * @summary List All Requests\n */\nexport const listAllRequests = async (params?: ListAllRequestsParams, options?: Parameters<typeof request>[1]): Promise<TutoringQueuePage> => {\n\n return request<TutoringQueuePage>(getListAllRequestsUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getReadRequestUrl = (requestId: number,) => {\n\n\n\n\n return `/admin/tutoring/requests/${requestId}`\n}\n\n/**\n * One request in full, including provenance and the staff note.\n * @summary Read Request\n */\nexport const readRequest = async (requestId: number, options?: Parameters<typeof request>[1]): Promise<TutoringRequestStaffRead> => {\n\n return request<TutoringRequestStaffRead>(getReadRequestUrl(requestId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getAmendRequestUrl = (requestId: number,) => {\n\n\n\n\n return `/admin/tutoring/requests/${requestId}`\n}\n\n/**\n * Reassign a stalled request, and say why, in one call.\n *\n * Partial: only fields present in the body are applied, so a client that knows\n * about one of them cannot blank the rest. Reassignment does **not** move the\n * status — a request routed to somebody else is still dispatched, and pretending\n * otherwise would corrupt the timestamp ladder every report reads.\n * @summary Amend Request\n */\nexport const amendRequest = async (requestId: number,\n tutoringRequestAdminWrite: TutoringRequestAdminWrite, options?: Parameters<typeof request>[1]): Promise<TutoringRequestStaffRead> => {\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<TutoringRequestStaffRead>(getAmendRequestUrl(requestId),\n {\n ...options,\n method: 'PATCH',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(tutoringRequestAdminWrite)\n }\n);}\n\n\nexport const getAdminCloseRequestUrl = (requestId: number,) => {\n\n\n\n\n return `/admin/tutoring/requests/${requestId}/close`\n}\n\n/**\n * Close a request from the back office. Goes through the state machine.\n * @summary Admin Close Request\n */\nexport const adminCloseRequest = async (requestId: number,\n tutoringRequestAdminCloseWrite: TutoringRequestAdminCloseWrite, 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>(getAdminCloseRequestUrl(requestId),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(tutoringRequestAdminCloseWrite)\n }\n);}\n\n\nexport const getReadDraftUrl = (requestId: number,) => {\n\n\n\n\n return `/admin/tutoring/requests/${requestId}/draft`\n}\n\n/**\n * The latest draft for one request.\n *\n * ``404`` when there is none, which is the ordinary case: drafting is off by\n * default, and even switched on it produces nothing when the provider is\n * unreachable. A client must treat a missing draft as normal rather than as\n * an error — the request is answerable by a person either way.\n *\n * Only the latest. Re-drafting is not a feature yet, and returning a list\n * would promise one.\n * @summary Read Draft\n */\nexport const readDraft = async (requestId: number, options?: Parameters<typeof request>[1]): Promise<AiDraftRead> => {\n\n return request<AiDraftRead>(getReadDraftUrl(requestId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getReviewDraftUrl = (requestId: number,) => {\n\n\n\n\n return `/admin/tutoring/requests/${requestId}/draft/review`\n}\n\n/**\n * Score a draft, and optionally hand the request to a person.\n *\n * ``escalate`` stamps ``escalatedAt`` — the legacy's ``ai_to_live``. It is\n * taken from the body rather than inferred from a low ``vote``: a reviewer may\n * rate a draft poorly and still keep it as a starting point, or rate it well\n * and escalate anyway because the pupil needs a conversation.\n *\n * Re-reviewing overwrites the score. Escalation does not un-stamp, because\n * handing a request to a person is not a thing that gets taken back.\n *\n * The request's own status is untouched. A draft is not a state of the\n * request, and moving it here would corrupt the timestamp ladder the reports\n * read.\n * @summary Review Draft\n */\nexport const reviewDraft = async (requestId: number,\n aiDraftReviewWrite: AiDraftReviewWrite, options?: Parameters<typeof request>[1]): Promise<AiDraftRead> => {\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<AiDraftRead>(getReviewDraftUrl(requestId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(aiDraftReviewWrite)\n }\n);}\n\n\nexport const getCreateSubjectUrl = () => {\n\n\n\n\n return `/admin/tutoring/subjects`\n}\n\n/**\n * Add a subject. Reference data, so ADMIN rather than SUPPORT.\n * @summary Create Subject\n */\nexport const createSubject = async (subjectWrite: SubjectWrite, options?: Parameters<typeof request>[1]): Promise<SubjectRead> => {\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<SubjectRead>(getCreateSubjectUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(subjectWrite)\n }\n);}\n\n\nexport const getAmendSubjectUrl = (subjectId: number,) => {\n\n\n\n\n return `/admin/tutoring/subjects/${subjectId}`\n}\n\n/**\n * @summary Amend Subject\n */\nexport const amendSubject = async (subjectId: number,\n subjectWrite: SubjectWrite, options?: Parameters<typeof request>[1]): Promise<SubjectRead> => {\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<SubjectRead>(getAmendSubjectUrl(subjectId),\n {\n ...options,\n method: 'PATCH',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(subjectWrite)\n }\n);}\n\n\n"],"mappings":";;;AAkCA,MAAa,+BAA+B,WAA0C;CACpF,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,sCAAsC,sBAAsB;AACpG;;;;;;;;;AAUA,MAAa,wBAAwB,OAAO,QAAsC,YAAmF;CAEnK,OAAO,QAAsC,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,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,YAAY;CACnC,CACF;AAAE;AAGF,MAAa,sBAAsB,cAAuB;CAKxD,OAAO,4BAA4B;AACrC;;;;AAKA,MAAa,eAAe,OAAO,WAC/B,cAA4B,YAAkE;CAE9F,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,QAAqB,mBAAmB,SAAS,GACtD;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,YAAY;CACnC,CACF;AAAE"}
|
|
1
|
+
{"version":3,"file":"admin-tutoring.js","names":[],"sources":["../../src/api/admin-tutoring/admin-tutoring.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.9.0\n */\nimport type {\n AiDraftRead,\n AiDraftReviewWrite,\n EducationalGoalRead,\n EducationalGoalWrite,\n LevelRead,\n LevelWrite,\n ListAllRequestsParams,\n ListExpiringDocumentsParams,\n ListFeedbackParams,\n ListPractitionersParams,\n PractitionerDocumentListRead,\n PractitionerPage,\n PractitionerRead,\n PractitionerWrite,\n SubjectRead,\n SubjectWrite,\n TutoringFeedbackModerationWrite,\n TutoringFeedbackPage,\n TutoringQueuePage,\n TutoringRequestAdminCloseWrite,\n TutoringRequestAdminWrite,\n TutoringRequestStaffRead\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getListExpiringDocumentsUrl = (params?: ListExpiringDocumentsParams,) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : String(value))\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/admin/tutoring/documents/expiring?${stringifiedParams}` : `/admin/tutoring/documents/expiring`\n}\n\n/**\n * Whose attestation lapses soon, as a query rather than a filing cabinet.\n *\n * An URSSAF *attestation de vigilance* is valid for six months and a lapsed one\n * is a compliance problem. The legacy stores it as a ``text`` column with one\n * ``ursaff_date`` beside it, so this question has no answer there at all.\n * @summary List Expiring Documents\n */\nexport const listExpiringDocuments = async (params?: ListExpiringDocumentsParams, options?: Parameters<typeof request>[1]): Promise<PractitionerDocumentListRead> => {\n\n return request<PractitionerDocumentListRead>(getListExpiringDocumentsUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getListFeedbackUrl = (params?: ListFeedbackParams,) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : String(value))\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/admin/tutoring/feedback?${stringifiedParams}` : `/admin/tutoring/feedback`\n}\n\n/**\n * Ratings, newest first. ``?publishable=false`` is the moderation queue.\n *\n * Tenant-scoped through the request it belongs to: a rating is a child's free\n * text, so it is reachable only by an operator who reaches the tenant.\n * @summary List Feedback\n */\nexport const listFeedback = async (params?: ListFeedbackParams, options?: Parameters<typeof request>[1]): Promise<TutoringFeedbackPage> => {\n\n return request<TutoringFeedbackPage>(getListFeedbackUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getModerateFeedbackUrl = (feedbackId: number,) => {\n\n\n\n\n return `/admin/tutoring/feedback/${feedbackId}/moderation`\n}\n\n/**\n * Clear a rating for the public showcase, or withhold it.\n *\n * ``PUT`` on a sub-resource rather than ``PATCH`` on the rating, mirroring\n * ``/admin/reviews/{id}/moderation``: the decision is the resource, and it is\n * idempotent.\n * @summary Moderate Feedback\n */\nexport const moderateFeedback = async (feedbackId: number,\n tutoringFeedbackModerationWrite: TutoringFeedbackModerationWrite, 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>(getModerateFeedbackUrl(feedbackId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(tutoringFeedbackModerationWrite)\n }\n);}\n\n\nexport const getCreateGoalUrl = () => {\n\n\n\n\n return `/admin/tutoring/goals`\n}\n\n/**\n * @summary Create Goal\n */\nexport const createGoal = async (educationalGoalWrite: EducationalGoalWrite, options?: Parameters<typeof request>[1]): Promise<EducationalGoalRead> => {\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<EducationalGoalRead>(getCreateGoalUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(educationalGoalWrite)\n }\n);}\n\n\nexport const getAmendGoalUrl = (goalId: number,) => {\n\n\n\n\n return `/admin/tutoring/goals/${goalId}`\n}\n\n/**\n * @summary Amend Goal\n */\nexport const amendGoal = async (goalId: number,\n educationalGoalWrite: EducationalGoalWrite, options?: Parameters<typeof request>[1]): Promise<EducationalGoalRead> => {\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<EducationalGoalRead>(getAmendGoalUrl(goalId),\n {\n ...options,\n method: 'PATCH',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(educationalGoalWrite)\n }\n);}\n\n\nexport const getCreateLevelUrl = () => {\n\n\n\n\n return `/admin/tutoring/levels`\n}\n\n/**\n * @summary Create Level\n */\nexport const createLevel = async (levelWrite: LevelWrite, options?: Parameters<typeof request>[1]): Promise<LevelRead> => {\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<LevelRead>(getCreateLevelUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(levelWrite)\n }\n);}\n\n\nexport const getAmendLevelUrl = (levelId: number,) => {\n\n\n\n\n return `/admin/tutoring/levels/${levelId}`\n}\n\n/**\n * @summary Amend Level\n */\nexport const amendLevel = async (levelId: number,\n levelWrite: LevelWrite, options?: Parameters<typeof request>[1]): Promise<LevelRead> => {\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<LevelRead>(getAmendLevelUrl(levelId),\n {\n ...options,\n method: 'PATCH',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(levelWrite)\n }\n);}\n\n\nexport const getListPractitionersUrl = (params?: ListPractitionersParams,) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : String(value))\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/admin/tutoring/practitioners?${stringifiedParams}` : `/admin/tutoring/practitioners`\n}\n\n/**\n * Who can take work, filtered the way the question is actually asked.\n *\n * ``role``, ``capability``, ``subjectId`` and ``levelId`` together answer \"who\n * can take *this* request\", which is the only thing anybody wants from this\n * list. The legacy answers it with a different screen per role — nine of them,\n * plus two more for pelite.\n * @summary List Practitioners\n */\nexport const listPractitioners = async (params?: ListPractitionersParams, options?: Parameters<typeof request>[1]): Promise<PractitionerPage> => {\n\n return request<PractitionerPage>(getListPractitionersUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getAmendPractitionerUrl = (userId: number,) => {\n\n\n\n\n return `/admin/tutoring/practitioners/${userId}`\n}\n\n/**\n * Availability, capabilities and competencies in one call.\n *\n * Competencies are replaced wholesale rather than diffed: the screen shows a\n * checklist and submits it. Absent means unchanged; an empty list means none,\n * which is a real instruction and has to be distinguishable from absence —\n * hence ``exclude_unset``.\n * @summary Amend Practitioner\n */\nexport const amendPractitioner = async (userId: number,\n practitionerWrite: PractitionerWrite, options?: Parameters<typeof request>[1]): Promise<PractitionerRead> => {\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<PractitionerRead>(getAmendPractitionerUrl(userId),\n {\n ...options,\n method: 'PATCH',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(practitionerWrite)\n }\n);}\n\n\nexport const getListPractitionerDocumentsUrl = (userId: number,) => {\n\n\n\n\n return `/admin/tutoring/practitioners/${userId}/documents`\n}\n\n/**\n * One practitioner's compliance paperwork. Metadata only, never the file.\n * @summary List Practitioner Documents\n */\nexport const listPractitionerDocuments = async (userId: number, options?: Parameters<typeof request>[1]): Promise<PractitionerDocumentListRead> => {\n\n return request<PractitionerDocumentListRead>(getListPractitionerDocumentsUrl(userId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getListAllRequestsUrl = (params?: ListAllRequestsParams,) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n const explodeParameters = [\"status\"];\n\n if (Array.isArray(value) && explodeParameters.includes(key)) {\n value.forEach((v) => {\n normalizedParams.append(key, v === null ? 'null' : String(v));\n });\n return;\n }\n\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : String(value))\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/admin/tutoring/requests?${stringifiedParams}` : `/admin/tutoring/requests`\n}\n\n/**\n * Every request in the tenants this operator reaches.\n *\n * Returns the queue shape rather than the staff shape on purpose: this is the\n * list screen, and a list of five hundred requests should not carry five hundred\n * statements. The staff detail shape is on the single-request route.\n * @summary List All Requests\n */\nexport const listAllRequests = async (params?: ListAllRequestsParams, options?: Parameters<typeof request>[1]): Promise<TutoringQueuePage> => {\n\n return request<TutoringQueuePage>(getListAllRequestsUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getReadRequestUrl = (requestId: number,) => {\n\n\n\n\n return `/admin/tutoring/requests/${requestId}`\n}\n\n/**\n * One request in full, including provenance and the staff note.\n * @summary Read Request\n */\nexport const readRequest = async (requestId: number, options?: Parameters<typeof request>[1]): Promise<TutoringRequestStaffRead> => {\n\n return request<TutoringRequestStaffRead>(getReadRequestUrl(requestId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getAmendRequestUrl = (requestId: number,) => {\n\n\n\n\n return `/admin/tutoring/requests/${requestId}`\n}\n\n/**\n * Reassign a stalled request, and say why, in one call.\n *\n * Partial: only fields present in the body are applied, so a client that knows\n * about one of them cannot blank the rest. Reassignment does **not** move the\n * status — a request routed to somebody else is still dispatched, and pretending\n * otherwise would corrupt the timestamp ladder every report reads.\n * @summary Amend Request\n */\nexport const amendRequest = async (requestId: number,\n tutoringRequestAdminWrite: TutoringRequestAdminWrite, options?: Parameters<typeof request>[1]): Promise<TutoringRequestStaffRead> => {\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<TutoringRequestStaffRead>(getAmendRequestUrl(requestId),\n {\n ...options,\n method: 'PATCH',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(tutoringRequestAdminWrite)\n }\n);}\n\n\nexport const getAdminCloseRequestUrl = (requestId: number,) => {\n\n\n\n\n return `/admin/tutoring/requests/${requestId}/close`\n}\n\n/**\n * Close a request from the back office. Goes through the state machine.\n * @summary Admin Close Request\n */\nexport const adminCloseRequest = async (requestId: number,\n tutoringRequestAdminCloseWrite: TutoringRequestAdminCloseWrite, 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>(getAdminCloseRequestUrl(requestId),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(tutoringRequestAdminCloseWrite)\n }\n);}\n\n\nexport const getReadDraftUrl = (requestId: number,) => {\n\n\n\n\n return `/admin/tutoring/requests/${requestId}/draft`\n}\n\n/**\n * The latest draft for one request.\n *\n * ``404`` when there is none, which is the ordinary case: drafting is off by\n * default, and even switched on it produces nothing when the provider is\n * unreachable. A client must treat a missing draft as normal rather than as\n * an error — the request is answerable by a person either way.\n *\n * Only the latest. Re-drafting is not a feature yet, and returning a list\n * would promise one.\n * @summary Read Draft\n */\nexport const readDraft = async (requestId: number, options?: Parameters<typeof request>[1]): Promise<AiDraftRead> => {\n\n return request<AiDraftRead>(getReadDraftUrl(requestId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getReviewDraftUrl = (requestId: number,) => {\n\n\n\n\n return `/admin/tutoring/requests/${requestId}/draft/review`\n}\n\n/**\n * Score a draft, and optionally hand the request to a person.\n *\n * ``escalate`` stamps ``escalatedAt`` — the legacy's ``ai_to_live``. It is\n * taken from the body rather than inferred from a low ``vote``: a reviewer may\n * rate a draft poorly and still keep it as a starting point, or rate it well\n * and escalate anyway because the pupil needs a conversation.\n *\n * Re-reviewing overwrites the score. Escalation does not un-stamp, because\n * handing a request to a person is not a thing that gets taken back.\n *\n * The request's own status is untouched. A draft is not a state of the\n * request, and moving it here would corrupt the timestamp ladder the reports\n * read.\n * @summary Review Draft\n */\nexport const reviewDraft = async (requestId: number,\n aiDraftReviewWrite: AiDraftReviewWrite, options?: Parameters<typeof request>[1]): Promise<AiDraftRead> => {\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<AiDraftRead>(getReviewDraftUrl(requestId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(aiDraftReviewWrite)\n }\n);}\n\n\nexport const getCreateSubjectUrl = () => {\n\n\n\n\n return `/admin/tutoring/subjects`\n}\n\n/**\n * Add a subject. Reference data, so ADMIN rather than SUPPORT.\n * @summary Create Subject\n */\nexport const createSubject = async (subjectWrite: SubjectWrite, options?: Parameters<typeof request>[1]): Promise<SubjectRead> => {\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<SubjectRead>(getCreateSubjectUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(subjectWrite)\n }\n);}\n\n\nexport const getAmendSubjectUrl = (subjectId: number,) => {\n\n\n\n\n return `/admin/tutoring/subjects/${subjectId}`\n}\n\n/**\n * @summary Amend Subject\n */\nexport const amendSubject = async (subjectId: number,\n subjectWrite: SubjectWrite, options?: Parameters<typeof request>[1]): Promise<SubjectRead> => {\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<SubjectRead>(getAmendSubjectUrl(subjectId),\n {\n ...options,\n method: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AAU,YAAY;CACnC,CACF;AAAE"}
|
package/dist/api/auth.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { Ar as InvitationSetupWrite, Gn as MeRead, Jc as AuthorizationParams, Y as SessionRead, bc as CodeExchangeWrite, jr as InvitationSetupRead, mc as CredentialsWrite, qc as AuthorizationRead, qn as LogoutWrite, st as RefreshWrite } from "../chunks/index.js";
|
|
3
3
|
import { c as request } from "../chunks/client.js";
|
|
4
4
|
//#region src/api/auth/auth.d.ts
|
|
5
5
|
export declare const getAuthorizationUrl: (params: AuthorizationParams) => string;
|
|
@@ -25,6 +25,16 @@ export declare const getAuthorizationUrl: (params: AuthorizationParams) => strin
|
|
|
25
25
|
* @summary Authorization
|
|
26
26
|
*/
|
|
27
27
|
export declare const authorization: (params: AuthorizationParams, options?: Parameters<typeof request>[1]) => Promise<AuthorizationRead>;
|
|
28
|
+
export declare const getSetupInvitationUrl: () => string;
|
|
29
|
+
/**
|
|
30
|
+
* Send broker setup instructions only for a live matching invitation.
|
|
31
|
+
*
|
|
32
|
+
* Knowing the invitation code proves neither email ownership nor household
|
|
33
|
+
* membership. Verification and password setup happen at Keycloak; subsequent
|
|
34
|
+
* PKCE code exchange must include ``invitationCode`` to accept the invitation.
|
|
35
|
+
* @summary Setup Invitation
|
|
36
|
+
*/
|
|
37
|
+
export declare const setupInvitation: (invitationSetupWrite: InvitationSetupWrite, options?: Parameters<typeof request>[1]) => Promise<InvitationSetupRead>;
|
|
28
38
|
export declare const getReadMeUrl: () => string;
|
|
29
39
|
/**
|
|
30
40
|
* Who the bearer of this token is, and what the session may do.
|
package/dist/api/auth.js
CHANGED
|
@@ -36,6 +36,36 @@ const authorization = async (params, options) => {
|
|
|
36
36
|
method: "GET"
|
|
37
37
|
});
|
|
38
38
|
};
|
|
39
|
+
const getSetupInvitationUrl = () => {
|
|
40
|
+
return `/auth/invitations/setup`;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Send broker setup instructions only for a live matching invitation.
|
|
44
|
+
*
|
|
45
|
+
* Knowing the invitation code proves neither email ownership nor household
|
|
46
|
+
* membership. Verification and password setup happen at Keycloak; subsequent
|
|
47
|
+
* PKCE code exchange must include ``invitationCode`` to accept the invitation.
|
|
48
|
+
* @summary Setup Invitation
|
|
49
|
+
*/
|
|
50
|
+
const setupInvitation = async (invitationSetupWrite, options) => {
|
|
51
|
+
const getHeaders = (h) => {
|
|
52
|
+
if (!h) return {};
|
|
53
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
54
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
55
|
+
const headers = {};
|
|
56
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
57
|
+
return headers;
|
|
58
|
+
};
|
|
59
|
+
return request(getSetupInvitationUrl(), {
|
|
60
|
+
...options,
|
|
61
|
+
method: "POST",
|
|
62
|
+
headers: {
|
|
63
|
+
"Content-Type": "application/json",
|
|
64
|
+
...getHeaders(options?.headers)
|
|
65
|
+
},
|
|
66
|
+
body: JSON.stringify(invitationSetupWrite)
|
|
67
|
+
});
|
|
68
|
+
};
|
|
39
69
|
const getReadMeUrl = () => {
|
|
40
70
|
return `/auth/me`;
|
|
41
71
|
};
|
|
@@ -191,6 +221,6 @@ const createSessionFromCode = async (codeExchangeWrite, options) => {
|
|
|
191
221
|
});
|
|
192
222
|
};
|
|
193
223
|
//#endregion
|
|
194
|
-
export { authorization, createSessionFromCode, createSessionFromCredentials, deleteSession, getAuthorizationUrl, getCreateSessionFromCodeUrl, getCreateSessionFromCredentialsUrl, getDeleteSessionUrl, getReadMeUrl, getRefreshSessionUrl, readMe, refreshSession };
|
|
224
|
+
export { authorization, createSessionFromCode, createSessionFromCredentials, deleteSession, getAuthorizationUrl, getCreateSessionFromCodeUrl, getCreateSessionFromCredentialsUrl, getDeleteSessionUrl, getReadMeUrl, getRefreshSessionUrl, getSetupInvitationUrl, readMe, refreshSession, setupInvitation };
|
|
195
225
|
|
|
196
226
|
//# sourceMappingURL=auth.js.map
|
package/dist/api/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","names":[],"sources":["../../src/api/auth/auth.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.8.2\n */\nimport type {\n AuthorizationParams,\n AuthorizationRead,\n CodeExchangeWrite,\n CredentialsWrite,\n LogoutWrite,\n MeRead,\n RefreshWrite,\n SessionRead\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getAuthorizationUrl = (params: AuthorizationParams,) => {\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 ? `/auth/authorization?${stringifiedParams}` : `/auth/authorization`\n}\n\n/**\n * Build the Keycloak authorization URL for this client and this tenant.\n *\n * Everything cryptographic belongs to the caller: it generates ``state``, the\n * PKCE verifier and the ``nonce``, and only ever sends the challenge. This\n * endpoint contributes the one thing the caller cannot know — which identity\n * provider to route to — and refuses an unsafe ``redirect_uri``.\n *\n * ``client_id`` defaults to ``mozaik-web``. Native apps select ``mozaik-mobile``\n * and keep that client ID for code exchange, refresh and logout. Only these\n * public clients are supported; each has its own callback allow-list.\n *\n * ``S256`` is hardcoded. ``plain`` is a valid PKCE method and provides no\n * protection, so making it selectable would only ever be used by mistake.\n *\n * A resolved provider is passed as ``kc_idp_hint``. Aliases are case-sensitive\n * at the broker and an unknown one silently falls back to the login form, which\n * is why :func:`_resolve_provider_alias` validates against the registry instead\n * of forwarding whatever arrived.\n * @summary Authorization\n */\nexport const authorization = async (params: AuthorizationParams, options?: Parameters<typeof request>[1]): Promise<AuthorizationRead> => {\n\n return request<AuthorizationRead>(getAuthorizationUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getReadMeUrl = () => {\n\n\n\n\n return `/auth/me`\n}\n\n/**\n * Who the bearer of this token is, and what the session may do.\n *\n * No tokens in the response — this endpoint reissues nothing, and a shape with\n * empty token fields would invite a client to store them. It is also the\n * cheapest liveness check a client has: it exercises verification,\n * tenant resolution and the account link in one call, so a 200 here means the\n * whole chain is intact.\n * @summary Read Me\n */\nexport const readMe = async ( options?: Parameters<typeof request>[1]): Promise<MeRead> => {\n\n return request<MeRead>(getReadMeUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getDeleteSessionUrl = () => {\n\n\n\n\n return `/auth/sessions`\n}\n\n/**\n * Sign out, revoking the refresh token at the broker.\n *\n * For a supported client, always 204. There is nothing useful for the caller\n * to do about an unreachable broker — it is\n * discarding its tokens either way. The failure is logged, not returned.\n *\n * The access token stays valid until it expires. That is inherent to verifying\n * tokens offline, and it is why the realm keeps access-token lifetimes short\n * rather than why this endpoint should pretend otherwise.\n * @summary Delete Session\n */\nexport const deleteSession = async (logoutWrite: LogoutWrite, 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>(getDeleteSessionUrl(),\n {\n ...options,\n method: 'DELETE',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(logoutWrite)\n }\n);}\n\n\nexport const getCreateSessionFromCredentialsUrl = () => {\n\n\n\n\n return `/auth/sessions`\n}\n\n/**\n * Log in with a username and password, via the broker's direct grant.\n *\n * Off unless ``AUTH_ALLOW_PASSWORD_GRANT`` says otherwise, and it should stay\n * off wherever the client fleet allows: the grant defeats MFA, cannot reach a\n * brokered partner, and puts the password through this process. It exists for\n * the native apps already in the field.\n *\n * Rate limited on both the submitted username and the client address. Keyed on\n * the lower-cased username so that case variation is not a way around the\n * counter, and on the address so that spraying many usernames is bounded too.\n * @summary Create Session From Credentials\n */\nexport const createSessionFromCredentials = async (credentialsWrite: CredentialsWrite, options?: Parameters<typeof request>[1]): Promise<SessionRead> => {\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<SessionRead>(getCreateSessionFromCredentialsUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(credentialsWrite)\n }\n);}\n\n\nexport const getRefreshSessionUrl = () => {\n\n\n\n\n return `/auth/sessions`\n}\n\n/**\n * Exchange a refresh token for a new pair.\n *\n * Public: the refresh token *is* the credential, so requiring a valid access\n * token as well would make the endpoint useless at the moment it is needed.\n * Rotation happens at the broker, so the presented token stops working as the\n * new one is issued.\n *\n * Returns the account as well as the tokens. That costs one indexed lookup and\n * means a client resuming from cold storage does not need a second call to\n * discover whether the account is still active — which it checks, because\n * deactivation is a local decision Keycloak knows nothing about.\n * @summary Refresh Session\n */\nexport const refreshSession = async (refreshWrite: RefreshWrite, options?: Parameters<typeof request>[1]): Promise<SessionRead> => {\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<SessionRead>(getRefreshSessionUrl(),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(refreshWrite)\n }\n);}\n\n\nexport const getCreateSessionFromCodeUrl = () => {\n\n\n\n\n return `/auth/sessions/code`\n}\n\n/**\n * Finish a brokered login: code plus verifier in, session out.\n *\n * Rate limited on the client address rather than on a user, because at this\n * point there is no user — the code has not been exchanged yet. The limit is\n * what stops a stolen code being brute-forced alongside a guessed verifier.\n * @summary Create Session From Code\n */\nexport const createSessionFromCode = async (codeExchangeWrite: CodeExchangeWrite, options?: Parameters<typeof request>[1]): Promise<SessionRead> => {\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<SessionRead>(getCreateSessionFromCodeUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(codeExchangeWrite)\n }\n);}\n\n\n"],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,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,YAAY;CACnC,CACF;AAAE;AAGF,MAAa,oCAAoC;CAK/C,OAAO;AACT;;;;;;;;;AAUA,MAAa,wBAAwB,OAAO,mBAAsC,YAAkE;CAEhJ,MAAM,cAAc,MAAwF;EAC5G,IAAI,CAAC,GAAG,OAAO,CAAC;EAChB,IAAI,aAAa,SAAS,OAAO,OAAO,YAAY,EAAE,QAAQ,CAAC;EAC/D,IAAI,OAAO,YAAY,GACrB,OAAO,OAAO,YACZ,MAAM,KAAK,IAAkC,UAAU,MAAM,KAAK,KAAK,CAAqB,CAC9F;EAEF,MAAM,UAAsD,CAAC;EAC7D,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAgD,CAAC,GAClF,IAAI,UAAU,KAAA,GAAW,QAAQ,QAAQ;EAE3C,OAAO;CACT;CACF,OAAO,QAAqB,4BAA4B,GACtD;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":"auth.js","names":[],"sources":["../../src/api/auth/auth.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.9.0\n */\nimport type {\n AuthorizationParams,\n AuthorizationRead,\n CodeExchangeWrite,\n CredentialsWrite,\n InvitationSetupRead,\n InvitationSetupWrite,\n LogoutWrite,\n MeRead,\n RefreshWrite,\n SessionRead\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getAuthorizationUrl = (params: AuthorizationParams,) => {\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 ? `/auth/authorization?${stringifiedParams}` : `/auth/authorization`\n}\n\n/**\n * Build the Keycloak authorization URL for this client and this tenant.\n *\n * Everything cryptographic belongs to the caller: it generates ``state``, the\n * PKCE verifier and the ``nonce``, and only ever sends the challenge. This\n * endpoint contributes the one thing the caller cannot know — which identity\n * provider to route to — and refuses an unsafe ``redirect_uri``.\n *\n * ``client_id`` defaults to ``mozaik-web``. Native apps select ``mozaik-mobile``\n * and keep that client ID for code exchange, refresh and logout. Only these\n * public clients are supported; each has its own callback allow-list.\n *\n * ``S256`` is hardcoded. ``plain`` is a valid PKCE method and provides no\n * protection, so making it selectable would only ever be used by mistake.\n *\n * A resolved provider is passed as ``kc_idp_hint``. Aliases are case-sensitive\n * at the broker and an unknown one silently falls back to the login form, which\n * is why :func:`_resolve_provider_alias` validates against the registry instead\n * of forwarding whatever arrived.\n * @summary Authorization\n */\nexport const authorization = async (params: AuthorizationParams, options?: Parameters<typeof request>[1]): Promise<AuthorizationRead> => {\n\n return request<AuthorizationRead>(getAuthorizationUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getSetupInvitationUrl = () => {\n\n\n\n\n return `/auth/invitations/setup`\n}\n\n/**\n * Send broker setup instructions only for a live matching invitation.\n *\n * Knowing the invitation code proves neither email ownership nor household\n * membership. Verification and password setup happen at Keycloak; subsequent\n * PKCE code exchange must include ``invitationCode`` to accept the invitation.\n * @summary Setup Invitation\n */\nexport const setupInvitation = async (invitationSetupWrite: InvitationSetupWrite, options?: Parameters<typeof request>[1]): Promise<InvitationSetupRead> => {\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<InvitationSetupRead>(getSetupInvitationUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(invitationSetupWrite)\n }\n);}\n\n\nexport const getReadMeUrl = () => {\n\n\n\n\n return `/auth/me`\n}\n\n/**\n * Who the bearer of this token is, and what the session may do.\n *\n * No tokens in the response — this endpoint reissues nothing, and a shape with\n * empty token fields would invite a client to store them. It is also the\n * cheapest liveness check a client has: it exercises verification,\n * tenant resolution and the account link in one call, so a 200 here means the\n * whole chain is intact.\n * @summary Read Me\n */\nexport const readMe = async ( options?: Parameters<typeof request>[1]): Promise<MeRead> => {\n\n return request<MeRead>(getReadMeUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getDeleteSessionUrl = () => {\n\n\n\n\n return `/auth/sessions`\n}\n\n/**\n * Sign out, revoking the refresh token at the broker.\n *\n * For a supported client, always 204. There is nothing useful for the caller\n * to do about an unreachable broker — it is\n * discarding its tokens either way. The failure is logged, not returned.\n *\n * The access token stays valid until it expires. That is inherent to verifying\n * tokens offline, and it is why the realm keeps access-token lifetimes short\n * rather than why this endpoint should pretend otherwise.\n * @summary Delete Session\n */\nexport const deleteSession = async (logoutWrite: LogoutWrite, 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>(getDeleteSessionUrl(),\n {\n ...options,\n method: 'DELETE',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(logoutWrite)\n }\n);}\n\n\nexport const getCreateSessionFromCredentialsUrl = () => {\n\n\n\n\n return `/auth/sessions`\n}\n\n/**\n * Log in with a username and password, via the broker's direct grant.\n *\n * Off unless ``AUTH_ALLOW_PASSWORD_GRANT`` says otherwise, and it should stay\n * off wherever the client fleet allows: the grant defeats MFA, cannot reach a\n * brokered partner, and puts the password through this process. It exists for\n * the native apps already in the field.\n *\n * Rate limited on both the submitted username and the client address. Keyed on\n * the lower-cased username so that case variation is not a way around the\n * counter, and on the address so that spraying many usernames is bounded too.\n * @summary Create Session From Credentials\n */\nexport const createSessionFromCredentials = async (credentialsWrite: CredentialsWrite, options?: Parameters<typeof request>[1]): Promise<SessionRead> => {\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<SessionRead>(getCreateSessionFromCredentialsUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(credentialsWrite)\n }\n);}\n\n\nexport const getRefreshSessionUrl = () => {\n\n\n\n\n return `/auth/sessions`\n}\n\n/**\n * Exchange a refresh token for a new pair.\n *\n * Public: the refresh token *is* the credential, so requiring a valid access\n * token as well would make the endpoint useless at the moment it is needed.\n * Rotation happens at the broker, so the presented token stops working as the\n * new one is issued.\n *\n * Returns the account as well as the tokens. That costs one indexed lookup and\n * means a client resuming from cold storage does not need a second call to\n * discover whether the account is still active — which it checks, because\n * deactivation is a local decision Keycloak knows nothing about.\n * @summary Refresh Session\n */\nexport const refreshSession = async (refreshWrite: RefreshWrite, options?: Parameters<typeof request>[1]): Promise<SessionRead> => {\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<SessionRead>(getRefreshSessionUrl(),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(refreshWrite)\n }\n);}\n\n\nexport const getCreateSessionFromCodeUrl = () => {\n\n\n\n\n return `/auth/sessions/code`\n}\n\n/**\n * Finish a brokered login: code plus verifier in, session out.\n *\n * Rate limited on the client address rather than on a user, because at this\n * point there is no user — the code has not been exchanged yet. The limit is\n * what stops a stolen code being brute-forced alongside a guessed verifier.\n * @summary Create Session From Code\n */\nexport const createSessionFromCode = async (codeExchangeWrite: CodeExchangeWrite, options?: Parameters<typeof request>[1]): Promise<SessionRead> => {\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<SessionRead>(getCreateSessionFromCodeUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(codeExchangeWrite)\n }\n);}\n\n\n"],"mappings":";;;AAsBA,MAAa,uBAAuB,WAAiC;CACnE,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,uBAAuB,sBAAsB;AACrF;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAa,gBAAgB,OAAO,QAA6B,YAAwE;CAEvI,OAAO,QAA2B,oBAAoB,MAAM,GAC5D;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,8BAA8B;CAKzC,OAAO;AACT;;;;;;;;;AAUA,MAAa,kBAAkB,OAAO,sBAA4C,YAA0E;CAExJ,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,QAA6B,sBAAsB,GACxD;EACE,GAAG;EACH,QAAQ;EACR,SAAS;GAAE,gBAAgB;GAAoB,GAAG,WAAW,SAAS,OAAO;EAAE;EAC/E,MAAM,KAAK,UAAU,oBAA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AAC,MAAM,UAAU,OAAO,QAAgD,CAAC,GAClF,IAAI,UAAU,KAAA,GAAW,QAAQ,QAAQ;EAE3C,OAAO;CACT;CACF,OAAO,QAAqB,4BAA4B,GACtD;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 {
|
|
2
|
+
import { Dr as LearningPathDetailRead, Dt as ReadCatalogParams, Et as ReadCatalogThemeParams, Ic as CatalogRead, Ii as EditorDetailRead, Mn as PackDetailRead, Ni as EditorListRead, Tt as ReadEditorParams, _c as ContentRead, _r as LikeRead, ct as RecommendationsRead, lt as ReadRecommendationsParams, mr as ListEditorsParams, mt as ReadPackParams } from "../chunks/index.js";
|
|
3
3
|
import { c as request } from "../chunks/client.js";
|
|
4
4
|
//#region src/api/biblio-catalogue/biblio-catalogue.d.ts
|
|
5
5
|
export declare const getReadContentUrl: (contentId: number) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"biblio-catalogue.js","names":[],"sources":["../../src/api/biblio-catalogue/biblio-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.8.2\n */\nimport type {\n CatalogRead,\n ContentRead,\n EditorDetailRead,\n EditorListRead,\n LearningPathDetailRead,\n LikeRead,\n ListEditorsParams,\n PackDetailRead,\n ReadCatalogParams,\n ReadCatalogThemeParams,\n ReadEditorParams,\n ReadPackParams,\n ReadRecommendationsParams,\n RecommendationsRead\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getReadContentUrl = (contentId: number,) => {\n\n\n\n\n return `/biblio/contents/${contentId}`\n}\n\n/**\n * One content item, with this caller's own state on it (E34).\n *\n * ``liked`` and ``favorited`` are why this is not just the summary shape: they\n * are per-caller and therefore uncacheable across users, which is worth knowing\n * before anyone puts a shared cache in front of it.\n * @summary Read Content\n */\nexport const readContent = async (contentId: number, options?: Parameters<typeof request>[1]): Promise<ContentRead> => {\n\n return request<ContentRead>(getReadContentUrl(contentId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getUnlikeContentUrl = (contentId: number,) => {\n\n\n\n\n return `/biblio/contents/${contentId}/like`\n}\n\n/**\n * Withdraw a like (E37). Idempotent — not liked is already the desired state.\n * @summary Unlike Content\n */\nexport const unlikeContent = async (contentId: number, options?: Parameters<typeof request>[1]): Promise<LikeRead> => {\n\n return request<LikeRead>(getUnlikeContentUrl(contentId),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\nexport const getLikeContentUrl = (contentId: number,) => {\n\n\n\n\n return `/biblio/contents/${contentId}/like`\n}\n\n/**\n * Record a like (E36). Idempotent.\n *\n * This and :func:`unlike_content` replace one non-idempotent\n * ``POST /content/{id}/toggle-like``. A retried toggle reverses the user's\n * intent; a repeated ``PUT`` cannot (§4, consequence 3).\n *\n * ``like_count`` is recomputed from ``content_rating`` rather than incremented,\n * because an increment beside an upsert double-counts the second time the same\n * person likes the same thing.\n * @summary Like Content\n */\nexport const likeContent = async (contentId: number, options?: Parameters<typeof request>[1]): Promise<LikeRead> => {\n\n return request<LikeRead>(getLikeContentUrl(contentId),\n {\n ...options,\n method: 'PUT'\n\n\n }\n);}\n\n\nexport const getReadRecommendationsUrl = (contentId: number,\n params?: ReadRecommendationsParams,) => {\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 ? `/biblio/contents/${contentId}/recommendations?${stringifiedParams}` : `/biblio/contents/${contentId}/recommendations`\n}\n\n/**\n * Related content the caller can also reach (E35).\n *\n * Recommending something the account cannot open is worse than recommending\n * nothing, so the candidate set is entitlement-filtered before ranking rather\n * than after — filtering afterwards silently shortens the list instead.\n *\n * Keyword overlap for now, over the GIN index on ``content.keywords``.\n * @summary Read Recommendations\n */\nexport const readRecommendations = async (contentId: number,\n params?: ReadRecommendationsParams, options?: Parameters<typeof request>[1]): Promise<RecommendationsRead> => {\n\n return request<RecommendationsRead>(getReadRecommendationsUrl(contentId,params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getListEditorsUrl = (params?: ListEditorsParams,) => {\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 ? `/biblio/editors?${stringifiedParams}` : `/biblio/editors`\n}\n\n/**\n * Active editors (E44).\n *\n * ``order`` and ``sort`` are resolved against a whitelist and never\n * interpolated. The legacy passed both straight to the query layer (defect\n * D17); an unrecognised value is ``422`` rather than a surprise ordering.\n *\n * The collection is not wrapped in a single-element array. The legacy\n * ``GET /api/v1/editors/`` was (§2.1).\n *\n * Authenticated even though the answer does not depend on who is asking. Which\n * publishers a platform carries is commercial information, and an endpoint that\n * enumerates them for anyone is a competitor's first request. The sibling\n * ``/editors/{id}`` was already authenticated; this one was not, which is how\n * the inconsistency was found.\n * @summary List Editors\n */\nexport const listEditors = async (params?: ListEditorsParams, options?: Parameters<typeof request>[1]): Promise<EditorListRead> => {\n\n return request<EditorListRead>(getListEditorsUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getReadEditorUrl = (editorId: number,\n params?: ReadEditorParams,) => {\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 ? `/biblio/editors/${editorId}?${stringifiedParams}` : `/biblio/editors/${editorId}`\n}\n\n/**\n * One editor and the content of theirs this caller can reach (E45).\n *\n * One endpoint replaces two — a page and a JSON route that used ``pageSize``\n * instead of ``limit`` and wrapped the object in an array. Same entity, two\n * conventions, one codebase (§4, consequence 5).\n * @summary Read Editor\n */\nexport const readEditor = async (editorId: number,\n params?: ReadEditorParams, options?: Parameters<typeof request>[1]): Promise<EditorDetailRead> => {\n\n return request<EditorDetailRead>(getReadEditorUrl(editorId,params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getReadLearningPathUrl = (learningPathId: number,) => {\n\n\n\n\n return `/biblio/learning-paths/${learningPathId}`\n}\n\n/**\n * A ``parcours`` and the content it walks through, in order.\n *\n * The other end of the ``parcours`` array on a pack, which named paths a client\n * then had no way to open.\n *\n * Steps the caller is not entitled to are **dropped, not hidden behind a\n * padlock**: the same category test every listing uses decides what appears, so\n * a path cannot become a way to learn that an item exists. That does mean a\n * path can come back with fewer steps than the library curated, and with gaps\n * in ``stepOrder`` — which is why the order is a field rather than the array\n * index.\n *\n * An inactive path is ``404`` rather than an empty one: it was withdrawn, and\n * an empty sequence would read as \"we have nothing for you\" instead.\n * @summary Read Learning Path\n */\nexport const readLearningPath = async (learningPathId: number, options?: Parameters<typeof request>[1]): Promise<LearningPathDetailRead> => {\n\n return request<LearningPathDetailRead>(getReadLearningPathUrl(learningPathId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getReadPackUrl = (packId: number,\n params?: ReadPackParams,) => {\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 ? `/biblio/packs/${packId}?${stringifiedParams}` : `/biblio/packs/${packId}`\n}\n\n/**\n * A pack with its catalogs, latest additions and learning paths (E38).\n *\n * ``canonical`` is how the redirect dies. When a pack resolves to a single\n * catalog the legacy answered ``302``; here the response is ``200`` and\n * ``canonical`` names the resolved catalog, leaving the client to decide whether\n * to follow it (§5.1).\n *\n * A pack the caller has no entitlement to is ``404``. The legacy dereferenced\n * ``null`` and returned ``500`` (defect D12).\n * @summary Read Pack\n */\nexport const readPack = async (packId: number,\n params?: ReadPackParams, options?: Parameters<typeof request>[1]): Promise<PackDetailRead> => {\n\n return request<PackDetailRead>(getReadPackUrl(packId,params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getReadCatalogUrl = (packId: number,\n catalogId: number,\n params?: ReadCatalogParams,) => {\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 ? `/biblio/packs/${packId}/catalogs/${catalogId}?${stringifiedParams}` : `/biblio/packs/${packId}/catalogs/${catalogId}`\n}\n\n/**\n * One catalog inside a pack (E39).\n * @summary Read Catalog\n */\nexport const readCatalog = async (packId: number,\n catalogId: number,\n params?: ReadCatalogParams, options?: Parameters<typeof request>[1]): Promise<CatalogRead> => {\n\n return request<CatalogRead>(getReadCatalogUrl(packId,catalogId,params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getReadCatalogThemeUrl = (packId: number,\n catalogId: number,\n themeId: number,\n params?: ReadCatalogThemeParams,) => {\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 ? `/biblio/packs/${packId}/catalogs/${catalogId}/themes/${themeId}?${stringifiedParams}` : `/biblio/packs/${packId}/catalogs/${catalogId}/themes/${themeId}`\n}\n\n/**\n * The same catalog, narrowed to one theme (E40).\n * @summary Read Catalog Theme\n */\nexport const readCatalogTheme = async (packId: number,\n catalogId: number,\n themeId: number,\n params?: ReadCatalogThemeParams, options?: Parameters<typeof request>[1]): Promise<CatalogRead> => {\n\n return request<CatalogRead>(getReadCatalogThemeUrl(packId,catalogId,themeId,params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n"],"mappings":";;;AA0BA,MAAa,qBAAqB,cAAuB;CAKvD,OAAO,oBAAoB;AAC7B;;;;;;;;;AAUA,MAAa,cAAc,OAAO,WAAmB,YAAkE;CAErH,OAAO,QAAqB,kBAAkB,SAAS,GACvD;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,uBAAuB,cAAuB;CAKzD,OAAO,oBAAoB,UAAU;AACvC;;;;;AAMA,MAAa,gBAAgB,OAAO,WAAmB,YAA+D;CAEpH,OAAO,QAAkB,oBAAoB,SAAS,GACtD;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,qBAAqB,cAAuB;CAKvD,OAAO,oBAAoB,UAAU;AACvC;;;;;;;;;;;;;AAcA,MAAa,cAAc,OAAO,WAAmB,YAA+D;CAElH,OAAO,QAAkB,kBAAkB,SAAS,GACpD;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,6BAA6B,WACtC,WAAwC;CAC1C,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,oBAAoB,UAAU,mBAAmB,sBAAsB,oBA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AU,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,iBAAiB,OAAO,YAAY,UAAU,UAAU,QAAQ,GAAG,sBAAsB,iBAAiB,OAAO,YAAY,UAAU,UAAU;AACzL;;;;;AAMA,MAAa,mBAAmB,OAAO,QACnC,WACA,SACA,QAAiC,YAAkE;CAErG,OAAO,QAAqB,uBAAuB,QAAO,WAAU,SAAQ,MAAM,GAClF;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE"}
|
|
1
|
+
{"version":3,"file":"biblio-catalogue.js","names":[],"sources":["../../src/api/biblio-catalogue/biblio-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.9.0\n */\nimport type {\n CatalogRead,\n ContentRead,\n EditorDetailRead,\n EditorListRead,\n LearningPathDetailRead,\n LikeRead,\n ListEditorsParams,\n PackDetailRead,\n ReadCatalogParams,\n ReadCatalogThemeParams,\n ReadEditorParams,\n ReadPackParams,\n ReadRecommendationsParams,\n RecommendationsRead\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getReadContentUrl = (contentId: number,) => {\n\n\n\n\n return `/biblio/contents/${contentId}`\n}\n\n/**\n * One content item, with this caller's own state on it (E34).\n *\n * ``liked`` and ``favorited`` are why this is not just the summary shape: they\n * are per-caller and therefore uncacheable across users, which is worth knowing\n * before anyone puts a shared cache in front of it.\n * @summary Read Content\n */\nexport const readContent = async (contentId: number, options?: Parameters<typeof request>[1]): Promise<ContentRead> => {\n\n return request<ContentRead>(getReadContentUrl(contentId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getUnlikeContentUrl = (contentId: number,) => {\n\n\n\n\n return `/biblio/contents/${contentId}/like`\n}\n\n/**\n * Withdraw a like (E37). Idempotent — not liked is already the desired state.\n * @summary Unlike Content\n */\nexport const unlikeContent = async (contentId: number, options?: Parameters<typeof request>[1]): Promise<LikeRead> => {\n\n return request<LikeRead>(getUnlikeContentUrl(contentId),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\nexport const getLikeContentUrl = (contentId: number,) => {\n\n\n\n\n return `/biblio/contents/${contentId}/like`\n}\n\n/**\n * Record a like (E36). Idempotent.\n *\n * This and :func:`unlike_content` replace one non-idempotent\n * ``POST /content/{id}/toggle-like``. A retried toggle reverses the user's\n * intent; a repeated ``PUT`` cannot (§4, consequence 3).\n *\n * ``like_count`` is recomputed from ``content_rating`` rather than incremented,\n * because an increment beside an upsert double-counts the second time the same\n * person likes the same thing.\n * @summary Like Content\n */\nexport const likeContent = async (contentId: number, options?: Parameters<typeof request>[1]): Promise<LikeRead> => {\n\n return request<LikeRead>(getLikeContentUrl(contentId),\n {\n ...options,\n method: 'PUT'\n\n\n }\n);}\n\n\nexport const getReadRecommendationsUrl = (contentId: number,\n params?: ReadRecommendationsParams,) => {\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 ? `/biblio/contents/${contentId}/recommendations?${stringifiedParams}` : `/biblio/contents/${contentId}/recommendations`\n}\n\n/**\n * Related content the caller can also reach (E35).\n *\n * Recommending something the account cannot open is worse than recommending\n * nothing, so the candidate set is entitlement-filtered before ranking rather\n * than after — filtering afterwards silently shortens the list instead.\n *\n * Keyword overlap for now, over the GIN index on ``content.keywords``.\n * @summary Read Recommendations\n */\nexport const readRecommendations = async (contentId: number,\n params?: ReadRecommendationsParams, options?: Parameters<typeof request>[1]): Promise<RecommendationsRead> => {\n\n return request<RecommendationsRead>(getReadRecommendationsUrl(contentId,params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getListEditorsUrl = (params?: ListEditorsParams,) => {\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 ? `/biblio/editors?${stringifiedParams}` : `/biblio/editors`\n}\n\n/**\n * Active editors (E44).\n *\n * ``order`` and ``sort`` are resolved against a whitelist and never\n * interpolated. The legacy passed both straight to the query layer (defect\n * D17); an unrecognised value is ``422`` rather than a surprise ordering.\n *\n * The collection is not wrapped in a single-element array. The legacy\n * ``GET /api/v1/editors/`` was (§2.1).\n *\n * Authenticated even though the answer does not depend on who is asking. Which\n * publishers a platform carries is commercial information, and an endpoint that\n * enumerates them for anyone is a competitor's first request. The sibling\n * ``/editors/{id}`` was already authenticated; this one was not, which is how\n * the inconsistency was found.\n * @summary List Editors\n */\nexport const listEditors = async (params?: ListEditorsParams, options?: Parameters<typeof request>[1]): Promise<EditorListRead> => {\n\n return request<EditorListRead>(getListEditorsUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getReadEditorUrl = (editorId: number,\n params?: ReadEditorParams,) => {\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 ? `/biblio/editors/${editorId}?${stringifiedParams}` : `/biblio/editors/${editorId}`\n}\n\n/**\n * One editor and the content of theirs this caller can reach (E45).\n *\n * One endpoint replaces two — a page and a JSON route that used ``pageSize``\n * instead of ``limit`` and wrapped the object in an array. Same entity, two\n * conventions, one codebase (§4, consequence 5).\n * @summary Read Editor\n */\nexport const readEditor = async (editorId: number,\n params?: ReadEditorParams, options?: Parameters<typeof request>[1]): Promise<EditorDetailRead> => {\n\n return request<EditorDetailRead>(getReadEditorUrl(editorId,params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getReadLearningPathUrl = (learningPathId: number,) => {\n\n\n\n\n return `/biblio/learning-paths/${learningPathId}`\n}\n\n/**\n * A ``parcours`` and the content it walks through, in order.\n *\n * The other end of the ``parcours`` array on a pack, which named paths a client\n * then had no way to open.\n *\n * Steps the caller is not entitled to are **dropped, not hidden behind a\n * padlock**: the same category test every listing uses decides what appears, so\n * a path cannot become a way to learn that an item exists. That does mean a\n * path can come back with fewer steps than the library curated, and with gaps\n * in ``stepOrder`` — which is why the order is a field rather than the array\n * index.\n *\n * An inactive path is ``404`` rather than an empty one: it was withdrawn, and\n * an empty sequence would read as \"we have nothing for you\" instead.\n * @summary Read Learning Path\n */\nexport const readLearningPath = async (learningPathId: number, options?: Parameters<typeof request>[1]): Promise<LearningPathDetailRead> => {\n\n return request<LearningPathDetailRead>(getReadLearningPathUrl(learningPathId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getReadPackUrl = (packId: number,\n params?: ReadPackParams,) => {\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 ? `/biblio/packs/${packId}?${stringifiedParams}` : `/biblio/packs/${packId}`\n}\n\n/**\n * A pack with its catalogs, latest additions and learning paths (E38).\n *\n * ``canonical`` is how the redirect dies. When a pack resolves to a single\n * catalog the legacy answered ``302``; here the response is ``200`` and\n * ``canonical`` names the resolved catalog, leaving the client to decide whether\n * to follow it (§5.1).\n *\n * A pack the caller has no entitlement to is ``404``. The legacy dereferenced\n * ``null`` and returned ``500`` (defect D12).\n * @summary Read Pack\n */\nexport const readPack = async (packId: number,\n params?: ReadPackParams, options?: Parameters<typeof request>[1]): Promise<PackDetailRead> => {\n\n return request<PackDetailRead>(getReadPackUrl(packId,params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getReadCatalogUrl = (packId: number,\n catalogId: number,\n params?: ReadCatalogParams,) => {\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 ? `/biblio/packs/${packId}/catalogs/${catalogId}?${stringifiedParams}` : `/biblio/packs/${packId}/catalogs/${catalogId}`\n}\n\n/**\n * One catalog inside a pack (E39).\n * @summary Read Catalog\n */\nexport const readCatalog = async (packId: number,\n catalogId: number,\n params?: ReadCatalogParams, options?: Parameters<typeof request>[1]): Promise<CatalogRead> => {\n\n return request<CatalogRead>(getReadCatalogUrl(packId,catalogId,params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getReadCatalogThemeUrl = (packId: number,\n catalogId: number,\n themeId: number,\n params?: ReadCatalogThemeParams,) => {\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 ? `/biblio/packs/${packId}/catalogs/${catalogId}/themes/${themeId}?${stringifiedParams}` : `/biblio/packs/${packId}/catalogs/${catalogId}/themes/${themeId}`\n}\n\n/**\n * The same catalog, narrowed to one theme (E40).\n * @summary Read Catalog Theme\n */\nexport const readCatalogTheme = async (packId: number,\n catalogId: number,\n themeId: number,\n params?: ReadCatalogThemeParams, options?: Parameters<typeof request>[1]): Promise<CatalogRead> => {\n\n return request<CatalogRead>(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YAAY,UAAU,UAAU,QAAQ,GAAG,sBAAsB,iBAAiB,OAAO,YAAY,UAAU,UAAU;AACzL;;;;;AAMA,MAAa,mBAAmB,OAAO,QACnC,WACA,SACA,QAAiC,YAAkE;CAErG,OAAO,QAAqB,uBAAuB,QAAO,WAAU,SAAQ,MAAM,GAClF;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { Ct as ReadHomeFeedParams, ci as HomeFeedRead } from "../chunks/index.js";
|
|
3
3
|
import { c as request } from "../chunks/client.js";
|
|
4
4
|
//#region src/api/biblio-home/biblio-home.d.ts
|
|
5
5
|
export declare const getReadHomeFeedUrl: (params?: ReadHomeFeedParams) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"biblio-home.js","names":[],"sources":["../../src/api/biblio-home/biblio-home.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
|
+
{"version":3,"file":"biblio-home.js","names":[],"sources":["../../src/api/biblio-home/biblio-home.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.9.0\n */\nimport type {\n HomeFeedRead,\n ReadHomeFeedParams\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getReadHomeFeedUrl = (params?: ReadHomeFeedParams,) => {\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 ? `/biblio/home-feed?${stringifiedParams}` : `/biblio/home-feed`\n}\n\n/**\n * Everything the home screen needs, in one call (E48).\n *\n * Each block is built independently and a block that raises is dropped. The\n * caller can tell the difference — an absent key means the section could not be\n * built, an empty list means there was nothing in it — which is more than the\n * legacy offered, where four carousels were hardcoded to empty and looked\n * identical to \"nothing new\".\n * @summary Read Home Feed\n */\nexport const readHomeFeed = async (params?: ReadHomeFeedParams, options?: Parameters<typeof request>[1]): Promise<HomeFeedRead> => {\n\n return request<HomeFeedRead>(getReadHomeFeedUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n"],"mappings":";;;AAcA,MAAa,sBAAsB,WAAiC;CAClE,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,qBAAqB,sBAAsB;AACnF;;;;;;;;;;;AAYA,MAAa,eAAe,OAAO,QAA6B,YAAmE;CAEjI,OAAO,QAAsB,mBAAmB,MAAM,GACtD;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { An as PackListRead, Cc as CategoryPreferencesWrite, Di as FavoriteAddWrite, Si as FavoritePage, Yt as PreferencesRead, hr as ListBiblioFavoritesParams, pi as HistoryPage, ur as ListHistoryParams, wc as CategoryListRead } from "../chunks/index.js";
|
|
3
3
|
import { c as request } from "../chunks/client.js";
|
|
4
4
|
//#region src/api/biblio-library/biblio-library.d.ts
|
|
5
5
|
export declare const getListBiblioCategoriesUrl: () => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"biblio-library.js","names":[],"sources":["../../src/api/biblio-library/biblio-library.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.8.2\n */\nimport type {\n CategoryListRead,\n CategoryPreferencesWrite,\n FavoriteAddWrite,\n FavoritePage,\n HistoryPage,\n ListBiblioFavoritesParams,\n ListHistoryParams,\n PackListRead,\n PreferencesRead\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getListBiblioCategoriesUrl = () => {\n\n\n\n\n return `/biblio/me/categories`\n}\n\n/**\n * The categories this account can reach (E26).\n *\n * Two independent gates, and both have to pass. Entitlement answers \"did the\n * company buy this\"; ``access_level`` answers \"is this person allowed it\" — an\n * ordinal on the account compared against one on the category, which is how a\n * child profile is kept out of the adult catalogue. Neither substitutes for the\n * other.\n * @summary List Biblio Categories\n */\nexport const listBiblioCategories = async ( options?: Parameters<typeof request>[1]): Promise<CategoryListRead> => {\n\n return request<CategoryListRead>(getListBiblioCategoriesUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getListBiblioFavoritesUrl = (params?: ListBiblioFavoritesParams,) => {\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 ? `/biblio/me/favorites?${stringifiedParams}` : `/biblio/me/favorites`\n}\n\n/**\n * The caller's favourites (E30), newest first.\n * @summary List Biblio Favorites\n */\nexport const listBiblioFavorites = async (params?: ListBiblioFavoritesParams, options?: Parameters<typeof request>[1]): Promise<FavoritePage> => {\n\n return request<FavoritePage>(getListBiblioFavoritesUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getRemoveBiblioFavoriteUrl = (contentId: number,) => {\n\n\n\n\n return `/biblio/me/favorites/${contentId}`\n}\n\n/**\n * Remove a favourite (E32). Idempotent — absent is already the desired state.\n * @summary Remove Biblio Favorite\n */\nexport const removeBiblioFavorite = async (contentId: number, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getRemoveBiblioFavoriteUrl(contentId),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\nexport const getAddBiblioFavoriteUrl = (contentId: number,) => {\n\n\n\n\n return `/biblio/me/favorites/${contentId}`\n}\n\n/**\n * Mark content as a favourite (E31). Idempotent.\n *\n * ``PUT`` and :func:`remove_favorite`'s ``DELETE`` replace one\n * ``POST /favorites`` carrying an ``enabled`` boolean — the verb encoded as\n * data. A retry after a timeout reversed the user's intent; a repeated ``PUT``\n * cannot (§4, consequence 3).\n *\n * Favouriting is not consumption, so it is not entitlement-gated: a member may\n * bookmark something their library has not licensed *yet*. Reaching the content\n * is gated, at the point of reaching it.\n * @summary Add Biblio Favorite\n */\nexport const addBiblioFavorite = async (contentId: number,\n favoriteAddWrite: FavoriteAddWrite, 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>(getAddBiblioFavoriteUrl(contentId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(favoriteAddWrite)\n }\n);}\n\n\nexport const getListHistoryUrl = (params?: ListHistoryParams,) => {\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 ? `/biblio/me/history?${stringifiedParams}` : `/biblio/me/history`\n}\n\n/**\n * What this account has consumed, most recent first (E33).\n *\n * One row per content item, not one per view: the caller wants \"what have I\n * been reading\", and ``consumption_event`` is append-only with a row per act.\n * The last access is therefore a MAX, and progress comes from\n * ``content_progress``, which is LEFT JOINed because an absent row means \"not\n * started\" rather than zero.\n * @summary List History\n */\nexport const listHistory = async (params?: ListHistoryParams, options?: Parameters<typeof request>[1]): Promise<HistoryPage> => {\n\n return request<HistoryPage>(getListHistoryUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getListPacksUrl = () => {\n\n\n\n\n return `/biblio/me/packs`\n}\n\n/**\n * The content packs this account can navigate (E25).\n *\n * A pack is a :class:`~app.models.biblio.catalogue.CatalogSection`, and one is\n * reachable when the contract reaches at least one category inside it. Deriving\n * it that way rather than granting packs directly means a pack cannot advertise\n * itself while every category under it is out of contract.\n *\n * Empty is a correct answer, not a broken one: an account whose contract has\n * lapsed reaches nothing.\n * @summary List Packs\n */\nexport const listPacks = async ( options?: Parameters<typeof request>[1]): Promise<PackListRead> => {\n\n return request<PackListRead>(getListPacksUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getReadPreferencesUrl = () => {\n\n\n\n\n return `/biblio/me/preferences`\n}\n\n/**\n * The caller's own preferences (E28).\n *\n * An object with one key rather than a bare array, so a second preference can\n * be added later without breaking every client.\n * @summary Read Preferences\n */\nexport const readPreferences = async ( options?: Parameters<typeof request>[1]): Promise<PreferencesRead> => {\n\n return request<PreferencesRead>(getReadPreferencesUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getReplaceCategoryPreferencesUrl = () => {\n\n\n\n\n return `/biblio/me/preferences/categories`\n}\n\n/**\n * Replace the favourite-category set wholesale (E29).\n *\n * ``PUT`` because the legacy handler already replaced the whole set; the verb\n * now says so. An empty array clears the set and is valid input — the legacy\n * left that path uncaught and returned ``500``.\n *\n * A category the account cannot reach is ``422``, listing the offending ids.\n * Silently dropping them would leave the client believing it had saved\n * something it had not.\n * @summary Replace Category Preferences\n */\nexport const replaceCategoryPreferences = async (categoryPreferencesWrite: CategoryPreferencesWrite, 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>(getReplaceCategoryPreferencesUrl(),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(categoryPreferencesWrite)\n }\n);}\n\n\n"],"mappings":";;;AAqBA,MAAa,mCAAmC;CAK9C,OAAO;AACT;;;;;;;;;;;AAYA,MAAa,uBAAuB,OAAQ,YAAuE;CAEjH,OAAO,QAA0B,2BAA2B,GAC5D;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,6BAA6B,WAAwC;CAChF,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,KAA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AK,UAAU,wBAAwB;CAC/C,CACF;AAAE"}
|
|
1
|
+
{"version":3,"file":"biblio-library.js","names":[],"sources":["../../src/api/biblio-library/biblio-library.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.9.0\n */\nimport type {\n CategoryListRead,\n CategoryPreferencesWrite,\n FavoriteAddWrite,\n FavoritePage,\n HistoryPage,\n ListBiblioFavoritesParams,\n ListHistoryParams,\n PackListRead,\n PreferencesRead\n} from '../../models';\n\nimport { request } from '../../client';\n\nexport const getListBiblioCategoriesUrl = () => {\n\n\n\n\n return `/biblio/me/categories`\n}\n\n/**\n * The categories this account can reach (E26).\n *\n * Two independent gates, and both have to pass. Entitlement answers \"did the\n * company buy this\"; ``access_level`` answers \"is this person allowed it\" — an\n * ordinal on the account compared against one on the category, which is how a\n * child profile is kept out of the adult catalogue. Neither substitutes for the\n * other.\n * @summary List Biblio Categories\n */\nexport const listBiblioCategories = async ( options?: Parameters<typeof request>[1]): Promise<CategoryListRead> => {\n\n return request<CategoryListRead>(getListBiblioCategoriesUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getListBiblioFavoritesUrl = (params?: ListBiblioFavoritesParams,) => {\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 ? `/biblio/me/favorites?${stringifiedParams}` : `/biblio/me/favorites`\n}\n\n/**\n * The caller's favourites (E30), newest first.\n * @summary List Biblio Favorites\n */\nexport const listBiblioFavorites = async (params?: ListBiblioFavoritesParams, options?: Parameters<typeof request>[1]): Promise<FavoritePage> => {\n\n return request<FavoritePage>(getListBiblioFavoritesUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getRemoveBiblioFavoriteUrl = (contentId: number,) => {\n\n\n\n\n return `/biblio/me/favorites/${contentId}`\n}\n\n/**\n * Remove a favourite (E32). Idempotent — absent is already the desired state.\n * @summary Remove Biblio Favorite\n */\nexport const removeBiblioFavorite = async (contentId: number, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getRemoveBiblioFavoriteUrl(contentId),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\nexport const getAddBiblioFavoriteUrl = (contentId: number,) => {\n\n\n\n\n return `/biblio/me/favorites/${contentId}`\n}\n\n/**\n * Mark content as a favourite (E31). Idempotent.\n *\n * ``PUT`` and :func:`remove_favorite`'s ``DELETE`` replace one\n * ``POST /favorites`` carrying an ``enabled`` boolean — the verb encoded as\n * data. A retry after a timeout reversed the user's intent; a repeated ``PUT``\n * cannot (§4, consequence 3).\n *\n * Favouriting is not consumption, so it is not entitlement-gated: a member may\n * bookmark something their library has not licensed *yet*. Reaching the content\n * is gated, at the point of reaching it.\n * @summary Add Biblio Favorite\n */\nexport const addBiblioFavorite = async (contentId: number,\n favoriteAddWrite: FavoriteAddWrite, 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>(getAddBiblioFavoriteUrl(contentId),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(favoriteAddWrite)\n }\n);}\n\n\nexport const getListHistoryUrl = (params?: ListHistoryParams,) => {\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 ? `/biblio/me/history?${stringifiedParams}` : `/biblio/me/history`\n}\n\n/**\n * What this account has consumed, most recent first (E33).\n *\n * One row per content item, not one per view: the caller wants \"what have I\n * been reading\", and ``consumption_event`` is append-only with a row per act.\n * The last access is therefore a MAX, and progress comes from\n * ``content_progress``, which is LEFT JOINed because an absent row means \"not\n * started\" rather than zero.\n * @summary List History\n */\nexport const listHistory = async (params?: ListHistoryParams, options?: Parameters<typeof request>[1]): Promise<HistoryPage> => {\n\n return request<HistoryPage>(getListHistoryUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getListPacksUrl = () => {\n\n\n\n\n return `/biblio/me/packs`\n}\n\n/**\n * The content packs this account can navigate (E25).\n *\n * A pack is a :class:`~app.models.biblio.catalogue.CatalogSection`, and one is\n * reachable when the contract reaches at least one category inside it. Deriving\n * it that way rather than granting packs directly means a pack cannot advertise\n * itself while every category under it is out of contract.\n *\n * Empty is a correct answer, not a broken one: an account whose contract has\n * lapsed reaches nothing.\n * @summary List Packs\n */\nexport const listPacks = async ( options?: Parameters<typeof request>[1]): Promise<PackListRead> => {\n\n return request<PackListRead>(getListPacksUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getReadPreferencesUrl = () => {\n\n\n\n\n return `/biblio/me/preferences`\n}\n\n/**\n * The caller's own preferences (E28).\n *\n * An object with one key rather than a bare array, so a second preference can\n * be added later without breaking every client.\n * @summary Read Preferences\n */\nexport const readPreferences = async ( options?: Parameters<typeof request>[1]): Promise<PreferencesRead> => {\n\n return request<PreferencesRead>(getReadPreferencesUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\nexport const getReplaceCategoryPreferencesUrl = () => {\n\n\n\n\n return `/biblio/me/preferences/categories`\n}\n\n/**\n * Replace the favourite-category set wholesale (E29).\n *\n * ``PUT`` because the legacy handler already replaced the whole set; the verb\n * now says so. An empty array clears the set and is valid input — the legacy\n * left that path uncaught and returned ``500``.\n *\n * A category the account cannot reach is ``422``, listing the offending ids.\n * Silently dropping them would leave the client believing it had saved\n * something it had not.\n * @summary Replace Category Preferences\n */\nexport const replaceCategoryPreferences = async (categoryPreferencesWrite: CategoryPreferencesWrite, 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>(getReplaceCategoryPreferencesUrl(),\n {\n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(categoryPreferencesWrite)\n }\n);}\n\n\n"],"mappings":";;;AAqBA,MAAa,mCAAmC;CAK9C,OAAO;AACT;;;;;;;;;;;AAYA,MAAa,uBAAuB,OAAQ,YAAuE;CAEjH,OAAO,QAA0B,2BAA2B,GAC5D;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,6BAA6B,WAAwC;CAChF,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;CA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BAAwB;CAC/C,CACF;AAAE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { yr as LicenseRead } from "../chunks/index.js";
|
|
3
3
|
import { c as request } from "../chunks/client.js";
|
|
4
4
|
//#region src/api/biblio-nextory/biblio-nextory.d.ts
|
|
5
5
|
export declare const getDeleteLicenseUrl: () => string;
|