@kronos-integration/service-systemd 2.4.9 → 2.5.3

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/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![minified size](https://badgen.net/bundlephobia/min/@kronos-integration/service-systemd)](https://bundlephobia.com/result?p=@kronos-integration/service-systemd)
4
4
  [![downloads](http://img.shields.io/npm/dm/@kronos-integration/service-systemd.svg?style=flat-square)](https://npmjs.org/package/@kronos-integration/service-systemd)
5
5
  [![GitHub Issues](https://img.shields.io/github/issues/Kronos-Integration/service-systemd.svg?style=flat-square)](https://github.com/Kronos-Integration/service-systemd/issues)
6
- [![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2FKronos-Integration%2Fservice-systemd%2Fbadge&style=flat)](https://actions-badge.atrox.dev/Kronos-Integration/service-systemd/goto)
6
+ [![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2FKronos-Integration%2Fservice-systemd%2Fbadge\&style=flat)](https://actions-badge.atrox.dev/Kronos-Integration/service-systemd/goto)
7
7
  [![Styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
8
8
  [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
9
9
  [![Known Vulnerabilities](https://snyk.io/test/github/Kronos-Integration/service-systemd/badge.svg)](https://snyk.io/test/github/Kronos-Integration/service-systemd)
@@ -13,11 +13,11 @@
13
13
 
14
14
  kronos systemd integration
15
15
 
16
- - sync node state to systemd with notify (done)
17
- - propagate config into kronos (done)
18
- - propagate socket activations into kronos (partly)
19
- - start / stop / restart / reload initiated from systemd (partly)
20
- - log into journal (done)
16
+ * sync node state to systemd with notify (done)
17
+ * propagate config into kronos (done)
18
+ * propagate socket activations into kronos (partly)
19
+ * start / stop / restart / reload initiated from systemd (partly)
20
+ * log into journal (done)
21
21
 
22
22
  # usage
23
23
 
@@ -27,14 +27,15 @@ kronos systemd integration
27
27
 
28
28
  ### Table of Contents
29
29
 
30
- - [JournalLogger](#journallogger)
31
- - [FileDescriptor](#filedescriptor)
32
- - [Properties](#properties)
33
- - [SystemdConfig](#systemdconfig)
34
- - [Properties](#properties-1)
35
- - [listeningFileDescriptors](#listeningfiledescriptors)
36
- - [loadConfig](#loadconfig)
37
- - [ServiceSystemd](#servicesystemd)
30
+ * [JournalLogger](#journallogger)
31
+ * [FileDescriptor](#filedescriptor)
32
+ * [Properties](#properties)
33
+ * [SystemdConfig](#systemdconfig)
34
+ * [Properties](#properties-1)
35
+ * [listeningFileDescriptors](#listeningfiledescriptors)
36
+ * [loadConfig](#loadconfig)
37
+ * [ServiceSystemd](#servicesystemd)
38
+ * [endpoints](#endpoints)
38
39
 
39
40
  ## JournalLogger
40
41
 
@@ -48,8 +49,8 @@ Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Globa
48
49
 
49
50
  ### Properties
50
51
 
51
- - `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?**
52
- - `fd` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
52
+ * `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?**
53
+ * `fd` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
53
54
 
54
55
  ## SystemdConfig
55
56
 
@@ -60,13 +61,13 @@ Also injects listeningFileDescriptors into the config
60
61
 
61
62
  ### Properties
62
63
 
63
- - `configurationDirectory` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** taken from CONFIGURATION_DIRECTORY
64
+ * `configurationDirectory` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** taken from CONFIGURATION_DIRECTORY
64
65
 
65
66
  ### listeningFileDescriptors
66
67
 
67
68
  listeningFileDescriptors as passed in LISTEN_FDS and LISTEN_FDNAMES.
68
69
 
69
- Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[FileDescriptor](#filedescriptor)>**
70
+ Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[FileDescriptor](#filedescriptor)>**
70
71
 
71
72
  ### loadConfig
72
73
 
@@ -79,11 +80,19 @@ Additionally pass listeninfFileDescriptions into config.
79
80
 
80
81
  Kronos bridge to systemd:
81
82
 
82
- - sync node state to systemd with notify
83
- - propagate config into kronos world
84
- - propagate socket activations into kronos (partly)
85
- - start / stop / restart / reload initiated from systemd
86
- - log into journal
83
+ * sync node state to systemd with notify
84
+ * propagate config into kronos world
85
+ * propagate socket activations into kronos (partly)
86
+ * start / stop / restart / reload initiated from systemd
87
+ * log into journal
88
+
89
+ ### endpoints
90
+
91
+ Definition of the predefined endpoints.
92
+
93
+ * info *in*
94
+
95
+ Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** predefined endpoints
87
96
 
88
97
  # install
89
98
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kronos-integration/service-systemd",
3
- "version": "2.4.9",
3
+ "version": "2.5.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -24,28 +24,28 @@
24
24
  "license": "BSD-2-Clause",
25
25
  "scripts": {
26
26
  "test": "npm run test:ava",
27
- "test:ava": "ava --timeout 2m tests/*.mjs",
28
- "cover": "c8 -x 'tests/**/*' --temp-directory build/tmp ava --timeout 2m tests/*.mjs && c8 report -r lcov -o build/coverage --temp-directory build/tmp",
29
- "docs": "documentation readme ./src/service.mjs --section=API",
27
+ "test:ava": "ava -s --timeout 2m tests/*.mjs",
28
+ "cover": "c8 -x 'tests/**/*' --temp-directory build/tmp ava -s --timeout 2m tests/*.mjs && c8 report -r lcov -o build/coverage --temp-directory build/tmp",
29
+ "docs": "documentation readme --section=API ./src/**/*.mjs",
30
30
  "lint": "npm run lint:docs",
31
- "lint:docs": "documentation lint ./src/service.mjs",
31
+ "lint:docs": "documentation lint ./src/**/*.mjs",
32
32
  "build": "cmake-js compile"
33
33
  },
34
34
  "dependencies": {
35
- "@kronos-integration/service": "^10.3.10",
35
+ "@kronos-integration/service": "^10.4.11",
36
36
  "config-expander": "^12.0.1"
37
37
  },
38
38
  "devDependencies": {
39
39
  "ava": "^3.15.0",
40
- "c8": "^7.4.0",
41
- "cmake-js": "^6.1.0",
42
- "documentation": "github:arlac77/documentation",
43
- "execa": "^5.0.0",
44
- "node-addon-api": "^3.0.2",
45
- "semantic-release": "^17.3.1"
40
+ "c8": "^7.10.0",
41
+ "cmake-js": "^6.2.1",
42
+ "documentation": "^13.2.5",
43
+ "execa": "^6.0.0",
44
+ "node-addon-api": "^4.0.0",
45
+ "semantic-release": "^18.0.1"
46
46
  },
47
47
  "engines": {
48
- "node": ">=14.15.3"
48
+ "node": ">=16.13.1"
49
49
  },
50
50
  "os": [
51
51
  "linux"
@@ -62,6 +62,7 @@
62
62
  "template": {
63
63
  "inheritFrom": [
64
64
  "arlac77/template-arlac77-github",
65
+ "arlac77/template-cmake",
65
66
  "arlac77/template-kronos-component"
66
67
  ]
67
68
  }
package/src/service.mjs CHANGED
@@ -59,7 +59,7 @@ class SystemdConfig extends ServiceConfig {
59
59
  static get description() {
60
60
  return "Synchronize configuration with systemd";
61
61
  }
62
-
62
+
63
63
  configurationDirectory = process.env.CONFIGURATION_DIRECTORY;
64
64
 
65
65
  /**
@@ -155,6 +155,21 @@ export class ServiceSystemd extends ServiceProviderMixin(
155
155
  return true;
156
156
  }
157
157
 
158
+ /**
159
+ * Definition of the predefined endpoints.
160
+ * - info _in_
161
+ * @return {Object} predefined endpoints
162
+ */
163
+ static get endpoints() {
164
+ return {
165
+ ...super.endpoints,
166
+ info: {
167
+ in: true,
168
+ receive: "details"
169
+ }
170
+ };
171
+ }
172
+
158
173
  async _start() {
159
174
  process.on("warning", warning => this.warn(warning));
160
175
  process.on("SIGINT", () => {
@@ -182,6 +197,17 @@ export class ServiceSystemd extends ServiceProviderMixin(
182
197
  break;
183
198
  }
184
199
  }
200
+
201
+ details()
202
+ {
203
+ return this.toJSONWithOptions({
204
+ includeRuntimeInfo: true,
205
+ includeDefaults: true,
206
+ includeName: true,
207
+ includeConfig: false,
208
+ includePrivate: false
209
+ });
210
+ }
185
211
  }
186
212
 
187
213
  export default ServiceSystemd;
Binary file
Binary file
Binary file