@anglr/common 17.0.0-beta.20230711090239 → 17.0.0-beta.20230711095959
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/changelog.md +11 -1
- package/es2022/hotkeys/src/services/appHotkeys.service.js +6 -2
- package/es2022/hotkeys/src/services/appHotkeys.service.js.map +1 -1
- package/es2022/src/modules/debugData/components/debugData/debugData.component.js +26 -26
- package/es2022/src/modules/debugData/components/debugData/debugData.component.js.map +1 -1
- package/es2022/structured-log/src/index.js +1 -1
- package/es2022/structured-log/src/index.js.map +1 -1
- package/es2022/structured-log/src/services/rest/restSink.options.js +40 -0
- package/es2022/structured-log/src/services/rest/restSink.options.js.map +1 -0
- package/es2022/structured-log/src/services/rest/restSink.service.js +22 -12
- package/es2022/structured-log/src/services/rest/restSink.service.js.map +1 -1
- package/hotkeys/src/services/appHotkeys.service.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/modules/debugData/components/debugData/debugData.component.d.ts +8 -8
- package/src/modules/debugData/components/debugData/debugData.component.d.ts.map +1 -1
- package/src/modules/debugData/components/debugData/debugData.component.html +1 -1
- package/structured-log/src/index.d.ts +1 -1
- package/structured-log/src/index.d.ts.map +1 -1
- package/structured-log/src/services/rest/restSink.options.d.ts +24 -0
- package/structured-log/src/services/rest/restSink.options.d.ts.map +1 -0
- package/structured-log/src/services/rest/restSink.service.d.ts +7 -4
- package/structured-log/src/services/rest/restSink.service.d.ts.map +1 -1
- package/version.bak +1 -1
- package/es2022/structured-log/src/services/rest/restSinkConfig.service.js +0 -60
- package/es2022/structured-log/src/services/rest/restSinkConfig.service.js.map +0 -1
- package/structured-log/src/services/rest/restSinkConfig.service.d.ts +0 -22
- package/structured-log/src/services/rest/restSinkConfig.service.d.ts.map +0 -1
package/changelog.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## Version 17.0.0 (2023-07-
|
|
3
|
+
## Version 17.0.0 (2023-07-11)
|
|
4
4
|
|
|
5
5
|
### Features
|
|
6
6
|
|
|
@@ -32,6 +32,16 @@
|
|
|
32
32
|
- minimal supported version of `tslib` is `2.6.0`
|
|
33
33
|
- dropped support of `NodeJs` lower than `16.14`
|
|
34
34
|
- pipe `LocalizePipe` renamed to `LocalizeSAPipe`
|
|
35
|
+
- `RestSinkConfigService` renamed to `RestSinkOptions`
|
|
36
|
+
- updated `RestSinkService` constructor parameters order
|
|
37
|
+
- updated `DebugDataComponent`
|
|
38
|
+
- renamed `_debugDataEnabledChangeSubscription` to `debugDataEnabledChangeSubscription`
|
|
39
|
+
- `debugDataEnabledChangeSubscription` is now *nullable*
|
|
40
|
+
- renamed `_debugDataEnabledSvc` to `debugDataEnabledSvc`
|
|
41
|
+
- renamed `changeDetector` to `_changeDetector`
|
|
42
|
+
- renamed `element` to `_element`
|
|
43
|
+
- `enabled` property changed to `protected`
|
|
44
|
+
- now using `signals`
|
|
35
45
|
|
|
36
46
|
## Version 16.0.0 (2023-02-08)
|
|
37
47
|
|
|
@@ -66,7 +66,9 @@ class AppHotkeysService {
|
|
|
66
66
|
appHotkeysService = tmp.hotkeys;
|
|
67
67
|
}
|
|
68
68
|
const oldHotkeys = appHotkeysService._hotkeySvc.mousetrap;
|
|
69
|
-
|
|
69
|
+
if (appHotkeysService._mousetrap) {
|
|
70
|
+
appHotkeysService._hotkeySvc.mousetrap = appHotkeysService._mousetrap;
|
|
71
|
+
}
|
|
70
72
|
scopedInitialization(appHotkeysService);
|
|
71
73
|
appHotkeysService._hotkeySvc.mousetrap = oldHotkeys;
|
|
72
74
|
}
|
|
@@ -100,7 +102,9 @@ class AppHotkeysService {
|
|
|
100
102
|
});
|
|
101
103
|
this._oldHotkeys = [];
|
|
102
104
|
if (this._mousetrap) {
|
|
103
|
-
|
|
105
|
+
if (oldMouseTrap) {
|
|
106
|
+
this._hotkeySvc.mousetrap = oldMouseTrap;
|
|
107
|
+
}
|
|
104
108
|
this._mousetrap.reset();
|
|
105
109
|
this._mousetrap = null;
|
|
106
110
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appHotkeys.service.js","sourceRoot":"","sources":["../../../../hotkeys/src/services/appHotkeys.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,cAAc,EAAS,MAAM,kBAAkB,CAAC;AACxD,OAAO,SAA8B,MAAM,WAAW,CAAC;;;AAEvD;;GAEG;AACH,MACa,iBAAiB;IAgCN;IA9BpB,oEAAoE;IAEpE;;OAEG;IACK,WAAW,GAAa,EAAE,CAAC;IAEnC;;OAEG;IACK,QAAQ,GAAa,EAAE,CAAC;IAEhC;;OAEG;IACK,OAAO,GAAyD,EAAE,CAAC;IAE3E;;OAEG;IACK,UAAU,
|
|
1
|
+
{"version":3,"file":"appHotkeys.service.js","sourceRoot":"","sources":["../../../../hotkeys/src/services/appHotkeys.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,cAAc,EAAS,MAAM,kBAAkB,CAAC;AACxD,OAAO,SAA8B,MAAM,WAAW,CAAC;;;AAEvD;;GAEG;AACH,MACa,iBAAiB;IAgCN;IA9BpB,oEAAoE;IAEpE;;OAEG;IACK,WAAW,GAAa,EAAE,CAAC;IAEnC;;OAEG;IACK,QAAQ,GAAa,EAAE,CAAC;IAEhC;;OAEG;IACK,OAAO,GAAyD,EAAE,CAAC;IAE3E;;OAEG;IACK,UAAU,GAA2B,IAAI,CAAC;IAElD,uEAAuE;IAEvE;;OAEG;IACI,OAAO,CAAiB;IAE/B,iEAAiE;IACjE,YAAoB,UAA0B;QAA1B,eAAU,GAAV,UAAU,CAAgB;QAE1C,IAAI,CAAC,OAAO,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,EACxC;YACI,GAAG,EAAE,CAAC,MAAsB,EAAE,QAAgB,EAAE,QAAa,E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AC,MAAM,CAAC,EACxB;YACI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;gBAEjB,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC;YACnC,CAAC,CAAC,CAAC;YAEH,OAAO;SACV;QAED,MAAM,YAAY,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAEvD,IAAG,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,EAC/B;YACI,OAAO,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;YAE5C,OAAO;SACV;QAED,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAElC,IAAG,SAAS,EACZ;YACI,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YAClC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SACpC;QAED,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;uGAvLQ,iBAAiB;2GAAjB,iBAAiB;;SAAjB,iBAAiB;2FAAjB,iBAAiB;kBAD7B,UAAU","sourcesContent":["import {Injectable} from '@angular/core';\nimport {HotkeysService, Hotkey} from 'angular2-hotkeys';\nimport Mousetrap, {MousetrapInstance} from 'mousetrap';\n\n/**\n * Application hotkeys service\n */\n@Injectable()\nexport class AppHotkeysService\n{\n //######################### private fields #########################\n\n /**\n * Old hotkeys from parent\n */\n private _oldHotkeys: Hotkey[] = [];\n\n /**\n * Hotkeys for current service\n */\n private _hotkeys: Hotkey[] = [];\n\n /**\n * Array of scoped instances of AppHotkeysService\n */\n private _scoped: {element: HTMLElement; hotkeys: AppHotkeysService}[] = [];\n\n /**\n * Instance of mousetrap that is attached to specific element\n */\n private _mousetrap: MousetrapInstance|null = null;\n\n //######################### public properties #########################\n\n /**\n * Hotkeys service used for handling hotkeys\n */\n public hotkeys: HotkeysService;\n\n //######################### constructor #########################\n constructor(private _hotkeySvc: HotkeysService)\n {\n this.hotkeys = new Proxy(this._hotkeySvc,\n {\n get: (target: HotkeysService, property: string, receiver: any) =>\n {\n if(property == 'add')\n {\n return new Proxy(Reflect.get(target, property, receiver), \n {\n apply: (method: (hotkey: Hotkey | Hotkey[], specificEvent?: string ) => Hotkey | Hotkey[], _thisArg: any, argArray: any) =>\n {\n this._processAddedHotkeys(argArray[0]);\n\n return method.apply(this._hotkeySvc, argArray);\n }\n });\n }\n else\n {\n return Reflect.get(target, property, receiver);\n }\n }\n });\n }\n\n //######################### public methods #########################\n\n /**\n * Creates scoped hotkeys for html element\n * @param element - Html element used as scope base for hotkeys\n * @param scopedInitialization - Method used for initialization scoped hotkeys, hotkeys can be initialized only inside this method\n */\n public withScope(element: HTMLElement, scopedInitialization: (appHotkeysService: AppHotkeysService) => void): void\n {\n const tmp = this._scoped.find(itm => itm.element == element);\n let appHotkeysService: AppHotkeysService;\n\n if(!tmp)\n {\n appHotkeysService = new AppHotkeysService(this._hotkeySvc);\n appHotkeysService._mousetrap = new Mousetrap(element);\n }\n else\n {\n appHotkeysService = tmp.hotkeys;\n }\n\n const oldHotkeys = appHotkeysService._hotkeySvc.mousetrap;\n\n if(appHotkeysService._mousetrap)\n {\n appHotkeysService._hotkeySvc.mousetrap = appHotkeysService._mousetrap;\n }\n\n scopedInitialization(appHotkeysService);\n appHotkeysService._hotkeySvc.mousetrap = oldHotkeys;\n }\n\n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this.destroy();\n }\n\n /**\n * This method should be called in ngOnDestroy for each component which registered new hotkeys\n */\n public destroy(): void\n {\n this._scoped.forEach(scoped =>\n {\n scoped.hotkeys.destroy();\n });\n\n this._scoped = [];\n\n let oldMouseTrap;\n\n if(this._mousetrap)\n {\n oldMouseTrap = this._hotkeySvc.mousetrap;\n this._hotkeySvc.mousetrap = this._mousetrap;\n }\n\n //remove all hotkeys registered by this service\n this._hotkeys.forEach(key =>\n {\n this._hotkeySvc.remove(key);\n });\n\n this._hotkeys = [];\n\n //restore old hotkeys from parent component\n this._oldHotkeys.forEach(key =>\n {\n this._hotkeySvc.add(key);\n });\n\n this._oldHotkeys = [];\n\n if(this._mousetrap)\n {\n if(oldMouseTrap)\n {\n this._hotkeySvc.mousetrap = oldMouseTrap;\n }\n \n this._mousetrap.reset();\n this._mousetrap = null;\n }\n }\n\n //######################### private methods #########################\n\n /**\n * Process added hotkeys, stores old ones\n * @param hotkey - Hotkey to be added\n */\n private _processAddedHotkeys(hotkey: Hotkey | Hotkey[]): void\n {\n if(Array.isArray(hotkey)) \n {\n hotkey.forEach(key =>\n {\n this._processAddedHotkeys(key);\n });\n\n return;\n }\n\n const oldHotkeyVal = this._hotkeySvc.get(hotkey.combo);\n\n if(!Array.isArray(oldHotkeyVal))\n {\n console.warn('Unexpected array of hotkeys');\n\n return;\n }\n\n const oldHotkey = oldHotkeyVal[0];\n\n if(oldHotkey)\n {\n this._hotkeySvc.remove(oldHotkey);\n this._oldHotkeys.push(oldHotkey);\n }\n\n this._hotkeys.push(hotkey);\n }\n}"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, ChangeDetectionStrategy, ChangeDetectorRef, ElementRef } from '@angular/core';
|
|
1
|
+
import { Component, ChangeDetectionStrategy, ChangeDetectorRef, ElementRef, signal } from '@angular/core';
|
|
2
2
|
import { DebugDataEnabledService } from '../../services/debugDataEnabled/debugDataEnabled.service';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
import * as i1 from "../../services/debugDataEnabled/debugDataEnabled.service";
|
|
@@ -11,38 +11,38 @@ const ENABLED = 'enabled';
|
|
|
11
11
|
* Component used for displaying debug data
|
|
12
12
|
*/
|
|
13
13
|
class DebugDataComponent {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
debugDataEnabledSvc;
|
|
15
|
+
changeDetector;
|
|
16
|
+
element;
|
|
17
17
|
//######################### protected fields #########################
|
|
18
18
|
/**
|
|
19
19
|
* Subscription for changes of debug data enabled
|
|
20
20
|
*/
|
|
21
|
-
|
|
22
|
-
//#########################
|
|
21
|
+
debugDataEnabledChangeSubscription;
|
|
22
|
+
//######################### protected properties - template bindings #########################
|
|
23
23
|
/**
|
|
24
24
|
* Indication whether is debug data enabled
|
|
25
25
|
*
|
|
26
26
|
* @internal
|
|
27
27
|
*/
|
|
28
|
-
enabled = false;
|
|
28
|
+
enabled = signal(false);
|
|
29
29
|
//######################### constructor #########################
|
|
30
|
-
constructor(
|
|
31
|
-
this.
|
|
32
|
-
this.
|
|
33
|
-
this.
|
|
30
|
+
constructor(debugDataEnabledSvc, changeDetector, element) {
|
|
31
|
+
this.debugDataEnabledSvc = debugDataEnabledSvc;
|
|
32
|
+
this.changeDetector = changeDetector;
|
|
33
|
+
this.element = element;
|
|
34
34
|
}
|
|
35
35
|
//######################### public methods - implementation of OnInit #########################
|
|
36
36
|
/**
|
|
37
37
|
* Initialize component
|
|
38
38
|
*/
|
|
39
39
|
ngOnInit() {
|
|
40
|
-
this.enabled
|
|
41
|
-
this.
|
|
42
|
-
this.
|
|
43
|
-
this.enabled
|
|
44
|
-
this.
|
|
45
|
-
this.
|
|
40
|
+
this.enabled.set(this.debugDataEnabledSvc.enabled);
|
|
41
|
+
this.setEnabledCssClass();
|
|
42
|
+
this.debugDataEnabledChangeSubscription = this.debugDataEnabledSvc.enabledChange.subscribe(() => {
|
|
43
|
+
this.enabled.set(this.debugDataEnabledSvc.enabled);
|
|
44
|
+
this.setEnabledCssClass();
|
|
45
|
+
this.changeDetector.detectChanges();
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
48
|
//######################### public methods - implementation of OnDestroy #########################
|
|
@@ -50,27 +50,27 @@ class DebugDataComponent {
|
|
|
50
50
|
* Called when component is destroyed
|
|
51
51
|
*/
|
|
52
52
|
ngOnDestroy() {
|
|
53
|
-
this.
|
|
54
|
-
this.
|
|
53
|
+
this.debugDataEnabledChangeSubscription?.unsubscribe();
|
|
54
|
+
this.debugDataEnabledChangeSubscription = null;
|
|
55
55
|
}
|
|
56
|
-
//#########################
|
|
56
|
+
//######################### protected methods #########################
|
|
57
57
|
/**
|
|
58
58
|
* Sets enabled css class according enabled state
|
|
59
59
|
*/
|
|
60
|
-
|
|
61
|
-
if (this.enabled) {
|
|
62
|
-
this.
|
|
60
|
+
setEnabledCssClass() {
|
|
61
|
+
if (this.enabled()) {
|
|
62
|
+
this.element.nativeElement.classList.add(ENABLED);
|
|
63
63
|
}
|
|
64
64
|
else {
|
|
65
|
-
this.
|
|
65
|
+
this.element.nativeElement.classList.remove(ENABLED);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DebugDataComponent, deps: [{ token: i1.DebugDataEnabledService }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
69
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: DebugDataComponent, selector: "debug-data", ngImport: i0, template: "<ng-template [ngIf]=\"enabled\">\r\n <ng-content></ng-content>\r\n</ng-template>", styles: [":host\r\n{\r\n font-weight: normal;\r\n font-style: italic;\r\n text-shadow: 0 0 1px;\r\n display: none;\r\n}\r\n\r\n:host(.clickable)\r\n{\r\n cursor: pointer;\r\n}\r\n\r\n:host(.enabled)\r\n{\r\n display: block;\r\n}"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
69
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: DebugDataComponent, selector: "debug-data", ngImport: i0, template: "<ng-template [ngIf]=\"enabled()\">\r\n <ng-content></ng-content>\r\n</ng-template>", styles: [":host\r\n{\r\n font-weight: normal;\r\n font-style: italic;\r\n text-shadow: 0 0 1px;\r\n display: none;\r\n}\r\n\r\n:host(.clickable)\r\n{\r\n cursor: pointer;\r\n}\r\n\r\n:host(.enabled)\r\n{\r\n display: block;\r\n}"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
70
70
|
}
|
|
71
71
|
export { DebugDataComponent };
|
|
72
72
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DebugDataComponent, decorators: [{
|
|
73
73
|
type: Component,
|
|
74
|
-
args: [{ selector: 'debug-data', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template [ngIf]=\"enabled\">\r\n <ng-content></ng-content>\r\n</ng-template>", styles: [":host\r\n{\r\n font-weight: normal;\r\n font-style: italic;\r\n text-shadow: 0 0 1px;\r\n display: none;\r\n}\r\n\r\n:host(.clickable)\r\n{\r\n cursor: pointer;\r\n}\r\n\r\n:host(.enabled)\r\n{\r\n display: block;\r\n}"] }]
|
|
74
|
+
args: [{ selector: 'debug-data', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template [ngIf]=\"enabled()\">\r\n <ng-content></ng-content>\r\n</ng-template>", styles: [":host\r\n{\r\n font-weight: normal;\r\n font-style: italic;\r\n text-shadow: 0 0 1px;\r\n display: none;\r\n}\r\n\r\n:host(.clickable)\r\n{\r\n cursor: pointer;\r\n}\r\n\r\n:host(.enabled)\r\n{\r\n display: block;\r\n}"] }]
|
|
75
75
|
}], ctorParameters: function () { return [{ type: i1.DebugDataEnabledService }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }]; } });
|
|
76
76
|
//# sourceMappingURL=debugData.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debugData.component.js","sourceRoot":"","sources":["../../../../../../src/modules/debugData/components/debugData/debugData.component.ts","../../../../../../src/modules/debugData/components/debugData/debugData.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAqB,iBAAiB,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"debugData.component.js","sourceRoot":"","sources":["../../../../../../src/modules/debugData/components/debugData/debugData.component.ts","../../../../../../src/modules/debugData/components/debugData/debugData.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAqB,iBAAiB,EAAE,UAAU,EAAE,MAAM,EAAiB,MAAM,eAAe,CAAC;AAG3I,OAAO,EAAC,uBAAuB,EAAC,MAAM,0DAA0D,CAAC;;;;AAEjG;;GAEG;AACH,MAAM,OAAO,GAAG,SAAS,CAAC;AAE1B;;GAEG;AACH,MAOa,kBAAkB;IAmBL;IACA;IACA;IAnBtB,sEAAsE;IAEtE;;OAEG;IACO,kCAAkC,CAA8B;IAE1E,8FAA8F;IAE9F;;;;OAIG;IACO,OAAO,GAA4B,MAAM,CAAC,KAAK,CAAC,CAAC;IAE3D,iEAAiE;IACjE,YAAsB,mBAA4C,EAC5C,cAAiC,EACjC,OAAgC;QAFhC,wBAAmB,GAAnB,mBAAmB,CAAyB;QAC5C,mBAAc,GAAd,cAAc,CAAmB;QACjC,YAAO,GAAP,OAAO,CAAyB;IAEtD,CAAC;IAED,+FAA+F;IAE/F;;OAEG;IACI,QAAQ;QAEX,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;QACnD,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAE1B,IAAI,CAAC,kCAAkC,GAAG,IAAI,CAAC,mBAAmB,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,EAAE;YAE5F,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;YACnD,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAE1B,IAAI,CAAC,cAAc,CAAC,aAAa,EAAE,CAAC;QACxC,CAAC,CAAC,CAAC;IACP,CAAC;IAED,kGAAkG;IAElG;;OAEG;IACI,WAAW;QAEd,IAAI,CAAC,kCAAkC,EAAE,WAAW,EAAE,CAAC;QACvD,IAAI,CAAC,kCAAkC,GAAG,IAAI,CAAC;IACnD,CAAC;IAED,uEAAuE;IAEvE;;OAEG;IACO,kBAAkB;QAExB,IAAG,IAAI,CAAC,OAAO,EAAE,EACjB;YACI,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;SACrD;aAED;YACI,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;SACxD;IACL,CAAC;uGAtEQ,kBAAkB;2FAAlB,kBAAkB,kDCpB/B,uFAEc;;SDkBD,kBAAkB;2FAAlB,kBAAkB;kBAP9B,SAAS;+BAEI,YAAY,mBAGL,uBAAuB,CAAC,MAAM","sourcesContent":["import {Component, ChangeDetectionStrategy, OnDestroy, OnInit, ChangeDetectorRef, ElementRef, signal, WritableSignal} from '@angular/core';\nimport {Subscription} from 'rxjs';\n\nimport {DebugDataEnabledService} from '../../services/debugDataEnabled/debugDataEnabled.service';\n\n/**\n * Name of css class for enabled debug data\n */\nconst ENABLED = 'enabled';\n\n/**\n * Component used for displaying debug data\n */\n@Component(\n{\n selector: 'debug-data',\n templateUrl: 'debugData.component.html',\n styleUrls: ['debugData.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DebugDataComponent implements OnDestroy, OnInit\n{\n //######################### protected fields #########################\n\n /**\n * Subscription for changes of debug data enabled\n */\n protected debugDataEnabledChangeSubscription: Subscription|undefined|null;\n\n //######################### protected properties - template bindings #########################\n\n /**\n * Indication whether is debug data enabled\n *\n * @internal\n */\n protected enabled: WritableSignal<boolean> = signal(false);\n\n //######################### constructor #########################\n constructor(protected debugDataEnabledSvc: DebugDataEnabledService,\n protected changeDetector: ChangeDetectorRef,\n protected element: ElementRef<HTMLElement>)\n {\n }\n\n //######################### public methods - implementation of OnInit #########################\n\n /**\n * Initialize component\n */\n public ngOnInit(): void\n {\n this.enabled.set(this.debugDataEnabledSvc.enabled);\n this.setEnabledCssClass();\n\n this.debugDataEnabledChangeSubscription = this.debugDataEnabledSvc.enabledChange.subscribe(() =>\n {\n this.enabled.set(this.debugDataEnabledSvc.enabled);\n this.setEnabledCssClass();\n\n this.changeDetector.detectChanges();\n });\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n\n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this.debugDataEnabledChangeSubscription?.unsubscribe();\n this.debugDataEnabledChangeSubscription = null;\n }\n\n //######################### protected methods #########################\n\n /**\n * Sets enabled css class according enabled state\n */\n protected setEnabledCssClass(): void\n {\n if(this.enabled())\n {\n this.element.nativeElement.classList.add(ENABLED);\n }\n else\n {\n this.element.nativeElement.classList.remove(ENABLED);\n }\n }\n}","<ng-template [ngIf]=\"enabled()\">\r\n <ng-content></ng-content>\r\n</ng-template>"]}
|
|
@@ -7,7 +7,7 @@ export * from './types/logger.interface';
|
|
|
7
7
|
export * from './services/console/consoleComponentSink.service';
|
|
8
8
|
export * from './services/console/consoleSinkConfig.service';
|
|
9
9
|
export * from './services/logger.service';
|
|
10
|
-
export * from './services/rest/
|
|
10
|
+
export * from './services/rest/restSink.options';
|
|
11
11
|
export * from './services/rest/restSink.service';
|
|
12
12
|
export * from './services/developerConsole/developerConsoleSink.options';
|
|
13
13
|
export * from './services/developerConsole/developerConsoleSink.service';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../structured-log/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mDAAmD,CAAC;AAClE,cAAc,wCAAwC,CAAC;AACvD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,iDAAiD,CAAC;AAChE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,2BAA2B,CAAC;AAC1C,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../structured-log/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mDAAmD,CAAC;AAClE,cAAc,wCAAwC,CAAC;AACvD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,iDAAiD,CAAC;AAChE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,0DAA0D,CAAC;AACzE,cAAc,0DAA0D,CAAC","sourcesContent":["export * from './components/console/console.component.animations';\nexport * from './components/console/console.component';\nexport * from './modules/consoleLog.module';\nexport * from './misc/utils';\nexport * from './types/tokens';\nexport * from './types/logger.interface';\nexport * from './services/console/consoleComponentSink.service';\nexport * from './services/console/consoleSinkConfig.service';\nexport * from './services/logger.service';\nexport * from './services/rest/restSink.options';\nexport * from './services/rest/restSink.service';\nexport * from './services/developerConsole/developerConsoleSink.options';\nexport * from './services/developerConsole/developerConsoleSink.service';\n"]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { isPresent } from '@jscrpt/common';
|
|
2
|
+
import { LogEventLevel } from 'structured-log';
|
|
3
|
+
/**
|
|
4
|
+
* Options for rest sink
|
|
5
|
+
*/
|
|
6
|
+
export class RestSinkOptions {
|
|
7
|
+
//######################### public properties #########################
|
|
8
|
+
/**
|
|
9
|
+
* Number of seconds after which should be flush called
|
|
10
|
+
*/
|
|
11
|
+
secondsToFlushAfter = 300;
|
|
12
|
+
/**
|
|
13
|
+
* Number of logs after which should be flush called
|
|
14
|
+
*/
|
|
15
|
+
flushAfterNumberOfLogs = 50;
|
|
16
|
+
/**
|
|
17
|
+
* Minimal log level that will be flushed immediately
|
|
18
|
+
*/
|
|
19
|
+
immediateFlushMinLevel = LogEventLevel.error;
|
|
20
|
+
/**
|
|
21
|
+
* Restricts logs to specified level
|
|
22
|
+
*/
|
|
23
|
+
restrictToLevel = LogEventLevel.warning;
|
|
24
|
+
//######################### constructor #########################
|
|
25
|
+
constructor(secondsToFlushAfter, flushAfterNumberOfLogs, immediateFlushMinLevel, restrictToLevel) {
|
|
26
|
+
if (isPresent(secondsToFlushAfter)) {
|
|
27
|
+
this.secondsToFlushAfter = secondsToFlushAfter;
|
|
28
|
+
}
|
|
29
|
+
if (isPresent(flushAfterNumberOfLogs)) {
|
|
30
|
+
this.flushAfterNumberOfLogs = flushAfterNumberOfLogs;
|
|
31
|
+
}
|
|
32
|
+
if (isPresent(immediateFlushMinLevel)) {
|
|
33
|
+
this.immediateFlushMinLevel = immediateFlushMinLevel;
|
|
34
|
+
}
|
|
35
|
+
if (isPresent(restrictToLevel)) {
|
|
36
|
+
this.restrictToLevel = restrictToLevel;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=restSink.options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restSink.options.js","sourceRoot":"","sources":["../../../../../structured-log/src/services/rest/restSink.options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAC,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAE7C;;GAEG;AACH,MAAM,OAAO,eAAe;IAExB,uEAAuE;IAEvE;;OAEG;IACI,mBAAmB,GAAW,GAAG,CAAC;IAEzC;;OAEG;IACI,sBAAsB,GAAW,EAAE,CAAC;IAE3C;;OAEG;IACI,sBAAsB,GAAkB,aAAa,CAAC,KAAK,CAAC;IAEnE;;OAEG;IACI,eAAe,GAAkB,aAAa,CAAC,OAAO,CAAC;IAE9D,iEAAiE;IACjE,YAAY,mBAA4B,EAC5B,sBAA+B,EAC/B,sBAAsC,EACtC,eAA+B;QAEvC,IAAG,SAAS,CAAC,mBAAmB,CAAC,EACjC;YACI,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;SAClD;QAED,IAAG,SAAS,CAAC,sBAAsB,CAAC,EACpC;YACI,IAAI,CAAC,sBAAsB,GAAG,sBAAsB,CAAC;SACxD;QAED,IAAG,SAAS,CAAC,sBAAsB,CAAC,EACpC;YACI,IAAI,CAAC,sBAAsB,GAAG,sBAAsB,CAAC;SACxD;QAED,IAAG,SAAS,CAAC,eAAe,CAAC,EAC7B;YACI,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;SAC1C;IACL,CAAC;CACJ","sourcesContent":["import {isPresent} from '@jscrpt/common';\nimport {LogEventLevel} from 'structured-log';\n\n/**\n * Options for rest sink\n */\nexport class RestSinkOptions\n{\n //######################### public properties #########################\n\n /**\n * Number of seconds after which should be flush called\n */\n public secondsToFlushAfter: number = 300;\n\n /**\n * Number of logs after which should be flush called\n */\n public flushAfterNumberOfLogs: number = 50;\n\n /**\n * Minimal log level that will be flushed immediately\n */\n public immediateFlushMinLevel: LogEventLevel = LogEventLevel.error;\n\n /**\n * Restricts logs to specified level\n */\n public restrictToLevel: LogEventLevel = LogEventLevel.warning;\n\n //######################### constructor #########################\n constructor(secondsToFlushAfter?: number,\n flushAfterNumberOfLogs?: number,\n immediateFlushMinLevel?: LogEventLevel,\n restrictToLevel?: LogEventLevel,)\n {\n if(isPresent(secondsToFlushAfter))\n {\n this.secondsToFlushAfter = secondsToFlushAfter;\n }\n\n if(isPresent(flushAfterNumberOfLogs))\n {\n this.flushAfterNumberOfLogs = flushAfterNumberOfLogs;\n }\n\n if(isPresent(immediateFlushMinLevel))\n {\n this.immediateFlushMinLevel = immediateFlushMinLevel;\n }\n\n if(isPresent(restrictToLevel))\n {\n this.restrictToLevel = restrictToLevel;\n }\n }\n}\n"]}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { Injectable, Inject } from '@angular/core';
|
|
1
|
+
import { Injectable, Inject, Optional } from '@angular/core';
|
|
2
2
|
import { APP_STABLE } from '@anglr/common';
|
|
3
3
|
import { isPresent } from '@jscrpt/common';
|
|
4
4
|
import { LogEventLevel } from 'structured-log';
|
|
5
5
|
import { lastValueFrom } from 'rxjs';
|
|
6
6
|
import { toText, isEnabled } from '../../misc/utils';
|
|
7
|
-
import {
|
|
7
|
+
import { RestSinkOptions } from './restSink.options';
|
|
8
8
|
import { LOGGER_REST_CLIENT } from '../../types/tokens';
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
10
|
-
import * as i1 from "./
|
|
10
|
+
import * as i1 from "./restSink.options";
|
|
11
11
|
/**
|
|
12
12
|
* Sink that is used for storing logs using REST
|
|
13
13
|
*/
|
|
14
14
|
class RestSinkService {
|
|
15
|
-
_configSvc;
|
|
16
15
|
_restClient;
|
|
17
16
|
//######################### private fields #########################
|
|
18
17
|
/**
|
|
@@ -27,14 +26,23 @@ class RestSinkService {
|
|
|
27
26
|
* Interval timer id
|
|
28
27
|
*/
|
|
29
28
|
_timer;
|
|
29
|
+
/**
|
|
30
|
+
* Configuration options for rest sink
|
|
31
|
+
*/
|
|
32
|
+
_config;
|
|
30
33
|
//######################### constructor #########################
|
|
31
|
-
constructor(
|
|
32
|
-
this._configSvc = _configSvc;
|
|
34
|
+
constructor(isStable, _restClient, config) {
|
|
33
35
|
this._restClient = _restClient;
|
|
36
|
+
if (!config || !(config instanceof RestSinkOptions)) {
|
|
37
|
+
this._config = new RestSinkOptions();
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
this._config = config;
|
|
41
|
+
}
|
|
34
42
|
isStable.then(() => {
|
|
35
43
|
this._timer = setInterval(() => {
|
|
36
44
|
this.flush();
|
|
37
|
-
}, (this.
|
|
45
|
+
}, (this._config.secondsToFlushAfter ?? 0) * 1000);
|
|
38
46
|
});
|
|
39
47
|
}
|
|
40
48
|
//######################### public methods - implementation of OnDestroy #########################
|
|
@@ -62,7 +70,7 @@ class RestSinkService {
|
|
|
62
70
|
this._updatePrototype(e);
|
|
63
71
|
this._prototypeUpdated = true;
|
|
64
72
|
}
|
|
65
|
-
if (!isEnabled(this.
|
|
73
|
+
if (!isEnabled(this._config.restrictToLevel, e.level)) {
|
|
66
74
|
return;
|
|
67
75
|
}
|
|
68
76
|
const logLevel = LogEventLevel[e.level].toUpperCase();
|
|
@@ -73,12 +81,12 @@ class RestSinkService {
|
|
|
73
81
|
message,
|
|
74
82
|
timestamp
|
|
75
83
|
});
|
|
76
|
-
if (isEnabled(this.
|
|
84
|
+
if (isEnabled(this._config.immediateFlushMinLevel, e.level)) {
|
|
77
85
|
forceFlush = true;
|
|
78
86
|
}
|
|
79
87
|
});
|
|
80
88
|
//flush if number of records is bigger than max or flush is required
|
|
81
|
-
if (forceFlush || this._logs.length >= this.
|
|
89
|
+
if (forceFlush || this._logs.length >= this._config.flushAfterNumberOfLogs) {
|
|
82
90
|
this.flush();
|
|
83
91
|
}
|
|
84
92
|
}
|
|
@@ -110,17 +118,19 @@ class RestSinkService {
|
|
|
110
118
|
messageTemplateInstance.constructor.prototype.toText = toText;
|
|
111
119
|
}
|
|
112
120
|
}
|
|
113
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: RestSinkService, deps: [{ token:
|
|
121
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: RestSinkService, deps: [{ token: APP_STABLE }, { token: LOGGER_REST_CLIENT }, { token: i1.RestSinkOptions, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
114
122
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: RestSinkService });
|
|
115
123
|
}
|
|
116
124
|
export { RestSinkService };
|
|
117
125
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: RestSinkService, decorators: [{
|
|
118
126
|
type: Injectable
|
|
119
|
-
}], ctorParameters: function () { return [{ type:
|
|
127
|
+
}], ctorParameters: function () { return [{ type: Promise, decorators: [{
|
|
120
128
|
type: Inject,
|
|
121
129
|
args: [APP_STABLE]
|
|
122
130
|
}] }, { type: undefined, decorators: [{
|
|
123
131
|
type: Inject,
|
|
124
132
|
args: [LOGGER_REST_CLIENT]
|
|
133
|
+
}] }, { type: i1.RestSinkOptions, decorators: [{
|
|
134
|
+
type: Optional
|
|
125
135
|
}] }]; } });
|
|
126
136
|
//# sourceMappingURL=restSink.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restSink.service.js","sourceRoot":"","sources":["../../../../../structured-log/src/services/rest/restSink.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,MAAM,EAAC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"restSink.service.js","sourceRoot":"","sources":["../../../../../structured-log/src/services/rest/restSink.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAiB,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAC,aAAa,EAAC,MAAM,MAAM,CAAC;AAEnC,OAAO,EAAC,MAAM,EAAE,SAAS,EAAC,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAC,eAAe,EAAC,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAC,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;;;AAGtD;;GAEG;AACH,MACa,eAAe;IA0BwB;IAxBhD,oEAAoE;IAEpE;;OAEG;IACK,iBAAiB,GAAY,KAAK,CAAC;IAE3C;;OAEG;IACK,KAAK,GAAc,EAAE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,GAAS,CAAC,CAAC,eAAgB,CAAC;QAEzD,IAAG,uBAAuB,CAAC,WAAW,IAAI,uBAAuB,CAAC,WAAW,CAAC,SAAS,IAAI,uBAAuB,CAAC,WAAW,CAAC,SAAS,CAAC,MAAM,EAC/I;YACI,uBAAuB,CAAC,WAAW,CAAC,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC;SACjE;IACL,CAAC;uGA3JQ,eAAe,kBAyBJ,UAAU,aACV,kBAAkB;2GA1B7B,eAAe;;SAAf,eAAe;2FAAf,eAAe;kBAD3B,UAAU;;0BA0BM,MAAM;2BAAC,UAAU;;0BACjB,MAAM;2BAAC,kBAAkB;;0BACzB,QAAQ","sourcesContent":["import {Injectable, Inject, Optional} from '@angular/core';\nimport {APP_STABLE} from '@anglr/common';\nimport {isPresent} from '@jscrpt/common';\nimport {Sink, LogEvent, LogEventLevel} from 'structured-log';\nimport {lastValueFrom} from 'rxjs';\n\nimport {toText, isEnabled} from '../../misc/utils';\nimport {RestSinkOptions} from './restSink.options';\nimport {LOGGER_REST_CLIENT} from '../../types/tokens';\nimport {LoggerRestClient, RestLog} from '../../types/logger.interface';\n\n/**\n * Sink that is used for storing logs using REST\n */\n@Injectable()\nexport class RestSinkService implements Sink\n{\n //######################### private fields #########################\n\n /**\n * Indication that prototype of MessageTemplate was updated\n */\n private _prototypeUpdated: boolean = false;\n\n /**\n * Array of unflushed logs\n */\n private _logs: RestLog[] = [];\n\n /**\n * Interval timer id\n */\n private _timer: number|undefined|null;\n\n /**\n * Configuration options for rest sink\n */\n private _config: RestSinkOptions;\n\n //######################### constructor #########################\n constructor(@Inject(APP_STABLE) isStable: Promise<void>,\n @Inject(LOGGER_REST_CLIENT) private _restClient: LoggerRestClient,\n @Optional() config?: RestSinkOptions,)\n {\n if(!config || !(config instanceof RestSinkOptions))\n {\n this._config = new RestSinkOptions();\n }\n else\n {\n this._config = config;\n }\n\n isStable.then(() =>\n {\n this._timer = setInterval(() =>\n {\n this.flush();\n }, (this._config.secondsToFlushAfter ?? 0) * 1000) as any;\n });\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n if(isPresent(this._timer))\n {\n clearInterval(this._timer);\n }\n\n this.flush();\n }\n\n //######################### public methods - implementation of Sink #########################\n\n /**\n * Emits events into log\n * @param events - Events to be emitted\n */\n public emit(events: LogEvent[]): void\n {\n if(!events || !events.length)\n {\n return;\n }\n\n let forceFlush = false;\n\n events.forEach(e =>\n {\n if(!this._prototypeUpdated)\n {\n this._updatePrototype(e);\n\n this._prototypeUpdated = true;\n }\n\n if (!isEnabled(this._config.restrictToLevel, e.level))\n {\n return;\n }\n\n const logLevel = LogEventLevel[e.level].toUpperCase();\n const timestamp = e.timestamp;\n const message = e.messageTemplate.render(e.properties);\n\n this._logs.push(\n {\n logLevel,\n message,\n timestamp\n });\n\n if (isEnabled(this._config.immediateFlushMinLevel, e.level))\n {\n forceFlush = true;\n }\n });\n\n //flush if number of records is bigger than max or flush is required\n if(forceFlush || this._logs.length >= this._config.flushAfterNumberOfLogs)\n {\n this.flush();\n }\n }\n\n /**\n * Flushes logs\n */\n public flush(): Promise<void>\n {\n let promise: Promise<void>|undefined;\n\n //no logs available\n if(!this._logs.length)\n {\n return Promise.resolve();\n }\n\n try\n {\n promise = lastValueFrom(this._restClient.log(this._logs));\n }\n catch(e)\n {\n console.log(e);\n }\n\n this._logs = [];\n\n return promise ?? Promise.resolve();\n }\n\n //######################### private methods #########################\n\n /**\n * Updates prototype of MessageTemplate\n */\n private _updatePrototype(e: LogEvent): void\n {\n const messageTemplateInstance = (<any>e.messageTemplate);\n\n if(messageTemplateInstance.constructor && messageTemplateInstance.constructor.prototype && messageTemplateInstance.constructor.prototype.toText)\n {\n messageTemplateInstance.constructor.prototype.toText = toText;\n }\n }\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appHotkeys.service.d.ts","sourceRoot":"","sources":["appHotkeys.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,cAAc,EAAS,MAAM,kBAAkB,CAAC;;AAGxD;;GAEG;AACH,qBACa,iBAAiB;IAgCd,OAAO,CAAC,UAAU;IA5B9B;;OAEG;IACH,OAAO,CAAC,WAAW,CAAgB;IAEnC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAgB;IAEhC;;OAEG;IACH,OAAO,CAAC,OAAO,CAA4D;IAE3E;;OAEG;IACH,OAAO,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"appHotkeys.service.d.ts","sourceRoot":"","sources":["appHotkeys.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,cAAc,EAAS,MAAM,kBAAkB,CAAC;;AAGxD;;GAEG;AACH,qBACa,iBAAiB;IAgCd,OAAO,CAAC,UAAU;IA5B9B;;OAEG;IACH,OAAO,CAAC,WAAW,CAAgB;IAEnC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAgB;IAEhC;;OAEG;IACH,OAAO,CAAC,OAAO,CAA4D;IAE3E;;OAEG;IACH,OAAO,CAAC,UAAU,CAAgC;IAIlD;;OAEG;IACI,OAAO,EAAE,cAAc,CAAC;gBAGX,UAAU,EAAE,cAAc;IA4B9C;;;;OAIG;IACI,SAAS,CAAC,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC,iBAAiB,EAAE,iBAAiB,KAAK,IAAI,GAAG,IAAI;IA0BlH;;OAEG;IACI,WAAW,IAAI,IAAI;IAK1B;;OAEG;IACI,OAAO,IAAI,IAAI;IA+CtB;;;OAGG;IACH,OAAO,CAAC,oBAAoB;yCAzJnB,iBAAiB;6CAAjB,iBAAiB;CAwL7B"}
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OnDestroy, OnInit, ChangeDetectorRef, ElementRef } from '@angular/core';
|
|
1
|
+
import { OnDestroy, OnInit, ChangeDetectorRef, ElementRef, WritableSignal } from '@angular/core';
|
|
2
2
|
import { Subscription } from 'rxjs';
|
|
3
3
|
import { DebugDataEnabledService } from '../../services/debugDataEnabled/debugDataEnabled.service';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
@@ -6,20 +6,20 @@ import * as i0 from "@angular/core";
|
|
|
6
6
|
* Component used for displaying debug data
|
|
7
7
|
*/
|
|
8
8
|
export declare class DebugDataComponent implements OnDestroy, OnInit {
|
|
9
|
-
protected
|
|
10
|
-
protected
|
|
11
|
-
protected
|
|
9
|
+
protected debugDataEnabledSvc: DebugDataEnabledService;
|
|
10
|
+
protected changeDetector: ChangeDetectorRef;
|
|
11
|
+
protected element: ElementRef<HTMLElement>;
|
|
12
12
|
/**
|
|
13
13
|
* Subscription for changes of debug data enabled
|
|
14
14
|
*/
|
|
15
|
-
protected
|
|
15
|
+
protected debugDataEnabledChangeSubscription: Subscription | undefined | null;
|
|
16
16
|
/**
|
|
17
17
|
* Indication whether is debug data enabled
|
|
18
18
|
*
|
|
19
19
|
* @internal
|
|
20
20
|
*/
|
|
21
|
-
enabled: boolean
|
|
22
|
-
constructor(
|
|
21
|
+
protected enabled: WritableSignal<boolean>;
|
|
22
|
+
constructor(debugDataEnabledSvc: DebugDataEnabledService, changeDetector: ChangeDetectorRef, element: ElementRef<HTMLElement>);
|
|
23
23
|
/**
|
|
24
24
|
* Initialize component
|
|
25
25
|
*/
|
|
@@ -31,7 +31,7 @@ export declare class DebugDataComponent implements OnDestroy, OnInit {
|
|
|
31
31
|
/**
|
|
32
32
|
* Sets enabled css class according enabled state
|
|
33
33
|
*/
|
|
34
|
-
|
|
34
|
+
protected setEnabledCssClass(): void;
|
|
35
35
|
static ɵfac: i0.ɵɵFactoryDeclaration<DebugDataComponent, never>;
|
|
36
36
|
static ɵcmp: i0.ɵɵComponentDeclaration<DebugDataComponent, "debug-data", never, {}, {}, never, ["*"], false, never>;
|
|
37
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debugData.component.d.ts","sourceRoot":"","sources":["debugData.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,SAAS,EAAE,MAAM,EAAE,iBAAiB,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"debugData.component.d.ts","sourceRoot":"","sources":["debugData.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,SAAS,EAAE,MAAM,EAAE,iBAAiB,EAAE,UAAU,EAAU,cAAc,EAAC,MAAM,eAAe,CAAC;AAC3I,OAAO,EAAC,YAAY,EAAC,MAAM,MAAM,CAAC;AAElC,OAAO,EAAC,uBAAuB,EAAC,MAAM,0DAA0D,CAAC;;AAOjG;;GAEG;AACH,qBAOa,kBAAmB,YAAW,SAAS,EAAE,MAAM;IAmB5C,SAAS,CAAC,mBAAmB,EAAE,uBAAuB;IACtD,SAAS,CAAC,cAAc,EAAE,iBAAiB;IAC3C,SAAS,CAAC,OAAO,EAAE,UAAU,CAAC,WAAW,CAAC;IAjBtD;;OAEG;IACH,SAAS,CAAC,kCAAkC,EAAE,YAAY,GAAC,SAAS,GAAC,IAAI,CAAC;IAI1E;;;;OAIG;IACH,SAAS,CAAC,OAAO,EAAE,cAAc,CAAC,OAAO,CAAC,CAAiB;gBAGrC,mBAAmB,EAAE,uBAAuB,EAC5C,cAAc,EAAE,iBAAiB,EACjC,OAAO,EAAE,UAAU,CAAC,WAAW,CAAC;IAMtD;;OAEG;IACI,QAAQ,IAAI,IAAI;IAgBvB;;OAEG;IACI,WAAW,IAAI,IAAI;IAQ1B;;OAEG;IACH,SAAS,CAAC,kBAAkB,IAAI,IAAI;yCA5D3B,kBAAkB;2CAAlB,kBAAkB;CAuE9B"}
|
|
@@ -7,7 +7,7 @@ export * from './types/logger.interface';
|
|
|
7
7
|
export * from './services/console/consoleComponentSink.service';
|
|
8
8
|
export * from './services/console/consoleSinkConfig.service';
|
|
9
9
|
export * from './services/logger.service';
|
|
10
|
-
export * from './services/rest/
|
|
10
|
+
export * from './services/rest/restSink.options';
|
|
11
11
|
export * from './services/rest/restSink.service';
|
|
12
12
|
export * from './services/developerConsole/developerConsoleSink.options';
|
|
13
13
|
export * from './services/developerConsole/developerConsoleSink.service';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,mDAAmD,CAAC;AAClE,cAAc,wCAAwC,CAAC;AACvD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,iDAAiD,CAAC;AAChE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,2BAA2B,CAAC;AAC1C,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,mDAAmD,CAAC;AAClE,cAAc,wCAAwC,CAAC;AACvD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,iDAAiD,CAAC;AAChE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,0DAA0D,CAAC;AACzE,cAAc,0DAA0D,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { LogEventLevel } from 'structured-log';
|
|
2
|
+
/**
|
|
3
|
+
* Options for rest sink
|
|
4
|
+
*/
|
|
5
|
+
export declare class RestSinkOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Number of seconds after which should be flush called
|
|
8
|
+
*/
|
|
9
|
+
secondsToFlushAfter: number;
|
|
10
|
+
/**
|
|
11
|
+
* Number of logs after which should be flush called
|
|
12
|
+
*/
|
|
13
|
+
flushAfterNumberOfLogs: number;
|
|
14
|
+
/**
|
|
15
|
+
* Minimal log level that will be flushed immediately
|
|
16
|
+
*/
|
|
17
|
+
immediateFlushMinLevel: LogEventLevel;
|
|
18
|
+
/**
|
|
19
|
+
* Restricts logs to specified level
|
|
20
|
+
*/
|
|
21
|
+
restrictToLevel: LogEventLevel;
|
|
22
|
+
constructor(secondsToFlushAfter?: number, flushAfterNumberOfLogs?: number, immediateFlushMinLevel?: LogEventLevel, restrictToLevel?: LogEventLevel);
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=restSink.options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restSink.options.d.ts","sourceRoot":"","sources":["restSink.options.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAE7C;;GAEG;AACH,qBAAa,eAAe;IAIxB;;OAEG;IACI,mBAAmB,EAAE,MAAM,CAAO;IAEzC;;OAEG;IACI,sBAAsB,EAAE,MAAM,CAAM;IAE3C;;OAEG;IACI,sBAAsB,EAAE,aAAa,CAAuB;IAEnE;;OAEG;IACI,eAAe,EAAE,aAAa,CAAyB;gBAGlD,mBAAmB,CAAC,EAAE,MAAM,EAC5B,sBAAsB,CAAC,EAAE,MAAM,EAC/B,sBAAsB,CAAC,EAAE,aAAa,EACtC,eAAe,CAAC,EAAE,aAAa;CAsB9C"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { Sink, LogEvent } from 'structured-log';
|
|
2
|
-
import {
|
|
2
|
+
import { RestSinkOptions } from './restSink.options';
|
|
3
3
|
import { LoggerRestClient } from '../../types/logger.interface';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
/**
|
|
6
6
|
* Sink that is used for storing logs using REST
|
|
7
7
|
*/
|
|
8
8
|
export declare class RestSinkService implements Sink {
|
|
9
|
-
private _configSvc;
|
|
10
9
|
private _restClient;
|
|
11
10
|
/**
|
|
12
11
|
* Indication that prototype of MessageTemplate was updated
|
|
@@ -20,7 +19,11 @@ export declare class RestSinkService implements Sink {
|
|
|
20
19
|
* Interval timer id
|
|
21
20
|
*/
|
|
22
21
|
private _timer;
|
|
23
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Configuration options for rest sink
|
|
24
|
+
*/
|
|
25
|
+
private _config;
|
|
26
|
+
constructor(isStable: Promise<void>, _restClient: LoggerRestClient, config?: RestSinkOptions);
|
|
24
27
|
/**
|
|
25
28
|
* Called when component is destroyed
|
|
26
29
|
*/
|
|
@@ -38,7 +41,7 @@ export declare class RestSinkService implements Sink {
|
|
|
38
41
|
* Updates prototype of MessageTemplate
|
|
39
42
|
*/
|
|
40
43
|
private _updatePrototype;
|
|
41
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<RestSinkService,
|
|
44
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RestSinkService, [null, null, { optional: true; }]>;
|
|
42
45
|
static ɵprov: i0.ɵɵInjectableDeclaration<RestSinkService>;
|
|
43
46
|
}
|
|
44
47
|
//# sourceMappingURL=restSink.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restSink.service.d.ts","sourceRoot":"","sources":["restSink.service.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAgB,MAAM,gBAAgB,CAAC;AAI7D,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"restSink.service.d.ts","sourceRoot":"","sources":["restSink.service.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAgB,MAAM,gBAAgB,CAAC;AAI7D,OAAO,EAAC,eAAe,EAAC,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAC,gBAAgB,EAAU,MAAM,8BAA8B,CAAC;;AAEvE;;GAEG;AACH,qBACa,eAAgB,YAAW,IAAI;IA0BA,OAAO,CAAC,WAAW;IAtB3D;;OAEG;IACH,OAAO,CAAC,iBAAiB,CAAkB;IAE3C;;OAEG;IACH,OAAO,CAAC,KAAK,CAAiB;IAE9B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAwB;IAEtC;;OAEG;IACH,OAAO,CAAC,OAAO,CAAkB;gBAGD,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,EACP,WAAW,EAAE,gBAAgB,EACrD,MAAM,CAAC,EAAE,eAAe;IAsBhD;;OAEG;IACI,WAAW,IAAI,IAAI;IAY1B;;;OAGG;IACI,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI;IA+CrC;;OAEG;IACI,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IA0B7B;;OAEG;IACH,OAAO,CAAC,gBAAgB;yCAnJf,eAAe;6CAAf,eAAe;CA4J3B"}
|
package/version.bak
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
17.0.0-beta.
|
|
1
|
+
17.0.0-beta.20230711095959
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { Injectable, Inject, Injector } from '@angular/core';
|
|
2
|
-
import { isBlank } from '@jscrpt/common';
|
|
3
|
-
import { LogEventLevel } from 'structured-log';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
import * as i1 from "structured-log";
|
|
6
|
-
/**
|
|
7
|
-
* Service used as configuration for *rest sink*
|
|
8
|
-
*/
|
|
9
|
-
class RestSinkConfigService {
|
|
10
|
-
secondsToFlushAfter;
|
|
11
|
-
flushAfterNumberOfLogs;
|
|
12
|
-
immediateFlushMinLevel;
|
|
13
|
-
restrictToLevel;
|
|
14
|
-
//######################### constructor #########################
|
|
15
|
-
/**
|
|
16
|
-
* Creates instance of `RestSinkConfigService`
|
|
17
|
-
* @param secondsToFlushAfter - Number of seconds after which should be flush called
|
|
18
|
-
* @param flushAfterNumberOfLogs - Number of logs after which should be flush called
|
|
19
|
-
* @param immediateFlushMinLevel - Minimal log level that will be flushed immediately
|
|
20
|
-
* @param restrictToLevel - Minimal log level to be displayed
|
|
21
|
-
*/
|
|
22
|
-
constructor(secondsToFlushAfter, flushAfterNumberOfLogs, immediateFlushMinLevel, restrictToLevel) {
|
|
23
|
-
this.secondsToFlushAfter = secondsToFlushAfter;
|
|
24
|
-
this.flushAfterNumberOfLogs = flushAfterNumberOfLogs;
|
|
25
|
-
this.immediateFlushMinLevel = immediateFlushMinLevel;
|
|
26
|
-
this.restrictToLevel = restrictToLevel;
|
|
27
|
-
if (isBlank(secondsToFlushAfter)) {
|
|
28
|
-
this.secondsToFlushAfter = 300;
|
|
29
|
-
}
|
|
30
|
-
if (isBlank(flushAfterNumberOfLogs)) {
|
|
31
|
-
this.flushAfterNumberOfLogs = 50;
|
|
32
|
-
}
|
|
33
|
-
if (isBlank(immediateFlushMinLevel)) {
|
|
34
|
-
this.immediateFlushMinLevel = LogEventLevel.error;
|
|
35
|
-
}
|
|
36
|
-
if (isBlank(restrictToLevel)) {
|
|
37
|
-
this.restrictToLevel = LogEventLevel.warning;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: RestSinkConfigService, deps: [{ token: Injector }, { token: Injector }, { token: Injector }, { token: Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
41
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: RestSinkConfigService, providedIn: 'root', useFactory: () => new RestSinkConfigService() });
|
|
42
|
-
}
|
|
43
|
-
export { RestSinkConfigService };
|
|
44
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: RestSinkConfigService, decorators: [{
|
|
45
|
-
type: Injectable,
|
|
46
|
-
args: [{ providedIn: 'root', useFactory: () => new RestSinkConfigService() }]
|
|
47
|
-
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
48
|
-
type: Inject,
|
|
49
|
-
args: [Injector]
|
|
50
|
-
}] }, { type: undefined, decorators: [{
|
|
51
|
-
type: Inject,
|
|
52
|
-
args: [Injector]
|
|
53
|
-
}] }, { type: i1.LogEventLevel, decorators: [{
|
|
54
|
-
type: Inject,
|
|
55
|
-
args: [Injector]
|
|
56
|
-
}] }, { type: i1.LogEventLevel, decorators: [{
|
|
57
|
-
type: Inject,
|
|
58
|
-
args: [Injector]
|
|
59
|
-
}] }]; } });
|
|
60
|
-
//# sourceMappingURL=restSinkConfig.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"restSinkConfig.service.js","sourceRoot":"","sources":["../../../../../structured-log/src/services/rest/restSinkConfig.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAC,aAAa,EAAC,MAAM,gBAAgB,CAAC;;;AAE7C;;GAEG;AACH,MACa,qBAAqB;IAWO;IACA;IACA;IACA;IAZrC,iEAAiE;IAEjE;;;;;;OAMG;IACH,YAAqC,mBAA4B,EAC5B,sBAA+B,EAC/B,sBAAsC,EACtC,eAA+B;QAH/B,wBAAmB,GAAnB,mBAAmB,CAAS;QAC5B,2BAAsB,GAAtB,sBAAsB,CAAS;QAC/B,2BAAsB,GAAtB,sBAAsB,CAAgB;QACtC,oBAAe,GAAf,eAAe,CAAgB;QAEhE,IAAG,OAAO,CAAC,mBAAmB,CAAC,EAC/B;YACI,IAAI,CAAC,mBAAmB,GAAG,GAAG,CAAC;SAClC;QAED,IAAG,OAAO,CAAC,sBAAsB,CAAC,EAClC;YACI,IAAI,CAAC,sBAAsB,GAAG,EAAE,CAAC;SACpC;QAED,IAAG,OAAO,CAAC,sBAAsB,CAAC,EAClC;YACI,IAAI,CAAC,sBAAsB,GAAG,aAAa,CAAC,KAAK,CAAC;SACrD;QAED,IAAG,OAAO,CAAC,eAAe,CAAC,EAC3B;YACI,IAAI,CAAC,eAAe,GAAG,aAAa,CAAC,OAAO,CAAC;SAChD;IACL,CAAC;uGAnCQ,qBAAqB,kBAWV,QAAQ,aACR,QAAQ,aACR,QAAQ,aACR,QAAQ;2GAdnB,qBAAqB,cADT,MAAM,cAAc,GAAG,EAAE,CAAC,IAAI,qBAAqB,EAAE;;SACjE,qBAAqB;2FAArB,qBAAqB;kBADjC,UAAU;mBAAC,EAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,2BAA2B,EAAC;;0BAY9D,MAAM;2BAAC,QAAQ;;0BACf,MAAM;2BAAC,QAAQ;;0BACf,MAAM;2BAAC,QAAQ;;0BACf,MAAM;2BAAC,QAAQ","sourcesContent":["import {Injectable, Inject, Injector} from '@angular/core';\nimport {isBlank} from '@jscrpt/common';\nimport {LogEventLevel} from 'structured-log';\n\n/**\n * Service used as configuration for *rest sink*\n */\n@Injectable({providedIn: 'root', useFactory: () => new RestSinkConfigService()})\nexport class RestSinkConfigService\n{\n //######################### constructor #########################\n\n /**\n * Creates instance of `RestSinkConfigService`\n * @param secondsToFlushAfter - Number of seconds after which should be flush called\n * @param flushAfterNumberOfLogs - Number of logs after which should be flush called\n * @param immediateFlushMinLevel - Minimal log level that will be flushed immediately\n * @param restrictToLevel - Minimal log level to be displayed\n */\n constructor(@Inject(Injector) public secondsToFlushAfter?: number,\n @Inject(Injector) public flushAfterNumberOfLogs?: number,\n @Inject(Injector) public immediateFlushMinLevel?: LogEventLevel,\n @Inject(Injector) public restrictToLevel?: LogEventLevel)\n {\n if(isBlank(secondsToFlushAfter))\n {\n this.secondsToFlushAfter = 300;\n }\n\n if(isBlank(flushAfterNumberOfLogs))\n {\n this.flushAfterNumberOfLogs = 50;\n }\n\n if(isBlank(immediateFlushMinLevel))\n {\n this.immediateFlushMinLevel = LogEventLevel.error;\n }\n\n if(isBlank(restrictToLevel))\n {\n this.restrictToLevel = LogEventLevel.warning;\n }\n }\n}"]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { LogEventLevel } from 'structured-log';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
/**
|
|
4
|
-
* Service used as configuration for *rest sink*
|
|
5
|
-
*/
|
|
6
|
-
export declare class RestSinkConfigService {
|
|
7
|
-
secondsToFlushAfter?: number;
|
|
8
|
-
flushAfterNumberOfLogs?: number;
|
|
9
|
-
immediateFlushMinLevel?: LogEventLevel;
|
|
10
|
-
restrictToLevel?: LogEventLevel;
|
|
11
|
-
/**
|
|
12
|
-
* Creates instance of `RestSinkConfigService`
|
|
13
|
-
* @param secondsToFlushAfter - Number of seconds after which should be flush called
|
|
14
|
-
* @param flushAfterNumberOfLogs - Number of logs after which should be flush called
|
|
15
|
-
* @param immediateFlushMinLevel - Minimal log level that will be flushed immediately
|
|
16
|
-
* @param restrictToLevel - Minimal log level to be displayed
|
|
17
|
-
*/
|
|
18
|
-
constructor(secondsToFlushAfter?: number, flushAfterNumberOfLogs?: number, immediateFlushMinLevel?: LogEventLevel, restrictToLevel?: LogEventLevel);
|
|
19
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<RestSinkConfigService, never>;
|
|
20
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<RestSinkConfigService>;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=restSinkConfig.service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"restSinkConfig.service.d.ts","sourceRoot":"","sources":["restSinkConfig.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,aAAa,EAAC,MAAM,gBAAgB,CAAC;;AAE7C;;GAEG;AACH,qBACa,qBAAqB;IAWO,mBAAmB,CAAC,EAAE,MAAM;IAC5B,sBAAsB,CAAC,EAAE,MAAM;IAC/B,sBAAsB,CAAC,EAAE,aAAa;IACtC,eAAe,CAAC,EAAE,aAAa;IAVpE;;;;;;OAMG;gBACkC,mBAAmB,CAAC,EAAE,MAAM,EAC5B,sBAAsB,CAAC,EAAE,MAAM,EAC/B,sBAAsB,CAAC,EAAE,aAAa,EACtC,eAAe,CAAC,EAAE,aAAa;yCAd3D,qBAAqB;6CAArB,qBAAqB;CAoCjC"}
|