fix: exclude P&L and HR pages from Superhuman client sync
Keeps agency-only ops out of the client-facing seguimiento timeline. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -10,6 +10,7 @@ export const SUPERHUMAN_API_BASE = 'https://docs.superhuman.com/apis/v1';
|
||||
const PASSWORD_RE = /contrase|password|secreto|credential/i;
|
||||
const SEGUIMIENTO_RE = /seguim/i;
|
||||
const KPI_RE = /^kpi|kpis\b/i;
|
||||
const AGENCY_ONLY_RE = /\bp\s*&\s*l\b|\bp&l\b|rrhh|n[oó]mina|contrato|facturaci[oó]n interna/i;
|
||||
|
||||
export type ShDoc = { id: string; name: string; browserLink?: string };
|
||||
export type ShPage = {
|
||||
@@ -242,8 +243,10 @@ export function selectClientFacingPages(pages: ShPage[]): {
|
||||
|
||||
for (const page of pages) {
|
||||
if (isPasswordSensitiveName(page.name)) continue;
|
||||
if (AGENCY_ONLY_RE.test(page.name || '')) continue;
|
||||
const ancestors = pageAncestors(page, byId);
|
||||
if (ancestors.some((a) => isPasswordSensitiveName(a.name))) continue;
|
||||
if (ancestors.some((a) => AGENCY_ONLY_RE.test(a.name || ''))) continue;
|
||||
|
||||
const underSeg = ancestors.some((a) => rootIds.has(a.id) && SEGUIMIENTO_RE.test(a.name));
|
||||
const isRoot = rootIds.has(page.id);
|
||||
|
||||
Reference in New Issue
Block a user