mirror of
https://github.com/outline/outline.git
synced 2026-11-26 07:33:19 +03:00
* feat: Add plan-based feature entitlements * feat: Gate audit log behind AuditLog entitlement * Guard guests * features
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
import { pick } from "es-toolkit";
|
|
import { TeamPreference } from "@shared/types";
|
|
import type { Team } from "@server/models";
|
|
|
|
export default function presentTeam(team: Team) {
|
|
return {
|
|
id: team.id,
|
|
name: team.name,
|
|
description: team.description,
|
|
avatarUrl: team.avatarUrl,
|
|
sharing: team.sharing,
|
|
memberCollectionCreate: team.memberCollectionCreate,
|
|
memberTeamCreate: team.memberTeamCreate,
|
|
defaultCollectionId: team.defaultCollectionId,
|
|
documentEmbeds: team.documentEmbeds,
|
|
guestSignin: team.emailSigninEnabled,
|
|
passkeysEnabled: team.passkeysEnabled,
|
|
subdomain: team.subdomain,
|
|
domain: team.domain,
|
|
url: team.url,
|
|
defaultUserRole: team.defaultUserRole,
|
|
inviteRequired: team.inviteRequired,
|
|
allowedDomains: team.allowedDomains?.map((d) => d.name),
|
|
// Unrecognized keys are omitted so that clients can safely send the object back.
|
|
preferences: team.preferences
|
|
? pick(team.preferences, Object.values(TeamPreference))
|
|
: team.preferences,
|
|
guidanceMCP: team.guidanceMCP,
|
|
plan: team.plan,
|
|
entitlements: team.entitlements,
|
|
};
|
|
}
|