2026-04-08 09:01:08 +00:00
|
|
|
import * as plugins from '../plugins.js';
|
|
|
|
|
import * as authInterfaces from '../data/auth.js';
|
2026-05-14 00:30:09 +00:00
|
|
|
import type { IAdminUserProjection } from './admin.js';
|
2026-04-08 09:01:08 +00:00
|
|
|
|
2026-05-19 17:06:50 +00:00
|
|
|
export type TUserManagementRole = 'admin' | 'user';
|
|
|
|
|
|
2026-04-08 09:01:08 +00:00
|
|
|
/**
|
2026-05-19 17:06:50 +00:00
|
|
|
* List all OpsServer users (admin-only).
|
2026-04-08 09:01:08 +00:00
|
|
|
* 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;
|
|
|
|
|
};
|
|
|
|
|
response: {
|
2026-05-14 00:30:09 +00:00
|
|
|
users: IAdminUserProjection[];
|
2026-04-08 09:01:08 +00:00
|
|
|
};
|
|
|
|
|
}
|
2026-05-19 17:06:50 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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;
|
|
|
|
|
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;
|
|
|
|
|
id: string;
|
|
|
|
|
};
|
|
|
|
|
response: {
|
|
|
|
|
success: boolean;
|
|
|
|
|
message?: string;
|
|
|
|
|
};
|
|
|
|
|
}
|