chore: seperate into packages
This commit is contained in:
@@ -1 +1,4 @@
|
||||
export * from './api.js';
|
||||
export { Services } from './utils/utils.services.js';
|
||||
export { StashRuntime } from './runtime.js';
|
||||
export * from './services/documents/documents.js';
|
||||
export * from './services/document-chunks/document-chunks.js';
|
||||
|
||||
@@ -1,14 +1,32 @@
|
||||
import { DocumentChunksService } from './exports.js';
|
||||
import { DatabaseService } from './services/database/database.js';
|
||||
import { DocumentsService } from './services/documents/documents.js';
|
||||
import { WarmupService } from './services/warmup/warmup.js';
|
||||
import { Services } from './utils/utils.services.js';
|
||||
|
||||
class StashRuntime {
|
||||
#services: Services;
|
||||
|
||||
constructor(services: Services) { }
|
||||
constructor(services = new Services()) {
|
||||
this.#services = services;
|
||||
services.set(StashRuntime, this);
|
||||
}
|
||||
|
||||
public get database() {
|
||||
return this.#services.get(DatabaseService);
|
||||
}
|
||||
|
||||
public get documents() {
|
||||
return this.#services.get(DocumentsService);
|
||||
}
|
||||
|
||||
public get documentChunks() {
|
||||
return this.#services.get(DocumentChunksService);
|
||||
}
|
||||
|
||||
public get warmup() {
|
||||
return this.#services.get(WarmupService);
|
||||
}
|
||||
}
|
||||
|
||||
export { StashRuntime };
|
||||
|
||||
Reference in New Issue
Block a user