@twin.org/api-auth-entity-storage-rest-client 0.0.3-next.8 → 0.9.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 (24) hide show
  1. package/README.md +3 -3
  2. package/dist/es/entityStorageAuthenticationAdminRestClient.js +114 -0
  3. package/dist/es/entityStorageAuthenticationAdminRestClient.js.map +1 -0
  4. package/dist/es/entityStorageAuthenticationAuditRestClient.js +73 -0
  5. package/dist/es/entityStorageAuthenticationAuditRestClient.js.map +1 -0
  6. package/dist/es/entityStorageAuthenticationRestClient.js +29 -15
  7. package/dist/es/entityStorageAuthenticationRestClient.js.map +1 -1
  8. package/dist/es/index.js +3 -0
  9. package/dist/es/index.js.map +1 -1
  10. package/dist/es/models/entityStorageAuthenticationRestClientConstructorOptions.js +2 -0
  11. package/dist/es/models/entityStorageAuthenticationRestClientConstructorOptions.js.map +1 -0
  12. package/dist/types/entityStorageAuthenticationAdminRestClient.d.ts +62 -0
  13. package/dist/types/entityStorageAuthenticationAuditRestClient.d.ts +54 -0
  14. package/dist/types/entityStorageAuthenticationRestClient.d.ts +5 -6
  15. package/dist/types/index.d.ts +3 -0
  16. package/dist/types/models/entityStorageAuthenticationRestClientConstructorOptions.d.ts +11 -0
  17. package/docs/changelog.md +827 -58
  18. package/docs/examples.md +111 -1
  19. package/docs/reference/classes/EntityStorageAuthenticationAdminRestClient.md +295 -0
  20. package/docs/reference/classes/EntityStorageAuthenticationAuditRestClient.md +231 -0
  21. package/docs/reference/classes/EntityStorageAuthenticationRestClient.md +76 -16
  22. package/docs/reference/index.md +6 -0
  23. package/docs/reference/interfaces/IEntityStorageAuthenticationRestClientConstructorOptions.md +141 -0
  24. package/package.json +10 -10
@@ -22,7 +22,7 @@ Create a new instance of EntityStorageAuthenticationRestClient.
22
22
 
23
23
  ##### config
24
24
 
25
- `IBaseRestClientConfig`
25
+ [`IEntityStorageAuthenticationRestClientConstructorOptions`](../interfaces/IEntityStorageAuthenticationRestClientConstructorOptions.md)
26
26
 
27
27
  The configuration for the client.
28
28
 
@@ -36,7 +36,7 @@ The configuration for the client.
36
36
 
37
37
  ## Properties
38
38
 
39
- ### CLASS\_NAME
39
+ ### CLASS\_NAME {#class_name}
40
40
 
41
41
  > `readonly` `static` **CLASS\_NAME**: `string`
42
42
 
@@ -44,7 +44,7 @@ Runtime name for the class.
44
44
 
45
45
  ## Methods
46
46
 
47
- ### className()
47
+ ### className() {#classname}
48
48
 
49
49
  > **className**(): `string`
50
50
 
@@ -62,7 +62,7 @@ The class name of the component.
62
62
 
63
63
  ***
64
64
 
65
- ### login()
65
+ ### login() {#login}
66
66
 
67
67
  > **login**(`email`, `password`): `Promise`\<\{ `token?`: `string`; `expiry`: `number`; \}\>
68
68
 
@@ -94,7 +94,7 @@ The authentication token for the user, if it uses a mechanism with public access
94
94
 
95
95
  ***
96
96
 
97
- ### logout()
97
+ ### logout() {#logout}
98
98
 
99
99
  > **logout**(`token?`): `Promise`\<`void`\>
100
100
 
@@ -112,7 +112,7 @@ The token to logout, if it uses a mechanism with public access.
112
112
 
113
113
  `Promise`\<`void`\>
114
114
 
115
- Nothing.
115
+ A promise that resolves when the logout request has completed.
116
116
 
117
117
  #### Implementation of
118
118
 
@@ -120,7 +120,7 @@ Nothing.
120
120
 
121
121
  ***
122
122
 
123
- ### refresh()
123
+ ### refresh() {#refresh}
124
124
 
125
125
  > **refresh**(`token?`): `Promise`\<\{ `token?`: `string`; `expiry`: `number`; \}\>
126
126
 
@@ -146,20 +146,14 @@ The refreshed token, if it uses a mechanism with public access.
146
146
 
147
147
  ***
148
148
 
