@kronos-integration/endpoint 9.4.45 → 9.4.47

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
@@ -1,5 +1,6 @@
1
1
  [![npm](https://img.shields.io/npm/v/@kronos-integration/endpoint.svg)](https://www.npmjs.com/package/@kronos-integration/endpoint)
2
2
  [![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
3
+ [![Typed with TypeScript](https://flat.badgen.net/badge/icon/Typed?icon=typescript\&label\&labelColor=blue\&color=555555)](https://typescriptlang.org)
3
4
  [![bundlejs](https://deno.bundlejs.com/?q=@kronos-integration/endpoint\&badge=detailed)](https://bundlejs.com/?q=@kronos-integration/endpoint)
4
5
  [![downloads](http://img.shields.io/npm/dm/@kronos-integration/endpoint.svg?style=flat-square)](https://npmjs.org/package/@kronos-integration/endpoint)
5
6
  [![GitHub Issues](https://img.shields.io/github/issues/Kronos-Integration/endpoint.svg?style=flat-square)](https://github.com/Kronos-Integration/endpoint/issues)
@@ -26,6 +27,7 @@ Named communication (end)-points inside of kronos
26
27
  * [isIn](#isin)
27
28
  * [isOpen](#isopen)
28
29
  * [isDummy](#isdummy)
30
+ * [ConnectionState](#connectionstate)
29
31
  * [Endpoint](#endpoint)
30
32
  * [Parameters](#parameters)
31
33
  * [displayName](#displayname)
@@ -50,38 +52,43 @@ Named communication (end)-points inside of kronos
50
52
  * [Parameters](#parameters-5)
51
53
  * [openConnections](#openconnections)
52
54
  * [closeConnections](#closeconnections)
55
+ * [getConnectionState](#getconnectionstate)
56
+ * [Parameters](#parameters-6)
57
+ * [setConnectionState](#setconnectionstate)
58
+ * [Parameters](#parameters-7)
53
59
  * [isEndpoint](#isendpoint)
54
- * [Parameters](#parameters-6)
60
+ * [Parameters](#parameters-8)
55
61
  * [instanciateInterceptors](#instanciateinterceptors)
56
- * [Parameters](#parameters-7)
62
+ * [Parameters](#parameters-9)
57
63
  * [MultiConnectionEndpoint](#multiconnectionendpoint)
58
- * [Parameters](#parameters-8)
59
- * [getConnectionState](#getconnectionstate)
60
- * [Parameters](#parameters-9)
61
- * [setConnectionState](#setconnectionstate)
62
- * [Parameters](#parameters-10)
63
- * [isConnected](#isconnected-1)
64
+ * [Parameters](#parameters-10)
65
+ * [getConnectionState](#getconnectionstate-1)
64
66
  * [Parameters](#parameters-11)
67
+ * [setConnectionState](#setconnectionstate-1)
68
+ * [Parameters](#parameters-12)
69
+ * [isConnected](#isconnected-1)
70
+ * [Parameters](#parameters-13)
65
71
  * [connections](#connections)
72
+ * [connections](#connections-1)
66
73
  * [MultiSendEndpoint](#multisendendpoint)
67
- * [Parameters](#parameters-12)
74
+ * [Parameters](#parameters-14)
68
75
  * [isOut](#isout-1)
69
76
  * [ReceivableEndpoint](#receivableendpoint)
70
- * [Parameters](#parameters-13)
77
+ * [Parameters](#parameters-15)
71
78
  * [isIn](#isin-2)
72
79
  * [receive](#receive-1)
73
80
  * [receive](#receive-2)
74
- * [Parameters](#parameters-14)
81
+ * [Parameters](#parameters-16)
75
82
  * [ReceiveEndpointDefault](#receiveendpointdefault)
76
83
  * [isDefault](#isdefault-1)
77
84
  * [ReceiveEndpointSelfConnectedDefault](#receiveendpointselfconnecteddefault)
78
85
  * [ReceiveEndpoint](#receiveendpoint)
79
- * [Parameters](#parameters-15)
86
+ * [Parameters](#parameters-17)
80
87
  * [isIn](#isin-3)
81
88
  * [SendEndpointDefault](#sendendpointdefault)
82
89
  * [isDefault](#isdefault-2)
83
90
  * [SendEndpoint](#sendendpoint)
84
- * [Parameters](#parameters-16)
91
+ * [Parameters](#parameters-18)
85
92
  * [isOut](#isout-2)
86
93
 
87
94
  ## DummyReceiveEndpoint
@@ -109,6 +116,10 @@ Dummy endpoints are used duiring construction of the endpoint mesh.
109
116
 
110
117
  Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** true
111
118
 
119
+ ## ConnectionState
120
+
121
+ Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
122
+
112
123
  ## Endpoint
113
124
 
114
125
  Connection endpoint.
@@ -227,6 +238,25 @@ Opens all connections.
227
238
 
228
239
  Closes all connections.
229
240
 
241
+ ### getConnectionState
242
+
243
+ Deliver state for a given connection.
244
+
245
+ #### Parameters
246
+
247
+ * `other` **[Endpoint](#endpoint)** 
248
+
249
+ Returns **[ConnectionState](#connectionstate)** 
250
+
251
+ ### setConnectionState
252
+
253
+ Set state for a given connection.
254
+
255
+ #### Parameters
256
+
257
+ * `other` **[Endpoint](#endpoint)** 
258
+ * `state` **[ConnectionState](#connectionstate)** 
259
+
230
260
  ## isEndpoint
231
261
 
232
262
  Check for Endpoint.
@@ -267,7 +297,7 @@ Deliver connection state.
267
297
 
268
298
  #### Parameters
269
299
 
270
- * `other` **Entpoint** 
300
+ * `other` **[Endpoint](#endpoint)** 
271
301
 
272
302
  Returns **any** our state for the connection to other
273
303
 
@@ -277,7 +307,7 @@ Set connection state.
277
307
 
278
308
  #### Parameters
279
309
 
280
- * `other` **Entpoint** 
310
+ * `other` **[Endpoint](#endpoint)** 
281
311
  * `state` **any** for the connection to other
282
312
 
283
313
  ### isConnected
@@ -294,6 +324,10 @@ Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/
294
324
 
295
325
  All connections
296
326
 
327
+ ## connections
328
+
329
+ Type: [Map](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map)<[Endpoint](#endpoint), any>
330
+
297
331
  ## MultiSendEndpoint
298
332
 
299
333
  **Extends MultiConnectionEndpoint**
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@kronos-integration/endpoint",
3
- "version": "9.4.45",
3
+ "version": "9.4.47",
4
4
  "publishConfig": {
5
- "access": "public"
5
+ "access": "public",
6
+ "provenance": true
6
7
  },
7
8
  "exports": {
8
9
  ".": "./src/module.mjs"
@@ -27,24 +28,26 @@
27
28
  "test:ava": "ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs",
28
29
  "cover": "c8 -x 'tests/**/*' --temp-directory build/tmp ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs && c8 report -r lcov -o build/coverage --temp-directory build/tmp",
29
30
  "docs": "documentation readme --section=API ./src/**/*.mjs",
30
- "lint": "npm run lint:docs",
31
- "lint:docs": "documentation lint ./src/**/*.mjs"
31
+ "lint": "npm run lint:docs && npm run lint:tsc",
32
+ "lint:docs": "documentation lint ./src/**/*.mjs",
33
+ "lint:tsc": "tsc --allowJs --checkJs --noEmit -t esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
32
34
  },
33
35
  "dependencies": {
34
- "@kronos-integration/interceptor": "^10.2.37"
36
+ "@kronos-integration/interceptor": "^10.2.38"
35
37
  },
36
38
  "devDependencies": {
37
- "ava": "^6.0.1",
38
- "c8": "^9.0.0",
39
- "documentation": "^14.0.2",
40
- "semantic-release": "^22.0.12"
39
+ "ava": "^6.1.1",
40
+ "c8": "^9.1.0",
41
+ "documentation": "^14.0.3",
42
+ "semantic-release": "^23.0.2",
43
+ "typescript": "^5.3.3"
41
44
  },
42
45
  "engines": {
43
- "node": ">=20.10.0"
46
+ "node": ">=20.11.0"
44
47
  },
45
48
  "repository": {
46
49
  "type": "git",
47
- "url": "https://github.com/Kronos-Integration/endpoint"
50
+ "url": "git+https://github.com/Kronos-Integration/endpoint.git"
48
51
  },
49
52
  "bugs": {
50
53
  "url": "https://github.com/Kronos-Integration/endpoint/issues"
@@ -53,7 +56,8 @@
53
56
  "template": {
54
57
  "inheritFrom": [
55
58
  "arlac77/template-arlac77-github",
56
- "arlac77/template-kronos-component"
59
+ "arlac77/template-kronos-component",
60
+ "arlac77/template-typescript"
57
61
  ]
58
62
  }
59
63
  }
package/src/endpoint.mjs CHANGED
@@ -129,7 +129,7 @@ export class Endpoint {
129
129
 
130
130
  /**
131
131
  * Deliver data flow direction.
132
- * @return {string} delivers data flow direction 'in', 'out', 'inout' or undefined
132
+ * @return {string|undefined} delivers data flow direction 'in', 'out', 'inout' or undefined
133
133
  */
134
134
  get direction() {
135
135
  if (this.isIn) {
@@ -251,7 +251,7 @@ export class Endpoint {
251
251
  /**
252
252
  * Actually start with the communication.
253
253
  * @param {Endpoint} other
254
- * @param {boolean} backpointer true if this is the call form back call from the other side
254
+ * @param {boolean?} backpointer true if this is the call from back call from the other side
255
255
  */
256
256
  openConnection(other, backpointer) {
257
257
  if (other !== undefined) {
@@ -276,7 +276,7 @@ export class Endpoint {
276
276
  /**
277
277
  * Actually stop the communication.
278
278
  * @param {Endpoint} other
279
- * @param {boolean} backpointer true if this is the call form back call from the other side
279
+ * @param {boolean?} backpointer true if this is the call from back call from the other side
280
280
  */
281
281
  closeConnection(other, backpointer) {
282
282
  if (other !== undefined) {
@@ -310,6 +310,9 @@ export class Endpoint {
310
310
  }
311
311
  }
312
312
 
313
+ /**
314
+ * @return {Iterable<any>}
315
+ */
313
316
  *connections() {}
314
317
 
315
318
  addConnection() {}
@@ -330,7 +333,7 @@ export class Endpoint {
330
333
  */
331
334
  setConnectionState(other, state) {}
332
335
 
333
- didConnect() {}
336
+ didConnect(a,b) {}
334
337
 
335
338
  get receivingInterceptors() {
336
339
  return [];
@@ -1,4 +1,4 @@
1
- import { isEndpoint } from "./endpoint.mjs";
1
+ import { isEndpoint, Endpoint } from "./endpoint.mjs";
2
2
  import { ReceivableEndpoint } from "./receivable-endpoint.mjs";
3
3
 
4
4
  /**
@@ -7,7 +7,7 @@ import { ReceivableEndpoint } from "./receivable-endpoint.mjs";
7
7
  */
8
8
  export class MultiConnectionEndpoint extends ReceivableEndpoint {
9
9
 
10
- #connections = new Map();
10
+ /** @type {Map<Endpoint,any>} */ #connections = new Map();
11
11
 
12
12
  constructor(name, owner, options) {
13
13
  super(name, owner, options);
@@ -19,7 +19,7 @@ export class MultiConnectionEndpoint extends ReceivableEndpoint {
19
19
 
20
20
  /**
21
21
  * Deliver connection state.
22
- * @param {Entpoint} other
22
+ * @param {Endpoint} other
23
23
  * @return {any} our state for the connection to other
24
24
  */
25
25
  getConnectionState(other) {
@@ -28,7 +28,7 @@ export class MultiConnectionEndpoint extends ReceivableEndpoint {
28
28
 
29
29
  /**
30
30
  * Set connection state.
31
- * @param {Entpoint} other
31
+ * @param {Endpoint} other
32
32
  * @param {any} state for the connection to other
33
33
  */
34
34
  setConnectionState(other, state) {
@@ -1,4 +1,5 @@
1
1
  import { MultiConnectionEndpoint } from "./multi-connection-endpoint.mjs";
2
+ import { Endpoint } from "./endpoint.mjs";
2
3
 
3
4
  /**
4
5
  * Multiple Sending Endpoint.
@@ -1,4 +1,5 @@
1
1
  import { ReceiveEndpointDefault } from "./receive-endpoint-default.mjs";
2
+ import { Endpoint } from "./endpoint.mjs";
2
3
 
3
4
  /**
4
5
  * Receiving endpoint wich can also send to itself.
@@ -20,6 +21,11 @@ export class ReceiveEndpointSelfConnectedDefault extends ReceiveEndpointDefault
20
21
  return super.addConnection(other, backpointer);
21
22
  }
22
23
 
24
+ /**
25
+ * Actually stop the communication.
26
+ * @param {Endpoint} other
27
+ * @param {boolean?} backpointer true if this is the call form back call from the other side
28
+ */
23
29
  removeConnection(other, backpointer) {
24
30
  if (other === this) {
25
31
  return;
@@ -1,4 +1,5 @@
1
1
  import { MultiConnectionEndpoint } from "./multi-connection-endpoint.mjs";
2
+ import { Endpoint } from "./endpoint.mjs";
2
3
 
3
4
  /**
4
5
  * Receiving Endpoint.
@@ -1,4 +1,4 @@
1
- import { isEndpoint } from "./endpoint.mjs";
1
+ import { isEndpoint, Endpoint} from "./endpoint.mjs";
2
2
  import { ReceivableEndpoint } from "./receivable-endpoint.mjs";
3
3
 
4
4
  /**