@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,385 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { r as request } from "../client-D3kMOcIr.js";
|
|
3
|
+
import { useMutation, useQuery } from "@tanstack/react-query";
|
|
4
|
+
//#region src/react/tutoring-requests/tutoring-requests.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 getListMyRequestsUrl = (params) => {
|
|
25
|
+
const normalizedParams = new URLSearchParams();
|
|
26
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
27
|
+
if (Array.isArray(value) && ["status"].includes(key)) {
|
|
28
|
+
value.forEach((v) => {
|
|
29
|
+
normalizedParams.append(key, v === null ? "null" : String(v));
|
|
30
|
+
});
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
34
|
+
});
|
|
35
|
+
const stringifiedParams = normalizedParams.toString();
|
|
36
|
+
return stringifiedParams.length > 0 ? `/tutoring/requests?${stringifiedParams}` : `/tutoring/requests`;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* The caller's own requests, newest first.
|
|
40
|
+
*
|
|
41
|
+
* Includes requests they submitted for a child profile, which is what the
|
|
42
|
+
* ``requested_by_id`` half of the predicate is for — a parent's list should not
|
|
43
|
+
* go empty the moment they ask on somebody else's behalf.
|
|
44
|
+
* @summary List My Requests
|
|
45
|
+
*/
|
|
46
|
+
const listMyRequests = async (params, options) => {
|
|
47
|
+
return request(getListMyRequestsUrl(params), {
|
|
48
|
+
...options,
|
|
49
|
+
method: "GET"
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
const getListMyRequestsQueryKey = (params) => {
|
|
53
|
+
return [`/tutoring/requests`, ...params ? [params] : []];
|
|
54
|
+
};
|
|
55
|
+
const getListMyRequestsQueryOptions = (params, options) => {
|
|
56
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
57
|
+
const queryKey = queryOptions?.queryKey ?? getListMyRequestsQueryKey(params);
|
|
58
|
+
const queryFn = ({ signal }) => listMyRequests(params, {
|
|
59
|
+
signal,
|
|
60
|
+
...requestOptions
|
|
61
|
+
});
|
|
62
|
+
return {
|
|
63
|
+
queryKey,
|
|
64
|
+
queryFn,
|
|
65
|
+
...queryOptions
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* @summary List My Requests
|
|
70
|
+
*/
|
|
71
|
+
function useListMyRequests(params, options, queryClient) {
|
|
72
|
+
const queryOptions = getListMyRequestsQueryOptions(params, options);
|
|
73
|
+
const query = useQuery(queryOptions, queryClient);
|
|
74
|
+
return withQueryKey(query, queryOptions.queryKey);
|
|
75
|
+
}
|
|
76
|
+
const getSubmitRequestUrl = () => {
|
|
77
|
+
return `/tutoring/requests`;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Ask for help.
|
|
81
|
+
*
|
|
82
|
+
* Debits the tenant's tutoring entitlement, which is what makes this a ``409``
|
|
83
|
+
* when the allowance is spent rather than a queued request nobody may answer.
|
|
84
|
+
* ``403`` from the entitlement layer is reported as ``404`` for the subject, per
|
|
85
|
+
* the convention the loan routes already follow.
|
|
86
|
+
*
|
|
87
|
+
* ``onBehalfOfId`` must name a profile of the caller. Anything else is ``403``:
|
|
88
|
+
* the legacy accepts a ``user_id`` in the body and trusts it, which is an
|
|
89
|
+
* authorization decision made by whoever wrote the client.
|
|
90
|
+
* @summary Submit Request
|
|
91
|
+
*/
|
|
92
|
+
const submitRequest = async (tutoringRequestWrite, options) => {
|
|
93
|
+
const getHeaders = (h) => {
|
|
94
|
+
if (!h) return {};
|
|
95
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
96
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
97
|
+
const headers = {};
|
|
98
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
99
|
+
return headers;
|
|
100
|
+
};
|
|
101
|
+
return request(getSubmitRequestUrl(), {
|
|
102
|
+
...options,
|
|
103
|
+
method: "POST",
|
|
104
|
+
headers: {
|
|
105
|
+
"Content-Type": "application/json",
|
|
106
|
+
...getHeaders(options?.headers)
|
|
107
|
+
},
|
|
108
|
+
body: JSON.stringify(tutoringRequestWrite)
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
const getSubmitRequestMutationKey = () => ["submitRequest"];
|
|
112
|
+
const getSubmitRequestMutationOptions = (options) => {
|
|
113
|
+
const mutationKey = getSubmitRequestMutationKey();
|
|
114
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : {
|
|
115
|
+
...options,
|
|
116
|
+
mutation: {
|
|
117
|
+
...options.mutation,
|
|
118
|
+
mutationKey
|
|
119
|
+
}
|
|
120
|
+
} : {
|
|
121
|
+
mutation: { mutationKey },
|
|
122
|
+
request: void 0
|
|
123
|
+
};
|
|
124
|
+
const mutationFn = (props) => {
|
|
125
|
+
const { data } = props ?? {};
|
|
126
|
+
return submitRequest(data, requestOptions);
|
|
127
|
+
};
|
|
128
|
+
return {
|
|
129
|
+
mutationFn,
|
|
130
|
+
...mutationOptions
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* @summary Submit Request
|
|
135
|
+
*/
|
|
136
|
+
const useSubmitRequest = (options, queryClient) => {
|
|
137
|
+
return useMutation(getSubmitRequestMutationOptions(options), queryClient);
|
|
138
|
+
};
|
|
139
|
+
const getGetRequestUrl = (requestId) => {
|
|
140
|
+
return `/tutoring/requests/${requestId}`;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* One of the caller's own requests, with signed links to its files.
|
|
144
|
+
* @summary Get Request
|
|
145
|
+
*/
|
|
146
|
+
const getRequest = async (requestId, options) => {
|
|
147
|
+
return request(getGetRequestUrl(requestId), {
|
|
148
|
+
...options,
|
|
149
|
+
method: "GET"
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
const getGetRequestQueryKey = (requestId) => {
|
|
153
|
+
return [`/tutoring/requests/${requestId}`];
|
|
154
|
+
};
|
|
155
|
+
const getGetRequestQueryOptions = (requestId, options) => {
|
|
156
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
157
|
+
const queryKey = queryOptions?.queryKey ?? getGetRequestQueryKey(requestId);
|
|
158
|
+
const queryFn = ({ signal }) => getRequest(requestId, {
|
|
159
|
+
signal,
|
|
160
|
+
...requestOptions
|
|
161
|
+
});
|
|
162
|
+
return {
|
|
163
|
+
queryKey,
|
|
164
|
+
queryFn,
|
|
165
|
+
enabled: requestId !== null && requestId !== void 0,
|
|
166
|
+
...queryOptions
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* @summary Get Request
|
|
171
|
+
*/
|
|
172
|
+
function useGetRequest(requestId, options, queryClient) {
|
|
173
|
+
const queryOptions = getGetRequestQueryOptions(requestId, options);
|
|
174
|
+
const query = useQuery(queryOptions, queryClient);
|
|
175
|
+
return withQueryKey(query, queryOptions.queryKey);
|
|
176
|
+
}
|
|
177
|
+
const getUploadAttachmentUrl = (requestId) => {
|
|
178
|
+
return `/tutoring/requests/${requestId}/attachments`;
|
|
179
|
+
};
|
|
180
|
+
/**
|
|
181
|
+
* Attach a file to a request. One per call.
|
|
182
|
+
*
|
|
183
|
+
* One per call rather than an array, deliberately. A pupil photographing four
|
|
184
|
+
* pages on a phone connection wants three of them to survive the fourth
|
|
185
|
+
* timing out, and the legacy's ``documents[]`` array is all-or-nothing — with
|
|
186
|
+
* no cap on how many, so a single request can be arbitrarily large.
|
|
187
|
+
*
|
|
188
|
+
* The role follows from who is asking: the pupil is attaching to a question,
|
|
189
|
+
* the assigned practitioner to an answer. Nobody declares it, so nobody can
|
|
190
|
+
* claim the wrong one.
|
|
191
|
+
*
|
|
192
|
+
* ``415`` for a format we do not accept, ``413`` for a file over the ceiling,
|
|
193
|
+
* ``409`` once the per-request cap is reached, and ``404`` for a request that
|
|
194
|
+
* is not the caller's.
|
|
195
|
+
* @summary Upload Attachment
|
|
196
|
+
*/
|
|
197
|
+
const uploadAttachment = async (requestId, bodyUploadAttachment, options) => {
|
|
198
|
+
const formData = new FormData();
|
|
199
|
+
formData.append(`file`, bodyUploadAttachment.file);
|
|
200
|
+
return request(getUploadAttachmentUrl(requestId), {
|
|
201
|
+
...options,
|
|
202
|
+
method: "POST",
|
|
203
|
+
body: formData
|
|
204
|
+
});
|
|
205
|
+
};
|
|
206
|
+
const getUploadAttachmentMutationKey = () => ["uploadAttachment"];
|
|
207
|
+
const getUploadAttachmentMutationOptions = (options) => {
|
|
208
|
+
const mutationKey = getUploadAttachmentMutationKey();
|
|
209
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : {
|
|
210
|
+
...options,
|
|
211
|
+
mutation: {
|
|
212
|
+
...options.mutation,
|
|
213
|
+
mutationKey
|
|
214
|
+
}
|
|
215
|
+
} : {
|
|
216
|
+
mutation: { mutationKey },
|
|
217
|
+
request: void 0
|
|
218
|
+
};
|
|
219
|
+
const mutationFn = (props) => {
|
|
220
|
+
const { requestId, data } = props ?? {};
|
|
221
|
+
return uploadAttachment(requestId, data, requestOptions);
|
|
222
|
+
};
|
|
223
|
+
return {
|
|
224
|
+
mutationFn,
|
|
225
|
+
...mutationOptions
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
/**
|
|
229
|
+
* @summary Upload Attachment
|
|
230
|
+
*/
|
|
231
|
+
const useUploadAttachment = (options, queryClient) => {
|
|
232
|
+
return useMutation(getUploadAttachmentMutationOptions(options), queryClient);
|
|
233
|
+
};
|
|
234
|
+
const getDeleteAttachmentUrl = (requestId, attachmentId) => {
|
|
235
|
+
return `/tutoring/requests/${requestId}/attachments/${attachmentId}`;
|
|
236
|
+
};
|
|
237
|
+
/**
|
|
238
|
+
* Remove a file the caller uploaded.
|
|
239
|
+
*
|
|
240
|
+
* Only the uploader, and only while the request is still open — a file that
|
|
241
|
+
* formed part of a delivered answer is part of the record.
|
|
242
|
+
*
|
|
243
|
+
* The object goes and the row goes with it: this is a mistaken upload being
|
|
244
|
+
* withdrawn, not a retention event. Retention is the bucket's lifecycle rule,
|
|
245
|
+
* which removes objects and leaves rows behind.
|
|
246
|
+
* @summary Delete Attachment
|
|
247
|
+
*/
|
|
248
|
+
const deleteAttachment = async (requestId, attachmentId, options) => {
|
|
249
|
+
return request(getDeleteAttachmentUrl(requestId, attachmentId), {
|
|
250
|
+
...options,
|
|
251
|
+
method: "DELETE"
|
|
252
|
+
});
|
|
253
|
+
};
|
|
254
|
+
const getDeleteAttachmentMutationKey = () => ["deleteAttachment"];
|
|
255
|
+
const getDeleteAttachmentMutationOptions = (options) => {
|
|
256
|
+
const mutationKey = getDeleteAttachmentMutationKey();
|
|
257
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : {
|
|
258
|
+
...options,
|
|
259
|
+
mutation: {
|
|
260
|
+
...options.mutation,
|
|
261
|
+
mutationKey
|
|
262
|
+
}
|
|
263
|
+
} : {
|
|
264
|
+
mutation: { mutationKey },
|
|
265
|
+
request: void 0
|
|
266
|
+
};
|
|
267
|
+
const mutationFn = (props) => {
|
|
268
|
+
const { requestId, attachmentId } = props ?? {};
|
|
269
|
+
return deleteAttachment(requestId, attachmentId, requestOptions);
|
|
270
|
+
};
|
|
271
|
+
return {
|
|
272
|
+
mutationFn,
|
|
273
|
+
...mutationOptions
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
/**
|
|
277
|
+
* @summary Delete Attachment
|
|
278
|
+
*/
|
|
279
|
+
const useDeleteAttachment = (options, queryClient) => {
|
|
280
|
+
return useMutation(getDeleteAttachmentMutationOptions(options), queryClient);
|
|
281
|
+
};
|
|
282
|
+
const getCancelRequestUrl = (requestId) => {
|
|
283
|
+
return `/tutoring/requests/${requestId}/cancel`;
|
|
284
|
+
};
|
|
285
|
+
/**
|
|
286
|
+
* Withdraw a request the caller asked.
|
|
287
|
+
*
|
|
288
|
+
* The debit is **not** reversed. A pupil who asks and withdraws has occupied a
|
|
289
|
+
* dispatcher's attention, and refunding it would make cancel-and-resubmit a way
|
|
290
|
+
* around the allowance. If a tenant should get the unit back, that is a credit
|
|
291
|
+
* somebody grants, which is a different act with a different audit trail.
|
|
292
|
+
* @summary Cancel Request
|
|
293
|
+
*/
|
|
294
|
+
const cancelRequest = async (requestId, options) => {
|
|
295
|
+
return request(getCancelRequestUrl(requestId), {
|
|
296
|
+
...options,
|
|
297
|
+
method: "POST"
|
|
298
|
+
});
|
|
299
|
+
};
|
|
300
|
+
const getCancelRequestMutationKey = () => ["cancelRequest"];
|
|
301
|
+
const getCancelRequestMutationOptions = (options) => {
|
|
302
|
+
const mutationKey = getCancelRequestMutationKey();
|
|
303
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : {
|
|
304
|
+
...options,
|
|
305
|
+
mutation: {
|
|
306
|
+
...options.mutation,
|
|
307
|
+
mutationKey
|
|
308
|
+
}
|
|
309
|
+
} : {
|
|
310
|
+
mutation: { mutationKey },
|
|
311
|
+
request: void 0
|
|
312
|
+
};
|
|
313
|
+
const mutationFn = (props) => {
|
|
314
|
+
const { requestId } = props ?? {};
|
|
315
|
+
return cancelRequest(requestId, requestOptions);
|
|
316
|
+
};
|
|
317
|
+
return {
|
|
318
|
+
mutationFn,
|
|
319
|
+
...mutationOptions
|
|
320
|
+
};
|
|
321
|
+
};
|
|
322
|
+
/**
|
|
323
|
+
* @summary Cancel Request
|
|
324
|
+
*/
|
|
325
|
+
const useCancelRequest = (options, queryClient) => {
|
|
326
|
+
return useMutation(getCancelRequestMutationOptions(options), queryClient);
|
|
327
|
+
};
|
|
328
|
+
const getRateRequestUrl = (requestId) => {
|
|
329
|
+
return `/tutoring/requests/${requestId}/feedback`;
|
|
330
|
+
};
|
|
331
|
+
/**
|
|
332
|
+
* Rate the answer. One rating per request, enforced by the table.
|
|
333
|
+
* @summary Rate Request
|
|
334
|
+
*/
|
|
335
|
+
const rateRequest = async (requestId, tutoringFeedbackWrite, options) => {
|
|
336
|
+
const getHeaders = (h) => {
|
|
337
|
+
if (!h) return {};
|
|
338
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
339
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
340
|
+
const headers = {};
|
|
341
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
342
|
+
return headers;
|
|
343
|
+
};
|
|
344
|
+
return request(getRateRequestUrl(requestId), {
|
|
345
|
+
...options,
|
|
346
|
+
method: "POST",
|
|
347
|
+
headers: {
|
|
348
|
+
"Content-Type": "application/json",
|
|
349
|
+
...getHeaders(options?.headers)
|
|
350
|
+
},
|
|
351
|
+
body: JSON.stringify(tutoringFeedbackWrite)
|
|
352
|
+
});
|
|
353
|
+
};
|
|
354
|
+
const getRateRequestMutationKey = () => ["rateRequest"];
|
|
355
|
+
const getRateRequestMutationOptions = (options) => {
|
|
356
|
+
const mutationKey = getRateRequestMutationKey();
|
|
357
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : {
|
|
358
|
+
...options,
|
|
359
|
+
mutation: {
|
|
360
|
+
...options.mutation,
|
|
361
|
+
mutationKey
|
|
362
|
+
}
|
|
363
|
+
} : {
|
|
364
|
+
mutation: { mutationKey },
|
|
365
|
+
request: void 0
|
|
366
|
+
};
|
|
367
|
+
const mutationFn = (props) => {
|
|
368
|
+
const { requestId, data } = props ?? {};
|
|
369
|
+
return rateRequest(requestId, data, requestOptions);
|
|
370
|
+
};
|
|
371
|
+
return {
|
|
372
|
+
mutationFn,
|
|
373
|
+
...mutationOptions
|
|
374
|
+
};
|
|
375
|
+
};
|
|
376
|
+
/**
|
|
377
|
+
* @summary Rate Request
|
|
378
|
+
*/
|
|
379
|
+
const useRateRequest = (options, queryClient) => {
|
|
380
|
+
return useMutation(getRateRequestMutationOptions(options), queryClient);
|
|
381
|
+
};
|
|
382
|
+
//#endregion
|
|
383
|
+
export { cancelRequest, deleteAttachment, getCancelRequestMutationKey, getCancelRequestMutationOptions, getCancelRequestUrl, getDeleteAttachmentMutationKey, getDeleteAttachmentMutationOptions, getDeleteAttachmentUrl, getGetRequestQueryKey, getGetRequestQueryOptions, getGetRequestUrl, getListMyRequestsQueryKey, getListMyRequestsQueryOptions, getListMyRequestsUrl, getRateRequestMutationKey, getRateRequestMutationOptions, getRateRequestUrl, getRequest, getSubmitRequestMutationKey, getSubmitRequestMutationOptions, getSubmitRequestUrl, getUploadAttachmentMutationKey, getUploadAttachmentMutationOptions, getUploadAttachmentUrl, listMyRequests, rateRequest, submitRequest, uploadAttachment, useCancelRequest, useDeleteAttachment, useGetRequest, useListMyRequests, useRateRequest, useSubmitRequest, useUploadAttachment };
|
|
384
|
+
|
|
385
|
+
//# sourceMappingURL=tutoring-requests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tutoring-requests.js","names":[],"sources":["../../src/react/tutoring-requests/tutoring-requests.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 BodyUploadAttachment,\n HTTPExceptionResponse,\n ListMyRequestsParams,\n TutoringAttachmentRead,\n TutoringFeedbackWrite,\n TutoringRequestPage,\n TutoringRequestRead,\n TutoringRequestWrite,\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 getListMyRequestsUrl = (params?: ListMyRequestsParams,) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n const explodeParameters = [\"status\"];\n\n if (Array.isArray(value) && explodeParameters.includes(key)) {\n value.forEach((v) => {\n normalizedParams.append(key, v === null ? 'null' : String(v));\n });\n return;\n }\n\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : String(value))\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/tutoring/requests?${stringifiedParams}` : `/tutoring/requests`\n}\n\n/**\n * The caller's own requests, newest first.\n *\n * Includes requests they submitted for a child profile, which is what the\n * ``requested_by_id`` half of the predicate is for — a parent's list should not\n * go empty the moment they ask on somebody else's behalf.\n * @summary List My Requests\n */\nexport const listMyRequests = async (params?: ListMyRequestsParams, options?: Parameters<typeof request>[1]): Promise<TutoringRequestPage> => {\n\n return request<TutoringRequestPage>(getListMyRequestsUrl(params),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getListMyRequestsQueryKey = (params?: ListMyRequestsParams,) => {\n return [\n `/tutoring/requests`, ...(params ? [params] : [])\n ] as const;\n }\n\n\nexport const getListMyRequestsQueryOptions = <TData = Awaited<ReturnType<typeof listMyRequests>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params?: ListMyRequestsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listMyRequests>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getListMyRequestsQueryKey(params);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof listMyRequests>>> = ({ signal }) => listMyRequests(params, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listMyRequests>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type ListMyRequestsQueryResult = NonNullable<Awaited<ReturnType<typeof listMyRequests>>>\nexport type ListMyRequestsQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useListMyRequests<TData = Awaited<ReturnType<typeof listMyRequests>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params: undefined | ListMyRequestsParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listMyRequests>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof listMyRequests>>,\n TError,\n Awaited<ReturnType<typeof listMyRequests>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListMyRequests<TData = Awaited<ReturnType<typeof listMyRequests>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListMyRequestsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listMyRequests>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof listMyRequests>>,\n TError,\n Awaited<ReturnType<typeof listMyRequests>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useListMyRequests<TData = Awaited<ReturnType<typeof listMyRequests>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListMyRequestsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listMyRequests>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary List My Requests\n */\n\nexport function useListMyRequests<TData = Awaited<ReturnType<typeof listMyRequests>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n params?: ListMyRequestsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listMyRequests>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getListMyRequestsQueryOptions(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 getSubmitRequestUrl = () => {\n\n\n\n\n return `/tutoring/requests`\n}\n\n/**\n * Ask for help.\n *\n * Debits the tenant's tutoring entitlement, which is what makes this a ``409``\n * when the allowance is spent rather than a queued request nobody may answer.\n * ``403`` from the entitlement layer is reported as ``404`` for the subject, per\n * the convention the loan routes already follow.\n *\n * ``onBehalfOfId`` must name a profile of the caller. Anything else is ``403``:\n * the legacy accepts a ``user_id`` in the body and trusts it, which is an\n * authorization decision made by whoever wrote the client.\n * @summary Submit Request\n */\nexport const submitRequest = async (tutoringRequestWrite: TutoringRequestWrite, options?: Parameters<typeof request>[1]): Promise<TutoringRequestRead> => {\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<TutoringRequestRead>(getSubmitRequestUrl(),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(tutoringRequestWrite)\n }\n);}\n\n\n\n\n\nexport const getSubmitRequestMutationKey = () => ['submitRequest'] as const;\n\nexport const getSubmitRequestMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof submitRequest>>, TError,SubmitRequestMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof submitRequest>>, TError,SubmitRequestMutationVariables, TContext> => {\n\nconst mutationKey = getSubmitRequestMutationKey();\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 submitRequest>>, SubmitRequestMutationVariables> = (props) => {\n const {data} = props ?? {};\n\n return submitRequest(data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type SubmitRequestMutationResult = NonNullable<Awaited<ReturnType<typeof submitRequest>>>\n export type SubmitRequestMutationBody = BodyType<TutoringRequestWrite>\n export type SubmitRequestMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type SubmitRequestMutationVariables = {data: BodyType<TutoringRequestWrite>}\n\n /**\n * @summary Submit Request\n */\nexport const useSubmitRequest = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof submitRequest>>, TError,SubmitRequestMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof submitRequest>>,\n TError,\n SubmitRequestMutationVariables,\n TContext\n > => {\n return useMutation(getSubmitRequestMutationOptions(options), queryClient);\n }\n export const getGetRequestUrl = (requestId: number,) => {\n\n\n\n\n return `/tutoring/requests/${requestId}`\n}\n\n/**\n * One of the caller's own requests, with signed links to its files.\n * @summary Get Request\n */\nexport const getRequest = async (requestId: number, options?: Parameters<typeof request>[1]): Promise<TutoringRequestRead> => {\n\n return request<TutoringRequestRead>(getGetRequestUrl(requestId),\n {\n ...options,\n method: 'GET'\n\n\n }\n);}\n\n\n\n\n\nexport const getGetRequestQueryKey = (requestId: number,) => {\n return [\n `/tutoring/requests/${requestId}`\n ] as const;\n }\n\n\nexport const getGetRequestQueryOptions = <TData = Awaited<ReturnType<typeof getRequest>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(requestId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getRequest>>, TError, TData>>, request?: SecondParameter<typeof request>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetRequestQueryKey(requestId);\n\n\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getRequest>>> = ({ signal }) => getRequest(requestId, { signal, ...requestOptions });\n\n\n\n\n\n return { queryKey, queryFn, enabled: requestId !== null && requestId !== undefined, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getRequest>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type GetRequestQueryResult = NonNullable<Awaited<ReturnType<typeof getRequest>>>\nexport type GetRequestQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n\n\nexport function useGetRequest<TData = Awaited<ReturnType<typeof getRequest>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n requestId: number, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getRequest>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getRequest>>,\n TError,\n Awaited<ReturnType<typeof getRequest>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetRequest<TData = Awaited<ReturnType<typeof getRequest>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n requestId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getRequest>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getRequest>>,\n TError,\n Awaited<ReturnType<typeof getRequest>>\n > , 'initialData'\n >, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetRequest<TData = Awaited<ReturnType<typeof getRequest>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n requestId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getRequest>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Get Request\n */\n\nexport function useGetRequest<TData = Awaited<ReturnType<typeof getRequest>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(\n requestId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getRequest>>, TError, TData>>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getGetRequestQueryOptions(requestId,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 getUploadAttachmentUrl = (requestId: number,) => {\n\n\n\n\n return `/tutoring/requests/${requestId}/attachments`\n}\n\n/**\n * Attach a file to a request. One per call.\n *\n * One per call rather than an array, deliberately. A pupil photographing four\n * pages on a phone connection wants three of them to survive the fourth\n * timing out, and the legacy's ``documents[]`` array is all-or-nothing — with\n * no cap on how many, so a single request can be arbitrarily large.\n *\n * The role follows from who is asking: the pupil is attaching to a question,\n * the assigned practitioner to an answer. Nobody declares it, so nobody can\n * claim the wrong one.\n *\n * ``415`` for a format we do not accept, ``413`` for a file over the ceiling,\n * ``409`` once the per-request cap is reached, and ``404`` for a request that\n * is not the caller's.\n * @summary Upload Attachment\n */\nexport const uploadAttachment = async (requestId: number,\n bodyUploadAttachment: BodyUploadAttachment, options?: Parameters<typeof request>[1]): Promise<TutoringAttachmentRead> => {\n const formData = new FormData();\nformData.append(`file`, bodyUploadAttachment.file);\n\n return request<TutoringAttachmentRead>(getUploadAttachmentUrl(requestId),\n {\n ...options,\n method: 'POST'\n ,\n body: formData\n }\n);}\n\n\n\n\n\nexport const getUploadAttachmentMutationKey = () => ['uploadAttachment'] as const;\n\nexport const getUploadAttachmentMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof uploadAttachment>>, TError,UploadAttachmentMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof uploadAttachment>>, TError,UploadAttachmentMutationVariables, TContext> => {\n\nconst mutationKey = getUploadAttachmentMutationKey();\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 uploadAttachment>>, UploadAttachmentMutationVariables> = (props) => {\n const {requestId,data} = props ?? {};\n\n return uploadAttachment(requestId,data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type UploadAttachmentMutationResult = NonNullable<Awaited<ReturnType<typeof uploadAttachment>>>\n export type UploadAttachmentMutationBody = BodyType<BodyUploadAttachment>\n export type UploadAttachmentMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type UploadAttachmentMutationVariables = {requestId: number;data: BodyType<BodyUploadAttachment>}\n\n /**\n * @summary Upload Attachment\n */\nexport const useUploadAttachment = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof uploadAttachment>>, TError,UploadAttachmentMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof uploadAttachment>>,\n TError,\n UploadAttachmentMutationVariables,\n TContext\n > => {\n return useMutation(getUploadAttachmentMutationOptions(options), queryClient);\n }\n export const getDeleteAttachmentUrl = (requestId: number,\n attachmentId: number,) => {\n\n\n\n\n return `/tutoring/requests/${requestId}/attachments/${attachmentId}`\n}\n\n/**\n * Remove a file the caller uploaded.\n *\n * Only the uploader, and only while the request is still open — a file that\n * formed part of a delivered answer is part of the record.\n *\n * The object goes and the row goes with it: this is a mistaken upload being\n * withdrawn, not a retention event. Retention is the bucket's lifecycle rule,\n * which removes objects and leaves rows behind.\n * @summary Delete Attachment\n */\nexport const deleteAttachment = async (requestId: number,\n attachmentId: number, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getDeleteAttachmentUrl(requestId,attachmentId),\n {\n ...options,\n method: 'DELETE'\n\n\n }\n);}\n\n\n\n\n\nexport const getDeleteAttachmentMutationKey = () => ['deleteAttachment'] as const;\n\nexport const getDeleteAttachmentMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteAttachment>>, TError,DeleteAttachmentMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof deleteAttachment>>, TError,DeleteAttachmentMutationVariables, TContext> => {\n\nconst mutationKey = getDeleteAttachmentMutationKey();\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 deleteAttachment>>, DeleteAttachmentMutationVariables> = (props) => {\n const {requestId,attachmentId} = props ?? {};\n\n return deleteAttachment(requestId,attachmentId,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DeleteAttachmentMutationResult = NonNullable<Awaited<ReturnType<typeof deleteAttachment>>>\n\n export type DeleteAttachmentMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type DeleteAttachmentMutationVariables = {requestId: number;attachmentId: number}\n\n /**\n * @summary Delete Attachment\n */\nexport const useDeleteAttachment = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteAttachment>>, TError,DeleteAttachmentMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof deleteAttachment>>,\n TError,\n DeleteAttachmentMutationVariables,\n TContext\n > => {\n return useMutation(getDeleteAttachmentMutationOptions(options), queryClient);\n }\n export const getCancelRequestUrl = (requestId: number,) => {\n\n\n\n\n return `/tutoring/requests/${requestId}/cancel`\n}\n\n/**\n * Withdraw a request the caller asked.\n *\n * The debit is **not** reversed. A pupil who asks and withdraws has occupied a\n * dispatcher's attention, and refunding it would make cancel-and-resubmit a way\n * around the allowance. If a tenant should get the unit back, that is a credit\n * somebody grants, which is a different act with a different audit trail.\n * @summary Cancel Request\n */\nexport const cancelRequest = async (requestId: number, options?: Parameters<typeof request>[1]): Promise<TutoringRequestRead> => {\n\n return request<TutoringRequestRead>(getCancelRequestUrl(requestId),\n {\n ...options,\n method: 'POST'\n\n\n }\n);}\n\n\n\n\n\nexport const getCancelRequestMutationKey = () => ['cancelRequest'] as const;\n\nexport const getCancelRequestMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof cancelRequest>>, TError,CancelRequestMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof cancelRequest>>, TError,CancelRequestMutationVariables, TContext> => {\n\nconst mutationKey = getCancelRequestMutationKey();\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 cancelRequest>>, CancelRequestMutationVariables> = (props) => {\n const {requestId} = props ?? {};\n\n return cancelRequest(requestId,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type CancelRequestMutationResult = NonNullable<Awaited<ReturnType<typeof cancelRequest>>>\n\n export type CancelRequestMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type CancelRequestMutationVariables = {requestId: number}\n\n /**\n * @summary Cancel Request\n */\nexport const useCancelRequest = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof cancelRequest>>, TError,CancelRequestMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof cancelRequest>>,\n TError,\n CancelRequestMutationVariables,\n TContext\n > => {\n return useMutation(getCancelRequestMutationOptions(options), queryClient);\n }\n export const getRateRequestUrl = (requestId: number,) => {\n\n\n\n\n return `/tutoring/requests/${requestId}/feedback`\n}\n\n/**\n * Rate the answer. One rating per request, enforced by the table.\n * @summary Rate Request\n */\nexport const rateRequest = async (requestId: number,\n tutoringFeedbackWrite: TutoringFeedbackWrite, 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>(getRateRequestUrl(requestId),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(tutoringFeedbackWrite)\n }\n);}\n\n\n\n\n\nexport const getRateRequestMutationKey = () => ['rateRequest'] as const;\n\nexport const getRateRequestMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof rateRequest>>, TError,RateRequestMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof rateRequest>>, TError,RateRequestMutationVariables, TContext> => {\n\nconst mutationKey = getRateRequestMutationKey();\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 rateRequest>>, RateRequestMutationVariables> = (props) => {\n const {requestId,data} = props ?? {};\n\n return rateRequest(requestId,data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type RateRequestMutationResult = NonNullable<Awaited<ReturnType<typeof rateRequest>>>\n export type RateRequestMutationBody = BodyType<TutoringFeedbackWrite>\n export type RateRequestMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type RateRequestMutationVariables = {requestId: number;data: BodyType<TutoringFeedbackWrite>}\n\n /**\n * @summary Rate Request\n */\nexport const useRateRequest = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof rateRequest>>, TError,RateRequestMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof rateRequest>>,\n TError,\n RateRequestMutationVariables,\n TContext\n > => {\n return useMutation(getRateRequestMutationOptions(options), queryClient);\n }\n"],"mappings":";;;;;;;;;;;AA8CA,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,O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kC,CAAC,aAAa;AAE7D,MAAa,iCACW,YACyF;CAEjH,MAAM,cAAc,0BAA0B;CAC9C,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,cAAuG,UAAU;EACnH,MAAM,EAAC,WAAU,SAAQ,SAAS,CAAC;EAEnC,OAAQ,YAAY,WAAU,MAAK,cAAc;CACnD;CAON,OAAQ;EAAE;EAAY,GAAG;CAAgB;AAAC;;;;AAU5C,MAAa,kBACW,SACrB,gBAKQ;CACL,OAAO,YAAY,8BAA8B,OAAO,GAAG,WAAW;AACxE"}
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@learnorama/mozaik-sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Typed Mozaik API client and optional TanStack Query hooks.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "UNLICENSED",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/Mozaik-co/backend.git",
|
|
10
|
+
"directory": "sdk"
|
|
11
|
+
},
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"files": [
|
|
14
|
+
"dist",
|
|
15
|
+
"README.md"
|
|
16
|
+
],
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./models": {
|
|
23
|
+
"types": "./dist/models.d.ts",
|
|
24
|
+
"import": "./dist/models.js"
|
|
25
|
+
},
|
|
26
|
+
"./api/*": {
|
|
27
|
+
"types": "./dist/api/*.d.ts",
|
|
28
|
+
"import": "./dist/api/*.js"
|
|
29
|
+
},
|
|
30
|
+
"./react/*": {
|
|
31
|
+
"types": "./dist/react/*.d.ts",
|
|
32
|
+
"import": "./dist/react/*.js"
|
|
33
|
+
},
|
|
34
|
+
"./package.json": "./package.json"
|
|
35
|
+
},
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public",
|
|
38
|
+
"registry": "https://registry.npmjs.org/",
|
|
39
|
+
"provenance": false
|
|
40
|
+
},
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "tsdown",
|
|
43
|
+
"test": "node --test tests/*.test.mjs",
|
|
44
|
+
"prepublishOnly": "npm run test"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"react": "^18.3.0 || ^19.0.0",
|
|
48
|
+
"@tanstack/react-query": "^5.102.8"
|
|
49
|
+
},
|
|
50
|
+
"peerDependenciesMeta": {
|
|
51
|
+
"react": {
|
|
52
|
+
"optional": true
|
|
53
|
+
},
|
|
54
|
+
"@tanstack/react-query": {
|
|
55
|
+
"optional": true
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|