@kronos-integration/endpoint 11.1.6 → 11.1.7

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,11 +1,11 @@
1
1
  {
2
2
  "name": "@kronos-integration/endpoint",
3
- "version": "11.1.6",
3
+ "version": "11.1.7",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
7
7
  },
8
- "packageManager": "npm@11.16.0",
8
+ "packageManager": "npm@11.18.0",
9
9
  "types": "./types/module.d.mts",
10
10
  "exports": {
11
11
  ".": {
@@ -40,19 +40,14 @@
40
40
  "lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule --target esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
41
41
  },
42
42
  "dependencies": {
43
- "@kronos-integration/interceptor": "^13.3.2"
43
+ "@kronos-integration/interceptor": "^13.3.5"
44
44
  },
45
45
  "devDependencies": {
46
46
  "ava": "^8.0.1",
47
- "c8": "^11.0.0",
47
+ "c8": "^12.0.0",
48
48
  "documentation": "^14.0.3",
49
- "semantic-release": "^25.0.5",
50
- "typescript": "^6.0.3"
51
- },
52
- "overrides": {
53
- "c8": {
54
- "yargs": "^18.0.0"
55
- }
49
+ "semantic-release": "^25.0.8",
50
+ "typescript": "^7.0.2"
56
51
  },
57
52
  "engines": {
58
53
  "node": ">=26.1.0"
@@ -1,11 +1,25 @@
1
+ import { Endpoint } from "./endpoint.mjs";
1
2
  /**
2
3
  * Dummy endpoints are used during construction of the endpoint mesh.
3
4
  * The will be replaces by real endpoints during the resolving phase.
4
5
  */
5
- export class DummyReceiveEndpoint extends Endpoint {
6
+ export declare class DummyReceiveEndpoint extends Endpoint {
6
7
  /**
7
8
  * dummy does nothing by intention.
8
9
  */
9
10
  receive(): Promise<void>;
11
+ /**
12
+ * @return {boolean} true
13
+ */
14
+ get isIn(): boolean;
15
+ /**
16
+ * @return {boolean} true
17
+ */
18
+ get isOpen(): boolean;
19
+ /**
20
+ * Indicate whatever we are a dummy endpoint.
21
+ * Dummy endpoints are used duiring construction of the endpoint mesh.
22
+ * @return {boolean} true
23
+ */
24
+ get isDummy(): boolean;
10
25
  }
11
- import { Endpoint } from "./endpoint.mjs";
@@ -1,23 +1,15 @@
1
- /**
2
- * Check for Endpoint.
3
- * @param {any} object to be checked
4
- * @return {boolean} true if object is an Endpoint
5
- */
6
- export function isEndpoint(object: any): boolean;
7
- /**
8
- * Instanciate interceptors from its definitions.
9
- * @param {Interceptor[]|string[]|undefined} interceptors
10
- * @param {Object} owner
11
- * @return {Interceptor[]}
12
- */
13
- export function instanciateInterceptors(interceptors: Interceptor[] | string[] | undefined, owner: Object): Interceptor[];
1
+ import { Interceptor } from "@kronos-integration/interceptor";
2
+ export type ConnectionState = Object;
14
3
  /**
15
4
  * @typedef {Object} ConnectionState
16
5
  */
17
6
  /**
18
7
  * Connection endpoint.
19
8
  */
20
- export class Endpoint {
9
+ export declare class Endpoint {
10
+ name: string;
11
+ owner: Object;
12
+ interceptors: Interceptor[];
21
13
  /**
22
14
  * @param {string} name endpoint name
23
15
  * @param {Object} owner of the endpoint (service)
@@ -27,21 +19,7 @@ export class Endpoint {
27
19
  * @param {Endpoint} [options.connected]
28
20
  * @param {Array<Interceptor>} [options.receivingInterceptors]
29
21
  */
30
- constructor(name: string, owner: Object, options: {
31
- didConnect?: ((arg0: Endpoint, arg1: Endpoint) => void | undefined) | undefined;
32
- interceptors?: Interceptor[] | string[] | undefined;
33
- connected?: Endpoint | undefined;
34
- receivingInterceptors?: Interceptor[] | undefined;
35
- });
36
- name: string;
37
- owner: Object;
38
- /**
39
- *
40
- * @param {Endpoint} endpoint
41
- * @param {Endpoint} other
42
- */
43
- didConnect(endpoint: Endpoint, other: Endpoint): void;
44
- interceptors: Interceptor[];
22
+ constructor(name: string, owner: Object, options: Object);
45
23
  /**
46
24
  * Name as presented for humans.
47
25
  * @return {string}
@@ -70,7 +48,7 @@ export class Endpoint {
70
48
  * @param {boolean} [options.includeRuntimeInfo]
71
49
  */
72
50
  connectionNamesWithStates(options?: {
73
- includeRuntimeInfo?: boolean | undefined;
51
+ includeRuntimeInfo?: boolean;
74
52
  }): string[];
75
53
  toString(): string;
76
54
  get identifier(): string;
@@ -168,6 +146,24 @@ export class Endpoint {
168
146
  * @param {ConnectionState} state
169
147
  */
170
148
  setConnectionState(other: Endpoint, state: ConnectionState): void;
149
+ /**
150
+ *
151
+ * @param {Endpoint} endpoint
152
+ * @param {Endpoint} other
153
+ */
154
+ didConnect(endpoint: Endpoint, other: Endpoint): void;
171
155
  get receivingInterceptors(): never[];
172
156
  }
173
- export type ConnectionState = Object;
157
+ /**
158
+ * Check for Endpoint.
159
+ * @param {any} object to be checked
160
+ * @return {boolean} true if object is an Endpoint
161
+ */
162
+ export declare function isEndpoint(object: any): boolean;
163
+ /**
164
+ * Instanciate interceptors from its definitions.
165
+ * @param {Interceptor[]|string[]|undefined} interceptors
166
+ * @param {Object} owner
167
+ * @return {Interceptor[]}
168
+ */
169
+ export declare function instanciateInterceptors(interceptors: Interceptor[] | string[] | undefined, owner: Object): Interceptor[];
@@ -1,8 +1,11 @@
1
+ import { Endpoint } from "./endpoint.mjs";
2
+ import { ReceivableEndpoint } from "./receivable-endpoint.mjs";
1
3
  /**
2
4
  * Multiple connection endpoint.
3
5
  * Can hold several connections.
4
6
  */
5
- export class MultiConnectionEndpoint extends ReceivableEndpoint {
7
+ export declare class MultiConnectionEndpoint extends ReceivableEndpoint {
8
+ #private;
6
9
  constructor(name: any, owner: any, options: any);
7
10
  /**
8
11
  * Deliver connection state.
@@ -23,11 +26,14 @@ export class MultiConnectionEndpoint extends ReceivableEndpoint {
23
26
  * @param {boolean?} [backpointer] true if this is the call form back call from the other side
24
27
  */
25
28
  removeConnection(other: Endpoint, backpointer?: boolean | null): void;
29
+ /**
30
+ * Check connectivity.
31
+ * @param {Endpoint} other
32
+ * @return {boolean} true if we are connected with other
33
+ */
34
+ isConnected(other: Endpoint): boolean;
26
35
  /**
27
36
  * All connections
28
37
  */
29
38
  connections(): Generator<Endpoint, void, unknown>;
30
- #private;
31
39
  }
32
- import { ReceivableEndpoint } from "./receivable-endpoint.mjs";
33
- import { Endpoint } from "./endpoint.mjs";
@@ -1,3 +1,4 @@
1
+ import { MultiConnectionEndpoint } from "./multi-connection-endpoint.mjs";
1
2
  /**
2
3
  * Multiple Sending Endpoint.
3
4
  * Can hold several connections.
@@ -8,8 +9,12 @@
8
9
  * @param {Endpoint} [options.connected] where te requests are delivered to
9
10
  * @param {Function} [options.didConnect] called after receiver is present
10
11
  */
11
- export class MultiSendEndpoint extends MultiConnectionEndpoint {
12
+ export declare class MultiSendEndpoint extends MultiConnectionEndpoint {
13
+ /**
14
+ * We are always _out_
15
+ * @return {boolean} always true
16
+ */
17
+ get isOut(): boolean;
12
18
  send(...args: any[]): void;
13
19
  sendAndReceive(...args: any[]): AsyncGenerator<any, void, unknown>;
14
20
  }
15
- import { MultiConnectionEndpoint } from "./multi-connection-endpoint.mjs";
@@ -1,3 +1,5 @@
1
+ import { Endpoint } from "./endpoint.mjs";
2
+ import { Interceptor } from "@kronos-integration/interceptor";
1
3
  /**
2
4
  * @param {string} name endpoint name
3
5
  * @param {Object} owner of the endpoint (service)
@@ -5,7 +7,8 @@
5
7
  * @param {Function} [options.receive] reciever function
6
8
  * @param {Function} [options.receivingInterceptors]
7
9
  */
8
- export class ReceivableEndpoint extends Endpoint {
10
+ export declare class ReceivableEndpoint extends Endpoint {
11
+ receive: Function | undefined;
9
12
  /**
10
13
  * @param {string} name endpoint name
11
14
  * @param {Object} owner of the endpoint (service)
@@ -14,9 +17,12 @@ export class ReceivableEndpoint extends Endpoint {
14
17
  * @param {Array<Interceptor>} [options.receivingInterceptors]
15
18
  */
16
19
  constructor(name: string, owner: Object, options: {
17
- receive?: Function | undefined;
18
- receivingInterceptors?: Interceptor[] | undefined;
20
+ receive?: Function;
21
+ receivingInterceptors?: Array<Interceptor>;
19
22
  });
20
- receive: Function | undefined;
23
+ /**
24
+ * @return {boolean} true is receive function is present
25
+ */
26
+ get isIn(): boolean;
27
+ get isOpen(): boolean;
21
28
  }
22
- import { Endpoint } from "./endpoint.mjs";
@@ -1,6 +1,11 @@
1
+ import { ReceiveEndpoint } from "./receive-endpoint.mjs";
1
2
  /**
2
3
  * Receive Endpoint acting as a default endpoints.
3
4
  */
4
- export class ReceiveEndpointDefault extends ReceiveEndpoint {
5
+ export declare class ReceiveEndpointDefault extends ReceiveEndpoint {
6
+ /**
7
+ * We are a default endpoint
8
+ * @return {boolean} always true
9
+ */
10
+ get isDefault(): boolean;
5
11
  }
6
- import { ReceiveEndpoint } from "./receive-endpoint.mjs";
@@ -1,8 +1,12 @@
1
+ import { ReceiveEndpointDefault } from "./receive-endpoint-default.mjs";
2
+ import { Endpoint } from "./endpoint.mjs";
1
3
  /**
2
4
  * Receiving endpoint wich can also send to itself.
3
5
  */
4
- export class ReceiveEndpointSelfConnectedDefault extends ReceiveEndpointDefault {
6
+ export declare class ReceiveEndpointSelfConnectedDefault extends ReceiveEndpointDefault {
7
+ get isOut(): boolean;
5
8
  connections(): any;
9
+ addConnection(other: any, backpointer: any): void;
6
10
  /**
7
11
  * Actually stop the communication.
8
12
  * @param {Endpoint} other
@@ -12,5 +16,3 @@ export class ReceiveEndpointSelfConnectedDefault extends ReceiveEndpointDefault
12
16
  isConnected(other: any): boolean;
13
17
  send(...args: any[]): Promise<any>;
14
18
  }
15
- import { ReceiveEndpointDefault } from "./receive-endpoint-default.mjs";
16
- import { Endpoint } from "./endpoint.mjs";
@@ -1,3 +1,4 @@
1
+ import { MultiConnectionEndpoint } from "./multi-connection-endpoint.mjs";
1
2
  /**
2
3
  * Receiving Endpoint.
3
4
  * Can receive from several endpoints.
@@ -8,6 +9,10 @@
8
9
  * @param {Function} [options.receive] reciever function
9
10
  * @param {Endpoint} [options.connected] sending side
10
11
  */
11
- export class ReceiveEndpoint extends MultiConnectionEndpoint {
12
+ export declare class ReceiveEndpoint extends MultiConnectionEndpoint {
13
+ /**
14
+ * We are always _in_
15
+ * @return {boolean} always true
16
+ */
17
+ get isIn(): boolean;
12
18
  }
13
- import { MultiConnectionEndpoint } from "./multi-connection-endpoint.mjs";
@@ -1,6 +1,11 @@
1
+ import { SendEndpoint } from "./send-endpoint.mjs";
1
2
  /**
2
3
  * Send Endpoint acting as a default endpoints.
3
4
  */
4
- export class SendEndpointDefault extends SendEndpoint {
5
+ export declare class SendEndpointDefault extends SendEndpoint {
6
+ /**
7
+ * We are a default endpoint.
8
+ * @return {boolean} always true
9
+ */
10
+ get isDefault(): boolean;
5
11
  }
6
- import { SendEndpoint } from "./send-endpoint.mjs";
@@ -1,3 +1,5 @@
1
+ import { Endpoint } from "./endpoint.mjs";
2
+ import { ReceivableEndpoint } from "./receivable-endpoint.mjs";
1
3
  /**
2
4
  * Sending Endpoint.
3
5
  * Can only hold one connection.
@@ -8,7 +10,8 @@
8
10
  * @param {Endpoint|undefined} [options.connected] where te requests are delivered to
9
11
  * @param {Function|undefined} [options.didConnect] called after receiver is present
10
12
  */
11
- export class SendEndpoint extends ReceivableEndpoint {
13
+ export declare class SendEndpoint extends ReceivableEndpoint {
14
+ #private;
12
15
  /**
13
16
  * @param {string} name endpoint name
14
17
  * @param {Object} owner of the endpoint (service)
@@ -16,13 +19,28 @@ export class SendEndpoint extends ReceivableEndpoint {
16
19
  * @param {Endpoint} [options.connected]
17
20
  */
18
21
  constructor(name: string, owner: Object, options: {
19
- connected?: Endpoint | undefined;
22
+ connected?: Endpoint;
20
23
  });
24
+ /**
25
+ * We are always _out_
26
+ * @return {boolean} always true
27
+ */
28
+ get isOut(): boolean;
29
+ get isOpen(): boolean;
21
30
  getConnectionState(other: any): any;
22
31
  setConnectionState(other: any, state: any): void;
32
+ /**
33
+ * Add a connection.
34
+ * @param {Endpoint} other
35
+ * @param {boolean} [backpointer] true if this is the call form back call from the other side
36
+ */
37
+ addConnection(other: Endpoint, backpointer?: boolean): void;
38
+ /**
39
+ * Actually stop the communication.
40
+ * @param {Endpoint} other
41
+ * @param {boolean} [backpointer] true if this is the call form back call from the other side
42
+ */
43
+ removeConnection(other: Endpoint, backpointer?: boolean): void;
23
44
  connections(): Generator<any, void, unknown>;
24
45
  send(...args: any[]): Promise<any>;
25
- #private;
26
46
  }
27
- import { ReceivableEndpoint } from "./receivable-endpoint.mjs";
28
- import { Endpoint } from "./endpoint.mjs";
@@ -1,6 +1,11 @@
1
+ import { SendEndpoint } from "./send-endpoint.mjs";
1
2
  /**
2
3
  * bi directional endpint
3
4
  */
4
- export class SendReceiveEndpoint extends SendEndpoint {
5
+ export declare class SendReceiveEndpoint extends SendEndpoint {
6
+ /**
7
+ * Always receiving.
8
+ * @return {boolean} true
9
+ */
10
+ get isIn(): boolean;
5
11
  }
6
- import { SendEndpoint } from "./send-endpoint.mjs";