( installationStatuses: readonly PlatformIntegrationSetupStatus[], organizationId?: string )
| 121 | } |
| 122 | |
| 123 | export 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 | } |
no test coverage detected