mirror of
https://github.com/strapi/strapi.git
synced 2025-07-17 14:02:21 +00:00

* chore(admin): convert API Token settings page to TS Co-Authored-By: Gustav Hansen <gu@stav.dev> * chore(admin): cleanup api token contracts (#18862) --------- Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com>
132 lines
2.3 KiB
TypeScript
132 lines
2.3 KiB
TypeScript
import { errors } from '@strapi/utils';
|
|
|
|
import type {
|
|
AdminUserCreationPayload,
|
|
AdminUserUpdatePayload,
|
|
Pagination,
|
|
SanitizedAdminUser,
|
|
} from './shared';
|
|
import type { 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;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* /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: {};
|
|
}
|
|
|
|
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;
|
|
}
|
|
}
|