116 lines
2.5 KiB
TypeScript
116 lines
2.5 KiB
TypeScript
import * as plugins from '../plugins.ts';
|
|
import * as data from '../data/index.ts';
|
|
|
|
// ============================================================================
|
|
// User Requests
|
|
// ============================================================================
|
|
|
|
export interface IReq_GetUsers extends
|
|
plugins.typedrequestInterfaces.implementsTR<
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
|
IReq_GetUsers
|
|
> {
|
|
method: 'getUsers';
|
|
request: {
|
|
identity: data.IIdentity;
|
|
};
|
|
response: {
|
|
users: data.IUser[];
|
|
};
|
|
}
|
|
|
|
export interface IReq_GetUser extends
|
|
plugins.typedrequestInterfaces.implementsTR<
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
|
IReq_GetUser
|
|
> {
|
|
method: 'getUser';
|
|
request: {
|
|
identity: data.IIdentity;
|
|
userId: string;
|
|
};
|
|
response: {
|
|
user: data.IUser;
|
|
};
|
|
}
|
|
|
|
export interface IReq_UpdateUser extends
|
|
plugins.typedrequestInterfaces.implementsTR<
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
|
IReq_UpdateUser
|
|
> {
|
|
method: 'updateUser';
|
|
request: {
|
|
identity: data.IIdentity;
|
|
userId: string;
|
|
displayName?: string;
|
|
avatarUrl?: string;
|
|
password?: string;
|
|
isActive?: boolean;
|
|
isSystemAdmin?: boolean;
|
|
};
|
|
response: {
|
|
user: data.IUser;
|
|
};
|
|
}
|
|
|
|
export interface IReq_GetUserSessions extends
|
|
plugins.typedrequestInterfaces.implementsTR<
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
|
IReq_GetUserSessions
|
|
> {
|
|
method: 'getUserSessions';
|
|
request: {
|
|
identity: data.IIdentity;
|
|
};
|
|
response: {
|
|
sessions: data.ISession[];
|
|
};
|
|
}
|
|
|
|
export interface IReq_RevokeSession extends
|
|
plugins.typedrequestInterfaces.implementsTR<
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
|
IReq_RevokeSession
|
|
> {
|
|
method: 'revokeSession';
|
|
request: {
|
|
identity: data.IIdentity;
|
|
sessionId: string;
|
|
};
|
|
response: {
|
|
message: string;
|
|
};
|
|
}
|
|
|
|
export interface IReq_ChangePassword extends
|
|
plugins.typedrequestInterfaces.implementsTR<
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
|
IReq_ChangePassword
|
|
> {
|
|
method: 'changePassword';
|
|
request: {
|
|
identity: data.IIdentity;
|
|
currentPassword: string;
|
|
newPassword: string;
|
|
};
|
|
response: {
|
|
message: string;
|
|
};
|
|
}
|
|
|
|
export interface IReq_DeleteAccount extends
|
|
plugins.typedrequestInterfaces.implementsTR<
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
|
IReq_DeleteAccount
|
|
> {
|
|
method: 'deleteAccount';
|
|
request: {
|
|
identity: data.IIdentity;
|
|
password: string;
|
|
};
|
|
response: {
|
|
message: string;
|
|
};
|
|
}
|