@syncot/auth
Advanced tools
Comparing version 0.0.24 to 0.0.25
@@ -6,2 +6,10 @@ # Change Log | ||
## [0.0.25](https://github.com/SyncOT/SyncOT/compare/@syncot/auth@0.0.24...@syncot/auth@0.0.25) (2020-11-10) | ||
**Note:** Version bump only for package @syncot/auth | ||
## [0.0.24](https://github.com/SyncOT/SyncOT/compare/@syncot/auth@0.0.23...@syncot/auth@0.0.24) (2020-11-03) | ||
@@ -8,0 +16,0 @@ |
@@ -1,70 +0,1 @@ | ||
import { EmitterInterface, SyncOtEmitter } from '@syncot/events'; | ||
import { Presence } from '@syncot/presence'; | ||
/** | ||
* Events emitted by `AuthService` and `AuthClient`. | ||
*/ | ||
export interface AuthEvents { | ||
active: void; | ||
inactive: void; | ||
error: Error; | ||
} | ||
/** | ||
* Manages authentication and authorization on the client side. | ||
* | ||
* @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>> { | ||
/** | ||
* 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; | ||
} | ||
/** | ||
* Manages authentication and authorization on the server side. | ||
* | ||
* @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 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. | ||
*/ | ||
mayReadDocument(typeName: string, id: string): boolean | Promise<boolean>; | ||
/** | ||
* Determines if the user may write to the specified document. | ||
*/ | ||
mayWriteDocument(typeName: string, id: string): boolean | Promise<boolean>; | ||
/** | ||
* Determines if the user may read/load the specified presence object. | ||
*/ | ||
mayReadPresence(presence: Presence): boolean; | ||
/** | ||
* Determines if the user may write/store the specified presence object. | ||
*/ | ||
mayWritePresence(presence: Presence): boolean; | ||
} | ||
export * from './auth'; |
@@ -1,1 +0,1 @@ | ||
export {}; | ||
export * from './auth'; |
{ | ||
"name": "@syncot/auth", | ||
"version": "0.0.24", | ||
"version": "0.0.25", | ||
"description": "Interfaces and type definitions related to authentication and authorization.", | ||
@@ -30,7 +30,7 @@ "keywords": [ | ||
"dependencies": { | ||
"@syncot/events": "^0.1.2", | ||
"@syncot/presence": "^0.0.22", | ||
"@syncot/events": "^0.1.3", | ||
"@syncot/presence": "^0.0.23", | ||
"tslib": "^2.0.3" | ||
}, | ||
"gitHead": "2399fa565e50dcfc2f4d37afd567c6cbcfdccb15" | ||
"gitHead": "5ba3e377863fb1d00a2c1fb556ae6832f9950ada" | ||
} |
6027
7
73
+ Added@syncot/presence@0.0.23(transitive)
- Removed@syncot/error@0.2.1(transitive)
- Removed@syncot/presence@0.0.22(transitive)
Updated@syncot/events@^0.1.3
Updated@syncot/presence@^0.0.23