@kronos-integration/endpoint 11.0.3 → 11.0.5

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
@@ -37,68 +37,70 @@ Named communication (end)-points inside of kronos
37
37
  * [isOut](#isout)
38
38
  * [direction](#direction)
39
39
  * [jsonAttributes](#jsonattributes)
40
+ * [toJSONWithOptions](#tojsonwithoptions)
41
+ * [Parameters](#parameters-2)
40
42
  * [hasInterceptors](#hasinterceptors)
41
43
  * [connectable](#connectable)
42
- * [Parameters](#parameters-2)
44
+ * [Parameters](#parameters-3)
43
45
  * [hasConnections](#hasconnections)
44
46
  * [isConnected](#isconnected)
45
- * [Parameters](#parameters-3)
46
- * [openConnection](#openconnection)
47
47
  * [Parameters](#parameters-4)
48
- * [closeConnection](#closeconnection)
48
+ * [openConnection](#openconnection)
49
49
  * [Parameters](#parameters-5)
50
+ * [closeConnection](#closeconnection)
51
+ * [Parameters](#parameters-6)
50
52
  * [openConnections](#openconnections)
51
53
  * [closeConnections](#closeconnections)
52
54
  * [connections](#connections)
53
55
  * [addConnection](#addconnection)
54
- * [Parameters](#parameters-6)
55
- * [removeConnection](#removeconnection)
56
56
  * [Parameters](#parameters-7)
57
- * [getConnectionState](#getconnectionstate)
57
+ * [removeConnection](#removeconnection)
58
58
  * [Parameters](#parameters-8)
59
- * [setConnectionState](#setconnectionstate)
59
+ * [getConnectionState](#getconnectionstate)
60
60
  * [Parameters](#parameters-9)
61
- * [didConnect](#didconnect)
61
+ * [setConnectionState](#setconnectionstate)
62
62
  * [Parameters](#parameters-10)
63
+ * [didConnect](#didconnect)
64
+ * [Parameters](#parameters-11)
63
65
  * [isEndpoint](#isendpoint)
64
- * [Parameters](#parameters-11)
65
- * [instanciateInterceptors](#instanciateinterceptors)
66
66
  * [Parameters](#parameters-12)
67
- * [MultiConnectionEndpoint](#multiconnectionendpoint)
67
+ * [instanciateInterceptors](#instanciateinterceptors)
68
68
  * [Parameters](#parameters-13)
69
+ * [MultiConnectionEndpoint](#multiconnectionendpoint)
70
+ * [Parameters](#parameters-14)
69
71
  * [getConnectionState](#getconnectionstate-1)
70
- * [Parameters](#parameters-14)
71
- * [setConnectionState](#setconnectionstate-1)
72
72
  * [Parameters](#parameters-15)
73
- * [removeConnection](#removeconnection-1)
73
+ * [setConnectionState](#setconnectionstate-1)
74
74
  * [Parameters](#parameters-16)
75
- * [isConnected](#isconnected-1)
75
+ * [removeConnection](#removeconnection-1)
76
76
  * [Parameters](#parameters-17)
77
+ * [isConnected](#isconnected-1)
78
+ * [Parameters](#parameters-18)
77
79
  * [connections](#connections-1)
78
80
  * [connections](#connections-2)
79
81
  * [MultiSendEndpoint](#multisendendpoint)
80
- * [Parameters](#parameters-18)
82
+ * [Parameters](#parameters-19)
81
83
  * [isOut](#isout-1)
82
84
  * [ReceivableEndpoint](#receivableendpoint)
83
- * [Parameters](#parameters-19)
85
+ * [Parameters](#parameters-20)
84
86
  * [isIn](#isin-2)
85
87
  * [ReceiveEndpointDefault](#receiveendpointdefault)
86
88
  * [isDefault](#isdefault-1)
87
89
  * [ReceiveEndpointSelfConnectedDefault](#receiveendpointselfconnecteddefault)
88
90
  * [removeConnection](#removeconnection-2)
89
- * [Parameters](#parameters-20)
91
+ * [Parameters](#parameters-21)
90
92
  * [ReceiveEndpoint](#receiveendpoint)
91
- * [Parameters](#parameters-21)
93
+ * [Parameters](#parameters-22)
92
94
  * [isIn](#isin-3)
93
95
  * [SendEndpointDefault](#sendendpointdefault)
94
96
  * [isDefault](#isdefault-2)
95
97
  * [SendEndpoint](#sendendpoint)
96
- * [Parameters](#parameters-22)
98
+ * [Parameters](#parameters-23)
97
99
  * [isOut](#isout-2)
98
100
  * [addConnection](#addconnection-1)
99
- * [Parameters](#parameters-23)
100
- * [removeConnection](#removeconnection-3)
101
101
  * [Parameters](#parameters-24)
102
+ * [removeConnection](#removeconnection-3)
103
+ * [Parameters](#parameters-25)
102
104
  * [SendReceiveEndpoint](#sendreceiveendpoint)
103
105
  * [isIn](#isin-4)
104
106
 
@@ -173,6 +175,8 @@ Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G
173
175
 
174
176
  * `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `{includeRuntimeInfo:true}`)
175
177
 
178
+ * `options.includeRuntimeInfo` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** 
179
+
176
180
  ### isIn
177
181
 
178
182
  Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** false
@@ -191,6 +195,14 @@ Returns **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/
191
195
 
192
196
  Additional attributes to present in json output.
193
197
 
198
+ ### toJSONWithOptions
199
+
200
+ #### Parameters
201
+
202
+ * `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** 
203
+
204
+ Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
205
+
194
206
  ### hasInterceptors
195
207
 
196
208
  Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** true if there is at least one interceptor assigned
@@ -405,9 +417,6 @@ Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/
405
417
  * `owner` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** of the endpoint (service)
406
418
  * `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
407
419
 
408
- * `options.receive` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** reciever function
409
- * `options.receivingInterceptors` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** 
410
-
411
420
  ### isIn
412
421
 
413
422
  Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** true is receive function is present
@@ -486,10 +495,7 @@ Back connections to any further endpoints will not be established
486
495
 
487
496
  * `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** endpoint name
488
497
  * `owner` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** of the endpoint (service)
489
- * `options` **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))** 
490
-
491
- * `options.connected` **([Endpoint](#endpoint) | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))?** where te requests are delivered to
492
- * `options.didConnect` **([Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))?** called after receiver is present
498
+ * `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
493
499
 
494
500
  ### isOut
495
501
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kronos-integration/endpoint",
3
- "version": "11.0.3",
3
+ "version": "11.0.5",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -39,7 +39,7 @@
39
39
  "lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule --target es2024 --lib es2024 -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
40
40
  },
41
41
  "dependencies": {
42
- "@kronos-integration/interceptor": "^13.0.3"
42
+ "@kronos-integration/interceptor": "^13.0.6"
43
43
  },
44
44
  "devDependencies": {
45
45
  "ava": "^6.4.1",
@@ -49,7 +49,7 @@
49
49
  "typescript": "^5.9.3"
50
50
  },
51
51
  "engines": {
52
- "node": ">=24.10.0"
52
+ "node": ">=24.11.1"
53
53
  },
54
54
  "repository": {
55
55
  "type": "git",
package/src/endpoint.mjs CHANGED
@@ -14,6 +14,8 @@ export class Endpoint {
14
14
  * @param {Object} options
15
15
  * @param {function(Endpoint,Endpoint):void|undefined} [options.didConnect] called after receiver is present
16
16
  * @param {Interceptor[]|string[]|undefined} [options.interceptors] interceptors
17
+ * @param {Endpoint} [options.connected]
18
+ * @param {Array<Interceptor>} [options.receivingInterceptors]
17
19
  */
18
20
  constructor(name, owner, options) {
19
21
  this.name = name;
@@ -66,6 +68,7 @@ export class Endpoint {
66
68
  /**
67
69
  *
68
70
  * @param {Object} options
71
+ * @param {boolean} [options.includeRuntimeInfo]
69
72
  */
70
73
  connectionNamesWithStates(options = { includeRuntimeInfo: true }) {
71
74
  return [...this.connections()]
@@ -157,6 +160,11 @@ export class Endpoint {
157
160
  return [];
158
161
  }
159
162
 
163
+ /**
164
+ *
165
+ * @param {Object} [options]
166
+ * @returns {Object}
167
+ */
160
168
  toJSONWithOptions(options) {
161
169
  const json = {};
162
170
 
@@ -1,4 +1,5 @@
1
1
  import { Endpoint, instanciateInterceptors } from "./endpoint.mjs";
2
+ import { Interceptor } from "@kronos-integration/interceptor";
2
3
 
3
4
  /**
4
5
  * @param {string} name endpoint name
@@ -8,6 +9,14 @@ import { Endpoint, instanciateInterceptors } from "./endpoint.mjs";
8
9
  * @param {Function} [options.receivingInterceptors]
9
10
  */
10
11
  export class ReceivableEndpoint extends Endpoint {
12
+
13
+ /**
14
+ * @param {string} name endpoint name
15
+ * @param {Object} owner of the endpoint (service)
16
+ * @param {Object} options
17
+ * @param {Function} [options.receive]
18
+ * @param {Array<Interceptor>} [options.receivingInterceptors]
19
+ */
11
20
  constructor(name, owner, options) {
12
21
  super(name, owner, options);
13
22
  if (options?.receive) {
@@ -15,6 +15,12 @@ export class SendEndpoint extends ReceivableEndpoint {
15
15
  #connection;
16
16
  #state;
17
17
 
18
+ /**
19
+ * @param {string} name endpoint name
20
+ * @param {Object} owner of the endpoint (service)
21
+ * @param {Object} options
22
+ * @param {Endpoint} [options.connected]
23
+ */
18
24
  constructor(name, owner, options) {
19
25
  super(name, owner, options);
20
26
  if (isEndpoint(options?.connected)) {
@@ -24,10 +24,14 @@ export class Endpoint {
24
24
  * @param {Object} options
25
25
  * @param {function(Endpoint,Endpoint):void|undefined} [options.didConnect] called after receiver is present
26
26
  * @param {Interceptor[]|string[]|undefined} [options.interceptors] interceptors
27
+ * @param {Endpoint} [options.connected]
28
+ * @param {Array<Interceptor>} [options.receivingInterceptors]
27
29
  */
28
30
  constructor(name: string, owner: any, options: {
29
31
  didConnect?: (arg0: Endpoint, arg1: Endpoint) => void | undefined;
30
32
  interceptors?: Interceptor[] | string[] | undefined;
33
+ connected?: Endpoint;
34
+ receivingInterceptors?: Array<Interceptor>;
31
35
  });
32
36
  name: string;
33
37
  owner: any;
@@ -63,8 +67,11 @@ export class Endpoint {
63
67
  /**
64
68
  *
65
69
  * @param {Object} options
70
+ * @param {boolean} [options.includeRuntimeInfo]
66
71
  */
67
- connectionNamesWithStates(options?: any): string[];
72
+ connectionNamesWithStates(options?: {
73
+ includeRuntimeInfo?: boolean;
74
+ }): string[];
68
75
  toString(): string;
69
76
  get identifier(): string;
70
77
  /**
@@ -80,26 +87,17 @@ export class Endpoint {
80
87
  * @return {string|undefined} delivers data flow direction 'in', 'out', 'inout' or undefined
81
88
  */
82
89
  get direction(): string | undefined;
83
- toJSON(): {
84
- in: boolean;
85
- out: boolean;
86
- open: boolean;
87
- dummy: boolean;
88
- connected: string | string[];
89
- interceptors: any[];
90
- };
90
+ toJSON(): any;
91
91
  /**
92
92
  * Additional attributes to present in json output.
93
93
  */
94
94
  get jsonAttributes(): any[];
95
- toJSONWithOptions(options: any): {
96
- in: boolean;
97
- out: boolean;
98
- open: boolean;
99
- dummy: boolean;
100
- connected: string | string[];
101
- interceptors: any[];
102
- };
95
+ /**
96
+ *
97
+ * @param {Object} [options]
98
+ * @returns {Object}
99
+ */
100
+ toJSONWithOptions(options?: any): any;
103
101
  /**
104
102
  * @return {boolean} true if there is at least one interceptor assigned
105
103
  */
@@ -3,6 +3,7 @@
3
3
  * Can hold several connections.
4
4
  */
5
5
  export class MultiConnectionEndpoint extends ReceivableEndpoint {
6
+ constructor(name: any, owner: any, options: any);
6
7
  addConnection(other: any, backpointer: any): void;
7
8
  /**
8
9
  * All connections
@@ -6,7 +6,18 @@
6
6
  * @param {Function} [options.receivingInterceptors]
7
7
  */
8
8
  export class ReceivableEndpoint extends Endpoint {
9
- constructor(name: any, owner: any, options: any);
10
- receive: any;
9
+ /**
10
+ * @param {string} name endpoint name
11
+ * @param {Object} owner of the endpoint (service)
12
+ * @param {Object} options
13
+ * @param {Function} [options.receive]
14
+ * @param {Array<Interceptor>} [options.receivingInterceptors]
15
+ */
16
+ constructor(name: string, owner: any, options: {
17
+ receive?: Function;
18
+ receivingInterceptors?: Array<Interceptor>;
19
+ });
20
+ receive: Function;
11
21
  }
12
22
  import { Endpoint } from "./endpoint.mjs";
23
+ import { Interceptor } from "@kronos-integration/interceptor";
@@ -9,6 +9,15 @@
9
9
  * @param {Function|undefined} [options.didConnect] called after receiver is present
10
10
  */
11
11
  export class SendEndpoint extends ReceivableEndpoint {
12
+ /**
13
+ * @param {string} name endpoint name
14
+ * @param {Object} owner of the endpoint (service)
15
+ * @param {Object} options
16
+ * @param {Endpoint} [options.connected]
17
+ */
18
+ constructor(name: string, owner: any, options: {
19
+ connected?: Endpoint;
20
+ });
12
21
  getConnectionState(other: any): any;
13
22
  setConnectionState(other: any, state: any): void;
14
23
  connections(): Generator<any, void, unknown>;
@@ -16,3 +25,4 @@ export class SendEndpoint extends ReceivableEndpoint {
16
25
  #private;
17
26
  }
18
27
  import { ReceivableEndpoint } from "./receivable-endpoint.mjs";
28
+ import { Endpoint } from "./endpoint.mjs";