@twin.org/logging-models 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.
@@ -37,8 +37,6 @@ class MultiLoggingConnector {
37
37
  /**
38
38
  * Create a new instance of MultiLoggingConnector.
39
39
  * @param options The options for the connector.
40
- * @param options.loggingConnectorTypes The logging connectors to multiplex.
41
- * @param options.config The configuration for the logging connector.
42
40
  */
43
41
  constructor(options) {
44
42
  core.Guards.object(this.CLASS_NAME, "options", options);
@@ -35,8 +35,6 @@ class MultiLoggingConnector {
35
35
  /**
36
36
  * Create a new instance of MultiLoggingConnector.
37
37
  * @param options The options for the connector.
38
- * @param options.loggingConnectorTypes The logging connectors to multiplex.
39
- * @param options.config The configuration for the logging connector.
40
38
  */
41
39
  constructor(options) {
42
40
  Guards.object(this.CLASS_NAME, "options", options);
@@ -1,7 +1,7 @@
1
1
  import type { EntityCondition, SortDirection } from "@twin.org/entity";
2
2
  import type { ILogEntry } from "../models/ILogEntry";
3
3
  import type { ILoggingConnector } from "../models/ILoggingConnector";
4
- import type { ILoggingLevelsConfig } from "../models/ILoggingLevelsConfig";
4
+ import type { IMultiLoggingConnectorConstructorOptions } from "../models/IMultiLoggingConnectorConstructorOptions";
5
5
  /**
6
6
  * Class for performing logging operations on multiple connectors.
7
7
  */
@@ -17,13 +17,8 @@ export declare class MultiLoggingConnector implements ILoggingConnector {
17
17
  /**
18
18
  * Create a new instance of MultiLoggingConnector.
19
19
  * @param options The options for the connector.
20
- * @param options.loggingConnectorTypes The logging connectors to multiplex.
21
- * @param options.config The configuration for the logging connector.
22
20
  */
23
- constructor(options: {
24
- loggingConnectorTypes: string[];
25
- config?: ILoggingLevelsConfig;
26
- });
21
+ constructor(options: IMultiLoggingConnectorConstructorOptions);
27
22
  /**
28
23
  * Log an entry to the connector.
29
24
  * @param logEntry The entry to log.
@@ -9,4 +9,5 @@ export * from "./models/ILogEntry";
9
9
  export * from "./models/ILoggingComponent";
10
10
  export * from "./models/ILoggingConnector";
11
11
  export * from "./models/ILoggingLevelsConfig";
12
+ export * from "./models/IMultiLoggingConnectorConstructorOptions";
12
13
  export * from "./models/logLevel";
@@ -0,0 +1,14 @@
1
+ import type { ILoggingLevelsConfig } from "../models/ILoggingLevelsConfig";
2
+ /**
3
+ * Options for the multi logging connector.
4
+ */
5
+ export interface IMultiLoggingConnectorConstructorOptions {
6
+ /**
7
+ * The logging connectors to multiplex.
8
+ */
9
+ loggingConnectorTypes: string[];
10
+ /**
11
+ * The configuration for the logging connector.
12
+ */
13
+ config?: ILoggingLevelsConfig;
14
+ }
package/docs/changelog.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @twin.org/logging-models - Changelog
2
2
 
3
- ## v0.0.1-next.6
3
+ ## v0.0.1-next.8
4
4
 
5
5
  - Initial Release
@@ -22,7 +22,9 @@ Translate the log entry.
22
22
 
23
23
  #### Parameters
24
24
 
25
- **logEntry**: [`ILogEntry`](../interfaces/ILogEntry.md)
25
+ ##### logEntry
26
+
27
+ [`ILogEntry`](../interfaces/ILogEntry.md)
26
28
 
27
29
  The log entry.
28
30
 
@@ -16,17 +16,11 @@ Create a new instance of MultiLoggingConnector.
16
16
 
17
17
  #### Parameters
18
18
 
19
- **options**
19
+ ##### options
20
20
 
21
- The options for the connector.
22
-
23
- • **options.loggingConnectorTypes**: `string`[]
24
-
25
- The logging connectors to multiplex.
21
+ [`IMultiLoggingConnectorConstructorOptions`](../interfaces/IMultiLoggingConnectorConstructorOptions.md)
26
22
 
27
- **options.config?**: [`ILoggingLevelsConfig`](../interfaces/ILoggingLevelsConfig.md)
28
-
29
- The configuration for the logging connector.
23
+ The options for the connector.
30
24
 
31
25
  #### Returns
32
26
 
@@ -62,7 +56,9 @@ Log an entry to the connector.
62
56
 
63
57
  #### Parameters
64
58
 
65
- **logEntry**: [`ILogEntry`](../interfaces/ILogEntry.md)
59
+ ##### logEntry
60
+
61
+ [`ILogEntry`](../interfaces/ILogEntry.md)
66
62
 
67
63
  The entry to log.
68
64
 
@@ -80,51 +76,49 @@ Nothing.
80
76
 
81
77
  ### query()
82
78
 
83
- > **query**(`conditions`?, `sortProperties`?, `properties`?, `cursor`?, `pageSize`?): `Promise`\<`object`\>
79
+ > **query**(`conditions`?, `sortProperties`?, `properties`?, `cursor`?, `pageSize`?): `Promise`\<\{ `entities`: `Partial`\<[`ILogEntry`](../interfaces/ILogEntry.md)\>[]; `cursor`: `string`; \}\>
84
80
 
85
81
  Query the log entries.
86
82
 
87
83
  #### Parameters
88
84
 
89
- **conditions?**: `EntityCondition`\<[`ILogEntry`](../interfaces/ILogEntry.md)\>
85
+ ##### conditions?
86
+
87
+ `EntityCondition`\<[`ILogEntry`](../interfaces/ILogEntry.md)\>
90
88
 
91
89
  The conditions to match for the entities.
92
90
 
93
- **sortProperties?**: `object`[]
91
+ ##### sortProperties?
92
+
93
+ `object`[]
94
94
 
95
95
  The optional sort order.
96
96
 
97
- **properties?**: keyof [`ILogEntry`](../interfaces/ILogEntry.md)[]
97
+ ##### properties?
98
+
99
+ keyof [`ILogEntry`](../interfaces/ILogEntry.md)[]
98
100
 
99
101
  The optional keys to return, defaults to all.
100
102
 
101
- **cursor?**: `string`
103
+ ##### cursor?
104
+
105
+ `string`
102
106
 
103
107
  The cursor to request the next page of entities.
104
108
 
105
- **pageSize?**: `number`
109
+ ##### pageSize?
110
+
111
+ `number`
106
112
 
107
113
  The maximum number of entities in a page.
108
114
 
109
115
  #### Returns
110
116
 
111
- `Promise`\<`object`\>
117
+ `Promise`\<\{ `entities`: `Partial`\<[`ILogEntry`](../interfaces/ILogEntry.md)\>[]; `cursor`: `string`; \}\>
112
118
 
113
119
  All the entities for the storage matching the conditions,
114
120
  and a cursor which can be used to request more entities.
115
121
 
116
- ##### entities
117
-
118
- > **entities**: `Partial`\<[`ILogEntry`](../interfaces/ILogEntry.md)\>[]
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
122
  #### Throws
129
123
 
130
124
  NotImplementedError if the implementation does not support retrieval.
@@ -46,7 +46,9 @@ Log an entry to the connector.
46
46
 
47
47
  #### Parameters
48
48
 
49
- **logEntry**: [`ILogEntry`](../interfaces/ILogEntry.md)
49
+ ##### logEntry
50
+
51
+ [`ILogEntry`](../interfaces/ILogEntry.md)
50
52
 
51
53
  The entry to log.
52
54
 
@@ -64,51 +66,49 @@ Nothing.
64
66
 
65
67
  ### query()
66
68
 
67
- > **query**(`conditions`?, `sortProperties`?, `properties`?, `cursor`?, `pageSize`?): `Promise`\<`object`\>
69
+ > **query**(`conditions`?, `sortProperties`?, `properties`?, `cursor`?, `pageSize`?): `Promise`\<\{ `entities`: `Partial`\<[`ILogEntry`](../interfaces/ILogEntry.md)\>[]; `cursor`: `string`; \}\>
68
70
 
69
71
  Query the log entries.
70
72
 
71
73
  #### Parameters
72
74
 
73
- **conditions?**: `EntityCondition`\<[`ILogEntry`](../interfaces/ILogEntry.md)\>
75
+ ##### conditions?
76
+
77
+ `EntityCondition`\<[`ILogEntry`](../interfaces/ILogEntry.md)\>
74
78
 
75
79
  The conditions to match for the entities.
76
80
 
77
- **sortProperties?**: `object`[]
81
+ ##### sortProperties?
82
+
83
+ `object`[]
78
84
 
79
85
  The optional sort order.
80
86
 
81
- **properties?**: keyof [`ILogEntry`](../interfaces/ILogEntry.md)[]
87
+ ##### properties?
88
+
89
+ keyof [`ILogEntry`](../interfaces/ILogEntry.md)[]
82
90
 
83
91
  The optional keys to return, defaults to all.
84
92
 
85
- **cursor?**: `string`
93
+ ##### cursor?
94
+
95
+ `string`
86
96
 
87
97
  The cursor to request the next page of entities.
88
98
 
89
- **pageSize?**: `number`
99
+ ##### pageSize?
100
+
101
+ `number`
90
102
 
91
103
  The maximum number of entities in a page.
92
104
 
93
105
  #### Returns
94
106
 
95
- `Promise`\<`object`\>
107
+ `Promise`\<\{ `entities`: `Partial`\<[`ILogEntry`](../interfaces/ILogEntry.md)\>[]; `cursor`: `string`; \}\>
96
108
 
97
109
  All the entities for the storage matching the conditions,
98
110
  and a cursor which can be used to request more entities.
99
111
 
100
- ##### entities
101
-
102
- > **entities**: `Partial`\<[`ILogEntry`](../interfaces/ILogEntry.md)\>[]
103
-
104
- The entities, which can be partial if a limited keys list was provided.
105
-
106
- ##### cursor?
107
-
108
- > `optional` **cursor**: `string`
109
-
110
- An optional cursor, when defined can be used to call find to get more entities.
111
-
112
112
  #### Throws
113
113
 
114
114
  NotImplementedError if the implementation does not support retrieval.
@@ -12,6 +12,7 @@
12
12
  - [ILoggingComponent](interfaces/ILoggingComponent.md)
13
13
  - [ILoggingConnector](interfaces/ILoggingConnector.md)
14
14
  - [ILoggingLevelsConfig](interfaces/ILoggingLevelsConfig.md)
15
+ - [IMultiLoggingConnectorConstructorOptions](interfaces/IMultiLoggingConnectorConstructorOptions.md)
15
16
  - [ILoggingCreateRequest](interfaces/ILoggingCreateRequest.md)
16
17
  - [ILoggingListRequest](interfaces/ILoggingListRequest.md)
17
18
  - [ILoggingListResponse](interfaces/ILoggingListResponse.md)
@@ -52,4 +52,4 @@ Optional data for the message.
52
52
 
53
53
  #### Index Signature
54
54
 
55
- \[`key`: `string`\]: `unknown`
55
+ \[`key`: `string`\]: `unknown`
@@ -16,7 +16,9 @@ Log an entry to the component.
16
16
 
17
17
  #### Parameters
18
18
 
19
- **logEntry**: [`ILogEntry`](ILogEntry.md)
19
+ ##### logEntry
20
+
21
+ [`ILogEntry`](ILogEntry.md)
20
22
 
21
23
  The entry to log.
22
24
 
@@ -30,55 +32,55 @@ Nothing.
30
32
 
31
33
  ### query()
32
34
 
33
- > **query**(`level`?, `source`?, `timeStart`?, `timeEnd`?, `cursor`?, `pageSize`?): `Promise`\<`object`\>
35
+ > **query**(`level`?, `source`?, `timeStart`?, `timeEnd`?, `cursor`?, `pageSize`?): `Promise`\<\{ `entities`: [`ILogEntry`](ILogEntry.md)[]; `cursor`: `string`; \}\>
34
36
 
35
37
  Query the log entries.
36
38
 
37
39
  #### Parameters
38
40
 
39
- **level?**: [`LogLevel`](../type-aliases/LogLevel.md)
41
+ ##### level?
42
+
43
+ [`LogLevel`](../type-aliases/LogLevel.md)
40
44
 
41
45
  The level of the log entries.
42
46
 
43
- **source?**: `string`
47
+ ##### source?
48
+
49
+ `string`
44
50
 
45
51
  The source of the log entries.
46
52
 
47
- **timeStart?**: `number`
53
+ ##### timeStart?
54
+
55
+ `number`
48
56
 
49
57
  The inclusive time as the start of the log entries.
50
58
 
51
- **timeEnd?**: `number`
59
+ ##### timeEnd?
60
+
61
+ `number`
52
62
 
53
63
  The inclusive time as the end of the log entries.
54
64
 
55
- **cursor?**: `string`
65
+ ##### cursor?
66
+
67
+ `string`
56
68
 
57
69
  The cursor to request the next page of entities.
58
70
 
59
- **pageSize?**: `number`
71
+ ##### pageSize?
72
+
73
+ `number`
60
74
 
61
75
  The maximum number of entities in a page.
62
76
 
63
77
  #### Returns
64
78
 
65
- `Promise`\<`object`\>
79
+ `Promise`\<\{ `entities`: [`ILogEntry`](ILogEntry.md)[]; `cursor`: `string`; \}\>
66
80
 
67
81
  All the entities for the storage matching the conditions,
68
82
  and a cursor which can be used to request more entities.
69
83
 
70
- ##### entities
71
-
72
- > **entities**: [`ILogEntry`](ILogEntry.md)[]
73
-
74
- The entities, which can be partial if a limited keys list was provided.
75
-
76
- ##### cursor?
77
-
78
- > `optional` **cursor**: `string`
79
-
80
- An optional cursor, when defined can be used to call find to get more entities.
81
-
82
84
  #### Throws
83
85
 
84
86
  NotImplementedError if the implementation does not support retrieval.
@@ -16,7 +16,9 @@ Log an entry to the connector.
16
16
 
17
17
  #### Parameters
18
18
 
19
- **logEntry**: [`ILogEntry`](ILogEntry.md)
19
+ ##### logEntry
20
+
21
+ [`ILogEntry`](ILogEntry.md)
20
22
 
21
23
  The entry to log.
22
24
 
@@ -30,51 +32,49 @@ Nothing.
30
32
 
31
33
  ### query()
32
34
 
33
- > **query**(`conditions`?, `sortProperties`?, `properties`?, `cursor`?, `pageSize`?): `Promise`\<`object`\>
35
+ > **query**(`conditions`?, `sortProperties`?, `properties`?, `cursor`?, `pageSize`?): `Promise`\<\{ `entities`: `Partial`\<[`ILogEntry`](ILogEntry.md)\>[]; `cursor`: `string`; \}\>
34
36
 
35
37
  Query the log entries.
36
38
 
37
39
  #### Parameters
38
40
 
39
- **conditions?**: `EntityCondition`\<[`ILogEntry`](ILogEntry.md)\>
41
+ ##### conditions?
42
+
43
+ `EntityCondition`\<[`ILogEntry`](ILogEntry.md)\>
40
44
 
41
45
  The conditions to match for the entities.
42
46
 
43
- **sortProperties?**: `object`[]
47
+ ##### sortProperties?
48
+
49
+ `object`[]
44
50
 
45
51
  The optional sort order.
46
52
 
47
- **properties?**: keyof [`ILogEntry`](ILogEntry.md)[]
53
+ ##### properties?
54
+
55
+ keyof [`ILogEntry`](ILogEntry.md)[]
48
56
 
49
57
  The optional keys to return, defaults to all.
50
58
 
51
- **cursor?**: `string`
59
+ ##### cursor?
60
+
61
+ `string`
52
62
 
53
63
  The cursor to request the next page of entities.
54
64
 
55
- **pageSize?**: `number`
65
+ ##### pageSize?
66
+
67
+ `number`
56
68
 
57
69
  The maximum number of entities in a page.
58
70
 
59
71
  #### Returns
60
72
 
61
- `Promise`\<`object`\>
73
+ `Promise`\<\{ `entities`: `Partial`\<[`ILogEntry`](ILogEntry.md)\>[]; `cursor`: `string`; \}\>
62
74
 
63
75
  All the entities for the storage matching the conditions,
64
76
  and a cursor which can be used to request more entities.
65
77
 
66
- ##### entities
67
-
68
- > **entities**: `Partial`\<[`ILogEntry`](ILogEntry.md)\>[]
69
-
70
- The entities, which can be partial if a limited keys list was provided.
71
-
72
- ##### cursor?
73
-
74
- > `optional` **cursor**: `string`
75
-
76
- An optional cursor, when defined can be used to call find to get more entities.
77
-
78
78
  #### Throws
79
79
 
80
80
  NotImplementedError if the implementation does not support retrieval.
@@ -0,0 +1,19 @@
1
+ # Interface: IMultiLoggingConnectorConstructorOptions
2
+
3
+ Options for the multi logging connector.
4
+
5
+ ## Properties
6
+
7
+ ### loggingConnectorTypes
8
+
9
+ > **loggingConnectorTypes**: `string`[]
10
+
11
+ The logging connectors to multiplex.
12
+
13
+ ***
14
+
15
+ ### config?
16
+
17
+ > `optional` **config**: [`ILoggingLevelsConfig`](ILoggingLevelsConfig.md)
18
+
19
+ The configuration for the logging connector.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/logging-models",
3
- "version": "0.0.1-next.6",
3
+ "version": "0.0.1-next.8",
4
4
  "description": "Models which define the structure of the logging connectors and services",
5
5
  "repository": {
6
6
  "type": "git",