149
- ### updatePassword()
149
+ ### updatePassword() {#updatepassword}
150
150
 
151
- > **updatePassword**(`email`, `currentPassword`, `newPassword`): `Promise`\<`void`\>
151
+ > **updatePassword**(`currentPassword`, `newPassword`): `Promise`\<`void`\>
152
152
 
153
153
  Update the user's password.
154
154
 
155
155
  #### Parameters
156
156
 
157
- ##### email
158
-
159
- `string`
160
-
161
- The email address of the user to update.
162
-
163
157
  ##### currentPassword
164
158
 
165
159
  `string`
@@ -176,8 +170,74 @@ The new password for the user.
176
170
 
177
171
  `Promise`\<`void`\>
178
172
 
179
- Nothing.
173
+ A promise that resolves when the password has been updated on the server.
180
174
 
181
175
  #### Implementation of
182
176
 
183
177
  `IAuthenticationComponent.updatePassword`
178
+
179
+ ***
180
+
181
+ ### getEndpointWithPrefix() {#getendpointwithprefix}
182
+
183
+ > **getEndpointWithPrefix**(): `string`
184
+
185
+ Get the endpoint with the prefix for the namespace.
186
+
187
+ #### Returns
188
+
189
+ `string`
190
+
191
+ The endpoint with namespace prefix attached.
192
+
193
+ #### Inherited from
194
+
195
+ `BaseRestClient.getEndpointWithPrefix`
196
+
197
+ ***
198
+
199
+ ### fetch() {#fetch}
200
+
201
+ > **fetch**\<`T`, `U`\>(`route`, `method`, `request?`): `Promise`\<`U`\>
202
+
203
+ Perform a request in json format.
204
+
205
+ #### Type Parameters
206
+
207
+ ##### T
208
+
209
+ `T` *extends* `IHttpRequest`\<`any`\>
210
+
211
+ ##### U
212
+
213
+ `U` *extends* `IHttpResponse`\<`any`\>
214
+
215
+ #### Parameters
216
+
217
+ ##### route
218
+
219
+ `string`
220
+
221
+ The route of the request.
222
+
223
+ ##### method
224
+
225
+ `HttpMethod`
226
+
227
+ The http method.
228
+
229
+ ##### request?
230
+
231
+ `T`
232
+
233
+ Request to send to the endpoint.
234
+
235
+ #### Returns
236
+
237
+ `Promise`\<`U`\>
238
+
239
+ The response.
240
+
241
+ #### Inherited from
242
+
243
+ `BaseRestClient.fetch`
@@ -2,4 +2,10 @@
2
2
 
3
3
  ## Classes
4
4
 
5
+ - [EntityStorageAuthenticationAdminRestClient](classes/EntityStorageAuthenticationAdminRestClient.md)
6
+ - [EntityStorageAuthenticationAuditRestClient](classes/EntityStorageAuthenticationAuditRestClient.md)
5
7
  - [EntityStorageAuthenticationRestClient](classes/EntityStorageAuthenticationRestClient.md)
