Skip to content

Commit

Permalink
update openapi.json & openapi-ts client, run pnpm format
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Oct 7, 2024
1 parent 7d7465b commit 7163e07
Show file tree
Hide file tree
Showing 4 changed files with 273 additions and 3 deletions.
117 changes: 117 additions & 0 deletions frontend/src/lib/client/schemas.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,123 @@ export const UserCreateSchema = {
title: 'UserCreate'
} as const;

export const UserQuestionAdminSchema = {
properties: {
id: {
type: 'integer',
title: 'Id'
},
order: {
type: 'integer',
title: 'Order'
},
input: {
type: 'string',
title: 'Input'
},
options: {
type: 'string',
title: 'Options'
},
text: {
additionalProperties: {
$ref: '#/components/schemas/UserQuestionText'
},
type: 'object',
title: 'Text',
default: {}
}
},
type: 'object',
required: ['id', 'order', 'input', 'options'],
title: 'UserQuestionAdmin'
} as const;

export const UserQuestionPublicSchema = {
properties: {
id: {
type: 'integer',
title: 'Id'
},
input: {
type: 'string',
title: 'Input'
},
text: {
additionalProperties: {
$ref: '#/components/schemas/UserQuestionTextPublic'
},
type: 'object',
title: 'Text',
default: {}
}
},
type: 'object',
required: ['id', 'input'],
title: 'UserQuestionPublic'
} as const;

export const UserQuestionTextSchema = {
properties: {
question: {
type: 'string',
title: 'Question',
default: ''
},
options_json: {
type: 'string',
title: 'Options Json',
default: ''
},
user_question_id: {
anyOf: [
{
type: 'integer'
},
{
type: 'null'
}
],
title: 'User Question Id'
},
lang_id: {
anyOf: [
{
type: 'integer'
},
{
type: 'null'
}
],
title: 'Lang Id'
},
options: {
type: 'string',
title: 'Options',
default: ''
}
},
type: 'object',
title: 'UserQuestionText'
} as const;

export const UserQuestionTextPublicSchema = {
properties: {
question: {
type: 'string',
title: 'Question',
default: ''
},
options_json: {
type: 'string',
title: 'Options Json',
default: ''
}
},
type: 'object',
title: 'UserQuestionTextPublic'
} as const;

