Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
+12
-15
@@ -3,12 +3,12 @@ import { loadRequiredWebConfig } from "@hivegrid/config";
|
||||
import { Prisma } from "@hivegrid/db/prisma-browser";
|
||||
import { getTranslations } from "~/locale/i18next.server";
|
||||
import { getPublicAuthProviders } from "../auth/authProviders.server";
|
||||
import { cachified, clearCacheKey } from "../cache.server";
|
||||
import { db } from "../db.server";
|
||||
import { defaultTheme } from "../theme/defaultThemes";
|
||||
import { getBaseURL, getDomainName } from "../url.server";
|
||||
import { PortalConfiguration, getAppPortalConfiguration } from "./appPortalConfiguration.db.server";
|
||||
import { getWidgetsConfiguration, WidgetsConfiguration } from "./appWidgetsConfiguration.db.server";
|
||||
import { invalidateAppConfigurationCache, loadCachedAppConfiguration } from "./app-configuration-cache.server";
|
||||
|
||||
export type AppConfiguration = {
|
||||
app: {
|
||||
@@ -19,7 +19,6 @@ export type AppConfiguration = {
|
||||
company?: { name: string; address: string };
|
||||
features: {
|
||||
tenantHome: "/:tenant/" | "/";
|
||||
tenantTypes: boolean;
|
||||
tenantApiKeys?: boolean;
|
||||
tenantEntityCustomization?: boolean;
|
||||
crm: boolean;
|
||||
@@ -126,7 +125,6 @@ export async function getAppConfiguration({ request }: { request: Request }): Pr
|
||||
tenantApiKeys: true,
|
||||
tenantEntityCustomization: false,
|
||||
crm: false,
|
||||
tenantTypes: false,
|
||||
tenantWorkflows: false,
|
||||
tenantEmailMarketing: false,
|
||||
tenantFeedback: true,
|
||||
@@ -134,7 +132,10 @@ export async function getAppConfiguration({ request }: { request: Request }): Pr
|
||||
},
|
||||
email: defaultEmailConfig,
|
||||
auth: {
|
||||
requireEmailVerification: false,
|
||||
// A deployment without a persisted AppConfiguration must not silently
|
||||
// skip ownership proof for a public email address. Explicitly configured
|
||||
// rows still override this launch-safe default below.
|
||||
requireEmailVerification: true,
|
||||
requireOrganization: false,
|
||||
requireName: false,
|
||||
slug: { require: false, type: "username" },
|
||||
@@ -202,11 +203,7 @@ export async function getAppConfiguration({ request }: { request: Request }): Pr
|
||||
scripts: { head: null, body: null },
|
||||
};
|
||||
|
||||
const appConfiguration = await cachified({
|
||||
key: `appConfiguration`,
|
||||
ttl: 1000 * 60 * 60 * 24, // 1 day
|
||||
getFreshValue: async () => db.appConfiguration.findFirst(),
|
||||
});
|
||||
const appConfiguration = await loadCachedAppConfiguration(() => db.appConfiguration.findFirst());
|
||||
if (!appConfiguration) {
|
||||
return conf;
|
||||
}
|
||||
@@ -284,8 +281,8 @@ export async function getOrCreateAppConfiguration({ request }: { request: Reques
|
||||
brandingFavicon: conf.branding.favicon,
|
||||
},
|
||||
})
|
||||
.then((item) => {
|
||||
clearCacheKey(`appConfiguration`);
|
||||
.then(async (item) => {
|
||||
await invalidateAppConfigurationCache();
|
||||
return item;
|
||||
});
|
||||
}
|
||||
@@ -308,15 +305,15 @@ export async function updateAppConfiguration(data: Prisma.AppConfigurationUpdate
|
||||
.updateMany({
|
||||
data,
|
||||
})
|
||||
.then((item) => {
|
||||
clearCacheKey(`appConfiguration`);
|
||||
.then(async (item) => {
|
||||
await invalidateAppConfigurationCache();
|
||||
return item;
|
||||
});
|
||||
}
|
||||
|
||||
export async function deleteAppConfiguration() {
|
||||
return await db.appConfiguration.deleteMany({ where: {} }).then((item) => {
|
||||
clearCacheKey(`appConfiguration`);
|
||||
return await db.appConfiguration.deleteMany({ where: {} }).then(async (item) => {
|
||||
await invalidateAppConfigurationCache();
|
||||
return item;
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user