refactor(private-zone): use canonical product name

This commit is contained in:
Codex
2026-07-23 10:53:41 +08:00
parent 4639acf232
commit 9ca56c2a04
103 changed files with 569 additions and 569 deletions
@@ -43,7 +43,7 @@ describe("global route context", () => {
"https://example.com/characters/maya/chat",
"//example.com/characters/maya/chat",
"/characters/unknown/chat",
"/characters/maya/private-zoom",
"/characters/maya/private-zone",
"/characters/maya/chat?image=1",
])("falls back to Elio for an invalid return target", (value) => {
expect(resolveGlobalRouteContextValue(value)).toBe(
@@ -54,15 +54,15 @@ describe("navigation resolver", () => {
).toBe(ROUTE_BUILDERS.authWithRedirect(subscriptionUrl));
});
it("builds private zoom subscription return urls", () => {
it("builds private zone subscription return urls", () => {
expect(
ROUTE_BUILDERS.subscription("topup", {
payChannel: "stripe",
returnTo: "private-zoom",
returnTo: "private-zone",
sourceCharacterSlug: "maya",
}),
).toBe(
"/subscription?type=topup&payChannel=stripe&returnTo=private-zoom&character=maya",
"/subscription?type=topup&payChannel=stripe&returnTo=private-zone&character=maya",
);
});
+5 -5
View File
@@ -8,7 +8,7 @@ describe("route meta", () => {
expect(getRouteAccess(ROUTES.splash)).toBe("authOnly");
expect(getRouteAccess(ROUTES.auth)).toBe("authOnly");
expect(getRouteAccess(ROUTES.chat)).toBe("guestEntry");
expect(getRouteAccess(ROUTES.privateZoom)).toBe("guestEntry");
expect(getRouteAccess(ROUTES.privateZone)).toBe("guestEntry");
expect(getRouteAccess(ROUTES.tip)).toBe("public");
expect(getRouteAccess(ROUTES.externalEntry)).toBe("public");
expect(getRouteAccess(ROUTES.profile)).toBe("realUser");
@@ -26,12 +26,12 @@ describe("route meta", () => {
expect(routes).toEqual({
splash: "/characters/maya/splash",
chat: "/characters/maya/chat",
privateZoom: "/characters/maya/private-zoom",
privateZone: "/characters/maya/private-zone",
tip: "/characters/maya/tip",
});
expect(getRouteAccess(routes.splash)).toBe("authOnly");
expect(getRouteAccess(routes.chat)).toBe("guestEntry");
expect(getRouteAccess(routes.privateZoom)).toBe("guestEntry");
expect(getRouteAccess(routes.privateZone)).toBe("guestEntry");
expect(getRouteAccess(routes.tip)).toBe("public");
});
@@ -41,8 +41,8 @@ describe("route meta", () => {
expect(getRouteAccess("/characters/maya/coins-rules")).toBe("public");
});
it("includes private zoom in static routes", () => {
expect(ALL_STATIC_ROUTES).toContain(ROUTES.privateZoom);
it("includes private zone in static routes", () => {
expect(ALL_STATIC_ROUTES).toContain(ROUTES.privateZone);
});
it("includes tip in static routes", () => {
+1 -1
View File
@@ -9,7 +9,7 @@ import type {
export type AppSubscriptionType = "vip" | "topup";
export type AppSubscriptionReturnTo =
| "chat"
| "private-zoom"
| "private-zone"
| "profile"
| null;
+2 -2
View File
@@ -12,7 +12,7 @@ const GLOBAL_ROUTE_ACCESS: Partial<Record<string, RouteAccess>> = {
[ROUTES.splash]: "authOnly",
[ROUTES.auth]: "authOnly",
[ROUTES.chat]: "guestEntry",
[ROUTES.privateZoom]: "guestEntry",
[ROUTES.privateZone]: "guestEntry",
[ROUTES.tip]: "public",
[ROUTES.externalEntry]: "public",
[ROUTES.profile]: "realUser",
@@ -24,7 +24,7 @@ const GLOBAL_ROUTE_ACCESS: Partial<Record<string, RouteAccess>> = {
const CHARACTER_ROUTE_ACCESS: Readonly<Record<string, RouteAccess>> = {
splash: "authOnly",
chat: "guestEntry",
"private-zoom": "guestEntry",
"private-zone": "guestEntry",
tip: "public",
};
+4 -4
View File
@@ -21,7 +21,7 @@ export const ROUTES = {
root: "/",
splash: "/splash",
chat: "/chat",
privateZoom: "/private-zoom",
privateZone: "/private-zone",
tip: "/tip",
externalEntry: "/external-entry",
auth: "/auth",
@@ -36,7 +36,7 @@ export type StaticRoute = (typeof ROUTES)[keyof typeof ROUTES];
export interface CharacterRoutes {
readonly splash: string;
readonly chat: string;
readonly privateZoom: string;
readonly privateZone: string;
readonly tip: string;
}
@@ -47,7 +47,7 @@ export function getCharacterRoutes(
return {
splash: `${root}/splash`,
chat: `${root}/chat`,
privateZoom: `${root}/private-zoom`,
privateZone: `${root}/private-zone`,
tip: `${root}/tip`,
};
}
@@ -110,7 +110,7 @@ export const ROUTE_BUILDERS = {
export const ALL_STATIC_ROUTES: readonly StaticRoute[] = [
ROUTES.splash,
ROUTES.chat,
ROUTES.privateZoom,
ROUTES.privateZone,
ROUTES.tip,
ROUTES.externalEntry,
ROUTES.auth,