fix: fix integrations not loading
This commit is contained in:
parent
d5fb8a2966
commit
1fb084451d
12 changed files with 184 additions and 202 deletions
16
app/server/config/integration/abstract.ts
Normal file
16
app/server/config/integration/abstract.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import type { ApiClient } from '~/server/headscale/api-client';
|
||||
|
||||
export abstract class Integration<T> {
|
||||
protected context: NonNullable<T>;
|
||||
constructor(context: T) {
|
||||
if (!context) {
|
||||
throw new Error('Missing integration context');
|
||||
}
|
||||
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
abstract isAvailable(): Promise<boolean> | boolean;
|
||||
abstract onConfigChange(client: ApiClient): Promise<void> | void;
|
||||
abstract get name(): string;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue