@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,129 @@
|
|
|
1
|
+
|
|
2
|
+
import { Gn as HTTPExceptionResponse, S as TutoringAnswerWrite, i as TutoringRoomRead, t as ValidationErrorResponse, y as TutoringCloseWrite } from "../index-wL_20vR8.js";
|
|
3
|
+
import { a as ErrorType, c as request, n as BodyType } from "../client-BDwBZYB0.js";
|
|
4
|
+
import { QueryClient, UseMutationOptions, UseMutationResult } from "@tanstack/react-query";
|
|
5
|
+
//#region src/react/tutoring-practitioner/tutoring-practitioner.d.ts
|
|
6
|
+
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
7
|
+
export declare const getAnswerRequestUrl: (requestId: number) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Deliver the answer.
|
|
10
|
+
*
|
|
11
|
+
* The body is stored as the answer and any named attachments are re-roled to
|
|
12
|
+
* ``answer`` — they were uploaded against this request, so no id from another
|
|
13
|
+
* request can be attached here.
|
|
14
|
+
* @summary Answer Request
|
|
15
|
+
*/
|
|
16
|
+
export declare const answerRequest: (requestId: number, tutoringAnswerWrite: TutoringAnswerWrite, options?: Parameters<typeof request>[1]) => Promise<void>;
|
|
17
|
+
export declare const getAnswerRequestMutationKey: () => readonly ['answerRequest'];
|
|
18
|
+
export declare const getAnswerRequestMutationOptions: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
|
|
19
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof answerRequest>>, TError, AnswerRequestMutationVariables, TContext>;
|
|
20
|
+
request?: SecondParameter<typeof request>;
|
|
21
|
+
}) => UseMutationOptions<Awaited<ReturnType<typeof answerRequest>>, TError, AnswerRequestMutationVariables, TContext>;
|
|
22
|
+
export type AnswerRequestMutationResult = NonNullable<Awaited<ReturnType<typeof answerRequest>>>;
|
|
23
|
+
export type AnswerRequestMutationBody = BodyType<TutoringAnswerWrite>;
|
|
24
|
+
export type AnswerRequestMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>;
|
|
25
|
+
export type AnswerRequestMutationVariables = {
|
|
26
|
+
requestId: number;
|
|
27
|
+
data: BodyType<TutoringAnswerWrite>;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* @summary Answer Request
|
|
31
|
+
*/
|
|
32
|
+
export declare const useAnswerRequest: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
|
|
33
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof answerRequest>>, TError, AnswerRequestMutationVariables, TContext>;
|
|
34
|
+
request?: SecondParameter<typeof request>;
|
|
35
|
+
}, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof answerRequest>>, TError, AnswerRequestMutationVariables, TContext>;
|
|
36
|
+
export declare const getClaimRequestUrl: (requestId: number) => string;
|
|
37
|
+
/**
|
|
38
|
+
* Take a dispatched request.
|
|
39
|
+
*
|
|
40
|
+
* ``409`` if somebody else already holds it. The check and the write are one
|
|
41
|
+
* statement so that two practitioners hitting claim in the same instant cannot
|
|
42
|
+
* both win — the legacy reads then writes, so both do.
|
|
43
|
+
* @summary Claim Request
|
|
44
|
+
*/
|
|
45
|
+
export declare const claimRequest: (requestId: number, options?: Parameters<typeof request>[1]) => Promise<void>;
|
|
46
|
+
export declare const getClaimRequestMutationKey: () => readonly ['claimRequest'];
|
|
47
|
+
export declare const getClaimRequestMutationOptions: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
|
|
48
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof claimRequest>>, TError, ClaimRequestMutationVariables, TContext>;
|
|
49
|
+
request?: SecondParameter<typeof request>;
|
|
50
|
+
}) => UseMutationOptions<Awaited<ReturnType<typeof claimRequest>>, TError, ClaimRequestMutationVariables, TContext>;
|
|
51
|
+
export type ClaimRequestMutationResult = NonNullable<Awaited<ReturnType<typeof claimRequest>>>;
|
|
52
|
+
export type ClaimRequestMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>;
|
|
53
|
+
export type ClaimRequestMutationVariables = {
|
|
54
|
+
requestId: number;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* @summary Claim Request
|
|
58
|
+
*/
|
|
59
|
+
export declare const useClaimRequest: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
|
|
60
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof claimRequest>>, TError, ClaimRequestMutationVariables, TContext>;
|
|
61
|
+
request?: SecondParameter<typeof request>;
|
|
62
|
+
}, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof claimRequest>>, TError, ClaimRequestMutationVariables, TContext>;
|
|
63
|
+
export declare const getCloseRequestUrl: (requestId: number) => string;
|
|
64
|
+
/**
|
|
65
|
+
* Close a request that will not be answered, with a reason.
|
|
66
|
+
*
|
|
67
|
+
* A dispatcher's job rather than a practitioner's: giving up on a request is a
|
|
68
|
+
* decision about the queue, and the person who could not answer it is not the
|
|
69
|
+
* person who should decide nobody will.
|
|
70
|
+
* @summary Close Request
|
|
71
|
+
*/
|
|
72
|
+
export declare const closeRequest: (requestId: number, tutoringCloseWrite: TutoringCloseWrite, options?: Parameters<typeof request>[1]) => Promise<void>;
|
|
73
|
+
export declare const getCloseRequestMutationKey: () => readonly ['closeRequest'];
|
|
74
|
+
export declare const getCloseRequestMutationOptions: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
|
|
75
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof closeRequest>>, TError, CloseRequestMutationVariables, TContext>;
|
|
76
|
+
request?: SecondParameter<typeof request>;
|
|
77
|
+
}) => UseMutationOptions<Awaited<ReturnType<typeof closeRequest>>, TError, CloseRequestMutationVariables, TContext>;
|
|
78
|
+
export type CloseRequestMutationResult = NonNullable<Awaited<ReturnType<typeof closeRequest>>>;
|
|
79
|
+
export type CloseRequestMutationBody = BodyType<TutoringCloseWrite>;
|
|
80
|
+
export type CloseRequestMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>;
|
|
81
|
+
export type CloseRequestMutationVariables = {
|
|
82
|
+
requestId: number;
|
|
83
|
+
data: BodyType<TutoringCloseWrite>;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* @summary Close Request
|
|
87
|
+
*/
|
|
88
|
+
export declare const useCloseRequest: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
|
|
89
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof closeRequest>>, TError, CloseRequestMutationVariables, TContext>;
|
|
90
|
+
request?: SecondParameter<typeof request>;
|
|
91
|
+
}, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof closeRequest>>, TError, CloseRequestMutationVariables, TContext>;
|
|
92
|
+
export declare const getOpenRoomUrl: (requestId: number) => string;
|
|
93
|
+
/**
|
|
94
|
+
* Open the room for a live request. The practitioner decides when.
|
|
95
|
+
*
|
|
96
|
+
* Deliberately an explicit action rather than a side effect of claiming, which
|
|
97
|
+
* is what Prof Express does: the teacher presses a button in their own queue,
|
|
98
|
+
* and ``createTeacherVedamoClasssroom`` refuses unless a teacher is assigned.
|
|
99
|
+
* A room provisioned at dispatch is a room the pupil joins alone.
|
|
100
|
+
*
|
|
101
|
+
* Only the assigned practitioner may open it, and only once — a second call
|
|
102
|
+
* returns the room that is already open rather than provisioning another. The
|
|
103
|
+
* legacy has no such check, so pressing its button twice orphans a room the
|
|
104
|
+
* pupil may already hold a link to.
|
|
105
|
+
*
|
|
106
|
+
* ``409`` for a channel with nothing to join, and for a request nobody has
|
|
107
|
+
* claimed.
|
|
108
|
+
* @summary Open Room
|
|
109
|
+
*/
|
|
110
|
+
export declare const openRoom: (requestId: number, options?: Parameters<typeof request>[1]) => Promise<TutoringRoomRead>;
|
|
111
|
+
export declare const getOpenRoomMutationKey: () => readonly ['openRoom'];
|
|
112
|
+
export declare const getOpenRoomMutationOptions: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
|
|
113
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof openRoom>>, TError, OpenRoomMutationVariables, TContext>;
|
|
114
|
+
request?: SecondParameter<typeof request>;
|
|
115
|
+
}) => UseMutationOptions<Awaited<ReturnType<typeof openRoom>>, TError, OpenRoomMutationVariables, TContext>;
|
|
116
|
+
export type OpenRoomMutationResult = NonNullable<Awaited<ReturnType<typeof openRoom>>>;
|
|
117
|
+
export type OpenRoomMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>;
|
|
118
|
+
export type OpenRoomMutationVariables = {
|
|
119
|
+
requestId: number;
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* @summary Open Room
|
|
123
|
+
*/
|
|
124
|
+
export declare const useOpenRoom: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
|
|
125
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof openRoom>>, TError, OpenRoomMutationVariables, TContext>;
|
|
126
|
+
request?: SecondParameter<typeof request>;
|
|
127
|
+
}, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof openRoom>>, TError, OpenRoomMutationVariables, TContext>;
|
|
128
|
+
//#endregion
|
|
129
|
+
//# sourceMappingURL=tutoring-practitioner.d.ts.map
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { r as request } from "../client-D3kMOcIr.js";
|
|
3
|
+
import { useMutation } from "@tanstack/react-query";
|
|
4
|
+
//#region src/react/tutoring-practitioner/tutoring-practitioner.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 getAnswerRequestUrl = (requestId) => {
|
|
13
|
+
return `/tutoring/requests/${requestId}/answer`;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Deliver the answer.
|
|
17
|
+
*
|
|
18
|
+
* The body is stored as the answer and any named attachments are re-roled to
|
|
19
|
+
* ``answer`` — they were uploaded against this request, so no id from another
|
|
20
|
+
* request can be attached here.
|
|
21
|
+
* @summary Answer Request
|
|
22
|
+
*/
|
|
23
|
+
const answerRequest = async (requestId, tutoringAnswerWrite, options) => {
|
|
24
|
+
const getHeaders = (h) => {
|
|
25
|
+
if (!h) return {};
|
|
26
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
27
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
28
|
+
const headers = {};
|
|
29
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
30
|
+
return headers;
|
|
31
|
+
};
|
|
32
|
+
return request(getAnswerRequestUrl(requestId), {
|
|
33
|
+
...options,
|
|
34
|
+
method: "POST",
|
|
35
|
+
headers: {
|
|
36
|
+
"Content-Type": "application/json",
|
|
37
|
+
...getHeaders(options?.headers)
|
|
38
|
+
},
|
|
39
|
+
body: JSON.stringify(tutoringAnswerWrite)
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
const getAnswerRequestMutationKey = () => ["answerRequest"];
|
|
43
|
+
const getAnswerRequestMutationOptions = (options) => {
|
|
44
|
+
const mutationKey = getAnswerRequestMutationKey();
|
|
45
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : {
|
|
46
|
+
...options,
|
|
47
|
+
mutation: {
|
|
48
|
+
...options.mutation,
|
|
49
|
+
mutationKey
|
|
50
|
+
}
|
|
51
|
+
} : {
|
|
52
|
+
mutation: { mutationKey },
|
|
53
|
+
request: void 0
|
|
54
|
+
};
|
|
55
|
+
const mutationFn = (props) => {
|
|
56
|
+
const { requestId, data } = props ?? {};
|
|
57
|
+
return answerRequest(requestId, data, requestOptions);
|
|
58
|
+
};
|
|
59
|
+
return {
|
|
60
|
+
mutationFn,
|
|
61
|
+
...mutationOptions
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* @summary Answer Request
|
|
66
|
+
*/
|
|
67
|
+
const useAnswerRequest = (options, queryClient) => {
|
|
68
|
+
return useMutation(getAnswerRequestMutationOptions(options), queryClient);
|
|
69
|
+
};
|
|
70
|
+
const getClaimRequestUrl = (requestId) => {
|
|
71
|
+
return `/tutoring/requests/${requestId}/claim`;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Take a dispatched request.
|
|
75
|
+
*
|
|
76
|
+
* ``409`` if somebody else already holds it. The check and the write are one
|
|
77
|
+
* statement so that two practitioners hitting claim in the same instant cannot
|
|
78
|
+
* both win — the legacy reads then writes, so both do.
|
|
79
|
+
* @summary Claim Request
|
|
80
|
+
*/
|
|
81
|
+
const claimRequest = async (requestId, options) => {
|
|
82
|
+
return request(getClaimRequestUrl(requestId), {
|
|
83
|
+
...options,
|
|
84
|
+
method: "POST"
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
const getClaimRequestMutationKey = () => ["claimRequest"];
|
|
88
|
+
const getClaimRequestMutationOptions = (options) => {
|
|
89
|
+
const mutationKey = getClaimRequestMutationKey();
|
|
90
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : {
|
|
91
|
+
...options,
|
|
92
|
+
mutation: {
|
|
93
|
+
...options.mutation,
|
|
94
|
+
mutationKey
|
|
95
|
+
}
|
|
96
|
+
} : {
|
|
97
|
+
mutation: { mutationKey },
|
|
98
|
+
request: void 0
|
|
99
|
+
};
|
|
100
|
+
const mutationFn = (props) => {
|
|
101
|
+
const { requestId } = props ?? {};
|
|
102
|
+
return claimRequest(requestId, requestOptions);
|
|
103
|
+
};
|
|
104
|
+
return {
|
|
105
|
+
mutationFn,
|
|
106
|
+
...mutationOptions
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* @summary Claim Request
|
|
111
|
+
*/
|
|
112
|
+
const useClaimRequest = (options, queryClient) => {
|
|
113
|
+
return useMutation(getClaimRequestMutationOptions(options), queryClient);
|
|
114
|
+
};
|
|
115
|
+
const getCloseRequestUrl = (requestId) => {
|
|
116
|
+
return `/tutoring/requests/${requestId}/close`;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Close a request that will not be answered, with a reason.
|
|
120
|
+
*
|
|
121
|
+
* A dispatcher's job rather than a practitioner's: giving up on a request is a
|
|
122
|
+
* decision about the queue, and the person who could not answer it is not the
|
|
123
|
+
* person who should decide nobody will.
|
|
124
|
+
* @summary Close Request
|
|
125
|
+
*/
|
|
126
|
+
const closeRequest = async (requestId, tutoringCloseWrite, options) => {
|
|
127
|
+
const getHeaders = (h) => {
|
|
128
|
+
if (!h) return {};
|
|
129
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
130
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
131
|
+
const headers = {};
|
|
132
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
133
|
+
return headers;
|
|
134
|
+
};
|
|
135
|
+
return request(getCloseRequestUrl(requestId), {
|
|
136
|
+
...options,
|
|
137
|
+
method: "POST",
|
|
138
|
+
headers: {
|
|
139
|
+
"Content-Type": "application/json",
|
|
140
|
+
...getHeaders(options?.headers)
|
|
141
|
+
},
|
|
142
|
+
body: JSON.stringify(tutoringCloseWrite)
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
const getCloseRequestMutationKey = () => ["closeRequest"];
|
|
146
|
+
const getCloseRequestMutationOptions = (options) => {
|
|
147
|
+
const mutationKey = getCloseRequestMutationKey();
|
|
148
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : {
|
|
149
|
+
...options,
|
|
150
|
+
mutation: {
|
|
151
|
+
...options.mutation,
|
|
152
|
+
mutationKey
|
|
153
|
+
}
|
|
154
|
+
} : {
|
|
155
|
+
mutation: { mutationKey },
|
|
156
|
+
request: void 0
|
|
157
|
+
};
|
|
158
|
+
const mutationFn = (props) => {
|
|
159
|
+
const { requestId, data } = props ?? {};
|
|
160
|
+
return closeRequest(requestId, data, requestOptions);
|
|
161
|
+
};
|
|
162
|
+
return {
|
|
163
|
+
mutationFn,
|
|
164
|
+
...mutationOptions
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* @summary Close Request
|
|
169
|
+
*/
|
|
170
|
+
const useCloseRequest = (options, queryClient) => {
|
|
171
|
+
return useMutation(getCloseRequestMutationOptions(options), queryClient);
|
|
172
|
+
};
|
|
173
|
+
const getOpenRoomUrl = (requestId) => {
|
|
174
|
+
return `/tutoring/requests/${requestId}/room`;
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* Open the room for a live request. The practitioner decides when.
|
|
178
|
+
*
|
|
179
|
+
* Deliberately an explicit action rather than a side effect of claiming, which
|
|
180
|
+
* is what Prof Express does: the teacher presses a button in their own queue,
|
|
181
|
+
* and ``createTeacherVedamoClasssroom`` refuses unless a teacher is assigned.
|
|
182
|
+
* A room provisioned at dispatch is a room the pupil joins alone.
|
|
183
|
+
*
|
|
184
|
+
* Only the assigned practitioner may open it, and only once — a second call
|
|
185
|
+
* returns the room that is already open rather than provisioning another. The
|
|
186
|
+
* legacy has no such check, so pressing its button twice orphans a room the
|
|
187
|
+
* pupil may already hold a link to.
|
|
188
|
+
*
|
|
189
|
+
* ``409`` for a channel with nothing to join, and for a request nobody has
|
|
190
|
+
* claimed.
|
|
191
|
+
* @summary Open Room
|
|
192
|
+
*/
|
|
193
|
+
const openRoom = async (requestId, options) => {
|
|
194
|
+
return request(getOpenRoomUrl(requestId), {
|
|
195
|
+
...options,
|
|
196
|
+
method: "POST"
|
|
197
|
+
});
|
|
198
|
+
};
|
|
199
|
+
const getOpenRoomMutationKey = () => ["openRoom"];
|
|
200
|
+
const getOpenRoomMutationOptions = (options) => {
|
|
201
|
+
const mutationKey = getOpenRoomMutationKey();
|
|
202
|
+
const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : {
|
|
203
|
+
...options,
|
|
204
|
+
mutation: {
|
|
205
|
+
...options.mutation,
|
|
206
|
+
mutationKey
|
|
207
|
+
}
|
|
208
|
+
} : {
|
|
209
|
+
mutation: { mutationKey },
|
|
210
|
+
request: void 0
|
|
211
|
+
};
|
|
212
|
+
const mutationFn = (props) => {
|
|
213
|
+
const { requestId } = props ?? {};
|
|
214
|
+
return openRoom(requestId, requestOptions);
|
|
215
|
+
};
|
|
216
|
+
return {
|
|
217
|
+
mutationFn,
|
|
218
|
+
...mutationOptions
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
/**
|
|
222
|
+
* @summary Open Room
|
|
223
|
+
*/
|
|
224
|
+
const useOpenRoom = (options, queryClient) => {
|
|
225
|
+
return useMutation(getOpenRoomMutationOptions(options), queryClient);
|
|
226
|
+
};
|
|
227
|
+
//#endregion
|
|
228
|
+
export { answerRequest, claimRequest, closeRequest, getAnswerRequestMutationKey, getAnswerRequestMutationOptions, getAnswerRequestUrl, getClaimRequestMutationKey, getClaimRequestMutationOptions, getClaimRequestUrl, getCloseRequestMutationKey, getCloseRequestMutationOptions, getCloseRequestUrl, getOpenRoomMutationKey, getOpenRoomMutationOptions, getOpenRoomUrl, openRoom, useAnswerRequest, useClaimRequest, useCloseRequest, useOpenRoom };
|
|
229
|
+
|
|
230
|
+
//# sourceMappingURL=tutoring-practitioner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tutoring-practitioner.js","names":[],"sources":["../../src/react/tutoring-practitioner/tutoring-practitioner.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} from '@tanstack/react-query';\nimport type {\n MutationFunction,\n QueryClient,\n UseMutationOptions,\n UseMutationResult\n} from '@tanstack/react-query';\n\nimport type {\n HTTPExceptionResponse,\n TutoringAnswerWrite,\n TutoringCloseWrite,\n TutoringRoomRead,\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\nexport const getAnswerRequestUrl = (requestId: number,) => {\n\n\n\n\n return `/tutoring/requests/${requestId}/answer`\n}\n\n/**\n * Deliver the answer.\n *\n * The body is stored as the answer and any named attachments are re-roled to\n * ``answer`` — they were uploaded against this request, so no id from another\n * request can be attached here.\n * @summary Answer Request\n */\nexport const answerRequest = async (requestId: number,\n tutoringAnswerWrite: TutoringAnswerWrite, 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>(getAnswerRequestUrl(requestId),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(tutoringAnswerWrite)\n }\n);}\n\n\n\n\n\nexport const getAnswerRequestMutationKey = () => ['answerRequest'] as const;\n\nexport const getAnswerRequestMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof answerRequest>>, TError,AnswerRequestMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof answerRequest>>, TError,AnswerRequestMutationVariables, TContext> => {\n\nconst mutationKey = getAnswerRequestMutationKey();\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 answerRequest>>, AnswerRequestMutationVariables> = (props) => {\n const {requestId,data} = props ?? {};\n\n return answerRequest(requestId,data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type AnswerRequestMutationResult = NonNullable<Awaited<ReturnType<typeof answerRequest>>>\n export type AnswerRequestMutationBody = BodyType<TutoringAnswerWrite>\n export type AnswerRequestMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type AnswerRequestMutationVariables = {requestId: number;data: BodyType<TutoringAnswerWrite>}\n\n /**\n * @summary Answer Request\n */\nexport const useAnswerRequest = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof answerRequest>>, TError,AnswerRequestMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof answerRequest>>,\n TError,\n AnswerRequestMutationVariables,\n TContext\n > => {\n return useMutation(getAnswerRequestMutationOptions(options), queryClient);\n }\n export const getClaimRequestUrl = (requestId: number,) => {\n\n\n\n\n return `/tutoring/requests/${requestId}/claim`\n}\n\n/**\n * Take a dispatched request.\n *\n * ``409`` if somebody else already holds it. The check and the write are one\n * statement so that two practitioners hitting claim in the same instant cannot\n * both win — the legacy reads then writes, so both do.\n * @summary Claim Request\n */\nexport const claimRequest = async (requestId: number, options?: Parameters<typeof request>[1]): Promise<void> => {\n\n return request<void>(getClaimRequestUrl(requestId),\n {\n ...options,\n method: 'POST'\n\n\n }\n);}\n\n\n\n\n\nexport const getClaimRequestMutationKey = () => ['claimRequest'] as const;\n\nexport const getClaimRequestMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof claimRequest>>, TError,ClaimRequestMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof claimRequest>>, TError,ClaimRequestMutationVariables, TContext> => {\n\nconst mutationKey = getClaimRequestMutationKey();\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 claimRequest>>, ClaimRequestMutationVariables> = (props) => {\n const {requestId} = props ?? {};\n\n return claimRequest(requestId,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type ClaimRequestMutationResult = NonNullable<Awaited<ReturnType<typeof claimRequest>>>\n\n export type ClaimRequestMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type ClaimRequestMutationVariables = {requestId: number}\n\n /**\n * @summary Claim Request\n */\nexport const useClaimRequest = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof claimRequest>>, TError,ClaimRequestMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof claimRequest>>,\n TError,\n ClaimRequestMutationVariables,\n TContext\n > => {\n return useMutation(getClaimRequestMutationOptions(options), queryClient);\n }\n export const getCloseRequestUrl = (requestId: number,) => {\n\n\n\n\n return `/tutoring/requests/${requestId}/close`\n}\n\n/**\n * Close a request that will not be answered, with a reason.\n *\n * A dispatcher's job rather than a practitioner's: giving up on a request is a\n * decision about the queue, and the person who could not answer it is not the\n * person who should decide nobody will.\n * @summary Close Request\n */\nexport const closeRequest = async (requestId: number,\n tutoringCloseWrite: TutoringCloseWrite, 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>(getCloseRequestUrl(requestId),\n {\n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },\n body: JSON.stringify(tutoringCloseWrite)\n }\n);}\n\n\n\n\n\nexport const getCloseRequestMutationKey = () => ['closeRequest'] as const;\n\nexport const getCloseRequestMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof closeRequest>>, TError,CloseRequestMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof closeRequest>>, TError,CloseRequestMutationVariables, TContext> => {\n\nconst mutationKey = getCloseRequestMutationKey();\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 closeRequest>>, CloseRequestMutationVariables> = (props) => {\n const {requestId,data} = props ?? {};\n\n return closeRequest(requestId,data,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type CloseRequestMutationResult = NonNullable<Awaited<ReturnType<typeof closeRequest>>>\n export type CloseRequestMutationBody = BodyType<TutoringCloseWrite>\n export type CloseRequestMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type CloseRequestMutationVariables = {requestId: number;data: BodyType<TutoringCloseWrite>}\n\n /**\n * @summary Close Request\n */\nexport const useCloseRequest = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof closeRequest>>, TError,CloseRequestMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof closeRequest>>,\n TError,\n CloseRequestMutationVariables,\n TContext\n > => {\n return useMutation(getCloseRequestMutationOptions(options), queryClient);\n }\n export const getOpenRoomUrl = (requestId: number,) => {\n\n\n\n\n return `/tutoring/requests/${requestId}/room`\n}\n\n/**\n * Open the room for a live request. The practitioner decides when.\n *\n * Deliberately an explicit action rather than a side effect of claiming, which\n * is what Prof Express does: the teacher presses a button in their own queue,\n * and ``createTeacherVedamoClasssroom`` refuses unless a teacher is assigned.\n * A room provisioned at dispatch is a room the pupil joins alone.\n *\n * Only the assigned practitioner may open it, and only once — a second call\n * returns the room that is already open rather than provisioning another. The\n * legacy has no such check, so pressing its button twice orphans a room the\n * pupil may already hold a link to.\n *\n * ``409`` for a channel with nothing to join, and for a request nobody has\n * claimed.\n * @summary Open Room\n */\nexport const openRoom = async (requestId: number, options?: Parameters<typeof request>[1]): Promise<TutoringRoomRead> => {\n\n return request<TutoringRoomRead>(getOpenRoomUrl(requestId),\n {\n ...options,\n method: 'POST'\n\n\n }\n);}\n\n\n\n\n\nexport const getOpenRoomMutationKey = () => ['openRoom'] as const;\n\nexport const getOpenRoomMutationOptions = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof openRoom>>, TError,OpenRoomMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n): UseMutationOptions<Awaited<ReturnType<typeof openRoom>>, TError,OpenRoomMutationVariables, TContext> => {\n\nconst mutationKey = getOpenRoomMutationKey();\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 openRoom>>, OpenRoomMutationVariables> = (props) => {\n const {requestId} = props ?? {};\n\n return openRoom(requestId,requestOptions)\n }\n\n\n\n\n\n\n return { mutationFn, ...mutationOptions }}\n\n export type OpenRoomMutationResult = NonNullable<Awaited<ReturnType<typeof openRoom>>>\n\n export type OpenRoomMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>\n export type OpenRoomMutationVariables = {requestId: number}\n\n /**\n * @summary Open Room\n */\nexport const useOpenRoom = <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof openRoom>>, TError,OpenRoomMutationVariables, TContext>, request?: SecondParameter<typeof request>}\n , queryClient?: QueryClient): UseMutationResult<\n Awaited<ReturnType<typeof openRoom>>,\n TError,\n OpenRoomMutationVariables,\n TContext\n > => {\n return useMutation(getOpenRoomMutationOptions(options), queryClient);\n }\n"],"mappings":"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"}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
|
|
2
|
+
import { Gn as HTTPExceptionResponse, Gr as BodyUploadAttachment, a as TutoringRequestWrite, c as TutoringRequestRead, hn as ListMyRequestsParams, p as TutoringFeedbackWrite, s as TutoringRequestPage, t as ValidationErrorResponse, x as TutoringAttachmentRead } from "../index-wL_20vR8.js";
|
|
3
|
+
import { a as ErrorType, c as request, n as BodyType } from "../client-BDwBZYB0.js";
|
|
4
|
+
import { DataTag, DefinedInitialDataOptions, DefinedUseQueryResult, QueryClient, QueryKey, UndefinedInitialDataOptions, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
|
|
5
|
+
//#region src/react/tutoring-requests/tutoring-requests.d.ts
|
|
6
|
+
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
7
|
+
export declare const getListMyRequestsUrl: (params?: ListMyRequestsParams) => string;
|
|
8
|
+
/**
|
|
9
|
+
* The caller's own requests, newest first.
|
|
10
|
+
*
|
|
11
|
+
* Includes requests they submitted for a child profile, which is what the
|
|
12
|
+
* ``requested_by_id`` half of the predicate is for — a parent's list should not
|
|
13
|
+
* go empty the moment they ask on somebody else's behalf.
|
|
14
|
+
* @summary List My Requests
|
|
15
|
+
*/
|
|
16
|
+
export declare const listMyRequests: (params?: ListMyRequestsParams, options?: Parameters<typeof request>[1]) => Promise<TutoringRequestPage>;
|
|
17
|
+
export declare const getListMyRequestsQueryKey: (params?: ListMyRequestsParams) => readonly ["/tutoring/requests", ...ListMyRequestsParams[]];
|
|
18
|
+
export declare const getListMyRequestsQueryOptions: <TData = Awaited<ReturnType<typeof listMyRequests>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params?: ListMyRequestsParams, options?: {
|
|
19
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof listMyRequests>>, TError, TData>>;
|
|
20
|
+
request?: SecondParameter<typeof request>;
|
|
21
|
+
}) => UseQueryOptions<Awaited<ReturnType<typeof listMyRequests>>, TError, TData> & {
|
|
22
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
23
|
+
};
|
|
24
|
+
export type ListMyRequestsQueryResult = NonNullable<Awaited<ReturnType<typeof listMyRequests>>>;
|
|
25
|
+
export type ListMyRequestsQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>;
|
|
26
|
+
export declare function useListMyRequests<TData = Awaited<ReturnType<typeof listMyRequests>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params: undefined | ListMyRequestsParams, options: {
|
|
27
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof listMyRequests>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof listMyRequests>>, TError, Awaited<ReturnType<typeof listMyRequests>>>, 'initialData'>;
|
|
28
|
+
request?: SecondParameter<typeof request>;
|
|
29
|
+
}, queryClient?: QueryClient): DefinedUseQueryResult<TData, TError> & {
|
|
30
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
31
|
+
};
|
|
32
|
+
export declare function useListMyRequests<TData = Awaited<ReturnType<typeof listMyRequests>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params?: ListMyRequestsParams, options?: {
|
|
33
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof listMyRequests>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof listMyRequests>>, TError, Awaited<ReturnType<typeof listMyRequests>>>, 'initialData'>;
|
|
34
|
+
request?: SecondParameter<typeof request>;
|
|
35
|
+
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
36
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
37
|
+
};
|
|
38
|
+
export declare function useListMyRequests<TData = Awaited<ReturnType<typeof listMyRequests>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(params?: ListMyRequestsParams, options?: {
|
|
39
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof listMyRequests>>, TError, TData>>;
|
|
40
|
+
request?: SecondParameter<typeof request>;
|
|
41
|
+
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
42
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
43
|
+
};
|
|
44
|
+
export declare const getSubmitRequestUrl: () => string;
|
|
45
|
+
/**
|
|
46
|
+
* Ask for help.
|
|
47
|
+
*
|
|
48
|
+
* Debits the tenant's tutoring entitlement, which is what makes this a ``409``
|
|
49
|
+
* when the allowance is spent rather than a queued request nobody may answer.
|
|
50
|
+
* ``403`` from the entitlement layer is reported as ``404`` for the subject, per
|
|
51
|
+
* the convention the loan routes already follow.
|
|
52
|
+
*
|
|
53
|
+
* ``onBehalfOfId`` must name a profile of the caller. Anything else is ``403``:
|
|
54
|
+
* the legacy accepts a ``user_id`` in the body and trusts it, which is an
|
|
55
|
+
* authorization decision made by whoever wrote the client.
|
|
56
|
+
* @summary Submit Request
|
|
57
|
+
*/
|
|
58
|
+
export declare const submitRequest: (tutoringRequestWrite: TutoringRequestWrite, options?: Parameters<typeof request>[1]) => Promise<TutoringRequestRead>;
|
|
59
|
+
export declare const getSubmitRequestMutationKey: () => readonly ['submitRequest'];
|
|
60
|
+
export declare const getSubmitRequestMutationOptions: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
|
|
61
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof submitRequest>>, TError, SubmitRequestMutationVariables, TContext>;
|
|
62
|
+
request?: SecondParameter<typeof request>;
|
|
63
|
+
}) => UseMutationOptions<Awaited<ReturnType<typeof submitRequest>>, TError, SubmitRequestMutationVariables, TContext>;
|
|
64
|
+
export type SubmitRequestMutationResult = NonNullable<Awaited<ReturnType<typeof submitRequest>>>;
|
|
65
|
+
export type SubmitRequestMutationBody = BodyType<TutoringRequestWrite>;
|
|
66
|
+
export type SubmitRequestMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>;
|
|
67
|
+
export type SubmitRequestMutationVariables = {
|
|
68
|
+
data: BodyType<TutoringRequestWrite>;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* @summary Submit Request
|
|
72
|
+
*/
|
|
73
|
+
export declare const useSubmitRequest: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
|
|
74
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof submitRequest>>, TError, SubmitRequestMutationVariables, TContext>;
|
|
75
|
+
request?: SecondParameter<typeof request>;
|
|
76
|
+
}, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof submitRequest>>, TError, SubmitRequestMutationVariables, TContext>;
|
|
77
|
+
export declare const getGetRequestUrl: (requestId: number) => string;
|
|
78
|
+
/**
|
|
79
|
+
* One of the caller's own requests, with signed links to its files.
|
|
80
|
+
* @summary Get Request
|
|
81
|
+
*/
|
|
82
|
+
export declare const getRequest: (requestId: number, options?: Parameters<typeof request>[1]) => Promise<TutoringRequestRead>;
|
|
83
|
+
export declare const getGetRequestQueryKey: (requestId: number) => readonly [`/tutoring/requests/${number}`];
|
|
84
|
+
export declare const getGetRequestQueryOptions: <TData = Awaited<ReturnType<typeof getRequest>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(requestId: number, options?: {
|
|
85
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getRequest>>, TError, TData>>;
|
|
86
|
+
request?: SecondParameter<typeof request>;
|
|
87
|
+
}) => UseQueryOptions<Awaited<ReturnType<typeof getRequest>>, TError, TData> & {
|
|
88
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
89
|
+
};
|
|
90
|
+
export type GetRequestQueryResult = NonNullable<Awaited<ReturnType<typeof getRequest>>>;
|
|
91
|
+
export type GetRequestQueryError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>;
|
|
92
|
+
export declare function useGetRequest<TData = Awaited<ReturnType<typeof getRequest>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(requestId: number, options: {
|
|
93
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getRequest>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof getRequest>>, TError, Awaited<ReturnType<typeof getRequest>>>, 'initialData'>;
|
|
94
|
+
request?: SecondParameter<typeof request>;
|
|
95
|
+
}, queryClient?: QueryClient): DefinedUseQueryResult<TData, TError> & {
|
|
96
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
97
|
+
};
|
|
98
|
+
export declare function useGetRequest<TData = Awaited<ReturnType<typeof getRequest>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(requestId: number, options?: {
|
|
99
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getRequest>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof getRequest>>, TError, Awaited<ReturnType<typeof getRequest>>>, 'initialData'>;
|
|
100
|
+
request?: SecondParameter<typeof request>;
|
|
101
|
+
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
102
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
103
|
+
};
|
|
104
|
+
export declare function useGetRequest<TData = Awaited<ReturnType<typeof getRequest>>, TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>>(requestId: number, options?: {
|
|
105
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getRequest>>, TError, TData>>;
|
|
106
|
+
request?: SecondParameter<typeof request>;
|
|
107
|
+
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
108
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
109
|
+
};
|
|
110
|
+
export declare const getUploadAttachmentUrl: (requestId: number) => string;
|
|
111
|
+
/**
|
|
112
|
+
* Attach a file to a request. One per call.
|
|
113
|
+
*
|
|
114
|
+
* One per call rather than an array, deliberately. A pupil photographing four
|
|
115
|
+
* pages on a phone connection wants three of them to survive the fourth
|
|
116
|
+
* timing out, and the legacy's ``documents[]`` array is all-or-nothing — with
|
|
117
|
+
* no cap on how many, so a single request can be arbitrarily large.
|
|
118
|
+
*
|
|
119
|
+
* The role follows from who is asking: the pupil is attaching to a question,
|
|
120
|
+
* the assigned practitioner to an answer. Nobody declares it, so nobody can
|
|
121
|
+
* claim the wrong one.
|
|
122
|
+
*
|
|
123
|
+
* ``415`` for a format we do not accept, ``413`` for a file over the ceiling,
|
|
124
|
+
* ``409`` once the per-request cap is reached, and ``404`` for a request that
|
|
125
|
+
* is not the caller's.
|
|
126
|
+
* @summary Upload Attachment
|
|
127
|
+
*/
|
|
128
|
+
export declare const uploadAttachment: (requestId: number, bodyUploadAttachment: BodyUploadAttachment, options?: Parameters<typeof request>[1]) => Promise<TutoringAttachmentRead>;
|
|
129
|
+
export declare const getUploadAttachmentMutationKey: () => readonly ['uploadAttachment'];
|
|
130
|
+
export declare const getUploadAttachmentMutationOptions: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
|
|
131
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof uploadAttachment>>, TError, UploadAttachmentMutationVariables, TContext>;
|
|
132
|
+
request?: SecondParameter<typeof request>;
|
|
133
|
+
}) => UseMutationOptions<Awaited<ReturnType<typeof uploadAttachment>>, TError, UploadAttachmentMutationVariables, TContext>;
|
|
134
|
+
export type UploadAttachmentMutationResult = NonNullable<Awaited<ReturnType<typeof uploadAttachment>>>;
|
|
135
|
+
export type UploadAttachmentMutationBody = BodyType<BodyUploadAttachment>;
|
|
136
|
+
export type UploadAttachmentMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>;
|
|
137
|
+
export type UploadAttachmentMutationVariables = {
|
|
138
|
+
requestId: number;
|
|
139
|
+
data: BodyType<BodyUploadAttachment>;
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* @summary Upload Attachment
|
|
143
|
+
*/
|
|
144
|
+
export declare const useUploadAttachment: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
|
|
145
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof uploadAttachment>>, TError, UploadAttachmentMutationVariables, TContext>;
|
|
146
|
+
request?: SecondParameter<typeof request>;
|
|
147
|
+
}, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof uploadAttachment>>, TError, UploadAttachmentMutationVariables, TContext>;
|
|
148
|
+
export declare const getDeleteAttachmentUrl: (requestId: number, attachmentId: number) => string;
|
|
149
|
+
/**
|
|
150
|
+
* Remove a file the caller uploaded.
|
|
151
|
+
*
|
|
152
|
+
* Only the uploader, and only while the request is still open — a file that
|
|
153
|
+
* formed part of a delivered answer is part of the record.
|
|
154
|
+
*
|
|
155
|
+
* The object goes and the row goes with it: this is a mistaken upload being
|
|
156
|
+
* withdrawn, not a retention event. Retention is the bucket's lifecycle rule,
|
|
157
|
+
* which removes objects and leaves rows behind.
|
|
158
|
+
* @summary Delete Attachment
|
|
159
|
+
*/
|
|
160
|
+
export declare const deleteAttachment: (requestId: number, attachmentId: number, options?: Parameters<typeof request>[1]) => Promise<void>;
|
|
161
|
+
export declare const getDeleteAttachmentMutationKey: () => readonly ['deleteAttachment'];
|
|
162
|
+
export declare const getDeleteAttachmentMutationOptions: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
|
|
163
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof deleteAttachment>>, TError, DeleteAttachmentMutationVariables, TContext>;
|
|
164
|
+
request?: SecondParameter<typeof request>;
|
|
165
|
+
}) => UseMutationOptions<Awaited<ReturnType<typeof deleteAttachment>>, TError, DeleteAttachmentMutationVariables, TContext>;
|
|
166
|
+
export type DeleteAttachmentMutationResult = NonNullable<Awaited<ReturnType<typeof deleteAttachment>>>;
|
|
167
|
+
export type DeleteAttachmentMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>;
|
|
168
|
+
export type DeleteAttachmentMutationVariables = {
|
|
169
|
+
requestId: number;
|
|
170
|
+
attachmentId: number;
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* @summary Delete Attachment
|
|
174
|
+
*/
|
|
175
|
+
export declare const useDeleteAttachment: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
|
|
176
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof deleteAttachment>>, TError, DeleteAttachmentMutationVariables, TContext>;
|
|
177
|
+
request?: SecondParameter<typeof request>;
|
|
178
|
+
}, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof deleteAttachment>>, TError, DeleteAttachmentMutationVariables, TContext>;
|
|
179
|
+
export declare const getCancelRequestUrl: (requestId: number) => string;
|
|
180
|
+
/**
|
|
181
|
+
* Withdraw a request the caller asked.
|
|
182
|
+
*
|
|
183
|
+
* The debit is **not** reversed. A pupil who asks and withdraws has occupied a
|
|
184
|
+
* dispatcher's attention, and refunding it would make cancel-and-resubmit a way
|
|
185
|
+
* around the allowance. If a tenant should get the unit back, that is a credit
|
|
186
|
+
* somebody grants, which is a different act with a different audit trail.
|
|
187
|
+
* @summary Cancel Request
|
|
188
|
+
*/
|
|
189
|
+
export declare const cancelRequest: (requestId: number, options?: Parameters<typeof request>[1]) => Promise<TutoringRequestRead>;
|
|
190
|
+
export declare const getCancelRequestMutationKey: () => readonly ['cancelRequest'];
|
|
191
|
+
export declare const getCancelRequestMutationOptions: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
|
|
192
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof cancelRequest>>, TError, CancelRequestMutationVariables, TContext>;
|
|
193
|
+
request?: SecondParameter<typeof request>;
|
|
194
|
+
}) => UseMutationOptions<Awaited<ReturnType<typeof cancelRequest>>, TError, CancelRequestMutationVariables, TContext>;
|
|
195
|
+
export type CancelRequestMutationResult = NonNullable<Awaited<ReturnType<typeof cancelRequest>>>;
|
|
196
|
+
export type CancelRequestMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>;
|
|
197
|
+
export type CancelRequestMutationVariables = {
|
|
198
|
+
requestId: number;
|
|
199
|
+
};
|
|
200
|
+
/**
|
|
201
|
+
* @summary Cancel Request
|
|
202
|
+
*/
|
|
203
|
+
export declare const useCancelRequest: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
|
|
204
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof cancelRequest>>, TError, CancelRequestMutationVariables, TContext>;
|
|
205
|
+
request?: SecondParameter<typeof request>;
|
|
206
|
+
}, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof cancelRequest>>, TError, CancelRequestMutationVariables, TContext>;
|
|
207
|
+
export declare const getRateRequestUrl: (requestId: number) => string;
|
|
208
|
+
/**
|
|
209
|
+
* Rate the answer. One rating per request, enforced by the table.
|
|
210
|
+
* @summary Rate Request
|
|
211
|
+
*/
|
|
212
|
+
export declare const rateRequest: (requestId: number, tutoringFeedbackWrite: TutoringFeedbackWrite, options?: Parameters<typeof request>[1]) => Promise<void>;
|
|
213
|
+
export declare const getRateRequestMutationKey: () => readonly ['rateRequest'];
|
|
214
|
+
export declare const getRateRequestMutationOptions: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
|
|
215
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof rateRequest>>, TError, RateRequestMutationVariables, TContext>;
|
|
216
|
+
request?: SecondParameter<typeof request>;
|
|
217
|
+
}) => UseMutationOptions<Awaited<ReturnType<typeof rateRequest>>, TError, RateRequestMutationVariables, TContext>;
|
|
218
|
+
export type RateRequestMutationResult = NonNullable<Awaited<ReturnType<typeof rateRequest>>>;
|
|
219
|
+
export type RateRequestMutationBody = BodyType<TutoringFeedbackWrite>;
|
|
220
|
+
export type RateRequestMutationError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>;
|
|
221
|
+
export type RateRequestMutationVariables = {
|
|
222
|
+
requestId: number;
|
|
223
|
+
data: BodyType<TutoringFeedbackWrite>;
|
|
224
|
+
};
|
|
225
|
+
/**
|
|
226
|
+
* @summary Rate Request
|
|
227
|
+
*/
|
|
228
|
+
export declare const useRateRequest: <TError = ErrorType<HTTPExceptionResponse | ValidationErrorResponse>, TContext = unknown>(options?: {
|
|
229
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof rateRequest>>, TError, RateRequestMutationVariables, TContext>;
|
|
230
|
+
request?: SecondParameter<typeof request>;
|
|
231
|
+
}, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof rateRequest>>, TError, RateRequestMutationVariables, TContext>;
|
|
232
|
+
//#endregion
|
|
233
|
+
//# sourceMappingURL=tutoring-requests.d.ts.map
|