@gtsc/api-auth-entity-storage-models
Advanced tools
Comparing version 0.0.3-next.63 to 0.0.3-next.64
export * from "./models/api/ILoginRequest"; | ||
export * from "./models/api/ILoginResponse"; | ||
export * from "./models/api/ILogoutRequest"; | ||
export * from "./models/api/IRefreshTokenRequest"; | ||
export * from "./models/api/IRefreshTokenResponse"; | ||
export * from "./models/IAuthentication"; |
@@ -10,6 +10,6 @@ /** | ||
/** | ||
* The access token for future requests. | ||
* The access token, if it uses a mechanism with public access. | ||
*/ | ||
token: string; | ||
token?: string; | ||
}; | ||
} |
@@ -11,5 +11,19 @@ import type { IService, IServiceRequestContext } from "@gtsc/services"; | ||
* @param requestContext The context for the request. | ||
* @returns The authentication token for the user. | ||
* @returns The authentication token for the user, if it uses a mechanism with public access. | ||
*/ | ||
login(email: string, password: string, requestContext?: IServiceRequestContext): Promise<string>; | ||
login(email: string, password: string, requestContext?: IServiceRequestContext): Promise<string | undefined>; | ||
/** | ||
* Logout the current user. | ||
* @param token The token to logout, if it uses a mechanism with public access. | ||
* @param requestContext The context for the request. | ||
* @returns Nothing. | ||
*/ | ||
logout(token?: string, requestContext?: IServiceRequestContext): Promise<void>; | ||
/** | ||
* Refresh the token. | ||
* @param token The token to refresh, if it uses a mechanism with public access. | ||
* @param requestContext The context for the request. | ||
* @returns The refreshed token, if it uses a mechanism with public access. | ||
*/ | ||
refresh(token?: string, requestContext?: IServiceRequestContext): Promise<string | undefined>; | ||
} |
@@ -8,1 +8,4 @@ # @gtsc/api-auth-entity-storage-models | ||
- [ILoginResponse](interfaces/ILoginResponse.md) | ||
- [ILogoutRequest](interfaces/ILogoutRequest.md) | ||
- [IRefreshTokenRequest](interfaces/IRefreshTokenRequest.md) | ||
- [IRefreshTokenResponse](interfaces/IRefreshTokenResponse.md) |
@@ -105,3 +105,3 @@ # Interface: IAuthentication | ||
> **login**(`email`, `password`, `requestContext`?): `Promise`\<`string`\> | ||
> **login**(`email`, `password`, `requestContext`?): `Promise`\<`undefined` \| `string`\> | ||
@@ -126,4 +126,52 @@ Perform a login for the user. | ||
`Promise`\<`string`\> | ||
`Promise`\<`undefined` \| `string`\> | ||
The authentication token for the user. | ||
The authentication token for the user, if it uses a mechanism with public access. | ||
*** | ||
### logout() | ||
> **logout**(`token`?, `requestContext`?): `Promise`\<`void`\> | ||
Logout the current user. | ||
#### Parameters | ||
• **token?**: `string` | ||
The token to logout, if it uses a mechanism with public access. | ||
• **requestContext?**: `IServiceRequestContext` | ||
The context for the request. | ||
#### Returns | ||
`Promise`\<`void`\> | ||
Nothing. | ||
*** | ||
### refresh() | ||
> **refresh**(`token`?, `requestContext`?): `Promise`\<`undefined` \| `string`\> | ||
Refresh the token. | ||
#### Parameters | ||
• **token?**: `string` | ||
The token to refresh, if it uses a mechanism with public access. | ||
• **requestContext?**: `IServiceRequestContext` | ||
The context for the request. | ||
#### Returns | ||
`Promise`\<`undefined` \| `string`\> | ||
The refreshed token, if it uses a mechanism with public access. |
@@ -13,6 +13,6 @@ # Interface: ILoginResponse | ||
#### token | ||
#### token? | ||
> **token**: `string` | ||
> `optional` **token**: `string` | ||
The access token for future requests. | ||
The access token, if it uses a mechanism with public access. |
{ | ||
"name": "@gtsc/api-auth-entity-storage-models", | ||
"version": "0.0.3-next.63", | ||
"version": "0.0.3-next.64", | ||
"description": "Models which define the structure of the Auth Entity Storage contracts.", | ||
@@ -5,0 +5,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20917
23
110