@learnorama/mozaik-sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/client-BDwBZYB0.d.ts +28 -0
- package/dist/client-D3kMOcIr.js +61 -0
- package/dist/client-D3kMOcIr.js.map +1 -0
- package/dist/index-wL_20vR8.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 +58 -0
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
|
|
2
|
+
import { r as request } from "../client-D3kMOcIr.js";
|
|
3
|
+
//#region src/api/biblio-catalogue/biblio-catalogue.ts
|
|
4
|
+
const getReadContentUrl = (contentId) => {
|
|
5
|
+
return `/biblio/contents/${contentId}`;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* One content item, with this caller's own state on it (E34).
|
|
9
|
+
*
|
|
10
|
+
* ``liked`` and ``favorited`` are why this is not just the summary shape: they
|
|
11
|
+
* are per-caller and therefore uncacheable across users, which is worth knowing
|
|
12
|
+
* before anyone puts a shared cache in front of it.
|
|
13
|
+
* @summary Read Content
|
|
14
|
+
*/
|
|
15
|
+
const readContent = async (contentId, options) => {
|
|
16
|
+
return request(getReadContentUrl(contentId), {
|
|
17
|
+
...options,
|
|
18
|
+
method: "GET"
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
const getUnlikeContentUrl = (contentId) => {
|
|
22
|
+
return `/biblio/contents/${contentId}/like`;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Withdraw a like (E37). Idempotent — not liked is already the desired state.
|
|
26
|
+
* @summary Unlike Content
|
|
27
|
+
*/
|
|
28
|
+
const unlikeContent = async (contentId, options) => {
|
|
29
|
+
return request(getUnlikeContentUrl(contentId), {
|
|
30
|
+
...options,
|
|
31
|
+
method: "DELETE"
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
const getLikeContentUrl = (contentId) => {
|
|
35
|
+
return `/biblio/contents/${contentId}/like`;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Record a like (E36). Idempotent.
|
|
39
|
+
*
|
|
40
|
+
* This and :func:`unlike_content` replace one non-idempotent
|
|
41
|
+
* ``POST /content/{id}/toggle-like``. A retried toggle reverses the user's
|
|
42
|
+
* intent; a repeated ``PUT`` cannot (§4, consequence 3).
|
|
43
|
+
*
|
|
44
|
+
* ``like_count`` is recomputed from ``content_rating`` rather than incremented,
|
|
45
|
+
* because an increment beside an upsert double-counts the second time the same
|
|
46
|
+
* person likes the same thing.
|
|
47
|
+
* @summary Like Content
|
|
48
|
+
*/
|
|
49
|
+
const likeContent = async (contentId, options) => {
|
|
50
|
+
return request(getLikeContentUrl(contentId), {
|
|
51
|
+
...options,
|
|
52
|
+
method: "PUT"
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
const getReadRecommendationsUrl = (contentId, params) => {
|
|
56
|
+
const normalizedParams = new URLSearchParams();
|
|
57
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
58
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
59
|
+
});
|
|
60
|
+
const stringifiedParams = normalizedParams.toString();
|
|
61
|
+
return stringifiedParams.length > 0 ? `/biblio/contents/${contentId}/recommendations?${stringifiedParams}` : `/biblio/contents/${contentId}/recommendations`;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Related content the caller can also reach (E35).
|
|
65
|
+
*
|
|
66
|
+
* Recommending something the account cannot open is worse than recommending
|
|
67
|
+
* nothing, so the candidate set is entitlement-filtered before ranking rather
|
|
68
|
+
* than after — filtering afterwards silently shortens the list instead.
|
|
69
|
+
*
|
|
70
|
+
* Keyword overlap for now, over the GIN index on ``content.keywords``.
|
|
71
|
+
* @summary Read Recommendations
|
|
72
|
+
*/
|
|
73
|
+
const readRecommendations = async (contentId, params, options) => {
|
|
74
|
+
return request(getReadRecommendationsUrl(contentId, params), {
|
|
75
|
+
...options,
|
|
76
|
+
method: "GET"
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
const getListEditorsUrl = (params) => {
|
|
80
|
+
const normalizedParams = new URLSearchParams();
|
|
81
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
82
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
83
|
+
});
|
|
84
|
+
const stringifiedParams = normalizedParams.toString();
|
|
85
|
+
return stringifiedParams.length > 0 ? `/biblio/editors?${stringifiedParams}` : `/biblio/editors`;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Active editors (E44).
|
|
89
|
+
*
|
|
90
|
+
* ``order`` and ``sort`` are resolved against a whitelist and never
|
|
91
|
+
* interpolated. The legacy passed both straight to the query layer (defect
|
|
92
|
+
* D17); an unrecognised value is ``422`` rather than a surprise ordering.
|
|
93
|
+
*
|
|
94
|
+
* The collection is not wrapped in a single-element array. The legacy
|
|
95
|
+
* ``GET /api/v1/editors/`` was (§2.1).
|
|
96
|
+
*
|
|
97
|
+
* Authenticated even though the answer does not depend on who is asking. Which
|
|
98
|
+
* publishers a platform carries is commercial information, and an endpoint that
|
|
99
|
+
* enumerates them for anyone is a competitor's first request. The sibling
|
|
100
|
+
* ``/editors/{id}`` was already authenticated; this one was not, which is how
|
|
101
|
+
* the inconsistency was found.
|
|
102
|
+
* @summary List Editors
|
|
103
|
+
*/
|
|
104
|
+
const listEditors = async (params, options) => {
|
|
105
|
+
return request(getListEditorsUrl(params), {
|
|
106
|
+
...options,
|
|
107
|
+
method: "GET"
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
const getReadEditorUrl = (editorId, params) => {
|
|
111
|
+
const normalizedParams = new URLSearchParams();
|
|
112
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
113
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
114
|
+
});
|
|
115
|
+
const stringifiedParams = normalizedParams.toString();
|
|
116
|
+
return stringifiedParams.length > 0 ? `/biblio/editors/${editorId}?${stringifiedParams}` : `/biblio/editors/${editorId}`;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* One editor and the content of theirs this caller can reach (E45).
|
|
120
|
+
*
|
|
121
|
+
* One endpoint replaces two — a page and a JSON route that used ``pageSize``
|
|
122
|
+
* instead of ``limit`` and wrapped the object in an array. Same entity, two
|
|
123
|
+
* conventions, one codebase (§4, consequence 5).
|
|
124
|
+
* @summary Read Editor
|
|
125
|
+
*/
|
|
126
|
+
const readEditor = async (editorId, params, options) => {
|
|
127
|
+
return request(getReadEditorUrl(editorId, params), {
|
|
128
|
+
...options,
|
|
129
|
+
method: "GET"
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
const getReadLearningPathUrl = (learningPathId) => {
|
|
133
|
+
return `/biblio/learning-paths/${learningPathId}`;
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* A ``parcours`` and the content it walks through, in order.
|
|
137
|
+
*
|
|
138
|
+
* The other end of the ``parcours`` array on a pack, which named paths a client
|
|
139
|
+
* then had no way to open.
|
|
140
|
+
*
|
|
141
|
+
* Steps the caller is not entitled to are **dropped, not hidden behind a
|
|
142
|
+
* padlock**: the same category test every listing uses decides what appears, so
|
|
143
|
+
* a path cannot become a way to learn that an item exists. That does mean a
|
|
144
|
+
* path can come back with fewer steps than the library curated, and with gaps
|
|
145
|
+
* in ``stepOrder`` — which is why the order is a field rather than the array
|
|
146
|
+
* index.
|
|
147
|
+
*
|
|
148
|
+
* An inactive path is ``404`` rather than an empty one: it was withdrawn, and
|
|
149
|
+
* an empty sequence would read as "we have nothing for you" instead.
|
|
150
|
+
* @summary Read Learning Path
|
|
151
|
+
*/
|
|
152
|
+
const readLearningPath = async (learningPathId, options) => {
|
|
153
|
+
return request(getReadLearningPathUrl(learningPathId), {
|
|
154
|
+
...options,
|
|
155
|
+
method: "GET"
|
|
156
|
+
});
|
|
157
|
+
};
|
|
158
|
+
const getReadPackUrl = (packId, params) => {
|
|
159
|
+
const normalizedParams = new URLSearchParams();
|
|
160
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
161
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
162
|
+
});
|
|
163
|
+
const stringifiedParams = normalizedParams.toString();
|
|
164
|
+
return stringifiedParams.length > 0 ? `/biblio/packs/${packId}?${stringifiedParams}` : `/biblio/packs/${packId}`;
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* A pack with its catalogs, latest additions and learning paths (E38).
|
|
168
|
+
*
|
|
169
|
+
* ``canonical`` is how the redirect dies. When a pack resolves to a single
|
|
170
|
+
* catalog the legacy answered ``302``; here the response is ``200`` and
|
|
171
|
+
* ``canonical`` names the resolved catalog, leaving the client to decide whether
|
|
172
|
+
* to follow it (§5.1).
|
|
173
|
+
*
|
|
174
|
+
* A pack the caller has no entitlement to is ``404``. The legacy dereferenced
|
|
175
|
+
* ``null`` and returned ``500`` (defect D12).
|
|
176
|
+
* @summary Read Pack
|
|
177
|
+
*/
|
|
178
|
+
const readPack = async (packId, params, options) => {
|
|
179
|
+
return request(getReadPackUrl(packId, params), {
|
|
180
|
+
...options,
|
|
181
|
+
method: "GET"
|
|
182
|
+
});
|
|
183
|
+
};
|
|
184
|
+
const getReadCatalogUrl = (packId, catalogId, params) => {
|
|
185
|
+
const normalizedParams = new URLSearchParams();
|
|
186
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
187
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
188
|
+
});
|
|
189
|
+
const stringifiedParams = normalizedParams.toString();
|
|
190
|
+
return stringifiedParams.length > 0 ? `/biblio/packs/${packId}/catalogs/${catalogId}?${stringifiedParams}` : `/biblio/packs/${packId}/catalogs/${catalogId}`;
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* One catalog inside a pack (E39).
|
|
194
|
+
* @summary Read Catalog
|
|
195
|
+
*/
|
|
196
|
+
const readCatalog = async (packId, catalogId, params, options) => {
|
|
197
|
+
return request(getReadCatalogUrl(packId, catalogId, params), {
|
|
198
|
+
...options,
|
|
199
|
+
method: "GET"
|
|
200
|
+
});
|
|
201
|
+
};
|
|
202
|
+
const getReadCatalogThemeUrl = (packId, catalogId, themeId, params) => {
|
|
203
|
+
const normalizedParams = new URLSearchParams();
|
|
204
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
205
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
206
|
+
});
|
|
207
|
+
const stringifiedParams = normalizedParams.toString();
|
|
208
|
+
return stringifiedParams.length > 0 ? `/biblio/packs/${packId}/catalogs/${catalogId}/themes/${themeId}?${stringifiedParams}` : `/biblio/packs/${packId}/catalogs/${catalogId}/themes/${themeId}`;
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* The same catalog, narrowed to one theme (E40).
|
|
212
|
+
* @summary Read Catalog Theme
|
|
213
|
+
*/
|
|
214
|
+
const readCatalogTheme = async (packId, catalogId, themeId, params, options) => {
|
|
215
|
+
return request(getReadCatalogThemeUrl(packId, catalogId, themeId, params), {
|
|
216
|
+
...options,
|
|
217
|
+
method: "GET"
|
|
218
|
+
});
|
|
219
|
+
};
|
|
220
|
+
//#endregion
|
|
221
|
+
export { getLikeContentUrl, getListEditorsUrl, getReadCatalogThemeUrl, getReadCatalogUrl, getReadContentUrl, getReadEditorUrl, getReadLearningPathUrl, getReadPackUrl, getReadRecommendationsUrl, getUnlikeContentUrl, likeContent, listEditors, readCatalog, readCatalogTheme, readContent, readEditor, readLearningPath, readPack, readRecommendations, unlikeContent };
|
|
222
|
+
|
|
223
|
+
//# sourceMappingURL=biblio-catalogue.js.map
|
|
@@ -0,0 +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.1.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>(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,oBAAoB,UAAU;AAC7I;;;;;;;;;;;AAYA,MAAa,sBAAsB,OAAO,WACtC,QAAoC,YAA0E;CAEhH,OAAO,QAA6B,0BAA0B,WAAU,MAAM,GAC9E;EACE,GAAG;E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;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"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
import { Kn as HomeFeedRead, st as ReadHomeFeedParams } from "../index-wL_20vR8.js";
|
|
3
|
+
import { c as request } from "../client-BDwBZYB0.js";
|
|
4
|
+
//#region src/api/biblio-home/biblio-home.d.ts
|
|
5
|
+
export declare const getReadHomeFeedUrl: (params?: ReadHomeFeedParams) => string;
|
|
6
|
+
/**
|
|
7
|
+
* Everything the home screen needs, in one call (E48).
|
|
8
|
+
*
|
|
9
|
+
* Each block is built independently and a block that raises is dropped. The
|
|
10
|
+
* caller can tell the difference — an absent key means the section could not be
|
|
11
|
+
* built, an empty list means there was nothing in it — which is more than the
|
|
12
|
+
* legacy offered, where four carousels were hardcoded to empty and looked
|
|
13
|
+
* identical to "nothing new".
|
|
14
|
+
* @summary Read Home Feed
|
|
15
|
+
*/
|
|
16
|
+
export declare const readHomeFeed: (params?: ReadHomeFeedParams, options?: Parameters<typeof request>[1]) => Promise<HomeFeedRead>;
|
|
17
|
+
//#endregion
|
|
18
|
+
//# sourceMappingURL=biblio-home.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
|
|
2
|
+
import { r as request } from "../client-D3kMOcIr.js";
|
|
3
|
+
//#region src/api/biblio-home/biblio-home.ts
|
|
4
|
+
const getReadHomeFeedUrl = (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 ? `/biblio/home-feed?${stringifiedParams}` : `/biblio/home-feed`;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Everything the home screen needs, in one call (E48).
|
|
14
|
+
*
|
|
15
|
+
* Each block is built independently and a block that raises is dropped. The
|
|
16
|
+
* caller can tell the difference — an absent key means the section could not be
|
|
17
|
+
* built, an empty list means there was nothing in it — which is more than the
|
|
18
|
+
* legacy offered, where four carousels were hardcoded to empty and looked
|
|
19
|
+
* identical to "nothing new".
|
|
20
|
+
* @summary Read Home Feed
|
|
21
|
+
*/
|
|
22
|
+
const readHomeFeed = async (params, options) => {
|
|
23
|
+
return request(getReadHomeFeedUrl(params), {
|
|
24
|
+
...options,
|
|
25
|
+
method: "GET"
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { getReadHomeFeedUrl, readHomeFeed };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=biblio-home.js.map
|
|
@@ -0,0 +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.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"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
|
|
2
|
+
import { $n as FavoritePage, Ct as PreferencesRead, Fr as CategoryListRead, Ht as PackListRead, Pr as CategoryPreferencesWrite, Tn as ListBiblioFavoritesParams, Zn as HistoryPage, bn as ListHistoryParams, ir as FavoriteAddWrite } from "../index-wL_20vR8.js";
|
|
3
|
+
import { c as request } from "../client-BDwBZYB0.js";
|
|
4
|
+
//#region src/api/biblio-library/biblio-library.d.ts
|
|
5
|
+
export declare const getListBiblioCategoriesUrl: () => string;
|
|
6
|
+
/**
|
|
7
|
+
* The categories this account can reach (E26).
|
|
8
|
+
*
|
|
9
|
+
* Two independent gates, and both have to pass. Entitlement answers "did the
|
|
10
|
+
* company buy this"; ``access_level`` answers "is this person allowed it" — an
|
|
11
|
+
* ordinal on the account compared against one on the category, which is how a
|
|
12
|
+
* child profile is kept out of the adult catalogue. Neither substitutes for the
|
|
13
|
+
* other.
|
|
14
|
+
* @summary List Biblio Categories
|
|
15
|
+
*/
|
|
16
|
+
export declare const listBiblioCategories: (options?: Parameters<typeof request>[1]) => Promise<CategoryListRead>;
|
|
17
|
+
export declare const getListBiblioFavoritesUrl: (params?: ListBiblioFavoritesParams) => string;
|
|
18
|
+
/**
|
|
19
|
+
* The caller's favourites (E30), newest first.
|
|
20
|
+
* @summary List Biblio Favorites
|
|
21
|
+
*/
|
|
22
|
+
export declare const listBiblioFavorites: (params?: ListBiblioFavoritesParams, options?: Parameters<typeof request>[1]) => Promise<FavoritePage>;
|
|
23
|
+
export declare const getRemoveBiblioFavoriteUrl: (contentId: number) => string;
|
|
24
|
+
/**
|
|
25
|
+
* Remove a favourite (E32). Idempotent — absent is already the desired state.
|
|
26
|
+
* @summary Remove Biblio Favorite
|
|
27
|
+
*/
|
|
28
|
+
export declare const removeBiblioFavorite: (contentId: number, options?: Parameters<typeof request>[1]) => Promise<void>;
|
|
29
|
+
export declare const getAddBiblioFavoriteUrl: (contentId: number) => string;
|
|
30
|
+
/**
|
|
31
|
+
* Mark content as a favourite (E31). Idempotent.
|
|
32
|
+
*
|
|
33
|
+
* ``PUT`` and :func:`remove_favorite`'s ``DELETE`` replace one
|
|
34
|
+
* ``POST /favorites`` carrying an ``enabled`` boolean — the verb encoded as
|
|
35
|
+
* data. A retry after a timeout reversed the user's intent; a repeated ``PUT``
|
|
36
|
+
* cannot (§4, consequence 3).
|
|
37
|
+
*
|
|
38
|
+
* Favouriting is not consumption, so it is not entitlement-gated: a member may
|
|
39
|
+
* bookmark something their library has not licensed *yet*. Reaching the content
|
|
40
|
+
* is gated, at the point of reaching it.
|
|
41
|
+
* @summary Add Biblio Favorite
|
|
42
|
+
*/
|
|
43
|
+
export declare const addBiblioFavorite: (contentId: number, favoriteAddWrite: FavoriteAddWrite, options?: Parameters<typeof request>[1]) => Promise<void>;
|
|
44
|
+
export declare const getListHistoryUrl: (params?: ListHistoryParams) => string;
|
|
45
|
+
/**
|
|
46
|
+
* What this account has consumed, most recent first (E33).
|
|
47
|
+
*
|
|
48
|
+
* One row per content item, not one per view: the caller wants "what have I
|
|
49
|
+
* been reading", and ``consumption_event`` is append-only with a row per act.
|
|
50
|
+
* The last access is therefore a MAX, and progress comes from
|
|
51
|
+
* ``content_progress``, which is LEFT JOINed because an absent row means "not
|
|
52
|
+
* started" rather than zero.
|
|
53
|
+
* @summary List History
|
|
54
|
+
*/
|
|
55
|
+
export declare const listHistory: (params?: ListHistoryParams, options?: Parameters<typeof request>[1]) => Promise<HistoryPage>;
|
|
56
|
+
export declare const getListPacksUrl: () => string;
|
|
57
|
+
/**
|
|
58
|
+
* The content packs this account can navigate (E25).
|
|
59
|
+
*
|
|
60
|
+
* A pack is a :class:`~app.models.biblio.catalogue.CatalogSection`, and one is
|
|
61
|
+
* reachable when the contract reaches at least one category inside it. Deriving
|
|
62
|
+
* it that way rather than granting packs directly means a pack cannot advertise
|
|
63
|
+
* itself while every category under it is out of contract.
|
|
64
|
+
*
|
|
65
|
+
* Empty is a correct answer, not a broken one: an account whose contract has
|
|
66
|
+
* lapsed reaches nothing.
|
|
67
|
+
* @summary List Packs
|
|
68
|
+
*/
|
|
69
|
+
export declare const listPacks: (options?: Parameters<typeof request>[1]) => Promise<PackListRead>;
|
|
70
|
+
export declare const getReadPreferencesUrl: () => string;
|
|
71
|
+
/**
|
|
72
|
+
* The caller's own preferences (E28).
|
|
73
|
+
*
|
|
74
|
+
* An object with one key rather than a bare array, so a second preference can
|
|
75
|
+
* be added later without breaking every client.
|
|
76
|
+
* @summary Read Preferences
|
|
77
|
+
*/
|
|
78
|
+
export declare const readPreferences: (options?: Parameters<typeof request>[1]) => Promise<PreferencesRead>;
|
|
79
|
+
export declare const getReplaceCategoryPreferencesUrl: () => string;
|
|
80
|
+
/**
|
|
81
|
+
* Replace the favourite-category set wholesale (E29).
|
|
82
|
+
*
|
|
83
|
+
* ``PUT`` because the legacy handler already replaced the whole set; the verb
|
|
84
|
+
* now says so. An empty array clears the set and is valid input — the legacy
|
|
85
|
+
* left that path uncaught and returned ``500``.
|
|
86
|
+
*
|
|
87
|
+
* A category the account cannot reach is ``422``, listing the offending ids.
|
|
88
|
+
* Silently dropping them would leave the client believing it had saved
|
|
89
|
+
* something it had not.
|
|
90
|
+
* @summary Replace Category Preferences
|
|
91
|
+
*/
|
|
92
|
+
export declare const replaceCategoryPreferences: (categoryPreferencesWrite: CategoryPreferencesWrite, options?: Parameters<typeof request>[1]) => Promise<void>;
|
|
93
|
+
//#endregion
|
|
94
|
+
//# sourceMappingURL=biblio-library.d.ts.map
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
|
|
2
|
+
import { r as request } from "../client-D3kMOcIr.js";
|
|
3
|
+
//#region src/api/biblio-library/biblio-library.ts
|
|
4
|
+
const getListBiblioCategoriesUrl = () => {
|
|
5
|
+
return `/biblio/me/categories`;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* The categories this account can reach (E26).
|
|
9
|
+
*
|
|
10
|
+
* Two independent gates, and both have to pass. Entitlement answers "did the
|
|
11
|
+
* company buy this"; ``access_level`` answers "is this person allowed it" — an
|
|
12
|
+
* ordinal on the account compared against one on the category, which is how a
|
|
13
|
+
* child profile is kept out of the adult catalogue. Neither substitutes for the
|
|
14
|
+
* other.
|
|
15
|
+
* @summary List Biblio Categories
|
|
16
|
+
*/
|
|
17
|
+
const listBiblioCategories = async (options) => {
|
|
18
|
+
return request(getListBiblioCategoriesUrl(), {
|
|
19
|
+
...options,
|
|
20
|
+
method: "GET"
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
const getListBiblioFavoritesUrl = (params) => {
|
|
24
|
+
const normalizedParams = new URLSearchParams();
|
|
25
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
26
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
27
|
+
});
|
|
28
|
+
const stringifiedParams = normalizedParams.toString();
|
|
29
|
+
return stringifiedParams.length > 0 ? `/biblio/me/favorites?${stringifiedParams}` : `/biblio/me/favorites`;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* The caller's favourites (E30), newest first.
|
|
33
|
+
* @summary List Biblio Favorites
|
|
34
|
+
*/
|
|
35
|
+
const listBiblioFavorites = async (params, options) => {
|
|
36
|
+
return request(getListBiblioFavoritesUrl(params), {
|
|
37
|
+
...options,
|
|
38
|
+
method: "GET"
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
const getRemoveBiblioFavoriteUrl = (contentId) => {
|
|
42
|
+
return `/biblio/me/favorites/${contentId}`;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Remove a favourite (E32). Idempotent — absent is already the desired state.
|
|
46
|
+
* @summary Remove Biblio Favorite
|
|
47
|
+
*/
|
|
48
|
+
const removeBiblioFavorite = async (contentId, options) => {
|
|
49
|
+
return request(getRemoveBiblioFavoriteUrl(contentId), {
|
|
50
|
+
...options,
|
|
51
|
+
method: "DELETE"
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
const getAddBiblioFavoriteUrl = (contentId) => {
|
|
55
|
+
return `/biblio/me/favorites/${contentId}`;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Mark content as a favourite (E31). Idempotent.
|
|
59
|
+
*
|
|
60
|
+
* ``PUT`` and :func:`remove_favorite`'s ``DELETE`` replace one
|
|
61
|
+
* ``POST /favorites`` carrying an ``enabled`` boolean — the verb encoded as
|
|
62
|
+
* data. A retry after a timeout reversed the user's intent; a repeated ``PUT``
|
|
63
|
+
* cannot (§4, consequence 3).
|
|
64
|
+
*
|
|
65
|
+
* Favouriting is not consumption, so it is not entitlement-gated: a member may
|
|
66
|
+
* bookmark something their library has not licensed *yet*. Reaching the content
|
|
67
|
+
* is gated, at the point of reaching it.
|
|
68
|
+
* @summary Add Biblio Favorite
|
|
69
|
+
*/
|
|
70
|
+
const addBiblioFavorite = async (contentId, favoriteAddWrite, options) => {
|
|
71
|
+
const getHeaders = (h) => {
|
|
72
|
+
if (!h) return {};
|
|
73
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
74
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
75
|
+
const headers = {};
|
|
76
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
77
|
+
return headers;
|
|
78
|
+
};
|
|
79
|
+
return request(getAddBiblioFavoriteUrl(contentId), {
|
|
80
|
+
...options,
|
|
81
|
+
method: "PUT",
|
|
82
|
+
headers: {
|
|
83
|
+
"Content-Type": "application/json",
|
|
84
|
+
...getHeaders(options?.headers)
|
|
85
|
+
},
|
|
86
|
+
body: JSON.stringify(favoriteAddWrite)
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
const getListHistoryUrl = (params) => {
|
|
90
|
+
const normalizedParams = new URLSearchParams();
|
|
91
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
92
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
93
|
+
});
|
|
94
|
+
const stringifiedParams = normalizedParams.toString();
|
|
95
|
+
return stringifiedParams.length > 0 ? `/biblio/me/history?${stringifiedParams}` : `/biblio/me/history`;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* What this account has consumed, most recent first (E33).
|
|
99
|
+
*
|
|
100
|
+
* One row per content item, not one per view: the caller wants "what have I
|
|
101
|
+
* been reading", and ``consumption_event`` is append-only with a row per act.
|
|
102
|
+
* The last access is therefore a MAX, and progress comes from
|
|
103
|
+
* ``content_progress``, which is LEFT JOINed because an absent row means "not
|
|
104
|
+
* started" rather than zero.
|
|
105
|
+
* @summary List History
|
|
106
|
+
*/
|
|
107
|
+
const listHistory = async (params, options) => {
|
|
108
|
+
return request(getListHistoryUrl(params), {
|
|
109
|
+
...options,
|
|
110
|
+
method: "GET"
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
const getListPacksUrl = () => {
|
|
114
|
+
return `/biblio/me/packs`;
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* The content packs this account can navigate (E25).
|
|
118
|
+
*
|
|
119
|
+
* A pack is a :class:`~app.models.biblio.catalogue.CatalogSection`, and one is
|
|
120
|
+
* reachable when the contract reaches at least one category inside it. Deriving
|
|
121
|
+
* it that way rather than granting packs directly means a pack cannot advertise
|
|
122
|
+
* itself while every category under it is out of contract.
|
|
123
|
+
*
|
|
124
|
+
* Empty is a correct answer, not a broken one: an account whose contract has
|
|
125
|
+
* lapsed reaches nothing.
|
|
126
|
+
* @summary List Packs
|
|
127
|
+
*/
|
|
128
|
+
const listPacks = async (options) => {
|
|
129
|
+
return request(getListPacksUrl(), {
|
|
130
|
+
...options,
|
|
131
|
+
method: "GET"
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
const getReadPreferencesUrl = () => {
|
|
135
|
+
return `/biblio/me/preferences`;
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* The caller's own preferences (E28).
|
|
139
|
+
*
|
|
140
|
+
* An object with one key rather than a bare array, so a second preference can
|
|
141
|
+
* be added later without breaking every client.
|
|
142
|
+
* @summary Read Preferences
|
|
143
|
+
*/
|
|
144
|
+
const readPreferences = async (options) => {
|
|
145
|
+
return request(getReadPreferencesUrl(), {
|
|
146
|
+
...options,
|
|
147
|
+
method: "GET"
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
const getReplaceCategoryPreferencesUrl = () => {
|
|
151
|
+
return `/biblio/me/preferences/categories`;
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* Replace the favourite-category set wholesale (E29).
|
|
155
|
+
*
|
|
156
|
+
* ``PUT`` because the legacy handler already replaced the whole set; the verb
|
|
157
|
+
* now says so. An empty array clears the set and is valid input — the legacy
|
|
158
|
+
* left that path uncaught and returned ``500``.
|
|
159
|
+
*
|
|
160
|
+
* A category the account cannot reach is ``422``, listing the offending ids.
|
|
161
|
+
* Silently dropping them would leave the client believing it had saved
|
|
162
|
+
* something it had not.
|
|
163
|
+
* @summary Replace Category Preferences
|
|
164
|
+
*/
|
|
165
|
+
const replaceCategoryPreferences = async (categoryPreferencesWrite, options) => {
|
|
166
|
+
const getHeaders = (h) => {
|
|
167
|
+
if (!h) return {};
|
|
168
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
169
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
170
|
+
const headers = {};
|
|
171
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
172
|
+
return headers;
|
|
173
|
+
};
|
|
174
|
+
return request(getReplaceCategoryPreferencesUrl(), {
|
|
175
|
+
...options,
|
|
176
|
+
method: "PUT",
|
|
177
|
+
headers: {
|
|
178
|
+
"Content-Type": "application/json",
|
|
179
|
+
...getHeaders(options?.headers)
|
|
180
|
+
},
|
|
181
|
+
body: JSON.stringify(categoryPreferencesWrite)
|
|
182
|
+
});
|
|
183
|
+
};
|
|
184
|
+
//#endregion
|
|
185
|
+
export { addBiblioFavorite, getAddBiblioFavoriteUrl, getListBiblioCategoriesUrl, getListBiblioFavoritesUrl, getListHistoryUrl, getListPacksUrl, getReadPreferencesUrl, getRemoveBiblioFavoriteUrl, getReplaceCategoryPreferencesUrl, listBiblioCategories, listBiblioFavorites, listHistory, listPacks, readPreferences, removeBiblioFavorite, replaceCategoryPreferences };
|
|
186
|
+
|
|
187
|
+
//# sourceMappingURL=biblio-library.js.map
|
|
@@ -0,0 +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.1.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;CAExE,CAAC;CAED,MAAM,oBAAoB,iBAAiB,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