forked from BeOnAuto/auto-engineer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathintegration-registry.ts
More file actions
35 lines (27 loc) · 1004 Bytes
/
integration-registry.ts
File metadata and controls
35 lines (27 loc) · 1004 Bytes
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
35
// integration-helper.ts - Add this to your flowlang package
import { Integration } from './types';
// Global registry for integrations
class GlobalIntegrationRegistry {
private integrations = new Map<string, Integration>();
register(integration: Integration) {
console.log(`[GlobalIntegrationRegistry] Registering integration: ${integration.name}`);
this.integrations.set(integration.name, integration);
}
getAll(): Integration[] {
return Array.from(this.integrations.values());
}
clear() {
this.integrations.clear();
}
get(name: string): Integration | undefined {
return this.integrations.get(name);
}
}
export const globalIntegrationRegistry = new GlobalIntegrationRegistry();
export const registerIntegrations = (...integrations: Integration[]) => {
for (const integration of integrations) {
globalIntegrationRegistry.register(integration);
}
};
// Export for use in schema generation
export { globalIntegrationRegistry as integrationRegistry };