2024-09-29 13:56:38 +02:00
|
|
|
import * as data from '../data/index.js';
|
|
|
|
|
import * as plugins from '../loint-reception.plugins.js';
|
|
|
|
|
|
|
|
|
|
export interface IReq_GetUserData
|
|
|
|
|
extends plugins.typedRequestInterfaces.implementsTR<
|
|
|
|
|
plugins.typedRequestInterfaces.ITypedRequest,
|
|
|
|
|
IReq_GetUserData
|
|
|
|
|
> {
|
|
|
|
|
method: 'getUserData';
|
|
|
|
|
request: {
|
|
|
|
|
refreshToken: string;
|
|
|
|
|
};
|
|
|
|
|
response: {
|
|
|
|
|
jwt: string;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IReq_SetUserData
|
|
|
|
|
extends plugins.typedRequestInterfaces.implementsTR<
|
|
|
|
|
plugins.typedRequestInterfaces.ITypedRequest,
|
|
|
|
|
IReq_SetUserData
|
|
|
|
|
> {
|
|
|
|
|
method: 'setUserData';
|
|
|
|
|
request: {
|
|
|
|
|
refreshToken: string;
|
|
|
|
|
};
|
|
|
|
|
response: {
|
|
|
|
|
oneTimeTransferCode: string;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IReq_SuspendUser
|
|
|
|
|
extends plugins.typedRequestInterfaces.implementsTR<
|
|
|
|
|
plugins.typedRequestInterfaces.ITypedRequest,
|
|
|
|
|
IReq_SuspendUser
|
|
|
|
|
> {
|
|
|
|
|
method: 'suspendUser';
|
|
|
|
|
request: {
|
|
|
|
|
jwt: string;
|
|
|
|
|
userId: string;
|
|
|
|
|
};
|
|
|
|
|
response: {
|
|
|
|
|
publicKeyPem: string;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IDeleteSuspendedUser
|
|
|
|
|
extends plugins.typedRequestInterfaces.implementsTR<
|
|
|
|
|
plugins.typedRequestInterfaces.ITypedRequest,
|
|
|
|
|
IDeleteSuspendedUser
|
|
|
|
|
> {
|
|
|
|
|
method: 'deleteSuspendedUser';
|
|
|
|
|
request: {
|
|
|
|
|
backendToken: string;
|
|
|
|
|
};
|
|
|
|
|
response: {
|
|
|
|
|
ok: boolean;
|
|
|
|
|
errorText?: string;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IReq_GetRolesAndOrganizationsForUserId
|
|
|
|
|
extends plugins.typedRequestInterfaces.implementsTR<
|
|
|
|
|
plugins.typedRequestInterfaces.ITypedRequest,
|
|
|
|
|
IReq_GetRolesAndOrganizationsForUserId
|
|
|
|
|
> {
|
|
|
|
|
method: 'getRolesAndOrganizationsForUserId';
|
|
|
|
|
request: {
|
|
|
|
|
jwt: string;
|
|
|
|
|
userId: string;
|
|
|
|
|
};
|
|
|
|
|
response: {
|
|
|
|
|
roles: data.IRole[];
|
|
|
|
|
organizations: data.IOrganization[];
|
|
|
|
|
};
|
|
|
|
|
}
|
2024-10-07 10:26:21 +02:00
|
|
|
|
|
|
|
|
export interface IReq_WhoIs {
|
|
|
|
|
method: 'whoIs';
|
|
|
|
|
request: {
|
|
|
|
|
jwt: string;
|
|
|
|
|
};
|
|
|
|
|
response: {
|
|
|
|
|
user: data.IUser;
|
|
|
|
|
};
|
|
|
|
|
}
|
2025-12-01 18:56:16 +00:00
|
|
|
|
|
|
|
|
export interface IReq_GetUserSessions
|
|
|
|
|
extends plugins.typedRequestInterfaces.implementsTR<
|
|
|
|
|
plugins.typedRequestInterfaces.ITypedRequest,
|
|
|
|
|
IReq_GetUserSessions
|
|
|
|
|
> {
|
|
|
|
|
method: 'getUserSessions';
|
|
|
|
|
request: {
|
|
|
|
|
jwt: string;
|
|
|
|
|
};
|
|
|
|
|
response: {
|
|
|
|
|
sessions: Array<{
|
|
|
|
|
id: string;
|
|
|
|
|
deviceId: string;
|
|
|
|
|
deviceName: string;
|
|
|
|
|
browser: string;
|
|
|
|
|
os: string;
|
|
|
|
|
ip: string;
|
|
|
|
|
lastActive: number;
|
|
|
|
|
createdAt: number;
|
|
|
|
|
isCurrent: boolean;
|
|
|
|
|
}>;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IReq_RevokeSession
|
|
|
|
|
extends plugins.typedRequestInterfaces.implementsTR<
|
|
|
|
|
plugins.typedRequestInterfaces.ITypedRequest,
|
|
|
|
|
IReq_RevokeSession
|
|
|
|
|
> {
|
|
|
|
|
method: 'revokeSession';
|
|
|
|
|
request: {
|
|
|
|
|
jwt: string;
|
|
|
|
|
sessionId: string;
|
|
|
|
|
};
|
|
|
|
|
response: {
|
|
|
|
|
success: boolean;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IReq_GetUserActivity
|
|
|
|
|
extends plugins.typedRequestInterfaces.implementsTR<
|
|
|
|
|
plugins.typedRequestInterfaces.ITypedRequest,
|
|
|
|
|
IReq_GetUserActivity
|
|
|
|
|
> {
|
|
|
|
|
method: 'getUserActivity';
|
|
|
|
|
request: {
|
|
|
|
|
jwt: string;
|
|
|
|
|
limit?: number;
|
|
|
|
|
offset?: number;
|
|
|
|
|
};
|
|
|
|
|
response: {
|
|
|
|
|
activities: data.IActivityLog[];
|
|
|
|
|
total: number;
|
|
|
|
|
};
|
|
|
|
|
}
|