@hkdigital/lib-core 0.3.3 → 0.3.5
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/components/index.d.ts +11 -0
- package/dist/components/index.js +23 -2
- package/dist/{features → components}/presenter/Presenter.svelte +1 -1
- package/dist/logging/index.d.ts +4 -5
- package/dist/logging/index.js +5 -6
- package/dist/logging/{adapters → internal/adapters}/console.js +1 -1
- package/dist/logging/internal/adapters/index.d.ts +2 -0
- package/dist/logging/internal/adapters/index.js +2 -0
- package/dist/logging/{factories → internal/factories}/client.d.ts +1 -1
- package/dist/logging/{factories → internal/factories}/client.js +2 -2
- package/dist/logging/{factories → internal/factories}/server.d.ts +1 -1
- package/dist/logging/{factories → internal/factories}/server.js +2 -2
- package/dist/{classes/logging → logging/internal/unified-logger}/Logger.d.ts +3 -3
- package/dist/{classes/logging → logging/internal/unified-logger}/Logger.js +19 -12
- package/dist/{classes/logging → logging/internal/unified-logger}/constants.d.ts +1 -0
- package/dist/{classes/logging → logging/internal/unified-logger}/constants.js +8 -2
- package/dist/{classes/logging → logging/internal/unified-logger}/index.d.ts +1 -0
- package/dist/{classes/logging → logging/internal/unified-logger}/index.js +2 -0
- package/dist/{components → primitives}/buttons/button/Button.svelte.d.ts +1 -1
- package/dist/{components → primitives}/drag-drop/DropZoneArea.svelte.d.ts +1 -1
- package/dist/primitives/index.d.ts +0 -0
- package/dist/primitives/index.js +2 -0
- package/dist/{components → primitives}/layout/grid-layers/util.js +1 -1
- package/dist/{components → primitives}/rows/panel-grid-row/PanelGridRow.svelte.d.ts +1 -1
- package/dist/{components → primitives}/rows/panel-row-2/PanelRow2.svelte.d.ts +1 -1
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.js +1 -0
- package/dist/services/internal/index.d.ts +6 -0
- package/dist/services/internal/index.js +8 -0
- package/dist/{classes/services → services/internal/service-base}/ServiceBase.d.ts +6 -8
- package/dist/{classes/services → services/internal/service-base}/ServiceBase.js +5 -6
- package/dist/{classes/services/service-states.d.ts → services/internal/service-base/constants.d.ts} +0 -61
- package/dist/{classes/services/service-states.js → services/internal/service-base/constants.js} +0 -95
- package/dist/services/internal/service-base/index.d.ts +3 -0
- package/dist/services/internal/service-base/index.js +3 -0
- package/dist/{classes/services → services/internal/service-base}/typedef.d.ts +34 -147
- package/dist/services/internal/service-base/typedef.js +101 -0
- package/dist/{classes/services → services/internal/service-manager}/ServiceManager.d.ts +8 -9
- package/dist/{classes/services → services/internal/service-manager}/ServiceManager.js +7 -7
- package/dist/services/internal/service-manager/constants.d.ts +4 -0
- package/dist/services/internal/service-manager/constants.js +6 -0
- package/dist/services/internal/service-manager/typedef.d.ts +104 -0
- package/dist/services/internal/service-manager/typedef.js +90 -0
- package/package.json +1 -1
- package/dist/classes/services/index.d.ts +0 -4
- package/dist/classes/services/index.js +0 -5
- package/dist/classes/services/typedef.js +0 -179
- package/dist/features/index.d.ts +0 -11
- package/dist/features/index.js +0 -23
- package/dist/logging/constants.d.ts +0 -1
- package/dist/logging/constants.js +0 -1
- package/dist/server/index.d.ts +0 -1
- package/dist/server/index.js +0 -1
- package/dist/server/logger.d.ts +0 -25
- package/dist/server/logger.js +0 -94
- /package/dist/classes/{events → event-emitter}/EventEmitter.d.ts +0 -0
- /package/dist/classes/{events → event-emitter}/EventEmitter.js +0 -0
- /package/dist/classes/{events → event-emitter}/index.d.ts +0 -0
- /package/dist/classes/{events → event-emitter}/index.js +0 -0
- /package/dist/{features → components}/button-group/ButtonGroup.svelte +0 -0
- /package/dist/{features → components}/button-group/ButtonGroup.svelte.d.ts +0 -0
- /package/dist/{features → components}/button-group/typedef.d.ts +0 -0
- /package/dist/{features → components}/button-group/typedef.js +0 -0
- /package/dist/{features → components}/compare-left-right/CompareLeftRight.svelte +0 -0
- /package/dist/{features → components}/compare-left-right/CompareLeftRight.svelte.d.ts +0 -0
- /package/dist/{features → components}/compare-left-right/index.d.ts +0 -0
- /package/dist/{features → components}/compare-left-right/index.js +0 -0
- /package/dist/{features → components}/game-box/GameBox.svelte +0 -0
- /package/dist/{features → components}/game-box/GameBox.svelte.d.ts +0 -0
- /package/dist/{features → components}/game-box/gamebox.util.d.ts +0 -0
- /package/dist/{features → components}/game-box/gamebox.util.js +0 -0
- /package/dist/{features → components}/hk-app-layout/HkAppLayout.state.svelte.d.ts +0 -0
- /package/dist/{features → components}/hk-app-layout/HkAppLayout.state.svelte.js +0 -0
- /package/dist/{features → components}/hk-app-layout/HkAppLayout.svelte +0 -0
- /package/dist/{features → components}/hk-app-layout/HkAppLayout.svelte.d.ts +0 -0
- /package/dist/{features → components}/image-box/ImageBox.svelte +0 -0
- /package/dist/{features → components}/image-box/ImageBox.svelte.d.ts +0 -0
- /package/dist/{features → components}/image-box/index.d.ts +0 -0
- /package/dist/{features → components}/image-box/index.js +0 -0
- /package/dist/{features → components}/image-box/typedef.d.ts +0 -0
- /package/dist/{features → components}/image-box/typedef.js +0 -0
- /package/dist/{features → components}/presenter/ImageSlide.svelte +0 -0
- /package/dist/{features → components}/presenter/ImageSlide.svelte.d.ts +0 -0
- /package/dist/{features → components}/presenter/Presenter.state.svelte.d.ts +0 -0
- /package/dist/{features → components}/presenter/Presenter.state.svelte.js +0 -0
- /package/dist/{features → components}/presenter/Presenter.svelte.d.ts +0 -0
- /package/dist/{features → components}/presenter/constants.d.ts +0 -0
- /package/dist/{features → components}/presenter/constants.js +0 -0
- /package/dist/{features → components}/presenter/index.d.ts +0 -0
- /package/dist/{features → components}/presenter/index.js +0 -0
- /package/dist/{features → components}/presenter/typedef.d.ts +0 -0
- /package/dist/{features → components}/presenter/typedef.js +0 -0
- /package/dist/{features → components}/presenter/util.d.ts +0 -0
- /package/dist/{features → components}/presenter/util.js +0 -0
- /package/dist/{features → components}/virtual-viewport/VirtualViewport.svelte +0 -0
- /package/dist/{features → components}/virtual-viewport/VirtualViewport.svelte.d.ts +0 -0
- /package/dist/logging/{adapters → internal/adapters}/console.d.ts +0 -0
- /package/dist/logging/{adapters → internal/adapters}/pino.d.ts +0 -0
- /package/dist/logging/{adapters → internal/adapters}/pino.js +0 -0
- /package/dist/logging/{factories → internal/factories}/universal.d.ts +0 -0
- /package/dist/logging/{factories → internal/factories}/universal.js +0 -0
- /package/dist/{classes/logging → logging/internal/unified-logger}/typedef.d.ts +0 -0
- /package/dist/{classes/logging → logging/internal/unified-logger}/typedef.js +0 -0
- /package/dist/{components → primitives}/area/HkArea.svelte +0 -0
- /package/dist/{components → primitives}/area/HkArea.svelte.d.ts +0 -0
- /package/dist/{components → primitives}/area/HkGridArea.svelte +0 -0
- /package/dist/{components → primitives}/area/HkGridArea.svelte.d.ts +0 -0
- /package/dist/{components → primitives}/area/index.d.ts +0 -0
- /package/dist/{components → primitives}/area/index.js +0 -0
- /package/dist/{components → primitives}/buttons/button/Button.svelte +0 -0
- /package/dist/{components → primitives}/buttons/button-icon-steeze/SteezeIconButton.svelte +0 -0
- /package/dist/{components → primitives}/buttons/button-icon-steeze/SteezeIconButton.svelte.d.ts +0 -0
- /package/dist/{components → primitives}/buttons/button-text/TextButton.svelte +0 -0
- /package/dist/{components → primitives}/buttons/button-text/TextButton.svelte.d.ts +0 -0
- /package/dist/{components → primitives}/buttons/index.d.ts +0 -0
- /package/dist/{components → primitives}/buttons/index.js +0 -0
- /package/dist/{components → primitives}/debug/debug-panel-design-scaling/DebugPanelDesignScaling.svelte +0 -0
- /package/dist/{components → primitives}/debug/debug-panel-design-scaling/DebugPanelDesignScaling.svelte.d.ts +0 -0
- /package/dist/{components → primitives}/debug/index.d.ts +0 -0
- /package/dist/{components → primitives}/debug/index.js +0 -0
- /package/dist/{components → primitives}/drag-drop/DragController.d.ts +0 -0
- /package/dist/{components → primitives}/drag-drop/DragController.js +0 -0
- /package/dist/{components → primitives}/drag-drop/DragDropContext.svelte +0 -0
- /package/dist/{components → primitives}/drag-drop/DragDropContext.svelte.d.ts +0 -0
- /package/dist/{components → primitives}/drag-drop/Draggable.svelte +0 -0
- /package/dist/{components → primitives}/drag-drop/Draggable.svelte.d.ts +0 -0
- /package/dist/{components → primitives}/drag-drop/DropZone.svelte +0 -0
- /package/dist/{components → primitives}/drag-drop/DropZone.svelte.d.ts +0 -0
- /package/dist/{components → primitives}/drag-drop/DropZoneArea.svelte +0 -0
- /package/dist/{components → primitives}/drag-drop/DropZoneList.svelte +0 -0
- /package/dist/{components → primitives}/drag-drop/DropZoneList.svelte.d.ts +0 -0
- /package/dist/{components → primitives}/drag-drop/actions.d.ts +0 -0
- /package/dist/{components → primitives}/drag-drop/actions.js +0 -0
- /package/dist/{components → primitives}/drag-drop/drag-state.svelte.d.ts +0 -0
- /package/dist/{components → primitives}/drag-drop/drag-state.svelte.js +0 -0
- /package/dist/{components → primitives}/drag-drop/index.d.ts +0 -0
- /package/dist/{components → primitives}/drag-drop/index.js +0 -0
- /package/dist/{components → primitives}/drag-drop/util.d.ts +0 -0
- /package/dist/{components → primitives}/drag-drop/util.js +0 -0
- /package/dist/{components → primitives}/hkdev/blocks/TextBlock.svelte +0 -0
- /package/dist/{components → primitives}/hkdev/blocks/TextBlock.svelte.d.ts +0 -0
- /package/dist/{components → primitives}/hkdev/buttons/CheckButton.svelte +0 -0
- /package/dist/{components → primitives}/hkdev/buttons/CheckButton.svelte.d.ts +0 -0
- /package/dist/{components → primitives}/icons/HkIcon.svelte +0 -0
- /package/dist/{components → primitives}/icons/HkIcon.svelte.d.ts +0 -0
- /package/dist/{components → primitives}/icons/HkTabIcon.svelte +0 -0
- /package/dist/{components → primitives}/icons/HkTabIcon.svelte.d.ts +0 -0
- /package/dist/{components → primitives}/icons/SteezeIcon.svelte +0 -0
- /package/dist/{components → primitives}/icons/SteezeIcon.svelte.d.ts +0 -0
- /package/dist/{components → primitives}/icons/index.d.ts +0 -0
- /package/dist/{components → primitives}/icons/index.js +0 -0
- /package/dist/{components → primitives}/icons/typedef.d.ts +0 -0
- /package/dist/{components → primitives}/icons/typedef.js +0 -0
- /package/dist/{components → primitives}/inputs/index.d.ts +0 -0
- /package/dist/{components → primitives}/inputs/index.js +0 -0
- /package/dist/{components → primitives}/inputs/text-input/TestTextInput.svelte__ +0 -0
- /package/dist/{components → primitives}/inputs/text-input/TextInput.svelte +0 -0
- /package/dist/{components → primitives}/inputs/text-input/TextInput.svelte.d.ts +0 -0
- /package/dist/{components → primitives}/inputs/text-input/TextInput.svelte___ +0 -0
- /package/dist/{components → primitives}/inputs/text-input/assets/IconInvalid.svelte +0 -0
- /package/dist/{components → primitives}/inputs/text-input/assets/IconInvalid.svelte.d.ts +0 -0
- /package/dist/{components → primitives}/inputs/text-input/assets/IconValid.svelte +0 -0
- /package/dist/{components → primitives}/inputs/text-input/assets/IconValid.svelte.d.ts +0 -0
- /package/dist/{components → primitives}/layout/grid-layers/GridLayers.svelte +0 -0
- /package/dist/{components → primitives}/layout/grid-layers/GridLayers.svelte.d.ts +0 -0
- /package/dist/{components → primitives}/layout/grid-layers/GridLayers.svelte__heightFrom__ +0 -0
- /package/dist/{components → primitives}/layout/grid-layers/util.d.ts +0 -0
- /package/dist/{components → primitives}/layout/index.d.ts +0 -0
- /package/dist/{components → primitives}/layout/index.js +0 -0
- /package/dist/{components → primitives}/panels/index.d.ts +0 -0
- /package/dist/{components → primitives}/panels/index.js +0 -0
- /package/dist/{components → primitives}/panels/panel/Panel.svelte +0 -0
- /package/dist/{components → primitives}/panels/panel/Panel.svelte.d.ts +0 -0
- /package/dist/{components → primitives}/rows/index.d.ts +0 -0
- /package/dist/{components → primitives}/rows/index.js +0 -0
- /package/dist/{components → primitives}/rows/panel-grid-row/PanelGridRow.svelte +0 -0
- /package/dist/{components → primitives}/rows/panel-row-2/PanelRow2.svelte +0 -0
- /package/dist/{components → primitives}/tab-bar/HkTabBar.state.svelte.d.ts +0 -0
- /package/dist/{components → primitives}/tab-bar/HkTabBar.state.svelte.js +0 -0
- /package/dist/{components → primitives}/tab-bar/HkTabBar.svelte +0 -0
- /package/dist/{components → primitives}/tab-bar/HkTabBar.svelte.d.ts +0 -0
- /package/dist/{components → primitives}/tab-bar/HkTabBarSelector.state.svelte.d.ts +0 -0
- /package/dist/{components → primitives}/tab-bar/HkTabBarSelector.state.svelte.js +0 -0
- /package/dist/{components → primitives}/tab-bar/HkTabBarSelector.svelte +0 -0
- /package/dist/{components → primitives}/tab-bar/HkTabBarSelector.svelte.d.ts +0 -0
- /package/dist/{components → primitives}/tab-bar/index.d.ts +0 -0
- /package/dist/{components → primitives}/tab-bar/index.js +0 -0
- /package/dist/{components → primitives}/tab-bar/typedef.d.ts +0 -0
- /package/dist/{components → primitives}/tab-bar/typedef.js +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { default as ButtonGroup } from "./button-group/ButtonGroup.svelte";
|
|
2
|
+
export { default as CompareLeftRight } from "./compare-left-right/CompareLeftRight.svelte";
|
|
3
|
+
export { default as GameBox } from "./game-box/GameBox.svelte";
|
|
4
|
+
export { default as HkAppLayout } from "./hk-app-layout/HkAppLayout.svelte";
|
|
5
|
+
export { default as ImageBox } from "./image-box/ImageBox.svelte";
|
|
6
|
+
export { default as Presenter } from "./presenter/Presenter.svelte";
|
|
7
|
+
export { default as ImageSlide } from "./presenter/ImageSlide.svelte";
|
|
8
|
+
export { default as VirtualViewport } from "./virtual-viewport/VirtualViewport.svelte";
|
|
9
|
+
export * from "./button-group/typedef.js";
|
|
10
|
+
export * from "./presenter/typedef.js";
|
|
11
|
+
export { createOrGetState as createOrGetAppLayoutState, createState as createAppLayoutState, getState as getAppLayoutState } from "./hk-app-layout/HkAppLayout.state.svelte.js";
|
package/dist/components/index.js
CHANGED
|
@@ -1,2 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export { default as ButtonGroup } from './button-group/ButtonGroup.svelte';
|
|
2
|
+
export { default as CompareLeftRight } from './compare-left-right/CompareLeftRight.svelte';
|
|
3
|
+
export { default as GameBox } from './game-box/GameBox.svelte';
|
|
4
|
+
|
|
5
|
+
export {
|
|
6
|
+
createOrGetState as createOrGetAppLayoutState,
|
|
7
|
+
createState as createAppLayoutState,
|
|
8
|
+
getState as getAppLayoutState
|
|
9
|
+
} from './hk-app-layout/HkAppLayout.state.svelte.js';
|
|
10
|
+
|
|
11
|
+
export { default as HkAppLayout } from './hk-app-layout/HkAppLayout.svelte';
|
|
12
|
+
|
|
13
|
+
export { default as ImageBox } from './image-box/ImageBox.svelte';
|
|
14
|
+
|
|
15
|
+
export { default as Presenter } from './presenter/Presenter.svelte';
|
|
16
|
+
export { default as ImageSlide } from './presenter/ImageSlide.svelte';
|
|
17
|
+
|
|
18
|
+
export { default as VirtualViewport } from './virtual-viewport/VirtualViewport.svelte';
|
|
19
|
+
|
|
20
|
+
// > Types
|
|
21
|
+
|
|
22
|
+
export * from './button-group/typedef.js';
|
|
23
|
+
export * from './presenter/typedef.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { onMount } from 'svelte';
|
|
3
3
|
|
|
4
|
-
import { GridLayers } from '../../
|
|
4
|
+
import { GridLayers } from '../../primitives/layout/index.js';
|
|
5
5
|
|
|
6
6
|
import { PresenterState } from './Presenter.state.svelte.js';
|
|
7
7
|
import { cssBefore, cssDuring, waitForRender } from './util.js';
|
package/dist/logging/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export { createServerLogger } from "./factories/server.js";
|
|
2
|
-
export { createClientLogger } from "./factories/client.js";
|
|
3
|
-
export { createLogger } from "./factories/universal.js";
|
|
4
|
-
export * from "
|
|
5
|
-
export { DEBUG, INFO, WARN, ERROR, NONE, LEVELS } from "./constants.js";
|
|
1
|
+
export { createServerLogger } from "./internal/factories/server.js";
|
|
2
|
+
export { createClientLogger } from "./internal/factories/client.js";
|
|
3
|
+
export { createLogger } from "./internal/factories/universal.js";
|
|
4
|
+
export * from "./internal/unified-logger/index.js";
|
package/dist/logging/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
export { DEBUG, INFO, WARN, ERROR, NONE, LEVELS } from './constants.js';
|
|
2
|
-
|
|
3
1
|
// Factories
|
|
4
|
-
export { createServerLogger } from './factories/server.js';
|
|
5
|
-
export { createClientLogger } from './factories/client.js';
|
|
6
|
-
export { createLogger } from './factories/universal.js';
|
|
2
|
+
export { createServerLogger } from './internal/factories/server.js';
|
|
3
|
+
export { createClientLogger } from './internal/factories/client.js';
|
|
4
|
+
export { createLogger } from './internal/factories/universal.js';
|
|
7
5
|
|
|
8
|
-
|
|
6
|
+
// Logger, constants and typedefs
|
|
7
|
+
export * from './internal/unified-logger/index.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Logger } from '
|
|
1
|
+
import { Logger } from '../unified-logger';
|
|
2
2
|
import { ConsoleAdapter } from '../adapters/console.js';
|
|
3
|
-
import { INFO } from '../constants.js';
|
|
3
|
+
import { INFO } from '../unified-logger/constants.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Create a client-side logger with console adapter
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Logger } from '
|
|
1
|
+
import { Logger } from '../unified-logger';
|
|
2
2
|
|
|
3
3
|
import { PinoAdapter } from '../adapters/pino.js';
|
|
4
|
-
import { INFO } from '../constants.js';
|
|
4
|
+
import { INFO } from '../unified-logger/constants.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Create a server-side logger with pino adapter
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Logger class for consistent logging
|
|
2
|
+
* Logger class for consistent logging
|
|
3
3
|
* @extends EventEmitter
|
|
4
4
|
*/
|
|
5
5
|
export default class Logger extends EventEmitter {
|
|
@@ -64,7 +64,7 @@ export default class Logger extends EventEmitter {
|
|
|
64
64
|
*/
|
|
65
65
|
context(namespace: string, additionalContext: any): Logger;
|
|
66
66
|
/**
|
|
67
|
-
* Log an
|
|
67
|
+
* Log an LogEvent emitted by an event emitter
|
|
68
68
|
*
|
|
69
69
|
* E.g. an event that was created by another Logger instance and should be
|
|
70
70
|
* forwarded to this logger.
|
|
@@ -75,4 +75,4 @@ export default class Logger extends EventEmitter {
|
|
|
75
75
|
logFromEvent(eventName: string, eventData: import("./typedef.js").LogEventData): boolean;
|
|
76
76
|
#private;
|
|
77
77
|
}
|
|
78
|
-
import { EventEmitter } from '
|
|
78
|
+
import { EventEmitter } from '../../../classes/event-emitter';
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* // Basic usage
|
|
11
|
-
* import { Logger, INFO, DEBUG } from '
|
|
11
|
+
* import { Logger, LOG, INFO, DEBUG } from '@hkdigital/lib-core/logger/index.js';
|
|
12
12
|
*
|
|
13
13
|
* const logger = new Logger('myService', INFO);
|
|
14
14
|
*
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* logger.warn('Unusual condition detected'); // Will be logged
|
|
19
19
|
*
|
|
20
20
|
* // Listen to log events
|
|
21
|
-
* logger.on(
|
|
21
|
+
* logger.on(LOG, (logEvent) => {
|
|
22
22
|
* // Process all log events
|
|
23
23
|
* saveToLogFile(logEvent);
|
|
24
24
|
* });
|
|
@@ -32,12 +32,19 @@
|
|
|
32
32
|
* logger.setLevel(DEBUG); // Now debug messages will also be logged
|
|
33
33
|
*/
|
|
34
34
|
|
|
35
|
-
import { EventEmitter } from '
|
|
35
|
+
import { EventEmitter } from '../../../classes/event-emitter';
|
|
36
36
|
|
|
37
|
-
import {
|
|
37
|
+
import {
|
|
38
|
+
DEBUG,
|
|
39
|
+
INFO,
|
|
40
|
+
WARN,
|
|
41
|
+
ERROR,
|
|
42
|
+
LEVELS,
|
|
43
|
+
LOG
|
|
44
|
+
} from './constants.js';
|
|
38
45
|
|
|
39
46
|
/**
|
|
40
|
-
* Logger class for consistent logging
|
|
47
|
+
* Logger class for consistent logging
|
|
41
48
|
* @extends EventEmitter
|
|
42
49
|
*/
|
|
43
50
|
export default class Logger extends EventEmitter {
|
|
@@ -131,7 +138,7 @@ export default class Logger extends EventEmitter {
|
|
|
131
138
|
* @returns {Logger} New logger instance with merged context
|
|
132
139
|
*/
|
|
133
140
|
context(namespace, additionalContext) {
|
|
134
|
-
if(
|
|
141
|
+
if (typeof namespace !== 'string') {
|
|
135
142
|
throw new Error('Invalid namespace');
|
|
136
143
|
}
|
|
137
144
|
|
|
@@ -144,7 +151,7 @@ export default class Logger extends EventEmitter {
|
|
|
144
151
|
}
|
|
145
152
|
|
|
146
153
|
/**
|
|
147
|
-
* Log an
|
|
154
|
+
* Log an LogEvent emitted by an event emitter
|
|
148
155
|
*
|
|
149
156
|
* E.g. an event that was created by another Logger instance and should be
|
|
150
157
|
* forwarded to this logger.
|
|
@@ -152,7 +159,7 @@ export default class Logger extends EventEmitter {
|
|
|
152
159
|
* @param {string} eventName
|
|
153
160
|
* @param {import('./typedef.js').LogEventData} eventData
|
|
154
161
|
*/
|
|
155
|
-
logFromEvent(
|
|
162
|
+
logFromEvent(eventName, eventData) {
|
|
156
163
|
const level = eventData.level;
|
|
157
164
|
|
|
158
165
|
// Check if this log level should be filtered
|
|
@@ -160,7 +167,7 @@ export default class Logger extends EventEmitter {
|
|
|
160
167
|
return false; // Below threshold, don't emit
|
|
161
168
|
}
|
|
162
169
|
|
|
163
|
-
this.#logEvent(
|
|
170
|
+
this.#logEvent({ ...eventData, eventName });
|
|
164
171
|
}
|
|
165
172
|
|
|
166
173
|
/**
|
|
@@ -188,9 +195,9 @@ export default class Logger extends EventEmitter {
|
|
|
188
195
|
details: details ?? null
|
|
189
196
|
};
|
|
190
197
|
|
|
191
|
-
// Emit as both specific level event and generic
|
|
198
|
+
// Emit as both specific level event and generic LOG event
|
|
192
199
|
this.emit(level, logEvent);
|
|
193
|
-
this.emit(
|
|
200
|
+
this.emit(LOG, logEvent);
|
|
194
201
|
|
|
195
202
|
return true;
|
|
196
203
|
}
|
|
@@ -203,7 +210,7 @@ export default class Logger extends EventEmitter {
|
|
|
203
210
|
#logEvent(logEvent) {
|
|
204
211
|
// Emit as both specific level event and generic 'log' event
|
|
205
212
|
this.emit(logEvent.level, logEvent);
|
|
206
|
-
this.emit(
|
|
213
|
+
this.emit(LOG, logEvent);
|
|
207
214
|
|
|
208
215
|
return true;
|
|
209
216
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
|
|
2
|
-
// Log level names
|
|
2
|
+
// Log level and log event names
|
|
3
3
|
export const DEBUG = 'debug';
|
|
4
4
|
export const INFO = 'info';
|
|
5
5
|
export const WARN = 'warn';
|
|
6
6
|
export const ERROR = 'error';
|
|
7
|
+
|
|
8
|
+
// Use NONE to set log level to disable all logging
|
|
7
9
|
export const NONE = 'none';
|
|
8
10
|
|
|
9
11
|
// Level values for filtering (higher = more important)
|
|
@@ -12,5 +14,9 @@ export const LEVELS = {
|
|
|
12
14
|
[INFO]: 2,
|
|
13
15
|
[WARN]: 3,
|
|
14
16
|
[ERROR]: 4,
|
|
15
|
-
[NONE]:
|
|
17
|
+
[NONE]: 5
|
|
16
18
|
};
|
|
19
|
+
|
|
20
|
+
// Event name for generic events
|
|
21
|
+
export const LOG = 'log';
|
|
22
|
+
|
|
@@ -41,4 +41,4 @@ declare const Button: import("svelte").Component<{
|
|
|
41
41
|
snippetLoading?: import("svelte").Snippet;
|
|
42
42
|
snippetError?: import("svelte").Snippet;
|
|
43
43
|
children: import("svelte").Snippet;
|
|
44
|
-
}, {}, "error" | "loading" | "
|
|
44
|
+
}, {}, "error" | "loading" | "selected" | "disabled" | "active">;
|
|
@@ -9,7 +9,7 @@ type DropZoneArea = {
|
|
|
9
9
|
accepts?: (item: any) => boolean;
|
|
10
10
|
fillContainer?: boolean;
|
|
11
11
|
aspectRatio?: string;
|
|
12
|
-
overflow?: "scroll" | "auto" | "
|
|
12
|
+
overflow?: "scroll" | "auto" | "visible" | "hidden";
|
|
13
13
|
base?: string;
|
|
14
14
|
classes?: string;
|
|
15
15
|
children?: Snippet<[]>;
|
|
File without changes
|
|
@@ -4,7 +4,7 @@ type PanelGridRow = {
|
|
|
4
4
|
$set?(props: Partial<{
|
|
5
5
|
base?: string;
|
|
6
6
|
bg?: string;
|
|
7
|
-
justify?: "center" | "start" | "end" | "between" | "around" | "evenly" | "stretch"
|
|
7
|
+
justify?: "center" | "normal" | "start" | "end" | "between" | "around" | "evenly" | "stretch";
|
|
8
8
|
justifyItems?: "center" | "start" | "end" | "stretch";
|
|
9
9
|
gap?: string;
|
|
10
10
|
classes?: string;
|
|
@@ -4,7 +4,7 @@ type PanelRow2 = {
|
|
|
4
4
|
$set?(props: Partial<{
|
|
5
5
|
base?: string;
|
|
6
6
|
bg?: string;
|
|
7
|
-
justify?: "center" | "start" | "end" | "between" | "around" | "evenly" | "stretch"
|
|
7
|
+
justify?: "center" | "normal" | "start" | "end" | "between" | "around" | "evenly" | "stretch";
|
|
8
8
|
justifyItems?: "center" | "start" | "end" | "stretch";
|
|
9
9
|
gap?: string;
|
|
10
10
|
classes?: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./internal/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './internal/index.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as ServiceBase } from "./service-base/ServiceBase.js";
|
|
2
|
+
export { default as ServiceManager } from "./service-manager/ServiceManager.js";
|
|
3
|
+
export * from "./service-base/constants.js";
|
|
4
|
+
export * from "./service-manager/constants.js";
|
|
5
|
+
export * from "./service-base/typedef.js";
|
|
6
|
+
export * from "./service-manager/typedef.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as ServiceBase } from './service-base/ServiceBase.js';
|
|
2
|
+
export { default as ServiceManager } from './service-manager/ServiceManager.js';
|
|
3
|
+
|
|
4
|
+
export * from './service-base/constants.js';
|
|
5
|
+
export * from './service-manager/constants.js';
|
|
6
|
+
|
|
7
|
+
export * from './service-base/typedef.js';
|
|
8
|
+
export * from './service-manager/typedef.js';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef {import('./typedef.js').ServiceConfig} ServiceConfig
|
|
3
2
|
* @typedef {import('./typedef.js').ServiceOptions} ServiceOptions
|
|
4
3
|
* @typedef {import('./typedef.js').StopOptions} StopOptions
|
|
5
4
|
* @typedef {import('./typedef.js').HealthStatus} HealthStatus
|
|
@@ -34,11 +33,11 @@ export class ServiceBase extends EventEmitter {
|
|
|
34
33
|
/**
|
|
35
34
|
* Initialize the service with configuration
|
|
36
35
|
*
|
|
37
|
-
* @param {
|
|
36
|
+
* @param {*} [config={}] - Service-specific configuration
|
|
38
37
|
*
|
|
39
38
|
* @returns {Promise<boolean>} True if initialization succeeded
|
|
40
39
|
*/
|
|
41
|
-
initialize(config?:
|
|
40
|
+
initialize(config?: any): Promise<boolean>;
|
|
42
41
|
/**
|
|
43
42
|
* Start the service
|
|
44
43
|
*
|
|
@@ -83,11 +82,11 @@ export class ServiceBase extends EventEmitter {
|
|
|
83
82
|
* Initialize the service (override in subclass)
|
|
84
83
|
*
|
|
85
84
|
* @protected
|
|
86
|
-
* @param {
|
|
85
|
+
* @param {*} config - Service configuration
|
|
87
86
|
*
|
|
88
87
|
* @returns {Promise<void>}
|
|
89
88
|
*/
|
|
90
|
-
protected _init(config:
|
|
89
|
+
protected _init(config: any): Promise<void>;
|
|
91
90
|
/**
|
|
92
91
|
* Start the service (override in subclass)
|
|
93
92
|
*
|
|
@@ -152,12 +151,11 @@ export class ServiceBase extends EventEmitter {
|
|
|
152
151
|
private _setError;
|
|
153
152
|
}
|
|
154
153
|
export default ServiceBase;
|
|
155
|
-
export type ServiceConfig = import("./typedef.js").ServiceConfig;
|
|
156
154
|
export type ServiceOptions = import("./typedef.js").ServiceOptions;
|
|
157
155
|
export type StopOptions = import("./typedef.js").StopOptions;
|
|
158
156
|
export type HealthStatus = import("./typedef.js").HealthStatus;
|
|
159
157
|
export type StateChangeEvent = import("./typedef.js").StateChangeEvent;
|
|
160
158
|
export type HealthChangeEvent = import("./typedef.js").HealthChangeEvent;
|
|
161
159
|
export type ServiceErrorEvent = import("./typedef.js").ServiceErrorEvent;
|
|
162
|
-
import { EventEmitter } from '
|
|
163
|
-
import { Logger } from '
|
|
160
|
+
import { EventEmitter } from '../../../classes/event-emitter';
|
|
161
|
+
import { Logger } from '../../../logging/internal/unified-logger';
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
* }
|
|
51
51
|
*/
|
|
52
52
|
|
|
53
|
-
import { EventEmitter } from '
|
|
54
|
-
import { Logger, INFO } from '
|
|
53
|
+
import { EventEmitter } from '../../../classes/event-emitter';
|
|
54
|
+
import { Logger, INFO } from '../../../logging/internal/unified-logger';
|
|
55
55
|
|
|
56
56
|
import {
|
|
57
57
|
CREATED,
|
|
@@ -65,10 +65,9 @@ import {
|
|
|
65
65
|
DESTROYED,
|
|
66
66
|
ERROR as ERROR_STATE,
|
|
67
67
|
RECOVERING
|
|
68
|
-
} from './
|
|
68
|
+
} from './constants.js';
|
|
69
69
|
|
|
70
70
|
/**
|
|
71
|
-
* @typedef {import('./typedef.js').ServiceConfig} ServiceConfig
|
|
72
71
|
* @typedef {import('./typedef.js').ServiceOptions} ServiceOptions
|
|
73
72
|
* @typedef {import('./typedef.js').StopOptions} StopOptions
|
|
74
73
|
* @typedef {import('./typedef.js').HealthStatus} HealthStatus
|
|
@@ -113,7 +112,7 @@ export class ServiceBase extends EventEmitter {
|
|
|
113
112
|
/**
|
|
114
113
|
* Initialize the service with configuration
|
|
115
114
|
*
|
|
116
|
-
* @param {
|
|
115
|
+
* @param {*} [config={}] - Service-specific configuration
|
|
117
116
|
*
|
|
118
117
|
* @returns {Promise<boolean>} True if initialization succeeded
|
|
119
118
|
*/
|
|
@@ -335,7 +334,7 @@ export class ServiceBase extends EventEmitter {
|
|
|
335
334
|
* Initialize the service (override in subclass)
|
|
336
335
|
*
|
|
337
336
|
* @protected
|
|
338
|
-
* @param {
|
|
337
|
+
* @param {*} config - Service configuration
|
|
339
338
|
*
|
|
340
339
|
* @returns {Promise<void>}
|
|
341
340
|
*/
|
package/dist/{classes/services/service-states.d.ts → services/internal/service-base/constants.d.ts}
RENAMED
|
@@ -1,36 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Check if a state transition is valid
|
|
3
|
-
*
|
|
4
|
-
* @param {string} fromState - Current state
|
|
5
|
-
* @param {string} toState - Desired state
|
|
6
|
-
*
|
|
7
|
-
* @returns {boolean} True if transition is valid
|
|
8
|
-
*/
|
|
9
|
-
export function isValidTransition(fromState: string, toState: string): boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Check if a service is in an operational state
|
|
12
|
-
*
|
|
13
|
-
* @param {string} state - Current state
|
|
14
|
-
*
|
|
15
|
-
* @returns {boolean} True if operational
|
|
16
|
-
*/
|
|
17
|
-
export function isOperational(state: string): boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Check if a service is in a transitional state
|
|
20
|
-
*
|
|
21
|
-
* @param {string} state - Current state
|
|
22
|
-
*
|
|
23
|
-
* @returns {boolean} True if transitioning
|
|
24
|
-
*/
|
|
25
|
-
export function isTransitioning(state: string): boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Check if a service is in an inactive state
|
|
28
|
-
*
|
|
29
|
-
* @param {string} state - Current state
|
|
30
|
-
*
|
|
31
|
-
* @returns {boolean} True if inactive
|
|
32
|
-
*/
|
|
33
|
-
export function isInactive(state: string): boolean;
|
|
34
1
|
/**
|
|
35
2
|
* @fileoverview Service state constants for the service management system.
|
|
36
3
|
*
|
|
@@ -129,31 +96,3 @@ export const ERROR: "error";
|
|
|
129
96
|
* @const {string}
|
|
130
97
|
*/
|
|
131
98
|
export const RECOVERING: "recovering";
|
|
132
|
-
export namespace VALID_TRANSITIONS {
|
|
133
|
-
let created: string[];
|
|
134
|
-
let initializing: string[];
|
|
135
|
-
let initialized: string[];
|
|
136
|
-
let starting: string[];
|
|
137
|
-
let running: string[];
|
|
138
|
-
let stopping: string[];
|
|
139
|
-
let stopped: string[];
|
|
140
|
-
let destroying: string[];
|
|
141
|
-
let destroyed: string[];
|
|
142
|
-
let error: string[];
|
|
143
|
-
let recovering: string[];
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* States that indicate the service is operational
|
|
147
|
-
* @const {string[]}
|
|
148
|
-
*/
|
|
149
|
-
export const OPERATIONAL_STATES: string[];
|
|
150
|
-
/**
|
|
151
|
-
* States that indicate the service is transitioning
|
|
152
|
-
* @const {string[]}
|
|
153
|
-
*/
|
|
154
|
-
export const TRANSITIONAL_STATES: string[];
|
|
155
|
-
/**
|
|
156
|
-
* States that indicate the service is not operational
|
|
157
|
-
* @const {string[]}
|
|
158
|
-
*/
|
|
159
|
-
export const INACTIVE_STATES: string[];
|
package/dist/{classes/services/service-states.js → services/internal/service-base/constants.js}
RENAMED
|
@@ -108,98 +108,3 @@ export const ERROR = 'error';
|
|
|
108
108
|
* @const {string}
|
|
109
109
|
*/
|
|
110
110
|
export const RECOVERING = 'recovering';
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Valid state transitions map
|
|
114
|
-
* Maps each state to the states it can transition to
|
|
115
|
-
* @const {Object<string, string[]>}
|
|
116
|
-
*/
|
|
117
|
-
export const VALID_TRANSITIONS = {
|
|
118
|
-
[CREATED]: [INITIALIZING, DESTROYING],
|
|
119
|
-
[INITIALIZING]: [INITIALIZED, ERROR, DESTROYING],
|
|
120
|
-
[INITIALIZED]: [STARTING, DESTROYING],
|
|
121
|
-
[STARTING]: [RUNNING, ERROR, STOPPING],
|
|
122
|
-
[RUNNING]: [STOPPING, ERROR],
|
|
123
|
-
[STOPPING]: [STOPPED, ERROR],
|
|
124
|
-
[STOPPED]: [STARTING, DESTROYING, INITIALIZING],
|
|
125
|
-
[DESTROYING]: [DESTROYED, ERROR],
|
|
126
|
-
[DESTROYED]: [CREATED], // Can be recreated
|
|
127
|
-
[ERROR]: [RECOVERING, STOPPING, DESTROYING],
|
|
128
|
-
[RECOVERING]: [RUNNING, STOPPED, ERROR]
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* States that indicate the service is operational
|
|
133
|
-
* @const {string[]}
|
|
134
|
-
*/
|
|
135
|
-
export const OPERATIONAL_STATES = [RUNNING];
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* States that indicate the service is transitioning
|
|
139
|
-
* @const {string[]}
|
|
140
|
-
*/
|
|
141
|
-
export const TRANSITIONAL_STATES = [
|
|
142
|
-
INITIALIZING,
|
|
143
|
-
STARTING,
|
|
144
|
-
STOPPING,
|
|
145
|
-
DESTROYING,
|
|
146
|
-
RECOVERING
|
|
147
|
-
];
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* States that indicate the service is not operational
|
|
151
|
-
* @const {string[]}
|
|
152
|
-
*/
|
|
153
|
-
export const INACTIVE_STATES = [
|
|
154
|
-
CREATED,
|
|
155
|
-
INITIALIZED,
|
|
156
|
-
STOPPED,
|
|
157
|
-
DESTROYED,
|
|
158
|
-
ERROR
|
|
159
|
-
];
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Check if a state transition is valid
|
|
163
|
-
*
|
|
164
|
-
* @param {string} fromState - Current state
|
|
165
|
-
* @param {string} toState - Desired state
|
|
166
|
-
*
|
|
167
|
-
* @returns {boolean} True if transition is valid
|
|
168
|
-
*/
|
|
169
|
-
export function isValidTransition(fromState, toState) {
|
|
170
|
-
const validStates = VALID_TRANSITIONS[fromState];
|
|
171
|
-
return validStates ? validStates.includes(toState) : false;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* Check if a service is in an operational state
|
|
176
|
-
*
|
|
177
|
-
* @param {string} state - Current state
|
|
178
|
-
*
|
|
179
|
-
* @returns {boolean} True if operational
|
|
180
|
-
*/
|
|
181
|
-
export function isOperational(state) {
|
|
182
|
-
return OPERATIONAL_STATES.includes(state);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* Check if a service is in a transitional state
|
|
187
|
-
*
|
|
188
|
-
* @param {string} state - Current state
|
|
189
|
-
*
|
|
190
|
-
* @returns {boolean} True if transitioning
|
|
191
|
-
*/
|
|
192
|
-
export function isTransitioning(state) {
|
|
193
|
-
return TRANSITIONAL_STATES.includes(state);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* Check if a service is in an inactive state
|
|
198
|
-
*
|
|
199
|
-
* @param {string} state - Current state
|
|
200
|
-
*
|
|
201
|
-
* @returns {boolean} True if inactive
|
|
202
|
-
*/
|
|
203
|
-
export function isInactive(state) {
|
|
204
|
-
return INACTIVE_STATES.includes(state);
|
|
205
|
-
}
|