@twin.org/api-auth-entity-storage-rest-client 0.0.3-next.22 → 0.0.3-next.24
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/EntityStorageAuthenticationAuditRestClient.md +231 -0
- package/docs/reference/index.md +1 -0
- 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.24](https://github.com/twinfoundation/api/compare/api-auth-entity-storage-rest-client-v0.0.3-next.23...api-auth-entity-storage-rest-client-v0.0.3-next.24) (2026-04-14)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Miscellaneous Chores
|
|
7
|
+
|
|
8
|
+
* **api-auth-entity-storage-rest-client:** Synchronize repo versions
|
|
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.23 to 0.0.3-next.24
|
|
16
|
+
* @twin.org/api-core bumped from 0.0.3-next.23 to 0.0.3-next.24
|
|
17
|
+
* @twin.org/api-models bumped from 0.0.3-next.23 to 0.0.3-next.24
|
|
18
|
+
|
|
19
|
+
## [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)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* auth enhancements ([#93](https://github.com/twinfoundation/api/issues/93)) ([921a50c](https://github.com/twinfoundation/api/commit/921a50cd89d26e530a6be6174a5a803060fa0eb6))
|
|
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.22 to 0.0.3-next.23
|
|
32
|
+
* @twin.org/api-core bumped from 0.0.3-next.22 to 0.0.3-next.23
|
|
33
|
+
* @twin.org/api-models bumped from 0.0.3-next.22 to 0.0.3-next.23
|
|
34
|
+
|
|
3
35
|
## [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)
|
|
4
36
|
|
|
5
37
|
|
|
@@ -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`
|
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/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.24",
|
|
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.24",
|
|
18
|
+
"@twin.org/api-core": "0.0.3-next.24",
|
|
19
|
+
"@twin.org/api-models": "0.0.3-next.24",
|
|
20
20
|
"@twin.org/core": "next",
|
|
21
21
|
"@twin.org/nameof": "next",
|
|
22
22
|
"@twin.org/web": "next"
|