@twin.org/api-auth-entity-storage-rest-client 0.0.2-next.11 → 0.0.2-next.12
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 +9 -9
- package/dist/esm/index.mjs +9 -9
- package/dist/types/{clients/entityStorageAuthenticationClient.d.ts → entityStorageAuthenticationRestClient.d.ts} +2 -2
- package/dist/types/index.d.ts +1 -1
- package/docs/changelog.md +16 -0
- package/docs/reference/classes/{EntityStorageAuthenticationClient.md → EntityStorageAuthenticationRestClient.md} +4 -8
- package/docs/reference/index.md +1 -1
- package/package.json +21 -5
package/dist/cjs/index.cjs
CHANGED
|
@@ -6,17 +6,17 @@ var core = require('@twin.org/core');
|
|
|
6
6
|
/**
|
|
7
7
|
* The client to connect to the authentication service.
|
|
8
8
|
*/
|
|
9
|
-
class
|
|
9
|
+
class EntityStorageAuthenticationRestClient extends apiCore.BaseRestClient {
|
|
10
10
|
/**
|
|
11
11
|
* Runtime name for the class.
|
|
12
12
|
*/
|
|
13
|
-
CLASS_NAME = "
|
|
13
|
+
static CLASS_NAME = "EntityStorageAuthenticationRestClient";
|
|
14
14
|
/**
|
|
15
15
|
* Create a new instance of EntityStorageAuthenticationClient.
|
|
16
16
|
* @param config The configuration for the client.
|
|
17
17
|
*/
|
|
18
18
|
constructor(config) {
|
|
19
|
-
super("
|
|
19
|
+
super("EntityStorageAuthenticationRestClient", config, "authentication");
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Perform a login for the user.
|
|
@@ -25,8 +25,8 @@ class EntityStorageAuthenticationClient extends apiCore.BaseRestClient {
|
|
|
25
25
|
* @returns The authentication token for the user, if it uses a mechanism with public access.
|
|
26
26
|
*/
|
|
27
27
|
async login(email, password) {
|
|
28
|
-
core.Guards.stringValue(
|
|
29
|
-
core.Guards.stringValue(
|
|
28
|
+
core.Guards.stringValue(EntityStorageAuthenticationRestClient.CLASS_NAME, "email", email);
|
|
29
|
+
core.Guards.stringValue(EntityStorageAuthenticationRestClient.CLASS_NAME, "password", password);
|
|
30
30
|
const response = await this.fetch("/login", "POST", {
|
|
31
31
|
body: {
|
|
32
32
|
email,
|
|
@@ -68,9 +68,9 @@ class EntityStorageAuthenticationClient extends apiCore.BaseRestClient {
|
|
|
68
68
|
* @returns Nothing.
|
|
69
69
|
*/
|
|
70
70
|
async updatePassword(email, currentPassword, newPassword) {
|
|
71
|
-
core.Guards.stringValue(
|
|
72
|
-
core.Guards.stringValue(
|
|
73
|
-
core.Guards.stringValue(
|
|
71
|
+
core.Guards.stringValue(EntityStorageAuthenticationRestClient.CLASS_NAME, "email", email);
|
|
72
|
+
core.Guards.stringValue(EntityStorageAuthenticationRestClient.CLASS_NAME, "currentPassword", currentPassword);
|
|
73
|
+
core.Guards.stringValue(EntityStorageAuthenticationRestClient.CLASS_NAME, "newPassword", newPassword);
|
|
74
74
|
await this.fetch("/:email/password", "PUT", {
|
|
75
75
|
pathParams: {
|
|
76
76
|
email
|
|
@@ -83,4 +83,4 @@ class EntityStorageAuthenticationClient extends apiCore.BaseRestClient {
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
exports.
|
|
86
|
+
exports.EntityStorageAuthenticationRestClient = EntityStorageAuthenticationRestClient;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -4,17 +4,17 @@ import { Guards } from '@twin.org/core';
|
|
|
4
4
|
/**
|
|
5
5
|
* The client to connect to the authentication service.
|
|
6
6
|
*/
|
|
7
|
-
class
|
|
7
|
+
class EntityStorageAuthenticationRestClient extends BaseRestClient {
|
|
8
8
|
/**
|
|
9
9
|
* Runtime name for the class.
|
|
10
10
|
*/
|
|
11
|
-
CLASS_NAME = "
|
|
11
|
+
static CLASS_NAME = "EntityStorageAuthenticationRestClient";
|
|
12
12
|
/**
|
|
13
13
|
* Create a new instance of EntityStorageAuthenticationClient.
|
|
14
14
|
* @param config The configuration for the client.
|
|
15
15
|
*/
|
|
16
16
|
constructor(config) {
|
|
17
|
-
super("
|
|
17
|
+
super("EntityStorageAuthenticationRestClient", config, "authentication");
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* Perform a login for the user.
|
|
@@ -23,8 +23,8 @@ class EntityStorageAuthenticationClient extends BaseRestClient {
|
|
|
23
23
|
* @returns The authentication token for the user, if it uses a mechanism with public access.
|
|
24
24
|
*/
|
|
25
25
|
async login(email, password) {
|
|
26
|
-
Guards.stringValue(
|
|
27
|
-
Guards.stringValue(
|
|
26
|
+
Guards.stringValue(EntityStorageAuthenticationRestClient.CLASS_NAME, "email", email);
|
|
27
|
+
Guards.stringValue(EntityStorageAuthenticationRestClient.CLASS_NAME, "password", password);
|
|
28
28
|
const response = await this.fetch("/login", "POST", {
|
|
29
29
|
body: {
|
|
30
30
|
email,
|
|
@@ -66,9 +66,9 @@ class EntityStorageAuthenticationClient extends BaseRestClient {
|
|
|
66
66
|
* @returns Nothing.
|
|
67
67
|
*/
|
|
68
68
|
async updatePassword(email, currentPassword, newPassword) {
|
|
69
|
-
Guards.stringValue(
|
|
70
|
-
Guards.stringValue(
|
|
71
|
-
Guards.stringValue(
|
|
69
|
+
Guards.stringValue(EntityStorageAuthenticationRestClient.CLASS_NAME, "email", email);
|
|
70
|
+
Guards.stringValue(EntityStorageAuthenticationRestClient.CLASS_NAME, "currentPassword", currentPassword);
|
|
71
|
+
Guards.stringValue(EntityStorageAuthenticationRestClient.CLASS_NAME, "newPassword", newPassword);
|
|
72
72
|
await this.fetch("/:email/password", "PUT", {
|
|
73
73
|
pathParams: {
|
|
74
74
|
email
|
|
@@ -81,4 +81,4 @@ class EntityStorageAuthenticationClient extends BaseRestClient {
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
export {
|
|
84
|
+
export { EntityStorageAuthenticationRestClient };
|
|
@@ -4,11 +4,11 @@ import type { IBaseRestClientConfig } from "@twin.org/api-models";
|
|
|
4
4
|
/**
|
|
5
5
|
* The client to connect to the authentication service.
|
|
6
6
|
*/
|
|
7
|
-
export declare class
|
|
7
|
+
export declare class EntityStorageAuthenticationRestClient extends BaseRestClient implements IAuthenticationComponent {
|
|
8
8
|
/**
|
|
9
9
|
* Runtime name for the class.
|
|
10
10
|
*/
|
|
11
|
-
readonly CLASS_NAME: string;
|
|
11
|
+
static readonly CLASS_NAME: string;
|
|
12
12
|
/**
|
|
13
13
|
* Create a new instance of EntityStorageAuthenticationClient.
|
|
14
14
|
* @param config The configuration for the client.
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./entityStorageAuthenticationRestClient";
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @twin.org/api-auth-entity-storage-rest-client - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.2-next.12](https://github.com/twinfoundation/api/compare/api-auth-entity-storage-rest-client-v0.0.2-next.11...api-auth-entity-storage-rest-client-v0.0.2-next.12) (2025-10-09)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add validate-locales ([cdba610](https://github.com/twinfoundation/api/commit/cdba610a0acb5022d2e3ce729732e6646a297e5e))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/api-auth-entity-storage-models bumped from 0.0.2-next.11 to 0.0.2-next.12
|
|
16
|
+
* @twin.org/api-core bumped from 0.0.2-next.11 to 0.0.2-next.12
|
|
17
|
+
* @twin.org/api-models bumped from 0.0.2-next.11 to 0.0.2-next.12
|
|
18
|
+
|
|
3
19
|
## [0.0.2-next.11](https://github.com/twinfoundation/api/compare/api-auth-entity-storage-rest-client-v0.0.2-next.10...api-auth-entity-storage-rest-client-v0.0.2-next.11) (2025-09-29)
|
|
4
20
|
|
|
5
21
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Class:
|
|
1
|
+
# Class: EntityStorageAuthenticationRestClient
|
|
2
2
|
|
|
3
3
|
The client to connect to the authentication service.
|
|
4
4
|
|
|
@@ -14,7 +14,7 @@ The client to connect to the authentication service.
|
|
|
14
14
|
|
|
15
15
|
### Constructor
|
|
16
16
|
|
|
17
|
-
> **new
|
|
17
|
+
> **new EntityStorageAuthenticationRestClient**(`config`): `EntityStorageAuthenticationRestClient`
|
|
18
18
|
|
|
19
19
|
Create a new instance of EntityStorageAuthenticationClient.
|
|
20
20
|
|
|
@@ -28,7 +28,7 @@ The configuration for the client.
|
|
|
28
28
|
|
|
29
29
|
#### Returns
|
|
30
30
|
|
|
31
|
-
`
|
|
31
|
+
`EntityStorageAuthenticationRestClient`
|
|
32
32
|
|
|
33
33
|
#### Overrides
|
|
34
34
|
|
|
@@ -38,14 +38,10 @@ The configuration for the client.
|
|
|
38
38
|
|
|
39
39
|
### CLASS\_NAME
|
|
40
40
|
|
|
41
|
-
> `readonly` **CLASS\_NAME**: `string`
|
|
41
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
42
42
|
|
|
43
43
|
Runtime name for the class.
|
|
44
44
|
|
|
45
|
-
#### Implementation of
|
|
46
|
-
|
|
47
|
-
`IAuthenticationComponent.CLASS_NAME`
|
|
48
|
-
|
|
49
45
|
## Methods
|
|
50
46
|
|
|
51
47
|
### login()
|
package/docs/reference/index.md
CHANGED
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.2-next.
|
|
3
|
+
"version": "0.0.2-next.12",
|
|
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.2-next.
|
|
18
|
-
"@twin.org/api-core": "0.0.2-next.
|
|
19
|
-
"@twin.org/api-models": "0.0.2-next.
|
|
17
|
+
"@twin.org/api-auth-entity-storage-models": "0.0.2-next.12",
|
|
18
|
+
"@twin.org/api-core": "0.0.2-next.12",
|
|
19
|
+
"@twin.org/api-models": "0.0.2-next.12",
|
|
20
20
|
"@twin.org/core": "next",
|
|
21
21
|
"@twin.org/nameof": "next",
|
|
22
22
|
"@twin.org/web": "next"
|
|
@@ -37,5 +37,21 @@
|
|
|
37
37
|
"dist/types",
|
|
38
38
|
"locales",
|
|
39
39
|
"docs"
|
|
40
|
-
]
|
|
40
|
+
],
|
|
41
|
+
"keywords": [
|
|
42
|
+
"twin",
|
|
43
|
+
"trade",
|
|
44
|
+
"iota",
|
|
45
|
+
"framework",
|
|
46
|
+
"blockchain",
|
|
47
|
+
"api",
|
|
48
|
+
"entity",
|
|
49
|
+
"storage",
|
|
50
|
+
"persistence",
|
|
51
|
+
"database"
|
|
52
|
+
],
|
|
53
|
+
"bugs": {
|
|
54
|
+
"url": "git+https://github.com/twinfoundation/api/issues"
|
|
55
|
+
},
|
|
56
|
+
"homepage": "https://twindev.org"
|
|
41
57
|
}
|