43 lines
688 B
TypeScript
43 lines
688 B
TypeScript
// services.ts
|
|
|
|
import { AuthService, InMemoryAuthStore } from "../auth";
|
|
import { config } from "../config";
|
|
import { getLogs, log } from "../logging";
|
|
|
|
//const database = Client({
|
|
|
|
//})
|
|
|
|
const database = {};
|
|
|
|
const logging = {
|
|
log,
|
|
getLogs,
|
|
};
|
|
|
|
const random = {
|
|
randomNumber: () => {
|
|
return Math.random();
|
|
},
|
|
};
|
|
|
|
const misc = {
|
|
sleep: (ms: number) => {
|
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
},
|
|
};
|
|
|
|
// Initialize auth with in-memory store
|
|
const authStore = new InMemoryAuthStore();
|
|
const auth = new AuthService(authStore);
|
|
|
|
const services = {
|
|
database,
|
|
logging,
|
|
misc,
|
|
random,
|
|
auth,
|
|
};
|
|
|
|
export { services };
|