docs(snapshot): tag profile-level vs company-scoped fields
Adds an inline comment partition and typed PROFILE_LEVEL_KEYS / COMPANY_SCOPED_KEYS constants on ProfileSnapshot so callers can reason about which fields survive a company switch. Shape is unchanged; renderer consumption is unaffected.
This commit is contained in:
1 parent
24ea9cff69
commit
0f881097bc
1 file changed
+40
@@ -25,6 +25,7 @@ import type {
|
|||||||
} from "./records-extended";
|
} from "./records-extended";
|
||||||
|
|
||||||
export interface ProfileSnapshot {
|
export interface ProfileSnapshot {
|
||||||
|
// ─── Profile-level (shared across all companies) ─────────────────────────
|
||||||
currentCompanyId: string | null;
|
currentCompanyId: string | null;
|
||||||
profilePath: string;
|
profilePath: string;
|
||||||
updatesEnabled: boolean;
|
updatesEnabled: boolean;
|
||||||
@@ -35,6 +36,7 @@ export interface ProfileSnapshot {
|
|||||||
};
|
};
|
||||||
companies: CompanyRecord[];
|
companies: CompanyRecord[];
|
||||||
connectors: ConnectorRecord[];
|
connectors: ConnectorRecord[];
|
||||||
|
// ─── Company-scoped collections (current company only) ───────────────────
|
||||||
workspaces: WorkspaceRecord[];
|
workspaces: WorkspaceRecord[];
|
||||||
agents: AgentRecord[];
|
agents: AgentRecord[];
|
||||||
goals: GoalRecord[];
|
goals: GoalRecord[];
|
||||||
@@ -56,3 +58,41 @@ export interface ProfileSnapshot {
|
|||||||
workflows: WorkflowPipelineRecord[];
|
workflows: WorkflowPipelineRecord[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Fields that are shared across companies and loaded regardless of currentCompanyId. */
|
||||||
|
export const PROFILE_LEVEL_KEYS = [
|
||||||
|
"currentCompanyId",
|
||||||
|
"profilePath",
|
||||||
|
"updatesEnabled",
|
||||||
|
"theme",
|
||||||
|
"locale",
|
||||||
|
"backend",
|
||||||
|
"companies",
|
||||||
|
"connectors",
|
||||||
|
] as const satisfies ReadonlyArray<keyof ProfileSnapshot>;
|
||||||
|
|
||||||
|
/** Fields that are filtered to the current company; switching companies reloads these. */
|
||||||
|
export const COMPANY_SCOPED_KEYS = [
|
||||||
|
"workspaces",
|
||||||
|
"agents",
|
||||||
|
"goals",
|
||||||
|
"projects",
|
||||||
|
"tasks",
|
||||||
|
"approvals",
|
||||||
|
"runs",
|
||||||
|
"costs",
|
||||||
|
"activity",
|
||||||
|
"secrets",
|
||||||
|
"comments",
|
||||||
|
"socialAccounts",
|
||||||
|
"meetings",
|
||||||
|
"documents",
|
||||||
|
"knowledgeBase",
|
||||||
|
"sprints",
|
||||||
|
"automationRules",
|
||||||
|
"agentMessages",
|
||||||
|
"workflows",
|
||||||
|
] as const satisfies ReadonlyArray<keyof ProfileSnapshot>;
|
||||||
|
|
||||||
|
export type ProfileLevelKey = typeof PROFILE_LEVEL_KEYS[number];
|
||||||
|
export type CompanyScopedKey = typeof COMPANY_SCOPED_KEYS[number];
|
||||||
|
|
||||||
Reference in new issue
Block a user