Update hivegrid-cloud reference to latest main

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
davidandClaude Fable 5 committed 2026-07-08 16:15:37 +02:00
1 parent e98d38e716
commit 7b21524c86
3781 files changed
+373484 -225607

No files matched your search

@@ -1,4 +1,4 @@
import { AdminUser, Role, Tenant, TenantUser, UserRole } from "@toolctrl/db/prisma-browser";
import { AdminUser, Role, Tenant, TenantUser, UserRole } from "@hivegrid/db/prisma-browser";
import { consumeRecoveryCode, getRecoveryCodeStatus, RecoveryCodeHashEntry } from "~/utils/auth/mfa/recovery-codes.server";
import { hashPassword } from "~/utils/auth/passwordHasher.server";
import Constants from "~/application/Constants";
@@ -7,13 +7,13 @@ import { PaginationDto } from "~/application/dtos/data/PaginationDto";
import { db } from "~/utils/db.server";
import RowFiltersHelper from "../helpers/RowFiltersHelper";
import { SortedByDto } from "~/application/dtos/data/SortedByDto";
import { Prisma } from "@toolctrl/db/prisma-browser";
import { Prisma } from "@hivegrid/db/prisma-browser";
import DateUtils from "../shared/DateUtils";
import { DefaultLogActions } from "~/application/dtos/shared/DefaultLogActions";
import { cachified, clearCacheKey } from "../cache.server";
import { createScopedLogger } from "../logger.server";
import { emitPluginHookFireAndForget } from "~/modules/plugins/services/.server/pluginHookPublisher";
import { PLUGIN_HOOK_USER_CREATED } from "@toolctrl/plugin-runtime";
import { PLUGIN_HOOK_USER_CREATED } from "@hivegrid/plugin-runtime";
const usersLogger = createScopedLogger("db.users");
@@ -417,6 +417,28 @@ export async function disableUserTotp(userId: string | undefined) {
});
}
/**
* Batch variant of `getUserTotpStatus` for list views (e.g. the members table):
* returns the subset of the given user ids that have TOTP fully enabled
* (secret + enabledAt set). Uses a single query instead of one findUnique per
* user, avoiding an N+1 when rendering member lists. The enabled predicate
* matches `getUserTotpStatus().enabled` exactly.
*/
export async function getEnabledTotpUserIds(userIds: string[]): Promise<string[]> {
if (userIds.length === 0) {
return [];
}
const rows = await db.user.findMany({
where: {
id: { in: userIds },
totpSecretEncrypted: { not: null },
totpEnabledAt: { not: null },
},
select: { id: true },
});
return rows.map((row) => row.id);
}
export async function getUserTotpStatus(userId: string | undefined): Promise<UserTotpStatus | null> {
if (!userId) {
return null;