@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.
Files changed (86) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +24 -2
  3. package/dist/es/index.js +22 -0
  4. package/dist/es/index.js.map +1 -0
  5. package/dist/es/models/IAuthenticationAdminComponent.js +2 -0
  6. package/dist/es/models/IAuthenticationAdminComponent.js.map +1 -0
  7. package/dist/es/models/IAuthenticationComponent.js +2 -0
  8. package/dist/es/models/IAuthenticationComponent.js.map +1 -0
  9. package/dist/es/models/IAuthenticationUser.js +4 -0
  10. package/dist/es/models/IAuthenticationUser.js.map +1 -0
  11. package/dist/es/models/IAuthenticationUserSecure.js +2 -0
  12. package/dist/es/models/IAuthenticationUserSecure.js.map +1 -0
  13. package/dist/es/models/IPasswordOptions.js +4 -0
  14. package/dist/es/models/IPasswordOptions.js.map +1 -0
  15. package/dist/es/models/api/IAdminUserCreateRequest.js +2 -0
  16. package/dist/es/models/api/IAdminUserCreateRequest.js.map +1 -0
  17. package/dist/es/models/api/IAdminUserGetByIdentityRequest.js +4 -0
  18. package/dist/es/models/api/IAdminUserGetByIdentityRequest.js.map +1 -0
  19. package/dist/es/models/api/IAdminUserGetRequest.js +4 -0
  20. package/dist/es/models/api/IAdminUserGetRequest.js.map +1 -0
  21. package/dist/es/models/api/IAdminUserGetResponse.js +2 -0
  22. package/dist/es/models/api/IAdminUserGetResponse.js.map +1 -0
  23. package/dist/es/models/api/IAdminUserRemoveRequest.js +4 -0
  24. package/dist/es/models/api/IAdminUserRemoveRequest.js.map +1 -0
  25. package/dist/es/models/api/IAdminUserUpdatePasswordRequest.js +4 -0
  26. package/dist/es/models/api/IAdminUserUpdatePasswordRequest.js.map +1 -0
  27. package/dist/es/models/api/IAdminUserUpdateRequest.js +2 -0
  28. package/dist/es/models/api/IAdminUserUpdateRequest.js.map +1 -0
  29. package/dist/es/models/api/ILoginRequest.js +4 -0
  30. package/dist/es/models/api/ILoginRequest.js.map +1 -0
  31. package/dist/es/models/api/ILoginResponse.js +2 -0
  32. package/dist/es/models/api/ILoginResponse.js.map +1 -0
  33. package/dist/es/models/api/ILogoutRequest.js +4 -0
  34. package/dist/es/models/api/ILogoutRequest.js.map +1 -0
  35. package/dist/es/models/api/IPasswordPolicyResponse.js +2 -0
  36. package/dist/es/models/api/IPasswordPolicyResponse.js.map +1 -0
  37. package/dist/es/models/api/IRefreshTokenRequest.js +4 -0
  38. package/dist/es/models/api/IRefreshTokenRequest.js.map +1 -0
  39. package/dist/es/models/api/IRefreshTokenResponse.js +2 -0
  40. package/dist/es/models/api/IRefreshTokenResponse.js.map +1 -0
  41. package/dist/es/models/api/IUpdatePasswordRequest.js +4 -0
  42. package/dist/es/models/api/IUpdatePasswordRequest.js.map +1 -0
  43. package/dist/types/index.d.ts +19 -0
  44. package/dist/types/models/IAuthenticationAdminComponent.d.ts +47 -0
  45. package/dist/types/models/IAuthenticationComponent.d.ts +44 -0
  46. package/dist/types/models/IAuthenticationUser.d.ts +17 -0
  47. package/dist/types/models/IAuthenticationUserSecure.d.ts +18 -0
  48. package/dist/types/models/IPasswordOptions.d.ts +13 -0
  49. package/dist/types/models/api/IAdminUserCreateRequest.d.ts +12 -0
  50. package/dist/types/models/api/IAdminUserGetByIdentityRequest.d.ts +14 -0
  51. package/dist/types/models/api/IAdminUserGetRequest.d.ts +14 -0
  52. package/dist/types/models/api/IAdminUserGetResponse.d.ts +10 -0
  53. package/dist/types/models/api/IAdminUserRemoveRequest.d.ts +14 -0
  54. package/dist/types/models/api/IAdminUserUpdatePasswordRequest.d.ts +27 -0
  55. package/dist/types/models/api/IAdminUserUpdateRequest.d.ts +19 -0
  56. package/dist/types/models/api/ILoginRequest.d.ts +18 -0
  57. package/dist/types/models/api/ILoginResponse.d.ts +24 -0
  58. package/dist/types/models/api/ILogoutRequest.d.ts +14 -0
  59. package/dist/types/models/api/IPasswordPolicyResponse.d.ts +10 -0
  60. package/dist/types/models/api/IRefreshTokenRequest.d.ts +14 -0
  61. package/dist/types/models/api/IRefreshTokenResponse.d.ts +24 -0
  62. package/dist/types/models/api/IUpdatePasswordRequest.d.ts +18 -0
  63. package/docs/changelog.md +11 -0
  64. package/docs/examples.md +89 -0
  65. package/docs/reference/index.md +23 -0
  66. package/docs/reference/interfaces/IAdminUserCreateRequest.md +17 -0
  67. package/docs/reference/interfaces/IAdminUserGetByIdentityRequest.md +17 -0
  68. package/docs/reference/interfaces/IAdminUserGetRequest.md +17 -0
  69. package/docs/reference/interfaces/IAdminUserGetResponse.md +11 -0
  70. package/docs/reference/interfaces/IAdminUserRemoveRequest.md +17 -0
  71. package/docs/reference/interfaces/IAdminUserUpdatePasswordRequest.md +37 -0
  72. package/docs/reference/interfaces/IAdminUserUpdateRequest.md +25 -0
  73. package/docs/reference/interfaces/IAuthenticationAdminComponent.md +151 -0
  74. package/docs/reference/interfaces/IAuthenticationComponent.md +121 -0
  75. package/docs/reference/interfaces/IAuthenticationUser.md +31 -0
  76. package/docs/reference/interfaces/IAuthenticationUserSecure.md +67 -0
  77. package/docs/reference/interfaces/ILoginRequest.md +23 -0
  78. package/docs/reference/interfaces/ILoginResponse.md +31 -0
  79. package/docs/reference/interfaces/ILogoutRequest.md +17 -0
  80. package/docs/reference/interfaces/IPasswordOptions.md +19 -0
  81. package/docs/reference/interfaces/IPasswordPolicyResponse.md +11 -0
  82. package/docs/reference/interfaces/IRefreshTokenRequest.md +17 -0
  83. package/docs/reference/interfaces/IRefreshTokenResponse.md +31 -0
  84. package/docs/reference/interfaces/IUpdatePasswordRequest.md +23 -0
  85. package/locales/en.json +1 -0
  86. 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,11 @@
1
+ # Interface: IPasswordPolicyResponse
2
+
3
+ Get the password policy.
4
+
5
+ ## Properties
6
+
7
+ ### body {#body}
8
+
9
+ > **body**: [`IPasswordOptions`](IPasswordOptions.md)
10
+
11
+ The body of the response.
@@ -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.
@@ -0,0 +1 @@
1
+ {}
package/package.json CHANGED
@@ -1,6 +1,55 @@
1
1
  {
2
- "name": "@3sixty/api-auth-entity-storage-models",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
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
+ }