@kronos-integration/service 13.2.7 → 13.2.8

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": "13.2.7",
3
+ "version": "13.2.8",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -39,7 +39,7 @@
39
39
  "@kronos-integration/endpoint": "^10.1.7",
40
40
  "@kronos-integration/interceptor": "^12.1.8",
41
41
  "loglevel-mixin": "^7.2.5",
42
- "pacc": "^4.6.0",
42
+ "pacc": "^4.7.0",
43
43
  "statetransition-mixin": "^8.1.3"
44
44
  },
45
45
  "devDependencies": {
@@ -168,7 +168,11 @@ export const InitializationContext = LogLevelMixin(
168
168
  const sp = this.serviceProvider;
169
169
 
170
170
  if (type instanceof Function) {
171
- return sp.serviceFactories[type.name] || sp.registerServiceFactory(type);
171
+ const factory = sp.serviceFactories[type.name];
172
+ if (factory !== undefined) {
173
+ return factory;
174
+ }
175
+ return sp.registerServiceFactory(type);
172
176
  }
173
177
 
174
178
  const factory = sp.serviceFactories[type];
@@ -184,7 +188,7 @@ export const InitializationContext = LogLevelMixin(
184
188
  if (this.waitForFactories) {
185
189
  try {
186
190
  const module = await import(type);
187
- if (module.default?.prototype instanceof Service) {
191
+ if (module.default && module.default.prototype instanceof Service) {
188
192
  sp.registerServiceFactory(type, module.default);
189
193
  return module.default;
190
194
  }
package/src/service.mjs CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  getAttributes,
6
6
  setAttributes,
7
7
  description_attribute,
8
- default_attribute_writable,
8
+ default_attribute,
9
9
  timeout_attribute
10
10
  } from "pacc";
11
11
  import { EndpointsMixin } from "./endpoints-mixin.mjs";
@@ -87,7 +87,7 @@ export class Service extends EndpointsMixin(
87
87
  static attributes = prepareAttributesDefinitions({
88
88
  description: description_attribute,
89
89
  logLevel: {
90
- ...default_attribute_writable,
90
+ ...default_attribute,
91
91
  description: "logging level",
92
92
  values: Object.keys(defaultLogLevels),
93
93
  default: defaultLogLevels.info,
@@ -234,7 +234,11 @@ export class Service extends EndpointsMixin(
234
234
  * @return {number} milliseconds before throwing for a long running transition
235
235
  */
236
236
  timeoutForTransition(transition) {
237
- return this.timeout[transition.name] * 1000 || super.timeoutForTransition(transition);
237
+ const timeout = this.timeout[transition.name];
238
+
239
+ return timeout === undefined
240
+ ? super.timeoutForTransition(transition)
241
+ : timeout * 1000;
238
242
  }
239
243
 
240
244
  /**