@twin.org/api-auth-entity-storage-rest-client 0.0.3-next.21 → 0.0.3-next.23
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/es/entityStorageAuthenticationAuditRestClient.js +73 -0
- package/dist/es/entityStorageAuthenticationAuditRestClient.js.map +1 -0
- package/dist/es/index.js +1 -0
- package/dist/es/index.js.map +1 -1
- package/dist/types/entityStorageAuthenticationAuditRestClient.d.ts +54 -0
- package/dist/types/index.d.ts +1 -0
- package/docs/changelog.md +32 -0
- package/docs/reference/classes/EntityStorageAuthenticationAdminRestClient.md +10 -10
- package/docs/reference/classes/EntityStorageAuthenticationAuditRestClient.md +231 -0
- package/docs/reference/classes/EntityStorageAuthenticationRestClient.md +8 -8
- package/docs/reference/index.md +1 -0
- package/docs/reference/interfaces/IEntityStorageAuthenticationRestClientConstructorOptions.md +17 -11
- package/package.json +4 -4
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { BaseRestClient } from "@twin.org/api-core";
|
|
2
|
+
import { Coerce, Guards } from "@twin.org/core";
|
|
3
|
+
import { HeaderTypes } from "@twin.org/web";
|
|
4
|
+
/**
|
|
5
|
+
* The client to connect to the authentication audit service.
|
|
6
|
+
*/
|
|
7
|
+
export class EntityStorageAuthenticationAuditRestClient extends BaseRestClient {
|
|
8
|
+
/**
|
|
9
|
+
* Runtime name for the class.
|
|
10
|
+
*/
|
|
11
|
+
static CLASS_NAME = "EntityStorageAuthenticationAuditRestClient";
|
|
12
|
+
/**
|
|
13
|
+
* Create a new instance of EntityStorageAuthenticationAuditRestClient.
|
|
14
|
+
* @param config The configuration for the client.
|
|
15
|
+
*/
|
|
16
|
+
constructor(config) {
|
|
17
|
+
super("EntityStorageAuthenticationAuditRestClient", config, "authentication/audit");
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Returns the class name of the component.
|
|
21
|
+
* @returns The class name of the component.
|
|
22
|
+
*/
|
|
23
|
+
className() {
|
|
24
|
+
return EntityStorageAuthenticationAuditRestClient.CLASS_NAME;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Create a new audit entry.
|
|
28
|
+
* @param entry The audit entry to be logged.
|
|
29
|
+
* @returns The unique identifier of the created audit entry.
|
|
30
|
+
*/
|
|
31
|
+
async create(entry) {
|
|
32
|
+
Guards.object(EntityStorageAuthenticationAuditRestClient.CLASS_NAME, "entry", entry);
|
|
33
|
+
Guards.stringValue(EntityStorageAuthenticationAuditRestClient.CLASS_NAME, "entry.event", entry.event);
|
|
34
|
+
const response = await this.fetch("", "POST", {
|
|
35
|
+
body: entry
|
|
36
|
+
});
|
|
37
|
+
return response.headers?.[HeaderTypes.Location] ?? "";
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Query the audit entries.
|
|
41
|
+
* @param options The query options.
|
|
42
|
+
* @param options.actorId The actor identifier to filter the audit entries, optional.
|
|
43
|
+
* @param options.organizationId The organization identifier to filter the audit entries, optional.
|
|
44
|
+
* @param options.tenantId The tenant identifier to filter the audit entries, optional.
|
|
45
|
+
* @param options.nodeId The node identifier to filter the audit entries, optional.
|
|
46
|
+
* @param options.event The audit event to filter the audit entries, optional.
|
|
47
|
+
* @param options.startDate The start date to filter the audit entries, optional.
|
|
48
|
+
* @param options.endDate The end date to filter the audit entries, optional.
|
|
49
|
+
* @param cursor The cursor for pagination.
|
|
50
|
+
* @param limit The maximum number of entries to return.
|
|
51
|
+
* @returns The audit entries.
|
|
52
|
+
*/
|
|
53
|
+
async query(options, cursor, limit) {
|
|
54
|
+
const response = await this.fetch("", "GET", {
|
|
55
|
+
query: {
|
|
56
|
+
actorId: options?.actorId,
|
|
57
|
+
organizationId: options?.organizationId,
|
|
58
|
+
tenantId: options?.tenantId,
|
|
59
|
+
nodeId: options?.nodeId,
|
|
60
|
+
event: options?.event,
|
|
61
|
+
startDate: options?.startDate,
|
|
62
|
+
endDate: options?.endDate,
|
|
63
|
+
cursor,
|
|
64
|
+
limit: Coerce.string(limit)
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
return {
|
|
68
|
+
entries: response.body.entries,
|
|
69
|
+
cursor: response.body.cursor
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=entityStorageAuthenticationAuditRestClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entityStorageAuthenticationAuditRestClient.js","sourceRoot":"","sources":["../../src/entityStorageAuthenticationAuditRestClient.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;GAEG;AACH,MAAM,OAAO,0CACZ,SAAQ,cAAc;IAGtB;;OAEG;IACI,MAAM,CAAU,UAAU,gDAAgE;IAEjG;;;OAGG;IACH,YAAY,MAA6B;QACxC,KAAK,+CAAuD,MAAM,EAAE,sBAAsB,CAAC,CAAC;IAC7F,CAAC;IAED;;;OAGG;IACI,SAAS;QACf,OAAO,0CAA0C,CAAC,UAAU,CAAC;IAC9D,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,MAAM,CAClB,KAA4D;QAE5D,MAAM,CAAC,MAAM,CAAC,0CAA0C,CAAC,UAAU,WAAiB,KAAK,CAAC,CAAC;QAC3F,MAAM,CAAC,WAAW,CACjB,0CAA0C,CAAC,UAAU,iBAErD,KAAK,CAAC,KAAK,CACX,CAAC;QAEF,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,KAAK,CAAwC,EAAE,EAAE,MAAM,EAAE;YACpF,IAAI,EAAE,KAAK;SACX,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC,OAAO,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;IACvD,CAAC;IAED;;;;;;;;;;;;;OAaG;IACI,KAAK,CAAC,KAAK,CACjB,OAQC,EACD,MAAe,EACf,KAAc;QAKd,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,KAAK,CAA0C,EAAE,EAAE,KAAK,EAAE;YACrF,KAAK,EAAE;gBACN,OAAO,EAAE,OAAO,EAAE,OAAO;gBACzB,cAAc,EAAE,OAAO,EAAE,cAAc;gBACvC,QAAQ,EAAE,OAAO,EAAE,QAAQ;gBAC3B,MAAM,EAAE,OAAO,EAAE,MAAM;gBACvB,KAAK,EAAE,OAAO,EAAE,KAAK;gBACrB,SAAS,EAAE,OAAO,EAAE,SAAS;gBAC7B,OAAO,EAAE,OAAO,EAAE,OAAO;gBACzB,MAAM;gBACN,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;aAC3B;SACD,CAAC,CAAC;QAEH,OAAO;YACN,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,OAAO;YAC9B,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM;SAC5B,CAAC;IACH,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type {\n\tAuthAuditEvent,\n\tIAuditCreateRequest,\n\tIAuditQueryRequest,\n\tIAuditQueryResponse,\n\tIAuthenticationAuditComponent,\n\tIAuthenticationAuditEntry\n} from \"@twin.org/api-auth-entity-storage-models\";\nimport { BaseRestClient } from \"@twin.org/api-core\";\nimport type { IBaseRestClientConfig, ICreatedResponse } from \"@twin.org/api-models\";\nimport { Coerce, Guards } from \"@twin.org/core\";\nimport { nameof } from \"@twin.org/nameof\";\nimport { HeaderTypes } from \"@twin.org/web\";\n\n/**\n * The client to connect to the authentication audit service.\n */\nexport class EntityStorageAuthenticationAuditRestClient\n\textends BaseRestClient\n\timplements IAuthenticationAuditComponent\n{\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<EntityStorageAuthenticationAuditRestClient>();\n\n\t/**\n\t * Create a new instance of EntityStorageAuthenticationAuditRestClient.\n\t * @param config The configuration for the client.\n\t */\n\tconstructor(config: IBaseRestClientConfig) {\n\t\tsuper(nameof<EntityStorageAuthenticationAuditRestClient>(), config, \"authentication/audit\");\n\t}\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn EntityStorageAuthenticationAuditRestClient.CLASS_NAME;\n\t}\n\n\t/**\n\t * Create a new audit entry.\n\t * @param entry The audit entry to be logged.\n\t * @returns The unique identifier of the created audit entry.\n\t */\n\tpublic async create(\n\t\tentry: Omit<IAuthenticationAuditEntry, \"id\" | \"dateCreated\">\n\t): Promise<string> {\n\t\tGuards.object(EntityStorageAuthenticationAuditRestClient.CLASS_NAME, nameof(entry), entry);\n\t\tGuards.stringValue(\n\t\t\tEntityStorageAuthenticationAuditRestClient.CLASS_NAME,\n\t\t\tnameof(entry.event),\n\t\t\tentry.event\n\t\t);\n\n\t\tconst response = await this.fetch<IAuditCreateRequest, ICreatedResponse>(\"\", \"POST\", {\n\t\t\tbody: entry\n\t\t});\n\n\t\treturn response.headers?.[HeaderTypes.Location] ?? \"\";\n\t}\n\n\t/**\n\t * Query the audit entries.\n\t * @param options The query options.\n\t * @param options.actorId The actor identifier to filter the audit entries, optional.\n\t * @param options.organizationId The organization identifier to filter the audit entries, optional.\n\t * @param options.tenantId The tenant identifier to filter the audit entries, optional.\n\t * @param options.nodeId The node identifier to filter the audit entries, optional.\n\t * @param options.event The audit event to filter the audit entries, optional.\n\t * @param options.startDate The start date to filter the audit entries, optional.\n\t * @param options.endDate The end date to filter the audit entries, optional.\n\t * @param cursor The cursor for pagination.\n\t * @param limit The maximum number of entries to return.\n\t * @returns The audit entries.\n\t */\n\tpublic async query(\n\t\toptions?: {\n\t\t\tactorId?: string;\n\t\t\torganizationId?: string;\n\t\t\ttenantId?: string;\n\t\t\tnodeId?: string;\n\t\t\tevent?: AuthAuditEvent | string;\n\t\t\tstartDate?: string;\n\t\t\tendDate?: string;\n\t\t},\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\tentries: IAuthenticationAuditEntry[];\n\t\tcursor?: string;\n\t}> {\n\t\tconst response = await this.fetch<IAuditQueryRequest, IAuditQueryResponse>(\"\", \"GET\", {\n\t\t\tquery: {\n\t\t\t\tactorId: options?.actorId,\n\t\t\t\torganizationId: options?.organizationId,\n\t\t\t\ttenantId: options?.tenantId,\n\t\t\t\tnodeId: options?.nodeId,\n\t\t\t\tevent: options?.event,\n\t\t\t\tstartDate: options?.startDate,\n\t\t\t\tendDate: options?.endDate,\n\t\t\t\tcursor,\n\t\t\t\tlimit: Coerce.string(limit)\n\t\t\t}\n\t\t});\n\n\t\treturn {\n\t\t\tentries: response.body.entries,\n\t\t\tcursor: response.body.cursor\n\t\t};\n\t}\n}\n"]}
|
package/dist/es/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Copyright 2024 IOTA Stiftung.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0.
|
|
3
3
|
export * from "./entityStorageAuthenticationAdminRestClient.js";
|
|
4
|
+
export * from "./entityStorageAuthenticationAuditRestClient.js";
|
|
4
5
|
export * from "./entityStorageAuthenticationRestClient.js";
|
|
5
6
|
export * from "./models/entityStorageAuthenticationRestClientConstructorOptions.js";
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
package/dist/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,iDAAiD,CAAC;AAChE,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qEAAqE,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./entityStorageAuthenticationAdminRestClient.js\";\nexport * from \"./entityStorageAuthenticationRestClient.js\";\nexport * from \"./models/entityStorageAuthenticationRestClientConstructorOptions.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,iDAAiD,CAAC;AAChE,cAAc,iDAAiD,CAAC;AAChE,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qEAAqE,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./entityStorageAuthenticationAdminRestClient.js\";\nexport * from \"./entityStorageAuthenticationAuditRestClient.js\";\nexport * from \"./entityStorageAuthenticationRestClient.js\";\nexport * from \"./models/entityStorageAuthenticationRestClientConstructorOptions.js\";\n"]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { AuthAuditEvent, IAuthenticationAuditComponent, IAuthenticationAuditEntry } from "@twin.org/api-auth-entity-storage-models";
|
|
2
|
+
import { BaseRestClient } from "@twin.org/api-core";
|
|
3
|
+
import type { IBaseRestClientConfig } from "@twin.org/api-models";
|
|
4
|
+
/**
|
|
5
|
+
* The client to connect to the authentication audit service.
|
|
6
|
+
*/
|
|
7
|
+
export declare class EntityStorageAuthenticationAuditRestClient extends BaseRestClient implements IAuthenticationAuditComponent {
|
|
8
|
+
/**
|
|
9
|
+
* Runtime name for the class.
|
|
10
|
+
*/
|
|
11
|
+
static readonly CLASS_NAME: string;
|
|
12
|
+
/**
|
|
13
|
+
* Create a new instance of EntityStorageAuthenticationAuditRestClient.
|
|
14
|
+
* @param config The configuration for the client.
|
|
15
|
+
*/
|
|
16
|
+
constructor(config: IBaseRestClientConfig);
|
|
17
|
+
/**
|
|
18
|
+
* Returns the class name of the component.
|
|
19
|
+
* @returns The class name of the component.
|
|
20
|
+
*/
|
|
21
|
+
className(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Create a new audit entry.
|
|
24
|
+
* @param entry The audit entry to be logged.
|
|
25
|
+
* @returns The unique identifier of the created audit entry.
|
|
26
|
+
*/
|
|
27
|
+
create(entry: Omit<IAuthenticationAuditEntry, "id" | "dateCreated">): Promise<string>;
|
|
28
|
+
/**
|
|
29
|
+
* Query the audit entries.
|
|
30
|
+
* @param options The query options.
|
|
31
|
+
* @param options.actorId The actor identifier to filter the audit entries, optional.
|
|
32
|
+
* @param options.organizationId The organization identifier to filter the audit entries, optional.
|
|
33
|
+
* @param options.tenantId The tenant identifier to filter the audit entries, optional.
|
|
34
|
+
* @param options.nodeId The node identifier to filter the audit entries, optional.
|
|
35
|
+
* @param options.event The audit event to filter the audit entries, optional.
|
|
36
|
+
* @param options.startDate The start date to filter the audit entries, optional.
|
|
37
|
+
* @param options.endDate The end date to filter the audit entries, optional.
|
|
38
|
+
* @param cursor The cursor for pagination.
|
|
39
|
+
* @param limit The maximum number of entries to return.
|
|
40
|
+
* @returns The audit entries.
|
|
41
|
+
*/
|
|
42
|
+
query(options?: {
|
|
43
|
+
actorId?: string;
|
|
44
|
+
organizationId?: string;
|
|
45
|
+
tenantId?: string;
|
|
46
|
+
nodeId?: string;
|
|
47
|
+
event?: AuthAuditEvent | string;
|
|
48
|
+
startDate?: string;
|
|
49
|
+
endDate?: string;
|
|
50
|
+
}, cursor?: string, limit?: number): Promise<{
|
|
51
|
+
entries: IAuthenticationAuditEntry[];
|
|
52
|
+
cursor?: string;
|
|
53
|
+
}>;
|
|
54
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export * from "./entityStorageAuthenticationAdminRestClient.js";
|
|
2
|
+
export * from "./entityStorageAuthenticationAuditRestClient.js";
|
|
2
3
|
export * from "./entityStorageAuthenticationRestClient.js";
|
|
3
4
|
export * from "./models/entityStorageAuthenticationRestClientConstructorOptions.js";
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3-next.23](https://github.com/twinfoundation/api/compare/api-auth-entity-storage-rest-client-v0.0.3-next.22...api-auth-entity-storage-rest-client-v0.0.3-next.23) (2026-04-14)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* auth enhancements ([#93](https://github.com/twinfoundation/api/issues/93)) ([921a50c](https://github.com/twinfoundation/api/commit/921a50cd89d26e530a6be6174a5a803060fa0eb6))
|
|
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.3-next.22 to 0.0.3-next.23
|
|
16
|
+
* @twin.org/api-core bumped from 0.0.3-next.22 to 0.0.3-next.23
|
|
17
|
+
* @twin.org/api-models bumped from 0.0.3-next.22 to 0.0.3-next.23
|
|
18
|
+
|
|
19
|
+
## [0.0.3-next.22](https://github.com/twinfoundation/api/compare/api-auth-entity-storage-rest-client-v0.0.3-next.21...api-auth-entity-storage-rest-client-v0.0.3-next.22) (2026-03-27)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Miscellaneous Chores
|
|
23
|
+
|
|
24
|
+
* **api-auth-entity-storage-rest-client:** Synchronize repo versions
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Dependencies
|
|
28
|
+
|
|
29
|
+
* The following workspace dependencies were updated
|
|
30
|
+
* dependencies
|
|
31
|
+
* @twin.org/api-auth-entity-storage-models bumped from 0.0.3-next.21 to 0.0.3-next.22
|
|
32
|
+
* @twin.org/api-core bumped from 0.0.3-next.21 to 0.0.3-next.22
|
|
33
|
+
* @twin.org/api-models bumped from 0.0.3-next.21 to 0.0.3-next.22
|
|
34
|
+
|
|
3
35
|
## [0.0.3-next.21](https://github.com/twinfoundation/api/compare/api-auth-entity-storage-rest-client-v0.0.3-next.20...api-auth-entity-storage-rest-client-v0.0.3-next.21) (2026-03-11)
|
|
4
36
|
|
|
5
37
|
|
|
@@ -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
|
-
### create()
|
|
65
|
+
### create() {#create}
|
|
66
66
|
|
|
67
67
|
> **create**(`user`): `Promise`\<`void`\>
|
|
68
68
|
|
|
@@ -88,7 +88,7 @@ Nothing.
|
|
|
88
88
|
|
|
89
89
|
***
|
|
90
90
|
|
|
91
|
-
### update()
|
|
91
|
+
### update() {#update}
|
|
92
92
|
|
|
93
93
|
> **update**(`user`): `Promise`\<`void`\>
|
|
94
94
|
|
|
@@ -114,7 +114,7 @@ Nothing.
|
|
|
114
114
|
|
|
115
115
|
***
|
|
116
116
|
|
|
117
|
-
### get()
|
|
117
|
+
### get() {#get}
|
|
118
118
|
|
|
119
119
|
> **get**(`email`): `Promise`\<`Omit`\<`IAuthenticationUser`, `"salt"` \| `"password"`\>\>
|
|
120
120
|
|
|
@@ -140,7 +140,7 @@ The user details.
|
|
|
140
140
|
|
|
141
141
|
***
|
|
142
142
|
|
|
143
|
-
### getByIdentity()
|
|
143
|
+
### getByIdentity() {#getbyidentity}
|
|
144
144
|
|
|
145
145
|
> **getByIdentity**(`identity`): `Promise`\<`Omit`\<`IAuthenticationUser`, `"salt"` \| `"password"`\>\>
|
|
146
146
|
|
|
@@ -166,7 +166,7 @@ The user details.
|
|
|
166
166
|
|
|
167
167
|
***
|
|
168
168
|
|
|
169
|
-
### remove()
|
|
169
|
+
### remove() {#remove}
|
|
170
170
|
|
|
171
171
|
> **remove**(`email`): `Promise`\<`void`\>
|
|
172
172
|
|
|
@@ -192,7 +192,7 @@ Nothing.
|
|
|
192
192
|
|
|
193
193
|
***
|
|
194
194
|
|
|
195
|
-
### updatePassword()
|
|
195
|
+
### updatePassword() {#updatepassword}
|
|
196
196
|
|
|
197
197
|
> **updatePassword**(`email`, `newPassword`, `currentPassword?`): `Promise`\<`void`\>
|
|
198
198
|
|
|
@@ -230,7 +230,7 @@ Nothing.
|
|
|
230
230
|
|
|
231
231
|
***
|
|
232
232
|
|
|
233
|
-
### getEndpointWithPrefix()
|
|
233
|
+
### getEndpointWithPrefix() {#getendpointwithprefix}
|
|
234
234
|
|
|
235
235
|
> **getEndpointWithPrefix**(): `string`
|
|
236
236
|
|
|
@@ -248,7 +248,7 @@ The endpoint with namespace prefix attached.
|
|
|
248
248
|
|
|
249
249
|
***
|
|
250
250
|
|
|
251
|
-
### fetch()
|
|
251
|
+
### fetch() {#fetch}
|
|
252
252
|
|
|
253
253
|
> **fetch**\<`T`, `U`\>(`route`, `method`, `request?`): `Promise`\<`U`\>
|
|
254
254
|
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
# Class: EntityStorageAuthenticationAuditRestClient
|
|
2
|
+
|
|
3
|
+
The client to connect to the authentication audit service.
|
|
4
|
+
|
|
5
|
+
## Extends
|
|
6
|
+
|
|
7
|
+
- `BaseRestClient`
|
|
8
|
+
|
|
9
|
+
## Implements
|
|
10
|
+
|
|
11
|
+
- `IAuthenticationAuditComponent`
|
|
12
|
+
|
|
13
|
+
## Constructors
|
|
14
|
+
|
|
15
|
+
### Constructor
|
|
16
|
+
|
|
17
|
+
> **new EntityStorageAuthenticationAuditRestClient**(`config`): `EntityStorageAuthenticationAuditRestClient`
|
|
18
|
+
|
|
19
|
+
Create a new instance of EntityStorageAuthenticationAuditRestClient.
|
|
20
|
+
|
|
21
|
+
#### Parameters
|
|
22
|
+
|
|
23
|
+
##### config
|
|
24
|
+
|
|
25
|
+
`IBaseRestClientConfig`
|
|
26
|
+
|
|
27
|
+
The configuration for the client.
|
|
28
|
+
|
|
29
|
+
#### Returns
|
|
30
|
+
|
|
31
|
+
`EntityStorageAuthenticationAuditRestClient`
|
|
32
|
+
|
|
33
|
+
#### Overrides
|
|
34
|
+
|
|
35
|
+
`BaseRestClient.constructor`
|
|
36
|
+
|
|
37
|
+
## Properties
|
|
38
|
+
|
|
39
|
+
### CLASS\_NAME {#class_name}
|
|
40
|
+
|
|
41
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
42
|
+
|
|
43
|
+
Runtime name for the class.
|
|
44
|
+
|
|
45
|
+
## Methods
|
|
46
|
+
|
|
47
|
+
### className() {#classname}
|
|
48
|
+
|
|
49
|
+
> **className**(): `string`
|
|
50
|
+
|
|
51
|
+
Returns the class name of the component.
|
|
52
|
+
|
|
53
|
+
#### Returns
|
|
54
|
+
|
|
55
|
+
`string`
|
|
56
|
+
|
|
57
|
+
The class name of the component.
|
|
58
|
+
|
|
59
|
+
#### Implementation of
|
|
60
|
+
|
|
61
|
+
`IAuthenticationAuditComponent.className`
|
|
62
|
+
|
|
63
|
+
***
|
|
64
|
+
|
|
65
|
+
### create() {#create}
|
|
66
|
+
|
|
67
|
+
> **create**(`entry`): `Promise`\<`string`\>
|
|
68
|
+
|
|
69
|
+
Create a new audit entry.
|
|
70
|
+
|
|
71
|
+
#### Parameters
|
|
72
|
+
|
|
73
|
+
##### entry
|
|
74
|
+
|
|
75
|
+
`Omit`\<`IAuthenticationAuditEntry`, `"id"` \| `"dateCreated"`\>
|
|
76
|
+
|
|
77
|
+
The audit entry to be logged.
|
|
78
|
+
|
|
79
|
+
#### Returns
|
|
80
|
+
|
|
81
|
+
`Promise`\<`string`\>
|
|
82
|
+
|
|
83
|
+
The unique identifier of the created audit entry.
|
|
84
|
+
|
|
85
|
+
#### Implementation of
|
|
86
|
+
|
|
87
|
+
`IAuthenticationAuditComponent.create`
|
|
88
|
+
|
|
89
|
+
***
|
|
90
|
+
|
|
91
|
+
### query() {#query}
|
|
92
|
+
|
|
93
|
+
> **query**(`options?`, `cursor?`, `limit?`): `Promise`\<\{ `entries`: `IAuthenticationAuditEntry`[]; `cursor?`: `string`; \}\>
|
|
94
|
+
|
|
95
|
+
Query the audit entries.
|
|
96
|
+
|
|
97
|
+
#### Parameters
|
|
98
|
+
|
|
99
|
+
##### options?
|
|
100
|
+
|
|
101
|
+
The query options.
|
|
102
|
+
|
|
103
|
+
###### actorId?
|
|
104
|
+
|
|
105
|
+
`string`
|
|
106
|
+
|
|
107
|
+
The actor identifier to filter the audit entries, optional.
|
|
108
|
+
|
|
109
|
+
###### organizationId?
|
|
110
|
+
|
|
111
|
+
`string`
|
|
112
|
+
|
|
113
|
+
The organization identifier to filter the audit entries, optional.
|
|
114
|
+
|
|
115
|
+
###### tenantId?
|
|
116
|
+
|
|
117
|
+
`string`
|
|
118
|
+
|
|
119
|
+
The tenant identifier to filter the audit entries, optional.
|
|
120
|
+
|
|
121
|
+
###### nodeId?
|
|
122
|
+
|
|
123
|
+
`string`
|
|
124
|
+
|
|
125
|
+
The node identifier to filter the audit entries, optional.
|
|
126
|
+
|
|
127
|
+
###### event?
|
|
128
|
+
|
|
129
|
+
`string`
|
|
130
|
+
|
|
131
|
+
The audit event to filter the audit entries, optional.
|
|
132
|
+
|
|
133
|
+
###### startDate?
|
|
134
|
+
|
|
135
|
+
`string`
|
|
136
|
+
|
|
137
|
+
The start date to filter the audit entries, optional.
|
|
138
|
+
|
|
139
|
+
###### endDate?
|
|
140
|
+
|
|
141
|
+
`string`
|
|
142
|
+
|
|
143
|
+
The end date to filter the audit entries, optional.
|
|
144
|
+
|
|
145
|
+
##### cursor?
|
|
146
|
+
|
|
147
|
+
`string`
|
|
148
|
+
|
|
149
|
+
The cursor for pagination.
|
|
150
|
+
|
|
151
|
+
##### limit?
|
|
152
|
+
|
|
153
|
+
`number`
|
|
154
|
+
|
|
155
|
+
The maximum number of entries to return.
|
|
156
|
+
|
|
157
|
+
#### Returns
|
|
158
|
+
|
|
159
|
+
`Promise`\<\{ `entries`: `IAuthenticationAuditEntry`[]; `cursor?`: `string`; \}\>
|
|
160
|
+
|
|
161
|
+
The audit entries.
|
|
162
|
+
|
|
163
|
+
#### Implementation of
|
|
164
|
+
|
|
165
|
+
`IAuthenticationAuditComponent.query`
|
|
166
|
+
|
|
167
|
+
***
|
|
168
|
+
|
|
169
|
+
### getEndpointWithPrefix() {#getendpointwithprefix}
|
|
170
|
+
|
|
171
|
+
> **getEndpointWithPrefix**(): `string`
|
|
172
|
+
|
|
173
|
+
Get the endpoint with the prefix for the namespace.
|
|
174
|
+
|
|
175
|
+
#### Returns
|
|
176
|
+
|
|
177
|
+
`string`
|
|
178
|
+
|
|
179
|
+
The endpoint with namespace prefix attached.
|
|
180
|
+
|
|
181
|
+
#### Inherited from
|
|
182
|
+
|
|
183
|
+
`BaseRestClient.getEndpointWithPrefix`
|
|
184
|
+
|
|
185
|
+
***
|
|
186
|
+
|
|
187
|
+
### fetch() {#fetch}
|
|
188
|
+
|
|
189
|
+
> **fetch**\<`T`, `U`\>(`route`, `method`, `request?`): `Promise`\<`U`\>
|
|
190
|
+
|
|
191
|
+
Perform a request in json format.
|
|
192
|
+
|
|
193
|
+
#### Type Parameters
|
|
194
|
+
|
|
195
|
+
##### T
|
|
196
|
+
|
|
197
|
+
`T` *extends* `IHttpRequest`\<`any`\>
|
|
198
|
+
|
|
199
|
+
##### U
|
|
200
|
+
|
|
201
|
+
`U` *extends* `IHttpResponse`\<`any`\>
|
|
202
|
+
|
|
203
|
+
#### Parameters
|
|
204
|
+
|
|
205
|
+
##### route
|
|
206
|
+
|
|
207
|
+
`string`
|
|
208
|
+
|
|
209
|
+
The route of the request.
|
|
210
|
+
|
|
211
|
+
##### method
|
|
212
|
+
|
|
213
|
+
`HttpMethod`
|
|
214
|
+
|
|
215
|
+
The http method.
|
|
216
|
+
|
|
217
|
+
##### request?
|
|
218
|
+
|
|
219
|
+
`T`
|
|
220
|
+
|
|
221
|
+
Request to send to the endpoint.
|
|
222
|
+
|
|
223
|
+
#### Returns
|
|
224
|
+
|
|
225
|
+
`Promise`\<`U`\>
|
|
226
|
+
|
|
227
|
+
The response.
|
|
228
|
+
|
|
229
|
+
#### Inherited from
|
|
230
|
+
|
|
231
|
+
`BaseRestClient.fetch`
|
|
@@ -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
|
|
|
@@ -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,7 +146,7 @@ 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
151
|
> **updatePassword**(`currentPassword`, `newPassword`): `Promise`\<`void`\>
|
|
152
152
|
|
|
@@ -178,7 +178,7 @@ Nothing.
|
|
|
178
178
|
|
|
179
179
|
***
|
|
180
180
|
|
|
181
|
-
### getEndpointWithPrefix()
|
|
181
|
+
### getEndpointWithPrefix() {#getendpointwithprefix}
|
|
182
182
|
|
|
183
183
|
> **getEndpointWithPrefix**(): `string`
|
|
184
184
|
|
|
@@ -196,7 +196,7 @@ The endpoint with namespace prefix attached.
|
|
|
196
196
|
|
|
197
197
|
***
|
|
198
198
|
|
|
199
|
-
### fetch()
|
|
199
|
+
### fetch() {#fetch}
|
|
200
200
|
|
|
201
201
|
> **fetch**\<`T`, `U`\>(`route`, `method`, `request?`): `Promise`\<`U`\>
|
|
202
202
|
|
package/docs/reference/index.md
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
## Classes
|
|
4
4
|
|
|
5
5
|
- [EntityStorageAuthenticationAdminRestClient](classes/EntityStorageAuthenticationAdminRestClient.md)
|
|
6
|
+
- [EntityStorageAuthenticationAuditRestClient](classes/EntityStorageAuthenticationAuditRestClient.md)
|
|
6
7
|
- [EntityStorageAuthenticationRestClient](classes/EntityStorageAuthenticationRestClient.md)
|
|
7
8
|
|
|
8
9
|
## Interfaces
|
package/docs/reference/interfaces/IEntityStorageAuthenticationRestClientConstructorOptions.md
CHANGED
|
@@ -8,15 +8,21 @@ Options for the Entity Storage Authentication REST client constructor.
|
|
|
8
8
|
|
|
9
9
|
## Properties
|
|
10
10
|
|
|
11
|
-
### cookieName?
|
|
11
|
+
### cookieName? {#cookiename}
|
|
12
12
|
|
|
13
|
-
> `optional` **cookieName
|
|
13
|
+
> `optional` **cookieName?**: `string`
|
|
14
14
|
|
|
15
15
|
The name of the cookie to use for storing the auth token.
|
|
16
16
|
|
|
17
|
+
#### Default
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
access_token
|
|
21
|
+
```
|
|
22
|
+
|
|
17
23
|
***
|
|
18
24
|
|
|
19
|
-
### endpoint
|
|
25
|
+
### endpoint {#endpoint}
|
|
20
26
|
|
|
21
27
|
> **endpoint**: `string`
|
|
22
28
|
|
|
@@ -28,9 +34,9 @@ The endpoint where the api is hosted.
|
|
|
28
34
|
|
|
29
35
|
***
|
|
30
36
|
|
|
31
|
-
### pathPrefix?
|
|
37
|
+
### pathPrefix? {#pathprefix}
|
|
32
38
|
|
|
33
|
-
> `optional` **pathPrefix
|
|
39
|
+
> `optional` **pathPrefix?**: `string`
|
|
34
40
|
|
|
35
41
|
The prefix to the routes.
|
|
36
42
|
|
|
@@ -40,9 +46,9 @@ The prefix to the routes.
|
|
|
40
46
|
|
|
41
47
|
***
|
|
42
48
|
|
|
43
|
-
### headers?
|
|
49
|
+
### headers? {#headers}
|
|
44
50
|
|
|
45
|
-
> `optional` **headers
|
|
51
|
+
> `optional` **headers?**: `IHttpHeaders`
|
|
46
52
|
|
|
47
53
|
The headers to include in requests.
|
|
48
54
|
|
|
@@ -52,9 +58,9 @@ The headers to include in requests.
|
|
|
52
58
|
|
|
53
59
|
***
|
|
54
60
|
|
|
55
|
-
### timeout?
|
|
61
|
+
### timeout? {#timeout}
|
|
56
62
|
|
|
57
|
-
> `optional` **timeout
|
|
63
|
+
> `optional` **timeout?**: `number`
|
|
58
64
|
|
|
59
65
|
Timeout for requests in ms.
|
|
60
66
|
|
|
@@ -64,9 +70,9 @@ Timeout for requests in ms.
|
|
|
64
70
|
|
|
65
71
|
***
|
|
66
72
|
|
|
67
|
-
### includeCredentials?
|
|
73
|
+
### includeCredentials? {#includecredentials}
|
|
68
74
|
|
|
69
|
-
> `optional` **includeCredentials
|
|
75
|
+
> `optional` **includeCredentials?**: `boolean`
|
|
70
76
|
|
|
71
77
|
Include credentials in the request, defaults to true.
|
|
72
78
|
|
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-next.
|
|
3
|
+
"version": "0.0.3-next.23",
|
|
4
4
|
"description": "REST clients for authentication and admin operations against entity storage endpoints.",
|
|
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.3-next.
|
|
18
|
-
"@twin.org/api-core": "0.0.3-next.
|
|
19
|
-
"@twin.org/api-models": "0.0.3-next.
|
|
17
|
+
"@twin.org/api-auth-entity-storage-models": "0.0.3-next.23",
|
|
18
|
+
"@twin.org/api-core": "0.0.3-next.23",
|
|
19
|
+
"@twin.org/api-models": "0.0.3-next.23",
|
|
20
20
|
"@twin.org/core": "next",
|
|
21
21
|
"@twin.org/nameof": "next",
|
|
22
22
|
"@twin.org/web": "next"
|