@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,411 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { r as request } from "../client-D3kMOcIr.js";
|
|
3
|
+
import { useMutation, useQuery } from "@tanstack/react-query";
|
|
4
|
+
//#region src/react/biblio-library/biblio-library.ts
|
|
5
|
+
/**
|
|
6
|
+
* Generated by orval 🍺
|
|
7
|
+
* Do not edit manually.
|
|
8
|
+
* Mozaik backend
|
|
9
|
+
* 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.
|
|
10
|
+
* OpenAPI spec version: 0.1.0
|
|
11
|
+
*/
|
|
12
|
+
const withQueryKey = (query, queryKey) => {
|
|
13
|
+
const result = { queryKey };
|
|
14
|
+
for (const key of Object.keys(query)) {
|
|
15
|
+
if (key === "queryKey") continue;
|
|
16
|
+
Object.defineProperty(result, key, {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
configurable: true,
|
|
19
|
+
get: () => query[key]
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return result;
|
|
23
|
+
};
|
|
24
|
+
const getListBiblioCategoriesUrl = () => {
|
|
25
|
+
return `/biblio/me/categories`;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* The categories this account can reach (E26).
|
|
29
|
+
*
|
|
30
|
+
* Two independent gates, and both have to pass. Entitlement answers "did the
|
|
31
|
+
* company buy this"; ``access_level`` answers "is this person allowed it" — an
|
|
32
|
+
* ordinal on the account compared against one on the category, which is how a
|
|
33
|
+
* child profile is kept out of the adult catalogue. Neither substitutes for the
|
|
34
|
+
* other.
|
|
35
|
+
* @summary List Biblio Categories
|
|
36
|
+
*/
|
|
37
|
+
const listBiblioCategories = async (options) => {
|
|
38
|
+
return request(getListBiblioCategoriesUrl(), {
|
|
39
|
+
...options,
|
|
40
|
+
method: "GET"
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
const getListBiblioCategoriesQueryKey = () => {
|
|
44
|
+
return [`/biblio/me/categories`];
|
|
45
|
+
};
|
|
46
|
+
const getListBiblioCategoriesQueryOptions = (options) => {
|
|
47
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
48
|
+
const queryKey = queryOptions?.queryKey ?? getListBiblioCategoriesQueryKey();
|
|
49
|
+
const queryFn = ({ signal }) => listBiblioCategories({
|
|
50
|
+
signal,
|
|
51
|
+
...requestOptions
|
|
52
|
+
});
|
|
53
|
+
return {
|
|
54
|
+
queryKey,
|
|
55
|
+
queryFn,
|
|
56
|
+
...queryOptions
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* @summary List Biblio Categories
|
|
61
|
+
*/
|
|
62
|
+
function useListBiblioCategories(options, queryClient) {
|
|
63
|
+
const queryOptions = getListBiblioCategoriesQueryOptions(options);
|
|
64
|
+
const query = useQuery(queryOptions, queryClient);
|
|
65
|
+
return withQueryKey(query, queryOptions.queryKey);
|
|
66
|
+
}
|
|
67
|
+
const getListBiblioFavoritesUrl = (params) => {
|
|
68
|
+
const normalizedParams = new URLSearchParams();
|
|
69
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
70
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
71
|
+
});
|
|
72
|
+
const stringifiedParams = normalizedParams.toString();
|
|
73
|
+
return stringifiedParams.length > 0 ? `/biblio/me/favorites?${stringifiedParams}` : `/biblio/me/favorites`;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* The caller's favourites (E30), newest first.
|
|
77
|
+
* @summary List Biblio Favorites
|
|
78
|
+
*/
|
|
79
|
+
const listBiblioFavorites = async (params, options) => {
|
|
80
|
+
return request(getListBiblioFavoritesUrl(params), {
|
|
81
|
+
...options,
|
|
82
|
+
method: "GET"
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
const getListBiblioFavoritesQueryKey = (params) => {
|
|
86
|
+
return [`/biblio/me/favorites`, ...params ? [params] : []];
|
|
87
|
+
};
|
|
88
|
+
const getListBiblioFavoritesQueryOptions = (params, options) => {
|
|
89
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
90
|
+
const queryKey = queryOptions?.queryKey ?? getListBiblioFavoritesQueryKey(params);
|
|
91
|
+
const queryFn = ({ signal }) => listBiblioFavorites(params, {
|
|
92
|
+
signal,
|
|
93
|
+
...requestOptions
|
|
94
|
+
});
|
|
95
|
+
return {
|
|
96
|
+
queryKey,
|
|
97
|
+
queryFn,
|
|
98
|
+
...queryOptions
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* @summary List Biblio Favorites
|
|
103
|
+
*/
|
|
104
|
+
function useListBiblioFavorites(params, options, queryClient) {
|
|
105
|
+
const queryOptions = getListBiblioFavoritesQueryOptions(params, options);
|
|
106
|
+
const query = useQuery(queryOptions, queryClient);
|
|
107
|
+
return withQueryKey(query, queryOptions.queryKey);
|
|
108
|
+
}
|
|
109
|
+
const getRemoveBiblioFavoriteUrl = (contentId) => {
|
|
110
|
+
return `/biblio/me/favorites/${contentId}`;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Remove a favourite (E32). Idempotent — absent is already the desired state.
|
|
114
|
+
* @summary Remove Biblio Favorite
|
|
115
|
+
*/
|
|
116
|
+
const removeBiblioFavorite = async (contentId, options) => {
|
|
117
|
+
return request(getRemoveBiblioFavoriteUrl(contentId), {
|
|
118
|
+
...options,
|
|
119
|
+
method: "DELETE"
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
const getRemoveBiblioFavoriteMutationKey = () => ["removeBiblioFavorite"];
|
|
123
|
+
const getRemoveBiblioFavoriteMutationOptions = (options) => {
|
|
124
|
+
const mutationKey = getRemoveBiblioFavoriteMutationKey();
|
|
125
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : {
|
|
126
|
+
...options,
|
|
127
|
+
mutation: {
|
|
128
|
+
...options.mutation,
|
|
129
|
+
mutationKey
|
|
130
|
+
}
|
|
131
|
+
} : {
|
|
132
|
+
mutation: { mutationKey },
|
|
133
|
+
request: void 0
|
|
134
|
+
};
|
|
135
|
+
const mutationFn = (props) => {
|
|
136
|
+
const { contentId } = props ?? {};
|
|
137
|
+
return removeBiblioFavorite(contentId, requestOptions);
|
|
138
|
+
};
|
|
139
|
+
return {
|
|
140
|
+
mutationFn,
|
|
141
|
+
...mutationOptions
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* @summary Remove Biblio Favorite
|
|
146
|
+
*/
|
|
147
|
+
const useRemoveBiblioFavorite = (options, queryClient) => {
|
|
148
|
+
return useMutation(getRemoveBiblioFavoriteMutationOptions(options), queryClient);
|
|
149
|
+
};
|
|
150
|
+
const getAddBiblioFavoriteUrl = (contentId) => {
|
|
151
|
+
return `/biblio/me/favorites/${contentId}`;
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* Mark content as a favourite (E31). Idempotent.
|
|
155
|
+
*
|
|
156
|
+
* ``PUT`` and :func:`remove_favorite`'s ``DELETE`` replace one
|
|
157
|
+
* ``POST /favorites`` carrying an ``enabled`` boolean — the verb encoded as
|
|
158
|
+
* data. A retry after a timeout reversed the user's intent; a repeated ``PUT``
|
|
159
|
+
* cannot (§4, consequence 3).
|
|
160
|
+
*
|
|
161
|
+
* Favouriting is not consumption, so it is not entitlement-gated: a member may
|
|
162
|
+
* bookmark something their library has not licensed *yet*. Reaching the content
|
|
163
|
+
* is gated, at the point of reaching it.
|
|
164
|
+
* @summary Add Biblio Favorite
|
|
165
|
+
*/
|
|
166
|
+
const addBiblioFavorite = async (contentId, favoriteAddWrite, options) => {
|
|
167
|
+
const getHeaders = (h) => {
|
|
168
|
+
if (!h) return {};
|
|
169
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
170
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
171
|
+
const headers = {};
|
|
172
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
173
|
+
return headers;
|
|
174
|
+
};
|
|
175
|
+
return request(getAddBiblioFavoriteUrl(contentId), {
|
|
176
|
+
...options,
|
|
177
|
+
method: "PUT",
|
|
178
|
+
headers: {
|
|
179
|
+
"Content-Type": "application/json",
|
|
180
|
+
...getHeaders(options?.headers)
|
|
181
|
+
},
|
|
182
|
+
body: JSON.stringify(favoriteAddWrite)
|
|
183
|
+
});
|
|
184
|
+
};
|
|
185
|
+
const getAddBiblioFavoriteMutationKey = () => ["addBiblioFavorite"];
|
|
186
|
+
const getAddBiblioFavoriteMutationOptions = (options) => {
|
|
187
|
+
const mutationKey = getAddBiblioFavoriteMutationKey();
|
|
188
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : {
|
|
189
|
+
...options,
|
|
190
|
+
mutation: {
|
|
191
|
+
...options.mutation,
|
|
192
|
+
mutationKey
|
|
193
|
+
}
|
|
194
|
+
} : {
|
|
195
|
+
mutation: { mutationKey },
|
|
196
|
+
request: void 0
|
|
197
|
+
};
|
|
198
|
+
const mutationFn = (props) => {
|
|
199
|
+
const { contentId, data } = props ?? {};
|
|
200
|
+
return addBiblioFavorite(contentId, data, requestOptions);
|
|
201
|
+
};
|
|
202
|
+
return {
|
|
203
|
+
mutationFn,
|
|
204
|
+
...mutationOptions
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
/**
|
|
208
|
+
* @summary Add Biblio Favorite
|
|
209
|
+
*/
|
|
210
|
+
const useAddBiblioFavorite = (options, queryClient) => {
|
|
211
|
+
return useMutation(getAddBiblioFavoriteMutationOptions(options), queryClient);
|
|
212
|
+
};
|
|
213
|
+
const getListHistoryUrl = (params) => {
|
|
214
|
+
const normalizedParams = new URLSearchParams();
|
|
215
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
216
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
217
|
+
});
|
|
218
|
+
const stringifiedParams = normalizedParams.toString();
|
|
219
|
+
return stringifiedParams.length > 0 ? `/biblio/me/history?${stringifiedParams}` : `/biblio/me/history`;
|
|
220
|
+
};
|
|
221
|
+
/**
|
|
222
|
+
* What this account has consumed, most recent first (E33).
|
|
223
|
+
*
|
|
224
|
+
* One row per content item, not one per view: the caller wants "what have I
|
|
225
|
+
* been reading", and ``consumption_event`` is append-only with a row per act.
|
|
226
|
+
* The last access is therefore a MAX, and progress comes from
|
|
227
|
+
* ``content_progress``, which is LEFT JOINed because an absent row means "not
|
|
228
|
+
* started" rather than zero.
|
|
229
|
+
* @summary List History
|
|
230
|
+
*/
|
|
231
|
+
const listHistory = async (params, options) => {
|
|
232
|
+
return request(getListHistoryUrl(params), {
|
|
233
|
+
...options,
|
|
234
|
+
method: "GET"
|
|
235
|
+
});
|
|
236
|
+
};
|
|
237
|
+
const getListHistoryQueryKey = (params) => {
|
|
238
|
+
return [`/biblio/me/history`, ...params ? [params] : []];
|
|
239
|
+
};
|
|
240
|
+
const getListHistoryQueryOptions = (params, options) => {
|
|
241
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
242
|
+
const queryKey = queryOptions?.queryKey ?? getListHistoryQueryKey(params);
|
|
243
|
+
const queryFn = ({ signal }) => listHistory(params, {
|
|
244
|
+
signal,
|
|
245
|
+
...requestOptions
|
|
246
|
+
});
|
|
247
|
+
return {
|
|
248
|
+
queryKey,
|
|
249
|
+
queryFn,
|
|
250
|
+
...queryOptions
|
|
251
|
+
};
|
|
252
|
+
};
|
|
253
|
+
/**
|
|
254
|
+
* @summary List History
|
|
255
|
+
*/
|
|
256
|
+
function useListHistory(params, options, queryClient) {
|
|
257
|
+
const queryOptions = getListHistoryQueryOptions(params, options);
|
|
258
|
+
const query = useQuery(queryOptions, queryClient);
|
|
259
|
+
return withQueryKey(query, queryOptions.queryKey);
|
|
260
|
+
}
|
|
261
|
+
const getListPacksUrl = () => {
|
|
262
|
+
return `/biblio/me/packs`;
|
|
263
|
+
};
|
|
264
|
+
/**
|
|
265
|
+
* The content packs this account can navigate (E25).
|
|
266
|
+
*
|
|
267
|
+
* A pack is a :class:`~app.models.biblio.catalogue.CatalogSection`, and one is
|
|
268
|
+
* reachable when the contract reaches at least one category inside it. Deriving
|
|
269
|
+
* it that way rather than granting packs directly means a pack cannot advertise
|
|
270
|
+
* itself while every category under it is out of contract.
|
|
271
|
+
*
|
|
272
|
+
* Empty is a correct answer, not a broken one: an account whose contract has
|
|
273
|
+
* lapsed reaches nothing.
|
|
274
|
+
* @summary List Packs
|
|
275
|
+
*/
|
|
276
|
+
const listPacks = async (options) => {
|
|
277
|
+
return request(getListPacksUrl(), {
|
|
278
|
+
...options,
|
|
279
|
+
method: "GET"
|
|
280
|
+
});
|
|
281
|
+
};
|
|
282
|
+
const getListPacksQueryKey = () => {
|
|
283
|
+
return [`/biblio/me/packs`];
|
|
284
|
+
};
|
|
285
|
+
const getListPacksQueryOptions = (options) => {
|
|
286
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
287
|
+
const queryKey = queryOptions?.queryKey ?? getListPacksQueryKey();
|
|
288
|
+
const queryFn = ({ signal }) => listPacks({
|
|
289
|
+
signal,
|
|
290
|
+
...requestOptions
|
|
291
|
+
});
|
|
292
|
+
return {
|
|
293
|
+
queryKey,
|
|
294
|
+
queryFn,
|
|
295
|
+
...queryOptions
|
|
296
|
+
};
|
|
297
|
+
};
|
|
298
|
+
/**
|
|
299
|
+
* @summary List Packs
|
|
300
|
+
*/
|
|
301
|
+
function useListPacks(options, queryClient) {
|
|
302
|
+
const queryOptions = getListPacksQueryOptions(options);
|
|
303
|
+
const query = useQuery(queryOptions, queryClient);
|
|
304
|
+
return withQueryKey(query, queryOptions.queryKey);
|
|
305
|
+
}
|
|
306
|
+
const getReadPreferencesUrl = () => {
|
|
307
|
+
return `/biblio/me/preferences`;
|
|
308
|
+
};
|
|
309
|
+
/**
|
|
310
|
+
* The caller's own preferences (E28).
|
|
311
|
+
*
|
|
312
|
+
* An object with one key rather than a bare array, so a second preference can
|
|
313
|
+
* be added later without breaking every client.
|
|
314
|
+
* @summary Read Preferences
|
|
315
|
+
*/
|
|
316
|
+
const readPreferences = async (options) => {
|
|
317
|
+
return request(getReadPreferencesUrl(), {
|
|
318
|
+
...options,
|
|
319
|
+
method: "GET"
|
|
320
|
+
});
|
|
321
|
+
};
|
|
322
|
+
const getReadPreferencesQueryKey = () => {
|
|
323
|
+
return [`/biblio/me/preferences`];
|
|
324
|
+
};
|
|
325
|
+
const getReadPreferencesQueryOptions = (options) => {
|
|
326
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
327
|
+
const queryKey = queryOptions?.queryKey ?? getReadPreferencesQueryKey();
|
|
328
|
+
const queryFn = ({ signal }) => readPreferences({
|
|
329
|
+
signal,
|
|
330
|
+
...requestOptions
|
|
331
|
+
});
|
|
332
|
+
return {
|
|
333
|
+
queryKey,
|
|
334
|
+
queryFn,
|
|
335
|
+
...queryOptions
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
/**
|
|
339
|
+
* @summary Read Preferences
|
|
340
|
+
*/
|
|
341
|
+
function useReadPreferences(options, queryClient) {
|
|
342
|
+
const queryOptions = getReadPreferencesQueryOptions(options);
|
|
343
|
+
const query = useQuery(queryOptions, queryClient);
|
|
344
|
+
return withQueryKey(query, queryOptions.queryKey);
|
|
345
|
+
}
|
|
346
|
+
const getReplaceCategoryPreferencesUrl = () => {
|
|
347
|
+
return `/biblio/me/preferences/categories`;
|
|
348
|
+
};
|
|
349
|
+
/**
|
|
350
|
+
* Replace the favourite-category set wholesale (E29).
|
|
351
|
+
*
|
|
352
|
+
* ``PUT`` because the legacy handler already replaced the whole set; the verb
|
|
353
|
+
* now says so. An empty array clears the set and is valid input — the legacy
|
|
354
|
+
* left that path uncaught and returned ``500``.
|
|
355
|
+
*
|
|
356
|
+
* A category the account cannot reach is ``422``, listing the offending ids.
|
|
357
|
+
* Silently dropping them would leave the client believing it had saved
|
|
358
|
+
* something it had not.
|
|
359
|
+
* @summary Replace Category Preferences
|
|
360
|
+
*/
|
|
361
|
+
const replaceCategoryPreferences = async (categoryPreferencesWrite, options) => {
|
|
362
|
+
const getHeaders = (h) => {
|
|
363
|
+
if (!h) return {};
|
|
364
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
365
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
366
|
+
const headers = {};
|
|
367
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
368
|
+
return headers;
|
|
369
|
+
};
|
|
370
|
+
return request(getReplaceCategoryPreferencesUrl(), {
|
|
371
|
+
...options,
|
|
372
|
+
method: "PUT",
|
|
373
|
+
headers: {
|
|
374
|
+
"Content-Type": "application/json",
|
|
375
|
+
...getHeaders(options?.headers)
|
|
376
|
+
},
|
|
377
|
+
body: JSON.stringify(categoryPreferencesWrite)
|
|
378
|
+
});
|
|
379
|
+
};
|
|
380
|
+
const getReplaceCategoryPreferencesMutationKey = () => ["replaceCategoryPreferences"];
|
|
381
|
+
const getReplaceCategoryPreferencesMutationOptions = (options) => {
|
|
382
|
+
const mutationKey = getReplaceCategoryPreferencesMutationKey();
|
|
383
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : {
|
|
384
|
+
...options,
|
|
385
|
+
mutation: {
|
|
386
|
+
...options.mutation,
|
|
387
|
+
mutationKey
|
|
388
|
+
}
|
|
389
|
+
} : {
|
|
390
|
+
mutation: { mutationKey },
|
|
391
|
+
request: void 0
|
|
392
|
+
};
|
|
393
|
+
const mutationFn = (props) => {
|
|
394
|
+
const { data } = props ?? {};
|
|
395
|
+
return replaceCategoryPreferences(data, requestOptions);
|
|
396
|
+
};
|
|
397
|
+
return {
|
|
398
|
+
mutationFn,
|
|
399
|
+
...mutationOptions
|
|
400
|
+
};
|
|
401
|
+
};
|
|
402
|
+
/**
|
|
403
|
+
* @summary Replace Category Preferences
|
|
404
|
+
*/
|
|
405
|
+
const useReplaceCategoryPreferences = (options, queryClient) => {
|
|
406
|
+
return useMutation(getReplaceCategoryPreferencesMutationOptions(options), queryClient);
|
|
407
|
+
};
|
|
408
|
+
//#endregion
|
|
409
|
+
export { addBiblioFavorite, getAddBiblioFavoriteMutationKey, getAddBiblioFavoriteMutationOptions, getAddBiblioFavoriteUrl, getListBiblioCategoriesQueryKey, getListBiblioCategoriesQueryOptions, getListBiblioCategoriesUrl, getListBiblioFavoritesQueryKey, getListBiblioFavoritesQueryOptions, getListBiblioFavoritesUrl, getListHistoryQueryKey, getListHistoryQueryOptions, getListHistoryUrl, getListPacksQueryKey, getListPacksQueryOptions, getListPacksUrl, getReadPreferencesQueryKey, getReadPreferencesQueryOptions, getReadPreferencesUrl, getRemoveBiblioFavoriteMutationKey, getRemoveBiblioFavoriteMutationOptions, getRemoveBiblioFavoriteUrl, getReplaceCategoryPreferencesMutationKey, getReplaceCategoryPreferencesMutationOptions, getReplaceCategoryPreferencesUrl, listBiblioCategories, listBiblioFavorites, listHistory, listPacks, readPreferences, removeBiblioFavorite, replaceCategoryPreferences, useAddBiblioFavorite, useListBiblioCategories, useListBiblioFavorites, useListHistory, useListPacks, useReadPreferences, useRemoveBiblioFavorite, useReplaceCategoryPreferences };
|
|
410
|
+
|
|
411
|
+
//# sourceMappingURL=biblio-library.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"biblio-library.js","names":[],"sources":["../../src/react/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 {\n useMutation,\n useQuery\n} from '@tanstack/react-query';\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n MutationFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseMutationOptions,\n UseMutationResult,\n UseQueryOptions,\n UseQueryResult\n} from '@tanstack/react-query';\n\nimport type {\n CategoryListRead,\n CategoryPreferencesWrite,\n FavoriteAddWrite,\n FavoritePage,\n HTTPExceptionResponse,\n HistoryPage,\n ListBiblioFavoritesParams,\n ListHistoryParams,\n PackListRead,\n PreferencesRead,\n ValidationErrorResponse\n} from '../../models';\n\nimport { request } from '../../client';\nimport type { ErrorType , BodyType } from '../../client';\n\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n\n\nconst withQueryKey = <T extends object, K>(query: T, queryKey: K): T & { queryKey: K } => {\n const result = { queryKey } as T & { queryKey: K };\n for (const key of Object.keys(query)) {\n // The explicit queryKey always wins, matching the previous\n // `{ ...query, queryKey }` spread where it was set last.\n if (key === 'queryKey') continue;\n Object.defineProperty(result, key, {\n enumerable: true,\n configurable: true,\n get: () => (query as Record<string, unknown>)[key],\n });\n }\n return result;\n};\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\n\n\n\nexport const getListBiblioCategoriesQueryKey = () => {\n return [\n `/biblio/me/categories`\n ] as const;\n }\n\n\nexport const getListBiblioCategoriesQueryOptions = <TData = Awaited<ReturnType<typeof listBiblioCategories>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listBiblioCategories>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getListBiblioCategoriesQueryKey();\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof listBiblioCategories>>> = ({ signal }) => listBiblioCategories({ signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listBiblioCategories>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ListBiblioCategoriesQueryResult = NonNullable<Awaited<ReturnType<typeof listBiblioCategories>>>\nexport type ListBiblioCategoriesQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useListBiblioCategories<TData = Awaited<ReturnType<typeof listBiblioCategories>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listBiblioCategories>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof listBiblioCategories>>,\n TError,\n Awaited<ReturnType<typeof listBiblioCategories>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListBiblioCategories<TData = Awaited<ReturnType<typeof listBiblioCategories>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listBiblioCategories>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof listBiblioCategories>>,\n TError,\n Awaited<ReturnType<typeof listBiblioCategories>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListBiblioCategories<TData = Awaited<ReturnType<typeof listBiblioCategories>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listBiblioCategories>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary List Biblio Categories\n */\n\nexport function useListBiblioCategories<TData = Awaited<ReturnType<typeof listBiblioCategories>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listBiblioCategories>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getListBiblioCategoriesQueryOptions(options)\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n return withQueryKey(query, queryOptions.queryKey);\n}\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\n\n\n\nexport const getListBiblioFavoritesQueryKey = (params?: ListBiblioFavoritesParams,) => {\n return [\n `/biblio/me/favorites`, ...(params ? [params] : [])\n ] as const;\n }\n\n\nexport const getListBiblioFavoritesQueryOptions = <TData = Awaited<ReturnType<typeof listBiblioFavorites>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params?: ListBiblioFavoritesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listBiblioFavorites>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getListBiblioFavoritesQueryKey(params);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof listBiblioFavorites>>> = ({ signal }) => listBiblioFavorites(params, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listBiblioFavorites>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ListBiblioFavoritesQueryResult = NonNullable<Awaited<ReturnType<typeof listBiblioFavorites>>>\nexport type ListBiblioFavoritesQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useListBiblioFavorites<TData = Awaited<ReturnType<typeof listBiblioFavorites>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params: undefined | ListBiblioFavoritesParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listBiblioFavorites>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof listBiblioFavorites>>,\n TError,\n Awaited<ReturnType<typeof listBiblioFavorites>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListBiblioFavorites<TData = Awaited<ReturnType<typeof listBiblioFavorites>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListBiblioFavoritesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listBiblioFavorites>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof listBiblioFavorites>>,\n TError,\n Awaited<ReturnType<typeof listBiblioFavorites>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListBiblioFavorites<TData = Awaited<ReturnType<typeof listBiblioFavorites>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListBiblioFavoritesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listBiblioFavorites>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary List Biblio Favorites\n */\n\nexport function useListBiblioFavorites<TData = Awaited<ReturnType<typeof listBiblioFavorites>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListBiblioFavoritesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listBiblioFavorites>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getListBiblioFavoritesQueryOptions(params,options)\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n return withQueryKey(query, queryOptions.queryKey);\n}\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\n\n\n\nexport const getRemoveBiblioFavoriteMutationKey = () => ['removeBiblioFavorite'] as const;\n\nexport const getRemoveBiblioFavoriteMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof removeBiblioFavorite>>, TError,RemoveBiblioFavoriteMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof removeBiblioFavorite>>, TError,RemoveBiblioFavoriteMutationVariables, TContext> => {\n\nconst mutationKey = getRemoveBiblioFavoriteMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof removeBiblioFavorite>>, RemoveBiblioFavoriteMutationVariables> = (props) => {\n const {contentId} = props ?? {};\n\n return removeBiblioFavorite(contentId,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type RemoveBiblioFavoriteMutationResult = NonNullable<Awaited<ReturnType<typeof removeBiblioFavorite>>>\n\n export type RemoveBiblioFavoriteMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type RemoveBiblioFavoriteMutationVariables = {contentId: number}\n\n /**\n * @summary Remove Biblio Favorite\n */\nexport const useRemoveBiblioFavorite = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof removeBiblioFavorite>>, TError,RemoveBiblioFavoriteMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof removeBiblioFavorite>>,\n TError,\n RemoveBiblioFavoriteMutationVariables,\n TContext\n > => {\n return useMutation(getRemoveBiblioFavoriteMutationOptions(options), queryClient);\n }\n export 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\n\n\n\nexport const getAddBiblioFavoriteMutationKey = () => ['addBiblioFavorite'] as const;\n\nexport const getAddBiblioFavoriteMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addBiblioFavorite>>, TError,AddBiblioFavoriteMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof addBiblioFavorite>>, TError,AddBiblioFavoriteMutationVariables, TContext> => {\n\nconst mutationKey = getAddBiblioFavoriteMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof addBiblioFavorite>>, AddBiblioFavoriteMutationVariables> = (props) => {\n const {contentId,data} = props ?? {};\n\n return addBiblioFavorite(contentId,data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type AddBiblioFavoriteMutationResult = NonNullable<Awaited<ReturnType<typeof addBiblioFavorite>>>\n export type AddBiblioFavoriteMutationBody = BodyType<FavoriteAddWrite>\n export type AddBiblioFavoriteMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type AddBiblioFavoriteMutationVariables = {contentId: number;data: BodyType<FavoriteAddWrite>}\n\n /**\n * @summary Add Biblio Favorite\n */\nexport const useAddBiblioFavorite = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addBiblioFavorite>>, TError,AddBiblioFavoriteMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof addBiblioFavorite>>,\n TError,\n AddBiblioFavoriteMutationVariables,\n TContext\n > => {\n return useMutation(getAddBiblioFavoriteMutationOptions(options), queryClient);\n }\n export 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\n\n\n\nexport const getListHistoryQueryKey = (params?: ListHistoryParams,) => {\n return [\n `/biblio/me/history`, ...(params ? [params] : [])\n ] as const;\n }\n\n\nexport const getListHistoryQueryOptions = <TData = Awaited<ReturnType<typeof listHistory>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params?: ListHistoryParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listHistory>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getListHistoryQueryKey(params);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof listHistory>>> = ({ signal }) => listHistory(params, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listHistory>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ListHistoryQueryResult = NonNullable<Awaited<ReturnType<typeof listHistory>>>\nexport type ListHistoryQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useListHistory<TData = Awaited<ReturnType<typeof listHistory>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params: undefined | ListHistoryParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listHistory>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof listHistory>>,\n TError,\n Awaited<ReturnType<typeof listHistory>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListHistory<TData = Awaited<ReturnType<typeof listHistory>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListHistoryParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listHistory>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof listHistory>>,\n TError,\n Awaited<ReturnType<typeof listHistory>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListHistory<TData = Awaited<ReturnType<typeof listHistory>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListHistoryParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listHistory>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary List History\n */\n\nexport function useListHistory<TData = Awaited<ReturnType<typeof listHistory>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListHistoryParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listHistory>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getListHistoryQueryOptions(params,options)\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n return withQueryKey(query, queryOptions.queryKey);\n}\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\n\n\n\nexport const getListPacksQueryKey = () => {\n return [\n `/biblio/me/packs`\n ] as const;\n }\n\n\nexport const getListPacksQueryOptions = <TData = Awaited<ReturnType<typeof listPacks>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listPacks>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getListPacksQueryKey();\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof listPacks>>> = ({ signal }) => listPacks({ signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listPacks>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ListPacksQueryResult = NonNullable<Awaited<ReturnType<typeof listPacks>>>\nexport type ListPacksQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useListPacks<TData = Awaited<ReturnType<typeof listPacks>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listPacks>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof listPacks>>,\n TError,\n Awaited<ReturnType<typeof listPacks>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListPacks<TData = Awaited<ReturnType<typeof listPacks>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listPacks>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof listPacks>>,\n TError,\n Awaited<ReturnType<typeof listPacks>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListPacks<TData = Awaited<ReturnType<typeof listPacks>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listPacks>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary List Packs\n */\n\nexport function useListPacks<TData = Awaited<ReturnType<typeof listPacks>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listPacks>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getListPacksQueryOptions(options)\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n return withQueryKey(query, queryOptions.queryKey);\n}\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\n\n\n\nexport const getReadPreferencesQueryKey = () => {\n return [\n `/biblio/me/preferences`\n ] as const;\n }\n\n\nexport const getReadPreferencesQueryOptions = <TData = Awaited<ReturnType<typeof readPreferences>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPreferences>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getReadPreferencesQueryKey();\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof readPreferences>>> = ({ signal }) => readPreferences({ signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof readPreferences>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ReadPreferencesQueryResult = NonNullable<Awaited<ReturnType<typeof readPreferences>>>\nexport type ReadPreferencesQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useReadPreferences<TData = Awaited<ReturnType<typeof readPreferences>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPreferences>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof readPreferences>>,\n TError,\n Awaited<ReturnType<typeof readPreferences>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadPreferences<TData = Awaited<ReturnType<typeof readPreferences>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPreferences>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof readPreferences>>,\n TError,\n Awaited<ReturnType<typeof readPreferences>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadPreferences<TData = Awaited<ReturnType<typeof readPreferences>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPreferences>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Read Preferences\n */\n\nexport function useReadPreferences<TData = Awaited<ReturnType<typeof readPreferences>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPreferences>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getReadPreferencesQueryOptions(options)\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n return withQueryKey(query, queryOptions.queryKey);\n}\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\n\n\nexport const getReplaceCategoryPreferencesMutationKey = () => ['replaceCategoryPreferences'] as const;\n\nexport const getReplaceCategoryPreferencesMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof replaceCategoryPreferences>>, TError,ReplaceCategoryPreferencesMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof replaceCategoryPreferences>>, TError,ReplaceCategoryPreferencesMutationVariables, TContext> => {\n\nconst mutationKey = getReplaceCategoryPreferencesMutationKey();\nconst {mutation: mutationOptions, request: requestOptions} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }, request: undefined};\n\n\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof replaceCategoryPreferences>>, ReplaceCategoryPreferencesMutationVariables> = (props) => {\n const {data} = props ?? {};\n\n return replaceCategoryPreferences(data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type ReplaceCategoryPreferencesMutationResult = NonNullable<Awaited<ReturnType<typeof replaceCategoryPreferences>>>\n export type ReplaceCategoryPreferencesMutationBody = BodyType<CategoryPreferencesWrite>\n export type ReplaceCategoryPreferencesMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type ReplaceCategoryPreferencesMutationVariables = {data: BodyType<CategoryPreferencesWrite>}\n\n /**\n * @summary Replace Category Preferences\n */\nexport const useReplaceCategoryPreferences = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof replaceCategoryPreferences>>, TError,ReplaceCategoryPreferencesMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof replaceCategoryPreferences>>,\n TError,\n ReplaceCategoryPreferencesMutationVariables,\n TContext\n > => {\n return useMutation(getReplaceCategoryPreferencesMutationOptions(options), queryClient);\n }\n"],"mappings":";;;;;;;;;;;AAgDA,MAAM,gBAAqC,OAAU,aAAqC;CACxF,MAAM,SAAS,EAAE,SAAS;CAC1B,KAAK,MAAM,OAAO,OAAO,KAAK,KAAK,GAAG;EAGpC,IAAI,QAAQ,YAAY;EACxB,OAAO,eAAe,QAAQ,KAAK;GACjC,YAAY;GACZ,cAAc;GACd,WAAY,MAAkC;EAChD,CAAC;CACH;CACA,OAAO;AACT;AAEA,MAAa,mCAAmC;CAK9C,OAAO;AACT;;;;;;;;;;;AAYA,MAAa,uBAAuB,OAAQ,YAAuE;CAEjH,OAAO,QAA0B,2BAA2B,GAC5D;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAMF,MAAa,wCAAwC;CACjD,OAAO,CACP,uBACA;AACA;AAGJ,MAAa,uCAAuK,YAC/K;CAEL,MAAM,EAAC,OAAO,cAAc,SAAS,mBAAkB,WAAW,CAAC;CAEjE,MAAM,WAAY,cAAc,YAAY,gCAAgC;CAI1E,MAAM,WAA4E,EAAE,aAAa,qBAAqB;EAAE;EAAQ,GAAG;CAAe,CAAC;CAMpJ,OAAQ;EAAE;EAAU;EAAS,GAAG;CAAY;AAC/C;;;;AAkCA,SAAgB,wBACd,SACC,aACiF;CAElF,MAAM,eAAe,oCAAoC,OAAO;CAEhE,MAAM,QAAQ,SAAS,cAAc,WAAW;CAEhD,OAAO,aAAa,OAAO,aAAa,QAAQ;AAClD;AAOA,MAAa,6BAA6B,WAAwC;CAChF,MAAM,mBAAmB,IAAI,gB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AAQ;EAAE;EAAY,GAAG;CAAgB;AAAC;;;;AAU5C,MAAa,iCACW,SACrB,gBAKQ;CACL,OAAO,YAAY,6CAA6C,OAAO,GAAG,WAAW;AACvF"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
|
|
2
|
+
import { Gn as HTTPExceptionResponse, Mn as LicenseRead, t as ValidationErrorResponse } from "../index-wL_20vR8.js";
|
|
3
|
+
import { a as ErrorType, c as request } from "../client-BDwBZYB0.js";
|
|
4
|
+
import { DataTag, DefinedInitialDataOptions, DefinedUseQueryResult, QueryClient, QueryKey, UndefinedInitialDataOptions, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
|
|
5
|
+
//#region src/react/biblio-nextory/biblio-nextory.d.ts
|
|
6
|
+
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
7
|
+
export declare const getDeleteLicenseUrl: () => string;
|
|
8
|
+
/**
|
|
9
|
+
* Release this member's seat back to the household pool.
|
|
10
|
+
*
|
|
11
|
+
* Not in the legacy's member surface — releasing was staff-only, so a household
|
|
12
|
+
* at its cap had to call support. The seat stays claimed by this member rather
|
|
13
|
+
* than orphaned, so their next allocation gets the same number back and their
|
|
14
|
+
* reading positions with it.
|
|
15
|
+
*
|
|
16
|
+
* ``204`` whether or not a licence was held: the desired end state is "no
|
|
17
|
+
* seat", and reporting ``404`` would only tell a caller something they cannot
|
|
18
|
+
* act on.
|
|
19
|
+
* @summary Delete License
|
|
20
|
+
*/
|
|
21
|
+
export declare const deleteLicense: (options?: Parameters<typeof request>[1]) => Promise<void>;
|
|
22
|
+
export declare const getDeleteLicenseMutationKey: () => readonly ['deleteLicense'];
|
|
23
|
+
export declare const getDeleteLicenseMutationOptions: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
|
|
24
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof deleteLicense>>, TError, void, TContext>;
|
|
25
|
+
request?: SecondParameter<typeof request>;
|
|
26
|
+
}) => UseMutationOptions<Awaited<ReturnType<typeof deleteLicense>>, TError, void, TContext>;
|
|
27
|
+
export type DeleteLicenseMutationResult = NonNullable<Awaited<ReturnType<typeof deleteLicense>>>;
|
|
28
|
+
export type DeleteLicenseMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>;
|
|
29
|
+
/**
|
|
30
|
+
* @summary Delete License
|
|
31
|
+
*/
|
|
32
|
+
export declare const useDeleteLicense: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
|
|
33
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof deleteLicense>>, TError, void, TContext>;
|
|
34
|
+
request?: SecondParameter<typeof request>;
|
|
35
|
+
}, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof deleteLicense>>, TError, void, TContext>;
|
|
36
|
+
export declare const getReadLicenseUrl: () => string;
|
|
37
|
+
/**
|
|
38
|
+
* The seat this member holds (E49). ``404`` when they hold none.
|
|
39
|
+
*
|
|
40
|
+
* Safe, and that is the entire point of the endpoint existing separately.
|
|
41
|
+
* @summary Read License
|
|
42
|
+
*/
|
|
43
|
+
export declare const readLicense: (options?: Parameters<typeof request>[1]) => Promise<LicenseRead>;
|
|
44
|
+
export declare const getReadLicenseQueryKey: () => readonly [`/biblio/me/nextory/license`];
|
|
45
|
+
export declare const getReadLicenseQueryOptions: <TData = Awaited<ReturnType<typeof readLicense>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(options?: {
|
|
46
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof readLicense>>, TError, TData>>;
|
|
47
|
+
request?: SecondParameter<typeof request>;
|
|
48
|
+
}) => UseQueryOptions<Awaited<ReturnType<typeof readLicense>>, TError, TData> & {
|
|
49
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
50
|
+
};
|
|
51
|
+
export type ReadLicenseQueryResult = NonNullable<Awaited<ReturnType<typeof readLicense>>>;
|
|
52
|
+
export type ReadLicenseQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>;
|
|
53
|
+
export declare function useReadLicense<TData = Awaited<ReturnType<typeof readLicense>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(options: {
|
|
54
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof readLicense>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof readLicense>>, TError, Awaited<ReturnType<typeof readLicense>>>, 'initialData'>;
|
|
55
|
+
request?: SecondParameter<typeof request>;
|
|
56
|
+
}, queryClient?: QueryClient): DefinedUseQueryResult<TData, TError> & {
|
|
57
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
58
|
+
};
|
|
59
|
+
export declare function useReadLicense<TData = Awaited<ReturnType<typeof readLicense>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(options?: {
|
|
60
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof readLicense>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof readLicense>>, TError, Awaited<ReturnType<typeof readLicense>>>, 'initialData'>;
|
|
61
|
+
request?: SecondParameter<typeof request>;
|
|
62
|
+
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
63
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
64
|
+
};
|
|
65
|
+
export declare function useReadLicense<TData = Awaited<ReturnType<typeof readLicense>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(options?: {
|
|
66
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof readLicense>>, TError, TData>>;
|
|
67
|
+
request?: SecondParameter<typeof request>;
|
|
68
|
+
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
69
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
70
|
+
};
|
|
71
|
+
export declare const getCreateLicenseUrl: () => string;
|
|
72
|
+
/**
|
|
73
|
+
* Allocate or reactivate this member's seat (E50).
|
|
74
|
+
*
|
|
75
|
+
* Idempotent: a member who already holds one gets it back with ``200``, and the
|
|
76
|
+
* call doubles as a repair — a subscription that lapsed at the partner is
|
|
77
|
+
* reopened against the same number, so reading positions survive.
|
|
78
|
+
*
|
|
79
|
+
* Medium assurance: this creates an account for the member at a third party
|
|
80
|
+
* under their identity, which is not something a session established by a
|
|
81
|
+
* partner handing over a static URL key should be able to do.
|
|
82
|
+
* @summary Create License
|
|
83
|
+
*/
|
|
84
|
+
export declare const createLicense: (options?: Parameters<typeof request>[1]) => Promise<LicenseRead>;
|
|
85
|
+
export declare const getCreateLicenseMutationKey: () => readonly ['createLicense'];
|
|
86
|
+
export declare const getCreateLicenseMutationOptions: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
|
|
87
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof createLicense>>, TError, void, TContext>;
|
|
88
|
+
request?: SecondParameter<typeof request>;
|
|
89
|
+
}) => UseMutationOptions<Awaited<ReturnType<typeof createLicense>>, TError, void, TContext>;
|
|
90
|
+
export type CreateLicenseMutationResult = NonNullable<Awaited<ReturnType<typeof createLicense>>>;
|
|
91
|
+
export type CreateLicenseMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>;
|
|
92
|
+
/**
|
|
93
|
+
* @summary Create License
|
|
94
|
+
*/
|
|
95
|
+
export declare const useCreateLicense: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
|
|
96
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof createLicense>>, TError, void, TContext>;
|
|
97
|
+
request?: SecondParameter<typeof request>;
|
|
98
|
+
}, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof createLicense>>, TError, void, TContext>;
|
|
99
|
+
//#endregion
|
|
100
|
+
//# sourceMappingURL=biblio-nextory.d.ts.map
|