@3sixty/api-auth-entity-storage-models 0.0.0-stage → 0.20.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +24 -2
- package/dist/es/index.js +22 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/models/IAuthenticationAdminComponent.js +2 -0
- package/dist/es/models/IAuthenticationAdminComponent.js.map +1 -0
- package/dist/es/models/IAuthenticationComponent.js +2 -0
- package/dist/es/models/IAuthenticationComponent.js.map +1 -0
- package/dist/es/models/IAuthenticationUser.js +4 -0
- package/dist/es/models/IAuthenticationUser.js.map +1 -0
- package/dist/es/models/IAuthenticationUserSecure.js +2 -0
- package/dist/es/models/IAuthenticationUserSecure.js.map +1 -0
- package/dist/es/models/IPasswordOptions.js +4 -0
- package/dist/es/models/IPasswordOptions.js.map +1 -0
- package/dist/es/models/api/IAdminUserCreateRequest.js +2 -0
- package/dist/es/models/api/IAdminUserCreateRequest.js.map +1 -0
- package/dist/es/models/api/IAdminUserGetByIdentityRequest.js +4 -0
- package/dist/es/models/api/IAdminUserGetByIdentityRequest.js.map +1 -0
- package/dist/es/models/api/IAdminUserGetRequest.js +4 -0
- package/dist/es/models/api/IAdminUserGetRequest.js.map +1 -0
- package/dist/es/models/api/IAdminUserGetResponse.js +2 -0
- package/dist/es/models/api/IAdminUserGetResponse.js.map +1 -0
- package/dist/es/models/api/IAdminUserRemoveRequest.js +4 -0
- package/dist/es/models/api/IAdminUserRemoveRequest.js.map +1 -0
- package/dist/es/models/api/IAdminUserUpdatePasswordRequest.js +4 -0
- package/dist/es/models/api/IAdminUserUpdatePasswordRequest.js.map +1 -0
- package/dist/es/models/api/IAdminUserUpdateRequest.js +2 -0
- package/dist/es/models/api/IAdminUserUpdateRequest.js.map +1 -0
- package/dist/es/models/api/ILoginRequest.js +4 -0
- package/dist/es/models/api/ILoginRequest.js.map +1 -0
- package/dist/es/models/api/ILoginResponse.js +2 -0
- package/dist/es/models/api/ILoginResponse.js.map +1 -0
- package/dist/es/models/api/ILogoutRequest.js +4 -0
- package/dist/es/models/api/ILogoutRequest.js.map +1 -0
- package/dist/es/models/api/IPasswordPolicyResponse.js +2 -0
- package/dist/es/models/api/IPasswordPolicyResponse.js.map +1 -0
- package/dist/es/models/api/IRefreshTokenRequest.js +4 -0
- package/dist/es/models/api/IRefreshTokenRequest.js.map +1 -0
- package/dist/es/models/api/IRefreshTokenResponse.js +2 -0
- package/dist/es/models/api/IRefreshTokenResponse.js.map +1 -0
- package/dist/es/models/api/IUpdatePasswordRequest.js +4 -0
- package/dist/es/models/api/IUpdatePasswordRequest.js.map +1 -0
- package/dist/types/index.d.ts +19 -0
- package/dist/types/models/IAuthenticationAdminComponent.d.ts +47 -0
- package/dist/types/models/IAuthenticationComponent.d.ts +44 -0
- package/dist/types/models/IAuthenticationUser.d.ts +17 -0
- package/dist/types/models/IAuthenticationUserSecure.d.ts +18 -0
- package/dist/types/models/IPasswordOptions.d.ts +13 -0
- package/dist/types/models/api/IAdminUserCreateRequest.d.ts +12 -0
- package/dist/types/models/api/IAdminUserGetByIdentityRequest.d.ts +14 -0
- package/dist/types/models/api/IAdminUserGetRequest.d.ts +14 -0
- package/dist/types/models/api/IAdminUserGetResponse.d.ts +10 -0
- package/dist/types/models/api/IAdminUserRemoveRequest.d.ts +14 -0
- package/dist/types/models/api/IAdminUserUpdatePasswordRequest.d.ts +27 -0
- package/dist/types/models/api/IAdminUserUpdateRequest.d.ts +19 -0
- package/dist/types/models/api/ILoginRequest.d.ts +18 -0
- package/dist/types/models/api/ILoginResponse.d.ts +24 -0
- package/dist/types/models/api/ILogoutRequest.d.ts +14 -0
- package/dist/types/models/api/IPasswordPolicyResponse.d.ts +10 -0
- package/dist/types/models/api/IRefreshTokenRequest.d.ts +14 -0
- package/dist/types/models/api/IRefreshTokenResponse.d.ts +24 -0
- package/dist/types/models/api/IUpdatePasswordRequest.d.ts +18 -0
- package/docs/changelog.md +11 -0
- package/docs/examples.md +89 -0
- package/docs/reference/index.md +23 -0
- package/docs/reference/interfaces/IAdminUserCreateRequest.md +17 -0
- package/docs/reference/interfaces/IAdminUserGetByIdentityRequest.md +17 -0
- package/docs/reference/interfaces/IAdminUserGetRequest.md +17 -0
- package/docs/reference/interfaces/IAdminUserGetResponse.md +11 -0
- package/docs/reference/interfaces/IAdminUserRemoveRequest.md +17 -0
- package/docs/reference/interfaces/IAdminUserUpdatePasswordRequest.md +37 -0
- package/docs/reference/interfaces/IAdminUserUpdateRequest.md +25 -0
- package/docs/reference/interfaces/IAuthenticationAdminComponent.md +151 -0
- package/docs/reference/interfaces/IAuthenticationComponent.md +121 -0
- package/docs/reference/interfaces/IAuthenticationUser.md +31 -0
- package/docs/reference/interfaces/IAuthenticationUserSecure.md +67 -0
- package/docs/reference/interfaces/ILoginRequest.md +23 -0
- package/docs/reference/interfaces/ILoginResponse.md +31 -0
- package/docs/reference/interfaces/ILogoutRequest.md +17 -0
- package/docs/reference/interfaces/IPasswordOptions.md +19 -0
- package/docs/reference/interfaces/IPasswordPolicyResponse.md +11 -0
- package/docs/reference/interfaces/IRefreshTokenRequest.md +17 -0
- package/docs/reference/interfaces/IRefreshTokenResponse.md +31 -0
- package/docs/reference/interfaces/IUpdatePasswordRequest.md +23 -0
- package/locales/en.json +1 -0
- package/package.json +54 -5
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IAuthenticationUser } from "../IAuthenticationUser.js";
|
|
2
|
+
/**
|
|
3
|
+
* Create a new user as an admin.
|
|
4
|
+
*/
|
|
5
|
+
export interface IAdminUserCreateRequest {
|
|
6
|
+
/**
|
|
7
|
+
* The body of the request.
|
|
8
|
+
*/
|
|
9
|
+
body: IAuthenticationUser & {
|
|
10
|
+
password: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Update a users password as an admin.
|
|
3
|
+
*/
|
|
4
|
+
export interface IAdminUserUpdatePasswordRequest {
|
|
5
|
+
/**
|
|
6
|
+
* The path parameters for the request.
|
|
7
|
+
*/
|
|
8
|
+
pathParams: {
|
|
9
|
+
/**
|
|
10
|
+
* The user email.
|
|
11
|
+
*/
|
|
12
|
+
email: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The body of the request.
|
|
16
|
+
*/
|
|
17
|
+
body: {
|
|
18
|
+
/**
|
|
19
|
+
* The new password for the user.
|
|
20
|
+
*/
|
|
21
|
+
newPassword: string;
|
|
22
|
+
/**
|
|
23
|
+
* The current password for the user.
|
|
24
|
+
*/
|
|
25
|
+
currentPassword?: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { IAuthenticationUser } from "../IAuthenticationUser.js";
|
|
2
|
+
/**
|
|
3
|
+
* Update a user as an admin.
|
|
4
|
+
*/
|
|
5
|
+
export interface IAdminUserUpdateRequest {
|
|
6
|
+
/**
|
|
7
|
+
* The path parameters for the request.
|
|
8
|
+
*/
|
|
9
|
+
pathParams: {
|
|
10
|
+
/**
|
|
11
|
+
* The user email.
|
|
12
|
+
*/
|
|
13
|
+
email: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* The body of the request.
|
|
17
|
+
*/
|
|
18
|
+
body: Partial<Omit<IAuthenticationUser, "email">>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Perform a login on the server.
|
|
3
|
+
*/
|
|
4
|
+
export interface ILoginRequest {
|
|
5
|
+
/**
|
|
6
|
+
* The login details.
|
|
7
|
+
*/
|
|
8
|
+
body: {
|
|
9
|
+
/**
|
|
10
|
+
* The email address for the user.
|
|
11
|
+
*/
|
|
12
|
+
email: string;
|
|
13
|
+
/**
|
|
14
|
+
* The password for the user.
|
|
15
|
+
*/
|
|
16
|
+
password: string;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { HeaderTypes } from "@3sixty/web";
|
|
2
|
+
/**
|
|
3
|
+
* Response from a login on the server.
|
|
4
|
+
*/
|
|
5
|
+
export interface ILoginResponse {
|
|
6
|
+
/**
|
|
7
|
+
* Response headers.
|
|
8
|
+
*/
|
|
9
|
+
headers?: {
|
|
10
|
+
/**
|
|
11
|
+
* The cookie containing the auth token.
|
|
12
|
+
*/
|
|
13
|
+
[HeaderTypes.SetCookie]?: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* The login response details.
|
|
17
|
+
*/
|
|
18
|
+
body: {
|
|
19
|
+
/**
|
|
20
|
+
* The expiry time of the token.
|
|
21
|
+
*/
|
|
22
|
+
expiry: number;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Perform a refresh of the auth token.
|
|
3
|
+
*/
|
|
4
|
+
export interface IRefreshTokenRequest {
|
|
5
|
+
/**
|
|
6
|
+
* The refresh token details.
|
|
7
|
+
*/
|
|
8
|
+
body?: {
|
|
9
|
+
/**
|
|
10
|
+
* The token to refresh, if it uses a mechanism with public access.
|
|
11
|
+
*/
|
|
12
|
+
token?: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { HeaderTypes } from "@3sixty/web";
|
|
2
|
+
/**
|
|
3
|
+
* Response from a refresh on the auth token.
|
|
4
|
+
*/
|
|
5
|
+
export interface IRefreshTokenResponse {
|
|
6
|
+
/**
|
|
7
|
+
* Response headers.
|
|
8
|
+
*/
|
|
9
|
+
headers?: {
|
|
10
|
+
/**
|
|
11
|
+
* The cookie containing the auth token.
|
|
12
|
+
*/
|
|
13
|
+
[HeaderTypes.SetCookie]?: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* The refresh token details.
|
|
17
|
+
*/
|
|
18
|
+
body: {
|
|
19
|
+
/**
|
|
20
|
+
* The expiry time of the token.
|
|
21
|
+
*/
|
|
22
|
+
expiry: number;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Update the current user's password.
|
|
3
|
+
*/
|
|
4
|
+
export interface IUpdatePasswordRequest {
|
|
5
|
+
/**
|
|
6
|
+
* The body of the request.
|
|
7
|
+
*/
|
|
8
|
+
body: {
|
|
9
|
+
/**
|
|
10
|
+
* The current password for the user.
|
|
11
|
+
*/
|
|
12
|
+
currentPassword: string;
|
|
13
|
+
/**
|
|
14
|
+
* The new password for the user.
|
|
15
|
+
*/
|
|
16
|
+
newPassword: string;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.20.0-next.1](https://github.com/3sixtyglobal/api-auth/compare/api-auth-entity-storage-models-v0.20.0-next.0...api-auth-entity-storage-models-v0.20.0-next.1) (2026-10-23)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* authorization ([#3](https://github.com/3sixtyglobal/api-auth/issues/3)) ([5688693](https://github.com/3sixtyglobal/api-auth/commit/568869364065b9d2c82c5c17c81f07cbdc64ec8b))
|
|
9
|
+
* initial commit ([b9112fb](https://github.com/3sixtyglobal/api-auth/commit/b9112fb6994758b43effdde1b9e41435ff50fe50))
|
|
10
|
+
* publish packages under the [@3sixty](https://github.com/3sixty) namespace ([6c22482](https://github.com/3sixtyglobal/api-auth/commit/6c2248295620000807ff91087c3b1dfc9b018b31))
|
|
11
|
+
* updated ts compile ([83c72bd](https://github.com/3sixtyglobal/api-auth/commit/83c72bd5d2e9d81208b7a2755450d96fbbb04004))
|
package/docs/examples.md
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Auth Entity Storage Models Examples
|
|
2
|
+
|
|
3
|
+
Use these snippets to shape request and response data consistently across sign-in flows, admin operations, and token refresh handling.
|
|
4
|
+
|
|
5
|
+
## Authentication Requests
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import type {
|
|
9
|
+
ILoginRequest,
|
|
10
|
+
IRefreshTokenRequest,
|
|
11
|
+
IUpdatePasswordRequest
|
|
12
|
+
} from '@3sixty/api-auth-entity-storage-models';
|
|
13
|
+
|
|
14
|
+
const loginRequest: ILoginRequest = {
|
|
15
|
+
body: {
|
|
16
|
+
email: 'alice@example.org',
|
|
17
|
+
password: 'correct-horse-battery-staple'
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const refreshRequest: IRefreshTokenRequest = {
|
|
22
|
+
body: {
|
|
23
|
+
token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.refresh'
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const updatePasswordRequest: IUpdatePasswordRequest = {
|
|
28
|
+
body: {
|
|
29
|
+
currentPassword: 'old-password',
|
|
30
|
+
newPassword: 'new-password-2026'
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
console.log(loginRequest.body.email); // alice@example.org
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Admin User Models
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
import type {
|
|
41
|
+
IAdminUserCreateRequest,
|
|
42
|
+
IAdminUserUpdateRequest
|
|
43
|
+
} from '@3sixty/api-auth-entity-storage-models';
|
|
44
|
+
|
|
45
|
+
const createRequest: IAdminUserCreateRequest = {
|
|
46
|
+
body: {
|
|
47
|
+
email: 'bob@example.org',
|
|
48
|
+
password: 'initial-password',
|
|
49
|
+
userIdentity: 'did:example:bob',
|
|
50
|
+
organizationIdentity: 'did:example:org'
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const updateRequest: IAdminUserUpdateRequest = {
|
|
55
|
+
pathParams: {
|
|
56
|
+
email: 'bob@example.org'
|
|
57
|
+
},
|
|
58
|
+
body: {
|
|
59
|
+
userIdentity: 'did:example:bob:ops'
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
console.log(updateRequest.body.userIdentity); // did:example:bob:ops
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Authentication Responses
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
import type {
|
|
70
|
+
ILoginResponse,
|
|
71
|
+
IPasswordPolicyResponse
|
|
72
|
+
} from '@3sixty/api-auth-entity-storage-models';
|
|
73
|
+
|
|
74
|
+
const loginResponse: ILoginResponse = {
|
|
75
|
+
body: {
|
|
76
|
+
expiry: 3600
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const passwordPolicyResponse: IPasswordPolicyResponse = {
|
|
81
|
+
body: {
|
|
82
|
+
minPasswordLength: 8,
|
|
83
|
+
maxPasswordLength: 128
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
console.log(loginResponse.body.expiry); // 3600
|
|
88
|
+
console.log(passwordPolicyResponse.body.minPasswordLength); // 8
|
|
89
|
+
```
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# @3sixty/api-auth-entity-storage-models
|
|
2
|
+
|
|
3
|
+
## Interfaces
|
|
4
|
+
|
|
5
|
+
- [IAuthenticationAdminComponent](interfaces/IAuthenticationAdminComponent.md)
|
|
6
|
+
- [IAuthenticationComponent](interfaces/IAuthenticationComponent.md)
|
|
7
|
+
- [IAuthenticationUser](interfaces/IAuthenticationUser.md)
|
|
8
|
+
- [IAuthenticationUserSecure](interfaces/IAuthenticationUserSecure.md)
|
|
9
|
+
- [IPasswordOptions](interfaces/IPasswordOptions.md)
|
|
10
|
+
- [IAdminUserCreateRequest](interfaces/IAdminUserCreateRequest.md)
|
|
11
|
+
- [IAdminUserGetByIdentityRequest](interfaces/IAdminUserGetByIdentityRequest.md)
|
|
12
|
+
- [IAdminUserGetRequest](interfaces/IAdminUserGetRequest.md)
|
|
13
|
+
- [IAdminUserGetResponse](interfaces/IAdminUserGetResponse.md)
|
|
14
|
+
- [IAdminUserRemoveRequest](interfaces/IAdminUserRemoveRequest.md)
|
|
15
|
+
- [IAdminUserUpdatePasswordRequest](interfaces/IAdminUserUpdatePasswordRequest.md)
|
|
16
|
+
- [IAdminUserUpdateRequest](interfaces/IAdminUserUpdateRequest.md)
|
|
17
|
+
- [ILoginRequest](interfaces/ILoginRequest.md)
|
|
18
|
+
- [ILoginResponse](interfaces/ILoginResponse.md)
|
|
19
|
+
- [ILogoutRequest](interfaces/ILogoutRequest.md)
|
|
20
|
+
- [IPasswordPolicyResponse](interfaces/IPasswordPolicyResponse.md)
|
|
21
|
+
- [IRefreshTokenRequest](interfaces/IRefreshTokenRequest.md)
|
|
22
|
+
- [IRefreshTokenResponse](interfaces/IRefreshTokenResponse.md)
|
|
23
|
+
- [IUpdatePasswordRequest](interfaces/IUpdatePasswordRequest.md)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Interface: IAdminUserCreateRequest
|
|
2
|
+
|
|
3
|
+
Create a new user as an admin.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### body {#body}
|
|
8
|
+
|
|
9
|
+
> **body**: [`IAuthenticationUser`](IAuthenticationUser.md) & `object`
|
|
10
|
+
|
|
11
|
+
The body of the request.
|
|
12
|
+
|
|
13
|
+
#### Type Declaration
|
|
14
|
+
|
|
15
|
+
##### password
|
|
16
|
+
|
|
17
|
+
> **password**: `string`
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Interface: IAdminUserGetByIdentityRequest
|
|
2
|
+
|
|
3
|
+
Get a user as an admin.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### pathParams {#pathparams}
|
|
8
|
+
|
|
9
|
+
> **pathParams**: `object`
|
|
10
|
+
|
|
11
|
+
The path parameters for the request.
|
|
12
|
+
|
|
13
|
+
#### identity
|
|
14
|
+
|
|
15
|
+
> **identity**: `string`
|
|
16
|
+
|
|
17
|
+
The user identity.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Interface: IAdminUserGetRequest
|
|
2
|
+
|
|
3
|
+
Get a user as an admin.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### pathParams {#pathparams}
|
|
8
|
+
|
|
9
|
+
> **pathParams**: `object`
|
|
10
|
+
|
|
11
|
+
The path parameters for the request.
|
|
12
|
+
|
|
13
|
+
#### email
|
|
14
|
+
|
|
15
|
+
> **email**: `string`
|
|
16
|
+
|
|
17
|
+
The user email.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Interface: IAdminUserRemoveRequest
|
|
2
|
+
|
|
3
|
+
Remove a user as an admin.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### pathParams {#pathparams}
|
|
8
|
+
|
|
9
|
+
> **pathParams**: `object`
|
|
10
|
+
|
|
11
|
+
The path parameters for the request.
|
|
12
|
+
|
|
13
|
+
#### email
|
|
14
|
+
|
|
15
|
+
> **email**: `string`
|
|
16
|
+
|
|
17
|
+
The user email.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Interface: IAdminUserUpdatePasswordRequest
|
|
2
|
+
|
|
3
|
+
Update a users password as an admin.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### pathParams {#pathparams}
|
|
8
|
+
|
|
9
|
+
> **pathParams**: `object`
|
|
10
|
+
|
|
11
|
+
The path parameters for the request.
|
|
12
|
+
|
|
13
|
+
#### email
|
|
14
|
+
|
|
15
|
+
> **email**: `string`
|
|
16
|
+
|
|
17
|
+
The user email.
|
|
18
|
+
|
|
19
|
+
***
|
|
20
|
+
|
|
21
|
+
### body {#body}
|
|
22
|
+
|
|
23
|
+
> **body**: `object`
|
|
24
|
+
|
|
25
|
+
The body of the request.
|
|
26
|
+
|
|
27
|
+
#### newPassword
|
|
28
|
+
|
|
29
|
+
> **newPassword**: `string`
|
|
30
|
+
|
|
31
|
+
The new password for the user.
|
|
32
|
+
|
|
33
|
+
#### currentPassword?
|
|
34
|
+
|
|
35
|
+
> `optional` **currentPassword?**: `string`
|
|
36
|
+
|
|
37
|
+
The current password for the user.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Interface: IAdminUserUpdateRequest
|
|
2
|
+
|
|
3
|
+
Update a user as an admin.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### pathParams {#pathparams}
|
|
8
|
+
|
|
9
|
+
> **pathParams**: `object`
|
|
10
|
+
|
|
11
|
+
The path parameters for the request.
|
|
12
|
+
|
|
13
|
+
#### email
|
|
14
|
+
|
|
15
|
+
> **email**: `string`
|
|
16
|
+
|
|
17
|
+
The user email.
|
|
18
|
+
|
|
19
|
+
***
|
|
20
|
+
|
|
21
|
+
### body {#body}
|
|
22
|
+
|
|
23
|
+
> **body**: `Partial`\<`Omit`\<[`IAuthenticationUser`](IAuthenticationUser.md), `"email"`\>\>
|
|
24
|
+
|
|
25
|
+
The body of the request.
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# Interface: IAuthenticationAdminComponent
|
|
2
|
+
|
|
3
|
+
Contract definition for authentication admin component.
|
|
4
|
+
|
|
5
|
+
## Extends
|
|
6
|
+
|
|
7
|
+
- `IComponent`
|
|
8
|
+
|
|
9
|
+
## Methods
|
|
10
|
+
|
|
11
|
+
### create() {#create}
|
|
12
|
+
|
|
13
|
+
> **create**(`user`): `Promise`\<`void`\>
|
|
14
|
+
|
|
15
|
+
Create a login for the user.
|
|
16
|
+
|
|
17
|
+
#### Parameters
|
|
18
|
+
|
|
19
|
+
##### user
|
|
20
|
+
|
|
21
|
+
[`IAuthenticationUser`](IAuthenticationUser.md) & `object`
|
|
22
|
+
|
|
23
|
+
The user to create.
|
|
24
|
+
|
|
25
|
+
#### Returns
|
|
26
|
+
|
|
27
|
+
`Promise`\<`void`\>
|
|
28
|
+
|
|
29
|
+
A promise that resolves when the user account has been created.
|
|
30
|
+
|
|
31
|
+
***
|
|
32
|
+
|
|
33
|
+
### update() {#update}
|
|
34
|
+
|
|
35
|
+
> **update**(`user`): `Promise`\<`void`\>
|
|
36
|
+
|
|
37
|
+
Update a login for the user.
|
|
38
|
+
|
|
39
|
+
#### Parameters
|
|
40
|
+
|
|
41
|
+
##### user
|
|
42
|
+
|
|
43
|
+
`Partial`\<[`IAuthenticationUser`](IAuthenticationUser.md)\>
|
|
44
|
+
|
|
45
|
+
The user to update.
|
|
46
|
+
|
|
47
|
+
#### Returns
|
|
48
|
+
|
|
49
|
+
`Promise`\<`void`\>
|
|
50
|
+
|
|
51
|
+
A promise that resolves when the user account has been updated.
|
|
52
|
+
|
|
53
|
+
***
|
|
54
|
+
|
|
55
|
+
### get() {#get}
|
|
56
|
+
|
|
57
|
+
> **get**(`email`): `Promise`\<[`IAuthenticationUser`](IAuthenticationUser.md)\>
|
|
58
|
+
|
|
59
|
+
Get a user by email.
|
|
60
|
+
|
|
61
|
+
#### Parameters
|
|
62
|
+
|
|
63
|
+
##### email
|
|
64
|
+
|
|
65
|
+
`string`
|
|
66
|
+
|
|
67
|
+
The email address of the user to get.
|
|
68
|
+
|
|
69
|
+
#### Returns
|
|
70
|
+
|
|
71
|
+
`Promise`\<[`IAuthenticationUser`](IAuthenticationUser.md)\>
|
|
72
|
+
|
|
73
|
+
The user details.
|
|
74
|
+
|
|
75
|
+
***
|
|
76
|
+
|
|
77
|
+
### getByIdentity() {#getbyidentity}
|
|
78
|
+
|
|
79
|
+
> **getByIdentity**(`identity`): `Promise`\<[`IAuthenticationUser`](IAuthenticationUser.md)\>
|
|
80
|
+
|
|
81
|
+
Get a user by identity.
|
|
82
|
+
|
|
83
|
+
#### Parameters
|
|
84
|
+
|
|
85
|
+
##### identity
|
|
86
|
+
|
|
87
|
+
`string`
|
|
88
|
+
|
|
89
|
+
The identity of the user to get.
|
|
90
|
+
|
|
91
|
+
#### Returns
|
|
92
|
+
|
|
93
|
+
`Promise`\<[`IAuthenticationUser`](IAuthenticationUser.md)\>
|
|
94
|
+
|
|
95
|
+
The user details.
|
|
96
|
+
|
|
97
|
+
***
|
|
98
|
+
|
|
99
|
+
### remove() {#remove}
|
|
100
|
+
|
|
101
|
+
> **remove**(`email`): `Promise`\<`void`\>
|
|
102
|
+
|
|
103
|
+
Remove a user.
|
|
104
|
+
|
|
105
|
+
#### Parameters
|
|
106
|
+
|
|
107
|
+
##### email
|
|
108
|
+
|
|
109
|
+
`string`
|
|
110
|
+
|
|
111
|
+
The email address of the user to remove.
|
|
112
|
+
|
|
113
|
+
#### Returns
|
|
114
|
+
|
|
115
|
+
`Promise`\<`void`\>
|
|
116
|
+
|
|
117
|
+
A promise that resolves when the user account has been removed.
|
|
118
|
+
|
|
119
|
+
***
|
|
120
|
+
|
|
121
|
+
### updatePassword() {#updatepassword}
|
|
122
|
+
|
|
123
|
+
> **updatePassword**(`email`, `newPassword`, `currentPassword?`): `Promise`\<`void`\>
|
|
124
|
+
|
|
125
|
+
Update the user's password.
|
|
126
|
+
|
|
127
|
+
#### Parameters
|
|
128
|
+
|
|
129
|
+
##### email
|
|
130
|
+
|
|
131
|
+
`string`
|
|
132
|
+
|
|
133
|
+
The email address of the user to update.
|
|
134
|
+
|
|
135
|
+
##### newPassword
|
|
136
|
+
|
|
137
|
+
`string`
|
|
138
|
+
|
|
139
|
+
The new password for the user.
|
|
140
|
+
|
|
141
|
+
##### currentPassword?
|
|
142
|
+
|
|
143
|
+
`string`
|
|
144
|
+
|
|
145
|
+
The current password, optional, if supplied will check against existing.
|
|
146
|
+
|
|
147
|
+
#### Returns
|
|
148
|
+
|
|
149
|
+
`Promise`\<`void`\>
|
|
150
|
+
|
|
151
|
+
A promise that resolves when the password has been updated.
|