javonet-nodejs-sdk 2.5.16 → 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/delegatesCache/DelegatesCache.cjs +1 -5
- package/dist/core/handler/AbstractHandler.cjs +24 -9
- package/dist/core/handler/ArrayGetItemHandler.cjs +5 -4
- package/dist/core/handler/ArrayGetRankHandler.cjs +4 -3
- package/dist/core/handler/ArrayGetSizeHandler.cjs +4 -3
- package/dist/core/handler/ArrayHandler.cjs +3 -0
- package/dist/core/handler/ArraySetItemHandler.cjs +5 -4
- package/dist/core/handler/CastingHandler.cjs +3 -1
- package/dist/core/handler/ConvertTypeHandler.cjs +4 -4
- package/dist/core/handler/CreateClassInstanceHandler.cjs +6 -5
- package/dist/core/handler/DestructReferenceHandler.cjs +3 -0
- package/dist/core/handler/EnableNamespaceHandler.cjs +3 -0
- package/dist/core/handler/EnableTypeHandler.cjs +4 -3
- package/dist/core/handler/GetGlobalStaticFieldHandler.cjs +4 -3
- package/dist/core/handler/GetInstanceFieldHandler.cjs +4 -3
- package/dist/core/handler/GetInstanceMethodAsDelegateHandler.cjs +15 -4
- package/dist/core/handler/GetStaticFieldHandler.cjs +5 -3
- package/dist/core/handler/GetStaticMethodAsDelegateHandler.cjs +10 -10
- package/dist/core/handler/GetTypeHandler.cjs +10 -2
- package/dist/core/handler/Handler.cjs +8 -11
- package/dist/core/handler/InvokeGlobalFunctionHandler.cjs +4 -3
- package/dist/core/handler/InvokeInstanceMethodHandler.cjs +4 -3
- package/dist/core/handler/InvokeStaticMethodHandler.cjs +4 -3
- package/dist/core/handler/LoadLibraryHandler.cjs +11 -10
- package/dist/core/handler/PassDelegateHandler.cjs +2 -4
- package/dist/core/handler/SetGlobalStaticFieldHandler.cjs +4 -3
- package/dist/core/handler/SetInstanceFieldHandler.cjs +4 -3
- package/dist/core/handler/SetStaticFieldHandler.cjs +4 -3
- package/dist/core/handler/ValueHandler.cjs +4 -0
- package/dist/core/interpreter/Interpreter.cjs +29 -17
- package/dist/core/namespaceCache/NamespaceCache.cjs +19 -10
- 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 +3 -5
- package/dist/core/receiver/ReceiverNative.cjs +6 -0
- package/dist/core/transmitter/Transmitter.cjs +19 -5
- 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 +15 -10
- package/dist/core/webSocketClient/WebSocketClient.cjs +22 -12
- package/dist/core/webSocketClient/WebSocketClientBrowser.cjs +2 -2
- package/dist/sdk/ConfigRuntimeFactory.cjs +92 -98
- package/dist/sdk/InvocationContext.cjs +229 -203
- package/dist/sdk/Javonet.cjs +14 -33
- package/dist/sdk/RuntimeContext.cjs +138 -99
- 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/CreateRequire.browser.d.ts +1 -0
- package/dist/types/utils/CreateRequire.node.d.ts +2 -0
- package/dist/types/utils/CustomError.d.ts +5 -1
- package/dist/types/utils/Runtime.d.ts +2 -3
- 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/CreateRequire.browser.cjs +30 -0
- package/dist/utils/CreateRequire.node.cjs +28 -0
- package/dist/utils/CustomError.cjs +4 -0
- package/dist/utils/Runtime.cjs +24 -18
- package/dist/utils/RuntimeLogger.cjs +2 -4
- package/dist/utils/RuntimeLoggerBrowser.cjs +1 -3
- 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 +45 -25
- 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/CreateRequire.browser.js +5 -0
- package/lib/utils/CreateRequire.node.js +3 -0
- package/lib/utils/CustomError.js +5 -0
- package/lib/utils/Runtime.js +25 -6
- 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 +13 -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,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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function createRequire(): Error;
|
|
@@ -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):
|
|
22
|
-
export function getDirname():
|
|
21
|
+
export function getRequire(callerPath: string): any;
|
|
22
|
+
export function getDirname(): any;
|
|
23
23
|
export function getDependency(dependencyName: string, callerPathOrUrl: string): string;
|
|
24
|
-
import { createRequire } from 'module';
|
|
@@ -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);
|
|
@@ -0,0 +1,30 @@
|
|
|
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 CreateRequire_browser_exports = {};
|
|
20
|
+
__export(CreateRequire_browser_exports, {
|
|
21
|
+
createRequire: () => createRequire
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(CreateRequire_browser_exports);
|
|
24
|
+
const createRequire = () => {
|
|
25
|
+
return new Error("createRequire is not supported in the browser");
|
|
26
|
+
};
|
|
27
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
+
0 && (module.exports = {
|
|
29
|
+
createRequire
|
|
30
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
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 CreateRequire_node_exports = {};
|
|
20
|
+
__export(CreateRequire_node_exports, {
|
|
21
|
+
createRequire: () => import_module.createRequire
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(CreateRequire_node_exports);
|
|
24
|
+
var import_module = require("module");
|
|
25
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
26
|
+
0 && (module.exports = {
|
|
27
|
+
createRequire
|
|
28
|
+
});
|
|
@@ -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/Runtime.cjs
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
var Runtime_exports = {};
|
|
30
20
|
__export(Runtime_exports, {
|
|
@@ -37,10 +27,11 @@ __export(Runtime_exports, {
|
|
|
37
27
|
isNodejsRuntime: () => isNodejsRuntime
|
|
38
28
|
});
|
|
39
29
|
module.exports = __toCommonJS(Runtime_exports);
|
|
40
|
-
var
|
|
41
|
-
var import_path = __toESM(require("path"), 1);
|
|
42
|
-
var import_url = require("url");
|
|
30
|
+
var import_CreateRequire_node = require("./CreateRequire.node.cjs");
|
|
43
31
|
const import_meta = {};
|
|
32
|
+
let pathToFileURL = null;
|
|
33
|
+
let fileURLToPath = null;
|
|
34
|
+
let path = null;
|
|
44
35
|
function isNodejsRuntime() {
|
|
45
36
|
return typeof process !== "undefined" && process.versions != null && process.versions.node != null;
|
|
46
37
|
}
|
|
@@ -60,10 +51,10 @@ const getRequire = (callerPath) => {
|
|
|
60
51
|
return require;
|
|
61
52
|
}
|
|
62
53
|
if (callerPath === void 0) {
|
|
63
|
-
return (0,
|
|
54
|
+
return (0, import_CreateRequire_node.createRequire)(import_meta.url);
|
|
64
55
|
}
|
|
65
|
-
const baseUrl = callerPath?.startsWith("file:") ? callerPath :
|
|
66
|
-
return (0,
|
|
56
|
+
const baseUrl = callerPath?.startsWith("file:") ? callerPath : pathToFileURL(callerPath).href;
|
|
57
|
+
return (0, import_CreateRequire_node.createRequire)(baseUrl);
|
|
67
58
|
}
|
|
68
59
|
return new Error("Runtime not supported");
|
|
69
60
|
} catch (error) {
|
|
@@ -71,9 +62,12 @@ const getRequire = (callerPath) => {
|
|
|
71
62
|
}
|
|
72
63
|
};
|
|
73
64
|
const getDirname = () => {
|
|
65
|
+
if (isBrowserRuntime()) {
|
|
66
|
+
return new Error("Runtime not supported");
|
|
67
|
+
}
|
|
74
68
|
if (isEsmRuntime()) {
|
|
75
|
-
const __filename2 =
|
|
76
|
-
return
|
|
69
|
+
const __filename2 = fileURLToPath(import_meta.url);
|
|
70
|
+
return path.dirname(__filename2);
|
|
77
71
|
}
|
|
78
72
|
return __dirname;
|
|
79
73
|
};
|
|
@@ -91,6 +85,18 @@ const getDependency = (dependencyName, callerPathOrUrl) => {
|
|
|
91
85
|
);
|
|
92
86
|
}
|
|
93
87
|
};
|
|
88
|
+
if (isNodejsRuntime()) {
|
|
89
|
+
const requireDynamic = getRequire(import_meta.url);
|
|
90
|
+
if (fileURLToPath === null) {
|
|
91
|
+
fileURLToPath = requireDynamic("url").fileURLToPath;
|
|
92
|
+
}
|
|
93
|
+
if (path === null) {
|
|
94
|
+
path = requireDynamic("path");
|
|
95
|
+
}
|
|
96
|
+
if (pathToFileURL === null) {
|
|
97
|
+
pathToFileURL = requireDynamic("url").pathToFileURL;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
94
100
|
// Annotate the CommonJS export names for ESM import in node:
|
|
95
101
|
0 && (module.exports = {
|
|
96
102
|
getDependency,
|