50 lines
2.1 KiB
TypeScript
50 lines
2.1 KiB
TypeScript
import { DefaultFeatures } from "~/application/dtos/shared/DefaultFeatures";
|
|
import type { FeatureFlagsFilterType } from "~/modules/featureFlags/dtos/FeatureFlagsFilterTypes";
|
|
import { t as i18nT } from "i18next";
|
|
|
|
export type OnboardingRegisteredStepId = "profile-basics" | "team-invites" | "priority-support-setup";
|
|
|
|
export interface OnboardingRegisteredStepDefinition {
|
|
readonly id: OnboardingRegisteredStepId;
|
|
readonly title: string;
|
|
readonly description: string;
|
|
readonly featureFlagKey?: FeatureFlagsFilterType;
|
|
readonly planFeatureKey?: DefaultFeatures | string;
|
|
}
|
|
|
|
export const onboardingStepRegistry = Object.freeze([
|
|
{
|
|
id: "profile-basics",
|
|
title: i18nT("onboarding.stepRegistry.profileBasics.title"),
|
|
description: i18nT("onboarding.stepRegistry.profileBasics.description"),
|
|
},
|
|
{
|
|
id: "team-invites",
|
|
title: i18nT("onboarding.stepRegistry.teamInvites.title"),
|
|
description: i18nT("onboarding.stepRegistry.teamInvites.description"),
|
|
featureFlagKey: "workspace-roles",
|
|
},
|
|
{
|
|
id: "priority-support-setup",
|
|
title: i18nT("onboarding.stepRegistry.prioritySupportSetup.title"),
|
|
description: i18nT("onboarding.stepRegistry.prioritySupportSetup.description"),
|
|
planFeatureKey: DefaultFeatures.PrioritySupport,
|
|
},
|
|
] as const satisfies readonly OnboardingRegisteredStepDefinition[]);
|
|
|
|
const onboardingStepIds = onboardingStepRegistry.map((step) => step.id) as readonly OnboardingRegisteredStepId[];
|
|
const onboardingGateSources = Object.freeze(["feature-flag", "plan"] as const);
|
|
|
|
export const onboardingStepRegistryEvidence = Object.freeze({
|
|
registryName: "Onboarding Step Registry",
|
|
registryScope: "source-backed-onboarding-steps",
|
|
expectedStepIds: onboardingStepIds,
|
|
gatingSourcesRepresented: onboardingGateSources,
|
|
redactionGuarantee:
|
|
"Onboarding step registry evidence is static source metadata only and excludes request, tenant, subscription, user, token, environment, and raw feature input values.",
|
|
} as const);
|
|
|
|
export function getOnboardingStepDefinitions(): readonly OnboardingRegisteredStepDefinition[] {
|
|
return onboardingStepRegistry;
|
|
}
|