javonet-nodejs-sdk 2.5.17 → 2.5.18
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/dist/core/handler/AbstractHandler.cjs +23 -6
- package/dist/core/handler/ArrayGetItemHandler.cjs +4 -1
- package/dist/core/handler/ArrayGetRankHandler.cjs +3 -0
- package/dist/core/handler/ArrayGetSizeHandler.cjs +3 -0
- package/dist/core/handler/ArrayHandler.cjs +3 -0
- package/dist/core/handler/ArraySetItemHandler.cjs +4 -1
- package/dist/core/handler/CastingHandler.cjs +3 -1
- package/dist/core/handler/ConvertTypeHandler.cjs +4 -4
- package/dist/core/handler/CreateClassInstanceHandler.cjs +5 -2
- package/dist/core/handler/DestructReferenceHandler.cjs +3 -0
- package/dist/core/handler/EnableNamespaceHandler.cjs +3 -0
- package/dist/core/handler/EnableTypeHandler.cjs +3 -0
- package/dist/core/handler/GetGlobalStaticFieldHandler.cjs +3 -0
- package/dist/core/handler/GetInstanceFieldHandler.cjs +3 -0
- package/dist/core/handler/GetInstanceMethodAsDelegateHandler.cjs +15 -4
- package/dist/core/handler/GetStaticFieldHandler.cjs +4 -0
- package/dist/core/handler/GetStaticMethodAsDelegateHandler.cjs +8 -6
- package/dist/core/handler/GetTypeHandler.cjs +10 -2
- package/dist/core/handler/Handler.cjs +8 -11
- package/dist/core/handler/InvokeGlobalFunctionHandler.cjs +3 -0
- package/dist/core/handler/InvokeInstanceMethodHandler.cjs +3 -0
- package/dist/core/handler/InvokeStaticMethodHandler.cjs +3 -0
- package/dist/core/handler/LoadLibraryHandler.cjs +4 -0
- package/dist/core/handler/SetGlobalStaticFieldHandler.cjs +3 -0
- package/dist/core/handler/SetInstanceFieldHandler.cjs +3 -0
- package/dist/core/handler/SetStaticFieldHandler.cjs +3 -0
- package/dist/core/handler/ValueHandler.cjs +4 -0
- package/dist/core/interpreter/Interpreter.cjs +28 -12
- package/dist/core/namespaceCache/NamespaceCache.cjs +12 -0
- package/dist/core/protocol/CommandDeserializer.cjs +10 -2
- package/dist/core/protocol/CommandSerializer.cjs +24 -4
- package/dist/core/protocol/TypeDeserializer.cjs +35 -0
- package/dist/core/protocol/TypeSerializer.cjs +51 -7
- package/dist/core/receiver/Receiver.cjs +1 -1
- package/dist/core/receiver/ReceiverNative.cjs +6 -0
- package/dist/core/transmitter/Transmitter.cjs +18 -2
- package/dist/core/transmitter/TransmitterWebsocket.cjs +8 -5
- package/dist/core/transmitter/TransmitterWebsocketBrowser.cjs +1 -1
- package/dist/core/transmitter/TransmitterWrapper.cjs +25 -8
- package/dist/core/typeCache/TypeCache.cjs +8 -0
- package/dist/core/webSocketClient/WebSocketClient.cjs +22 -12
- package/dist/core/webSocketClient/WebSocketClientBrowser.cjs +2 -2
- package/dist/sdk/ConfigRuntimeFactory.cjs +60 -55
- package/dist/sdk/InvocationContext.cjs +81 -23
- package/dist/sdk/Javonet.cjs +14 -33
- package/dist/sdk/RuntimeContext.cjs +85 -30
- package/dist/sdk/RuntimeFactory.cjs +3 -0
- package/dist/sdk/tools/ActivationHelper.cjs +66 -0
- package/dist/sdk/tools/JsonResolver.cjs +214 -0
- package/dist/types/core/handler/AbstractHandler.d.ts +23 -4
- package/dist/types/core/handler/ArrayGetItemHandler.d.ts +8 -1
- package/dist/types/core/handler/ArrayGetRankHandler.d.ts +8 -1
- package/dist/types/core/handler/ArrayGetSizeHandler.d.ts +8 -1
- package/dist/types/core/handler/ArrayHandler.d.ts +8 -1
- package/dist/types/core/handler/ArraySetItemHandler.d.ts +8 -1
- package/dist/types/core/handler/CastingHandler.d.ts +4 -0
- package/dist/types/core/handler/ConvertTypeHandler.d.ts +8 -4
- package/dist/types/core/handler/CreateClassInstanceHandler.d.ts +8 -1
- package/dist/types/core/handler/DestructReferenceHandler.d.ts +8 -1
- package/dist/types/core/handler/EnableNamespaceHandler.d.ts +8 -1
- package/dist/types/core/handler/EnableTypeHandler.d.ts +8 -1
- package/dist/types/core/handler/GetGlobalStaticFieldHandler.d.ts +8 -1
- package/dist/types/core/handler/GetInstanceFieldHandler.d.ts +8 -1
- package/dist/types/core/handler/GetStaticFieldHandler.d.ts +9 -1
- package/dist/types/core/handler/GetStaticMethodAsDelegateHandler.d.ts +4 -3
- package/dist/types/core/handler/GetTypeHandler.d.ts +17 -8
- package/dist/types/core/handler/Handler.d.ts +8 -8
- package/dist/types/core/handler/InvokeDelegateHandler.d.ts +4 -0
- package/dist/types/core/handler/InvokeGlobalFunctionHandler.d.ts +8 -1
- package/dist/types/core/handler/InvokeInstanceMethodHandler.d.ts +8 -1
- package/dist/types/core/handler/InvokeStaticMethodHandler.d.ts +8 -1
- package/dist/types/core/handler/LoadLibraryHandler.d.ts +8 -3
- package/dist/types/core/handler/SetGlobalStaticFieldHandler.d.ts +4 -0
- package/dist/types/core/handler/SetInstanceFieldHandler.d.ts +8 -1
- package/dist/types/core/handler/SetStaticFieldHandler.d.ts +8 -1
- package/dist/types/core/handler/ValueHandler.d.ts +9 -1
- package/dist/types/core/interpreter/Interpreter.d.ts +11 -10
- package/dist/types/core/namespaceCache/NamespaceCache.d.ts +17 -5
- package/dist/types/core/protocol/CommandDeserializer.d.ts +10 -3
- package/dist/types/core/protocol/CommandSerializer.d.ts +19 -2
- package/dist/types/core/protocol/TypeDeserializer.d.ts +46 -11
- package/dist/types/core/protocol/TypeSerializer.d.ts +53 -13
- package/dist/types/core/receiver/Receiver.d.ts +2 -2
- package/dist/types/core/receiver/ReceiverNative.d.ts +8 -2
- package/dist/types/core/transmitter/Transmitter.d.ts +20 -4
- package/dist/types/core/transmitter/TransmitterWebsocket.d.ts +8 -4
- package/dist/types/core/transmitter/TransmitterWebsocketBrowser.d.ts +4 -7
- package/dist/types/core/transmitter/TransmitterWrapper.d.ts +12 -3
- package/dist/types/core/typeCache/TypeCache.d.ts +15 -5
- package/dist/types/core/webSocketClient/WebSocketClient.d.ts +17 -21
- package/dist/types/sdk/ConfigRuntimeFactory.d.ts +9 -6
- package/dist/types/sdk/InvocationContext.d.ts +38 -6
- package/dist/types/sdk/Javonet.d.ts +12 -7
- package/dist/types/sdk/RuntimeContext.d.ts +23 -7
- package/dist/types/sdk/RuntimeFactory.d.ts +9 -2
- package/dist/types/sdk/tools/ActivationHelper.d.ts +20 -0
- package/dist/types/sdk/tools/JsonResolver.d.ts +87 -0
- package/dist/types/utils/Command.d.ts +18 -14
- package/dist/types/utils/CustomError.d.ts +5 -1
- package/dist/types/utils/Runtime.d.ts +1 -2
- package/dist/types/utils/RuntimeNameHandler.d.ts +6 -2
- package/dist/types/utils/Type.d.ts +1 -0
- package/dist/types/utils/TypesHandler.d.ts +16 -0
- package/dist/types/utils/UtilsConst.d.ts +32 -0
- package/dist/types/utils/connectionData/IConnectionData.d.ts +16 -3
- package/dist/types/utils/connectionData/InMemoryConnectionData.d.ts +4 -3
- package/dist/types/utils/connectionData/WsConnectionData.d.ts +7 -10
- package/dist/types/utils/nodejs/connectionData/TcpConnectionData.d.ts +17 -10
- package/dist/utils/Command.cjs +9 -9
- package/dist/utils/CustomError.cjs +4 -0
- package/dist/utils/RuntimeNameHandler.cjs +1 -1
- package/dist/utils/Type.cjs +2 -1
- package/dist/utils/TypesHandler.cjs +55 -0
- package/dist/utils/UtilsConst.cjs +101 -0
- package/dist/utils/connectionData/IConnectionData.cjs +9 -0
- package/dist/utils/connectionData/InMemoryConnectionData.cjs +10 -0
- package/dist/utils/connectionData/WsConnectionData.cjs +4 -0
- package/dist/utils/nodejs/connectionData/TcpConnectionData.cjs +33 -3
- package/lib/core/delegatesCache/DelegatesCache.js +1 -0
- package/lib/core/handler/AbstractHandler.js +27 -9
- package/lib/core/handler/ArrayGetItemHandler.js +9 -1
- package/lib/core/handler/ArrayGetRankHandler.js +9 -0
- package/lib/core/handler/ArrayGetSizeHandler.js +8 -0
- package/lib/core/handler/ArrayHandler.js +8 -0
- package/lib/core/handler/ArraySetItemHandler.js +11 -1
- package/lib/core/handler/CastingHandler.js +8 -1
- package/lib/core/handler/ConvertTypeHandler.js +9 -4
- package/lib/core/handler/CreateClassInstanceHandler.js +10 -4
- package/lib/core/handler/DestructReferenceHandler.js +8 -0
- package/lib/core/handler/EnableNamespaceHandler.js +8 -0
- package/lib/core/handler/EnableTypeHandler.js +8 -0
- package/lib/core/handler/GetGlobalStaticFieldHandler.js +9 -0
- package/lib/core/handler/GetInstanceFieldHandler.js +8 -0
- package/lib/core/handler/GetInstanceMethodAsDelegateHandler.js +9 -4
- package/lib/core/handler/GetStaticFieldHandler.js +9 -0
- package/lib/core/handler/GetStaticMethodAsDelegateHandler.js +8 -7
- package/lib/core/handler/GetTypeHandler.js +15 -5
- package/lib/core/handler/Handler.js +13 -18
- package/lib/core/handler/InvokeDelegateHandler.js +5 -0
- package/lib/core/handler/InvokeGlobalFunctionHandler.js +11 -1
- package/lib/core/handler/InvokeInstanceMethodHandler.js +8 -0
- package/lib/core/handler/InvokeStaticMethodHandler.js +8 -0
- package/lib/core/handler/LoadLibraryHandler.js +11 -0
- package/lib/core/handler/SetGlobalStaticFieldHandler.js +10 -0
- package/lib/core/handler/SetInstanceFieldHandler.js +7 -0
- package/lib/core/handler/SetStaticFieldHandler.js +8 -0
- package/lib/core/handler/ValueHandler.js +9 -0
- package/lib/core/interpreter/Interpreter.js +42 -24
- package/lib/core/namespaceCache/NamespaceCache.js +14 -0
- package/lib/core/protocol/CommandDeserializer.js +11 -2
- package/lib/core/protocol/CommandSerializer.js +40 -9
- package/lib/core/protocol/TypeDeserializer.js +36 -0
- package/lib/core/protocol/TypeSerializer.js +62 -7
- package/lib/core/receiver/Receiver.js +3 -2
- package/lib/core/receiver/ReceiverNative.js +8 -0
- package/lib/core/transmitter/Transmitter.js +18 -1
- package/lib/core/transmitter/TransmitterWebsocket.js +12 -5
- package/lib/core/transmitter/TransmitterWebsocketBrowser.js +2 -4
- package/lib/core/transmitter/TransmitterWrapper.js +27 -6
- package/lib/core/typeCache/TypeCache.js +9 -0
- package/lib/core/webSocketClient/WebSocketClient.js +33 -30
- package/lib/core/webSocketClient/WebSocketClientBrowser.js +5 -6
- package/lib/sdk/ConfigRuntimeFactory.js +70 -68
- package/lib/sdk/InvocationContext.js +94 -26
- package/lib/sdk/Javonet.js +18 -36
- package/lib/sdk/RuntimeContext.js +109 -29
- package/lib/sdk/RuntimeFactory.js +7 -0
- package/lib/sdk/tools/ActivationHelper.js +51 -0
- package/lib/sdk/tools/JsonResolver.js +226 -0
- package/lib/types.d.ts +57 -0
- package/lib/utils/Command.js +14 -9
- package/lib/utils/CustomError.js +5 -0
- package/lib/utils/Runtime.js +1 -1
- package/lib/utils/RuntimeLogger.js +3 -0
- package/lib/utils/RuntimeNameHandler.js +6 -1
- package/lib/utils/Type.js +2 -1
- package/lib/utils/TypesHandler.js +35 -0
- package/lib/utils/UtilsConst.js +88 -0
- package/lib/utils/connectionData/IConnectionData.js +14 -0
- package/lib/utils/connectionData/InMemoryConnectionData.js +15 -0
- package/lib/utils/connectionData/WsConnectionData.js +9 -0
- package/lib/utils/nodejs/connectionData/TcpConnectionData.js +35 -5
- package/package.json +4 -3
- package/dist/sdk/tools/browser/ConfigSourceResolver.cjs +0 -153
- package/dist/sdk/tools/nodejs/JsonFileResolver.cjs +0 -120
- package/dist/types/sdk/tools/browser/ConfigSourceResolver.d.ts +0 -46
- package/dist/types/sdk/tools/nodejs/JsonFileResolver.d.ts +0 -13
- package/dist/types/utils/nodejs/TypesConverter.d.ts +0 -48
- package/dist/utils/nodejs/TypesConverter.cjs +0 -102
- package/lib/declarations.d.ts +0 -35
- package/lib/sdk/tools/browser/ConfigSourceResolver.js +0 -146
- package/lib/sdk/tools/nodejs/JsonFileResolver.js +0 -106
- package/lib/utils/nodejs/TypesConverter.js +0 -91
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type ConfigSource = import("../types.d.ts").ConfigSource;
|
|
1
2
|
/**
|
|
2
3
|
* The Javonet class is a singleton class that serves as the entry point for interacting with Javonet.
|
|
3
4
|
* It provides methods to activate and initialize the Javonet SDK.
|
|
@@ -28,29 +29,33 @@ export class Javonet {
|
|
|
28
29
|
/**
|
|
29
30
|
* Initializes Javonet with a custom configuration file taken from external source.
|
|
30
31
|
* Currentyl supported: Configuration file in JSON format
|
|
31
|
-
* @param config - Path to a configuration file.
|
|
32
|
+
* @param {string|ConfigSource} config - Path to a configuration file.
|
|
32
33
|
* @returns {ConfigRuntimeFactory} A ConfigRuntimeFactory instance with configuration data.
|
|
33
34
|
* @see [Javonet Guides](https://www.javonet.com/guides/v2/javascript/foundations/configure-channel)
|
|
34
35
|
*/
|
|
35
|
-
static withConfig(config:
|
|
36
|
+
static withConfig(config: string | ConfigSource): ConfigRuntimeFactory;
|
|
36
37
|
/**
|
|
37
38
|
* Activates Javonet with the provided license key.
|
|
38
39
|
* @param {string} licenseKey - The license key to activate Javonet.
|
|
39
|
-
* @returns {
|
|
40
|
+
* @returns {void} The activation status code.
|
|
40
41
|
* @see [Javonet Guides](https://www.javonet.com/guides/v2/javascript/getting-started/activating-javonet)
|
|
41
42
|
*/
|
|
42
|
-
static activate(licenseKey: string):
|
|
43
|
+
static activate(licenseKey: string): void;
|
|
44
|
+
/**
|
|
45
|
+
* Gets the runtime information.
|
|
46
|
+
* @returns {string} The runtime information.
|
|
47
|
+
*/
|
|
43
48
|
static getRuntimeInfo(): string;
|
|
44
49
|
/**
|
|
45
50
|
* Sets the configuration source for the Javonet SDK.
|
|
46
|
-
*
|
|
47
51
|
* @param {string} configSource - The configuration source.
|
|
52
|
+
* @returns {void}
|
|
48
53
|
*/
|
|
49
|
-
static setConfigSource(configSource: string):
|
|
54
|
+
static setConfigSource(configSource: string): void;
|
|
50
55
|
/**
|
|
51
56
|
* Sets the working directory for the Javonet SDK.
|
|
52
|
-
*
|
|
53
57
|
* @param {string} path - The working directory.
|
|
58
|
+
* @returns {void}
|
|
54
59
|
*/
|
|
55
60
|
static setJavonetWorkingDirectory(path: string): void;
|
|
56
61
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export type RuntimeNameType = import("../types.d.ts").RuntimeName;
|
|
2
|
+
export type IConnectionData = import("../utils/connectionData/IConnectionData.js").IConnectionData;
|
|
3
|
+
export type Transmitter = typeof import("../core/transmitter/Transmitter.js").Transmitter;
|
|
1
4
|
/**
|
|
2
5
|
* Represents a single context which allows interaction with a selected technology.
|
|
3
6
|
* Refers to a single instance of the called runtime within a particular target OS process.
|
|
@@ -10,13 +13,26 @@
|
|
|
10
13
|
* @class
|
|
11
14
|
*/
|
|
12
15
|
export class RuntimeContext {
|
|
13
|
-
|
|
14
|
-
static
|
|
15
|
-
|
|
16
|
-
static
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
/** @type {Map<string, RuntimeContext>} */
|
|
17
|
+
static memoryRuntimeContexts: Map<string, RuntimeContext>;
|
|
18
|
+
/** @type {Map<string, RuntimeContext>} */
|
|
19
|
+
static networkRuntimeContexts: Map<string, RuntimeContext>;
|
|
20
|
+
/** @type {Map<string, RuntimeContext>} */
|
|
21
|
+
static webSocketRuntimeContexts: Map<string, RuntimeContext>;
|
|
22
|
+
/**
|
|
23
|
+
* @param {RuntimeNameType} runtimeName
|
|
24
|
+
* @param {IConnectionData} connectionData
|
|
25
|
+
* @returns {RuntimeContext}
|
|
26
|
+
*/
|
|
27
|
+
static getInstance(runtimeName: RuntimeNameType, connectionData: IConnectionData): RuntimeContext;
|
|
28
|
+
/**
|
|
29
|
+
* @param {RuntimeNameType} runtimeName
|
|
30
|
+
* @param {IConnectionData} connectionData
|
|
31
|
+
*/
|
|
32
|
+
constructor(runtimeName: RuntimeNameType, connectionData: IConnectionData);
|
|
33
|
+
_isExecuted: boolean;
|
|
34
|
+
runtimeName: import("../types.d.ts").RuntimeName;
|
|
35
|
+
connectionData: import("../utils/connectionData/IConnectionData.js").IConnectionData;
|
|
20
36
|
/**
|
|
21
37
|
* Executes the current command. The initial state of RuntimeContext is non-materialized,
|
|
22
38
|
* wrapping either a single command or a chain of recursively nested commands.
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import('../utils/connectionData/IConnectionData.js').IConnectionData} IConnectionData
|
|
3
|
+
*/
|
|
1
4
|
/**
|
|
2
5
|
* The RuntimeFactory class provides methods for creating runtime contexts.
|
|
3
6
|
* Each method corresponds to a specific runtime (CLR, JVM, .NET Core, Perl, Ruby, Node.js, Python) and returns a RuntimeContext instance for that runtime.
|
|
4
7
|
* @see [Javonet Guides](https://www.javonet.com/guides/v2/javascript/foundations/runtime-context)
|
|
5
8
|
*/
|
|
6
9
|
export class RuntimeFactory {
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @param {IConnectionData} connectionData
|
|
12
|
+
*/
|
|
13
|
+
constructor(connectionData: IConnectionData);
|
|
14
|
+
connectionData: import("../utils/connectionData/IConnectionData.js").IConnectionData;
|
|
9
15
|
/**
|
|
10
16
|
* Creates RuntimeContext instance to interact with the .NET Framework runtime.
|
|
11
17
|
* @return {RuntimeContext} a RuntimeContext instance for the .NET Framework runtime
|
|
@@ -55,4 +61,5 @@ export class RuntimeFactory {
|
|
|
55
61
|
*/
|
|
56
62
|
python27(): RuntimeContext;
|
|
57
63
|
}
|
|
64
|
+
export type IConnectionData = import("../utils/connectionData/IConnectionData.js").IConnectionData;
|
|
58
65
|
import { RuntimeContext } from './RuntimeContext.js';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export class ActivationHelper {
|
|
2
|
+
/** @type {string} */
|
|
3
|
+
static temporaryLicenseKey: string;
|
|
4
|
+
/**
|
|
5
|
+
* @param {string} value
|
|
6
|
+
*/
|
|
7
|
+
static setTemporaryLicenseKey(value: string): void;
|
|
8
|
+
/**
|
|
9
|
+
* @returns {string}
|
|
10
|
+
*/
|
|
11
|
+
static getTemporaryLicenseKey(): string;
|
|
12
|
+
/**
|
|
13
|
+
* @returns {Promise<string>}
|
|
14
|
+
*/
|
|
15
|
+
static getLicenseKey(): Promise<string>;
|
|
16
|
+
/**
|
|
17
|
+
* @returns {string}
|
|
18
|
+
*/
|
|
19
|
+
static _getLicenseKeyFromFile(): string;
|
|
20
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
export type RuntimeChannelType = import("../../types.d.ts").RuntimeChannelType;
|
|
2
|
+
export type ConfigSource = import("../../types.d.ts").ConfigSource;
|
|
3
|
+
export type RuntimeChannel = import("../../types.d.ts").RuntimeChannel;
|
|
4
|
+
export type Runtime = import("../../types.d.ts").Runtime;
|
|
5
|
+
export type Runtimes = import("../../types.d.ts").Runtimes;
|
|
6
|
+
export type RuntimeType = import("../../types.d.ts").RuntimeType;
|
|
7
|
+
export class JsonResolver {
|
|
8
|
+
/**
|
|
9
|
+
* @param {string | ConfigSource} configSource
|
|
10
|
+
*/
|
|
11
|
+
constructor(configSource: string | ConfigSource);
|
|
12
|
+
/** @type {ConfigSource} */
|
|
13
|
+
jsonObject: ConfigSource;
|
|
14
|
+
/** @type {string | ConfigSource} */
|
|
15
|
+
configSource: string | ConfigSource;
|
|
16
|
+
/**
|
|
17
|
+
* @returns {Partial<Runtimes>}
|
|
18
|
+
*/
|
|
19
|
+
get runtimes(): Partial<Runtimes>;
|
|
20
|
+
/**
|
|
21
|
+
* @returns {string}
|
|
22
|
+
*/
|
|
23
|
+
get licenseKey(): string;
|
|
24
|
+
/**
|
|
25
|
+
* @returns {string}
|
|
26
|
+
*/
|
|
27
|
+
get workingDirectory(): string;
|
|
28
|
+
/**
|
|
29
|
+
* @returns {string}
|
|
30
|
+
*/
|
|
31
|
+
getLicenseKey(): string;
|
|
32
|
+
/**
|
|
33
|
+
* @returns {string}
|
|
34
|
+
*/
|
|
35
|
+
getWorkingDirectory(): string;
|
|
36
|
+
/**
|
|
37
|
+
* @param {RuntimeType} runtimeName
|
|
38
|
+
* @param {string} configName
|
|
39
|
+
* @returns {RuntimeChannelType}
|
|
40
|
+
*/
|
|
41
|
+
getChannelType(runtimeName: RuntimeType, configName: string): RuntimeChannelType;
|
|
42
|
+
/**
|
|
43
|
+
* @param {RuntimeType} runtimeName
|
|
44
|
+
* @param {string} configName
|
|
45
|
+
* @returns {string}
|
|
46
|
+
*/
|
|
47
|
+
getChannelHost(runtimeName: RuntimeType, configName: string): string;
|
|
48
|
+
/**
|
|
49
|
+
* @param {RuntimeType} runtimeName
|
|
50
|
+
* @param {string} configName
|
|
51
|
+
* @returns {number|string}
|
|
52
|
+
*/
|
|
53
|
+
getChannelPort(runtimeName: RuntimeType, configName: string): number | string;
|
|
54
|
+
/**
|
|
55
|
+
* @param {RuntimeType} runtimeName
|
|
56
|
+
* @param {string} configName
|
|
57
|
+
* @returns {string}
|
|
58
|
+
*/
|
|
59
|
+
getModules(runtimeName: RuntimeType, configName: string): string;
|
|
60
|
+
/**
|
|
61
|
+
* @private
|
|
62
|
+
* @param {string | ConfigSource} configSource
|
|
63
|
+
* @returns {ConfigSource}
|
|
64
|
+
*/
|
|
65
|
+
private _getJsonObject;
|
|
66
|
+
/**
|
|
67
|
+
* @private
|
|
68
|
+
* @param {RuntimeType} runtimeName
|
|
69
|
+
* @param {string} configName
|
|
70
|
+
* @returns {Runtime}
|
|
71
|
+
*/
|
|
72
|
+
private _getRuntime;
|
|
73
|
+
/**
|
|
74
|
+
* @private
|
|
75
|
+
* @param {RuntimeType} runtimeName
|
|
76
|
+
* @param {string} configName
|
|
77
|
+
* @returns {string}
|
|
78
|
+
*/
|
|
79
|
+
private _getRuntimeName;
|
|
80
|
+
/**
|
|
81
|
+
* @private
|
|
82
|
+
* @param {RuntimeType} runtimeName
|
|
83
|
+
* @param {string} configName
|
|
84
|
+
* @returns {RuntimeChannel}
|
|
85
|
+
*/
|
|
86
|
+
private _getChannel;
|
|
87
|
+
}
|
|
@@ -1,31 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import('../types.d.ts').RuntimeName} RuntimeName
|
|
3
|
+
*/
|
|
1
4
|
export class Command {
|
|
2
5
|
/**
|
|
3
|
-
* @param {
|
|
4
|
-
* @param {
|
|
6
|
+
* @param {unknown} response
|
|
7
|
+
* @param {RuntimeName} runtimeName
|
|
8
|
+
* @returns {Command}
|
|
5
9
|
*/
|
|
6
|
-
static createResponse(response
|
|
10
|
+
static createResponse(response: unknown, runtimeName: RuntimeName): Command;
|
|
7
11
|
/**
|
|
8
|
-
* @param {
|
|
9
|
-
* @param {
|
|
10
|
-
* @
|
|
12
|
+
* @param {unknown} response
|
|
13
|
+
* @param {RuntimeName} runtimeName
|
|
14
|
+
* @returns {Command}
|
|
11
15
|
*/
|
|
12
|
-
static createReference(response
|
|
16
|
+
static createReference(response: unknown, runtimeName: RuntimeName): Command;
|
|
13
17
|
/**
|
|
14
|
-
* @param {
|
|
15
|
-
* @param {
|
|
18
|
+
* @param {unknown} response
|
|
19
|
+
* @param {RuntimeName} runtimeName
|
|
16
20
|
* @returns {Command}
|
|
17
|
-
* @method
|
|
18
21
|
*/
|
|
19
|
-
static createArrayResponse(response
|
|
22
|
+
static createArrayResponse(response: unknown, runtimeName: RuntimeName): Command;
|
|
20
23
|
/**
|
|
21
24
|
* Constructs a new Command instance.
|
|
22
|
-
* @param {
|
|
25
|
+
* @param {RuntimeName} runtimeName - The runtime name associated with the command.
|
|
23
26
|
* @param {number} commandType - The type of the command.
|
|
24
27
|
* @param {any} [payload] - The optional payload of the command.
|
|
25
28
|
* @method
|
|
26
29
|
*/
|
|
27
|
-
constructor(runtimeName:
|
|
28
|
-
runtimeName:
|
|
30
|
+
constructor(runtimeName: RuntimeName, commandType: number, payload?: any);
|
|
31
|
+
runtimeName: import("../types.d.ts").RuntimeName;
|
|
29
32
|
commandType: number;
|
|
30
33
|
payload: any;
|
|
31
34
|
dropFirstPayloadArg(): Command;
|
|
@@ -40,3 +43,4 @@ export class Command {
|
|
|
40
43
|
*/
|
|
41
44
|
prependArgToPayload(current_command: Command | null): Command;
|
|
42
45
|
}
|
|
46
|
+
export type RuntimeName = import("../types.d.ts").RuntimeName;
|
|
@@ -18,7 +18,6 @@ export function isEsmRuntime(): boolean;
|
|
|
18
18
|
* @returns {string}
|
|
19
19
|
*/
|
|
20
20
|
export function getRuntimeExtension(): string;
|
|
21
|
-
export function getRequire(callerPath: string):
|
|
21
|
+
export function getRequire(callerPath: string): any;
|
|
22
22
|
export function getDirname(): any;
|
|
23
23
|
export function getDependency(dependencyName: string, callerPathOrUrl: string): string;
|
|
24
|
-
import { createRequire } from './CreateRequire.node.js';
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
export type RuntimeType = import("../types.d.ts").RuntimeType;
|
|
2
|
+
/**
|
|
3
|
+
* @typedef {import('../types.d.ts').RuntimeType} RuntimeType
|
|
4
|
+
*/
|
|
1
5
|
export class RuntimeNameHandler {
|
|
2
6
|
/**
|
|
3
7
|
* @param {number} runtimeName
|
|
4
|
-
* @returns {
|
|
8
|
+
* @returns {RuntimeType}
|
|
5
9
|
*/
|
|
6
|
-
static getName(runtimeName: number):
|
|
10
|
+
static getName(runtimeName: number): RuntimeType;
|
|
7
11
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypesHandler class provides utilities for converting between types.
|
|
3
|
+
*/
|
|
4
|
+
export class TypesHandler {
|
|
5
|
+
/**
|
|
6
|
+
* Converts a JavaScript type to a JType equivalent.
|
|
7
|
+
* @param {Function} type - The JavaScript type.
|
|
8
|
+
* @returns {string} The corresponding type name
|
|
9
|
+
*/
|
|
10
|
+
static convertTypeToJType(type: Function): string;
|
|
11
|
+
/**
|
|
12
|
+
* @param {unknown} value
|
|
13
|
+
* @returns {boolean}
|
|
14
|
+
*/
|
|
15
|
+
static isPrimitiveOrNullOrUndefined(value: unknown): boolean;
|
|
16
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export class UtilsConst {
|
|
2
|
+
/** @type {string} */
|
|
3
|
+
static _javonetWorkingDirectory: string;
|
|
4
|
+
/** @type {string} */
|
|
5
|
+
static _configSource: string;
|
|
6
|
+
/** @type {string} */
|
|
7
|
+
static _licenseKey: string;
|
|
8
|
+
/**
|
|
9
|
+
* @param {string} inputPath
|
|
10
|
+
*/
|
|
11
|
+
static setJavonetWorkingDirectory(inputPath: string): void;
|
|
12
|
+
/**
|
|
13
|
+
* @returns {string}
|
|
14
|
+
*/
|
|
15
|
+
static getJavonetWorkingDirectory(): string;
|
|
16
|
+
/**
|
|
17
|
+
* @param {string} value
|
|
18
|
+
*/
|
|
19
|
+
static setConfigSource(value: string): void;
|
|
20
|
+
/**
|
|
21
|
+
* @returns {string}
|
|
22
|
+
*/
|
|
23
|
+
static getConfigSource(): string;
|
|
24
|
+
/**
|
|
25
|
+
* @param {string} value
|
|
26
|
+
*/
|
|
27
|
+
static setLicenseKey(value: string): void;
|
|
28
|
+
/**
|
|
29
|
+
* @returns {string}
|
|
30
|
+
*/
|
|
31
|
+
static getLicenseKey(): string;
|
|
32
|
+
}
|
|
@@ -1,5 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import('../ConnectionType.js').ConnectionType} ConnectionType
|
|
3
|
+
*/
|
|
1
4
|
export class IConnectionData {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
+
/**
|
|
6
|
+
* @returns {ConnectionType}
|
|
7
|
+
*/
|
|
8
|
+
get connectionType(): ConnectionType;
|
|
9
|
+
/**
|
|
10
|
+
* @returns {string}
|
|
11
|
+
*/
|
|
12
|
+
get hostname(): string;
|
|
13
|
+
/**
|
|
14
|
+
* @returns {number[]}
|
|
15
|
+
*/
|
|
16
|
+
serializeConnectionData(): number[];
|
|
5
17
|
}
|
|
18
|
+
export type ConnectionType = any;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
export type ConnectionType = any;
|
|
2
|
+
/**
|
|
3
|
+
* @typedef {import('../ConnectionType.js').ConnectionType} ConnectionType
|
|
4
|
+
*/
|
|
1
5
|
/**
|
|
2
6
|
* @extends IConnectionData
|
|
3
7
|
*/
|
|
4
8
|
export class InMemoryConnectionData extends IConnectionData {
|
|
5
9
|
_connectionType: 0;
|
|
6
10
|
_hostname: string;
|
|
7
|
-
get connectionType(): 0;
|
|
8
|
-
get hostname(): string;
|
|
9
|
-
serializeConnectionData(): number[];
|
|
10
11
|
/**
|
|
11
12
|
* @param {InMemoryConnectionData} other
|
|
12
13
|
* @returns {boolean}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
export type ConnectionType = any;
|
|
2
|
+
/**
|
|
3
|
+
* @typedef {import('../ConnectionType.js').ConnectionType} ConnectionType
|
|
4
|
+
*/
|
|
1
5
|
/**
|
|
2
6
|
* Represents WebSocket connection data.
|
|
3
7
|
* @extends IConnectionData
|
|
@@ -11,21 +15,14 @@ export class WsConnectionData extends IConnectionData {
|
|
|
11
15
|
private _hostname;
|
|
12
16
|
/** @private @type {ConnectionType} */
|
|
13
17
|
private _connectionType;
|
|
14
|
-
/** @type {ConnectionType} */
|
|
15
|
-
get connectionType(): {
|
|
16
|
-
readonly IN_MEMORY: 0;
|
|
17
|
-
readonly TCP: 1;
|
|
18
|
-
readonly WEB_SOCKET: 2;
|
|
19
|
-
};
|
|
20
18
|
/** @type {string} */
|
|
21
19
|
set hostname(value: string);
|
|
22
20
|
/** @type {string} */
|
|
23
21
|
get hostname(): string;
|
|
24
22
|
/**
|
|
25
|
-
*
|
|
26
|
-
* @returns {
|
|
23
|
+
* @param {WsConnectionData} other
|
|
24
|
+
* @returns {boolean}
|
|
27
25
|
*/
|
|
28
|
-
|
|
29
|
-
equals(other: any): boolean;
|
|
26
|
+
equals(other: WsConnectionData): boolean;
|
|
30
27
|
}
|
|
31
28
|
import { IConnectionData } from './IConnectionData.js';
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @typedef {import('../../ConnectionType.js').ConnectionType} ConnectionType
|
|
2
3
|
* @extends IConnectionData
|
|
3
4
|
*/
|
|
4
5
|
export class TcpConnectionData extends IConnectionData {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
/**
|
|
7
|
+
* @param {string} hostname
|
|
8
|
+
* @param {number} port
|
|
9
|
+
*/
|
|
10
|
+
constructor(hostname: string, port: number);
|
|
11
|
+
/** @type {string} */
|
|
12
|
+
ipAddress: string;
|
|
13
|
+
/** @type {number} */
|
|
14
|
+
_port: number;
|
|
15
|
+
/** @type {string} */
|
|
16
|
+
_hostname: string;
|
|
17
|
+
/** @type {ConnectionType} */
|
|
18
|
+
_connectionType: ConnectionType;
|
|
12
19
|
/**
|
|
13
20
|
* @param {TcpConnectionData} other
|
|
14
21
|
* @returns {boolean}
|
|
@@ -16,10 +23,10 @@ export class TcpConnectionData extends IConnectionData {
|
|
|
16
23
|
equals(other: TcpConnectionData): boolean;
|
|
17
24
|
/**
|
|
18
25
|
* @param {string} hostname
|
|
19
|
-
* @returns {string
|
|
26
|
+
* @returns {string}
|
|
20
27
|
*/
|
|
21
|
-
resolveIpAddress(hostname: string): string
|
|
22
|
-
serializeConnectionData(): 1[];
|
|
28
|
+
resolveIpAddress(hostname: string): string;
|
|
23
29
|
#private;
|
|
24
30
|
}
|
|
31
|
+
export type ConnectionType = any;
|
|
25
32
|
import { IConnectionData } from '../../connectionData/IConnectionData.js';
|
package/dist/utils/Command.cjs
CHANGED
|
@@ -25,7 +25,7 @@ var import_CommandType = require("./CommandType.cjs");
|
|
|
25
25
|
class Command {
|
|
26
26
|
/**
|
|
27
27
|
* Constructs a new Command instance.
|
|
28
|
-
* @param {
|
|
28
|
+
* @param {RuntimeName} runtimeName - The runtime name associated with the command.
|
|
29
29
|
* @param {number} commandType - The type of the command.
|
|
30
30
|
* @param {any} [payload] - The optional payload of the command.
|
|
31
31
|
* @method
|
|
@@ -36,25 +36,25 @@ class Command {
|
|
|
36
36
|
this.payload = payload;
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
|
-
* @param {
|
|
40
|
-
* @param {
|
|
39
|
+
* @param {unknown} response
|
|
40
|
+
* @param {RuntimeName} runtimeName
|
|
41
|
+
* @returns {Command}
|
|
41
42
|
*/
|
|
42
43
|
static createResponse(response, runtimeName) {
|
|
43
44
|
return new Command(runtimeName, import_CommandType.CommandType.Value, [response]);
|
|
44
45
|
}
|
|
45
46
|
/**
|
|
46
|
-
* @param {
|
|
47
|
-
* @param {
|
|
48
|
-
* @
|
|
47
|
+
* @param {unknown} response
|
|
48
|
+
* @param {RuntimeName} runtimeName
|
|
49
|
+
* @returns {Command}
|
|
49
50
|
*/
|
|
50
51
|
static createReference(response, runtimeName) {
|
|
51
52
|
return new Command(runtimeName, import_CommandType.CommandType.Reference, [response]);
|
|
52
53
|
}
|
|
53
54
|
/**
|
|
54
|
-
* @param {
|
|
55
|
-
* @param {
|
|
55
|
+
* @param {unknown} response
|
|
56
|
+
* @param {RuntimeName} runtimeName
|
|
56
57
|
* @returns {Command}
|
|
57
|
-
* @method
|
|
58
58
|
*/
|
|
59
59
|
static createArrayResponse(response, runtimeName) {
|
|
60
60
|
return new Command(runtimeName, import_CommandType.CommandType.Array, response);
|
|
@@ -22,6 +22,10 @@ __export(CustomError_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(CustomError_exports);
|
|
24
24
|
class CustomError extends Error {
|
|
25
|
+
/**
|
|
26
|
+
* @param {string} message
|
|
27
|
+
* @param {string} cause
|
|
28
|
+
*/
|
|
25
29
|
constructor(message, cause) {
|
|
26
30
|
super(`${message}: ${cause}`);
|
|
27
31
|
this.name = "CustomError";
|
package/dist/utils/Type.cjs
CHANGED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var TypesHandler_exports = {};
|
|
20
|
+
__export(TypesHandler_exports, {
|
|
21
|
+
TypesHandler: () => TypesHandler
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(TypesHandler_exports);
|
|
24
|
+
class TypesHandler {
|
|
25
|
+
/**
|
|
26
|
+
* Converts a JavaScript type to a JType equivalent.
|
|
27
|
+
* @param {Function} type - The JavaScript type.
|
|
28
|
+
* @returns {string} The corresponding type name
|
|
29
|
+
*/
|
|
30
|
+
static convertTypeToJType(type) {
|
|
31
|
+
switch (type) {
|
|
32
|
+
case Boolean:
|
|
33
|
+
return "JType.Boolean";
|
|
34
|
+
case Number:
|
|
35
|
+
return "JType.Float";
|
|
36
|
+
case String:
|
|
37
|
+
return "JType.String";
|
|
38
|
+
case Object:
|
|
39
|
+
return typeof type;
|
|
40
|
+
default:
|
|
41
|
+
return typeof type;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @param {unknown} value
|
|
46
|
+
* @returns {boolean}
|
|
47
|
+
*/
|
|
48
|
+
static isPrimitiveOrNullOrUndefined(value) {
|
|
49
|
+
return value === null || value === void 0 || typeof value === "string" || typeof value === "number" || typeof value === "boolean";
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
+
0 && (module.exports = {
|
|
54
|
+
TypesHandler
|
|
55
|
+
});
|