@kronos-integration/service 15.1.0 → 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 CHANGED
@@ -1,11 +1,13 @@
1
+ [![npm](https://img.shields.io/npm/v/@kronos-integration/service.svg)](https://www.npmjs.com/package/@kronos-integration/service)
1
2
  [![License](https://img.shields.io/badge/License-0BSD-blue.svg)](https://spdx.org/licenses/0BSD.html)
2
3
  [![Typed with TypeScript](https://flat.badgen.net/badge/icon/Typed?icon=typescript\&label\&labelColor=blue\&color=555555)](https://typescriptlang.org)
4
+ [![bundlejs](https://deno.bundlejs.com/?q=@kronos-integration/service\&badge=detailed)](https://bundlejs.com/?q=@kronos-integration/service)
5
+ [![downloads](http://img.shields.io/npm/dm/@kronos-integration/service.svg?style=flat-square)](https://npmjs.org/package/@kronos-integration/service)
3
6
  [![GitHub Issues](https://img.shields.io/github/issues/Kronos-Integration/service.svg?style=flat-square)](https://github.com/Kronos-Integration/service/issues)
4
7
  [![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2FKronos-Integration%2Fservice%2Fbadge\&style=flat)](https://actions-badge.atrox.dev/Kronos-Integration/service/goto)
5
8
  [![Styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
6
9
  [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
7
10
  [![Known Vulnerabilities](https://snyk.io/test/github/Kronos-Integration/service/badge.svg)](https://snyk.io/test/github/Kronos-Integration/service)
8
- [![Coverage Status](https://coveralls.io/repos/Kronos-Integration/service/badge.svg)](https://coveralls.io/github/Kronos-Integration/service)
9
11
 
10
12
  # @kronos-integration/service
11
13
 
@@ -91,8 +93,10 @@ The transitions are:
91
93
  * [Parameters](#parameters-13)
92
94
  * [getCredential](#getcredential)
93
95
  * [Parameters](#parameters-14)
94
- * [log](#log)
96
+ * [getCredentials](#getcredentials)
95
97
  * [Parameters](#parameters-15)
98
+ * [log](#log)
99
+ * [Parameters](#parameters-16)
96
100
  * [attributes](#attributes)
97
101
  * [endpoints](#endpoints-2)
98
102
  * [StandaloneServiceProvider](#standaloneserviceprovider)
@@ -244,12 +248,6 @@ All services have at least three endpoints:
244
248
  ### Parameters
245
249
 
246
250
  * `config` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
247
-
248
- * `config.name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
249
- * `config.logLevel` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
250
- * `config.autostart` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** defaults to false
251
- * `config.description` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** human readable description
252
- * `config.endpoints` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** will be merged with the build in ones
253
251
  * `ic` **InitializationContext** 
254
252
 
255
253
  ### Properties
@@ -400,6 +398,16 @@ Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/
400
398
 
401
399
  Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [Uint8Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array))>**&#x20;
402
400
 
401
+ ### getCredentials
402
+
403
+ Retrieve all credential attribute values.
404
+
405
+ #### Parameters
406
+
407
+ * `filter` (optional, default `(name,attribute)=>attribute.credential`)
408
+
409
+ Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>**&#x20;
410
+
403
411
  ### log
404
412
 
405
413
  Adds service name to the log event.
package/package.json CHANGED
@@ -1,15 +1,16 @@
1
1
  {
2
2
  "name": "@kronos-integration/service",
3
- "version": "15.1.0",
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
- "default": "./src/module.mjs",
12
- "types": "./types/module.d.mts"
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": "BSD-2-Clause",
27
+ "license": "0BSD",
27
28
  "scripts": {
28
29
  "prepare": "node --run prepare:typescript",
29
- "prepare:typescript": "tsc --allowJs --declaration --emitDeclarationOnly --declarationDir types --resolveJsonModule --target es2024 --lib es2024 -m esnext --module nodenext --moduleResolution nodenext --rootDir src ./src**/*.mjs",
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/**/*.mjs",
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/**/*.mjs",
36
- "lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule --target es2024 --lib es2024 -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
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
- "@kronos-integration/endpoint": "^11.0.4",
40
- "@kronos-integration/interceptor": "^13.0.5",
40
+ "@kronos-integration/endpoint": "^11.0.5",
41
+ "@kronos-integration/interceptor": "^13.0.6",
41
42
  "loglevel-mixin": "^7.2.6",
42
- "pacc": "^5.0.0",
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
  }
@@ -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
 
@@ -18,6 +18,7 @@ export class ServiceConfig extends Service {
18
18
  * Deliver configuration for a given service.
19
19
  * @param {string} name service name
20
20
  * @param {Object} config
21
+ * @returns {Promise<Object>}
21
22
  */
22
23
  configFor(name: string, config: any): Promise<any>;
23
24
  /**
@@ -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
- constructor(config: any, ic: any);
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;