mirror of
https://github.com/morten-olsen/mini-loader.git
synced 2026-02-08 01:36:26 +01:00
init
This commit is contained in:
66
packages/server/src/repos/repos.ts
Normal file
66
packages/server/src/repos/repos.ts
Normal file
@@ -0,0 +1,66 @@
|
||||
import { Config } from '../config/config.js';
|
||||
import { Database } from '../database/database.js';
|
||||
import { ArtifactRepo } from './artifacts/artifacts.js';
|
||||
import { LoadRepo } from './loads/loads.js';
|
||||
import { LogRepo } from './logs/logs.js';
|
||||
import { RunRepo } from './runs/runs.js';
|
||||
import { SecretRepo } from './secrets/secrets.js';
|
||||
|
||||
type ReposOptions = {
|
||||
database: Database;
|
||||
config: Config;
|
||||
};
|
||||
|
||||
class Repos {
|
||||
#loads: LoadRepo;
|
||||
#runs: RunRepo;
|
||||
#logs: LogRepo;
|
||||
#artifacts: ArtifactRepo;
|
||||
#secrets: SecretRepo;
|
||||
|
||||
constructor({ database, config }: ReposOptions) {
|
||||
this.#loads = new LoadRepo({
|
||||
database,
|
||||
config,
|
||||
});
|
||||
this.#runs = new RunRepo({
|
||||
database,
|
||||
loads: this.#loads,
|
||||
});
|
||||
this.#logs = new LogRepo({
|
||||
database,
|
||||
});
|
||||
this.#artifacts = new ArtifactRepo({
|
||||
database,
|
||||
});
|
||||
this.#secrets = new SecretRepo({
|
||||
database,
|
||||
});
|
||||
}
|
||||
|
||||
public get loads() {
|
||||
return this.#loads;
|
||||
}
|
||||
|
||||
public get runs() {
|
||||
return this.#runs;
|
||||
}
|
||||
|
||||
public get logs() {
|
||||
return this.#logs;
|
||||
}
|
||||
|
||||
public get artifacts() {
|
||||
return this.#artifacts;
|
||||
}
|
||||
|
||||
public get secrets() {
|
||||
return this.#secrets;
|
||||
}
|
||||
}
|
||||
|
||||
export { findLogsSchema, addLogSchema } from './logs/logs.js';
|
||||
export { setLoadSchema, findLoadsSchema } from './loads/loads.js';
|
||||
export { createRunSchema, findRunsSchema } from './runs/runs.js';
|
||||
export { addArtifactSchema, findArtifactsSchema } from './artifacts/artifacts.js';
|
||||
export { Repos };
|
||||
Reference in New Issue
Block a user