@twin.org/api-auth-entity-storage-rest-client 0.0.1-next.9 → 0.0.2-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/dist/cjs/index.cjs
CHANGED
|
@@ -60,6 +60,27 @@ class EntityStorageAuthenticationClient extends apiCore.BaseRestClient {
|
|
|
60
60
|
});
|
|
61
61
|
return response.body;
|
|
62
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Update the user's password.
|
|
65
|
+
* @param email The email address of the user to update.
|
|
66
|
+
* @param currentPassword The current password for the user.
|
|
67
|
+
* @param newPassword The new password for the user.
|
|
68
|
+
* @returns Nothing.
|
|
69
|
+
*/
|
|
70
|
+
async updatePassword(email, currentPassword, newPassword) {
|
|
71
|
+
core.Guards.stringValue(this.CLASS_NAME, "email", email);
|
|
72
|
+
core.Guards.stringValue(this.CLASS_NAME, "currentPassword", currentPassword);
|
|
73
|
+
core.Guards.stringValue(this.CLASS_NAME, "newPassword", newPassword);
|
|
74
|
+
await this.fetch("/:email/password", "PUT", {
|
|
75
|
+
pathParams: {
|
|
76
|
+
email
|
|
77
|
+
},
|
|
78
|
+
body: {
|
|
79
|
+
currentPassword,
|
|
80
|
+
newPassword
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
63
84
|
}
|
|
64
85
|
|
|
65
86
|
exports.EntityStorageAuthenticationClient = EntityStorageAuthenticationClient;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -58,6 +58,27 @@ class EntityStorageAuthenticationClient extends BaseRestClient {
|
|
|
58
58
|
});
|
|
59
59
|
return response.body;
|
|
60
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Update the user's password.
|
|
63
|
+
* @param email The email address of the user to update.
|
|
64
|
+
* @param currentPassword The current password for the user.
|
|
65
|
+
* @param newPassword The new password for the user.
|
|
66
|
+
* @returns Nothing.
|
|
67
|
+
*/
|
|
68
|
+
async updatePassword(email, currentPassword, newPassword) {
|
|
69
|
+
Guards.stringValue(this.CLASS_NAME, "email", email);
|
|
70
|
+
Guards.stringValue(this.CLASS_NAME, "currentPassword", currentPassword);
|
|
71
|
+
Guards.stringValue(this.CLASS_NAME, "newPassword", newPassword);
|
|
72
|
+
await this.fetch("/:email/password", "PUT", {
|
|
73
|
+
pathParams: {
|
|
74
|
+
email
|
|
75
|
+
},
|
|
76
|
+
body: {
|
|
77
|
+
currentPassword,
|
|
78
|
+
newPassword
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
61
82
|
}
|
|
62
83
|
|
|
63
84
|
export { EntityStorageAuthenticationClient };
|
|
@@ -39,4 +39,12 @@ export declare class EntityStorageAuthenticationClient extends BaseRestClient im
|
|
|
39
39
|
token?: string;
|
|
40
40
|
expiry: number;
|
|
41
41
|
}>;
|
|
42
|
+
/**
|
|
43
|
+
* Update the user's password.
|
|
44
|
+
* @param email The email address of the user to update.
|
|
45
|
+
* @param currentPassword The current password for the user.
|
|
46
|
+
* @param newPassword The new password for the user.
|
|
47
|
+
* @returns Nothing.
|
|
48
|
+
*/
|
|
49
|
+
updatePassword(email: string, currentPassword: string, newPassword: string): Promise<void>;
|
|
42
50
|
}
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,119 @@
|
|
|
1
1
|
# @twin.org/api-auth-entity-storage-rest-client - Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## [0.0.2-next.1](https://github.com/twinfoundation/api/compare/api-auth-entity-storage-rest-client-v0.0.2-next.0...api-auth-entity-storage-rest-client-v0.0.2-next.1) (2025-07-08)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add json-ld mime type processor and auth admin component ([8861791](https://github.com/twinfoundation/api/commit/88617916e23bfbca023dbae1976fe421983a02ff))
|
|
9
|
+
* update dependencies ([1171dc4](https://github.com/twinfoundation/api/commit/1171dc416a9481737f6a640e3cf30145768f37e9))
|
|
10
|
+
* use shared store mechanism ([#19](https://github.com/twinfoundation/api/issues/19)) ([32116df](https://github.com/twinfoundation/api/commit/32116df3b4380a30137f5056f242a5c99afa2df9))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Dependencies
|
|
14
|
+
|
|
15
|
+
* The following workspace dependencies were updated
|
|
16
|
+
* dependencies
|
|
17
|
+
* @twin.org/api-auth-entity-storage-models bumped from 0.0.2-next.0 to 0.0.2-next.1
|
|
18
|
+
* @twin.org/api-core bumped from 0.0.2-next.0 to 0.0.2-next.1
|
|
19
|
+
* @twin.org/api-models bumped from 0.0.2-next.0 to 0.0.2-next.1
|
|
20
|
+
|
|
21
|
+
## 0.0.1 (2025-07-03)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
* release to production ([70ee2d5](https://github.com/twinfoundation/api/commit/70ee2d56a1dc9537d7c9c154d4cb78a235678a3a))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Dependencies
|
|
30
|
+
|
|
31
|
+
* The following workspace dependencies were updated
|
|
32
|
+
* dependencies
|
|
33
|
+
* @twin.org/api-auth-entity-storage-models bumped from ^0.0.0 to ^0.0.1
|
|
34
|
+
* @twin.org/api-core bumped from ^0.0.0 to ^0.0.1
|
|
35
|
+
* @twin.org/api-models bumped from ^0.0.0 to ^0.0.1
|
|
36
|
+
|
|
37
|
+
## [0.0.1-next.36](https://github.com/twinfoundation/api/compare/api-auth-entity-storage-rest-client-v0.0.1-next.35...api-auth-entity-storage-rest-client-v0.0.1-next.36) (2025-06-17)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
### Miscellaneous Chores
|
|
41
|
+
|
|
42
|
+
* **api-auth-entity-storage-rest-client:** Synchronize repo versions
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### Dependencies
|
|
46
|
+
|
|
47
|
+
* The following workspace dependencies were updated
|
|
48
|
+
* dependencies
|
|
49
|
+
* @twin.org/api-auth-entity-storage-models bumped from 0.0.1-next.35 to 0.0.1-next.36
|
|
50
|
+
* @twin.org/api-core bumped from 0.0.1-next.35 to 0.0.1-next.36
|
|
51
|
+
* @twin.org/api-models bumped from 0.0.1-next.35 to 0.0.1-next.36
|
|
52
|
+
|
|
53
|
+
## [0.0.1-next.35](https://github.com/twinfoundation/api/compare/api-auth-entity-storage-rest-client-v0.0.1-next.34...api-auth-entity-storage-rest-client-v0.0.1-next.35) (2025-06-11)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
### Features
|
|
57
|
+
|
|
58
|
+
* update dependencies ([1171dc4](https://github.com/twinfoundation/api/commit/1171dc416a9481737f6a640e3cf30145768f37e9))
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
### Dependencies
|
|
62
|
+
|
|
63
|
+
* The following workspace dependencies were updated
|
|
64
|
+
* dependencies
|
|
65
|
+
* @twin.org/api-auth-entity-storage-models bumped from 0.0.1-next.34 to 0.0.1-next.35
|
|
66
|
+
* @twin.org/api-core bumped from 0.0.1-next.34 to 0.0.1-next.35
|
|
67
|
+
* @twin.org/api-models bumped from 0.0.1-next.34 to 0.0.1-next.35
|
|
68
|
+
|
|
69
|
+
## [0.0.1-next.34](https://github.com/twinfoundation/api/compare/api-auth-entity-storage-rest-client-v0.0.1-next.33...api-auth-entity-storage-rest-client-v0.0.1-next.34) (2025-05-27)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
### Miscellaneous Chores
|
|
73
|
+
|
|
74
|
+
* **api-auth-entity-storage-rest-client:** Synchronize repo versions
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
### Dependencies
|
|
78
|
+
|
|
79
|
+
* The following workspace dependencies were updated
|
|
80
|
+
* dependencies
|
|
81
|
+
* @twin.org/api-auth-entity-storage-models bumped from 0.0.1-next.33 to 0.0.1-next.34
|
|
82
|
+
* @twin.org/api-core bumped from 0.0.1-next.33 to 0.0.1-next.34
|
|
83
|
+
* @twin.org/api-models bumped from 0.0.1-next.33 to 0.0.1-next.34
|
|
84
|
+
|
|
85
|
+
## [0.0.1-next.33](https://github.com/twinfoundation/api/compare/api-auth-entity-storage-rest-client-v0.0.1-next.32...api-auth-entity-storage-rest-client-v0.0.1-next.33) (2025-04-17)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
### Features
|
|
89
|
+
|
|
90
|
+
* use shared store mechanism ([#19](https://github.com/twinfoundation/api/issues/19)) ([32116df](https://github.com/twinfoundation/api/commit/32116df3b4380a30137f5056f242a5c99afa2df9))
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
### Dependencies
|
|
94
|
+
|
|
95
|
+
* The following workspace dependencies were updated
|
|
96
|
+
* dependencies
|
|
97
|
+
* @twin.org/api-auth-entity-storage-models bumped from 0.0.1-next.32 to 0.0.1-next.33
|
|
98
|
+
* @twin.org/api-core bumped from 0.0.1-next.32 to 0.0.1-next.33
|
|
99
|
+
* @twin.org/api-models bumped from 0.0.1-next.32 to 0.0.1-next.33
|
|
100
|
+
|
|
101
|
+
## [0.0.1-next.32](https://github.com/twinfoundation/api/compare/api-auth-entity-storage-rest-client-v0.0.1-next.31...api-auth-entity-storage-rest-client-v0.0.1-next.32) (2025-03-28)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
### Miscellaneous Chores
|
|
105
|
+
|
|
106
|
+
* **api-auth-entity-storage-rest-client:** Synchronize repo versions
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
### Dependencies
|
|
110
|
+
|
|
111
|
+
* The following workspace dependencies were updated
|
|
112
|
+
* dependencies
|
|
113
|
+
* @twin.org/api-auth-entity-storage-models bumped from 0.0.1-next.31 to 0.0.1-next.32
|
|
114
|
+
* @twin.org/api-core bumped from 0.0.1-next.31 to 0.0.1-next.32
|
|
115
|
+
* @twin.org/api-models bumped from 0.0.1-next.31 to 0.0.1-next.32
|
|
116
|
+
|
|
117
|
+
## v0.0.1-next.31
|
|
4
118
|
|
|
5
119
|
- Initial Release
|
|
@@ -12,21 +12,23 @@ The client to connect to the authentication service.
|
|
|
12
12
|
|
|
13
13
|
## Constructors
|
|
14
14
|
|
|
15
|
-
###
|
|
15
|
+
### Constructor
|
|
16
16
|
|
|
17
|
-
> **new EntityStorageAuthenticationClient**(`config`):
|
|
17
|
+
> **new EntityStorageAuthenticationClient**(`config`): `EntityStorageAuthenticationClient`
|
|
18
18
|
|
|
19
19
|
Create a new instance of EntityStorageAuthenticationClient.
|
|
20
20
|
|
|
21
21
|
#### Parameters
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
##### config
|
|
24
|
+
|
|
25
|
+
`IBaseRestClientConfig`
|
|
24
26
|
|
|
25
27
|
The configuration for the client.
|
|
26
28
|
|
|
27
29
|
#### Returns
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
`EntityStorageAuthenticationClient`
|
|
30
32
|
|
|
31
33
|
#### Overrides
|
|
32
34
|
|
|
@@ -48,34 +50,30 @@ Runtime name for the class.
|
|
|
48
50
|
|
|
49
51
|
### login()
|
|
50
52
|
|
|
51
|
-
> **login**(`email`, `password`): `Promise
|
|
53
|
+
> **login**(`email`, `password`): `Promise`\<\{ `token?`: `string`; `expiry`: `number`; \}\>
|
|
52
54
|
|
|
53
55
|
Perform a login for the user.
|
|
54
56
|
|
|
55
57
|
#### Parameters
|
|
56
58
|
|
|
57
|
-
|
|
59
|
+
##### email
|
|
60
|
+
|
|
61
|
+
`string`
|
|
58
62
|
|
|
59
63
|
The email address for the user.
|
|
60
64
|
|
|
61
|
-
|
|
65
|
+
##### password
|
|
66
|
+
|
|
67
|
+
`string`
|
|
62
68
|
|
|
63
69
|
The password for the user.
|
|
64
70
|
|
|
65
71
|
#### Returns
|
|
66
72
|
|
|
67
|
-
`Promise
|
|
73
|
+
`Promise`\<\{ `token?`: `string`; `expiry`: `number`; \}\>
|
|
68
74
|
|
|
69
75
|
The authentication token for the user, if it uses a mechanism with public access.
|
|
70
76
|
|
|
71
|
-
##### token?
|
|
72
|
-
|
|
73
|
-
> `optional` **token**: `string`
|
|
74
|
-
|
|
75
|
-
##### expiry
|
|
76
|
-
|
|
77
|
-
> **expiry**: `number`
|
|
78
|
-
|
|
79
77
|
#### Implementation of
|
|
80
78
|
|
|
81
79
|
`IAuthenticationComponent.login`
|
|
@@ -84,13 +82,15 @@ The authentication token for the user, if it uses a mechanism with public access
|
|
|
84
82
|
|
|
85
83
|
### logout()
|
|
86
84
|
|
|
87
|
-
> **logout**(`token
|
|
85
|
+
> **logout**(`token?`): `Promise`\<`void`\>
|
|
88
86
|
|
|
89
87
|
Logout the current user.
|
|
90
88
|
|
|
91
89
|
#### Parameters
|
|
92
90
|
|
|
93
|
-
|
|
91
|
+
##### token?
|
|
92
|
+
|
|
93
|
+
`string`
|
|
94
94
|
|
|
95
95
|
The token to logout, if it uses a mechanism with public access.
|
|
96
96
|
|
|
@@ -108,30 +108,62 @@ Nothing.
|
|
|
108
108
|
|
|
109
109
|
### refresh()
|
|
110
110
|
|
|
111
|
-
> **refresh**(`token
|
|
111
|
+
> **refresh**(`token?`): `Promise`\<\{ `token?`: `string`; `expiry`: `number`; \}\>
|
|
112
112
|
|
|
113
113
|
Refresh the token.
|
|
114
114
|
|
|
115
115
|
#### Parameters
|
|
116
116
|
|
|
117
|
-
|
|
117
|
+
##### token?
|
|
118
|
+
|
|
119
|
+
`string`
|
|
118
120
|
|
|
119
121
|
The token to refresh, if it uses a mechanism with public access.
|
|
120
122
|
|
|
121
123
|
#### Returns
|
|
122
124
|
|
|
123
|
-
`Promise
|
|
125
|
+
`Promise`\<\{ `token?`: `string`; `expiry`: `number`; \}\>
|
|
124
126
|
|
|
125
127
|
The refreshed token, if it uses a mechanism with public access.
|
|
126
128
|
|
|
127
|
-
|
|
129
|
+
#### Implementation of
|
|
130
|
+
|
|
131
|
+
`IAuthenticationComponent.refresh`
|
|
132
|
+
|
|
133
|
+
***
|
|
128
134
|
|
|
129
|
-
|
|
135
|
+
### updatePassword()
|
|
130
136
|
|
|
131
|
-
|
|
137
|
+
> **updatePassword**(`email`, `currentPassword`, `newPassword`): `Promise`\<`void`\>
|
|
132
138
|
|
|
133
|
-
|
|
139
|
+
Update the user's password.
|
|
140
|
+
|
|
141
|
+
#### Parameters
|
|
142
|
+
|
|
143
|
+
##### email
|
|
144
|
+
|
|
145
|
+
`string`
|
|
146
|
+
|
|
147
|
+
The email address of the user to update.
|
|
148
|
+
|
|
149
|
+
##### currentPassword
|
|
150
|
+
|
|
151
|
+
`string`
|
|
152
|
+
|
|
153
|
+
The current password for the user.
|
|
154
|
+
|
|
155
|
+
##### newPassword
|
|
156
|
+
|
|
157
|
+
`string`
|
|
158
|
+
|
|
159
|
+
The new password for the user.
|
|
160
|
+
|
|
161
|
+
#### Returns
|
|
162
|
+
|
|
163
|
+
`Promise`\<`void`\>
|
|
164
|
+
|
|
165
|
+
Nothing.
|
|
134
166
|
|
|
135
167
|
#### Implementation of
|
|
136
168
|
|
|
137
|
-
`IAuthenticationComponent.
|
|
169
|
+
`IAuthenticationComponent.updatePassword`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/api-auth-entity-storage-rest-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2-next.1",
|
|
4
4
|
"description": "Perform REST authentication using entity storage.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
"node": ">=20.0.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@twin.org/api-auth-entity-storage-models": "0.0.
|
|
18
|
-
"@twin.org/api-core": "0.0.
|
|
19
|
-
"@twin.org/api-models": "0.0.
|
|
17
|
+
"@twin.org/api-auth-entity-storage-models": "0.0.2-next.1",
|
|
18
|
+
"@twin.org/api-core": "0.0.2-next.1",
|
|
19
|
+
"@twin.org/api-models": "0.0.2-next.1",
|
|
20
20
|
"@twin.org/core": "next",
|
|
21
21
|
"@twin.org/nameof": "next",
|
|
22
22
|
"@twin.org/web": "next"
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"types": "./dist/types/index.d.ts",
|
|
27
27
|
"exports": {
|
|
28
28
|
".": {
|
|
29
|
+
"types": "./dist/types/index.d.ts",
|
|
29
30
|
"require": "./dist/cjs/index.cjs",
|
|
30
|
-
"import": "./dist/esm/index.mjs"
|
|
31
|
-
"types": "./dist/types/index.d.ts"
|
|
31
|
+
"import": "./dist/esm/index.mjs"
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
"files": [
|