67 lines
1.6 KiB
TypeScript
67 lines
1.6 KiB
TypeScript
import * as plugins from '../plugins.js';
|
|
import * as authInterfaces from '../data/auth.js';
|
|
import type { IAdminUserProjection } from './admin.js';
|
|
|
|
export type TUserManagementRole = 'admin' | 'user';
|
|
|
|
/**
|
|
* List all OpsServer users (admin-only).
|
|
* Deliberately omits password/secret fields from the response.
|
|
*/
|
|
export interface IReq_ListUsers extends plugins.typedrequestInterfaces.implementsTR<
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
|
IReq_ListUsers
|
|
> {
|
|
method: 'listUsers';
|
|
request: {
|
|
identity?: authInterfaces.IIdentity;
|
|
apiToken?: string;
|
|
};
|
|
response: {
|
|
users: IAdminUserProjection[];
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Create a persisted OpsServer user account (admin-only).
|
|
*/
|
|
export interface IReq_CreateUser extends plugins.typedrequestInterfaces.implementsTR<
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
|
IReq_CreateUser
|
|
> {
|
|
method: 'createUser';
|
|
request: {
|
|
identity?: authInterfaces.IIdentity;
|
|
apiToken?: string;
|
|
email: string;
|
|
name?: string;
|
|
role: TUserManagementRole;
|
|
password: string;
|
|
enableIdpGlobalAuth?: boolean;
|
|
};
|
|
response: {
|
|
success: boolean;
|
|
user?: IAdminUserProjection;
|
|
message?: string;
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Delete a persisted OpsServer user account (admin-only).
|
|
*/
|
|
export interface IReq_DeleteUser extends plugins.typedrequestInterfaces.implementsTR<
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
|
IReq_DeleteUser
|
|
> {
|
|
method: 'deleteUser';
|
|
request: {
|
|
identity?: authInterfaces.IIdentity;
|
|
apiToken?: string;
|
|
id: string;
|
|
};
|
|
response: {
|
|
success: boolean;
|
|
message?: string;
|
|
};
|
|
}
|