@twin.org/logging-service 0.0.1-next.6 → 0.0.1-next.8
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 +0 -1
- package/dist/esm/index.mjs +0 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/loggingService.d.ts +2 -4
- package/dist/types/models/ILoggingServiceConstructorOptions.d.ts +10 -0
- package/docs/changelog.md +1 -1
- package/docs/reference/classes/LoggingService.md +26 -26
- package/docs/reference/functions/generateRestRoutesLogging.md +6 -2
- package/docs/reference/functions/loggingCreate.md +9 -3
- package/docs/reference/functions/loggingList.md +9 -3
- package/docs/reference/index.md +4 -0
- package/docs/reference/interfaces/ILoggingServiceConstructorOptions.md +17 -0
- package/package.json +2 -2
package/dist/cjs/index.cjs
CHANGED
@@ -171,7 +171,6 @@ class LoggingService {
|
|
171
171
|
/**
|
172
172
|
* Create a new instance of LoggingService.
|
173
173
|
* @param options The options for the connector.
|
174
|
-
* @param options.loggingConnectorType The type of the logging connector to use, defaults to "logging".
|
175
174
|
*/
|
176
175
|
constructor(options) {
|
177
176
|
this._loggingConnector = loggingModels.LoggingConnectorFactory.get(options?.loggingConnectorType ?? "logging");
|
package/dist/esm/index.mjs
CHANGED
@@ -169,7 +169,6 @@ class LoggingService {
|
|
169
169
|
/**
|
170
170
|
* Create a new instance of LoggingService.
|
171
171
|
* @param options The options for the connector.
|
172
|
-
* @param options.loggingConnectorType The type of the logging connector to use, defaults to "logging".
|
173
172
|
*/
|
174
173
|
constructor(options) {
|
175
174
|
this._loggingConnector = LoggingConnectorFactory.get(options?.loggingConnectorType ?? "logging");
|
package/dist/types/index.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import { type ILogEntry, type ILoggingComponent, type LogLevel } from "@twin.org/logging-models";
|
2
|
+
import type { ILoggingServiceConstructorOptions } from "./models/ILoggingServiceConstructorOptions";
|
2
3
|
/**
|
3
4
|
* Service for performing logging operations to a connector.
|
4
5
|
*/
|
@@ -14,11 +15,8 @@ export declare class LoggingService implements ILoggingComponent {
|
|
14
15
|
/**
|
15
16
|
* Create a new instance of LoggingService.
|
16
17
|
* @param options The options for the connector.
|
17
|
-
* @param options.loggingConnectorType The type of the logging connector to use, defaults to "logging".
|
18
18
|
*/
|
19
|
-
constructor(options?:
|
20
|
-
loggingConnectorType?: string;
|
21
|
-
});
|
19
|
+
constructor(options?: ILoggingServiceConstructorOptions);
|
22
20
|
/**
|
23
21
|
* Log an entry to the connector.
|
24
22
|
* @param logEntry The entry to log.
|
package/docs/changelog.md
CHANGED
@@ -16,13 +16,11 @@ Create a new instance of LoggingService.
|
|
16
16
|
|
17
17
|
#### Parameters
|
18
18
|
|
19
|
-
|
19
|
+
##### options?
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
• **options.loggingConnectorType?**: `string`
|
21
|
+
[`ILoggingServiceConstructorOptions`](../interfaces/ILoggingServiceConstructorOptions.md)
|
24
22
|
|
25
|
-
The
|
23
|
+
The options for the connector.
|
26
24
|
|
27
25
|
#### Returns
|
28
26
|
|
@@ -58,7 +56,9 @@ Log an entry to the connector.
|
|
58
56
|
|
59
57
|
#### Parameters
|
60
58
|
|
61
|
-
|
59
|
+
##### logEntry
|
60
|
+
|
61
|
+
`ILogEntry`
|
62
62
|
|
63
63
|
The entry to log.
|
64
64
|
|
@@ -76,55 +76,55 @@ Nothing.
|
|
76
76
|
|
77
77
|
### query()
|
78
78
|
|
79
|
-
> **query**(`level`?, `source`?, `timeStart`?, `timeEnd`?, `cursor`?, `pageSize`?): `Promise
|
79
|
+
> **query**(`level`?, `source`?, `timeStart`?, `timeEnd`?, `cursor`?, `pageSize`?): `Promise`\<\{ `entities`: `ILogEntry`[]; `cursor`: `string`; \}\>
|
80
80
|
|
81
81
|
Query the log entries.
|
82
82
|
|
83
83
|
#### Parameters
|
84
84
|
|
85
|
-
|
85
|
+
##### level?
|
86
|
+
|
87
|
+
`LogLevel`
|
86
88
|
|
87
89
|
The level of the log entries.
|
88
90
|
|
89
|
-
|
91
|
+
##### source?
|
92
|
+
|
93
|
+
`string`
|
90
94
|
|
91
95
|
The source of the log entries.
|
92
96
|
|
93
|
-
|
97
|
+
##### timeStart?
|
98
|
+
|
99
|
+
`number`
|
94
100
|
|
95
101
|
The inclusive time as the start of the log entries.
|
96
102
|
|
97
|
-
|
103
|
+
##### timeEnd?
|
104
|
+
|
105
|
+
`number`
|
98
106
|
|
99
107
|
The inclusive time as the end of the log entries.
|
100
108
|
|
101
|
-
|
109
|
+
##### cursor?
|
110
|
+
|
111
|
+
`string`
|
102
112
|
|
103
113
|
The cursor to request the next page of entities.
|
104
114
|
|
105
|
-
|
115
|
+
##### pageSize?
|
116
|
+
|
117
|
+
`number`
|
106
118
|
|
107
119
|
The maximum number of entities in a page.
|
108
120
|
|
109
121
|
#### Returns
|
110
122
|
|
111
|
-
`Promise
|
123
|
+
`Promise`\<\{ `entities`: `ILogEntry`[]; `cursor`: `string`; \}\>
|
112
124
|
|
113
125
|
All the entities for the storage matching the conditions,
|
114
126
|
and a cursor which can be used to request more entities.
|
115
127
|
|
116
|
-
##### entities
|
117
|
-
|
118
|
-
> **entities**: `ILogEntry`[]
|
119
|
-
|
120
|
-
The entities, which can be partial if a limited keys list was provided.
|
121
|
-
|
122
|
-
##### cursor?
|
123
|
-
|
124
|
-
> `optional` **cursor**: `string`
|
125
|
-
|
126
|
-
An optional cursor, when defined can be used to call find to get more entities.
|
127
|
-
|
128
128
|
#### Throws
|
129
129
|
|
130
130
|
NotImplementedError if the implementation does not support retrieval.
|
@@ -6,11 +6,15 @@ The REST routes for logging.
|
|
6
6
|
|
7
7
|
## Parameters
|
8
8
|
|
9
|
-
|
9
|
+
### baseRouteName
|
10
|
+
|
11
|
+
`string`
|
10
12
|
|
11
13
|
Prefix to prepend to the paths.
|
12
14
|
|
13
|
-
|
15
|
+
### componentName
|
16
|
+
|
17
|
+
`string`
|
14
18
|
|
15
19
|
The name of the component to use in the routes stored in the ComponentFactory.
|
16
20
|
|
@@ -6,15 +6,21 @@ Create a new log entry.
|
|
6
6
|
|
7
7
|
## Parameters
|
8
8
|
|
9
|
-
|
9
|
+
### httpRequestContext
|
10
|
+
|
11
|
+
`IHttpRequestContext`
|
10
12
|
|
11
13
|
The request context for the API.
|
12
14
|
|
13
|
-
|
15
|
+
### componentName
|
16
|
+
|
17
|
+
`string`
|
14
18
|
|
15
19
|
The name of the component to use in the routes.
|
16
20
|
|
17
|
-
|
21
|
+
### request
|
22
|
+
|
23
|
+
`ILoggingCreateRequest`
|
18
24
|
|
19
25
|
The request.
|
20
26
|
|
@@ -6,15 +6,21 @@ Get a list of the logging entries.
|
|
6
6
|
|
7
7
|
## Parameters
|
8
8
|
|
9
|
-
|
9
|
+
### httpRequestContext
|
10
|
+
|
11
|
+
`IHttpRequestContext`
|
10
12
|
|
11
13
|
The request context for the API.
|
12
14
|
|
13
|
-
|
15
|
+
### componentName
|
16
|
+
|
17
|
+
`string`
|
14
18
|
|
15
19
|
The name of the component to use in the routes.
|
16
20
|
|
17
|
-
|
21
|
+
### request
|
22
|
+
|
23
|
+
`ILoggingListRequest`
|
18
24
|
|
19
25
|
The request.
|
20
26
|
|
package/docs/reference/index.md
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
# Interface: ILoggingServiceConstructorOptions
|
2
|
+
|
3
|
+
Options for the logging service constructor.
|
4
|
+
|
5
|
+
## Properties
|
6
|
+
|
7
|
+
### loggingConnectorType?
|
8
|
+
|
9
|
+
> `optional` **loggingConnectorType**: `string`
|
10
|
+
|
11
|
+
The type of the logging connector to use.
|
12
|
+
|
13
|
+
#### Default
|
14
|
+
|
15
|
+
```ts
|
16
|
+
logging
|
17
|
+
```
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@twin.org/logging-service",
|
3
|
-
"version": "0.0.1-next.
|
3
|
+
"version": "0.0.1-next.8",
|
4
4
|
"description": "Logging contract implementation and REST endpoint definitions",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -17,7 +17,7 @@
|
|
17
17
|
"@twin.org/api-models": "next",
|
18
18
|
"@twin.org/core": "next",
|
19
19
|
"@twin.org/entity": "next",
|
20
|
-
"@twin.org/logging-models": "0.0.1-next.
|
20
|
+
"@twin.org/logging-models": "0.0.1-next.8",
|
21
21
|
"@twin.org/nameof": "next",
|
22
22
|
"@twin.org/web": "next"
|
23
23
|
},
|