2023-10-30 12:17:27 +00:00
|
|
|
import type { errors } from '@strapi/utils';
|
|
|
|
import type { SanitizedAdminUser, Permission } from './shared';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GET /users/me - Log in as an admin user
|
|
|
|
*/
|
|
|
|
export declare namespace GetMe {
|
|
|
|
export interface Request {
|
|
|
|
query: {};
|
|
|
|
body: {};
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface Response {
|
|
|
|
data: SanitizedAdminUser;
|
|
|
|
error?: errors.ApplicationError;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* PUT /users/me - Update the current admin user
|
|
|
|
*/
|
|
|
|
export declare namespace UpdateMe {
|
2023-11-14 15:22:12 +01:00
|
|
|
export interface BaseRequestBody {
|
2024-01-02 17:01:58 +00:00
|
|
|
password?: string;
|
|
|
|
currentPassword?: string;
|
2023-11-14 15:22:12 +01:00
|
|
|
email?: string;
|
|
|
|
firstname?: string;
|
|
|
|
lastname?: string;
|
|
|
|
username?: string;
|
|
|
|
preferedLanguage?: string;
|
|
|
|
}
|
|
|
|
|
2023-10-30 12:17:27 +00:00
|
|
|
export interface Request {
|
|
|
|
query: {};
|
2024-01-02 17:01:58 +00:00
|
|
|
body: BaseRequestBody;
|
2023-10-30 12:17:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface Response {
|
|
|
|
data: SanitizedAdminUser;
|
2023-11-16 16:38:15 +01:00
|
|
|
error?:
|
|
|
|
| errors.ApplicationError
|
|
|
|
| errors.ValidationError<'ValidationError', { currentPassword: ['Invalid credentials'] }>
|
|
|
|
| errors.YupValidationError;
|
2023-10-30 12:17:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GET /users/me/permissions - Get the permissions of the current admin user
|
|
|
|
*/
|
|
|
|
export declare namespace GetOwnPermissions {
|
|
|
|
export interface Request {
|
|
|
|
query: {};
|
|
|
|
body: {};
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface Response {
|
|
|
|
data: Permission[];
|
|
|
|
error?: errors.ApplicationError;
|
|
|
|
}
|
|
|
|
}
|