diff --git a/docs/apl.md b/docs/apl.md index 8370c62..cf8d7e3 100644 --- a/docs/apl.md +++ b/docs/apl.md @@ -12,6 +12,34 @@ APL is an interface for managing auth data of registered Apps. Implementing it d - `getAll: () => Promise` - Returns all auth data available. +- `isReady: () => Promise` - Check if persistence layer behind APL is ready. For example: database connection established + +- `isConfigured: () => Promise` - Check if persistence layer behind APL is configured. For example: env variable required by database connection + +## AplReadyResult & ApConfiguredResult + +Responses from `isReady()` and `isConfigured()` should match following: + +```ts +type AplReadyResult = + | { + ready: true; + } + | { + ready: false; + error: Error; + }; + +type AplConfiguredResult = + | { + configured: true; + } + | { + configured: false; + error: Error; + }; +``` + ## Example implementation Let's create an APL, which uses Redis for data storage: