@kronos-integration/service 10.4.20 → 10.4.21
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 +7 -7
- package/src/endpoints-mixin.mjs +1 -1
- package/src/initialization-context.mjs +1 -2
- package/src/module.mjs +6 -16
- package/src/service-config.mjs +2 -2
- package/src/service-logger.mjs +2 -2
- package/src/service-provider-mixin.mjs +4 -4
- package/src/service.mjs +8 -8
- package/src/standalone-service-provider.mjs +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kronos-integration/service",
|
|
3
|
-
"version": "10.4.
|
|
3
|
+
"version": "10.4.21",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -29,21 +29,21 @@
|
|
|
29
29
|
"lint:docs": "documentation lint ./src/**/*.mjs"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@kronos-integration/endpoint": "^9.4.
|
|
33
|
-
"@kronos-integration/interceptor": "^10.2.
|
|
32
|
+
"@kronos-integration/endpoint": "^9.4.24",
|
|
33
|
+
"@kronos-integration/interceptor": "^10.2.21",
|
|
34
34
|
"loglevel-mixin": "^6.1.0",
|
|
35
|
-
"model-attributes": "^4.1.
|
|
35
|
+
"model-attributes": "^4.1.15",
|
|
36
36
|
"remove-sensible-values": "^1.0.11",
|
|
37
|
-
"statetransition-mixin": "^
|
|
37
|
+
"statetransition-mixin": "^7.0.3"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"ava": "^4.0
|
|
40
|
+
"ava": "^4.2.0",
|
|
41
41
|
"c8": "^7.11.0",
|
|
42
42
|
"documentation": "^13.2.5",
|
|
43
43
|
"semantic-release": "^19.0.2"
|
|
44
44
|
},
|
|
45
45
|
"engines": {
|
|
46
|
-
"node": ">=16.
|
|
46
|
+
"node": ">=16.14.2"
|
|
47
47
|
},
|
|
48
48
|
"repository": {
|
|
49
49
|
"type": "git",
|
package/src/endpoints-mixin.mjs
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
* @param {Class} superclass class to be extended
|
|
15
15
|
* @return {Class} extended class
|
|
16
16
|
*/
|
|
17
|
-
export
|
|
17
|
+
export function EndpointsMixin(superclass) {
|
|
18
18
|
return class EndpointsMixin extends superclass {
|
|
19
19
|
/**
|
|
20
20
|
* Default set of endpoints to create.
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { LogLevelMixin } from "loglevel-mixin";
|
|
2
|
-
|
|
3
2
|
import {
|
|
4
3
|
isEndpoint,
|
|
5
4
|
Endpoint,
|
|
6
5
|
DummyReceiveEndpoint
|
|
7
6
|
} from "@kronos-integration/endpoint";
|
|
8
|
-
import Service from "./service.mjs";
|
|
7
|
+
import { Service } from "./service.mjs";
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* Keeps track of all in flight object creations and loose ends during config initialization.
|
package/src/module.mjs
CHANGED
|
@@ -1,18 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
EndpointsMixin,
|
|
10
|
-
ServiceProviderMixin,
|
|
11
|
-
ServiceConfig,
|
|
12
|
-
ServiceLogger,
|
|
13
|
-
Service,
|
|
14
|
-
StandaloneServiceProvider
|
|
15
|
-
};
|
|
16
|
-
|
|
1
|
+
export * from "./service.mjs";
|
|
2
|
+
export * from "./service-logger.mjs";
|
|
3
|
+
export * from "./service-config.mjs";
|
|
4
|
+
export * from "./service-provider-mixin.mjs";
|
|
5
|
+
export * from "./endpoints-mixin.mjs";
|
|
6
|
+
export * from "./standalone-service-provider.mjs";
|
|
17
7
|
export * from "./service-consumer-mixin.mjs";
|
|
18
8
|
export * from "./initialization-context.mjs";
|
package/src/service-config.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { removeSensibleValues } from "remove-sensible-values";
|
|
2
|
-
import Service from "./service.mjs";
|
|
2
|
+
import { Service } from "./service.mjs";
|
|
3
3
|
import { keyValue2Object } from "./util.mjs";
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -8,7 +8,7 @@ import { keyValue2Object } from "./util.mjs";
|
|
|
8
8
|
* or preserves them until a maching service becomes avaliable.
|
|
9
9
|
* @property {Map<string,Object>} preservedConfigs values for services not already established
|
|
10
10
|
*/
|
|
11
|
-
export
|
|
11
|
+
export class ServiceConfig extends Service {
|
|
12
12
|
/**
|
|
13
13
|
* @return {string} 'config'
|
|
14
14
|
*/
|
package/src/service-logger.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Interceptor } from "@kronos-integration/interceptor";
|
|
2
|
-
import Service from "./service.mjs";
|
|
3
|
-
import ServiceLogger from "./service-logger.mjs";
|
|
4
|
-
import ServiceConfig from "./service-config.mjs";
|
|
2
|
+
import { Service } from "./service.mjs";
|
|
3
|
+
import { ServiceLogger } from "./service-logger.mjs";
|
|
4
|
+
import { ServiceConfig } from "./service-config.mjs";
|
|
5
5
|
import { InitializationContext } from "./initialization-context.mjs";
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -12,7 +12,7 @@ import { InitializationContext } from "./initialization-context.mjs";
|
|
|
12
12
|
* @param {Class} serviceLoggerClass where the logging houtd go
|
|
13
13
|
* @param {Class} serviceConfigClass where the config comes from
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
15
|
+
export function ServiceProviderMixin(
|
|
16
16
|
superclass,
|
|
17
17
|
serviceLoggerClass = ServiceLogger,
|
|
18
18
|
serviceConfigClass = ServiceConfig
|
package/src/service.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
getAttributes,
|
|
6
6
|
setAttributes
|
|
7
7
|
} from "model-attributes";
|
|
8
|
-
import EndpointsMixin from "./endpoints-mixin.mjs";
|
|
8
|
+
import { EndpointsMixin } from "./endpoints-mixin.mjs";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Key of the service description.
|
|
@@ -53,7 +53,7 @@ const _ca = createAttributes({
|
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
55
|
|
|
56
|
-
const timeout =
|
|
56
|
+
const timeout = 30000;
|
|
57
57
|
|
|
58
58
|
const rsfDefault = {
|
|
59
59
|
target: "running",
|
|
@@ -84,7 +84,7 @@ const ssfDefault = {
|
|
|
84
84
|
* @param {Object} config.endpoints will be merged with the build in ones
|
|
85
85
|
* @param {InitializationContext} ic
|
|
86
86
|
*/
|
|
87
|
-
export
|
|
87
|
+
export class Service extends EndpointsMixin(
|
|
88
88
|
StateTransitionMixin(
|
|
89
89
|
LogLevelMixin(class {}),
|
|
90
90
|
prepareActions({
|
|
@@ -249,9 +249,10 @@ export default class Service extends EndpointsMixin(
|
|
|
249
249
|
*/
|
|
250
250
|
timeoutForTransition(transition) {
|
|
251
251
|
const timeout = this.timeout[transition.name];
|
|
252
|
+
|
|
252
253
|
return timeout === undefined
|
|
253
254
|
? super.timeoutForTransition(transition)
|
|
254
|
-
: timeout;
|
|
255
|
+
: timeout * 1000;
|
|
255
256
|
}
|
|
256
257
|
|
|
257
258
|
/**
|
|
@@ -305,11 +306,10 @@ export default class Service extends EndpointsMixin(
|
|
|
305
306
|
* Base service is not a provider.
|
|
306
307
|
* @return {boolean} false
|
|
307
308
|
*/
|
|
308
|
-
get isServiceProvider()
|
|
309
|
-
{
|
|
309
|
+
get isServiceProvider() {
|
|
310
310
|
return false;
|
|
311
311
|
}
|
|
312
|
-
|
|
312
|
+
|
|
313
313
|
/**
|
|
314
314
|
* Returns the string representation of this service.
|
|
315
315
|
* @return {string} human readable name
|
|
@@ -345,7 +345,7 @@ export default class Service extends EndpointsMixin(
|
|
|
345
345
|
type: this.type
|
|
346
346
|
};
|
|
347
347
|
|
|
348
|
-
if(this.isServiceProvider) {
|
|
348
|
+
if (this.isServiceProvider) {
|
|
349
349
|
json.serviceProvider = true;
|
|
350
350
|
}
|
|
351
351
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import Service
|
|
2
|
-
import ServiceProviderMixin from
|
|
1
|
+
import { Service } from "./service.mjs";
|
|
2
|
+
import { ServiceProviderMixin } from "./service-provider-mixin.mjs";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Simple service manager (for examples and testing only).
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export class StandaloneServiceProvider extends ServiceProviderMixin(Service) {
|
|
8
8
|
/**
|
|
9
9
|
* @return {string} 'standalone-provider'
|
|
10
10
|
*/
|
|
11
11
|
static get name() {
|
|
12
|
-
return
|
|
12
|
+
return "standalone-provider";
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
static get description() {
|