feat: workflows & plugins (#26727)

feat: plugins

chore: better types

feat: plugins
This commit is contained in:
Jason Rasmussen
2026-05-18 11:09:33 -04:00
committed by GitHub
parent 7384799f19
commit 3d075f2bf8
144 changed files with 6099 additions and 7419 deletions
+61
View File
@@ -58,6 +58,7 @@ import { ViewRepository } from 'src/repositories/view-repository';
import { WebsocketRepository } from 'src/repositories/websocket.repository';
import { WorkflowRepository } from 'src/repositories/workflow.repository';
import { UserTable } from 'src/schema/tables/user.table';
import { ClassConstructor } from 'src/types';
import { AccessRequest, checkAccess, requireAccess } from 'src/utils/access';
import { getConfig, updateConfig } from 'src/utils/config';
@@ -187,6 +188,66 @@ export class BaseService {
);
}
static create<T extends BaseService>(Service: ClassConstructor<T>, ctx: BaseService) {
const service = new Service(
LoggingRepository.create(),
ctx.accessRepository,
ctx.activityRepository,
ctx.albumRepository,
ctx.albumUserRepository,
ctx.apiKeyRepository,
ctx.appRepository,
ctx.assetRepository,
ctx.assetEditRepository,
ctx.assetJobRepository,
ctx.configRepository,
ctx.cronRepository,
ctx.cryptoRepository,
ctx.databaseRepository,
ctx.downloadRepository,
ctx.duplicateRepository,
ctx.emailRepository,
ctx.eventRepository,
ctx.jobRepository,
ctx.libraryRepository,
ctx.machineLearningRepository,
ctx.mapRepository,
ctx.mediaRepository,
ctx.memoryRepository,
ctx.metadataRepository,
ctx.moveRepository,
ctx.notificationRepository,
ctx.oauthRepository,
ctx.ocrRepository,
ctx.partnerRepository,
ctx.personRepository,
ctx.pluginRepository,
ctx.processRepository,
ctx.searchRepository,
ctx.serverInfoRepository,
ctx.sessionRepository,
ctx.sharedLinkRepository,
ctx.sharedLinkAssetRepository,
ctx.stackRepository,
ctx.storageRepository,
ctx.syncRepository,
ctx.syncCheckpointRepository,
ctx.systemMetadataRepository,
ctx.tagRepository,
ctx.telemetryRepository,
ctx.trashRepository,
ctx.userRepository,
ctx.versionRepository,
ctx.viewRepository,
ctx.websocketRepository,
ctx.workflowRepository,
);
service.logger.setContext(this.name);
return service as T;
}
get worker() {
return this.configRepository.getWorker();
}