8
+
9
+ ## Interfaces
10
+
11
+ - [IEntityStorageAuthenticationRestClientConstructorOptions](interfaces/IEntityStorageAuthenticationRestClientConstructorOptions.md)
@@ -0,0 +1,141 @@
1
+ # Interface: IEntityStorageAuthenticationRestClientConstructorOptions
2
+
3
+ Options for the Entity Storage Authentication REST client constructor.
4
+
5
+ ## Extends
6
+
7
+ - `IBaseRestClientConfig`
8
+
9
+ ## Properties
10
+
11
+ ### cookieName? {#cookiename}
12
+
13
+ > `optional` **cookieName?**: `string`
14
+
15
+ The name of the cookie to use for storing the auth token.
16
+
17
+ #### Default
18
+
19
+ ```ts
20
+ access_token
21
+ ```
22
+
23
+ ***
24
+
25
+ ### endpoint {#endpoint}
26
+
27
+ > **endpoint**: `string`
28
+
29
+ The endpoint where the api is hosted.
30
+
31
+ #### Inherited from
32
+
33
+ `IBaseRestClientConfig.endpoint`
34
+
35
+ ***
36
+
37
+ ### pathPrefix? {#pathprefix}
38
+
39
+ > `optional` **pathPrefix?**: `string`
40
+
41
+ The prefix to the routes.
42
+
43
+ #### Inherited from
44
+
45
+ `IBaseRestClientConfig.pathPrefix`
46
+
47
+ ***
48
+
49
+ ### headers? {#headers}
50
+
51
+ > `optional` **headers?**: `IHttpHeaders`
52
+
53
+ The headers to include in requests.
54
+
55
+ #### Inherited from
56
+
57
+ `IBaseRestClientConfig.headers`
58
+
59
+ ***
60
+
61
+ ### timeout? {#timeout}
62
+
63
+ > `optional` **timeout?**: `number`
64
+
65
+ Timeout for requests in ms.
66
+
67
+ #### Inherited from
68
+
69
+ `IBaseRestClientConfig.timeout`
70
+
71
+ ***
72
+
73
+ ### includeCredentials? {#includecredentials}
74
+
75
+ > `optional` **includeCredentials?**: `boolean`
76
+
77
+ Include credentials in the request, defaults to true.
78
+
79
+ #### Inherited from
80
+
81
+ `IBaseRestClientConfig.includeCredentials`
82
+
83
+ ***
84
+
85
+ ### customHeaders? {#customheaders}
86
+
87
+ > `optional` **customHeaders?**: () => `Promise`\<`IHttpHeaders`\>
88
+
89
+ Hook to provide headers asynchronously.
90
+
91
+ #### Returns
92
+
93
+ `Promise`\<`IHttpHeaders`\>
94
+
95
+ A promise that resolves to the headers.
96
+
97
+ #### Inherited from
98
+
99
+ `IBaseRestClientConfig.customHeaders`
100
+
101
+ ***
102
+
103
+ ### customAuthHeader? {#customauthheader}
104
+
105
+ > `optional` **customAuthHeader?**: () => `Promise`\<`string`\>
106
+
107
+ Hook to provide an authorization header value asynchronously.
108
+
109
+ #### Returns
110
+
111
+ `Promise`\<`string`\>
112
+
113
+ A promise that resolves to the authorization header value.
114
+
115
+ #### Inherited from
116
+
117
+ `IBaseRestClientConfig.customAuthHeader`
118
+
119
+ ***
120
+
121
+ ### onAuthFailure? {#onauthfailure}
122
+
123
+ > `optional` **onAuthFailure?**: (`err`) => `Promise`\<`void`\>
124
+
125
+ Hook to handle authorization failures asynchronously.
126
+
127
+ #### Parameters
128
+
129
+ ##### err
130
+
131
+ `IError`
132
+
133
+ #### Returns
134
+
135
+ `Promise`\<`void`\>
136
+
137
+ A promise that resolves when the auth failure handling is complete.
138
+
139
+ #### Inherited from
140
+
141
+ `IBaseRestClientConfig.onAuthFailure`
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@twin.org/api-auth-entity-storage-rest-client",
3
- "version": "0.0.3-next.8",
4
- "description": "Perform REST authentication using entity storage.",
3
+ "version": "0.9.0-next.1",
4
+ "description": "REST clients for authentication and admin operations against entity storage endpoints.",
5
5
  "repository": {
6
6
  "type": "git",
7
- "url": "git+https://github.com/twinfoundation/api.git",
7
+ "url": "git+https://github.com/iotaledger/twin-api.git",
8
8
  "directory": "packages/api-auth-entity-storage-rest-client"
9
9
  },
10
10
  "author": "martyn.janes@iota.org",
@@ -14,12 +14,12 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@twin.org/api-auth-entity-storage-models": "0.0.3-next.8",
18
- "@twin.org/api-core": "0.0.3-next.8",
19
- "@twin.org/api-models": "0.0.3-next.8",
20
- "@twin.org/core": "next",
21
- "@twin.org/nameof": "next",
22
- "@twin.org/web": "next"
17
+ "@twin.org/api-auth-entity-storage-models": "0.9.0-next.1",
18
+ "@twin.org/api-core": "0.9.0-next.1",
19
+ "@twin.org/api-models": "0.9.0-next.1",
20
+ "@twin.org/core": "0.9.0-next.1",
21
+ "@twin.org/nameof": "0.9.0-next.1",
22
+ "@twin.org/web": "0.9.0-next.1"
23
23
  },
24
24
  "main": "./dist/es/index.js",
25
25
  "types": "./dist/types/index.d.ts",
@@ -49,7 +49,7 @@
49
49
  "database"
50
50
  ],
51
51
  "bugs": {
52
- "url": "git+https://github.com/twinfoundation/api/issues"
52
+ "url": "git+https://github.com/iotaledger/twin-api/issues"
53
53
  },
54
54
  "homepage": "https://twindev.org"
55
55
  }