@kronos-integration/service 13.2.5 → 13.2.7

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.5",
3
+ "version": "13.2.7",
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.1.6",
40
- "@kronos-integration/interceptor": "^12.1.6",
39
+ "@kronos-integration/endpoint": "^10.1.7",
40
+ "@kronos-integration/interceptor": "^12.1.8",
41
41
  "loglevel-mixin": "^7.2.5",
42
- "pacc": "^4.5.3",
42
+ "pacc": "^4.6.0",
43
43
  "statetransition-mixin": "^8.1.3"
44
44
  },
45
45
  "devDependencies": {
@@ -47,10 +47,10 @@
47
47
  "c8": "^10.1.3",
48
48
  "documentation": "^14.0.3",
49
49
  "semantic-release": "^24.2.7",
50
- "typescript": "^5.8.3"
50
+ "typescript": "^5.9.2"
51
51
  },
52
52
  "engines": {
53
- "node": ">=22.17.1"
53
+ "node": ">=22.18.0"
54
54
  },
55
55
  "repository": {
56
56
  "type": "git",
@@ -168,11 +168,7 @@ export const InitializationContext = LogLevelMixin(
168
168
  const sp = this.serviceProvider;
169
169
 
170
170
  if (type instanceof Function) {
171
- const factory = sp.serviceFactories[type.name];
172
- if (factory !== undefined) {
173
- return factory;
174
- }
175
- return sp.registerServiceFactory(type);
171
+ return sp.serviceFactories[type.name] || sp.registerServiceFactory(type);
176
172
  }
177
173
 
178
174
  const factory = sp.serviceFactories[type];
@@ -188,7 +184,7 @@ export const InitializationContext = LogLevelMixin(
188
184
  if (this.waitForFactories) {
189
185
  try {
190
186
  const module = await import(type);
191
- if (module.default && module.default.prototype instanceof Service) {
187
+ if (module.default?.prototype instanceof Service) {
192
188
  sp.registerServiceFactory(type, module.default);
193
189
  return module.default;
194
190
  }
package/src/service.mjs CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  getAttributes,
6
6
  setAttributes,
7
7
  description_attribute,
8
- default_attribute,
8
+ default_attribute_writable,
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,
90
+ ...default_attribute_writable,
91
91
  description: "logging level",
92
92
  values: Object.keys(defaultLogLevels),
93
93
  default: defaultLogLevels.info,
@@ -234,11 +234,7 @@ export class Service extends EndpointsMixin(
234
234
  * @return {number} milliseconds before throwing for a long running transition
235
235
  */
236
236
  timeoutForTransition(transition) {
237
- const timeout = this.timeout[transition.name];
238
-
239
- return timeout === undefined
240
- ? super.timeoutForTransition(transition)
241
- : timeout * 1000;
237
+ return this.timeout[transition.name] * 1000 || super.timeoutForTransition(transition);
242
238
  }
243
239
 
244
240
  /**
@@ -21,12 +21,12 @@ export function ServiceProviderMixin(superclass: any, serviceLoggerClass?: new (
21
21
  * By default be our own owner.
22
22
  * @return this
23
23
  */
24
- readonly owner: /*elided*/ any;
24
+ get owner(): /*elided*/ any;
25
25
  /**
26
26
  * We are the service provider.
27
27
  * @return {boolean} true
28
28
  */
29
- readonly isServiceProvider: boolean;
29
+ get isServiceProvider(): boolean;
30
30
  /**
31
31
  * Register service or interceptor factories.
32
32
  *
@@ -54,7 +54,7 @@ export function ServiceProviderMixin(superclass: any, serviceLoggerClass?: new (
54
54
  unregisterServiceFactory(factory: any): Promise<void>;
55
55
  registerService(service: any): Promise<any>;
56
56
  unregisterService(serviceName: any): Promise<void>;
57
- readonly serviceNames: string[];
57
+ get serviceNames(): string[];
58
58
  getService(name: any): any;
59
59
  declareService(config: any): Promise<any>;
60
60
  /**
@@ -9,8 +9,8 @@ declare const StandaloneServiceProvider_base: {
9
9
  emit(name: any, ...args: any[]): void;
10
10
  addListener(name: any, listener: any): void;
11
11
  removeListener(name: any, listener: any): void;
12
- readonly owner: /*elided*/ any;
13
- readonly isServiceProvider: boolean;
12
+ get owner(): /*elided*/ any;
13
+ get isServiceProvider(): boolean;
14
14
  registerFactories(factories: [Function | string]): Promise<void>;
15
15
  registerInterceptorFactory(factory: new () => new () => /*elided*/ any): new () => new () => /*elided*/ any;
16
16
  unregisterInterceptorFactory(factory: any): void;
@@ -20,7 +20,7 @@ declare const StandaloneServiceProvider_base: {
20
20
  unregisterServiceFactory(factory: any): Promise<void>;
21
21
  registerService(service: any): Promise<any>;
22
22
  unregisterService(serviceName: any): Promise<void>;
23
- readonly serviceNames: string[];
23
+ get serviceNames(): string[];
24
24
  getService(name: any): any;
25
25
  declareService(config: any): Promise<any>;
26
26
  declareServices(configs: object): Promise<any>;