@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,163 @@
|
|
|
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-nextory/biblio-nextory.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 getDeleteLicenseUrl = () => {
|
|
25
|
+
return `/biblio/me/nextory/license`;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Release this member's seat back to the household pool.
|
|
29
|
+
*
|
|
30
|
+
* Not in the legacy's member surface — releasing was staff-only, so a household
|
|
31
|
+
* at its cap had to call support. The seat stays claimed by this member rather
|
|
32
|
+
* than orphaned, so their next allocation gets the same number back and their
|
|
33
|
+
* reading positions with it.
|
|
34
|
+
*
|
|
35
|
+
* ``204`` whether or not a licence was held: the desired end state is "no
|
|
36
|
+
* seat", and reporting ``404`` would only tell a caller something they cannot
|
|
37
|
+
* act on.
|
|
38
|
+
* @summary Delete License
|
|
39
|
+
*/
|
|
40
|
+
const deleteLicense = async (options) => {
|
|
41
|
+
return request(getDeleteLicenseUrl(), {
|
|
42
|
+
...options,
|
|
43
|
+
method: "DELETE"
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
const getDeleteLicenseMutationKey = () => ["deleteLicense"];
|
|
47
|
+
const getDeleteLicenseMutationOptions = (options) => {
|
|
48
|
+
const mutationKey = getDeleteLicenseMutationKey();
|
|
49
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : {
|
|
50
|
+
...options,
|
|
51
|
+
mutation: {
|
|
52
|
+
...options.mutation,
|
|
53
|
+
mutationKey
|
|
54
|
+
}
|
|
55
|
+
} : {
|
|
56
|
+
mutation: { mutationKey },
|
|
57
|
+
request: void 0
|
|
58
|
+
};
|
|
59
|
+
const mutationFn = () => {
|
|
60
|
+
return deleteLicense(requestOptions);
|
|
61
|
+
};
|
|
62
|
+
return {
|
|
63
|
+
mutationFn,
|
|
64
|
+
...mutationOptions
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* @summary Delete License
|
|
69
|
+
*/
|
|
70
|
+
const useDeleteLicense = (options, queryClient) => {
|
|
71
|
+
return useMutation(getDeleteLicenseMutationOptions(options), queryClient);
|
|
72
|
+
};
|
|
73
|
+
const getReadLicenseUrl = () => {
|
|
74
|
+
return `/biblio/me/nextory/license`;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* The seat this member holds (E49). ``404`` when they hold none.
|
|
78
|
+
*
|
|
79
|
+
* Safe, and that is the entire point of the endpoint existing separately.
|
|
80
|
+
* @summary Read License
|
|
81
|
+
*/
|
|
82
|
+
const readLicense = async (options) => {
|
|
83
|
+
return request(getReadLicenseUrl(), {
|
|
84
|
+
...options,
|
|
85
|
+
method: "GET"
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
const getReadLicenseQueryKey = () => {
|
|
89
|
+
return [`/biblio/me/nextory/license`];
|
|
90
|
+
};
|
|
91
|
+
const getReadLicenseQueryOptions = (options) => {
|
|
92
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
93
|
+
const queryKey = queryOptions?.queryKey ?? getReadLicenseQueryKey();
|
|
94
|
+
const queryFn = ({ signal }) => readLicense({
|
|
95
|
+
signal,
|
|
96
|
+
...requestOptions
|
|
97
|
+
});
|
|
98
|
+
return {
|
|
99
|
+
queryKey,
|
|
100
|
+
queryFn,
|
|
101
|
+
...queryOptions
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* @summary Read License
|
|
106
|
+
*/
|
|
107
|
+
function useReadLicense(options, queryClient) {
|
|
108
|
+
const queryOptions = getReadLicenseQueryOptions(options);
|
|
109
|
+
const query = useQuery(queryOptions, queryClient);
|
|
110
|
+
return withQueryKey(query, queryOptions.queryKey);
|
|
111
|
+
}
|
|
112
|
+
const getCreateLicenseUrl = () => {
|
|
113
|
+
return `/biblio/me/nextory/license`;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Allocate or reactivate this member's seat (E50).
|
|
117
|
+
*
|
|
118
|
+
* Idempotent: a member who already holds one gets it back with ``200``, and the
|
|
119
|
+
* call doubles as a repair — a subscription that lapsed at the partner is
|
|
120
|
+
* reopened against the same number, so reading positions survive.
|
|
121
|
+
*
|
|
122
|
+
* Medium assurance: this creates an account for the member at a third party
|
|
123
|
+
* under their identity, which is not something a session established by a
|
|
124
|
+
* partner handing over a static URL key should be able to do.
|
|
125
|
+
* @summary Create License
|
|
126
|
+
*/
|
|
127
|
+
const createLicense = async (options) => {
|
|
128
|
+
return request(getCreateLicenseUrl(), {
|
|
129
|
+
...options,
|
|
130
|
+
method: "POST"
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
const getCreateLicenseMutationKey = () => ["createLicense"];
|
|
134
|
+
const getCreateLicenseMutationOptions = (options) => {
|
|
135
|
+
const mutationKey = getCreateLicenseMutationKey();
|
|
136
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : {
|
|
137
|
+
...options,
|
|
138
|
+
mutation: {
|
|
139
|
+
...options.mutation,
|
|
140
|
+
mutationKey
|
|
141
|
+
}
|
|
142
|
+
} : {
|
|
143
|
+
mutation: { mutationKey },
|
|
144
|
+
request: void 0
|
|
145
|
+
};
|
|
146
|
+
const mutationFn = () => {
|
|
147
|
+
return createLicense(requestOptions);
|
|
148
|
+
};
|
|
149
|
+
return {
|
|
150
|
+
mutationFn,
|
|
151
|
+
...mutationOptions
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
/**
|
|
155
|
+
* @summary Create License
|
|
156
|
+
*/
|
|
157
|
+
const useCreateLicense = (options, queryClient) => {
|
|
158
|
+
return useMutation(getCreateLicenseMutationOptions(options), queryClient);
|
|
159
|
+
};
|
|
160
|
+
//#endregion
|
|
161
|
+
export { createLicense, deleteLicense, getCreateLicenseMutationKey, getCreateLicenseMutationOptions, getCreateLicenseUrl, getDeleteLicenseMutationKey, getDeleteLicenseMutationOptions, getDeleteLicenseUrl, getReadLicenseQueryKey, getReadLicenseQueryOptions, getReadLicenseUrl, readLicense, useCreateLicense, useDeleteLicense, useReadLicense };
|
|
162
|
+
|
|
163
|
+
//# sourceMappingURL=biblio-nextory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"biblio-nextory.js","names":[],"sources":["../../src/react/biblio-nextory/biblio-nextory.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 HTTPExceptionResponse,\n LicenseRead,\n ValidationErrorResponse\n} from '../../models';\n\nimport { request } from '../../client';\nimport type { ErrorType } 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 getDeleteLicenseUrl = () => {\n\n\n\n\n return `/biblio/me/nextory/license`\n}\n\n/**\n * Release this member's seat back to the household pool.\n *\n * Not in the legacy's member surface — releasing was staff-only, so a household\n * at its cap had to call support. The seat stays claimed by this member rather\n * than orphaned, so their next allocation gets the same number back and their\n * reading positions with it.\n *\n * ``204`` whether or not a licence was held: the desired end state is \"no\n * seat\", and reporting ``404`` would only tell a caller something they cannot\n * act on.\n * @summary Delete License\n */\nexport const deleteLicense = async ( options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getDeleteLicenseUrl(),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\n\n\n\nexport const getDeleteLicenseMutationKey = () => ['deleteLicense'] as const;\n\nexport const getDeleteLicenseMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteLicense>>, TError,void, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof deleteLicense>>, TError,void, TContext> => {\n\nconst mutationKey = getDeleteLicenseMutationKey();\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 deleteLicense>>, void> = () => {\n\n\n return deleteLicense(requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DeleteLicenseMutationResult = NonNullable<Awaited<ReturnType<typeof deleteLicense>>>\n\n export type DeleteLicenseMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\n /**\n * @summary Delete License\n */\nexport const useDeleteLicense = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteLicense>>, TError,void, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof deleteLicense>>,\n TError,\n void,\n TContext\n > => {\n return useMutation(getDeleteLicenseMutationOptions(options), queryClient);\n }\n export const getReadLicenseUrl = () => {\n\n\n\n\n return `/biblio/me/nextory/license`\n}\n\n/**\n * The seat this member holds (E49). ``404`` when they hold none.\n *\n * Safe, and that is the entire point of the endpoint existing separately.\n * @summary Read License\n */\nexport const readLicense = async ( options?: Parameters<typeof request>[1]): Promise<LicenseRead> => {\n\n return request<LicenseRead>(getReadLicenseUrl(),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getReadLicenseQueryKey = () => {\n return [\n `/biblio/me/nextory/license`\n ] as const;\n }\n\n\nexport const getReadLicenseQueryOptions = <TData = Awaited<ReturnType<typeof readLicense>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readLicense>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getReadLicenseQueryKey();\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof readLicense>>> = ({ signal }) => readLicense({ signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof readLicense>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ReadLicenseQueryResult = NonNullable<Awaited<ReturnType<typeof readLicense>>>\nexport type ReadLicenseQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useReadLicense<TData = Awaited<ReturnType<typeof readLicense>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof readLicense>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof readLicense>>,\n TError,\n Awaited<ReturnType<typeof readLicense>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadLicense<TData = Awaited<ReturnType<typeof readLicense>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readLicense>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof readLicense>>,\n TError,\n Awaited<ReturnType<typeof readLicense>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadLicense<TData = Awaited<ReturnType<typeof readLicense>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readLicense>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Read License\n */\n\nexport function useReadLicense<TData = Awaited<ReturnType<typeof readLicense>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readLicense>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getReadLicenseQueryOptions(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 getCreateLicenseUrl = () => {\n\n\n\n\n return `/biblio/me/nextory/license`\n}\n\n/**\n * Allocate or reactivate this member's seat (E50).\n *\n * Idempotent: a member who already holds one gets it back with ``200``, and the\n * call doubles as a repair — a subscription that lapsed at the partner is\n * reopened against the same number, so reading positions survive.\n *\n * Medium assurance: this creates an account for the member at a third party\n * under their identity, which is not something a session established by a\n * partner handing over a static URL key should be able to do.\n * @summary Create License\n */\nexport const createLicense = async ( options?: Parameters<typeof request>[1]): Promise<LicenseRead> => {\n\n return request<LicenseRead>(getCreateLicenseUrl(),\n {\n ...options,\n method: 'POST'\n\n\n }\n);}\n\n\n\n\n\nexport const getCreateLicenseMutationKey = () => ['createLicense'] as const;\n\nexport const getCreateLicenseMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createLicense>>, TError,void, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof createLicense>>, TError,void, TContext> => {\n\nconst mutationKey = getCreateLicenseMutationKey();\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 createLicense>>, void> = () => {\n\n\n return createLicense(requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type CreateLicenseMutationResult = NonNullable<Awaited<ReturnType<typeof createLicense>>>\n\n export type CreateLicenseMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\n /**\n * @summary Create License\n */\nexport const useCreateLicense = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createLicense>>, TError,void, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof createLicense>>,\n TError,\n void,\n TContext\n > => {\n return useMutation(getCreateLicenseMutationOptions(options), queryClient);\n }\n"],"mappings":";;;;;;;;;;;AAwCA,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,4BAA4B;CAKvC,OAAO;AACT;;;;;;;;;;;;;;AAeA,MAAa,gBAAgB,OAAQ,YAA2D;CAE9F,OAAO,QAAc,oBAAoB,GACzC;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAMF,MAAa,oCAAoC,CAAC,eAAe;AAEjE,MAAa,mCACW,YACmE;CAE3F,MAAM,cAAc,4BAA4B;CAChD,MAAM,EAAC,UAAU,iBAAiB,SAAS,mBAAkB,UACvD,QAAQ,YAAY,iBAAiB,QAAQ,YAAY,QAAQ,SAAS,cAC1E,UACE;EAAC,GAAG;EAAS,UAAU;GAAC,GAAG,QAAQ;GAAU;EAAW;CAAC,IACzD;EAAC,UAAU,EAAE,YAAa;EAAG,SAAS,KAAA;CAAS;CAKjD,MAAM,mBAAsF;EAGxF,OAAQ,cAAc,cAAc;CACtC;CAON,OAAQ;EAAE;EAAY,GAAG;CAAgB;AAAC;;;;AAU5C,MAAa,oBACW,SACrB,gBAKQ;CACL,OAAO,YAAY,gCAAgC,OAAO,GAAG,WAAW;AAC1E;AACA,MAAa,0BAA0B;CAKzC,OAAO;AACT;;;;;;;AAQA,MAAa,cAAc,OAAQ,YAAkE;CAEnG,OAAO,QAAqB,kBAAkB,GAC9C;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAMF,MAAa,+BAA+B;CACxC,OAAO,CACP,4BACA;AACA;AAGJ,MAAa,8BAAqJ,YAC7J;CAEL,MAAM,EAAC,OAAO,cAAc,SAAS,mBAAkB,WAAW,CAAC;CAEjE,MAAM,WAAY,cAAc,YAAY,uBAAuB;CAIjE,MAAM,WAAmE,EAAE,aAAa,YAAY;EAAE;EAAQ,GAAG;CAAe,CAAC;CAMlI,OAAQ;EAAE;EAAU;EAAS,GAAG;CAAY;AAC/C;;;;AAkCA,SAAgB,eACd,SACC,aACiF;CAElF,MAAM,eAAe,2BAA2B,OAAO;CAEvD,MAAM,QAAQ,SAAS,cAAc,WAAW;CAEhD,OAAO,aAAa,OAAO,aAAa,QAAQ;AAClD;AAOA,MAAa,4BAA4B;CAKvC,OAAO;AACT;;;;;;;;;;;;;AAcA,MAAa,gBAAgB,OAAQ,YAAkE;CAErG,OAAO,QAAqB,oBAAoB,GAChD;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAMF,MAAa,oCAAoC,CAAC,eAAe;AAEjE,MAAa,mCACW,YACmE;CAE3F,MAAM,cAAc,4BAA4B;CAChD,MAAM,EAAC,UAAU,iBAAiB,SAAS,mBAAkB,UACvD,QAAQ,YAAY,iBAAiB,QAAQ,YAAY,QAAQ,SAAS,cAC1E,UACE;EAAC,GAAG;EAAS,UAAU;GAAC,GAAG,QAAQ;GAAU;EAAW;CAAC,IACzD;EAAC,UAAU,EAAE,YAAa;EAAG,SAAS,KAAA;CAAS;CAKjD,MAAM,mBAAsF;EAGxF,OAAQ,cAAc,cAAc;CACtC;CAON,OAAQ;EAAE;EAAY,GAAG;CAAgB;AAAC;;;;AAU5C,MAAa,oBACW,SACrB,gBAKQ;CACL,OAAO,YAAY,gCAAgC,OAAO,GAAG,WAAW;AAC1E"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
|
|
2
|
+
import { Gn as HTTPExceptionResponse, Q as ReadPressReviewParams, bt as PressArticleRead, dn as ListPressArticlesParams, qn as PressReviewRead, t as ValidationErrorResponse, xt as PressArticleListRead } 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, UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
|
|
5
|
+
//#region src/react/biblio-press/biblio-press.d.ts
|
|
6
|
+
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
7
|
+
export declare const getListPressArticlesUrl: (params?: ListPressArticlesParams) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Press articles, filtered (E41).
|
|
10
|
+
*
|
|
11
|
+
* ``theme_id`` unifies the legacy's two separate parameters ``themeId`` and
|
|
12
|
+
* ``themePk``, which named the same thing. ``order`` is resolved against a
|
|
13
|
+
* whitelist; anything else is ``422`` rather than a surprise ordering.
|
|
14
|
+
* @summary List Press Articles
|
|
15
|
+
*/
|
|
16
|
+
export declare const listPressArticles: (params?: ListPressArticlesParams, options?: Parameters<typeof request>[1]) => Promise<PressArticleListRead>;
|
|
17
|
+
export declare const getListPressArticlesQueryKey: (params?: ListPressArticlesParams) => readonly ["/biblio/press-articles", ...ListPressArticlesParams[]];
|
|
18
|
+
export declare const getListPressArticlesQueryOptions: <TData = Awaited<ReturnType<typeof listPressArticles>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params?: ListPressArticlesParams, options?: {
|
|
19
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof listPressArticles>>, TError, TData>>;
|
|
20
|
+
request?: SecondParameter<typeof request>;
|
|
21
|
+
}) => UseQueryOptions<Awaited<ReturnType<typeof listPressArticles>>, TError, TData> & {
|
|
22
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
23
|
+
};
|
|
24
|
+
export type ListPressArticlesQueryResult = NonNullable<Awaited<ReturnType<typeof listPressArticles>>>;
|
|
25
|
+
export type ListPressArticlesQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>;
|
|
26
|
+
export declare function useListPressArticles<TData = Awaited<ReturnType<typeof listPressArticles>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params: undefined | ListPressArticlesParams, options: {
|
|
27
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof listPressArticles>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof listPressArticles>>, TError, Awaited<ReturnType<typeof listPressArticles>>>, 'initialData'>;
|
|
28
|
+
request?: SecondParameter<typeof request>;
|
|
29
|
+
}, queryClient?: QueryClient): DefinedUseQueryResult<TData, TError> & {
|
|
30
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
31
|
+
};
|
|
32
|
+
export declare function useListPressArticles<TData = Awaited<ReturnType<typeof listPressArticles>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params?: ListPressArticlesParams, options?: {
|
|
33
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof listPressArticles>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof listPressArticles>>, TError, Awaited<ReturnType<typeof listPressArticles>>>, 'initialData'>;
|
|
34
|
+
request?: SecondParameter<typeof request>;
|
|
35
|
+
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
36
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
37
|
+
};
|
|
38
|
+
export declare function useListPressArticles<TData = Awaited<ReturnType<typeof listPressArticles>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params?: ListPressArticlesParams, options?: {
|
|
39
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof listPressArticles>>, TError, TData>>;
|
|
40
|
+
request?: SecondParameter<typeof request>;
|
|
41
|
+
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
42
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
43
|
+
};
|
|
44
|
+
export declare const getReadPressArticleUrl: (articleId: number) => string;
|
|
45
|
+
/**
|
|
46
|
+
* One press article (E42). ``404`` when unknown *or* not entitled.
|
|
47
|
+
* @summary Read Press Article
|
|
48
|
+
*/
|
|
49
|
+
export declare const readPressArticle: (articleId: number, options?: Parameters<typeof request>[1]) => Promise<PressArticleRead>;
|
|
50
|
+
export declare const getReadPressArticleQueryKey: (articleId: number) => readonly [`/biblio/press-articles/${number}`];
|
|
51
|
+
export declare const getReadPressArticleQueryOptions: <TData = Awaited<ReturnType<typeof readPressArticle>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(articleId: number, options?: {
|
|
52
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressArticle>>, TError, TData>>;
|
|
53
|
+
request?: SecondParameter<typeof request>;
|
|
54
|
+
}) => UseQueryOptions<Awaited<ReturnType<typeof readPressArticle>>, TError, TData> & {
|
|
55
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
56
|
+
};
|
|
57
|
+
export type ReadPressArticleQueryResult = NonNullable<Awaited<ReturnType<typeof readPressArticle>>>;
|
|
58
|
+
export type ReadPressArticleQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>;
|
|
59
|
+
export declare function useReadPressArticle<TData = Awaited<ReturnType<typeof readPressArticle>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(articleId: number, options: {
|
|
60
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressArticle>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof readPressArticle>>, TError, Awaited<ReturnType<typeof readPressArticle>>>, 'initialData'>;
|
|
61
|
+
request?: SecondParameter<typeof request>;
|
|
62
|
+
}, queryClient?: QueryClient): DefinedUseQueryResult<TData, TError> & {
|
|
63
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
64
|
+
};
|
|
65
|
+
export declare function useReadPressArticle<TData = Awaited<ReturnType<typeof readPressArticle>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(articleId: number, options?: {
|
|
66
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressArticle>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof readPressArticle>>, TError, Awaited<ReturnType<typeof readPressArticle>>>, 'initialData'>;
|
|
67
|
+
request?: SecondParameter<typeof request>;
|
|
68
|
+
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
69
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
70
|
+
};
|
|
71
|
+
export declare function useReadPressArticle<TData = Awaited<ReturnType<typeof readPressArticle>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(articleId: number, options?: {
|
|
72
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressArticle>>, TError, TData>>;
|
|
73
|
+
request?: SecondParameter<typeof request>;
|
|
74
|
+
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
75
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
76
|
+
};
|
|
77
|
+
export declare const getReadPressReviewUrl: (params?: ReadPressReviewParams) => string;
|
|
78
|
+
/**
|
|
79
|
+
* The curated press review (E43). An explicit aggregate (§5.2).
|
|
80
|
+
*
|
|
81
|
+
* New as an endpoint; the legacy composed it into two pages and never exposed
|
|
82
|
+
* it. There is no curation table, so a section is a theme and its members are
|
|
83
|
+
* that theme's most recent entitled articles — which is what the rendered page
|
|
84
|
+
* amounted to. When a real curation model appears this is the one place that has
|
|
85
|
+
* to change.
|
|
86
|
+
*
|
|
87
|
+
* A theme with nothing the caller may read is omitted rather than returned
|
|
88
|
+
* empty: an empty section is a hole in a page, and the client cannot tell
|
|
89
|
+
* "nothing new" from "not licensed".
|
|
90
|
+
* @summary Read Press Review
|
|
91
|
+
*/
|
|
92
|
+
export declare const readPressReview: (params?: ReadPressReviewParams, options?: Parameters<typeof request>[1]) => Promise<PressReviewRead>;
|
|
93
|
+
export declare const getReadPressReviewQueryKey: (params?: ReadPressReviewParams) => readonly ["/biblio/press-review", ...ReadPressReviewParams[]];
|
|
94
|
+
export declare const getReadPressReviewQueryOptions: <TData = Awaited<ReturnType<typeof readPressReview>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params?: ReadPressReviewParams, options?: {
|
|
95
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressReview>>, TError, TData>>;
|
|
96
|
+
request?: SecondParameter<typeof request>;
|
|
97
|
+
}) => UseQueryOptions<Awaited<ReturnType<typeof readPressReview>>, TError, TData> & {
|
|
98
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
99
|
+
};
|
|
100
|
+
export type ReadPressReviewQueryResult = NonNullable<Awaited<ReturnType<typeof readPressReview>>>;
|
|
101
|
+
export type ReadPressReviewQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>;
|
|
102
|
+
export declare function useReadPressReview<TData = Awaited<ReturnType<typeof readPressReview>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params: undefined | ReadPressReviewParams, options: {
|
|
103
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressReview>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof readPressReview>>, TError, Awaited<ReturnType<typeof readPressReview>>>, 'initialData'>;
|
|
104
|
+
request?: SecondParameter<typeof request>;
|
|
105
|
+
}, queryClient?: QueryClient): DefinedUseQueryResult<TData, TError> & {
|
|
106
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
107
|
+
};
|
|
108
|
+
export declare function useReadPressReview<TData = Awaited<ReturnType<typeof readPressReview>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params?: ReadPressReviewParams, options?: {
|
|
109
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressReview>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof readPressReview>>, TError, Awaited<ReturnType<typeof readPressReview>>>, 'initialData'>;
|
|
110
|
+
request?: SecondParameter<typeof request>;
|
|
111
|
+
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
112
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
113
|
+
};
|
|
114
|
+
export declare function useReadPressReview<TData = Awaited<ReturnType<typeof readPressReview>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params?: ReadPressReviewParams, options?: {
|
|
115
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressReview>>, TError, TData>>;
|
|
116
|
+
request?: SecondParameter<typeof request>;
|
|
117
|
+
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
118
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
119
|
+
};
|
|
120
|
+
//#endregion
|
|
121
|
+
//# sourceMappingURL=biblio-press.d.ts.map
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { r as request } from "../client-D3kMOcIr.js";
|
|
3
|
+
import { useQuery } from "@tanstack/react-query";
|
|
4
|
+
//#region src/react/biblio-press/biblio-press.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 getListPressArticlesUrl = (params) => {
|
|
25
|
+
const normalizedParams = new URLSearchParams();
|
|
26
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
27
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
28
|
+
});
|
|
29
|
+
const stringifiedParams = normalizedParams.toString();
|
|
30
|
+
return stringifiedParams.length > 0 ? `/biblio/press-articles?${stringifiedParams}` : `/biblio/press-articles`;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Press articles, filtered (E41).
|
|
34
|
+
*
|
|
35
|
+
* ``theme_id`` unifies the legacy's two separate parameters ``themeId`` and
|
|
36
|
+
* ``themePk``, which named the same thing. ``order`` is resolved against a
|
|
37
|
+
* whitelist; anything else is ``422`` rather than a surprise ordering.
|
|
38
|
+
* @summary List Press Articles
|
|
39
|
+
*/
|
|
40
|
+
const listPressArticles = async (params, options) => {
|
|
41
|
+
return request(getListPressArticlesUrl(params), {
|
|
42
|
+
...options,
|
|
43
|
+
method: "GET"
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
const getListPressArticlesQueryKey = (params) => {
|
|
47
|
+
return [`/biblio/press-articles`, ...params ? [params] : []];
|
|
48
|
+
};
|
|
49
|
+
const getListPressArticlesQueryOptions = (params, options) => {
|
|
50
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
51
|
+
const queryKey = queryOptions?.queryKey ?? getListPressArticlesQueryKey(params);
|
|
52
|
+
const queryFn = ({ signal }) => listPressArticles(params, {
|
|
53
|
+
signal,
|
|
54
|
+
...requestOptions
|
|
55
|
+
});
|
|
56
|
+
return {
|
|
57
|
+
queryKey,
|
|
58
|
+
queryFn,
|
|
59
|
+
...queryOptions
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* @summary List Press Articles
|
|
64
|
+
*/
|
|
65
|
+
function useListPressArticles(params, options, queryClient) {
|
|
66
|
+
const queryOptions = getListPressArticlesQueryOptions(params, options);
|
|
67
|
+
const query = useQuery(queryOptions, queryClient);
|
|
68
|
+
return withQueryKey(query, queryOptions.queryKey);
|
|
69
|
+
}
|
|
70
|
+
const getReadPressArticleUrl = (articleId) => {
|
|
71
|
+
return `/biblio/press-articles/${articleId}`;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* One press article (E42). ``404`` when unknown *or* not entitled.
|
|
75
|
+
* @summary Read Press Article
|
|
76
|
+
*/
|
|
77
|
+
const readPressArticle = async (articleId, options) => {
|
|
78
|
+
return request(getReadPressArticleUrl(articleId), {
|
|
79
|
+
...options,
|
|
80
|
+
method: "GET"
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
const getReadPressArticleQueryKey = (articleId) => {
|
|
84
|
+
return [`/biblio/press-articles/${articleId}`];
|
|
85
|
+
};
|
|
86
|
+
const getReadPressArticleQueryOptions = (articleId, options) => {
|
|
87
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
88
|
+
const queryKey = queryOptions?.queryKey ?? getReadPressArticleQueryKey(articleId);
|
|
89
|
+
const queryFn = ({ signal }) => readPressArticle(articleId, {
|
|
90
|
+
signal,
|
|
91
|
+
...requestOptions
|
|
92
|
+
});
|
|
93
|
+
return {
|
|
94
|
+
queryKey,
|
|
95
|
+
queryFn,
|
|
96
|
+
enabled: articleId !== null && articleId !== void 0,
|
|
97
|
+
...queryOptions
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* @summary Read Press Article
|
|
102
|
+
*/
|
|
103
|
+
function useReadPressArticle(articleId, options, queryClient) {
|
|
104
|
+
const queryOptions = getReadPressArticleQueryOptions(articleId, options);
|
|
105
|
+
const query = useQuery(queryOptions, queryClient);
|
|
106
|
+
return withQueryKey(query, queryOptions.queryKey);
|
|
107
|
+
}
|
|
108
|
+
const getReadPressReviewUrl = (params) => {
|
|
109
|
+
const normalizedParams = new URLSearchParams();
|
|
110
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
111
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
112
|
+
});
|
|
113
|
+
const stringifiedParams = normalizedParams.toString();
|
|
114
|
+
return stringifiedParams.length > 0 ? `/biblio/press-review?${stringifiedParams}` : `/biblio/press-review`;
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* The curated press review (E43). An explicit aggregate (§5.2).
|
|
118
|
+
*
|
|
119
|
+
* New as an endpoint; the legacy composed it into two pages and never exposed
|
|
120
|
+
* it. There is no curation table, so a section is a theme and its members are
|
|
121
|
+
* that theme's most recent entitled articles — which is what the rendered page
|
|
122
|
+
* amounted to. When a real curation model appears this is the one place that has
|
|
123
|
+
* to change.
|
|
124
|
+
*
|
|
125
|
+
* A theme with nothing the caller may read is omitted rather than returned
|
|
126
|
+
* empty: an empty section is a hole in a page, and the client cannot tell
|
|
127
|
+
* "nothing new" from "not licensed".
|
|
128
|
+
* @summary Read Press Review
|
|
129
|
+
*/
|
|
130
|
+
const readPressReview = async (params, options) => {
|
|
131
|
+
return request(getReadPressReviewUrl(params), {
|
|
132
|
+
...options,
|
|
133
|
+
method: "GET"
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
const getReadPressReviewQueryKey = (params) => {
|
|
137
|
+
return [`/biblio/press-review`, ...params ? [params] : []];
|
|
138
|
+
};
|
|
139
|
+
const getReadPressReviewQueryOptions = (params, options) => {
|
|
140
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
141
|
+
const queryKey = queryOptions?.queryKey ?? getReadPressReviewQueryKey(params);
|
|
142
|
+
const queryFn = ({ signal }) => readPressReview(params, {
|
|
143
|
+
signal,
|
|
144
|
+
...requestOptions
|
|
145
|
+
});
|
|
146
|
+
return {
|
|
147
|
+
queryKey,
|
|
148
|
+
queryFn,
|
|
149
|
+
...queryOptions
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* @summary Read Press Review
|
|
154
|
+
*/
|
|
155
|
+
function useReadPressReview(params, options, queryClient) {
|
|
156
|
+
const queryOptions = getReadPressReviewQueryOptions(params, options);
|
|
157
|
+
const query = useQuery(queryOptions, queryClient);
|
|
158
|
+
return withQueryKey(query, queryOptions.queryKey);
|
|
159
|
+
}
|
|
160
|
+
//#endregion
|
|
161
|
+
export { getListPressArticlesQueryKey, getListPressArticlesQueryOptions, getListPressArticlesUrl, getReadPressArticleQueryKey, getReadPressArticleQueryOptions, getReadPressArticleUrl, getReadPressReviewQueryKey, getReadPressReviewQueryOptions, getReadPressReviewUrl, listPressArticles, readPressArticle, readPressReview, useListPressArticles, useReadPressArticle, useReadPressReview };
|
|
162
|
+
|
|
163
|
+
//# sourceMappingURL=biblio-press.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"biblio-press.js","names":[],"sources":["../../src/react/biblio-press/biblio-press.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 useQuery\n} from '@tanstack/react-query';\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseQueryOptions,\n UseQueryResult\n} from '@tanstack/react-query';\n\nimport type {\n HTTPExceptionResponse,\n ListPressArticlesParams,\n PressArticleListRead,\n PressArticleRead,\n PressReviewRead,\n ReadPressReviewParams,\n ValidationErrorResponse\n} from '../../models';\n\nimport { request } from '../../client';\nimport type { ErrorType } 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 getListPressArticlesUrl = (params?: ListPressArticlesParams,) => {\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/press-articles?${stringifiedParams}` : `/biblio/press-articles`\n}\n\n/**\n * Press articles, filtered (E41).\n *\n * ``theme_id`` unifies the legacy's two separate parameters ``themeId`` and\n * ``themePk``, which named the same thing. ``order`` is resolved against a\n * whitelist; anything else is ``422`` rather than a surprise ordering.\n * @summary List Press Articles\n */\nexport const listPressArticles = async (params?: ListPressArticlesParams, options?: Parameters<typeof request>[1]): Promise<PressArticleListRead> => {\n\n return request<PressArticleListRead>(getListPressArticlesUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getListPressArticlesQueryKey = (params?: ListPressArticlesParams,) => {\n return [\n `/biblio/press-articles`, ...(params ? [params] : [])\n ] as const;\n }\n\n\nexport const getListPressArticlesQueryOptions = <TData = Awaited<ReturnType<typeof listPressArticles>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params?: ListPressArticlesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listPressArticles>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getListPressArticlesQueryKey(params);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof listPressArticles>>> = ({ signal }) => listPressArticles(params, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listPressArticles>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ListPressArticlesQueryResult = NonNullable<Awaited<ReturnType<typeof listPressArticles>>>\nexport type ListPressArticlesQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useListPressArticles<TData = Awaited<ReturnType<typeof listPressArticles>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params: undefined | ListPressArticlesParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listPressArticles>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof listPressArticles>>,\n TError,\n Awaited<ReturnType<typeof listPressArticles>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListPressArticles<TData = Awaited<ReturnType<typeof listPressArticles>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListPressArticlesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listPressArticles>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof listPressArticles>>,\n TError,\n Awaited<ReturnType<typeof listPressArticles>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListPressArticles<TData = Awaited<ReturnType<typeof listPressArticles>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListPressArticlesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listPressArticles>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary List Press Articles\n */\n\nexport function useListPressArticles<TData = Awaited<ReturnType<typeof listPressArticles>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListPressArticlesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listPressArticles>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getListPressArticlesQueryOptions(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 getReadPressArticleUrl = (articleId: number,) => {\n\n\n\n\n return `/biblio/press-articles/${articleId}`\n}\n\n/**\n * One press article (E42). ``404`` when unknown *or* not entitled.\n * @summary Read Press Article\n */\nexport const readPressArticle = async (articleId: number, options?: Parameters<typeof request>[1]): Promise<PressArticleRead> => {\n\n return request<PressArticleRead>(getReadPressArticleUrl(articleId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getReadPressArticleQueryKey = (articleId: number,) => {\n return [\n `/biblio/press-articles/${articleId}`\n ] as const;\n }\n\n\nexport const getReadPressArticleQueryOptions = <TData = Awaited<ReturnType<typeof readPressArticle>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(articleId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressArticle>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getReadPressArticleQueryKey(articleId);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof readPressArticle>>> = ({ signal }) => readPressArticle(articleId, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, enabled: articleId !== null && articleId !== undefined, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof readPressArticle>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ReadPressArticleQueryResult = NonNullable<Awaited<ReturnType<typeof readPressArticle>>>\nexport type ReadPressArticleQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useReadPressArticle<TData = Awaited<ReturnType<typeof readPressArticle>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n articleId: number, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressArticle>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof readPressArticle>>,\n TError,\n Awaited<ReturnType<typeof readPressArticle>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadPressArticle<TData = Awaited<ReturnType<typeof readPressArticle>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n articleId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressArticle>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof readPressArticle>>,\n TError,\n Awaited<ReturnType<typeof readPressArticle>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadPressArticle<TData = Awaited<ReturnType<typeof readPressArticle>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n articleId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressArticle>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Read Press Article\n */\n\nexport function useReadPressArticle<TData = Awaited<ReturnType<typeof readPressArticle>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n articleId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressArticle>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getReadPressArticleQueryOptions(articleId,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 getReadPressReviewUrl = (params?: ReadPressReviewParams,) => {\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/press-review?${stringifiedParams}` : `/biblio/press-review`\n}\n\n/**\n * The curated press review (E43). An explicit aggregate (§5.2).\n *\n * New as an endpoint; the legacy composed it into two pages and never exposed\n * it. There is no curation table, so a section is a theme and its members are\n * that theme's most recent entitled articles — which is what the rendered page\n * amounted to. When a real curation model appears this is the one place that has\n * to change.\n *\n * A theme with nothing the caller may read is omitted rather than returned\n * empty: an empty section is a hole in a page, and the client cannot tell\n * \"nothing new\" from \"not licensed\".\n * @summary Read Press Review\n */\nexport const readPressReview = async (params?: ReadPressReviewParams, options?: Parameters<typeof request>[1]): Promise<PressReviewRead> => {\n\n return request<PressReviewRead>(getReadPressReviewUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getReadPressReviewQueryKey = (params?: ReadPressReviewParams,) => {\n return [\n `/biblio/press-review`, ...(params ? [params] : [])\n ] as const;\n }\n\n\nexport const getReadPressReviewQueryOptions = <TData = Awaited<ReturnType<typeof readPressReview>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params?: ReadPressReviewParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressReview>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getReadPressReviewQueryKey(params);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof readPressReview>>> = ({ signal }) => readPressReview(params, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof readPressReview>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ReadPressReviewQueryResult = NonNullable<Awaited<ReturnType<typeof readPressReview>>>\nexport type ReadPressReviewQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useReadPressReview<TData = Awaited<ReturnType<typeof readPressReview>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params: undefined | ReadPressReviewParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressReview>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof readPressReview>>,\n TError,\n Awaited<ReturnType<typeof readPressReview>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadPressReview<TData = Awaited<ReturnType<typeof readPressReview>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ReadPressReviewParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressReview>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof readPressReview>>,\n TError,\n Awaited<ReturnType<typeof readPressReview>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useReadPressReview<TData = Awaited<ReturnType<typeof readPressReview>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ReadPressReviewParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressReview>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Read Press Review\n */\n\nexport function useReadPressReview<TData = Awaited<ReturnType<typeof readPressReview>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ReadPressReviewParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof readPressReview>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getReadPressReviewQueryOptions(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\n"],"mappings":";;;;;;;;;;;AAwCA,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,2BAA2B,WAAsC;CAC5E,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,0BAA0B,sBAAsB;AACxF;;;;;;;;;AAUA,MAAa,oBAAoB,OAAO,QAAkC,YAA2E;CAEnJ,OAAO,QAA8B,wBAAwB,MAAM,GACnE;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAMF,MAAa,gCAAgC,WAAsC;CAC/E,OAAO,CACP,0BAA0B,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CACnD;AACA;AAGJ,MAAa,oCAAgK,QAAkC,YAC1M;CAEL,MAAM,EAAC,OAAO,cAAc,SAAS,mBAAkB,WAAW,CAAC;CAEjE,MAAM,WAAY,cAAc,YAAY,6BAA6B,MAAM;CAI7E,MAAM,WAAyE,EAAE,aAAa,kBAAkB,QAAQ;EAAE;EAAQ,GAAG;CAAe,CAAC;CAMtJ,OAAQ;EAAE;EAAU;EAAS,GAAG;CAAY;AAC/C;;;;AAkCA,SAAgB,qBACf,QAAkC,SAChC,aACiF;CAElF,MAAM,eAAe,iCAAiC,QAAO,OAAO;CAEpE,MAAM,QAAQ,SAAS,cAAc,WAAW;CAEhD,OAAO,aAAa,OAAO,aAAa,QAAQ;AAClD;AAOA,MAAa,0BAA0B,cAAuB;CAK5D,OAAO,0BAA0B;AACnC;;;;;AAMA,MAAa,mBAAmB,OAAO,WAAmB,YAAuE;CAE/H,OAAO,QAA0B,uBAAuB,SAAS,GACjE;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAMF,MAAa,+BAA+B,cAAuB;CAC/D,OAAO,CACP,0BAA0B,WAC1B;AACA;AAGJ,MAAa,mCAA8J,WAAmB,YACzL;CAEL,MAAM,EAAC,OAAO,cAAc,SAAS,mBAAkB,WAAW,CAAC;CAEjE,MAAM,WAAY,cAAc,YAAY,4BAA4B,SAAS;CAI/E,MAAM,WAAwE,EAAE,aAAa,iBAAiB,WAAW;EAAE;EAAQ,GAAG;CAAe,CAAC;CAMvJ,OAAQ;EAAE;EAAU;EAAS,SAAS,cAAc,QAAQ,cAAc,KAAA;EAAW,GAAG;CAAY;AACvG;;;;AAkCA,SAAgB,oBACf,WAAmB,SACjB,aACiF;CAElF,MAAM,eAAe,gCAAgC,WAAU,OAAO;CAEtE,MAAM,QAAQ,SAAS,cAAc,WAAW;CAEhD,OAAO,aAAa,OAAO,aAAa,QAAQ;AAClD;AAOA,MAAa,yBAAyB,WAAoC;CACxE,MAAM,mBAAmB,IAAI,gBAAgB;CAE7C,OAAO,QAAQ,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,WAAW;EAErD,IAAI,UAAU,KAAA,GACZ,iBAAiB,OAAO,KAAK,UAAU,OAAO,SAAS,OAAO,KAAK,CAAC;CAExE,CAAC;CAED,MAAM,oBAAoB,iBAAiB,SAAS;CAEpD,OAAO,kBAAkB,SAAS,IAAI,wBAAwB,sBAAsB;AACtF;;;;;;;;;;;;;;;AAgBA,MAAa,kBAAkB,OAAO,QAAgC,YAAsE;CAE1I,OAAO,QAAyB,sBAAsB,MAAM,GAC5D;EACE,GAAG;EACH,QAAQ;CAGV,CACF;AAAE;AAMF,MAAa,8BAA8B,WAAoC;CAC3E,OAAO,CACP,wBAAwB,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CACjD;AACA;AAGJ,MAAa,kCAA4J,QAAgC,YACpM;CAEL,MAAM,EAAC,OAAO,cAAc,SAAS,mBAAkB,WAAW,CAAC;CAEjE,MAAM,WAAY,cAAc,YAAY,2BAA2B,MAAM;CAI3E,MAAM,WAAuE,EAAE,aAAa,gBAAgB,QAAQ;EAAE;EAAQ,GAAG;CAAe,CAAC;CAMlJ,OAAQ;EAAE;EAAU;EAAS,GAAG;CAAY;AAC/C;;;;AAkCA,SAAgB,mBACf,QAAgC,SAC9B,aACiF;CAElF,MAAM,eAAe,+BAA+B,QAAO,OAAO;CAElE,MAAM,QAAQ,SAAS,cAAc,WAAW;CAEhD,OAAO,aAAa,OAAO,aAAa,QAAQ;AAClD"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
|
|
2
|
+
import { Gn as HTTPExceptionResponse, H as SearchResultsRead, U as SearchParams, 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, UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
|
|
5
|
+
//#region src/react/biblio-search/biblio-search.d.ts
|
|
6
|
+
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
7
|
+
export declare const getSearchUrl: (params?: SearchParams) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Search the catalogue (E46).
|
|
10
|
+
*
|
|
11
|
+
* An empty ``q`` returns an empty ``data`` with ``200``. It is not an error: a
|
|
12
|
+
* client clearing its search box should get an empty result, not a failure.
|
|
13
|
+
*
|
|
14
|
+
* An unrecognised ``type`` is ``422``, naming the families that exist.
|
|
15
|
+
* @summary Search
|
|
16
|
+
*/
|
|
17
|
+
export declare const search: (params?: SearchParams, options?: Parameters<typeof request>[1]) => Promise<SearchResultsRead>;
|
|
18
|
+
export declare const getSearchQueryKey: (params?: SearchParams) => readonly ["/biblio/search", ...SearchParams[]];
|
|
19
|
+
export declare const getSearchQueryOptions: <TData = Awaited<ReturnType<typeof search>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params?: SearchParams, options?: {
|
|
20
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof search>>, TError, TData>>;
|
|
21
|
+
request?: SecondParameter<typeof request>;
|
|
22
|
+
}) => UseQueryOptions<Awaited<ReturnType<typeof search>>, TError, TData> & {
|
|
23
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
24
|
+
};
|
|
25
|
+
export type SearchQueryResult = NonNullable<Awaited<ReturnType<typeof search>>>;
|
|
26
|
+
export type SearchQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>;
|
|
27
|
+
export declare function useSearch<TData = Awaited<ReturnType<typeof search>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params: undefined | SearchParams, options: {
|
|
28
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof search>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof search>>, TError, Awaited<ReturnType<typeof search>>>, 'initialData'>;
|
|
29
|
+
request?: SecondParameter<typeof request>;
|
|
30
|
+
}, queryClient?: QueryClient): DefinedUseQueryResult<TData, TError> & {
|
|
31
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
32
|
+
};
|
|
33
|
+
export declare function useSearch<TData = Awaited<ReturnType<typeof search>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params?: SearchParams, options?: {
|
|
34
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof search>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof search>>, TError, Awaited<ReturnType<typeof search>>>, 'initialData'>;
|
|
35
|
+
request?: SecondParameter<typeof request>;
|
|
36
|
+
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
37
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
38
|
+
};
|
|
39
|
+
export declare function useSearch<TData = Awaited<ReturnType<typeof search>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params?: SearchParams, options?: {
|
|
40
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof search>>, TError, TData>>;
|
|
41
|
+
request?: SecondParameter<typeof request>;
|
|
42
|
+
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
43
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
44
|
+
};
|
|
45
|
+
//#endregion
|
|
46
|
+
//# sourceMappingURL=biblio-search.d.ts.map
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { r as request } from "../client-D3kMOcIr.js";
|
|
3
|
+
import { useQuery } from "@tanstack/react-query";
|
|
4
|
+
//#region src/react/biblio-search/biblio-search.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 getSearchUrl = (params) => {
|
|
25
|
+
const normalizedParams = new URLSearchParams();
|
|
26
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
27
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
28
|
+
});
|
|
29
|
+
const stringifiedParams = normalizedParams.toString();
|
|
30
|
+
return stringifiedParams.length > 0 ? `/biblio/search?${stringifiedParams}` : `/biblio/search`;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Search the catalogue (E46).
|
|
34
|
+
*
|
|
35
|
+
* An empty ``q`` returns an empty ``data`` with ``200``. It is not an error: a
|
|
36
|
+
* client clearing its search box should get an empty result, not a failure.
|
|
37
|
+
*
|
|
38
|
+
* An unrecognised ``type`` is ``422``, naming the families that exist.
|
|
39
|
+
* @summary Search
|
|
40
|
+
*/
|
|
41
|
+
const search = async (params, options) => {
|
|
42
|
+
return request(getSearchUrl(params), {
|
|
43
|
+
...options,
|
|
44
|
+
method: "GET"
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
const getSearchQueryKey = (params) => {
|
|
48
|
+
return [`/biblio/search`, ...params ? [params] : []];
|
|
49
|
+
};
|
|
50
|
+
const getSearchQueryOptions = (params, options) => {
|
|
51
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
52
|
+
const queryKey = queryOptions?.queryKey ?? getSearchQueryKey(params);
|
|
53
|
+
const queryFn = ({ signal }) => search(params, {
|
|
54
|
+
signal,
|
|
55
|
+
...requestOptions
|
|
56
|
+
});
|
|
57
|
+
return {
|
|
58
|
+
queryKey,
|
|
59
|
+
queryFn,
|
|
60
|
+
...queryOptions
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* @summary Search
|
|
65
|
+
*/
|
|
66
|
+
function useSearch(params, options, queryClient) {
|
|
67
|
+
const queryOptions = getSearchQueryOptions(params, options);
|
|
68
|
+
const query = useQuery(queryOptions, queryClient);
|
|
69
|
+
return withQueryKey(query, queryOptions.queryKey);
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
72
|
+
export { getSearchQueryKey, getSearchQueryOptions, getSearchUrl, search, useSearch };
|
|
73
|
+
|
|
74
|
+
//# sourceMappingURL=biblio-search.js.map
|