export const UserReadSchema = {
properties: {
id: {
Expand Down
94 changes: 93 additions & 1 deletion frontend/src/lib/client/services.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import type {
GetMilestoneGroupData,
GetMilestoneGroupError,
GetMilestoneGroupResponse,
GetUserQuestionsError,
GetUserQuestionsResponse,
CreateLanguageData,
CreateLanguageError,
CreateLanguageResponse,
Expand Down Expand Up @@ -51,6 +53,16 @@ import type {
UploadMilestoneImageData,
UploadMilestoneImageError,
UploadMilestoneImageResponse,
GetUserQuestions1Error,
GetUserQuestions1Response,
UpdateUserQuestionData,
UpdateUserQuestionError,
UpdateUserQuestionResponse,
CreateUserQuestionError,
CreateUserQuestionResponse,
DeleteQuestionData,
DeleteQuestionError,
DeleteQuestionResponse,
UsersCurrentUserError,
UsersCurrentUserResponse,
UsersPatchCurrentUserData,
Expand Down Expand Up @@ -159,6 +171,22 @@ export const getMilestoneGroup = <ThrowOnError extends boolean = false>(
});
};

/**
* Get User Questions
*/
export const getUserQuestions = <ThrowOnError extends boolean = false>(
options?: Options<unknown, ThrowOnError>
) => {
return (options?.client ?? client).get<
GetUserQuestionsResponse,
GetUserQuestionsError,
ThrowOnError
>({
...options,
url: '/user-questions/'
});
};

/**
* Create Language
*/
Expand Down Expand Up @@ -304,7 +332,7 @@ export const updateMilestone = <ThrowOnError extends boolean = false>(
ThrowOnError
>({
...options,
url: '/admin/milestones'
url: '/admin/milestones/'
});
};

Expand Down Expand Up @@ -345,6 +373,70 @@ export const uploadMilestoneImage = <ThrowOnError extends boolean = false>(
});
};

/**
* Get User Questions
*/
export const getUserQuestions1 = <ThrowOnError extends boolean = false>(
options?: Options<unknown, ThrowOnError>
) => {
return (options?.client ?? client).get<
GetUserQuestions1Response,
GetUserQuestions1Error,
ThrowOnError
>({
...options,
url: '/admin/user-questions/'
});
};

/**
* Update User Question
*/
export const updateUserQuestion = <ThrowOnError extends boolean = false>(
options: Options<UpdateUserQuestionData, ThrowOnError>
) => {
return (options?.client ?? client).put<
UpdateUserQuestionResponse,
UpdateUserQuestionError,
ThrowOnError
>({
...options,
url: '/admin/user-questions/'
});
};

/**
* Create User Question
*/
export const createUserQuestion = <ThrowOnError extends boolean = false>(
options?: Options<unknown, ThrowOnError>
) => {
return (options?.client ?? client).post<
CreateUserQuestionResponse,
CreateUserQuestionError,
ThrowOnError
>({
...options,
url: '/admin/user-questions/'
});
};

/**
* Delete Question
*/
export const deleteQuestion = <ThrowOnError extends boolean = false>(
options: Options<DeleteQuestionData, ThrowOnError>
) => {
return (options?.client ?? client).delete<
DeleteQuestionResponse,
DeleteQuestionError,
ThrowOnError
>({
...options,
url: '/admin/user-questions/{user_question_id}'
});
};

/**
* Users:Current User
*/
Expand Down
63 changes: 62 additions & 1 deletion frontend/src/lib/client/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,37 @@ export type UserCreate = {
is_researcher?: boolean | null;
};

export type UserQuestionAdmin = {
id: number;
order: number;
input: string;
options: string;
text?: {
[key: string]: UserQuestionText;
};
};

export type UserQuestionPublic = {
id: number;
input: string;
text?: {
[key: string]: UserQuestionTextPublic;
};
};

export type UserQuestionText = {
question?: string;
options_json?: string;
user_question_id?: number | null;
lang_id?: number | null;
options?: string;
};

export type UserQuestionTextPublic = {
question?: string;
options_json?: string;
};

export type UserRead = {
id: number;
email: string;
Expand Down Expand Up @@ -200,6 +231,10 @@ export type GetMilestoneGroupResponse = MilestoneGroupPublic;

export type GetMilestoneGroupError = HTTPValidationError;

export type GetUserQuestionsResponse = Array<UserQuestionPublic>;

export type GetUserQuestionsError = unknown;

export type CreateLanguageData = {
body: LanguageCreate;
};
Expand All @@ -214,7 +249,7 @@ export type DeleteLanguageData = {
};
};

export type DeleteLanguageResponse = Language;
export type DeleteLanguageResponse = unknown;

export type DeleteLanguageError = HTTPValidationError;

Expand Down Expand Up @@ -294,6 +329,32 @@ export type UploadMilestoneImageResponse = MilestoneImage;

export type UploadMilestoneImageError = HTTPValidationError;

export type GetUserQuestions1Response = Array<UserQuestionAdmin>;

export type GetUserQuestions1Error = unknown;

export type UpdateUserQuestionData = {
body: UserQuestionAdmin;
};

export type UpdateUserQuestionResponse = UserQuestionAdmin;

export type UpdateUserQuestionError = HTTPValidationError;

export type CreateUserQuestionResponse = UserQuestionAdmin;

export type CreateUserQuestionError = unknown;

export type DeleteQuestionData = {
path: {
user_question_id: number;
};
};

export type DeleteQuestionResponse = unknown;

export type DeleteQuestionError = HTTPValidationError;

export type UsersCurrentUserResponse = UserRead;

export type UsersCurrentUserError = unknown;
Expand Down
Loading

0 comments on commit 7163e07

Please sign in to comment.