2023-10-30 12:17:27 +00:00
|
|
|
import { errors } from '@strapi/utils';
|
|
|
|
|
2023-11-16 16:38:15 +01:00
|
|
|
import type { SanitizedAdminUser, AdminUserCreationPayload } from './shared';
|
|
|
|
import { Entity } from '@strapi/types';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* /create - Create an admin user
|
|
|
|
*/
|
|
|
|
export declare namespace Create {
|
|
|
|
export interface Request {
|
|
|
|
body: AdminUserCreationPayload;
|
|
|
|
query: {};
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface Response {
|
|
|
|
data: SanitizedAdminUser;
|
|
|
|
error?: errors.ApplicationError | errors.YupValidationError;
|
|
|
|
}
|
|
|
|
}
|
2023-10-30 12:17:27 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* /find - Find admin users
|
|
|
|
*/
|
2023-11-16 16:38:15 +01:00
|
|
|
// TODO: Rename to FindAll
|
|
|
|
export declare namespace Find {
|
2023-10-30 12:17:27 +00:00
|
|
|
// TODO make the types for this
|
|
|
|
export interface Request {
|
|
|
|
body: {};
|
2023-11-16 16:38:15 +01:00
|
|
|
query: {};
|
2023-10-30 12:17:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface Response {
|
|
|
|
data: {
|
|
|
|
results: SanitizedAdminUser[];
|
|
|
|
pagination: {
|
|
|
|
page: number;
|
|
|
|
pageSize: number;
|
|
|
|
pageCount: number;
|
|
|
|
total: number;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
error?: errors.ApplicationError;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* /findOne - Find an admin user
|
|
|
|
*/
|
|
|
|
export declare namespace FindOne {
|
|
|
|
export interface Request {
|
|
|
|
body: {};
|
|
|
|
query: {};
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface Params {
|
|
|
|
id: Entity.ID;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface Response {
|
|
|
|
data: SanitizedAdminUser;
|
|
|
|
error?: errors.ApplicationError;
|
|
|
|
}
|
|
|
|
}
|
2023-11-16 16:38:15 +01:00
|
|
|
/**
|
|
|
|
* /update - Update an admin user
|
|
|
|
*/
|
|
|
|
export declare namespace Update {
|
|
|
|
export interface Request {
|
|
|
|
body: AdminUserCreationPayload;
|
|
|
|
query: {};
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface Params {
|
|
|
|
id: Entity.ID;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface Response {
|
|
|
|
data: SanitizedAdminUser;
|
|
|
|
error?: errors.ApplicationError | errors.YupValidationError;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* /deleteOne - Delete an admin user
|
|
|
|
*/
|
|
|
|
export declare namespace DeleteOne {
|
|
|
|
export interface Request {
|
|
|
|
body: {};
|
|
|
|
query: {};
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface Params {
|
|
|
|
id: Entity.ID;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface Response {
|
|
|
|
data: SanitizedAdminUser;
|
|
|
|
error?: errors.ApplicationError;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* /deleteMany - Delete admin users
|
|
|
|
*/
|
|
|
|
export declare namespace DeleteMany {
|
|
|
|
export interface Request {
|
|
|
|
body: {
|
|
|
|
ids: Entity.ID[];
|
|
|
|
};
|
|
|
|
query: {};
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface Response {
|
|
|
|
data: SanitizedAdminUser[];
|
|
|
|
error?: errors.ApplicationError | errors.YupValidationError;
|
|
|
|
}
|
|
|
|
}
|