-
Notifications
You must be signed in to change notification settings - Fork 74
/
Copy pathindex.ts
34 lines (31 loc) · 1.11 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import type { ComponentType, SVGProps } from 'react';
import { DevCycle } from './devcycle';
import { EcosystemElement } from '../types';
import { Goff } from './goff';
import { Flipt } from './flipt';
import { Flagd } from './flagd';
export type OFREPElement = Omit<EcosystemElement, 'allTechnologies' | 'technology' | 'category'>;
export const ECOSYSTEM_OFREP_APIS: OFREPElement[] = [DevCycle, Flipt, Goff, Flagd]
.map(
(api): OFREPElement => ({
vendor: api.name,
title: `${api.name} OFREP API`,
description:
typeof api.description === 'string' ? api.description : createDefaultDescription(api.name, api.vendorOfficial),
type: 'OFREP API',
logo: api.logo,
href: api.href,
vendorOfficial: api.vendorOfficial,
}),
)
.flat();
function createDefaultDescription(vendor: string, official: boolean): string {
return official ? `The official ${vendor} OFREP API` : `A community-maintained ${vendor} OFREP API`;
}
export type OFREP_API = {
name: string;
logo: ComponentType<SVGProps<SVGSVGElement>>;
description?: string;
href: string;
vendorOfficial: boolean;
};