feat: view the user's app version on the user page (#21345)

Co-authored-by: Daniel Dietzler <mail@ddietzler.dev>
This commit is contained in:
aviv926 2025-10-22 01:36:18 +03:00 committed by GitHub
parent c3a533ab40
commit 032de9ff2f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 301 additions and 50 deletions

View file

@ -244,6 +244,17 @@ export type UserPreferencesUpdateDto = {
sharedLinks?: SharedLinksUpdate;
tags?: TagsUpdate;
};
export type SessionResponseDto = {
appVersion: string | null;
createdAt: string;
current: boolean;
deviceOS: string;
deviceType: string;
expiresAt?: string;
id: string;
isPendingSyncReset: boolean;
updatedAt: string;
};
export type AssetStatsResponseDto = {
images: number;
total: number;
@ -1192,16 +1203,6 @@ export type ServerVersionHistoryResponseDto = {
id: string;
version: string;
};
export type SessionResponseDto = {
createdAt: string;
current: boolean;
deviceOS: string;
deviceType: string;
expiresAt?: string;
id: string;
isPendingSyncReset: boolean;
updatedAt: string;
};
export type SessionCreateDto = {
deviceOS?: string;
deviceType?: string;
@ -1209,6 +1210,7 @@ export type SessionCreateDto = {
duration?: number;
};
export type SessionCreateResponseDto = {
appVersion: string | null;
createdAt: string;
current: boolean;
deviceOS: string;
@ -1853,6 +1855,19 @@ export function restoreUserAdmin({ id }: {
method: "POST"
}));
}
/**
* This endpoint is an admin-only route, and requires the `adminSession.read` permission.
*/
export function getUserSessionsAdmin({ id }: {
id: string;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: SessionResponseDto[];
}>(`/admin/users/${encodeURIComponent(id)}/sessions`, {
...opts
}));
}
/**
* This endpoint is an admin-only route, and requires the `adminUser.read` permission.
*/
@ -4830,6 +4845,7 @@ export enum Permission {
AdminUserRead = "adminUser.read",
AdminUserUpdate = "adminUser.update",
AdminUserDelete = "adminUser.delete",
AdminSessionRead = "adminSession.read",
AdminAuthUnlinkAll = "adminAuth.unlinkAll"
}
export enum AssetMetadataKey {