Add Tailwind + shadcn UI primitives; add React Query + Orval client
This commit is contained in:
304
frontend/src/api/generated/work/work.ts
Normal file
304
frontend/src/api/generated/work/work.ts
Normal file
@@ -0,0 +1,304 @@
|
||||
/**
|
||||
* Generated by orval v8.2.0 🍺
|
||||
* Do not edit manually.
|
||||
* OpenClaw Agency API
|
||||
* OpenAPI spec version: 0.3.0
|
||||
*/
|
||||
import type {
|
||||
HTTPValidationError,
|
||||
ListTaskCommentsTaskCommentsGetParams,
|
||||
ListTasksTasksGetParams,
|
||||
Task,
|
||||
TaskComment,
|
||||
TaskCommentCreate,
|
||||
TaskCreate,
|
||||
TaskUpdate,
|
||||
} from ".././model";
|
||||
|
||||
import { customFetch } from "../../mutator";
|
||||
|
||||
/**
|
||||
* @summary List Tasks
|
||||
*/
|
||||
export type listTasksTasksGetResponse200 = {
|
||||
data: Task[];
|
||||
status: 200;
|
||||
};
|
||||
|
||||
export type listTasksTasksGetResponse422 = {
|
||||
data: HTTPValidationError;
|
||||
status: 422;
|
||||
};
|
||||
|
||||
export type listTasksTasksGetResponseSuccess = listTasksTasksGetResponse200 & {
|
||||
headers: Headers;
|
||||
};
|
||||
export type listTasksTasksGetResponseError = listTasksTasksGetResponse422 & {
|
||||
headers: Headers;
|
||||
};
|
||||
|
||||
export type listTasksTasksGetResponse =
|
||||
| listTasksTasksGetResponseSuccess
|
||||
| listTasksTasksGetResponseError;
|
||||
|
||||
export const getListTasksTasksGetUrl = (params?: ListTasksTasksGetParams) => {
|
||||
const normalizedParams = new URLSearchParams();
|
||||
|
||||
Object.entries(params || {}).forEach(([key, value]) => {
|
||||
if (value !== undefined) {
|
||||
normalizedParams.append(key, value === null ? "null" : value.toString());
|
||||
}
|
||||
});
|
||||
|
||||
const stringifiedParams = normalizedParams.toString();
|
||||
|
||||
return stringifiedParams.length > 0
|
||||
? `/tasks?${stringifiedParams}`
|
||||
: `/tasks`;
|
||||
};
|
||||
|
||||
export const listTasksTasksGet = async (
|
||||
params?: ListTasksTasksGetParams,
|
||||
options?: RequestInit,
|
||||
): Promise<listTasksTasksGetResponse> => {
|
||||
return customFetch<listTasksTasksGetResponse>(
|
||||
getListTasksTasksGetUrl(params),
|
||||
{
|
||||
...options,
|
||||
method: "GET",
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* @summary Create Task
|
||||
*/
|
||||
export type createTaskTasksPostResponse200 = {
|
||||
data: Task;
|
||||
status: 200;
|
||||
};
|
||||
|
||||
export type createTaskTasksPostResponse422 = {
|
||||
data: HTTPValidationError;
|
||||
status: 422;
|
||||
};
|
||||
|
||||
export type createTaskTasksPostResponseSuccess =
|
||||
createTaskTasksPostResponse200 & {
|
||||
headers: Headers;
|
||||
};
|
||||
export type createTaskTasksPostResponseError =
|
||||
createTaskTasksPostResponse422 & {
|
||||
headers: Headers;
|
||||
};
|
||||
|
||||
export type createTaskTasksPostResponse =
|
||||
| createTaskTasksPostResponseSuccess
|
||||
| createTaskTasksPostResponseError;
|
||||
|
||||
export const getCreateTaskTasksPostUrl = () => {
|
||||
return `/tasks`;
|
||||
};
|
||||
|
||||
export const createTaskTasksPost = async (
|
||||
taskCreate: TaskCreate,
|
||||
options?: RequestInit,
|
||||
): Promise<createTaskTasksPostResponse> => {
|
||||
return customFetch<createTaskTasksPostResponse>(getCreateTaskTasksPostUrl(), {
|
||||
...options,
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json", ...options?.headers },
|
||||
body: JSON.stringify(taskCreate),
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* @summary Update Task
|
||||
*/
|
||||
export type updateTaskTasksTaskIdPatchResponse200 = {
|
||||
data: Task;
|
||||
status: 200;
|
||||
};
|
||||
|
||||
export type updateTaskTasksTaskIdPatchResponse422 = {
|
||||
data: HTTPValidationError;
|
||||
status: 422;
|
||||
};
|
||||
|
||||
export type updateTaskTasksTaskIdPatchResponseSuccess =
|
||||
updateTaskTasksTaskIdPatchResponse200 & {
|
||||
headers: Headers;
|
||||
};
|
||||
export type updateTaskTasksTaskIdPatchResponseError =
|
||||
updateTaskTasksTaskIdPatchResponse422 & {
|
||||
headers: Headers;
|
||||
};
|
||||
|
||||
export type updateTaskTasksTaskIdPatchResponse =
|
||||
| updateTaskTasksTaskIdPatchResponseSuccess
|
||||
| updateTaskTasksTaskIdPatchResponseError;
|
||||
|
||||
export const getUpdateTaskTasksTaskIdPatchUrl = (taskId: number) => {
|
||||
return `/tasks/${taskId}`;
|
||||
};
|
||||
|
||||
export const updateTaskTasksTaskIdPatch = async (
|
||||
taskId: number,
|
||||
taskUpdate: TaskUpdate,
|
||||
options?: RequestInit,
|
||||
): Promise<updateTaskTasksTaskIdPatchResponse> => {
|
||||
return customFetch<updateTaskTasksTaskIdPatchResponse>(
|
||||
getUpdateTaskTasksTaskIdPatchUrl(taskId),
|
||||
{
|
||||
...options,
|
||||
method: "PATCH",
|
||||
headers: { "Content-Type": "application/json", ...options?.headers },
|
||||
body: JSON.stringify(taskUpdate),
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* @summary Delete Task
|
||||
*/
|
||||
export type deleteTaskTasksTaskIdDeleteResponse200 = {
|
||||
data: unknown;
|
||||
status: 200;
|
||||
};
|
||||
|
||||
export type deleteTaskTasksTaskIdDeleteResponse422 = {
|
||||
data: HTTPValidationError;
|
||||
status: 422;
|
||||
};
|
||||
|
||||
export type deleteTaskTasksTaskIdDeleteResponseSuccess =
|
||||
deleteTaskTasksTaskIdDeleteResponse200 & {
|
||||
headers: Headers;
|
||||
};
|
||||
export type deleteTaskTasksTaskIdDeleteResponseError =
|
||||
deleteTaskTasksTaskIdDeleteResponse422 & {
|
||||
headers: Headers;
|
||||
};
|
||||
|
||||
export type deleteTaskTasksTaskIdDeleteResponse =
|
||||
| deleteTaskTasksTaskIdDeleteResponseSuccess
|
||||
| deleteTaskTasksTaskIdDeleteResponseError;
|
||||
|
||||
export const getDeleteTaskTasksTaskIdDeleteUrl = (taskId: number) => {
|
||||
return `/tasks/${taskId}`;
|
||||
};
|
||||
|
||||
export const deleteTaskTasksTaskIdDelete = async (
|
||||
taskId: number,
|
||||
options?: RequestInit,
|
||||
): Promise<deleteTaskTasksTaskIdDeleteResponse> => {
|
||||
return customFetch<deleteTaskTasksTaskIdDeleteResponse>(
|
||||
getDeleteTaskTasksTaskIdDeleteUrl(taskId),
|
||||
{
|
||||
...options,
|
||||
method: "DELETE",
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* @summary List Task Comments
|
||||
*/
|
||||
export type listTaskCommentsTaskCommentsGetResponse200 = {
|
||||
data: TaskComment[];
|
||||
status: 200;
|
||||
};
|
||||
|
||||
export type listTaskCommentsTaskCommentsGetResponse422 = {
|
||||
data: HTTPValidationError;
|
||||
status: 422;
|
||||
};
|
||||
|
||||
export type listTaskCommentsTaskCommentsGetResponseSuccess =
|
||||
listTaskCommentsTaskCommentsGetResponse200 & {
|
||||
headers: Headers;
|
||||
};
|
||||
export type listTaskCommentsTaskCommentsGetResponseError =
|
||||
listTaskCommentsTaskCommentsGetResponse422 & {
|
||||
headers: Headers;
|
||||
};
|
||||
|
||||
export type listTaskCommentsTaskCommentsGetResponse =
|
||||
| listTaskCommentsTaskCommentsGetResponseSuccess
|
||||
| listTaskCommentsTaskCommentsGetResponseError;
|
||||
|
||||
export const getListTaskCommentsTaskCommentsGetUrl = (
|
||||
params: ListTaskCommentsTaskCommentsGetParams,
|
||||
) => {
|
||||
const normalizedParams = new URLSearchParams();
|
||||
|
||||
Object.entries(params || {}).forEach(([key, value]) => {
|
||||
if (value !== undefined) {
|
||||
normalizedParams.append(key, value === null ? "null" : value.toString());
|
||||
}
|
||||
});
|
||||
|
||||
const stringifiedParams = normalizedParams.toString();
|
||||
|
||||
return stringifiedParams.length > 0
|
||||
? `/task-comments?${stringifiedParams}`
|
||||
: `/task-comments`;
|
||||
};
|
||||
|
||||
export const listTaskCommentsTaskCommentsGet = async (
|
||||
params: ListTaskCommentsTaskCommentsGetParams,
|
||||
options?: RequestInit,
|
||||
): Promise<listTaskCommentsTaskCommentsGetResponse> => {
|
||||
return customFetch<listTaskCommentsTaskCommentsGetResponse>(
|
||||
getListTaskCommentsTaskCommentsGetUrl(params),
|
||||
{
|
||||
...options,
|
||||
method: "GET",
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* @summary Create Task Comment
|
||||
*/
|
||||
export type createTaskCommentTaskCommentsPostResponse200 = {
|
||||
data: TaskComment;
|
||||
status: 200;
|
||||
};
|
||||
|
||||
export type createTaskCommentTaskCommentsPostResponse422 = {
|
||||
data: HTTPValidationError;
|
||||
status: 422;
|
||||
};
|
||||
|
||||
export type createTaskCommentTaskCommentsPostResponseSuccess =
|
||||
createTaskCommentTaskCommentsPostResponse200 & {
|
||||
headers: Headers;
|
||||
};
|
||||
export type createTaskCommentTaskCommentsPostResponseError =
|
||||
createTaskCommentTaskCommentsPostResponse422 & {
|
||||
headers: Headers;
|
||||
};
|
||||
|
||||
export type createTaskCommentTaskCommentsPostResponse =
|
||||
| createTaskCommentTaskCommentsPostResponseSuccess
|
||||
| createTaskCommentTaskCommentsPostResponseError;
|
||||
|
||||
export const getCreateTaskCommentTaskCommentsPostUrl = () => {
|
||||
return `/task-comments`;
|
||||
};
|
||||
|
||||
export const createTaskCommentTaskCommentsPost = async (
|
||||
taskCommentCreate: TaskCommentCreate,
|
||||
options?: RequestInit,
|
||||
): Promise<createTaskCommentTaskCommentsPostResponse> => {
|
||||
return customFetch<createTaskCommentTaskCommentsPostResponse>(
|
||||
getCreateTaskCommentTaskCommentsPostUrl(),
|
||||
{
|
||||
...options,
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json", ...options?.headers },
|
||||
body: JSON.stringify(taskCommentCreate),
|
||||
},
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user