@kronos-integration/service 12.0.5 → 13.0.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kronos-integration/service",
3
- "version": "12.0.5",
3
+ "version": "13.0.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -36,10 +36,10 @@
36
36
  "lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule --target es2024 --lib es2024 -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
37
37
  },
38
38
  "dependencies": {
39
- "@kronos-integration/endpoint": "^10.0.4",
40
- "@kronos-integration/interceptor": "^11.0.4",
39
+ "@kronos-integration/endpoint": "^10.0.5",
40
+ "@kronos-integration/interceptor": "^12.0.0",
41
41
  "loglevel-mixin": "^7.2.5",
42
- "pacc": "^3.7.0",
42
+ "pacc": "^3.8.0",
43
43
  "remove-sensible-values": "^1.3.1",
44
44
  "statetransition-mixin": "^8.1.3"
45
45
  },
package/src/service.mjs CHANGED
@@ -3,16 +3,14 @@ import { prepareActions, StateTransitionMixin } from "statetransition-mixin";
3
3
  import {
4
4
  prepareAttributesDefinitions,
5
5
  getAttributes,
6
- setAttributes
6
+ setAttributes,
7
+ description_attribute
7
8
  } from "pacc";
8
9
  import { EndpointsMixin } from "./endpoints-mixin.mjs";
9
10
  import { InitializationContext } from "./initialization-context.mjs";
10
11
 
11
- const CONFIG_ATTRIBUTES = prepareAttributesDefinitions({
12
- description: {
13
- type: "string",
14
- description: "human readable description of the service"
15
- },
12
+ const ATTRIBUTES = prepareAttributesDefinitions({
13
+ description: description_attribute,
16
14
  logLevel: {
17
15
  description: `logging level one of: ${Object.keys(defaultLogLevels)}`,
18
16
  default: defaultLogLevels.info,
@@ -122,8 +120,8 @@ export class Service extends EndpointsMixin(
122
120
  * The Service class only defines the logLevel, and start/stop/restart timeout attribute
123
121
  * @return {Object}
124
122
  */
125
- static get configurationAttributes() {
126
- return CONFIG_ATTRIBUTES;
123
+ static get attributes() {
124
+ return ATTRIBUTES;
127
125
  }
128
126
 
129
127
  /**
@@ -181,8 +179,8 @@ export class Service extends EndpointsMixin(
181
179
  return this.owner.instantiateInterceptor(options);
182
180
  }
183
181
 
184
- get configurationAttributes() {
185
- return this.constructor.configurationAttributes;
182
+ get attributes() {
183
+ return this.constructor.attributes;
186
184
  }
187
185
 
188
186
  get type() {
@@ -357,7 +355,7 @@ export class Service extends EndpointsMixin(
357
355
  }
358
356
 
359
357
  if (options.includeConfig) {
360
- let atts = getAttributes(this, this.configurationAttributes);
358
+ let atts = getAttributes(this, this.attributes);
361
359
 
362
360
  if (!options.includePrivate) {
363
361
  atts = Object.fromEntries(
@@ -406,7 +404,7 @@ export class Service extends EndpointsMixin(
406
404
  /**
407
405
  * Takes attribute values from config parameters
408
406
  * and copies them over to the object.
409
- * Copying is done according to configurationAttributes.
407
+ * Copying is done according to attributes.
410
408
  * Which means we loop over all configuration attributes.
411
409
  * and then for each attribute decide if we use the default, call a setter function
412
410
  * or simply assign the attribute value.
@@ -418,7 +416,7 @@ export class Service extends EndpointsMixin(
418
416
  setAttributes(
419
417
  this,
420
418
  config,
421
- this.configurationAttributes,
419
+ this.attributes,
422
420
  (ca, path, value) => {
423
421
  this.trace(level => {
424
422
  if (ca.private) {
@@ -26,7 +26,7 @@ export class Service extends Service_base {
26
26
  * The Service class only defines the logLevel, and start/stop/restart timeout attribute
27
27
  * @return {Object}
28
28
  */
29
- static get configurationAttributes(): any;
29
+ static get attributes(): any;
30
30
  /**
31
31
  * Definition of the predefined endpoints.
32
32
  * - log _out_
@@ -38,7 +38,7 @@ export class Service extends Service_base {
38
38
  owner: any;
39
39
  logLevel: any;
40
40
  instantiateInterceptor(options: any): any;
41
- get configurationAttributes(): any;
41
+ get attributes(): any;
42
42
  get type(): string;
43
43
  set description(desc: any);
44
44
  get description(): any;
@@ -124,7 +124,7 @@ export class Service extends Service_base {
124
124
  /**
125
125
  * Takes attribute values from config parameters
126
126
  * and copies them over to the object.
127
- * Copying is done according to configurationAttributes.
127
+ * Copying is done according to attributes.
128
128
  * Which means we loop over all configuration attributes.
129
129
  * and then for each attribute decide if we use the default, call a setter function
130
130
  * or simply assign the attribute value.