Update hivegrid-cloud reference to latest main
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e98d38e716
commit
7b21524c86
3781 files changed
+373484
-225607
No files matched your search
+2
-2
@@ -1,9 +1,9 @@
|
||||
import { describe, expect, test } from "vitest";
|
||||
import packageCanonicalUrlUtils, { adminPath as packageAdminPath, appPath as packageAppPath } from "@toolctrl/url";
|
||||
import packageCanonicalUrlUtils, { adminPath as packageAdminPath, appPath as packageAppPath } from "@hivegrid/url";
|
||||
import CanonicalUrlUtils, { adminPath, apiPath, appPath, appUrl, type AppPathOptions } from "./CanonicalUrlUtils";
|
||||
|
||||
describe("CanonicalUrlUtils compatibility shim", () => {
|
||||
test("re-exports named helpers from @toolctrl/url", () => {
|
||||
test("re-exports named helpers from @hivegrid/url", () => {
|
||||
const appOptions: AppPathOptions = { tenantSlug: "acme/team", path: "/settings?tab=billing#plan", mode: "host-aware" };
|
||||
|
||||
expect(appPath(appOptions)).toBe(packageAppPath(appOptions));
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@ export {
|
||||
appPath,
|
||||
appUrl,
|
||||
default,
|
||||
} from "@toolctrl/url";
|
||||
} from "@hivegrid/url";
|
||||
|
||||
export type {
|
||||
AbsoluteUrlOptions,
|
||||
@@ -20,4 +20,4 @@ export type {
|
||||
CanonicalPathOptions,
|
||||
CanonicalUrlMode,
|
||||
PathInput,
|
||||
} from "@toolctrl/url";
|
||||
} from "@hivegrid/url";
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { DomainRoutingConfig } from "@toolctrl/config";
|
||||
import type { DomainRoutingConfig } from "@hivegrid/config";
|
||||
import { adminPath, appPath, type PathInput } from "./CanonicalUrlUtils";
|
||||
|
||||
export type PublicDomainRoutingConfig = Pick<DomainRoutingConfig, "protocol" | "webAppHost" | "adminAppHost" | "apiHost" | "appBaseDomain">;
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ import {
|
||||
getHostRoutingContext,
|
||||
getHostRoutingContextFromRequest,
|
||||
} from "./HostRouting.server";
|
||||
import type { DomainRoutingConfig } from "@toolctrl/config";
|
||||
import type { DomainRoutingConfig } from "@hivegrid/config";
|
||||
|
||||
const config: DomainRoutingConfig = {
|
||||
appBaseDomain: "localhost:3000",
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { getDomainRoutingConfig, hostMatches, normalizeHost, type DomainRoutingConfig, type DomainRoutingEnv } from "@toolctrl/config";
|
||||
import { getDomainRoutingConfig, hostMatches, normalizeHost, type DomainRoutingConfig, type DomainRoutingEnv } from "@hivegrid/config";
|
||||
import { adminPath, apiPath, appPath } from "./CanonicalUrlUtils";
|
||||
import {
|
||||
canonicalAdminRouteSlugs,
|
||||
|
||||
+2
-1
@@ -15,6 +15,7 @@ describe("public route segments", () => {
|
||||
"/healthz",
|
||||
"/readyz",
|
||||
"/mfa-challenge",
|
||||
"/signup",
|
||||
"/unauthorized/foo",
|
||||
"/401",
|
||||
"/403",
|
||||
@@ -52,7 +53,7 @@ describe("public route segments", () => {
|
||||
});
|
||||
|
||||
test("exports reserved slugs for route collision checks", () => {
|
||||
expect(reservedTenantRouteSlugs).toEqual(expect.arrayContaining(["accounts", "analytics", "api", "crm", "docs", "help", "healthcheck", "healthz", "readyz", "swagger", "mcp", "mfa-challenge"]));
|
||||
expect(reservedTenantRouteSlugs).toEqual(expect.arrayContaining(["accounts", "analytics", "api", "crm", "docs", "help", "healthcheck", "healthz", "readyz", "swagger", "mcp", "mfa-challenge", "signup"]));
|
||||
expect(reservedTenantChildRouteSlugs).toEqual(expect.arrayContaining(["settings", "crm", "email-marketing", "workflow-engine", "g", "chat", "internal", "widgets"]));
|
||||
});
|
||||
});
|
||||
+3
-2
@@ -27,6 +27,7 @@ export const publicWebRoutePrefixes = [
|
||||
"/register",
|
||||
"/reset",
|
||||
"/select-tenant",
|
||||
"/signup",
|
||||
"/sitemap.xml",
|
||||
"/subscribe/",
|
||||
"/terms-and-conditions",
|
||||
@@ -41,6 +42,7 @@ export const canonicalAdminRouteSlugs = [
|
||||
"accounts",
|
||||
"analytics",
|
||||
"api",
|
||||
"audit",
|
||||
"audit-trails",
|
||||
"dashboard",
|
||||
"email-sequences",
|
||||
@@ -53,11 +55,10 @@ export const canonicalAdminRouteSlugs = [
|
||||
"marketing-leads",
|
||||
"metrics",
|
||||
"mfa-challenge",
|
||||
"navigation",
|
||||
"notifications",
|
||||
"onboarding",
|
||||
"settings",
|
||||
"setup",
|
||||
"select-tenant",
|
||||
] as const;
|
||||
|
||||
export const disabledPluginRouteSlugs = [
|
||||
|
||||
+2
-1
@@ -6,11 +6,12 @@ describe("subscription URL helpers", () => {
|
||||
it("builds canonical public checkout routes", () => {
|
||||
expect(subscriptionCheckoutPath("acme")).toBe("/subscribe/acme");
|
||||
expect(subscriptionCheckoutPath("acme", "{CHECKOUT_SESSION_ID}/success")).toBe("/subscribe/acme/{CHECKOUT_SESSION_ID}/success");
|
||||
expect(subscriptionRequiredCheckoutPath("acme")).toBe("/subscribe/acme?error=subscription_required");
|
||||
expect(subscriptionRequiredCheckoutPath("acme")).toBe("/acme/settings/subscription?subscription_required=1");
|
||||
});
|
||||
|
||||
it("encodes tenant slugs as one route segment", () => {
|
||||
expect(subscriptionCheckoutPath(" Acme Team/West ")).toBe("/subscribe/Acme%20Team%2FWest");
|
||||
expect(() => subscriptionCheckoutPath(" ")).toThrow("tenantSlug is required");
|
||||
expect(() => subscriptionRequiredCheckoutPath(" ")).toThrow("tenantSlug is required");
|
||||
});
|
||||
});
|
||||
+8
-1
@@ -1,3 +1,5 @@
|
||||
import { appPath } from "~/utils/app/CanonicalUrlUtils";
|
||||
|
||||
export function subscriptionCheckoutPath(tenantSlug: string, path?: string) {
|
||||
const tenantSegment = tenantSlug.trim();
|
||||
if (!tenantSegment) {
|
||||
@@ -19,5 +21,10 @@ export function subscriptionCheckoutPath(tenantSlug: string, path?: string) {
|
||||
}
|
||||
|
||||
export function subscriptionRequiredCheckoutPath(tenantSlug: string) {
|
||||
return subscriptionCheckoutPath(tenantSlug, "?error=subscription_required");
|
||||
const tenantSegment = tenantSlug.trim();
|
||||
if (!tenantSegment) {
|
||||
throw new Error("tenantSlug is required");
|
||||
}
|
||||
|
||||
return appPath({ tenantSlug: tenantSegment, path: "settings/subscription?subscription_required=1", mode: "host-aware" });
|
||||
}
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import { vi, describe, it, expect } from "vitest";
|
||||
import SubscriptionUtils from "./SubscriptionUtils";
|
||||
import { SubscriptionBillingPeriod } from "~/application/enums/subscriptions/SubscriptionBillingPeriod";
|
||||
import { Prisma } from "@toolctrl/db/prisma-browser";
|
||||
import { Prisma } from "@hivegrid/db/prisma-browser";
|
||||
import DateUtils from "../shared/DateUtils";
|
||||
|
||||
describe("getProductTitle", () => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { TenantUser } from "@toolctrl/db/prisma-browser";
|
||||
import type { TenantUser } from "@hivegrid/db/prisma-browser";
|
||||
import { TenantUserType } from "~/application/enums/tenants/TenantUserType";
|
||||
|
||||
export const avatarText = (user: { firstName: string | null; lastName: string | null; email: string }): string => {
|
||||
|
||||
Reference in new issue
Block a user