@kronos-integration/service 15.1.1 → 15.1.2
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 +3 -7
- package/package.json +11 -11
- package/src/service-config.mjs +1 -3
- package/src/service.mjs +9 -7
- package/types/service-config.d.mts +1 -0
- package/types/service.d.mts +16 -8
package/README.md
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
[](https://www.npmjs.com/package/@kronos-integration/service)
|
|
1
2
|
[](https://spdx.org/licenses/0BSD.html)
|
|
2
3
|
[](https://typescriptlang.org)
|
|
4
|
+
[](https://bundlejs.com/?q=@kronos-integration/service)
|
|
5
|
+
[](https://npmjs.org/package/@kronos-integration/service)
|
|
3
6
|
[](https://github.com/Kronos-Integration/service/issues)
|
|
4
7
|
[](https://actions-badge.atrox.dev/Kronos-Integration/service/goto)
|
|
5
8
|
[](https://github.com/prettier/prettier)
|
|
6
9
|
[](http://commitizen.github.io/cz-cli/)
|
|
7
10
|
[](https://snyk.io/test/github/Kronos-Integration/service)
|
|
8
|
-
[](https://coveralls.io/github/Kronos-Integration/service)
|
|
9
11
|
|
|
10
12
|
# @kronos-integration/service
|
|
11
13
|
|
|
@@ -246,12 +248,6 @@ All services have at least three endpoints:
|
|
|
246
248
|
### Parameters
|
|
247
249
|
|
|
248
250
|
* `config` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
249
|
-
|
|
250
|
-
* `config.name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
251
|
-
* `config.logLevel` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
252
|
-
* `config.autostart` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** defaults to false
|
|
253
|
-
* `config.description` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** human readable description
|
|
254
|
-
* `config.endpoints` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** will be merged with the build in ones
|
|
255
251
|
* `ic` **InitializationContext** 
|
|
256
252
|
|
|
257
253
|
### Properties
|
package/package.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kronos-integration/service",
|
|
3
|
-
"version": "15.1.
|
|
3
|
+
"version": "15.1.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
7
7
|
},
|
|
8
|
+
"packageManager": "npm@11.6.4+sha512.1118cab46a05a50aee6bff5b1b4fa1df18afff89d57465620a3518035026955db87c5bdf9d207b07b7487d99f2490d450cb774655ad63ec2cba7bf1d0ad25d45",
|
|
8
9
|
"types": "./types/module.d.mts",
|
|
9
10
|
"exports": {
|
|
10
11
|
".": {
|
|
11
|
-
"
|
|
12
|
-
"
|
|
12
|
+
"types": "./types/module.d.mts",
|
|
13
|
+
"default": "./src/module.mjs"
|
|
13
14
|
}
|
|
14
15
|
},
|
|
15
16
|
"description": "Base service implementation",
|
|
@@ -23,23 +24,23 @@
|
|
|
23
24
|
"email": "markus.felten@gmx.de"
|
|
24
25
|
}
|
|
25
26
|
],
|
|
26
|
-
"license": "
|
|
27
|
+
"license": "0BSD",
|
|
27
28
|
"scripts": {
|
|
28
29
|
"prepare": "node --run prepare:typescript",
|
|
29
|
-
"prepare:typescript": "tsc --allowJs --declaration --emitDeclarationOnly --declarationDir types --resolveJsonModule --target
|
|
30
|
+
"prepare:typescript": "tsc --allowJs --declaration --emitDeclarationOnly --declarationDir types --resolveJsonModule --target esnext -m esnext --module nodenext --moduleResolution nodenext --rootDir src ./src**/*.mjs",
|
|
30
31
|
"test": "node --run test:ava",
|
|
31
32
|
"test:ava": "ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs",
|
|
32
33
|
"cover": "c8 -x 'tests/**/*' --temp-directory build/tmp ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs && c8 report -r lcov -o build/coverage --temp-directory build/tmp",
|
|
33
|
-
"docs": "documentation readme --section=API ./src
|
|
34
|
+
"docs": "documentation readme --section=API ./src**/*.mjs",
|
|
34
35
|
"lint": "node --run lint:docs && node --run lint:typescript",
|
|
35
|
-
"lint:docs": "documentation lint ./src
|
|
36
|
-
"lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule --target
|
|
36
|
+
"lint:docs": "documentation lint ./src**/*.mjs",
|
|
37
|
+
"lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule --target esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
|
|
37
38
|
},
|
|
38
39
|
"dependencies": {
|
|
39
40
|
"@kronos-integration/endpoint": "^11.0.5",
|
|
40
41
|
"@kronos-integration/interceptor": "^13.0.6",
|
|
41
42
|
"loglevel-mixin": "^7.2.6",
|
|
42
|
-
"pacc": "^5.
|
|
43
|
+
"pacc": "^5.2.0",
|
|
43
44
|
"statetransition-mixin": "^8.1.4"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
@@ -66,6 +67,5 @@
|
|
|
66
67
|
"arlac77/template-kronos-component",
|
|
67
68
|
"arlac77/template-typescript"
|
|
68
69
|
]
|
|
69
|
-
}
|
|
70
|
-
"packageManager": "npm@11.6.4+sha512.1118cab46a05a50aee6bff5b1b4fa1df18afff89d57465620a3518035026955db87c5bdf9d207b07b7487d99f2490d450cb774655ad63ec2cba7bf1d0ad25d45"
|
|
70
|
+
}
|
|
71
71
|
}
|
package/src/service-config.mjs
CHANGED
|
@@ -25,16 +25,14 @@ export class ServiceConfig extends Service {
|
|
|
25
25
|
* Deliver configuration for a given service.
|
|
26
26
|
* @param {string} name service name
|
|
27
27
|
* @param {Object} config
|
|
28
|
+
* @returns {Promise<Object>}
|
|
28
29
|
*/
|
|
29
30
|
async configFor(name, config) {
|
|
30
|
-
this.trace(`configFor ${name}`);
|
|
31
|
-
|
|
32
31
|
await this.start();
|
|
33
32
|
|
|
34
33
|
const pc = this.preservedConfigs.get(name);
|
|
35
34
|
if (pc !== undefined) {
|
|
36
35
|
config = config === undefined ? pc : merge(config, pc);
|
|
37
|
-
this.trace(`using preserved config ${name}`);
|
|
38
36
|
}
|
|
39
37
|
|
|
40
38
|
this.preservedConfigs.set(name, config);
|
package/src/service.mjs
CHANGED
|
@@ -35,13 +35,6 @@ const ssfDefault = {
|
|
|
35
35
|
* - log _out_: log events
|
|
36
36
|
* - config _in_: configuration request
|
|
37
37
|
* - command _in_: administrative actions to be executed by the step
|
|
38
|
-
* @param {Object} config
|
|
39
|
-
* @param {string} config.name
|
|
40
|
-
* @param {string} config.logLevel
|
|
41
|
-
* @param {boolean} config.autostart defaults to false
|
|
42
|
-
* @param {string} config.description human readable description
|
|
43
|
-
* @param {Object} config.endpoints will be merged with the build in ones
|
|
44
|
-
* @param {InitializationContext} ic
|
|
45
38
|
*
|
|
46
39
|
* @property {Object} endpoints
|
|
47
40
|
*/
|
|
@@ -135,6 +128,15 @@ export class Service extends EndpointsMixin(
|
|
|
135
128
|
|
|
136
129
|
#description;
|
|
137
130
|
|
|
131
|
+
/**
|
|
132
|
+
* @param {Object} config
|
|
133
|
+
* @param {string} config.name
|
|
134
|
+
* @param {string} config.logLevel
|
|
135
|
+
* @param {boolean} config.autostart defaults to false
|
|
136
|
+
* @param {string} config.description human readable description
|
|
137
|
+
* @param {Object} config.endpoints will be merged with the build in ones
|
|
138
|
+
* @param {InitializationContext} ic
|
|
139
|
+
*/
|
|
138
140
|
constructor(config, ic) {
|
|
139
141
|
super();
|
|
140
142
|
|
package/types/service.d.mts
CHANGED
|
@@ -6,13 +6,6 @@ declare const Service_base: new () => new () => /*elided*/ any;
|
|
|
6
6
|
* - log _out_: log events
|
|
7
7
|
* - config _in_: configuration request
|
|
8
8
|
* - command _in_: administrative actions to be executed by the step
|
|
9
|
-
* @param {Object} config
|
|
10
|
-
* @param {string} config.name
|
|
11
|
-
* @param {string} config.logLevel
|
|
12
|
-
* @param {boolean} config.autostart defaults to false
|
|
13
|
-
* @param {string} config.description human readable description
|
|
14
|
-
* @param {Object} config.endpoints will be merged with the build in ones
|
|
15
|
-
* @param {InitializationContext} ic
|
|
16
9
|
*
|
|
17
10
|
* @property {Object} endpoints
|
|
18
11
|
*/
|
|
@@ -34,7 +27,22 @@ export class Service extends Service_base {
|
|
|
34
27
|
* @return {Object} predefined endpoints
|
|
35
28
|
*/
|
|
36
29
|
static get endpoints(): any;
|
|
37
|
-
|
|
30
|
+
/**
|
|
31
|
+
* @param {Object} config
|
|
32
|
+
* @param {string} config.name
|
|
33
|
+
* @param {string} config.logLevel
|
|
34
|
+
* @param {boolean} config.autostart defaults to false
|
|
35
|
+
* @param {string} config.description human readable description
|
|
36
|
+
* @param {Object} config.endpoints will be merged with the build in ones
|
|
37
|
+
* @param {InitializationContext} ic
|
|
38
|
+
*/
|
|
39
|
+
constructor(config: {
|
|
40
|
+
name: string;
|
|
41
|
+
logLevel: string;
|
|
42
|
+
autostart: boolean;
|
|
43
|
+
description: string;
|
|
44
|
+
endpoints: any;
|
|
45
|
+
}, ic: any);
|
|
38
46
|
owner: any;
|
|
39
47
|
instantiateInterceptor(options: any): any;
|
|
40
48
|
get attributes(): any;
|