@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,121 @@
|
|
|
1
|
+
# Interface: IAuthenticationComponent
|
|
2
|
+
|
|
3
|
+
Contract definition for authentication component.
|
|
4
|
+
|
|
5
|
+
## Extends
|
|
6
|
+
|
|
7
|
+
- `IComponent`
|
|
8
|
+
|
|
9
|
+
## Methods
|
|
10
|
+
|
|
11
|
+
### login() {#login}
|
|
12
|
+
|
|
13
|
+
> **login**(`email`, `password`): `Promise`\<\{ `token?`: `string`; `expiry`: `number`; \}\>
|
|
14
|
+
|
|
15
|
+
Perform a login for the user.
|
|
16
|
+
|
|
17
|
+
#### Parameters
|
|
18
|
+
|
|
19
|
+
##### email
|
|
20
|
+
|
|
21
|
+
`string`
|
|
22
|
+
|
|
23
|
+
The email address for the user.
|
|
24
|
+
|
|
25
|
+
##### password
|
|
26
|
+
|
|
27
|
+
`string`
|
|
28
|
+
|
|
29
|
+
The password for the user.
|
|
30
|
+
|
|
31
|
+
#### Returns
|
|
32
|
+
|
|
33
|
+
`Promise`\<\{ `token?`: `string`; `expiry`: `number`; \}\>
|
|
34
|
+
|
|
35
|
+
The authentication token for the user, if it uses a mechanism with public access.
|
|
36
|
+
|
|
37
|
+
***
|
|
38
|
+
|
|
39
|
+
### logout() {#logout}
|
|
40
|
+
|
|
41
|
+
> **logout**(`token?`): `Promise`\<`void`\>
|
|
42
|
+
|
|
43
|
+
Logout the current user.
|
|
44
|
+
|
|
45
|
+
#### Parameters
|
|
46
|
+
|
|
47
|
+
##### token?
|
|
48
|
+
|
|
49
|
+
`string`
|
|
50
|
+
|
|
51
|
+
The token to logout, if it uses a mechanism with public access.
|
|
52
|
+
|
|
53
|
+
#### Returns
|
|
54
|
+
|
|
55
|
+
`Promise`\<`void`\>
|
|
56
|
+
|
|
57
|
+
A promise that resolves when the logout has been completed.
|
|
58
|
+
|
|
59
|
+
***
|
|
60
|
+
|
|
61
|
+
### refresh() {#refresh}
|
|
62
|
+
|
|
63
|
+
> **refresh**(`token?`): `Promise`\<\{ `token?`: `string`; `expiry`: `number`; \}\>
|
|
64
|
+
|
|
65
|
+
Refresh the token.
|
|
66
|
+
|
|
67
|
+
#### Parameters
|
|
68
|
+
|
|
69
|
+
##### token?
|
|
70
|
+
|
|
71
|
+
`string`
|
|
72
|
+
|
|
73
|
+
The token to refresh, if it uses a mechanism with public access.
|
|
74
|
+
|
|
75
|
+
#### Returns
|
|
76
|
+
|
|
77
|
+
`Promise`\<\{ `token?`: `string`; `expiry`: `number`; \}\>
|
|
78
|
+
|
|
79
|
+
The refreshed token, if it uses a mechanism with public access.
|
|
80
|
+
|
|
81
|
+
***
|
|
82
|
+
|
|
83
|
+
### updatePassword() {#updatepassword}
|
|
84
|
+
|
|
85
|
+
> **updatePassword**(`currentPassword`, `newPassword`): `Promise`\<`void`\>
|
|
86
|
+
|
|
87
|
+
Update the user's password.
|
|
88
|
+
|
|
89
|
+
#### Parameters
|
|
90
|
+
|
|
91
|
+
##### currentPassword
|
|
92
|
+
|
|
93
|
+
`string`
|
|
94
|
+
|
|
95
|
+
The current password for the user.
|
|
96
|
+
|
|
97
|
+
##### newPassword
|
|
98
|
+
|
|
99
|
+
`string`
|
|
100
|
+
|
|
101
|
+
The new password for the user.
|
|
102
|
+
|
|
103
|
+
#### Returns
|
|
104
|
+
|
|
105
|
+
`Promise`\<`void`\>
|
|
106
|
+
|
|
107
|
+
A promise that resolves when the password has been updated.
|
|
108
|
+
|
|
109
|
+
***
|
|
110
|
+
|
|
111
|
+
### passwordPolicy() {#passwordpolicy}
|
|
112
|
+
|
|
113
|
+
> **passwordPolicy**(): `Promise`\<[`IPasswordOptions`](IPasswordOptions.md)\>
|
|
114
|
+
|
|
115
|
+
Get the password policy used for password validation.
|
|
116
|
+
|
|
117
|
+
#### Returns
|
|
118
|
+
|
|
119
|
+
`Promise`\<[`IPasswordOptions`](IPasswordOptions.md)\>
|
|
120
|
+
|
|
121
|
+
The password policy options.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Interface: IAuthenticationUser
|
|
2
|
+
|
|
3
|
+
Contract definition for authentication user.
|
|
4
|
+
|
|
5
|
+
## Extended by
|
|
6
|
+
|
|
7
|
+
- [`IAuthenticationUserSecure`](IAuthenticationUserSecure.md)
|
|
8
|
+
|
|
9
|
+
## Properties
|
|
10
|
+
|
|
11
|
+
### email {#email}
|
|
12
|
+
|
|
13
|
+
> **email**: `string`
|
|
14
|
+
|
|
15
|
+
The user e-mail address.
|
|
16
|
+
|
|
17
|
+
***
|
|
18
|
+
|
|
19
|
+
### userIdentity {#useridentity}
|
|
20
|
+
|
|
21
|
+
> **userIdentity**: `string`
|
|
22
|
+
|
|
23
|
+
The user identity.
|
|
24
|
+
|
|
25
|
+
***
|
|
26
|
+
|
|
27
|
+
### organizationIdentity {#organizationidentity}
|
|
28
|
+
|
|
29
|
+
> **organizationIdentity**: `string`
|
|
30
|
+
|
|
31
|
+
The users organization.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Interface: IAuthenticationUserSecure
|
|
2
|
+
|
|
3
|
+
Contract definition for authentication user.
|
|
4
|
+
|
|
5
|
+
## Extends
|
|
6
|
+
|
|
7
|
+
- [`IAuthenticationUser`](IAuthenticationUser.md)
|
|
8
|
+
|
|
9
|
+
## Properties
|
|
10
|
+
|
|
11
|
+
### email {#email}
|
|
12
|
+
|
|
13
|
+
> **email**: `string`
|
|
14
|
+
|
|
15
|
+
The user e-mail address.
|
|
16
|
+
|
|
17
|
+
#### Inherited from
|
|
18
|
+
|
|
19
|
+
[`IAuthenticationUser`](IAuthenticationUser.md).[`email`](IAuthenticationUser.md#email)
|
|
20
|
+
|
|
21
|
+
***
|
|
22
|
+
|
|
23
|
+
### userIdentity {#useridentity}
|
|
24
|
+
|
|
25
|
+
> **userIdentity**: `string`
|
|
26
|
+
|
|
27
|
+
The user identity.
|
|
28
|
+
|
|
29
|
+
#### Inherited from
|
|
30
|
+
|
|
31
|
+
[`IAuthenticationUser`](IAuthenticationUser.md).[`userIdentity`](IAuthenticationUser.md#useridentity)
|
|
32
|
+
|
|
33
|
+
***
|
|
34
|
+
|
|
35
|
+
### organizationIdentity {#organizationidentity}
|
|
36
|
+
|
|
37
|
+
> **organizationIdentity**: `string`
|
|
38
|
+
|
|
39
|
+
The users organization.
|
|
40
|
+
|
|
41
|
+
#### Inherited from
|
|
42
|
+
|
|
43
|
+
[`IAuthenticationUser`](IAuthenticationUser.md).[`organizationIdentity`](IAuthenticationUser.md#organizationidentity)
|
|
44
|
+
|
|
45
|
+
***
|
|
46
|
+
|
|
47
|
+
### password {#password}
|
|
48
|
+
|
|
49
|
+
> **password**: `string`
|
|
50
|
+
|
|
51
|
+
The encrypted password for the user.
|
|
52
|
+
|
|
53
|
+
***
|
|
54
|
+
|
|
55
|
+
### salt {#salt}
|
|
56
|
+
|
|
57
|
+
> **salt**: `string`
|
|
58
|
+
|
|
59
|
+
The salt for the password.
|
|
60
|
+
|
|
61
|
+
***
|
|
62
|
+
|
|
63
|
+
### tenantId {#tenantid}
|
|
64
|
+
|
|
65
|
+
> **tenantId**: `string`
|
|
66
|
+
|
|
67
|
+
The tenant ID associated with the user, optional in single tenant contexts.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Interface: ILoginRequest
|
|
2
|
+
|
|
3
|
+
Perform a login on the server.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### body {#body}
|
|
8
|
+
|
|
9
|
+
> **body**: `object`
|
|
10
|
+
|
|
11
|
+
The login details.
|
|
12
|
+
|
|
13
|
+
#### email
|
|
14
|
+
|
|
15
|
+
> **email**: `string`
|
|
16
|
+
|
|
17
|
+
The email address for the user.
|
|
18
|
+
|
|
19
|
+
#### password
|
|
20
|
+
|
|
21
|
+
> **password**: `string`
|
|
22
|
+
|
|
23
|
+
The password for the user.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Interface: ILoginResponse
|
|
2
|
+
|
|
3
|
+
Response from a login on the server.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### headers? {#headers}
|
|
8
|
+
|
|
9
|
+
> `optional` **headers?**: `object`
|
|
10
|
+
|
|
11
|
+
Response headers.
|
|
12
|
+
|
|
13
|
+
#### set-cookie?
|
|
14
|
+
|
|
15
|
+
> `optional` **set-cookie?**: `string`
|
|
16
|
+
|
|
17
|
+
The cookie containing the auth token.
|
|
18
|
+
|
|
19
|
+
***
|
|
20
|
+
|
|
21
|
+
### body {#body}
|
|
22
|
+
|
|
23
|
+
> **body**: `object`
|
|
24
|
+
|
|
25
|
+
The login response details.
|
|
26
|
+
|
|
27
|
+
#### expiry
|
|
28
|
+
|
|
29
|
+
> **expiry**: `number`
|
|
30
|
+
|
|
31
|
+
The expiry time of the token.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Interface: ILogoutRequest
|
|
2
|
+
|
|
3
|
+
Perform a logout on the auth token.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### body? {#body}
|
|
8
|
+
|
|
9
|
+
> `optional` **body?**: `object`
|
|
10
|
+
|
|
11
|
+
The logout token details.
|
|
12
|
+
|
|
13
|
+
#### token?
|
|
14
|
+
|
|
15
|
+
> `optional` **token?**: `string`
|
|
16
|
+
|
|
17
|
+
The token to logout, if it uses a mechanism with public access.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Interface: IPasswordOptions
|
|
2
|
+
|
|
3
|
+
Password length validation options.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### minPasswordLength? {#minpasswordlength}
|
|
8
|
+
|
|
9
|
+
> `optional` **minPasswordLength?**: `number`
|
|
10
|
+
|
|
11
|
+
The minimum password length for validation.
|
|
12
|
+
|
|
13
|
+
***
|
|
14
|
+
|
|
15
|
+
### maxPasswordLength? {#maxpasswordlength}
|
|
16
|
+
|
|
17
|
+
> `optional` **maxPasswordLength?**: `number`
|
|
18
|
+
|
|
19
|
+
The maximum password length for validation.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Interface: IRefreshTokenRequest
|
|
2
|
+
|
|
3
|
+
Perform a refresh of the auth token.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### body? {#body}
|
|
8
|
+
|
|
9
|
+
> `optional` **body?**: `object`
|
|
10
|
+
|
|
11
|
+
The refresh token details.
|
|
12
|
+
|
|
13
|
+
#### token?
|
|
14
|
+
|
|
15
|
+
> `optional` **token?**: `string`
|
|
16
|
+
|
|
17
|
+
The token to refresh, if it uses a mechanism with public access.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Interface: IRefreshTokenResponse
|
|
2
|
+
|
|
3
|
+
Response from a refresh on the auth token.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### headers? {#headers}
|
|
8
|
+
|
|
9
|
+
> `optional` **headers?**: `object`
|
|
10
|
+
|
|
11
|
+
Response headers.
|
|
12
|
+
|
|
13
|
+
#### set-cookie?
|
|
14
|
+
|
|
15
|
+
> `optional` **set-cookie?**: `string`
|
|
16
|
+
|
|
17
|
+
The cookie containing the auth token.
|
|
18
|
+
|
|
19
|
+
***
|
|
20
|
+
|
|
21
|
+
### body {#body}
|
|
22
|
+
|
|
23
|
+
> **body**: `object`
|
|
24
|
+
|
|
25
|
+
The refresh token details.
|
|
26
|
+
|
|
27
|
+
#### expiry
|
|
28
|
+
|
|
29
|
+
> **expiry**: `number`
|
|
30
|
+
|
|
31
|
+
The expiry time of the token.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Interface: IUpdatePasswordRequest
|
|
2
|
+
|
|
3
|
+
Update the current user's password.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### body {#body}
|
|
8
|
+
|
|
9
|
+
> **body**: `object`
|
|
10
|
+
|
|
11
|
+
The body of the request.
|
|
12
|
+
|
|
13
|
+
#### currentPassword
|
|
14
|
+
|
|
15
|
+
> **currentPassword**: `string`
|
|
16
|
+
|
|
17
|
+
The current password for the user.
|
|
18
|
+
|
|
19
|
+
#### newPassword
|
|
20
|
+
|
|
21
|
+
> **newPassword**: `string`
|
|
22
|
+
|
|
23
|
+
The new password for the user.
|
package/locales/en.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
package/package.json
CHANGED
|
@@ -1,6 +1,55 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
"name": "@3sixty/api-auth-entity-storage-models",
|
|
3
|
+
"version": "0.20.0-next.1",
|
|
4
|
+
"description": "Contracts for authentication flows and admin user management with entity storage.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/3sixtyglobal/api-auth.git",
|
|
8
|
+
"directory": "packages/api-auth-entity-storage-models"
|
|
9
|
+
},
|
|
10
|
+
"author": "martyn.janes@iota.org",
|
|
11
|
+
"license": "Apache-2.0",
|
|
12
|
+
"type": "module",
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=24.0.0"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@3sixty/core": "next",
|
|
18
|
+
"@3sixty/nameof": "next",
|
|
19
|
+
"@3sixty/web": "next"
|
|
20
|
+
},
|
|
21
|
+
"main": "./dist/es/index.js",
|
|
22
|
+
"types": "./dist/types/index.d.ts",
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./dist/types/index.d.ts",
|
|
26
|
+
"import": "./dist/es/index.js",
|
|
27
|
+
"default": "./dist/es/index.js"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist/es",
|
|
32
|
+
"dist/types",
|
|
33
|
+
"locales",
|
|
34
|
+
"docs"
|
|
35
|
+
],
|
|
36
|
+
"keywords": [
|
|
37
|
+
"twin",
|
|
38
|
+
"trade",
|
|
39
|
+
"iota",
|
|
40
|
+
"framework",
|
|
41
|
+
"blockchain",
|
|
42
|
+
"api",
|
|
43
|
+
"entity",
|
|
44
|
+
"storage",
|
|
45
|
+
"persistence",
|
|
46
|
+
"database",
|
|
47
|
+
"models",
|
|
48
|
+
"types",
|
|
49
|
+
"schemas"
|
|
50
|
+
],
|
|
51
|
+
"bugs": {
|
|
52
|
+
"url": "git+https://github.com/3sixtyglobal/api-auth/issues"
|
|
53
|
+
},
|
|
54
|
+
"homepage": "https://3sixty.global"
|
|
55
|
+
}
|