@kronos-integration/service 15.3.0 → 15.4.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/README.md CHANGED
@@ -63,19 +63,21 @@ The transitions are:
63
63
  * [defineServiceConsumerProperties](#defineserviceconsumerproperties)
64
64
  * [Parameters](#parameters-6)
65
65
  * [ServiceLogger](#servicelogger)
66
+ * [logEntry](#logentry)
67
+ * [Parameters](#parameters-7)
66
68
  * [autostart](#autostart-1)
67
69
  * [name](#name-1)
68
70
  * [endpoints](#endpoints-1)
69
71
  * [Service](#service)
70
- * [Parameters](#parameters-7)
72
+ * [Parameters](#parameters-8)
71
73
  * [Properties](#properties-1)
72
74
  * [extendetName](#extendetname)
73
75
  * [stateChanged](#statechanged)
74
- * [Parameters](#parameters-8)
75
- * [rejectWrongState](#rejectwrongstate)
76
76
  * [Parameters](#parameters-9)
77
- * [timeoutForTransition](#timeoutfortransition)
77
+ * [rejectWrongState](#rejectwrongstate)
78
78
  * [Parameters](#parameters-10)
79
+ * [timeoutForTransition](#timeoutfortransition)
80
+ * [Parameters](#parameters-11)
79
81
  * [\_start](#_start)
80
82
  * [\_stop](#_stop)
81
83
  * [\_restart](#_restart)
@@ -84,20 +86,20 @@ The transitions are:
84
86
  * [isServiceProvider](#isserviceprovider)
85
87
  * [toString](#tostring)
86
88
  * [toJSONWithOptions](#tojsonwithoptions)
87
- * [Parameters](#parameters-11)
89
+ * [Parameters](#parameters-12)
88
90
  * [name](#name-2)
89
91
  * [autostart](#autostart-2)
90
92
  * [\_configure](#_configure)
91
- * [Parameters](#parameters-12)
92
- * [configure](#configure-1)
93
93
  * [Parameters](#parameters-13)
94
- * [getCredential](#getcredential)
94
+ * [configure](#configure-1)
95
95
  * [Parameters](#parameters-14)
96
- * [getCredentials](#getcredentials)
96
+ * [getCredential](#getcredential)
97
97
  * [Parameters](#parameters-15)
98
+ * [getCredentials](#getcredentials)
99
+ * [Parameters](#parameters-16)
98
100
  * [storePersistentCredentials](#storepersistentcredentials)
99
101
  * [log](#log)
100
- * [Parameters](#parameters-16)
102
+ * [Parameters](#parameters-17)
101
103
  * [attributes](#attributes)
102
104
  * [endpoints](#endpoints-2)
103
105
  * [StandaloneServiceProvider](#standaloneserviceprovider)
@@ -203,6 +205,14 @@ Assign services based on a configuration.
203
205
 
204
206
  Log receiving service.
205
207
 
208
+ ### logEntry
209
+
210
+ #### Parameters
211
+
212
+ * `entry` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
213
+
214
+ * `entry.severity` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
215
+
206
216
  ### autostart
207
217
 
208
218
  We always start immediate.
@@ -310,14 +320,14 @@ Closes all endpoint connections.
310
320
  Restart action.
311
321
  default implementation does a \_stop() and a \_start()
312
322
 
313
- Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)** fulfills after start
323
+ Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<any>** fulfills after start
314
324
 
315
325
  ### restartIfRunning
316
326
 
317
327
  Restarts if in running mode.
318
328
  Otherwise does nothing.
319
329
 
320
- Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)** resolves when restart is done (or immediate if no restart triggered)
330
+ Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<any>** resolves when restart is done (or immediate if no restart triggered)
321
331
 
322
332
  ### toStringAttributes
323
333
 
@@ -403,11 +413,11 @@ Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/
403
413
 
404
414
  ### getCredentials
405
415
 
406
- Retrieve all credential attribute values.
416
+ Retrieve all (filtered) credential attribute values.
407
417
 
408
418
  #### Parameters
409
419
 
410
- * `filter` (optional, default `(name,attribute)=>attribute.credential`)
420
+ * `filter` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** (optional, default `(name,attribute)=>attribute.credential`)
411
421
 
412
422
  Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>**&#x20;
413
423
 
@@ -415,6 +425,8 @@ Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/
415
425
 
416
426
  Load and store persistent credentials in the service attributes.
417
427
 
428
+ Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined)>**&#x20;
429
+
418
430
  ### log
419
431
 
420
432
  Adds service name to the log event.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kronos-integration/service",
3
- "version": "15.3.0",
3
+ "version": "15.4.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -27,6 +27,15 @@ export function ServiceProviderMixin(
27
27
  superclass.attributes
28
28
  );
29
29
 
30
+ static get endpoints() {
31
+ return {
32
+ ...super.endpoints,
33
+ info: {
34
+ receive: "info"
35
+ }
36
+ };
37
+ }
38
+
30
39
  listeners = {};
31
40
  interceptorFactories = {};
32
41
  serviceFactories = {};
@@ -105,6 +114,16 @@ export function ServiceProviderMixin(
105
114
  return true;
106
115
  }
107
116
 
117
+ info() {
118
+ return this.toJSONWithOptions({
119
+ includeRuntimeInfo: false,
120
+ includeDefaults: true,
121
+ includeName: true,
122
+ includeConfig: true,
123
+ includePrivate: false
124
+ });
125
+ }
126
+
108
127
  /**
109
128
  * Register service or interceptor factories.
110
129
  *
@@ -33,6 +33,7 @@ export function ServiceProviderMixin(superclass: typeof Service, serviceLoggerCl
33
33
  * @return {boolean} true
34
34
  */
35
35
  get isServiceProvider(): boolean;
36
+ info(): any;
36
37
  /**
37
38
  * Register service or interceptor factories.
38
39
  *
@@ -157,9 +158,9 @@ export function ServiceProviderMixin(superclass: typeof Service, serviceLoggerCl
157
158
  log(level: string, arg: any): void;
158
159
  };
159
160
  attributes: any;
161
+ get endpoints(): any;
160
162
  get description(): string;
161
163
  get name(): string;
162
- get endpoints(): any;
163
164
  };
164
165
  import { Service } from "./service.mjs";
165
166
  import { ServiceLogger } from "./service-logger.mjs";
@@ -11,6 +11,7 @@ declare const StandaloneServiceProvider_base: {
11
11
  removeListener(name: any, listener: any): void;
12
12
  get owner(): /*elided*/ any;
13
13
  get isServiceProvider(): boolean;
14
+ info(): any;
14
15
  registerFactories(factories: [typeof Service | string]): Promise<void>;
15
16
  registerInterceptorFactory(factory: typeof import("@kronos-integration/interceptor").Interceptor): typeof import("@kronos-integration/interceptor").Interceptor;
16
17
  unregisterInterceptorFactory(factory: typeof import("@kronos-integration/interceptor").Interceptor): void;
@@ -59,9 +60,9 @@ declare const StandaloneServiceProvider_base: {
59
60
  log(level: string, arg: any): void;
60
61
  };
61
62
  attributes: any;
63
+ get endpoints(): any;
62
64
  get description(): string;
63
65
  get name(): string;
64
- get endpoints(): any;
65
66
  };
66
67
  /**
67
68
  * Simple service manager (for examples and testing only).