@kronos-integration/endpoint 11.0.2 → 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 +4 -4
- package/src/endpoint.mjs +8 -0
- package/src/receivable-endpoint.mjs +9 -0
- package/src/send-endpoint.mjs +6 -0
- package/types/endpoint.d.mts +15 -17
- package/types/multi-connection-endpoint.d.mts +1 -0
- package/types/receivable-endpoint.d.mts +13 -2
- package/types/send-endpoint.d.mts +10 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kronos-integration/endpoint",
|
|
3
|
-
"version": "11.0.
|
|
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.
|
|
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.
|
|
52
|
+
"node": ">=24.11.1"
|
|
53
53
|
},
|
|
54
54
|
"repository": {
|
|
55
55
|
"type": "git",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"arlac77/template-typescript"
|
|
67
67
|
]
|
|
68
68
|
},
|
|
69
|
-
"packageManager": "npm@11.6.
|
|
69
|
+
"packageManager": "npm@11.6.4+sha512.1118cab46a05a50aee6bff5b1b4fa1df18afff89d57465620a3518035026955db87c5bdf9d207b07b7487d99f2490d450cb774655ad63ec2cba7bf1d0ad25d45"
|
|
70
70
|
}
|
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) {
|
package/src/send-endpoint.mjs
CHANGED
|
@@ -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)) {
|
package/types/endpoint.d.mts
CHANGED
|
@@ -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?:
|
|
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
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
*/
|
|
@@ -6,7 +6,18 @@
|
|
|
6
6
|
* @param {Function} [options.receivingInterceptors]
|
|
7
7
|
*/
|
|
8
8
|
export class ReceivableEndpoint extends Endpoint {
|
|
9
|
-
|
|
10
|
-
|
|
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";
|