@syncot/auth
Advanced tools
Comparing version 0.0.11 to 0.0.12
@@ -7,6 +7,4 @@ import { Presence } from '@syncot/presence'; | ||
export interface AuthEvents { | ||
user: void; | ||
auth: void; | ||
authEnd: void; | ||
userEnd: void; | ||
active: void; | ||
inactive: void; | ||
error: Error; | ||
@@ -17,22 +15,20 @@ } | ||
* | ||
* @event user A user ID has been set. | ||
* @event auth The user ID has been authenticated. | ||
* @event authEnd The user ID is no longer authenticated. | ||
* @event userEnd The user ID has been unset. | ||
* @event error An auth-related error has occurred. The system will attempt to recover automatically. | ||
* @event destroy The AuthManager has been destroyed. | ||
* @event active The AuthClient has an authenticated user. | ||
* @event inactive The AuthClient no longer has an authenticated. | ||
* @event error The AuthClient has experienced an error. | ||
* @event destroy The AuthClient has been destroyed. | ||
*/ | ||
export interface AuthClient extends EmitterInterface<SyncOtEmitter<AuthEvents>> { | ||
/** | ||
* Gets the user ID, if present, otherwise returns undefined. | ||
* If a user is authenticated, then `true`, otherwise `false`. | ||
*/ | ||
getUserId(): string | undefined; | ||
readonly active: boolean; | ||
/** | ||
* Returns true, if the user ID is present, otherwise returns false. | ||
* If `active===true`, then a session ID, otherwise `undefined`. | ||
*/ | ||
hasUserId(): boolean; | ||
readonly sessionId: string | undefined; | ||
/** | ||
* Returns true, if the user ID has been authenticated, otherwise returns false. | ||
* If `active===true`, then the ID of the authenticated user, otherwise `undefined`. | ||
*/ | ||
hasAuthenticatedUserId(): boolean; | ||
readonly userId: string | undefined; | ||
} | ||
@@ -42,11 +38,21 @@ /** | ||
* | ||
* @event user A user ID has been set. | ||
* @event auth The user ID has been authenticated. | ||
* @event authEnd The user ID is no longer authenticated. | ||
* @event userEnd The user ID has been unset. | ||
* @event error An auth-related error has occurred. The system will attempt to recover automatically. | ||
* @event destroy The AuthManager has been destroyed. | ||
* @event active The AuthService has an authenticated user. | ||
* @event inactive The AuthService no longer has an authenticated user. | ||
* @event error The AuthService has experienced an error. | ||
* @event destroy The AuthService has been destroyed. | ||
*/ | ||
export interface AuthService extends AuthClient { | ||
export interface AuthService extends EmitterInterface<SyncOtEmitter<AuthEvents>> { | ||
/** | ||
* If a user is authenticated, then `true`, otherwise `false`. | ||
*/ | ||
readonly active: boolean; | ||
/** | ||
* If `active===true`, then a session ID, otherwise `undefined`. | ||
*/ | ||
readonly sessionId: string | undefined; | ||
/** | ||
* If `active===true`, then the ID of the authenticated user, otherwise `undefined`. | ||
*/ | ||
readonly userId: string | undefined; | ||
/** | ||
* Determines if the user may read from the specified document. | ||
@@ -53,0 +59,0 @@ */ |
{ | ||
"name": "@syncot/auth", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"description": "Interfaces and type definitions related to authentication and authorization.", | ||
@@ -30,7 +30,7 @@ "keywords": [ | ||
"dependencies": { | ||
"@syncot/presence": "^0.0.10", | ||
"@syncot/util": "^0.0.7", | ||
"@syncot/presence": "^0.0.11", | ||
"@syncot/util": "^0.0.8", | ||
"tslib": "^1.9.3" | ||
}, | ||
"gitHead": "f42e7403c10d1236587af99fc13d35b2a27a55ad" | ||
"gitHead": "888dd1570ed3023173b3b5bbafad0f29271b246f" | ||
} |
4352
71
+ Added@syncot/presence@0.0.11(transitive)
+ Added@syncot/util@0.0.8(transitive)
+ Added@types/node@12.20.55(transitive)
- Removed@syncot/presence@0.0.10(transitive)
- Removed@syncot/util@0.0.7(transitive)
- Removed@types/node@10.17.60(transitive)
Updated@syncot/presence@^0.0.11
Updated@syncot/util@^0.0.8