@learnorama/mozaik-sdk 0.1.0-staging.11.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/README.md +94 -0
- package/dist/api/account.d.ts +75 -0
- package/dist/api/account.js +117 -0
- package/dist/api/account.js.map +1 -0
- package/dist/api/admin-catalogue.d.ts +68 -0
- package/dist/api/admin-catalogue.js +155 -0
- package/dist/api/admin-catalogue.js.map +1 -0
- package/dist/api/admin-consumption.d.ts +27 -0
- package/dist/api/admin-consumption.js +55 -0
- package/dist/api/admin-consumption.js.map +1 -0
- package/dist/api/admin-licenses.d.ts +21 -0
- package/dist/api/admin-licenses.js +34 -0
- package/dist/api/admin-licenses.js.map +1 -0
- package/dist/api/admin-patrons.d.ts +36 -0
- package/dist/api/admin-patrons.js +76 -0
- package/dist/api/admin-patrons.js.map +1 -0
- package/dist/api/admin-reviews.d.ts +30 -0
- package/dist/api/admin-reviews.js +63 -0
- package/dist/api/admin-reviews.js.map +1 -0
- package/dist/api/admin-roles.d.ts +34 -0
- package/dist/api/admin-roles.js +62 -0
- package/dist/api/admin-roles.js.map +1 -0
- package/dist/api/admin-support.d.ts +68 -0
- package/dist/api/admin-support.js +116 -0
- package/dist/api/admin-support.js.map +1 -0
- package/dist/api/admin-tenants.d.ts +33 -0
- package/dist/api/admin-tenants.js +68 -0
- package/dist/api/admin-tenants.js.map +1 -0
- package/dist/api/admin-tutoring.d.ts +159 -0
- package/dist/api/admin-tutoring.js +455 -0
- package/dist/api/admin-tutoring.js.map +1 -0
- package/dist/api/auth.d.ts +92 -0
- package/dist/api/auth.js +192 -0
- package/dist/api/auth.js.map +1 -0
- package/dist/api/biblio-catalogue.d.ts +122 -0
- package/dist/api/biblio-catalogue.js +223 -0
- package/dist/api/biblio-catalogue.js.map +1 -0
- package/dist/api/biblio-home.d.ts +18 -0
- package/dist/api/biblio-home.js +31 -0
- package/dist/api/biblio-home.js.map +1 -0
- package/dist/api/biblio-library.d.ts +94 -0
- package/dist/api/biblio-library.js +187 -0
- package/dist/api/biblio-library.js.map +1 -0
- package/dist/api/biblio-nextory.d.ts +43 -0
- package/dist/api/biblio-nextory.js +65 -0
- package/dist/api/biblio-nextory.js.map +1 -0
- package/dist/api/biblio-press.d.ts +38 -0
- package/dist/api/biblio-press.js +70 -0
- package/dist/api/biblio-press.js.map +1 -0
- package/dist/api/biblio-search.d.ts +17 -0
- package/dist/api/biblio-search.js +30 -0
- package/dist/api/biblio-search.js.map +1 -0
- package/dist/api/biblio-telemetry.d.ts +28 -0
- package/dist/api/biblio-telemetry.js +49 -0
- package/dist/api/biblio-telemetry.js.map +1 -0
- package/dist/api/consumption.d.ts +30 -0
- package/dist/api/consumption.js +45 -0
- package/dist/api/consumption.js.map +1 -0
- package/dist/api/cvs-app.d.ts +39 -0
- package/dist/api/cvs-app.js +72 -0
- package/dist/api/cvs-app.js.map +1 -0
- package/dist/api/cvs-documents.d.ts +106 -0
- package/dist/api/cvs-documents.js +208 -0
- package/dist/api/cvs-documents.js.map +1 -0
- package/dist/api/cvs-favorites.d.ts +53 -0
- package/dist/api/cvs-favorites.js +82 -0
- package/dist/api/cvs-favorites.js.map +1 -0
- package/dist/api/cvs-loans.d.ts +59 -0
- package/dist/api/cvs-loans.js +106 -0
- package/dist/api/cvs-loans.js.map +1 -0
- package/dist/api/cvs-streaming.d.ts +40 -0
- package/dist/api/cvs-streaming.js +68 -0
- package/dist/api/cvs-streaming.js.map +1 -0
- package/dist/api/index.d.ts +34 -0
- package/dist/api/index.js +34 -0
- package/dist/api/partner-catalogue.d.ts +77 -0
- package/dist/api/partner-catalogue.js +125 -0
- package/dist/api/partner-catalogue.js.map +1 -0
- package/dist/api/partner-reader.d.ts +56 -0
- package/dist/api/partner-reader.js +103 -0
- package/dist/api/partner-reader.js.map +1 -0
- package/dist/api/profiles.d.ts +64 -0
- package/dist/api/profiles.js +126 -0
- package/dist/api/profiles.js.map +1 -0
- package/dist/api/tutoring-catalogue.d.ts +32 -0
- package/dist/api/tutoring-catalogue.js +59 -0
- package/dist/api/tutoring-catalogue.js.map +1 -0
- package/dist/api/tutoring-chat.d.ts +31 -0
- package/dist/api/tutoring-chat.js +71 -0
- package/dist/api/tutoring-chat.js.map +1 -0
- package/dist/api/tutoring-dispatch.d.ts +37 -0
- package/dist/api/tutoring-dispatch.js +83 -0
- package/dist/api/tutoring-dispatch.js.map +1 -0
- package/dist/api/tutoring-practitioner.d.ts +55 -0
- package/dist/api/tutoring-practitioner.js +110 -0
- package/dist/api/tutoring-practitioner.js.map +1 -0
- package/dist/api/tutoring-requests.d.ts +86 -0
- package/dist/api/tutoring-requests.js +176 -0
- package/dist/api/tutoring-requests.js.map +1 -0
- package/dist/chunks/client.d.ts +28 -0
- package/dist/chunks/client.js +61 -0
- package/dist/chunks/client.js.map +1 -0
- package/dist/chunks/index.d.ts +4566 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/models.d.ts +3 -0
- package/dist/models.js +175 -0
- package/dist/models.js.map +1 -0
- package/dist/react/account.d.ts +163 -0
- package/dist/react/account.js +240 -0
- package/dist/react/account.js.map +1 -0
- package/dist/react/admin-catalogue.d.ts +196 -0
- package/dist/react/admin-catalogue.js +336 -0
- package/dist/react/admin-catalogue.js.map +1 -0
- package/dist/react/admin-consumption.d.ts +75 -0
- package/dist/react/admin-consumption.js +127 -0
- package/dist/react/admin-consumption.js.map +1 -0
- package/dist/react/admin-licenses.d.ts +50 -0
- package/dist/react/admin-licenses.js +78 -0
- package/dist/react/admin-licenses.js.map +1 -0
- package/dist/react/admin-patrons.d.ts +111 -0
- package/dist/react/admin-patrons.js +173 -0
- package/dist/react/admin-patrons.js.map +1 -0
- package/dist/react/admin-reviews.d.ts +78 -0
- package/dist/react/admin-reviews.js +135 -0
- package/dist/react/admin-reviews.js.map +1 -0
- package/dist/react/admin-roles.d.ts +82 -0
- package/dist/react/admin-roles.js +135 -0
- package/dist/react/admin-roles.js.map +1 -0
- package/dist/react/admin-support.d.ts +123 -0
- package/dist/react/admin-support.js +208 -0
- package/dist/react/admin-support.js.map +1 -0
- package/dist/react/admin-tenants.d.ts +108 -0
- package/dist/react/admin-tenants.js +165 -0
- package/dist/react/admin-tenants.js.map +1 -0
- package/dist/react/admin-tutoring.d.ts +556 -0
- package/dist/react/admin-tutoring.js +954 -0
- package/dist/react/admin-tutoring.js.map +1 -0
- package/dist/react/auth.d.ts +220 -0
- package/dist/react/auth.js +372 -0
- package/dist/react/auth.js.map +1 -0
- package/dist/react/biblio-catalogue.d.ts +374 -0
- package/dist/react/biblio-catalogue.js +498 -0
- package/dist/react/biblio-catalogue.js.map +1 -0
- package/dist/react/biblio-home.d.ts +47 -0
- package/dist/react/biblio-home.js +75 -0
- package/dist/react/biblio-home.js.map +1 -0
- package/dist/react/biblio-library.d.ts +285 -0
- package/dist/react/biblio-library.js +411 -0
- package/dist/react/biblio-library.js.map +1 -0
- package/dist/react/biblio-nextory.d.ts +100 -0
- package/dist/react/biblio-nextory.js +163 -0
- package/dist/react/biblio-nextory.js.map +1 -0
- package/dist/react/biblio-press.d.ts +121 -0
- package/dist/react/biblio-press.js +163 -0
- package/dist/react/biblio-press.js.map +1 -0
- package/dist/react/biblio-search.d.ts +46 -0
- package/dist/react/biblio-search.js +74 -0
- package/dist/react/biblio-search.js.map +1 -0
- package/dist/react/biblio-telemetry.d.ts +49 -0
- package/dist/react/biblio-telemetry.js +85 -0
- package/dist/react/biblio-telemetry.js.map +1 -0
- package/dist/react/consumption.d.ts +66 -0
- package/dist/react/consumption.js +109 -0
- package/dist/react/consumption.js.map +1 -0
- package/dist/react/cvs-app.d.ts +86 -0
- package/dist/react/cvs-app.js +144 -0
- package/dist/react/cvs-app.js.map +1 -0
- package/dist/react/cvs-documents.d.ts +254 -0
- package/dist/react/cvs-documents.js +418 -0
- package/dist/react/cvs-documents.js.map +1 -0
- package/dist/react/cvs-favorites.d.ts +143 -0
- package/dist/react/cvs-favorites.js +206 -0
- package/dist/react/cvs-favorites.js.map +1 -0
- package/dist/react/cvs-loans.d.ts +140 -0
- package/dist/react/cvs-loans.js +234 -0
- package/dist/react/cvs-loans.js.map +1 -0
- package/dist/react/cvs-streaming.d.ts +87 -0
- package/dist/react/cvs-streaming.js +141 -0
- package/dist/react/cvs-streaming.js.map +1 -0
- package/dist/react/index.d.ts +34 -0
- package/dist/react/index.js +34 -0
- package/dist/react/partner-catalogue.d.ts +223 -0
- package/dist/react/partner-catalogue.js +301 -0
- package/dist/react/partner-catalogue.js.map +1 -0
- package/dist/react/partner-reader.d.ts +159 -0
- package/dist/react/partner-reader.js +226 -0
- package/dist/react/partner-reader.js.map +1 -0
- package/dist/react/profiles.d.ts +174 -0
- package/dist/react/profiles.js +279 -0
- package/dist/react/profiles.js.map +1 -0
- package/dist/react/tutoring-catalogue.d.ts +115 -0
- package/dist/react/tutoring-catalogue.js +151 -0
- package/dist/react/tutoring-catalogue.js.map +1 -0
- package/dist/react/tutoring-chat.d.ts +96 -0
- package/dist/react/tutoring-chat.js +172 -0
- package/dist/react/tutoring-chat.js.map +1 -0
- package/dist/react/tutoring-dispatch.d.ts +102 -0
- package/dist/react/tutoring-dispatch.js +183 -0
- package/dist/react/tutoring-dispatch.js.map +1 -0
- package/dist/react/tutoring-practitioner.d.ts +129 -0
- package/dist/react/tutoring-practitioner.js +230 -0
- package/dist/react/tutoring-practitioner.js.map +1 -0
- package/dist/react/tutoring-requests.d.ts +233 -0
- package/dist/react/tutoring-requests.js +385 -0
- package/dist/react/tutoring-requests.js.map +1 -0
- package/package.json +70 -0
|
@@ -0,0 +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.1.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: '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,4BAA4B,MAAM,GAC/E;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,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,4BAA4B,sBAAsB;AAC1F;;;;;;;;AASA,MAAa,eAAe,OAAO,QAA6B,YAA2E;CAEzI,OAAO,QAA8B,mBAAmB,MAAM,GAC9D;EACE,GAAG;EACH,QAAQ;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,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"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
|
|
2
|
+
import { $t as MeRead, Dr as CredentialsWrite, Kr as AuthorizationRead, Y as RefreshWrite, jr as CodeExchangeWrite, qr as AuthorizationParams, tn as LogoutWrite, z as SessionRead } from "../chunks/index.js";
|
|
3
|
+
import { c as request } from "../chunks/client.js";
|
|
4
|
+
//#region src/api/auth/auth.d.ts
|
|
5
|
+
export declare const getAuthorizationUrl: (params: AuthorizationParams) => string;
|
|
6
|
+
/**
|
|
7
|
+
* Build the Keycloak authorization URL for this client and this tenant.
|
|
8
|
+
*
|
|
9
|
+
* Everything cryptographic belongs to the caller: it generates ``state``, the
|
|
10
|
+
* PKCE verifier and the ``nonce``, and only ever sends the challenge. This
|
|
11
|
+
* endpoint contributes the one thing the caller cannot know — which identity
|
|
12
|
+
* provider to route to — and refuses an unsafe ``redirect_uri``.
|
|
13
|
+
*
|
|
14
|
+
* ``S256`` is hardcoded. ``plain`` is a valid PKCE method and provides no
|
|
15
|
+
* protection, so making it selectable would only ever be used by mistake.
|
|
16
|
+
*
|
|
17
|
+
* A resolved provider is passed as ``kc_idp_hint``. Aliases are case-sensitive
|
|
18
|
+
* at the broker and an unknown one silently falls back to the login form, which
|
|
19
|
+
* is why :func:`_resolve_provider_alias` validates against the registry instead
|
|
20
|
+
* of forwarding whatever arrived.
|
|
21
|
+
* @summary Authorization
|
|
22
|
+
*/
|
|
23
|
+
export declare const authorization: (params: AuthorizationParams, options?: Parameters<typeof request>[1]) => Promise<AuthorizationRead>;
|
|
24
|
+
export declare const getReadMeUrl: () => string;
|
|
25
|
+
/**
|
|
26
|
+
* Who the bearer of this token is, and what the session may do.
|
|
27
|
+
*
|
|
28
|
+
* No tokens in the response — this endpoint reissues nothing, and a shape with
|
|
29
|
+
* empty token fields would invite a client to store them. It is also the
|
|
30
|
+
* cheapest liveness check a client has: it exercises verification,
|
|
31
|
+
* tenant resolution and the account link in one call, so a 200 here means the
|
|
32
|
+
* whole chain is intact.
|
|
33
|
+
* @summary Read Me
|
|
34
|
+
*/
|
|
35
|
+
export declare const readMe: (options?: Parameters<typeof request>[1]) => Promise<MeRead>;
|
|
36
|
+
export declare const getDeleteSessionUrl: () => string;
|
|
37
|
+
/**
|
|
38
|
+
* Sign out, revoking the refresh token at the broker.
|
|
39
|
+
*
|
|
40
|
+
* Always 204. A logout that can fail is a logout users do not trust, and there
|
|
41
|
+
* is nothing useful for the caller to do about an unreachable broker — it is
|
|
42
|
+
* discarding its tokens either way. The failure is logged, not returned.
|
|
43
|
+
*
|
|
44
|
+
* The access token stays valid until it expires. That is inherent to verifying
|
|
45
|
+
* tokens offline, and it is why the realm keeps access-token lifetimes short
|
|
46
|
+
* rather than why this endpoint should pretend otherwise.
|
|
47
|
+
* @summary Delete Session
|
|
48
|
+
*/
|
|
49
|
+
export declare const deleteSession: (logoutWrite: LogoutWrite, options?: Parameters<typeof request>[1]) => Promise<void>;
|
|
50
|
+
export declare const getCreateSessionFromCredentialsUrl: () => string;
|
|
51
|
+
/**
|
|
52
|
+
* Log in with a username and password, via the broker's direct grant.
|
|
53
|
+
*
|
|
54
|
+
* Off unless ``AUTH_ALLOW_PASSWORD_GRANT`` says otherwise, and it should stay
|
|
55
|
+
* off wherever the client fleet allows: the grant defeats MFA, cannot reach a
|
|
56
|
+
* brokered partner, and puts the password through this process. It exists for
|
|
57
|
+
* the native apps already in the field.
|
|
58
|
+
*
|
|
59
|
+
* Rate limited on both the submitted username and the client address. Keyed on
|
|
60
|
+
* the lower-cased username so that case variation is not a way around the
|
|
61
|
+
* counter, and on the address so that spraying many usernames is bounded too.
|
|
62
|
+
* @summary Create Session From Credentials
|
|
63
|
+
*/
|
|
64
|
+
export declare const createSessionFromCredentials: (credentialsWrite: CredentialsWrite, options?: Parameters<typeof request>[1]) => Promise<SessionRead>;
|
|
65
|
+
export declare const getRefreshSessionUrl: () => string;
|
|
66
|
+
/**
|
|
67
|
+
* Exchange a refresh token for a new pair.
|
|
68
|
+
*
|
|
69
|
+
* Public: the refresh token *is* the credential, so requiring a valid access
|
|
70
|
+
* token as well would make the endpoint useless at the moment it is needed.
|
|
71
|
+
* Rotation happens at the broker, so the presented token stops working as the
|
|
72
|
+
* new one is issued.
|
|
73
|
+
*
|
|
74
|
+
* Returns the account as well as the tokens. That costs one indexed lookup and
|
|
75
|
+
* means a client resuming from cold storage does not need a second call to
|
|
76
|
+
* discover whether the account is still active — which it checks, because
|
|
77
|
+
* deactivation is a local decision Keycloak knows nothing about.
|
|
78
|
+
* @summary Refresh Session
|
|
79
|
+
*/
|
|
80
|
+
export declare const refreshSession: (refreshWrite: RefreshWrite, options?: Parameters<typeof request>[1]) => Promise<SessionRead>;
|
|
81
|
+
export declare const getCreateSessionFromCodeUrl: () => string;
|
|
82
|
+
/**
|
|
83
|
+
* Finish a brokered login: code plus verifier in, session out.
|
|
84
|
+
*
|
|
85
|
+
* Rate limited on the client address rather than on a user, because at this
|
|
86
|
+
* point there is no user — the code has not been exchanged yet. The limit is
|
|
87
|
+
* what stops a stolen code being brute-forced alongside a guessed verifier.
|
|
88
|
+
* @summary Create Session From Code
|
|
89
|
+
*/
|
|
90
|
+
export declare const createSessionFromCode: (codeExchangeWrite: CodeExchangeWrite, options?: Parameters<typeof request>[1]) => Promise<SessionRead>;
|
|
91
|
+
//#endregion
|
|
92
|
+
//# sourceMappingURL=auth.d.ts.map
|
package/dist/api/auth.js
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
|
|
2
|
+
import { r as request } from "../chunks/client.js";
|
|
3
|
+
//#region src/api/auth/auth.ts
|
|
4
|
+
const getAuthorizationUrl = (params) => {
|
|
5
|
+
const normalizedParams = new URLSearchParams();
|
|
6
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
7
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
8
|
+
});
|
|
9
|
+
const stringifiedParams = normalizedParams.toString();
|
|
10
|
+
return stringifiedParams.length > 0 ? `/auth/authorization?${stringifiedParams}` : `/auth/authorization`;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Build the Keycloak authorization URL for this client and this tenant.
|
|
14
|
+
*
|
|
15
|
+
* Everything cryptographic belongs to the caller: it generates ``state``, the
|
|
16
|
+
* PKCE verifier and the ``nonce``, and only ever sends the challenge. This
|
|
17
|
+
* endpoint contributes the one thing the caller cannot know — which identity
|
|
18
|
+
* provider to route to — and refuses an unsafe ``redirect_uri``.
|
|
19
|
+
*
|
|
20
|
+
* ``S256`` is hardcoded. ``plain`` is a valid PKCE method and provides no
|
|
21
|
+
* protection, so making it selectable would only ever be used by mistake.
|
|
22
|
+
*
|
|
23
|
+
* A resolved provider is passed as ``kc_idp_hint``. Aliases are case-sensitive
|
|
24
|
+
* at the broker and an unknown one silently falls back to the login form, which
|
|
25
|
+
* is why :func:`_resolve_provider_alias` validates against the registry instead
|
|
26
|
+
* of forwarding whatever arrived.
|
|
27
|
+
* @summary Authorization
|
|
28
|
+
*/
|
|
29
|
+
const authorization = async (params, options) => {
|
|
30
|
+
return request(getAuthorizationUrl(params), {
|
|
31
|
+
...options,
|
|
32
|
+
method: "GET"
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
const getReadMeUrl = () => {
|
|
36
|
+
return `/auth/me`;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Who the bearer of this token is, and what the session may do.
|
|
40
|
+
*
|
|
41
|
+
* No tokens in the response — this endpoint reissues nothing, and a shape with
|
|
42
|
+
* empty token fields would invite a client to store them. It is also the
|
|
43
|
+
* cheapest liveness check a client has: it exercises verification,
|
|
44
|
+
* tenant resolution and the account link in one call, so a 200 here means the
|
|
45
|
+
* whole chain is intact.
|
|
46
|
+
* @summary Read Me
|
|
47
|
+
*/
|
|
48
|
+
const readMe = async (options) => {
|
|
49
|
+
return request(getReadMeUrl(), {
|
|
50
|
+
...options,
|
|
51
|
+
method: "GET"
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
const getDeleteSessionUrl = () => {
|
|
55
|
+
return `/auth/sessions`;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Sign out, revoking the refresh token at the broker.
|
|
59
|
+
*
|
|
60
|
+
* Always 204. A logout that can fail is a logout users do not trust, and there
|
|
61
|
+
* is nothing useful for the caller to do about an unreachable broker — it is
|
|
62
|
+
* discarding its tokens either way. The failure is logged, not returned.
|
|
63
|
+
*
|
|
64
|
+
* The access token stays valid until it expires. That is inherent to verifying
|
|
65
|
+
* tokens offline, and it is why the realm keeps access-token lifetimes short
|
|
66
|
+
* rather than why this endpoint should pretend otherwise.
|
|
67
|
+
* @summary Delete Session
|
|
68
|
+
*/
|
|
69
|
+
const deleteSession = async (logoutWrite, options) => {
|
|
70
|
+
const getHeaders = (h) => {
|
|
71
|
+
if (!h) return {};
|
|
72
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
73
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
74
|
+
const headers = {};
|
|
75
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
76
|
+
return headers;
|
|
77
|
+
};
|
|
78
|
+
return request(getDeleteSessionUrl(), {
|
|
79
|
+
...options,
|
|
80
|
+
method: "DELETE",
|
|
81
|
+
headers: {
|
|
82
|
+
"Content-Type": "application/json",
|
|
83
|
+
...getHeaders(options?.headers)
|
|
84
|
+
},
|
|
85
|
+
body: JSON.stringify(logoutWrite)
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
const getCreateSessionFromCredentialsUrl = () => {
|
|
89
|
+
return `/auth/sessions`;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Log in with a username and password, via the broker's direct grant.
|
|
93
|
+
*
|
|
94
|
+
* Off unless ``AUTH_ALLOW_PASSWORD_GRANT`` says otherwise, and it should stay
|
|
95
|
+
* off wherever the client fleet allows: the grant defeats MFA, cannot reach a
|
|
96
|
+
* brokered partner, and puts the password through this process. It exists for
|
|
97
|
+
* the native apps already in the field.
|
|
98
|
+
*
|
|
99
|
+
* Rate limited on both the submitted username and the client address. Keyed on
|
|
100
|
+
* the lower-cased username so that case variation is not a way around the
|
|
101
|
+
* counter, and on the address so that spraying many usernames is bounded too.
|
|
102
|
+
* @summary Create Session From Credentials
|
|
103
|
+
*/
|
|
104
|
+
const createSessionFromCredentials = async (credentialsWrite, options) => {
|
|
105
|
+
const getHeaders = (h) => {
|
|
106
|
+
if (!h) return {};
|
|
107
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
108
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
109
|
+
const headers = {};
|
|
110
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
111
|
+
return headers;
|
|
112
|
+
};
|
|
113
|
+
return request(getCreateSessionFromCredentialsUrl(), {
|
|
114
|
+
...options,
|
|
115
|
+
method: "POST",
|
|
116
|
+
headers: {
|
|
117
|
+
"Content-Type": "application/json",
|
|
118
|
+
...getHeaders(options?.headers)
|
|
119
|
+
},
|
|
120
|
+
body: JSON.stringify(credentialsWrite)
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
const getRefreshSessionUrl = () => {
|
|
124
|
+
return `/auth/sessions`;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Exchange a refresh token for a new pair.
|
|
128
|
+
*
|
|
129
|
+
* Public: the refresh token *is* the credential, so requiring a valid access
|
|
130
|
+
* token as well would make the endpoint useless at the moment it is needed.
|
|
131
|
+
* Rotation happens at the broker, so the presented token stops working as the
|
|
132
|
+
* new one is issued.
|
|
133
|
+
*
|
|
134
|
+
* Returns the account as well as the tokens. That costs one indexed lookup and
|
|
135
|
+
* means a client resuming from cold storage does not need a second call to
|
|
136
|
+
* discover whether the account is still active — which it checks, because
|
|
137
|
+
* deactivation is a local decision Keycloak knows nothing about.
|
|
138
|
+
* @summary Refresh Session
|
|
139
|
+
*/
|
|
140
|
+
const refreshSession = async (refreshWrite, options) => {
|
|
141
|
+
const getHeaders = (h) => {
|
|
142
|
+
if (!h) return {};
|
|
143
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
144
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
145
|
+
const headers = {};
|
|
146
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
147
|
+
return headers;
|
|
148
|
+
};
|
|
149
|
+
return request(getRefreshSessionUrl(), {
|
|
150
|
+
...options,
|
|
151
|
+
method: "PUT",
|
|
152
|
+
headers: {
|
|
153
|
+
"Content-Type": "application/json",
|
|
154
|
+
...getHeaders(options?.headers)
|
|
155
|
+
},
|
|
156
|
+
body: JSON.stringify(refreshWrite)
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
const getCreateSessionFromCodeUrl = () => {
|
|
160
|
+
return `/auth/sessions/code`;
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* Finish a brokered login: code plus verifier in, session out.
|
|
164
|
+
*
|
|
165
|
+
* Rate limited on the client address rather than on a user, because at this
|
|
166
|
+
* point there is no user — the code has not been exchanged yet. The limit is
|
|
167
|
+
* what stops a stolen code being brute-forced alongside a guessed verifier.
|
|
168
|
+
* @summary Create Session From Code
|
|
169
|
+
*/
|
|
170
|
+
const createSessionFromCode = async (codeExchangeWrite, options) => {
|
|
171
|
+
const getHeaders = (h) => {
|
|
172
|
+
if (!h) return {};
|
|
173
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
174
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
175
|
+
const headers = {};
|
|
176
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
177
|
+
return headers;
|
|
178
|
+
};
|
|
179
|
+
return request(getCreateSessionFromCodeUrl(), {
|
|
180
|
+
...options,
|
|
181
|
+
method: "POST",
|
|
182
|
+
headers: {
|
|
183
|
+
"Content-Type": "application/json",
|
|
184
|
+
...getHeaders(options?.headers)
|
|
185
|
+
},
|
|
186
|
+
body: JSON.stringify(codeExchangeWrite)
|
|
187
|
+
});
|
|
188
|
+
};
|
|
189
|
+
//#endregion
|
|
190
|
+
export { authorization, createSessionFromCode, createSessionFromCredentials, deleteSession, getAuthorizationUrl, getCreateSessionFromCodeUrl, getCreateSessionFromCredentialsUrl, getDeleteSessionUrl, getReadMeUrl, getRefreshSessionUrl, readMe, refreshSession };
|
|
191
|
+
|
|
192
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +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.1.0\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 * ``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 * Always 204. A logout that can fail is a logout users do not trust, and there\n * is nothing useful for the caller 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":";;;AAoBA,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;;;;;;;;;;;;;;;;;;AAmBA,MAAa,gBAAgB,OAAO,QAA6B,YAAwE;CAEvI,OAAO,QAA2B,oBAAoB,MAAM,GAC5D;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,qBAAqB;CAKhC,OAAO;AACT;;;;;;;;;;;AAYA,MAAa,SAAS,OAAQ,YAA6D;CAEzF,OAAO,QAAgB,aAAa,GACpC;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAGF,MAAa,4BAA4B;CAKvC,OAAO;AACT;;;;;;;;;;;;;AAcA,MAAa,gBAAgB,OAAO,aAA0B,YAA2D;CAErH,MAAM,cAAc,MAAwF;EAC5G,IAAI,CAAC,G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
+
import { An as LikeRead, Or as ContentRead, Rr as CatalogRead, Vn as LearningPathDetailRead, Wt as PackDetailRead, X as RecommendationsRead, Z as ReadRecommendationsParams, dt as ReadCatalogParams, et as ReadPackParams, fr as EditorDetailRead, lr as EditorListRead, lt as ReadEditorParams, ut as ReadCatalogThemeParams, wn as ListEditorsParams } from "../chunks/index.js";
|
|
3
|
+
import { c as request } from "../chunks/client.js";
|
|
4
|
+
//#region src/api/biblio-catalogue/biblio-catalogue.d.ts
|
|
5
|
+
export declare const getReadContentUrl: (contentId: number) => string;
|
|
6
|
+
/**
|
|
7
|
+
* One content item, with this caller's own state on it (E34).
|
|
8
|
+
*
|
|
9
|
+
* ``liked`` and ``favorited`` are why this is not just the summary shape: they
|
|
10
|
+
* are per-caller and therefore uncacheable across users, which is worth knowing
|
|
11
|
+
* before anyone puts a shared cache in front of it.
|
|
12
|
+
* @summary Read Content
|
|
13
|
+
*/
|
|
14
|
+
export declare const readContent: (contentId: number, options?: Parameters<typeof request>[1]) => Promise<ContentRead>;
|
|
15
|
+
export declare const getUnlikeContentUrl: (contentId: number) => string;
|
|
16
|
+
/**
|
|
17
|
+
* Withdraw a like (E37). Idempotent — not liked is already the desired state.
|
|
18
|
+
* @summary Unlike Content
|
|
19
|
+
*/
|
|
20
|
+
export declare const unlikeContent: (contentId: number, options?: Parameters<typeof request>[1]) => Promise<LikeRead>;
|
|
21
|
+
export declare const getLikeContentUrl: (contentId: number) => string;
|
|
22
|
+
/**
|
|
23
|
+
* Record a like (E36). Idempotent.
|
|
24
|
+
*
|
|
25
|
+
* This and :func:`unlike_content` replace one non-idempotent
|
|
26
|
+
* ``POST /content/{id}/toggle-like``. A retried toggle reverses the user's
|
|
27
|
+
* intent; a repeated ``PUT`` cannot (§4, consequence 3).
|
|
28
|
+
*
|
|
29
|
+
* ``like_count`` is recomputed from ``content_rating`` rather than incremented,
|
|
30
|
+
* because an increment beside an upsert double-counts the second time the same
|
|
31
|
+
* person likes the same thing.
|
|
32
|
+
* @summary Like Content
|
|
33
|
+
*/
|
|
34
|
+
export declare const likeContent: (contentId: number, options?: Parameters<typeof request>[1]) => Promise<LikeRead>;
|
|
35
|
+
export declare const getReadRecommendationsUrl: (contentId: number, params?: ReadRecommendationsParams) => string;
|
|
36
|
+
/**
|
|
37
|
+
* Related content the caller can also reach (E35).
|
|
38
|
+
*
|
|
39
|
+
* Recommending something the account cannot open is worse than recommending
|
|
40
|
+
* nothing, so the candidate set is entitlement-filtered before ranking rather
|
|
41
|
+
* than after — filtering afterwards silently shortens the list instead.
|
|
42
|
+
*
|
|
43
|
+
* Keyword overlap for now, over the GIN index on ``content.keywords``.
|
|
44
|
+
* @summary Read Recommendations
|
|
45
|
+
*/
|
|
46
|
+
export declare const readRecommendations: (contentId: number, params?: ReadRecommendationsParams, options?: Parameters<typeof request>[1]) => Promise<RecommendationsRead>;
|
|
47
|
+
export declare const getListEditorsUrl: (params?: ListEditorsParams) => string;
|
|
48
|
+
/**
|
|
49
|
+
* Active editors (E44).
|
|
50
|
+
*
|
|
51
|
+
* ``order`` and ``sort`` are resolved against a whitelist and never
|
|
52
|
+
* interpolated. The legacy passed both straight to the query layer (defect
|
|
53
|
+
* D17); an unrecognised value is ``422`` rather than a surprise ordering.
|
|
54
|
+
*
|
|
55
|
+
* The collection is not wrapped in a single-element array. The legacy
|
|
56
|
+
* ``GET /api/v1/editors/`` was (§2.1).
|
|
57
|
+
*
|
|
58
|
+
* Authenticated even though the answer does not depend on who is asking. Which
|
|
59
|
+
* publishers a platform carries is commercial information, and an endpoint that
|
|
60
|
+
* enumerates them for anyone is a competitor's first request. The sibling
|
|
61
|
+
* ``/editors/{id}`` was already authenticated; this one was not, which is how
|
|
62
|
+
* the inconsistency was found.
|
|
63
|
+
* @summary List Editors
|
|
64
|
+
*/
|
|
65
|
+
export declare const listEditors: (params?: ListEditorsParams, options?: Parameters<typeof request>[1]) => Promise<EditorListRead>;
|
|
66
|
+
export declare const getReadEditorUrl: (editorId: number, params?: ReadEditorParams) => string;
|
|
67
|
+
/**
|
|
68
|
+
* One editor and the content of theirs this caller can reach (E45).
|
|
69
|
+
*
|
|
70
|
+
* One endpoint replaces two — a page and a JSON route that used ``pageSize``
|
|
71
|
+
* instead of ``limit`` and wrapped the object in an array. Same entity, two
|
|
72
|
+
* conventions, one codebase (§4, consequence 5).
|
|
73
|
+
* @summary Read Editor
|
|
74
|
+
*/
|
|
75
|
+
export declare const readEditor: (editorId: number, params?: ReadEditorParams, options?: Parameters<typeof request>[1]) => Promise<EditorDetailRead>;
|
|
76
|
+
export declare const getReadLearningPathUrl: (learningPathId: number) => string;
|
|
77
|
+
/**
|
|
78
|
+
* A ``parcours`` and the content it walks through, in order.
|
|
79
|
+
*
|
|
80
|
+
* The other end of the ``parcours`` array on a pack, which named paths a client
|
|
81
|
+
* then had no way to open.
|
|
82
|
+
*
|
|
83
|
+
* Steps the caller is not entitled to are **dropped, not hidden behind a
|
|
84
|
+
* padlock**: the same category test every listing uses decides what appears, so
|
|
85
|
+
* a path cannot become a way to learn that an item exists. That does mean a
|
|
86
|
+
* path can come back with fewer steps than the library curated, and with gaps
|
|
87
|
+
* in ``stepOrder`` — which is why the order is a field rather than the array
|
|
88
|
+
* index.
|
|
89
|
+
*
|
|
90
|
+
* An inactive path is ``404`` rather than an empty one: it was withdrawn, and
|
|
91
|
+
* an empty sequence would read as "we have nothing for you" instead.
|
|
92
|
+
* @summary Read Learning Path
|
|
93
|
+
*/
|
|
94
|
+
export declare const readLearningPath: (learningPathId: number, options?: Parameters<typeof request>[1]) => Promise<LearningPathDetailRead>;
|
|
95
|
+
export declare const getReadPackUrl: (packId: number, params?: ReadPackParams) => string;
|
|
96
|
+
/**
|
|
97
|
+
* A pack with its catalogs, latest additions and learning paths (E38).
|
|
98
|
+
*
|
|
99
|
+
* ``canonical`` is how the redirect dies. When a pack resolves to a single
|
|
100
|
+
* catalog the legacy answered ``302``; here the response is ``200`` and
|
|
101
|
+
* ``canonical`` names the resolved catalog, leaving the client to decide whether
|
|
102
|
+
* to follow it (§5.1).
|
|
103
|
+
*
|
|
104
|
+
* A pack the caller has no entitlement to is ``404``. The legacy dereferenced
|
|
105
|
+
* ``null`` and returned ``500`` (defect D12).
|
|
106
|
+
* @summary Read Pack
|
|
107
|
+
*/
|
|
108
|
+
export declare const readPack: (packId: number, params?: ReadPackParams, options?: Parameters<typeof request>[1]) => Promise<PackDetailRead>;
|
|
109
|
+
export declare const getReadCatalogUrl: (packId: number, catalogId: number, params?: ReadCatalogParams) => string;
|
|
110
|
+
/**
|
|
111
|
+
* One catalog inside a pack (E39).
|
|
112
|
+
* @summary Read Catalog
|
|
113
|
+
*/
|
|
114
|
+
export declare const readCatalog: (packId: number, catalogId: number, params?: ReadCatalogParams, options?: Parameters<typeof request>[1]) => Promise<CatalogRead>;
|
|
115
|
+
export declare const getReadCatalogThemeUrl: (packId: number, catalogId: number, themeId: number, params?: ReadCatalogThemeParams) => string;
|
|
116
|
+
/**
|
|
117
|
+
* The same catalog, narrowed to one theme (E40).
|
|
118
|
+
* @summary Read Catalog Theme
|
|
119
|
+
*/
|
|
120
|
+
export declare const readCatalogTheme: (packId: number, catalogId: number, themeId: number, params?: ReadCatalogThemeParams, options?: Parameters<typeof request>[1]) => Promise<CatalogRead>;
|
|
121
|
+
//#endregion
|
|
122
|
+
//# sourceMappingURL=biblio-catalogue.d.ts.map
|