@kronos-integration/endpoint 11.0.3 → 11.0.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kronos-integration/endpoint",
3
- "version": "11.0.3",
3
+ "version": "11.0.4",
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.5"
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";