MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / buildPlatforms

Function buildPlatforms

apps/web/src/lib/integrations/platform-definitions.ts:123–144  ·  view source on GitHub ↗
(
  installationStatuses: readonly PlatformIntegrationSetupStatus[],
  organizationId?: string
)

Source from the content-addressed store, hash-verified

121}
122
123export function buildPlatforms(
124 installationStatuses: readonly PlatformIntegrationSetupStatus[],
125 organizationId?: string
126): Platform[] {
127 const installations = buildInstallationStatusMap(installationStatuses);
128
129 return getPlatformDefinitionsForOwner(organizationId)
130 .filter(def => {
131 if (def.hiddenUnlessInstalled) {
132 return installations[def.id as keyof InstallationStatus]?.installed === true;
133 }
134 return true;
135 })
136 .map(def => ({
137 id: def.id,
138 name: def.name,
139 description: def.description,
140 status: getStatus(def.id, installations),
141 enabled: def.enabled,
142 route: organizationId ? def.orgRoute?.(organizationId) : def.personalRoute,
143 }));
144}

Callers 2

IntegrationsHubFunction · 0.90

Calls 3

getStatusFunction · 0.85

Tested by

no test coverage detected