Add isReady and isConfigured docs to APL section (#80)

This commit is contained in:
Lukasz Ostrowski 2022-10-12 15:16:36 +02:00 committed by GitHub
parent bec148e696
commit ed9c94299e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,6 +12,34 @@ APL is an interface for managing auth data of registered Apps. Implementing it d
- `getAll: () => Promise<AuthData[]>` - Returns all auth data available.
- `isReady: () => Promise<AplReadyResult>` - Check if persistence layer behind APL is ready. For example: database connection established
- `isConfigured: () => Promise<AplConfiguredResult>` - 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: