Skip to content
Snippets Groups Projects
Commit 8e452fba authored by Henrik's avatar Henrik
Browse files

feat: refresh OpenAPI

parent f2a3e968
No related branches found
No related tags found
No related merge requests found
Pipeline #280756 failed
......@@ -36,8 +36,8 @@
"required": true
},
"responses": {
"200": {
"description": "No accounts associated with a bank user",
"404": {
"description": "Bank profile id does not exist",
"content": {
"*/*": {
"schema": {
......@@ -46,8 +46,8 @@
}
}
},
"404": {
"description": "Bank profile id does not exist",
"200": {
"description": "No accounts associated with a bank user",
"content": {
"*/*": {
"schema": {
......@@ -78,8 +78,8 @@
"required": true
},
"responses": {
"200": {
"description": "Successfully created a bank profile",
"400": {
"description": "Could not create profile",
"content": {
"*/*": {
"schema": {
......@@ -88,8 +88,8 @@
}
}
},
"400": {
"description": "Could not create profile",
"200": {
"description": "Successfully created a bank profile",
"content": {
"*/*": {
"schema": {
......@@ -120,8 +120,8 @@
"required": true
},
"responses": {
"200": {
"description": "Successfully created account",
"404": {
"description": "Provided bank profile id could not be found",
"content": {
"*/*": {
"schema": {
......@@ -130,8 +130,8 @@
}
}
},
"404": {
"description": "Provided bank profile id could not be found",
"200": {
"description": "Successfully created account",
"content": {
"*/*": {
"schema": {
......@@ -188,17 +188,17 @@
"required": true
},
"responses": {
"204": {
"description": "Password was reset successfully"
},
"403": {
"description": "Invalid token"
},
"204": {
"description": "Password was reset successfully"
}
},
"security": []
}
},
"/api/image/upload": {
"/api/images": {
"post": {
"tags": [
"Image"
......@@ -208,7 +208,7 @@
"operationId": "uploadImage",
"requestBody": {
"content": {
"application/json": {
"multipart/form-data": {
"schema": {
"required": [
"file"
......@@ -225,19 +225,8 @@
}
},
"responses": {
"200": {
"description": "Successfully uploaded the image",
"content": {
"*/*": {
"schema": {
"type": "integer",
"format": "int64"
}
}
}
},
"201": {
"description": "Created",
"description": "Successfully uploaded the image",
"content": {
"*/*": {
"schema": {
......@@ -280,7 +269,7 @@
}
}
},
"/api/budget/update": {
"/api/budget/update/{budgetId}": {
"post": {
"tags": [
"User"
......@@ -288,19 +277,30 @@
"summary": "Updates a budget",
"description": "Updates a budget based on the budget request",
"operationId": "updateBudget",
"parameters": [
{
"name": "budgetId",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"format": "int64"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BudgetResponseDTO"
"$ref": "#/components/schemas/BudgetRequestDTO"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successfully updated budget",
"500": {
"description": "Budget is not found",
"content": {
"application/json": {
"schema": {
......@@ -309,8 +309,8 @@
}
}
},
"500": {
"description": "Budget is not found",
"200": {
"description": "Successfully updated budget",
"content": {
"application/json": {
"schema": {
......@@ -352,8 +352,8 @@
"required": true
},
"responses": {
"200": {
"description": "Successfully updated budget",
"500": {
"description": "Error updating expense",
"content": {
"application/json": {
"schema": {
......@@ -362,8 +362,8 @@
}
}
},
"500": {
"description": "Error updating expense",
"200": {
"description": "Successfully updated budget",
"content": {
"application/json": {
"schema": {
......@@ -426,22 +426,22 @@
}
],
"responses": {
"200": {
"description": "Email is valid",
"409": {
"description": "Email already exists",
"content": {
"*/*": {
"schema": {
"type": "object"
"$ref": "#/components/schemas/ExceptionResponse"
}
}
}
},
"409": {
"description": "Email already exists",
"200": {
"description": "Email is valid",
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/ExceptionResponse"
"type": "object"
}
}
}
......@@ -610,6 +610,38 @@
}
}
},
"/api/users/password": {
"patch": {
"tags": [
"User"
],
"summary": "Update a password",
"description": "Update the password of the authenticated user",
"operationId": "updatePassword",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PasswordUpdateDTO"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successfully updated password",
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/UserDTO"
}
}
}
}
}
}
},
"/bank/v1/account/accounts/ssn/{ssn}": {
"get": {
"tags": [
......@@ -679,8 +711,8 @@
}
],
"responses": {
"200": {
"description": "No accounts associated with a bank user",
"404": {
"description": "Bank profile id does not exist",
"content": {
"*/*": {
"schema": {
......@@ -692,8 +724,8 @@
}
}
},
"404": {
"description": "Bank profile id does not exist",
"200": {
"description": "No accounts associated with a bank user",
"content": {
"*/*": {
"schema": {
......@@ -859,7 +891,7 @@
}
}
},
"/api/image/{id}": {
"/api/images/{id}": {
"get": {
"tags": [
"Image"
......@@ -884,16 +916,24 @@
"content": {
"*/*": {
"schema": {
"type": "array",
"items": {
"type": "string",
"format": "byte"
}
"type": "string",
"format": "binary"
}
}
}
},
"404": {
"description": "Image not found",
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/ExceptionResponse"
}
}
}
}
}
},
"security": []
}
},
"/api/goal/getGoals": {
......@@ -984,8 +1024,8 @@
}
],
"responses": {
"200": {
"description": "Successfully got budget",
"500": {
"description": "Budget is not found",
"content": {
"application/json": {
"schema": {
......@@ -994,8 +1034,8 @@
}
}
},
"500": {
"description": "Budget is not found",
"200": {
"description": "Successfully got budget",
"content": {
"application/json": {
"schema": {
......@@ -1106,8 +1146,8 @@
}
],
"responses": {
"200": {
"description": "Successfully deleted budget",
"500": {
"description": "Budget is not found",
"content": {
"application/json": {
"schema": {
......@@ -1116,8 +1156,8 @@
}
}
},
"500": {
"description": "Budget is not found",
"200": {
"description": "Successfully deleted budget",
"content": {
"application/json": {
"schema": {
......@@ -1420,13 +1460,9 @@
}
}
},
"BudgetResponseDTO": {
"BudgetRequestDTO": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"budgetName": {
"type": "string"
},
......@@ -1435,10 +1471,6 @@
},
"expenseAmount": {
"type": "number"
},
"createdAt": {
"type": "string",
"format": "date-time"
}
}
},
......@@ -1457,20 +1489,6 @@
}
}
},
"BudgetRequestDTO": {
"type": "object",
"properties": {
"budgetName": {
"type": "string"
},
"budgetAmount": {
"type": "number"
},
"expenseAmount": {
"type": "number"
}
}
},
"Badge": {
"type": "object",
"properties": {
......@@ -1663,6 +1681,10 @@
"email": {
"type": "string"
},
"profileImage": {
"type": "integer",
"format": "int64"
},
"checkingAccount": {
"$ref": "#/components/schemas/Account"
},
......@@ -1701,21 +1723,21 @@
"enabled": {
"type": "boolean"
},
"accountNonExpired": {
"type": "boolean"
},
"credentialsNonExpired": {
"type": "boolean"
},
"username": {
"type": "string"
},
"authorities": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GrantedAuthority"
}
},
"username": {
"type": "string"
},
"accountNonExpired": {
"type": "boolean"
},
"credentialsNonExpired": {
"type": "boolean"
},
"accountNonLocked": {
"type": "boolean"
}
......@@ -1813,8 +1835,9 @@
"email": {
"type": "string"
},
"password": {
"type": "string"
"profileImage": {
"type": "integer",
"format": "int64"
},
"configuration": {
"$ref": "#/components/schemas/ConfigurationDTO"
......@@ -1834,6 +1857,10 @@
"lastName": {
"type": "string"
},
"profileImage": {
"type": "integer",
"format": "int64"
},
"email": {
"type": "string"
},
......@@ -1858,6 +1885,17 @@
}
}
},
"PasswordUpdateDTO": {
"type": "object",
"properties": {
"oldPassword": {
"type": "string"
},
"newPassword": {
"type": "string"
}
}
},
"ProfileDTO": {
"type": "object",
"properties": {
......@@ -1871,6 +1909,10 @@
"lastName": {
"type": "string"
},
"profileImage": {
"type": "integer",
"format": "int64"
},
"createdAt": {
"type": "string",
"format": "date-time"
......@@ -1910,6 +1952,28 @@
}
}
},
"BudgetResponseDTO": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"budgetName": {
"type": "string"
},
"budgetAmount": {
"type": "number"
},
"expenseAmount": {
"type": "number"
},
"createdAt": {
"type": "string",
"format": "date-time"
}
}
},
"ExpenseResponseDTO": {
"type": "object",
"properties": {
......
......@@ -37,6 +37,7 @@ export type { LoginRequest } from './models/LoginRequest';
export { ParticipantDTO } from './models/ParticipantDTO';
export type { ParticipantUserDTO } from './models/ParticipantUserDTO';
export type { PasswordResetDTO } from './models/PasswordResetDTO';
export type { PasswordUpdateDTO } from './models/PasswordUpdateDTO';
export type { Point } from './models/Point';
export type { ProfileDTO } from './models/ProfileDTO';
export type { SignUpRequest } from './models/SignUpRequest';
......
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type PasswordUpdateDTO = {
oldPassword?: string;
newPassword?: string;
};
......@@ -6,6 +6,7 @@ export type ProfileDTO = {
id?: number;
firstName?: string;
lastName?: string;
profileImage?: number;
createdAt?: string;
};
......@@ -13,6 +13,7 @@ export type User = {
firstName?: string;
lastName?: string;
email?: string;
profileImage?: number;
checkingAccount?: Account;
savingsAccount?: Account;
password?: string;
......@@ -23,10 +24,10 @@ export type User = {
streak?: Streak;
configuration?: Configuration;
enabled?: boolean;
authorities?: Array<GrantedAuthority>;
username?: string;
accountNonExpired?: boolean;
credentialsNonExpired?: boolean;
username?: string;
authorities?: Array<GrantedAuthority>;
accountNonLocked?: boolean;
};
export namespace User {
......
......@@ -6,6 +6,7 @@ export type UserDTO = {
id?: number;
firstName?: string;
lastName?: string;
profileImage?: number;
email?: string;
createdAt?: string;
role?: string;
......
......@@ -7,7 +7,7 @@ export type UserUpdateDTO = {
firstName?: string;
lastName?: string;
email?: string;
password?: string;
profileImage?: number;
configuration?: ConfigurationDTO;
};
......@@ -13,36 +13,39 @@ export class ImageService {
* @throws ApiError
*/
public static uploadImage({
requestBody,
formData,
}: {
requestBody?: {
formData?: {
file: Blob;
},
}): CancelablePromise<number> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/image/upload',
body: requestBody,
mediaType: 'application/json',
url: '/api/images',
formData: formData,
mediaType: 'multipart/form-data',
});
}
/**
* Retrieve an image
* Retrieve an image from the server
* @returns string Successfully retrieved the image
* @returns binary Successfully retrieved the image
* @throws ApiError
*/
public static getImage({
id,
}: {
id: number,
}): CancelablePromise<Array<string>> {
}): CancelablePromise<Blob> {
return __request(OpenAPI, {
method: 'GET',
url: '/api/image/{id}',
url: '/api/images/{id}',
path: {
'id': id,
},
errors: {
404: `Image not found`,
},
});
}
}
......@@ -10,6 +10,7 @@ import type { BudgetResponseDTO } from '../models/BudgetResponseDTO';
import type { ExpenseRequestDTO } from '../models/ExpenseRequestDTO';
import type { ExpenseResponseDTO } from '../models/ExpenseResponseDTO';
import type { PasswordResetDTO } from '../models/PasswordResetDTO';
import type { PasswordUpdateDTO } from '../models/PasswordUpdateDTO';
import type { ProfileDTO } from '../models/ProfileDTO';
import type { UserDTO } from '../models/UserDTO';
import type { UserUpdateDTO } from '../models/UserUpdateDTO';
......@@ -63,13 +64,18 @@ export class UserService {
* @throws ApiError
*/
public static updateBudget({
budgetId,
requestBody,
}: {
requestBody: BudgetResponseDTO,
budgetId: number,
requestBody: BudgetRequestDTO,
}): CancelablePromise<Record<string, any>> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/budget/update',
url: '/api/budget/update/{budgetId}',
path: {
'budgetId': budgetId,
},
body: requestBody,
mediaType: 'application/json',
errors: {
......@@ -157,6 +163,24 @@ export class UserService {
mediaType: 'application/json',
});
}
/**
* Update a password
* Update the password of the authenticated user
* @returns UserDTO Successfully updated password
* @throws ApiError
*/
public static updatePassword({
requestBody,
}: {
requestBody: PasswordUpdateDTO,
}): CancelablePromise<UserDTO> {
return __request(OpenAPI, {
method: 'PATCH',
url: '/api/users/password',
body: requestBody,
mediaType: 'application/json',
});
}
/**
* Get a profile
* Get the profile of a user
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment