@kronos-integration/service 10.4.32 → 10.4.33
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 +60 -89
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -22,61 +22,56 @@ Base service implementation
|
|
|
22
22
|
* [EndpointsMixin](#endpointsmixin)
|
|
23
23
|
* [Parameters](#parameters)
|
|
24
24
|
* [endpoints](#endpoints)
|
|
25
|
-
* [
|
|
26
|
-
* [InitializationContext](#initializationcontext-1)
|
|
25
|
+
* [ServiceConfig](#serviceconfig)
|
|
27
26
|
* [Parameters](#parameters-1)
|
|
28
27
|
* [Properties](#properties)
|
|
29
|
-
* [serviceProvider](#serviceprovider)
|
|
30
|
-
* [ServiceConfig](#serviceconfig)
|
|
31
|
-
* [Parameters](#parameters-2)
|
|
32
|
-
* [Properties](#properties-1)
|
|
33
28
|
* [configFor](#configfor)
|
|
34
|
-
* [Parameters](#parameters-
|
|
29
|
+
* [Parameters](#parameters-2)
|
|
35
30
|
* [clearPreserved](#clearpreserved)
|
|
36
|
-
* [Parameters](#parameters-
|
|
31
|
+
* [Parameters](#parameters-3)
|
|
37
32
|
* [configureValue](#configurevalue)
|
|
38
|
-
* [Parameters](#parameters-
|
|
33
|
+
* [Parameters](#parameters-4)
|
|
39
34
|
* [configure](#configure)
|
|
40
|
-
* [Parameters](#parameters-
|
|
35
|
+
* [Parameters](#parameters-5)
|
|
41
36
|
* [autostart](#autostart)
|
|
42
37
|
* [name](#name)
|
|
43
38
|
* [merge](#merge)
|
|
44
|
-
* [Parameters](#parameters-
|
|
39
|
+
* [Parameters](#parameters-6)
|
|
45
40
|
* [defineServiceConsumerProperties](#defineserviceconsumerproperties)
|
|
46
|
-
* [Parameters](#parameters-
|
|
41
|
+
* [Parameters](#parameters-7)
|
|
47
42
|
* [ServiceLogger](#servicelogger)
|
|
48
43
|
* [autostart](#autostart-1)
|
|
49
44
|
* [name](#name-1)
|
|
50
45
|
* [endpoints](#endpoints-1)
|
|
51
46
|
* [ServiceProviderMixin](#serviceprovidermixin)
|
|
52
|
-
* [Parameters](#parameters-
|
|
47
|
+
* [Parameters](#parameters-8)
|
|
53
48
|
* [DESCRIPTION](#description)
|
|
54
49
|
* [Service](#service)
|
|
55
|
-
* [Parameters](#parameters-
|
|
50
|
+
* [Parameters](#parameters-9)
|
|
56
51
|
* [extendetName](#extendetname)
|
|
57
52
|
* [stateChanged](#statechanged)
|
|
58
|
-
* [Parameters](#parameters-
|
|
53
|
+
* [Parameters](#parameters-10)
|
|
59
54
|
* [rejectWrongState](#rejectwrongstate)
|
|
60
|
-
* [Parameters](#parameters-
|
|
55
|
+
* [Parameters](#parameters-11)
|
|
61
56
|
* [timeoutForTransition](#timeoutfortransition)
|
|
62
|
-
* [Parameters](#parameters-
|
|
63
|
-
* [\_start](
|
|
64
|
-
* [\_stop](
|
|
65
|
-
* [\_restart](
|
|
57
|
+
* [Parameters](#parameters-12)
|
|
58
|
+
* [\_start](#_start)
|
|
59
|
+
* [\_stop](#_stop)
|
|
60
|
+
* [\_restart](#_restart)
|
|
66
61
|
* [restartIfRunning](#restartifrunning)
|
|
67
62
|
* [toStringAttributes](#tostringattributes)
|
|
68
63
|
* [isServiceProvider](#isserviceprovider)
|
|
69
64
|
* [toString](#tostring)
|
|
70
65
|
* [toJSONWithOptions](#tojsonwithoptions)
|
|
71
|
-
* [Parameters](#parameters-
|
|
66
|
+
* [Parameters](#parameters-13)
|
|
72
67
|
* [name](#name-2)
|
|
73
68
|
* [autostart](#autostart-2)
|
|
74
|
-
* [\_configure](
|
|
75
|
-
* [Parameters](#parameters-
|
|
69
|
+
* [\_configure](#_configure)
|
|
70
|
+
* [Parameters](#parameters-14)
|
|
76
71
|
* [configure](#configure-1)
|
|
77
|
-
* [Parameters](#parameters-
|
|
72
|
+
* [Parameters](#parameters-15)
|
|
78
73
|
* [log](#log)
|
|
79
|
-
* [Parameters](#parameters-
|
|
74
|
+
* [Parameters](#parameters-16)
|
|
80
75
|
* [configurationAttributes](#configurationattributes)
|
|
81
76
|
* [endpoints](#endpoints-2)
|
|
82
77
|
* [StandaloneServiceProvider](#standaloneserviceprovider)
|
|
@@ -99,29 +94,6 @@ Default set of endpoints to create.
|
|
|
99
94
|
|
|
100
95
|
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** {} empty set
|
|
101
96
|
|
|
102
|
-
## InitializationContext
|
|
103
|
-
|
|
104
|
-
Keeps track of all in flight object creations and loose ends during config initialization.
|
|
105
|
-
|
|
106
|
-
## InitializationContext
|
|
107
|
-
|
|
108
|
-
### Parameters
|
|
109
|
-
|
|
110
|
-
* `serviceProvider` **ServiceProvider**
|
|
111
|
-
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
|
|
112
|
-
|
|
113
|
-
* `options.logLevel` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
114
|
-
|
|
115
|
-
### Properties
|
|
116
|
-
|
|
117
|
-
* `outstandingServices` **[Map](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), [Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Service](#service)>>**
|
|
118
|
-
* `outstandingFactories` **[Map](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), [Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)>>**
|
|
119
|
-
* `outstandingEndpointConnections` **[Map](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), [Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<Endpoint>>**
|
|
120
|
-
|
|
121
|
-
## serviceProvider
|
|
122
|
-
|
|
123
|
-
if config belongs to the provider we represent ourselfs
|
|
124
|
-
|
|
125
97
|
## ServiceConfig
|
|
126
98
|
|
|
127
99
|
**Extends Service**
|
|
@@ -132,8 +104,8 @@ or preserves them until a maching service becomes avaliable.
|
|
|
132
104
|
|
|
133
105
|
### Parameters
|
|
134
106
|
|
|
135
|
-
* `config`
|
|
136
|
-
* `ic`
|
|
107
|
+
* `config`  
|
|
108
|
+
* `ic`  
|
|
137
109
|
|
|
138
110
|
### Properties
|
|
139
111
|
|
|
@@ -146,7 +118,7 @@ Deliver configuration for a given service.
|
|
|
146
118
|
#### Parameters
|
|
147
119
|
|
|
148
120
|
* `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** service name
|
|
149
|
-
* `config` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
121
|
+
* `config` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
150
122
|
|
|
151
123
|
### clearPreserved
|
|
152
124
|
|
|
@@ -163,13 +135,13 @@ Set config entry.
|
|
|
163
135
|
#### Parameters
|
|
164
136
|
|
|
165
137
|
* `key` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** path to the value
|
|
166
|
-
* `value` **any
|
|
138
|
+
* `value` **any** 
|
|
167
139
|
|
|
168
140
|
### configure
|
|
169
141
|
|
|
170
142
|
#### Parameters
|
|
171
143
|
|
|
172
|
-
* `config` **([Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) | [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object))
|
|
144
|
+
* `config` **([Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) | [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object))** 
|
|
173
145
|
|
|
174
146
|
### autostart
|
|
175
147
|
|
|
@@ -188,8 +160,8 @@ When *a* and *b* are arrays of values only the none duplicates are appendend to
|
|
|
188
160
|
|
|
189
161
|
### Parameters
|
|
190
162
|
|
|
191
|
-
* `a` **any
|
|
192
|
-
* `b` **any
|
|
163
|
+
* `a` **any** 
|
|
164
|
+
* `b` **any** 
|
|
193
165
|
|
|
194
166
|
Returns **any** merged b into a
|
|
195
167
|
|
|
@@ -202,7 +174,7 @@ Assign services based on a configuration.
|
|
|
202
174
|
* `target` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** object
|
|
203
175
|
* `config` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** service defintion
|
|
204
176
|
* `provider` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** service provider
|
|
205
|
-
* `waitUntilFactoryPresent` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)
|
|
177
|
+
* `waitUntilFactoryPresent` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** 
|
|
206
178
|
|
|
207
179
|
## ServiceLogger
|
|
208
180
|
|
|
@@ -234,7 +206,7 @@ By default a service provider has two build in services
|
|
|
234
206
|
|
|
235
207
|
### Parameters
|
|
236
208
|
|
|
237
|
-
* `superclass`
|
|
209
|
+
* `superclass`  
|
|
238
210
|
* `serviceLoggerClass` **Class** where the logging houtd go (optional, default `ServiceLogger`)
|
|
239
211
|
* `serviceConfigClass` **Class** where the config comes from (optional, default `ServiceConfig`)
|
|
240
212
|
|
|
@@ -245,22 +217,22 @@ Key of the service description.
|
|
|
245
217
|
## Service
|
|
246
218
|
|
|
247
219
|
**Extends EndpointsMixin(StateTransitionMixin(LogLevelMixin(class {}), prepareActions({
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
220
|
+
  start: {
|
|
221
|
+
  stopped: rsfDefault
|
|
222
|
+
  },
|
|
223
|
+
  restart: {
|
|
224
|
+
  stopped: rsfDefault,
|
|
225
|
+
  running: {
|
|
226
|
+
  target: "running",
|
|
227
|
+
  during: "restarting",
|
|
228
|
+
  timeout
|
|
229
|
+
  }
|
|
230
|
+
  },
|
|
231
|
+
  stop: {
|
|
232
|
+
  running: ssfDefault,
|
|
233
|
+
  starting: ssfDefault,
|
|
234
|
+
  failed: ssfDefault
|
|
235
|
+
  }
|
|
264
236
|
}), "stopped"))**
|
|
265
237
|
|
|
266
238
|
Service
|
|
@@ -273,21 +245,21 @@ All services have at least three endpoints:
|
|
|
273
245
|
|
|
274
246
|
### Parameters
|
|
275
247
|
|
|
276
|
-
* `config` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
248
|
+
* `config` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
277
249
|
|
|
278
|
-
* `config.name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)
|
|
279
|
-
* `config.logLevel` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)
|
|
250
|
+
* `config.name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
251
|
+
* `config.logLevel` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
280
252
|
* `config.autostart` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** defaults to false
|
|
281
253
|
* `config.description` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** human readable description
|
|
282
254
|
* `config.endpoints` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** will be merged with the build in ones
|
|
283
|
-
* `ic` **
|
|
255
|
+
* `ic` **InitializationContext** 
|
|
284
256
|
|
|
285
257
|
### extendetName
|
|
286
258
|
|
|
287
259
|
Used in human readable state messages.
|
|
288
260
|
Besides the actual service name it may contain additional short hints.
|
|
289
261
|
|
|
290
|
-
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)
|
|
262
|
+
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
291
263
|
|
|
292
264
|
### stateChanged
|
|
293
265
|
|
|
@@ -296,9 +268,9 @@ Emits a serviceStateChanged event to the owner.
|
|
|
296
268
|
|
|
297
269
|
#### Parameters
|
|
298
270
|
|
|
299
|
-
* `origin`
|
|
300
|
-
* `oldState` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)
|
|
301
|
-
* `newState` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)
|
|
271
|
+
* `origin`  
|
|
272
|
+
* `oldState` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
273
|
+
* `newState` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
302
274
|
|
|
303
275
|
### rejectWrongState
|
|
304
276
|
|
|
@@ -318,7 +290,7 @@ Deliver transition timeout.
|
|
|
318
290
|
|
|
319
291
|
#### Parameters
|
|
320
292
|
|
|
321
|
-
* `transition` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
293
|
+
* `transition` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
322
294
|
|
|
323
295
|
Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** milliseconds before throwing for a long running transition
|
|
324
296
|
|
|
@@ -348,7 +320,7 @@ Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/
|
|
|
348
320
|
|
|
349
321
|
Mapping of properties used in toString.
|
|
350
322
|
|
|
351
|
-
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
323
|
+
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
352
324
|
|
|
353
325
|
### isServiceProvider
|
|
354
326
|
|
|
@@ -368,7 +340,7 @@ Deliver json representation.
|
|
|
368
340
|
|
|
369
341
|
#### Parameters
|
|
370
342
|
|
|
371
|
-
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
343
|
+
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
372
344
|
|
|
373
345
|
* `options.includeRuntimeInfo` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** include runtime informtion like state
|
|
374
346
|
* `options.includeDefaults` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** include default endpoints
|
|
@@ -401,7 +373,7 @@ or simply assign the attribute value.
|
|
|
401
373
|
|
|
402
374
|
#### Parameters
|
|
403
375
|
|
|
404
|
-
* `config` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
376
|
+
* `config` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
405
377
|
|
|
406
378
|
Returns **[Set](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Set)** of modified attributes
|
|
407
379
|
|
|
@@ -414,7 +386,7 @@ will be called.
|
|
|
414
386
|
|
|
415
387
|
#### Parameters
|
|
416
388
|
|
|
417
|
-
* `config` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
389
|
+
* `config` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
418
390
|
|
|
419
391
|
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)** fillfills when config is applied
|
|
420
392
|
|
|
@@ -434,10 +406,9 @@ Meta information for the config attributes.
|
|
|
434
406
|
* default optional default value of the attribute
|
|
435
407
|
* needsRestart optional modification requires a service restart
|
|
436
408
|
* setter(newValue,attribute) optional function to be used if simple value assignment is not enough
|
|
409
|
+
The Service class only defines the logLevel, and start/stop/restart timeout attribute
|
|
437
410
|
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
|
|
411
|
+
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
441
412
|
|
|
442
413
|
### endpoints
|
|
443
414
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kronos-integration/service",
|
|
3
|
-
"version": "10.4.
|
|
3
|
+
"version": "10.4.33",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
"@kronos-integration/interceptor": "^10.2.27",
|
|
34
34
|
"loglevel-mixin": "^6.1.4",
|
|
35
35
|
"model-attributes": "^4.1.19",
|
|
36
|
-
"remove-sensible-values": "^1.
|
|
36
|
+
"remove-sensible-values": "^1.2.0",
|
|
37
37
|
"statetransition-mixin": "^8.0.2"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"ava": "^4.3.
|
|
40
|
+
"ava": "^4.3.3",
|
|
41
41
|
"c8": "^7.12.0",
|
|
42
42
|
"documentation": "^14.0.0",
|
|
43
|
-
"semantic-release": "^19.0.
|
|
43
|
+
"semantic-release": "^19.0.5"
|
|
44
44
|
},
|
|
45
45
|
"engines": {
|
|
46
46
|
"node": ">=16.16.0"
|