feat(TALE-7): reimplement integration system

This commit is contained in:
Aarnav Tale 2024-07-09 22:53:00 -04:00
parent 3cc726320a
commit 0aa0406ea6
No known key found for this signature in database
6 changed files with 356 additions and 375 deletions

View file

@ -0,0 +1,14 @@
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export interface IntegrationFactory<T = any> {
name: string
context: T
isAvailable: (context: T) => Promise<boolean> | boolean
onAclChange?: (context: T) => Promise<void> | void
onConfigChange?: (context: T) => Promise<void> | void
}
export function createIntegration<T>(
options: IntegrationFactory<T>,
) {
return options
}