mirror of
https://github.com/strapi/strapi.git
synced 2025-07-14 12:32:35 +00:00

* chore(cm): convert list-view to TS * chore: fix broken tests * chore: remove separate recursive paths and unify
132 lines
2.4 KiB
TypeScript
132 lines
2.4 KiB
TypeScript
import { errors } from '@strapi/utils';
|
|
|
|
import type {
|
|
AdminUserCreationPayload,
|
|
AdminUserUpdatePayload,
|
|
Pagination,
|
|
SanitizedAdminUser,
|
|
} from './shared';
|
|
import type { Entity, EntityService } 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;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* /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;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* /find - Find admin users
|
|
*/
|
|
|
|
export declare namespace FindAll {
|
|
// TODO make the types for this
|
|
export interface Request {
|
|
body: {};
|
|
query: EntityService.Params.Pick<'admin::user', 'filters'>;
|
|
}
|
|
|
|
export interface Response {
|
|
data: {
|
|
results: SanitizedAdminUser[];
|
|
pagination: Pagination;
|
|
};
|
|
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;
|
|
}
|
|
}
|
|
/**
|
|
* /update - Update an admin user
|
|
*/
|
|
export declare namespace Update {
|
|
export interface Request {
|
|
body: AdminUserUpdatePayload;
|
|
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;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* /users/batch-delete - 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;
|
|
}
|
|
}
|