@twin.org/logging-service 0.0.1-next.9 → 0.0.2-next.1

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.
@@ -155,10 +155,6 @@ async function loggingList(httpRequestContext, componentName, request) {
155
155
  * Service for performing logging operations to a connector.
156
156
  */
157
157
  class LoggingService {
158
- /**
159
- * The namespace for the logging component.
160
- */
161
- static NAMESPACE = "logging";
162
158
  /**
163
159
  * Runtime name for the class.
164
160
  */
@@ -194,7 +190,6 @@ class LoggingService {
194
190
  * @param pageSize The maximum number of entities in a page.
195
191
  * @returns All the entities for the storage matching the conditions,
196
192
  * and a cursor which can be used to request more entities.
197
- * @throws NotImplementedError if the implementation does not support retrieval.
198
193
  */
199
194
  async query(level, source, timeStart, timeEnd, cursor, pageSize) {
200
195
  const condition = {
@@ -229,16 +224,11 @@ class LoggingService {
229
224
  value: timeEnd
230
225
  });
231
226
  }
232
- const result = await this._loggingConnector.query(condition, [
233
- {
234
- property: "ts",
235
- sortDirection: entity.SortDirection.Descending
236
- }
237
- ], undefined, cursor, pageSize);
238
- return {
239
- entities: result.entities,
240
- cursor: result.cursor
241
- };
227
+ if (core.Is.function(this._loggingConnector?.query)) {
228
+ const result = await this._loggingConnector.query(condition, [{ property: "ts", sortDirection: entity.SortDirection.Descending }], undefined, cursor, pageSize);
229
+ return { entities: result.entities, cursor: result.cursor };
230
+ }
231
+ return { entities: [] };
242
232
  }
243
233
  }
244
234
 
@@ -153,10 +153,6 @@ async function loggingList(httpRequestContext, componentName, request) {
153
153
  * Service for performing logging operations to a connector.
154
154
  */
155
155
  class LoggingService {
156
- /**
157
- * The namespace for the logging component.
158
- */
159
- static NAMESPACE = "logging";
160
156
  /**
161
157
  * Runtime name for the class.
162
158
  */
@@ -192,7 +188,6 @@ class LoggingService {
192
188
  * @param pageSize The maximum number of entities in a page.
193
189
  * @returns All the entities for the storage matching the conditions,
194
190
  * and a cursor which can be used to request more entities.
195
- * @throws NotImplementedError if the implementation does not support retrieval.
196
191
  */
197
192
  async query(level, source, timeStart, timeEnd, cursor, pageSize) {
198
193
  const condition = {
@@ -227,16 +222,11 @@ class LoggingService {
227
222
  value: timeEnd
228
223
  });
229
224
  }
230
- const result = await this._loggingConnector.query(condition, [
231
- {
232
- property: "ts",
233
- sortDirection: SortDirection.Descending
234
- }
235
- ], undefined, cursor, pageSize);
236
- return {
237
- entities: result.entities,
238
- cursor: result.cursor
239
- };
225
+ if (Is.function(this._loggingConnector?.query)) {
226
+ const result = await this._loggingConnector.query(condition, [{ property: "ts", sortDirection: SortDirection.Descending }], undefined, cursor, pageSize);
227
+ return { entities: result.entities, cursor: result.cursor };
228
+ }
229
+ return { entities: [] };
240
230
  }
241
231
  }
242
232
 
@@ -4,10 +4,6 @@ import type { ILoggingServiceConstructorOptions } from "./models/ILoggingService
4
4
  * Service for performing logging operations to a connector.
5
5
  */
6
6
  export declare class LoggingService implements ILoggingComponent {
7
- /**
8
- * The namespace for the logging component.
9
- */
10
- static readonly NAMESPACE: string;
11
7
  /**
12
8
  * Runtime name for the class.
13
9
  */
@@ -33,7 +29,6 @@ export declare class LoggingService implements ILoggingComponent {
33
29
  * @param pageSize The maximum number of entities in a page.
34
30
  * @returns All the entities for the storage matching the conditions,
35
31
  * and a cursor which can be used to request more entities.
36
- * @throws NotImplementedError if the implementation does not support retrieval.
37
32
  */
38
33
  query(level?: LogLevel, source?: string, timeStart?: number, timeEnd?: number, cursor?: string, pageSize?: number): Promise<{
39
34
  /**
package/docs/changelog.md CHANGED
@@ -1,5 +1,98 @@
1
1
  # @twin.org/logging-service - Changelog
2
2
 
3
- ## v0.0.1-next.9
3
+ ## [0.0.2-next.1](https://github.com/twinfoundation/logging/compare/logging-service-v0.0.2-next.0...logging-service-v0.0.2-next.1) (2025-08-19)
4
+
5
+
6
+ ### Features
7
+
8
+ * add production release automation ([5dbcad8](https://github.com/twinfoundation/logging/commit/5dbcad8b105d749947c4fda19c814373cee2a172))
9
+ * remove unused namespace ([7eb6575](https://github.com/twinfoundation/logging/commit/7eb65758fbdc9a42f68d149702ba03c000556325))
10
+ * update dependencies ([976fc06](https://github.com/twinfoundation/logging/commit/976fc06976c4899769486b7cb2e827c407d7fc89))
11
+ * update framework core ([aac823c](https://github.com/twinfoundation/logging/commit/aac823c2ead88843618b8a82b308d5a793411764))
12
+ * use shared store mechanism ([#20](https://github.com/twinfoundation/logging/issues/20)) ([bbacd31](https://github.com/twinfoundation/logging/commit/bbacd31af991d82d84294ad432a40830692880ca))
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * query params force coercion ([71c5329](https://github.com/twinfoundation/logging/commit/71c53292d300acae0369bd7937c5ca3ab5430689))
18
+
19
+
20
+ ### Dependencies
21
+
22
+ * The following workspace dependencies were updated
23
+ * dependencies
24
+ * @twin.org/logging-models bumped from 0.0.2-next.0 to 0.0.2-next.1
25
+
26
+ ## 0.0.1 (2025-07-03)
27
+
28
+
29
+ ### Features
30
+
31
+ * release to production ([3458161](https://github.com/twinfoundation/logging/commit/3458161b4bb530f86e4d1fe06123d885cdcb114d))
32
+
33
+
34
+ ### Dependencies
35
+
36
+ * The following workspace dependencies were updated
37
+ * dependencies
38
+ * @twin.org/logging-models bumped from ^0.0.0 to ^0.0.1
39
+
40
+ ## [0.0.1-next.16](https://github.com/twinfoundation/logging/compare/logging-service-v0.0.1-next.15...logging-service-v0.0.1-next.16) (2025-06-20)
41
+
42
+
43
+ ### Bug Fixes
44
+
45
+ * query params force coercion ([71c5329](https://github.com/twinfoundation/logging/commit/71c53292d300acae0369bd7937c5ca3ab5430689))
46
+
47
+
48
+ ### Dependencies
49
+
50
+ * The following workspace dependencies were updated
51
+ * dependencies
52
+ * @twin.org/logging-models bumped from 0.0.1-next.15 to 0.0.1-next.16
53
+
54
+ ## [0.0.1-next.15](https://github.com/twinfoundation/logging/compare/logging-service-v0.0.1-next.14...logging-service-v0.0.1-next.15) (2025-06-12)
55
+
56
+
57
+ ### Features
58
+
59
+ * update dependencies ([976fc06](https://github.com/twinfoundation/logging/commit/976fc06976c4899769486b7cb2e827c407d7fc89))
60
+
61
+
62
+ ### Dependencies
63
+
64
+ * The following workspace dependencies were updated
65
+ * dependencies
66
+ * @twin.org/logging-models bumped from 0.0.1-next.14 to 0.0.1-next.15
67
+
68
+ ## [0.0.1-next.14](https://github.com/twinfoundation/logging/compare/logging-service-v0.0.1-next.13...logging-service-v0.0.1-next.14) (2025-04-17)
69
+
70
+
71
+ ### Features
72
+
73
+ * use shared store mechanism ([#20](https://github.com/twinfoundation/logging/issues/20)) ([bbacd31](https://github.com/twinfoundation/logging/commit/bbacd31af991d82d84294ad432a40830692880ca))
74
+
75
+
76
+ ### Dependencies
77
+
78
+ * The following workspace dependencies were updated
79
+ * dependencies
80
+ * @twin.org/logging-models bumped from 0.0.1-next.13 to 0.0.1-next.14
81
+
82
+ ## [0.0.1-next.13](https://github.com/twinfoundation/logging/compare/logging-service-v0.0.1-next.12...logging-service-v0.0.1-next.13) (2025-03-28)
83
+
84
+
85
+ ### Miscellaneous Chores
86
+
87
+ * **logging-service:** Synchronize repo versions
88
+
89
+
90
+ ### Dependencies
91
+
92
+ * The following workspace dependencies were updated
93
+ * dependencies
94
+ * @twin.org/logging-models bumped from 0.0.1-next.12 to 0.0.1-next.13
95
+
96
+ ## v0.0.1-next.12
4
97
 
5
98
  - Initial Release
@@ -1,403 +1,415 @@
1
1
  {
2
- "openapi": "3.1.0",
3
- "info": {
4
- "title": "TWIN - Test Endpoints",
5
- "description": "REST API for TWIN - Test Endpoints.",
6
- "version": "1.0.0",
7
- "license": {
8
- "name": "Apache 2.0 License",
9
- "url": "https://opensource.org/licenses/Apache-2.0"
10
- }
11
- },
12
- "servers": [
13
- {
14
- "url": "https://localhost"
15
- }
16
- ],
17
- "tags": [
18
- {
19
- "name": "Logging",
20
- "description": "Endpoints which are modelled to access a logging contract."
21
- }
22
- ],
23
- "paths": {
24
- "/logging": {
25
- "post": {
26
- "operationId": "loggingEntryCreate",
27
- "summary": "Create a log entry",
28
- "tags": [
29
- "Logging"
30
- ],
31
- "security": [
32
- {
33
- "jwtBearerAuthScheme": []
34
- }
35
- ],
36
- "requestBody": {
37
- "description": "Create a new log entry.",
38
- "required": true,
39
- "content": {
40
- "application/json": {
41
- "schema": {
42
- "$ref": "#/components/schemas/LogEntry"
43
- },
44
- "examples": {
45
- "loggingEntryCreateInfoExample": {
46
- "value": {
47
- "level": "info",
48
- "message": "This is an information message",
49
- "source": "source",
50
- "ts": 1715252922273
51
- }
52
- },
53
- "loggingEntryCreateErrorExample": {
54
- "value": {
55
- "level": "info",
56
- "message": "This is an error message",
57
- "source": "source",
58
- "ts": 1715252922273,
59
- "error": {
60
- "name": "GeneralError",
61
- "message": "component.error",
62
- "properties": {
63
- "foo": "bar"
64
- }
65
- }
66
- }
67
- }
68
- }
69
- }
70
- }
71
- },
72
- "responses": {
73
- "204": {
74
- "description": "The rest request ended in success with no data."
75
- },
76
- "400": {
77
- "description": "The server cannot process the request, see the content for more details.",
78
- "content": {
79
- "application/json": {
80
- "schema": {
81
- "$ref": "#/components/schemas/Error"
82
- },
83
- "examples": {
84
- "exampleResponse": {
85
- "value": {
86
- "name": "GeneralError",
87
- "message": "component.error",
88
- "properties": {
89
- "foo": "bar"
90
- }
91
- }
92
- }
93
- }
94
- }
95
- }
96
- },
97
- "401": {
98
- "description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
99
- "content": {
100
- "application/json": {
101
- "schema": {
102
- "$ref": "#/components/schemas/Error"
103
- },
104
- "examples": {
105
- "exampleResponse": {
106
- "value": {
107
- "name": "UnauthorizedError",
108
- "message": "component.error"
109
- }
110
- }
111
- }
112
- }
113
- }
114
- },
115
- "500": {
116
- "description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
117
- "content": {
118
- "application/json": {
119
- "schema": {
120
- "$ref": "#/components/schemas/Error"
121
- },
122
- "examples": {
123
- "exampleResponse": {
124
- "value": {
125
- "name": "InternalServerError",
126
- "message": "component.error"
127
- }
128
- }
129
- }
130
- }
131
- }
132
- }
133
- }
134
- },
135
- "get": {
136
- "operationId": "loggingListEntries",
137
- "summary": "Get a list of the log entries",
138
- "tags": [
139
- "Logging"
140
- ],
141
- "parameters": [
142
- {
143
- "name": "level",
144
- "description": "The level of the log entries to retrieve.",
145
- "in": "query",
146
- "required": false,
147
- "schema": {
148
- "$ref": "#/components/schemas/LogLevel"
149
- },
150
- "example": "info"
151
- },
152
- {
153
- "name": "source",
154
- "description": "The source of the log entries to retrieve.",
155
- "in": "query",
156
- "required": false,
157
- "schema": {
158
- "type": "string"
159
- }
160
- },
161
- {
162
- "name": "timeStart",
163
- "description": "The start time of the metrics to retrieve as a timestamp in ms.",
164
- "in": "query",
165
- "required": false,
166
- "schema": {
167
- "type": "number"
168
- }
169
- },
170
- {
171
- "name": "timeEnd",
172
- "description": "The end time of the metrics to retrieve as a timestamp in ms.",
173
- "in": "query",
174
- "required": false,
175
- "schema": {
176
- "type": "number"
177
- }
178
- },
179
- {
180
- "name": "cursor",
181
- "description": "The optional cursor to get next chunk.",
182
- "in": "query",
183
- "required": false,
184
- "schema": {
185
- "type": "string"
186
- }
187
- },
188
- {
189
- "name": "pageSize",
190
- "description": "The maximum number of entities in a page.",
191
- "in": "query",
192
- "required": false,
193
- "schema": {
194
- "type": "number"
195
- }
196
- }
197
- ],
198
- "security": [
199
- {
200
- "jwtBearerAuthScheme": []
201
- }
202
- ],
203
- "responses": {
204
- "200": {
205
- "description": "Response for log entry list request.",
206
- "content": {
207
- "application/json": {
208
- "schema": {
209
- "$ref": "#/components/schemas/LoggingListResponse"
210
- },
211
- "examples": {
212
- "listResponseExample": {
213
- "value": {
214
- "entities": [
215
- {
216
- "level": "info",
217
- "message": "This is an information message",
218
- "source": "source",
219
- "ts": 1715252922273
220
- }
221
- ],
222
- "cursor": "1"
223
- }
224
- }
225
- }
226
- }
227
- }
228
- },
229
- "400": {
230
- "description": "The server cannot process the request, see the content for more details.",
231
- "content": {
232
- "application/json": {
233
- "schema": {
234
- "$ref": "#/components/schemas/Error"
235
- },
236
- "examples": {
237
- "exampleResponse": {
238
- "value": {
239
- "name": "GeneralError",
240
- "message": "component.error",
241
- "properties": {
242
- "foo": "bar"
243
- }
244
- }
245
- }
246
- }
247
- }
248
- }
249
- },
250
- "401": {
251
- "description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
252
- "content": {
253
- "application/json": {
254
- "schema": {
255
- "$ref": "#/components/schemas/Error"
256
- },
257
- "examples": {
258
- "exampleResponse": {
259
- "value": {
260
- "name": "UnauthorizedError",
261
- "message": "component.error"
262
- }
263
- }
264
- }
265
- }
266
- }
267
- },
268
- "500": {
269
- "description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
270
- "content": {
271
- "application/json": {
272
- "schema": {
273
- "$ref": "#/components/schemas/Error"
274
- },
275
- "examples": {
276
- "exampleResponse": {
277
- "value": {
278
- "name": "InternalServerError",
279
- "message": "component.error"
280
- }
281
- }
282
- }
283
- }
284
- }
285
- }
286
- }
287
- }
288
- }
289
- },
290
- "components": {
291
- "schemas": {
292
- "Error": {
293
- "type": "object",
294
- "properties": {
295
- "name": {
296
- "type": "string",
297
- "description": "The name for the error."
298
- },
299
- "message": {
300
- "type": "string",
301
- "description": "The message for the error."
302
- },
303
- "source": {
304
- "type": "string",
305
- "description": "The source of the error."
306
- },
307
- "properties": {
308
- "type": "object",
309
- "additionalProperties": {},
310
- "description": "Any additional information for the error."
311
- },
312
- "stack": {
313
- "type": "string",
314
- "description": "The stack trace for the error."
315
- },
316
- "inner": {
317
- "$ref": "#/components/schemas/Error"
318
- }
319
- },
320
- "required": [
321
- "name",
322
- "message"
323
- ],
324
- "additionalProperties": false,
325
- "description": "Model to describe serialized error."
326
- },
327
- "LogEntry": {
328
- "type": "object",
329
- "properties": {
330
- "level": {
331
- "$ref": "#/components/schemas/LogLevel"
332
- },
333
- "source": {
334
- "type": "string",
335
- "description": "The source of the log entry."
336
- },
337
- "ts": {
338
- "type": "number",
339
- "description": "The timestamp of the log entry, if left blank will be populated by the connector."
340
- },
341
- "message": {
342
- "type": "string",
343
- "description": "The message."
344
- },
345
- "error": {
346
- "$ref": "#/components/schemas/Error"
347
- },
348
- "data": {
349
- "type": "object",
350
- "additionalProperties": {},
351
- "description": "Optional data for the message."
352
- }
353
- },
354
- "required": [
355
- "level",
356
- "source",
357
- "message"
358
- ],
359
- "additionalProperties": false,
360
- "description": "Interface describing a log entry."
361
- },
362
- "LogLevel": {
363
- "type": "string",
364
- "enum": [
365
- "info",
366
- "error",
367
- "warn",
368
- "trace",
369
- "debug"
370
- ],
371
- "description": "Log level."
372
- },
373
- "LoggingListResponse": {
374
- "type": "object",
375
- "properties": {
376
- "entities": {
377
- "type": "array",
378
- "items": {
379
- "$ref": "#/components/schemas/LogEntry"
380
- },
381
- "description": "The entities, which can be partial if a limited keys list was provided."
382
- },
383
- "cursor": {
384
- "type": "string",
385
- "description": "An optional cursor, when defined can be used to call find to get more entities."
386
- }
387
- },
388
- "required": [
389
- "entities"
390
- ],
391
- "additionalProperties": false,
392
- "description": "The response payload."
393
- }
394
- },
395
- "securitySchemes": {
396
- "jwtBearerAuthScheme": {
397
- "type": "http",
398
- "scheme": "bearer",
399
- "bearerFormat": "JWT"
400
- }
401
- }
402
- }
403
- }
2
+ "openapi": "3.1.1",
3
+ "info": {
4
+ "title": "TWIN - Test Endpoints",
5
+ "description": "REST API for TWIN - Test Endpoints.",
6
+ "version": "1.0.0",
7
+ "license": {
8
+ "name": "Apache 2.0 License",
9
+ "url": "https://opensource.org/licenses/Apache-2.0"
10
+ }
11
+ },
12
+ "servers": [
13
+ {
14
+ "url": "https://localhost"
15
+ }
16
+ ],
17
+ "tags": [
18
+ {
19
+ "name": "Logging",
20
+ "description": "Endpoints which are modelled to access a logging contract."
21
+ }
22
+ ],
23
+ "paths": {
24
+ "/logging": {
25
+ "post": {
26
+ "operationId": "loggingEntryCreate",
27
+ "summary": "Create a log entry",
28
+ "tags": [
29
+ "Logging"
30
+ ],
31
+ "security": [
32
+ {
33
+ "jwtBearerAuthScheme": []
34
+ }
35
+ ],
36
+ "requestBody": {
37
+ "description": "Create a new log entry.",
38
+ "required": true,
39
+ "content": {
40
+ "application/json": {
41
+ "schema": {
42
+ "$ref": "#/components/schemas/LogEntry"
43
+ },
44
+ "examples": {
45
+ "loggingEntryCreateInfoExample": {
46
+ "value": {
47
+ "level": "info",
48
+ "message": "This is an information message",
49
+ "source": "source",
50
+ "ts": 1715252922273
51
+ }
52
+ },
53
+ "loggingEntryCreateErrorExample": {
54
+ "value": {
55
+ "level": "info",
56
+ "message": "This is an error message",
57
+ "source": "source",
58
+ "ts": 1715252922273,
59
+ "error": {
60
+ "name": "GeneralError",
61
+ "message": "component.error",
62
+ "properties": {
63
+ "foo": "bar"
64
+ }
65
+ }
66
+ }
67
+ }
68
+ }
69
+ }
70
+ }
71
+ },
72
+ "responses": {
73
+ "204": {
74
+ "description": "The rest request ended in success with no data."
75
+ },
76
+ "400": {
77
+ "description": "The server cannot process the request, see the content for more details.",
78
+ "content": {
79
+ "application/json": {
80
+ "schema": {
81
+ "$ref": "#/components/schemas/Error"
82
+ },
83
+ "examples": {
84
+ "exampleResponse": {
85
+ "value": {
86
+ "name": "GeneralError",
87
+ "message": "component.error",
88
+ "properties": {
89
+ "foo": "bar"
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }
95
+ }
96
+ },
97
+ "401": {
98
+ "description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
99
+ "content": {
100
+ "application/json": {
101
+ "schema": {
102
+ "$ref": "#/components/schemas/Error"
103
+ },
104
+ "examples": {
105
+ "exampleResponse": {
106
+ "value": {
107
+ "name": "UnauthorizedError",
108
+ "message": "component.error"
109
+ }
110
+ }
111
+ }
112
+ }
113
+ }
114
+ },
115
+ "500": {
116
+ "description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
117
+ "content": {
118
+ "application/json": {
119
+ "schema": {
120
+ "$ref": "#/components/schemas/Error"
121
+ },
122
+ "examples": {
123
+ "exampleResponse": {
124
+ "value": {
125
+ "name": "InternalServerError",
126
+ "message": "component.error"
127
+ }
128
+ }
129
+ }
130
+ }
131
+ }
132
+ }
133
+ }
134
+ },
135
+ "get": {
136
+ "operationId": "loggingListEntries",
137
+ "summary": "Get a list of the log entries",
138
+ "tags": [
139
+ "Logging"
140
+ ],
141
+ "parameters": [
142
+ {
143
+ "name": "level",
144
+ "description": "The level of the log entries to retrieve.",
145
+ "in": "query",
146
+ "required": false,
147
+ "schema": {
148
+ "$ref": "#/components/schemas/LogLevel"
149
+ },
150
+ "example": "info"
151
+ },
152
+ {
153
+ "name": "source",
154
+ "description": "The source of the log entries to retrieve.",
155
+ "in": "query",
156
+ "required": false,
157
+ "schema": {
158
+ "type": "string"
159
+ }
160
+ },
161
+ {
162
+ "name": "timeStart",
163
+ "description": "The start time of the metrics to retrieve as a timestamp in ms.",
164
+ "in": "query",
165
+ "required": false,
166
+ "schema": {
167
+ "type": [
168
+ "number",
169
+ "string"
170
+ ]
171
+ }
172
+ },
173
+ {
174
+ "name": "timeEnd",
175
+ "description": "The end time of the metrics to retrieve as a timestamp in ms.",
176
+ "in": "query",
177
+ "required": false,
178
+ "schema": {
179
+ "type": [
180
+ "number",
181
+ "string"
182
+ ]
183
+ }
184
+ },
185
+ {
186
+ "name": "cursor",
187
+ "description": "The optional cursor to get next chunk.",
188
+ "in": "query",
189
+ "required": false,
190
+ "schema": {
191
+ "type": "string"
192
+ }
193
+ },
194
+ {
195
+ "name": "pageSize",
196
+ "description": "The maximum number of entities in a page.",
197
+ "in": "query",
198
+ "required": false,
199
+ "schema": {
200
+ "type": [
201
+ "number",
202
+ "string"
203
+ ]
204
+ }
205
+ }
206
+ ],
207
+ "security": [
208
+ {
209
+ "jwtBearerAuthScheme": []
210
+ }
211
+ ],
212
+ "responses": {
213
+ "200": {
214
+ "description": "Response for log entry list request.",
215
+ "content": {
216
+ "application/json": {
217
+ "schema": {
218
+ "$ref": "#/components/schemas/LoggingListResponse"
219
+ },
220
+ "examples": {
221
+ "listResponseExample": {
222
+ "value": {
223
+ "entities": [
224
+ {
225
+ "level": "info",
226
+ "message": "This is an information message",
227
+ "source": "source",
228
+ "ts": 1715252922273
229
+ }
230
+ ],
231
+ "cursor": "1"
232
+ }
233
+ }
234
+ }
235
+ }
236
+ }
237
+ },
238
+ "400": {
239
+ "description": "The server cannot process the request, see the content for more details.",
240
+ "content": {
241
+ "application/json": {
242
+ "schema": {
243
+ "$ref": "#/components/schemas/Error"
244
+ },
245
+ "examples": {
246
+ "exampleResponse": {
247
+ "value": {
248
+ "name": "GeneralError",
249
+ "message": "component.error",
250
+ "properties": {
251
+ "foo": "bar"
252
+ }
253
+ }
254
+ }
255
+ }
256
+ }
257
+ }
258
+ },
259
+ "401": {
260
+ "description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
261
+ "content": {
262
+ "application/json": {
263
+ "schema": {
264
+ "$ref": "#/components/schemas/Error"
265
+ },
266
+ "examples": {
267
+ "exampleResponse": {
268
+ "value": {
269
+ "name": "UnauthorizedError",
270
+ "message": "component.error"
271
+ }
272
+ }
273
+ }
274
+ }
275
+ }
276
+ },
277
+ "500": {
278
+ "description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
279
+ "content": {
280
+ "application/json": {
281
+ "schema": {
282
+ "$ref": "#/components/schemas/Error"
283
+ },
284
+ "examples": {
285
+ "exampleResponse": {
286
+ "value": {
287
+ "name": "InternalServerError",
288
+ "message": "component.error"
289
+ }
290
+ }
291
+ }
292
+ }
293
+ }
294
+ }
295
+ }
296
+ }
297
+ }
298
+ },
299
+ "components": {
300
+ "schemas": {
301
+ "Error": {
302
+ "type": "object",
303
+ "properties": {
304
+ "name": {
305
+ "type": "string",
306
+ "description": "The name for the error."
307
+ },
308
+ "message": {
309
+ "type": "string",
310
+ "description": "The message for the error."
311
+ },
312
+ "source": {
313
+ "type": "string",
314
+ "description": "The source of the error."
315
+ },
316
+ "properties": {
317
+ "type": "object",
318
+ "additionalProperties": {},
319
+ "description": "Any additional information for the error."
320
+ },
321
+ "stack": {
322
+ "type": "string",
323
+ "description": "The stack trace for the error."
324
+ },
325
+ "cause": {
326
+ "$ref": "#/components/schemas/Error"
327
+ }
328
+ },
329
+ "required": [
330
+ "name",
331
+ "message"
332
+ ],
333
+ "additionalProperties": false,
334
+ "description": "Model to describe serialized error."
335
+ },
336
+ "LogEntry": {
337
+ "type": "object",
338
+ "properties": {
339
+ "level": {
340
+ "$ref": "#/components/schemas/LogLevel"
341
+ },
342
+ "source": {
343
+ "type": "string",
344
+ "description": "The source of the log entry."
345
+ },
346
+ "ts": {
347
+ "type": "number",
348
+ "description": "The timestamp of the log entry, if left blank will be populated by the connector."
349
+ },
350
+ "message": {
351
+ "type": "string",
352
+ "description": "The message."
353
+ },
354
+ "error": {
355
+ "$ref": "#/components/schemas/Error"
356
+ },
357
+ "data": {
358
+ "type": "object",
359
+ "additionalProperties": {},
360
+ "description": "Optional data for the message."
361
+ }
362
+ },
363
+ "required": [
364
+ "level",
365
+ "source",
366
+ "message"
367
+ ],
368
+ "additionalProperties": false,
369
+ "description": "Interface describing a log entry."
370
+ },
371
+ "LogLevel": {
372
+ "type": "string",
373
+ "enum": [
374
+ "info",
375
+ "error",
376
+ "warn",
377
+ "trace",
378
+ "debug"
379
+ ],
380
+ "description": "Log level."
381
+ },
382
+ "LoggingListResponse": {
383
+ "type": "object",
384
+ "properties": {
385
+ "entities": {
386
+ "type": "array",
387
+ "items": false,
388
+ "description": "The entities, which can be partial if a limited keys list was provided.",
389
+ "prefixItems": [
390
+ {
391
+ "$ref": "#/components/schemas/LogEntry"
392
+ }
393
+ ]
394
+ },
395
+ "cursor": {
396
+ "type": "string",
397
+ "description": "An optional cursor, when defined can be used to call find to get more entities."
398
+ }
399
+ },
400
+ "required": [
401
+ "entities"
402
+ ],
403
+ "additionalProperties": false,
404
+ "description": "The response payload."
405
+ }
406
+ },
407
+ "securitySchemes": {
408
+ "jwtBearerAuthScheme": {
409
+ "type": "http",
410
+ "scheme": "bearer",
411
+ "bearerFormat": "JWT"
412
+ }
413
+ }
414
+ }
415
+ }
@@ -8,9 +8,9 @@ Service for performing logging operations to a connector.
8
8
 
9
9
  ## Constructors
10
10
 
11
- ### new LoggingService()
11
+ ### Constructor
12
12
 
13
- > **new LoggingService**(`options`?): [`LoggingService`](LoggingService.md)
13
+ > **new LoggingService**(`options?`): `LoggingService`
14
14
 
15
15
  Create a new instance of LoggingService.
16
16
 
@@ -24,18 +24,10 @@ The options for the connector.
24
24
 
25
25
  #### Returns
26
26
 
27
- [`LoggingService`](LoggingService.md)
27
+ `LoggingService`
28
28
 
29
29
  ## Properties
30
30
 
31
- ### NAMESPACE
32
-
33
- > `readonly` `static` **NAMESPACE**: `string` = `"logging"`
34
-
35
- The namespace for the logging component.
36
-
37
- ***
38
-
39
31
  ### CLASS\_NAME
40
32
 
41
33
  > `readonly` **CLASS\_NAME**: `string`
@@ -76,7 +68,7 @@ Nothing.
76
68
 
77
69
  ### query()
78
70
 
79
- > **query**(`level`?, `source`?, `timeStart`?, `timeEnd`?, `cursor`?, `pageSize`?): `Promise`\<\{ `entities`: `ILogEntry`[]; `cursor`: `string`; \}\>
71
+ > **query**(`level?`, `source?`, `timeStart?`, `timeEnd?`, `cursor?`, `pageSize?`): `Promise`\<\{ `entities`: `ILogEntry`[]; `cursor?`: `string`; \}\>
80
72
 
81
73
  Query the log entries.
82
74
 
@@ -120,15 +112,11 @@ The maximum number of entities in a page.
120
112
 
121
113
  #### Returns
122
114
 
123
- `Promise`\<\{ `entities`: `ILogEntry`[]; `cursor`: `string`; \}\>
115
+ `Promise`\<\{ `entities`: `ILogEntry`[]; `cursor?`: `string`; \}\>
124
116
 
125
117
  All the entities for the storage matching the conditions,
126
118
  and a cursor which can be used to request more entities.
127
119
 
128
- #### Throws
129
-
130
- NotImplementedError if the implementation does not support retrieval.
131
-
132
120
  #### Implementation of
133
121
 
134
122
  `ILoggingComponent.query`
@@ -1,6 +1,6 @@
1
1
  # Function: generateRestRoutesLogging()
2
2
 
3
- > **generateRestRoutesLogging**(`baseRouteName`, `componentName`): `IRestRoute`[]
3
+ > **generateRestRoutesLogging**(`baseRouteName`, `componentName`): `IRestRoute`\<`any`, `any`\>[]
4
4
 
5
5
  The REST routes for logging.
6
6
 
@@ -20,6 +20,6 @@ The name of the component to use in the routes stored in the ComponentFactory.
20
20
 
21
21
  ## Returns
22
22
 
23
- `IRestRoute`[]
23
+ `IRestRoute`\<`any`, `any`\>[]
24
24
 
25
25
  The generated routes.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/logging-service",
3
- "version": "0.0.1-next.9",
3
+ "version": "0.0.2-next.1",
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.9",
20
+ "@twin.org/logging-models": "0.0.2-next.1",
21
21
  "@twin.org/nameof": "next",
22
22
  "@twin.org/web": "next"
23
23
  },