-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #154
- Loading branch information
Showing
14 changed files
with
163 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { InMemoryRepository } from '@akdasa-studios/framework' | ||
import { SyncRepository } from '@akdasa-studios/framework-sync' | ||
import { InboxCard, Repositories, ReviewCard, Verse, VerseStatus } from "@akdasa-studios/shlokas-core" | ||
import { | ||
CouchDB, InboxCardDeserializer, | ||
InboxCardSerializer, PouchRepository, ReviewCardDeserializer, | ||
ReviewCardSerializer, VerseStatusDeserializer, VerseStatusSerializer | ||
} from '@/services/persistence' | ||
|
||
|
||
export function createRepositories(remote: string) { | ||
const couchDB = new CouchDB(remote) | ||
return new Repositories( | ||
new InMemoryRepository<Verse>(), | ||
new SyncRepository(new PouchRepository<VerseStatus>( | ||
couchDB, | ||
"verseStatus", | ||
new VerseStatusSerializer(), | ||
new VerseStatusDeserializer() | ||
)), | ||
new SyncRepository(new PouchRepository<InboxCard>( | ||
couchDB, | ||
"inbox", | ||
new InboxCardSerializer(), | ||
new InboxCardDeserializer() | ||
)), | ||
new SyncRepository(new PouchRepository<ReviewCard>( | ||
couchDB, | ||
"review", | ||
new ReviewCardSerializer(), | ||
new ReviewCardDeserializer() | ||
)), | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { LogRecord, Logs, LogTransport } from '@akdasa-studios/framework' | ||
|
||
|
||
class ConsoleLogTransport implements LogTransport { | ||
log(record: LogRecord): void { | ||
console.log(record.context, record.message, JSON.stringify(record.data)) | ||
} | ||
} | ||
|
||
/** | ||
* Initialize logging system | ||
*/ | ||
export async function initLogging() { | ||
Logs.register(new ConsoleLogTransport()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.