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 { Prisma, Role, Tenant, TenantInboundAddress, TenantSettingsRow, TenantType, TenantUser } from "@toolctrl/db/prisma-browser";
import { Prisma, Role, Tenant, TenantInboundAddress, TenantType, TenantUser } from "@hivegrid/db/prisma-browser";
import { FiltersDto } from "~/application/dtos/data/FiltersDto";
import { PaginationDto } from "~/application/dtos/data/PaginationDto";
import { TenantUserJoined } from "~/application/enums/tenants/TenantUserJoined";
@@ -10,14 +10,12 @@ import { getAvailableTenantInboundAddress } from "../services/emailService";
import { createUserRole } from "./permissions/userRoles.db.server";
import { TenantSubscriptionWithDetails, createTenantSubscription } from "./tenantSubscriptions.db.server";
import { UserSimple, UserWithRoles } from "./users.db.server";
import { RowWithDetails } from "./entities/rows.db.server";
import { getAvailableTenantSlug } from "../services/tenantService";
import RowModelHelper from "../helpers/models/RowModelHelper";
import TenantModelHelper from "../helpers/models/TenantModelHelper";
import TenantSubscriptionProductModelHelper from "../helpers/models/TenantSubscriptionProductModelHelper";
import { cachified, clearCacheKey, clearCacheKeyPrefix } from "../cache.server";
import { emitPluginHookFireAndForget } from "~/modules/plugins/services/.server/pluginHookPublisher";
import { PLUGIN_HOOK_TENANT_CREATED } from "@toolctrl/plugin-runtime";
import { PLUGIN_HOOK_TENANT_CREATED } from "@hivegrid/plugin-runtime";
export type TenantSimple = {
id: string;
@@ -42,7 +40,6 @@ export type TenantWithDetails = Tenant & {
user: UserSimple;
})[];
subscription: TenantSubscriptionWithDetails | null;
tenantSettingsRow: (TenantSettingsRow & { row: RowWithDetails }) | null;
types: TenantType[];
};
@@ -50,7 +47,6 @@ export type TenantWithUsage = TenantWithDetails & {
_count: {
users?: number;
invitations?: number;
rows?: number;
logs?: number;
apiKeys?: number;
events?: number;
@@ -155,7 +151,6 @@ export async function adminGetAllTenantsWithUsage(
products: { include: { ...TenantSubscriptionProductModelHelper.includeTenantSubscriptionProductDetails } },
},
},
tenantSettingsRow: { include: { row: { include: RowModelHelper.includeRowDetails } } },
types: true,
_count: true,
},
@@ -445,6 +440,23 @@ export async function updateTenantTheme(id: string, data: { theme: string | null
});
}
export async function updateTenantAnrede(id: string, anrede: string) {
return await db.tenant
.update({
where: { id },
data: { anrede },
})
.then((item) => {
clearCacheKey(`tenant:${item.slug}`);
clearCacheKey(`tenant:${item.id}`);
clearCacheKey(`tenantIdOrSlug:${item.id}`);
clearCacheKey(`tenantIdOrSlug:${item.slug}`);
clearCacheKey(`tenantSimple:${item.id}`);
clearCacheKeyPrefix("apiKeyHash:");
return item;
});
}
export async function addTenantTypeToTenant(id: string, data: { typeId: string }) {
return await db.tenant
.update({
@@ -605,7 +617,6 @@ export async function deleteTenant(id: string) {
subscription: true,
users: true,
invitations: true,
rows: true,
logs: true,
apiKeys: true,
userRoles: true,