@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.
- package/dist/cjs/index.cjs +5 -15
- package/dist/esm/index.mjs +5 -15
- package/dist/types/loggingService.d.ts +0 -5
- package/docs/changelog.md +94 -1
- package/docs/open-api/spec.json +414 -402
- package/docs/reference/classes/LoggingService.md +5 -17
- package/docs/reference/functions/generateRestRoutesLogging.md +2 -2
- package/package.json +2 -2
package/dist/cjs/index.cjs
CHANGED
|
@@ -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
|
-
|
|
233
|
-
{
|
|
234
|
-
|
|
235
|
-
|
|
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
|
|
package/dist/esm/index.mjs
CHANGED
|
@@ -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
|
-
|
|
231
|
-
{
|
|
232
|
-
|
|
233
|
-
|
|
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
|
-
##
|
|
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
|
package/docs/open-api/spec.json
CHANGED
|
@@ -1,403 +1,415 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
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
|
-
###
|
|
11
|
+
### Constructor
|
|
12
12
|
|
|
13
|
-
> **new LoggingService**(`options
|
|
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
|
-
|
|
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
|
|
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
|
|
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.
|
|
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.
|
|
20
|
+
"@twin.org/logging-models": "0.0.2-next.1",
|
|
21
21
|
"@twin.org/nameof": "next",
|
|
22
22
|
"@twin.org/web": "next"
|
|
23
23
|
},
|