javonet-nodejs-sdk 2.6.2 → 2.6.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/dist/core/handler/AbstractHandler.cjs +4 -4
- package/dist/core/handler/AddEventListenerHandler.cjs +36 -0
- package/dist/core/handler/ArrayReferenceHandler.cjs +36 -0
- package/dist/core/handler/AsKwargsHandler.cjs +36 -0
- package/dist/core/handler/AsOutHandler.cjs +36 -0
- package/dist/core/handler/AsRefHandler.cjs +36 -0
- package/dist/core/handler/CreateNullHandler.cjs +36 -0
- package/dist/core/handler/ExceptionHandler.cjs +36 -0
- package/dist/core/handler/GenerateLibHandler.cjs +36 -0
- package/dist/core/handler/GetAsyncOperationResultHandler.cjs +36 -0
- package/dist/core/handler/GetEnumItemHandler.cjs +36 -0
- package/dist/core/handler/GetEnumNameHandler.cjs +36 -0
- package/dist/core/handler/GetEnumValueHandler.cjs +36 -0
- package/dist/core/handler/GetGlobalFieldHandler.cjs +63 -0
- package/dist/core/handler/GetInstanceMethodAsDelegateHandler.cjs +2 -4
- package/dist/core/handler/GetModuleHandler.cjs +36 -0
- package/dist/core/handler/GetRefValueHandler.cjs +36 -0
- package/dist/core/handler/GetResultTypeHandler.cjs +43 -0
- package/dist/core/handler/GetStaticMethodAsDelegateHandler.cjs +4 -2
- package/dist/core/handler/GetTypeHandler.cjs +3 -3
- package/dist/core/handler/Handler.cjs +55 -11
- package/dist/core/handler/HeartBeatHandler.cjs +36 -0
- package/dist/core/handler/InvokeGenericMethodHandler.cjs +36 -0
- package/dist/core/handler/InvokeGenericStaticMethodHandler.cjs +36 -0
- package/dist/core/handler/OptimizeHandler.cjs +36 -0
- package/dist/core/handler/PluginWrapperHandler.cjs +36 -0
- package/dist/core/handler/RetrieveArrayHandler.cjs +36 -0
- package/dist/core/transmitter/Transmitter.cjs +4 -4
- package/dist/sdk/ActivatorDetails.cjs +37 -0
- package/dist/sdk/ConfigRuntimeFactory.cjs +50 -47
- package/dist/sdk/InvocationContext.cjs +91 -0
- package/dist/sdk/Javonet.cjs +22 -1
- package/dist/sdk/RuntimeContext.cjs +19 -0
- package/dist/sdk/RuntimeFactory.cjs +33 -1
- package/dist/sdk/configuration/Config.cjs +55 -0
- package/dist/sdk/configuration/ConfigPriority.cjs +38 -0
- package/dist/sdk/configuration/ConfigSourceResolver.cjs +100 -0
- package/dist/sdk/configuration/ConfigsDictionary.cjs +121 -0
- package/dist/sdk/configuration/configResolvers/ConfigResolver.cjs +121 -0
- package/dist/sdk/configuration/configResolvers/ConnectionStringConfigResolver.cjs +123 -0
- package/dist/sdk/configuration/configResolvers/JsonConfigResolver.cjs +125 -0
- package/dist/sdk/configuration/configResolvers/YamlConfigResolver.cjs +125 -0
- package/dist/sdk/tools/ComplexTypeResolver.cjs +114 -0
- package/dist/sdk/tools/JsonResolver.cjs +4 -1
- package/dist/sdk/tools/typeParsingFunctions/JavaTypeParsingFunctions.cjs +44 -0
- package/dist/sdk/tools/typeParsingFunctions/NetcoreTypeParsingFunctions.cjs +44 -0
- package/dist/sdk/tools/typeParsingFunctions/NodejsTypeParsingFunctions.cjs +44 -0
- package/dist/sdk/tools/typeParsingFunctions/PythonTypeParsingFunctions.cjs +44 -0
- package/dist/sdk/tools/typeParsingFunctions/TypeParsingUtils.cjs +34 -0
- package/dist/types/core/handler/AddEventListenerHandler.d.ts +7 -0
- package/dist/types/core/handler/ArrayReferenceHandler.d.ts +7 -0
- package/dist/types/core/handler/AsKwargsHandler.d.ts +7 -0
- package/dist/types/core/handler/AsOutHandler.d.ts +7 -0
- package/dist/types/core/handler/AsRefHandler.d.ts +7 -0
- package/dist/types/core/handler/CreateNullHandler.d.ts +7 -0
- package/dist/types/core/handler/ExceptionHandler.d.ts +7 -0
- package/dist/types/core/handler/GenerateLibHandler.d.ts +7 -0
- package/dist/types/core/handler/GetAsyncOperationResultHandler.d.ts +7 -0
- package/dist/types/core/handler/GetEnumItemHandler.d.ts +7 -0
- package/dist/types/core/handler/GetEnumNameHandler.d.ts +7 -0
- package/dist/types/core/handler/GetEnumValueHandler.d.ts +7 -0
- package/dist/types/core/handler/GetGlobalFieldHandler.d.ts +13 -0
- package/dist/types/core/handler/GetModuleHandler.d.ts +7 -0
- package/dist/types/core/handler/GetRefValueHandler.d.ts +7 -0
- package/dist/types/core/handler/GetResultTypeHandler.d.ts +18 -0
- package/dist/types/core/handler/HeartBeatHandler.d.ts +7 -0
- package/dist/types/core/handler/InvokeGenericMethodHandler.d.ts +7 -0
- package/dist/types/core/handler/InvokeGenericStaticMethodHandler.d.ts +7 -0
- package/dist/types/core/handler/OptimizeHandler.d.ts +7 -0
- package/dist/types/core/handler/PluginWrapperHandler.d.ts +7 -0
- package/dist/types/core/handler/RetrieveArrayHandler.d.ts +7 -0
- package/dist/types/core/transmitter/Transmitter.d.ts +1 -1
- package/dist/types/sdk/ActivatorDetails.d.ts +12 -0
- package/dist/types/sdk/ConfigRuntimeFactory.d.ts +3 -0
- package/dist/types/sdk/InvocationContext.d.ts +22 -0
- package/dist/types/sdk/Javonet.d.ts +15 -1
- package/dist/types/sdk/RuntimeContext.d.ts +8 -0
- package/dist/types/sdk/RuntimeFactory.d.ts +14 -0
- package/dist/types/sdk/configuration/Config.d.ts +14 -0
- package/dist/types/sdk/configuration/ConfigPriority.d.ts +8 -0
- package/dist/types/sdk/configuration/ConfigSourceResolver.d.ts +7 -0
- package/dist/types/sdk/configuration/ConfigsDictionary.d.ts +30 -0
- package/dist/types/sdk/configuration/configResolvers/ConfigResolver.d.ts +30 -0
- package/dist/types/sdk/configuration/configResolvers/ConnectionStringConfigResolver.d.ts +23 -0
- package/dist/types/sdk/configuration/configResolvers/JsonConfigResolver.d.ts +26 -0
- package/dist/types/sdk/configuration/configResolvers/YamlConfigResolver.d.ts +32 -0
- package/dist/types/sdk/tools/ComplexTypeResolver.d.ts +28 -0
- package/dist/types/sdk/tools/JsonResolver.d.ts +4 -2
- package/dist/types/sdk/tools/typeParsingFunctions/JavaTypeParsingFunctions.d.ts +11 -0
- package/dist/types/sdk/tools/typeParsingFunctions/NetcoreTypeParsingFunctions.d.ts +11 -0
- package/dist/types/sdk/tools/typeParsingFunctions/NodejsTypeParsingFunctions.d.ts +11 -0
- package/dist/types/sdk/tools/typeParsingFunctions/PythonTypeParsingFunctions.d.ts +11 -0
- package/dist/types/sdk/tools/typeParsingFunctions/TypeParsingUtils.d.ts +1 -0
- package/dist/types/utils/CommandType.d.ts +3 -0
- package/dist/types/utils/IsThenable.d.ts +6 -0
- package/dist/types/utils/Runtime.d.ts +4 -3
- package/dist/types/utils/RuntimeNameHandler.d.ts +5 -0
- package/dist/utils/CommandType.cjs +4 -1
- package/dist/utils/IsThenable.cjs +30 -0
- package/dist/utils/RuntimeNameHandler.cjs +34 -0
- package/dist/utils/connectionData/InMemoryConnectionData.cjs +7 -1
- package/dist/utils/connectionData/WsConnectionData.cjs +6 -0
- package/dist/utils/exception/ExceptionSerializer.cjs +6 -2
- package/dist/utils/nodejs/connectionData/TcpConnectionData.cjs +15 -6
- package/lib/core/handler/AbstractHandler.js +7 -5
- package/lib/core/handler/AddEventListenerHandler.js +11 -0
- package/lib/core/handler/ArrayReferenceHandler.js +11 -0
- package/lib/core/handler/AsKwargsHandler.js +11 -0
- package/lib/core/handler/AsOutHandler.js +11 -0
- package/lib/core/handler/AsRefHandler.js +11 -0
- package/lib/core/handler/CreateNullHandler.js +11 -0
- package/lib/core/handler/ExceptionHandler.js +11 -0
- package/lib/core/handler/GenerateLibHandler.js +11 -0
- package/lib/core/handler/GetAsyncOperationResultHandler.js +11 -0
- package/lib/core/handler/GetEnumItemHandler.js +11 -0
- package/lib/core/handler/GetEnumNameHandler.js +11 -0
- package/lib/core/handler/GetEnumValueHandler.js +11 -0
- package/lib/core/handler/GetGlobalFieldHandler.js +44 -0
- package/lib/core/handler/GetInstanceMethodAsDelegateHandler.js +3 -3
- package/lib/core/handler/GetModuleHandler.js +11 -0
- package/lib/core/handler/GetRefValueHandler.js +11 -0
- package/lib/core/handler/GetResultTypeHandler.js +29 -0
- package/lib/core/handler/GetStaticFieldHandler.js +0 -1
- package/lib/core/handler/GetStaticMethodAsDelegateHandler.js +3 -1
- package/lib/core/handler/GetTypeHandler.js +3 -3
- package/lib/core/handler/Handler.js +55 -11
- package/lib/core/handler/HeartBeatHandler.js +11 -0
- package/lib/core/handler/InvokeGenericMethodHandler.js +11 -0
- package/lib/core/handler/InvokeGenericStaticMethodHandler.js +11 -0
- package/lib/core/handler/InvokeStaticMethodHandler.js +1 -1
- package/lib/core/handler/OptimizeHandler.js +11 -0
- package/lib/core/handler/PluginWrapperHandler.js +11 -0
- package/lib/core/handler/ResolveReferenceHandler.js +1 -3
- package/lib/core/handler/RetrieveArrayHandler.js +11 -0
- package/lib/core/receiver/Receiver.js +5 -7
- package/lib/core/transmitter/Transmitter.js +5 -5
- package/lib/core/webSocketClient/WebSocketClientBrowser.js +2 -2
- package/lib/sdk/ActivatorDetails.js +15 -0
- package/lib/sdk/ConfigRuntimeFactory.js +65 -48
- package/lib/sdk/InvocationContext.js +95 -0
- package/lib/sdk/Javonet.js +31 -3
- package/lib/sdk/RuntimeContext.js +21 -0
- package/lib/sdk/RuntimeFactory.js +49 -1
- package/lib/sdk/configuration/Config.js +37 -0
- package/lib/sdk/configuration/ConfigPriority.js +9 -0
- package/lib/sdk/configuration/ConfigSourceResolver.js +84 -0
- package/lib/sdk/configuration/ConfigsDictionary.js +118 -0
- package/lib/sdk/configuration/configResolvers/ConfigResolver.js +109 -0
- package/lib/sdk/configuration/configResolvers/ConnectionStringConfigResolver.js +119 -0
- package/lib/sdk/configuration/configResolvers/JsonConfigResolver.js +99 -0
- package/lib/sdk/configuration/configResolvers/YamlConfigResolver.js +109 -0
- package/lib/sdk/tools/ActivationHelper.js +1 -1
- package/lib/sdk/tools/ComplexTypeResolver.js +103 -0
- package/lib/sdk/tools/JsonResolver.js +5 -1
- package/lib/sdk/tools/typeParsingFunctions/JavaTypeParsingFunctions.js +25 -0
- package/lib/sdk/tools/typeParsingFunctions/NetcoreTypeParsingFunctions.js +25 -0
- package/lib/sdk/tools/typeParsingFunctions/NodejsTypeParsingFunctions.js +25 -0
- package/lib/sdk/tools/typeParsingFunctions/PythonTypeParsingFunctions.js +25 -0
- package/lib/sdk/tools/typeParsingFunctions/TypeParsingUtils.js +13 -0
- package/lib/utils/CommandType.js +3 -0
- package/lib/utils/CustomError.js +1 -1
- package/lib/utils/IsThenable.js +10 -0
- package/lib/utils/Runtime.js +11 -4
- package/lib/utils/RuntimeLoggerBrowser.js +0 -1
- package/lib/utils/RuntimeNameHandler.js +37 -0
- package/lib/utils/TypesHandler.js +11 -5
- package/lib/utils/connectionData/InMemoryConnectionData.js +8 -1
- package/lib/utils/connectionData/WsConnectionData.js +7 -0
- package/lib/utils/exception/ExceptionSerializer.js +6 -2
- package/lib/utils/nodejs/connectionData/TcpConnectionData.js +16 -6
- package/lib/utils/nodejs/uuid/v4.js +0 -1
- package/package.json +4 -2
|
@@ -11,8 +11,10 @@ export class JsonResolver {
|
|
|
11
11
|
constructor(configSource: string | ConfigSource);
|
|
12
12
|
/** @type {ConfigSource} */
|
|
13
13
|
jsonObject: ConfigSource;
|
|
14
|
-
/** @type {string
|
|
15
|
-
configSource: string
|
|
14
|
+
/** @type {string} */
|
|
15
|
+
configSource: string;
|
|
16
|
+
/** @type {boolean} */
|
|
17
|
+
isConfigSourcePath: boolean;
|
|
16
18
|
/**
|
|
17
19
|
* @returns {Partial<Runtimes>}
|
|
18
20
|
*/
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {InvocationContext} invocationContext - InvocationContext pointing to the target object
|
|
3
|
+
* @returns {Date} A JavaScript Date parsed from the Java timestamp
|
|
4
|
+
*/
|
|
5
|
+
export function parseDate(invocationContext: InvocationContext): Date;
|
|
6
|
+
/**
|
|
7
|
+
* Mapping of parsing functions for different type signatures.
|
|
8
|
+
* @type {Map<string, (invocationContext: InvocationContext) => unknown>}
|
|
9
|
+
*/
|
|
10
|
+
export const JavaTypeParsingFunctions: Map<string, (invocationContext: InvocationContext) => unknown>;
|
|
11
|
+
export type InvocationContext = import("../../InvocationContext.js").InvocationContext;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {InvocationContext} invocationContext - InvocationContext pointing to the target object
|
|
3
|
+
* @returns {Date} A JavaScript Date parsed from the Java timestamp
|
|
4
|
+
*/
|
|
5
|
+
export function parseDate(invocationContext: InvocationContext): Date;
|
|
6
|
+
/**
|
|
7
|
+
* Mapping of parsing functions for different type signatures.
|
|
8
|
+
* @type {Map<string, (invocationContext: InvocationContext) => unknown>}
|
|
9
|
+
*/
|
|
10
|
+
export const NetcoreTypeParsingFunctions: Map<string, (invocationContext: InvocationContext) => unknown>;
|
|
11
|
+
export type InvocationContext = import("../../InvocationContext.js").InvocationContext;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {InvocationContext} invocationContext - InvocationContext pointing to the target object
|
|
3
|
+
* @returns {Date} A JavaScript Date parsed from the Java timestamp
|
|
4
|
+
*/
|
|
5
|
+
export function parseDate(invocationContext: InvocationContext): Date;
|
|
6
|
+
/**
|
|
7
|
+
* Mapping of parsing functions for different type signatures.
|
|
8
|
+
* @type {Map<string, (invocationContext: InvocationContext) => unknown>}
|
|
9
|
+
*/
|
|
10
|
+
export const NodejsTypeParsingFunctions: Map<string, (invocationContext: InvocationContext) => unknown>;
|
|
11
|
+
export type InvocationContext = import("../../InvocationContext.js").InvocationContext;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {InvocationContext} invocationContext - InvocationContext pointing to the target object
|
|
3
|
+
* @returns {Date} A JavaScript Date parsed from the Java timestamp
|
|
4
|
+
*/
|
|
5
|
+
export function parseDatetime(invocationContext: InvocationContext): Date;
|
|
6
|
+
/**
|
|
7
|
+
* Mapping of parsing functions for different type signatures.
|
|
8
|
+
* @type {Map<string, (invocationContext: InvocationContext) => unknown>}
|
|
9
|
+
*/
|
|
10
|
+
export const PythonTypeParsingFunctions: Map<string, (invocationContext: InvocationContext) => unknown>;
|
|
11
|
+
export type InvocationContext = import("../../InvocationContext.js").InvocationContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function handleResultWithAction(result: any, action: (arg0: any) => any): any;
|
|
@@ -18,6 +18,7 @@ export function isEsmRuntime(): boolean;
|
|
|
18
18
|
* @returns {string}
|
|
19
19
|
*/
|
|
20
20
|
export function getRuntimeExtension(): string;
|
|
21
|
-
export function getRequire(callerPath
|
|
22
|
-
export function getDirname():
|
|
23
|
-
export function getDependency(dependencyName: string, callerPathOrUrl
|
|
21
|
+
export function getRequire(callerPath?: string): any;
|
|
22
|
+
export function getDirname(): string | Error;
|
|
23
|
+
export function getDependency(dependencyName: string, callerPathOrUrl?: string): string;
|
|
24
|
+
export type ConfigSource = import("../types.js").ConfigSource;
|
|
@@ -68,7 +68,10 @@ const CommandType = (
|
|
|
68
68
|
ConvertType: 41,
|
|
69
69
|
AddEventListener: 42,
|
|
70
70
|
PluginWrapper: 43,
|
|
71
|
-
GetAsyncOperationResult: 44
|
|
71
|
+
GetAsyncOperationResult: 44,
|
|
72
|
+
AsKwargs: 45,
|
|
73
|
+
GetResultType: 46,
|
|
74
|
+
GetGlobalField: 47
|
|
72
75
|
}
|
|
73
76
|
);
|
|
74
77
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -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 IsThenable_exports = {};
|
|
20
|
+
__export(IsThenable_exports, {
|
|
21
|
+
isThenable: () => isThenable
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(IsThenable_exports);
|
|
24
|
+
function isThenable(value) {
|
|
25
|
+
return value !== null && typeof value === "object" && "then" in value;
|
|
26
|
+
}
|
|
27
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
+
0 && (module.exports = {
|
|
29
|
+
isThenable
|
|
30
|
+
});
|
|
@@ -55,6 +55,40 @@ class RuntimeNameHandler {
|
|
|
55
55
|
throw new Error("Invalid runtime name.");
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* @param {string} name
|
|
60
|
+
* @returns {number}
|
|
61
|
+
*/
|
|
62
|
+
static getRuntime = (name) => {
|
|
63
|
+
if (!name || name.trim() === "") {
|
|
64
|
+
throw new Error("Runtime name cannot be null or whitespace.");
|
|
65
|
+
}
|
|
66
|
+
const normalized = name.trim().toLowerCase();
|
|
67
|
+
switch (normalized) {
|
|
68
|
+
case "clr":
|
|
69
|
+
return import_RuntimeName.RuntimeName.Clr;
|
|
70
|
+
case "go":
|
|
71
|
+
return import_RuntimeName.RuntimeName.Go;
|
|
72
|
+
case "jvm":
|
|
73
|
+
return import_RuntimeName.RuntimeName.Jvm;
|
|
74
|
+
case "netcore":
|
|
75
|
+
return import_RuntimeName.RuntimeName.Netcore;
|
|
76
|
+
case "perl":
|
|
77
|
+
return import_RuntimeName.RuntimeName.Perl;
|
|
78
|
+
case "python":
|
|
79
|
+
return import_RuntimeName.RuntimeName.Python;
|
|
80
|
+
case "ruby":
|
|
81
|
+
return import_RuntimeName.RuntimeName.Ruby;
|
|
82
|
+
case "nodejs":
|
|
83
|
+
return import_RuntimeName.RuntimeName.Nodejs;
|
|
84
|
+
case "php":
|
|
85
|
+
return import_RuntimeName.RuntimeName.Php;
|
|
86
|
+
case "python27":
|
|
87
|
+
return import_RuntimeName.RuntimeName.Python27;
|
|
88
|
+
default:
|
|
89
|
+
throw new Error(`${name} is not a supported runtime.`);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
58
92
|
}
|
|
59
93
|
// Annotate the CommonJS export names for ESM import in node:
|
|
60
94
|
0 && (module.exports = {
|
|
@@ -27,7 +27,7 @@ class InMemoryConnectionData extends import_IConnectionData.IConnectionData {
|
|
|
27
27
|
constructor() {
|
|
28
28
|
super();
|
|
29
29
|
this._connectionType = import_ConnectionType.ConnectionType.IN_MEMORY;
|
|
30
|
-
this._hostname = "";
|
|
30
|
+
this._hostname = "inMemory";
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
33
|
* @returns {ConnectionType}
|
|
@@ -55,6 +55,12 @@ class InMemoryConnectionData extends import_IConnectionData.IConnectionData {
|
|
|
55
55
|
equals(other) {
|
|
56
56
|
return other instanceof InMemoryConnectionData;
|
|
57
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* @returns {string}
|
|
60
|
+
*/
|
|
61
|
+
toString() {
|
|
62
|
+
return this.hostname;
|
|
63
|
+
}
|
|
58
64
|
}
|
|
59
65
|
// Annotate the CommonJS export names for ESM import in node:
|
|
60
66
|
0 && (module.exports = {
|
|
@@ -58,6 +58,12 @@ class WsConnectionData extends import_IConnectionData.IConnectionData {
|
|
|
58
58
|
equals(other) {
|
|
59
59
|
return other instanceof WsConnectionData && this._hostname === other.hostname;
|
|
60
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* @returns {string}
|
|
63
|
+
*/
|
|
64
|
+
toString() {
|
|
65
|
+
return this.hostname;
|
|
66
|
+
}
|
|
61
67
|
}
|
|
62
68
|
// Annotate the CommonJS export names for ESM import in node:
|
|
63
69
|
0 && (module.exports = {
|
|
@@ -35,7 +35,9 @@ class ExceptionSerializer {
|
|
|
35
35
|
try {
|
|
36
36
|
this.serializeStackTrace(exception, stackClasses, stackMethods, stackLines, stackFiles);
|
|
37
37
|
exceptionCommand = exceptionCommand.addArgToPayload(this.getExceptionCode(exception));
|
|
38
|
-
exceptionCommand = exceptionCommand.addArgToPayload(
|
|
38
|
+
exceptionCommand = exceptionCommand.addArgToPayload(
|
|
39
|
+
command ? command.toString() : "Command is null"
|
|
40
|
+
);
|
|
39
41
|
exceptionCommand = exceptionCommand.addArgToPayload(exception.name);
|
|
40
42
|
exceptionCommand = exceptionCommand.addArgToPayload(exception.message);
|
|
41
43
|
exceptionCommand = exceptionCommand.addArgToPayload(stackClasses.join("|"));
|
|
@@ -45,7 +47,9 @@ class ExceptionSerializer {
|
|
|
45
47
|
} catch (e) {
|
|
46
48
|
exceptionCommand = new import_Command.Command(import_RuntimeName.RuntimeName.Nodejs, import_CommandType.CommandType.Exception, []);
|
|
47
49
|
exceptionCommand = exceptionCommand.addArgToPayload(this.getExceptionCode(e));
|
|
48
|
-
exceptionCommand = exceptionCommand.addArgToPayload(
|
|
50
|
+
exceptionCommand = exceptionCommand.addArgToPayload(
|
|
51
|
+
command ? command.toString() : "Command is null"
|
|
52
|
+
);
|
|
49
53
|
exceptionCommand = exceptionCommand.addArgToPayload("Node.js Exception Serialization Error");
|
|
50
54
|
exceptionCommand = exceptionCommand.addArgToPayload(e.message);
|
|
51
55
|
exceptionCommand = exceptionCommand.addArgToPayload("ExceptionSerializer");
|
|
@@ -81,13 +81,16 @@ class TcpConnectionData extends import_IConnectionData.IConnectionData {
|
|
|
81
81
|
return hostname;
|
|
82
82
|
} else {
|
|
83
83
|
const dns = requireDynamic("dns");
|
|
84
|
-
return dns.resolve4(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
return dns.resolve4(
|
|
85
|
+
hostname,
|
|
86
|
+
(err, addresses) => {
|
|
87
|
+
if (err) {
|
|
88
|
+
console.error(err);
|
|
89
|
+
return "";
|
|
90
|
+
}
|
|
91
|
+
return addresses[0];
|
|
88
92
|
}
|
|
89
|
-
|
|
90
|
-
});
|
|
93
|
+
);
|
|
91
94
|
}
|
|
92
95
|
}
|
|
93
96
|
return "";
|
|
@@ -124,6 +127,12 @@ class TcpConnectionData extends import_IConnectionData.IConnectionData {
|
|
|
124
127
|
#getPortBytes() {
|
|
125
128
|
return [this._port & 255, this._port >> 8];
|
|
126
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* @returns {string}
|
|
132
|
+
*/
|
|
133
|
+
toString() {
|
|
134
|
+
return `${this.ipAddress}:${this._port}`;
|
|
135
|
+
}
|
|
127
136
|
}
|
|
128
137
|
// Annotate the CommonJS export names for ESM import in node:
|
|
129
138
|
0 && (module.exports = {
|
|
@@ -39,16 +39,18 @@ class AbstractHandler {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
43
|
-
* @param {*} error
|
|
44
|
-
* @param {*} class_name
|
|
45
|
-
* @returns
|
|
42
|
+
*
|
|
43
|
+
* @param {*} error
|
|
44
|
+
* @param {*} class_name
|
|
45
|
+
* @returns
|
|
46
46
|
*/
|
|
47
47
|
process_stack_trace(error, class_name) {
|
|
48
48
|
let stackTraceArray = error.stack.split('\n').map((/** @type {string} */ frame) => frame.trim())
|
|
49
49
|
stackTraceArray.forEach((/** @type {string} */ str, /** @type {number} */ index) => {
|
|
50
50
|
if (str.includes(class_name)) {
|
|
51
|
-
stackTraceArray = stackTraceArray
|
|
51
|
+
stackTraceArray = stackTraceArray
|
|
52
|
+
.slice(0, index)
|
|
53
|
+
.filter((/** @type {string} */ s) => !s.includes(class_name))
|
|
52
54
|
}
|
|
53
55
|
})
|
|
54
56
|
error.stack = stackTraceArray.join(' \n ')
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
import { AbstractHandler } from './AbstractHandler.js'
|
|
3
|
+
|
|
4
|
+
export class AddEventListenerHandler extends AbstractHandler {
|
|
5
|
+
/**
|
|
6
|
+
* @param {any} command
|
|
7
|
+
*/
|
|
8
|
+
handleCommand(command) {
|
|
9
|
+
throw new Error(`${this.constructor.name} is not implemented in Node.js`)
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
import { AbstractHandler } from './AbstractHandler.js'
|
|
3
|
+
|
|
4
|
+
export class ArrayReferenceHandler extends AbstractHandler {
|
|
5
|
+
/**
|
|
6
|
+
* @param {any} command
|
|
7
|
+
*/
|
|
8
|
+
handleCommand(command) {
|
|
9
|
+
throw new Error(`${this.constructor.name} is not implemented in Node.js`)
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
import { AbstractHandler } from './AbstractHandler.js'
|
|
3
|
+
|
|
4
|
+
export class AsKwargsHandler extends AbstractHandler {
|
|
5
|
+
/**
|
|
6
|
+
* @param {any} command
|
|
7
|
+
*/
|
|
8
|
+
handleCommand(command) {
|
|
9
|
+
throw new Error(`${this.constructor.name} is not implemented in Node.js`)
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
import { AbstractHandler } from './AbstractHandler.js'
|
|
3
|
+
|
|
4
|
+
export class AsOutHandler extends AbstractHandler {
|
|
5
|
+
/**
|
|
6
|
+
* @param {any} command
|
|
7
|
+
*/
|
|
8
|
+
handleCommand(command) {
|
|
9
|
+
throw new Error(`${this.constructor.name} is not implemented in Node.js`)
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
import { AbstractHandler } from './AbstractHandler.js'
|
|
3
|
+
|
|
4
|
+
export class AsRefHandler extends AbstractHandler {
|
|
5
|
+
/**
|
|
6
|
+
* @param {any} command
|
|
7
|
+
*/
|
|
8
|
+
handleCommand(command) {
|
|
9
|
+
throw new Error(`${this.constructor.name} is not implemented in Node.js`)
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
import { AbstractHandler } from './AbstractHandler.js'
|
|
3
|
+
|
|
4
|
+
export class CreateNullHandler extends AbstractHandler {
|
|
5
|
+
/**
|
|
6
|
+
* @param {any} command
|
|
7
|
+
*/
|
|
8
|
+
handleCommand(command) {
|
|
9
|
+
throw new Error(`${this.constructor.name} is not implemented in Node.js`)
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
import { AbstractHandler } from './AbstractHandler.js'
|
|
3
|
+
|
|
4
|
+
export class ExceptionHandler extends AbstractHandler {
|
|
5
|
+
/**
|
|
6
|
+
* @param {any} command
|
|
7
|
+
*/
|
|
8
|
+
handleCommand(command) {
|
|
9
|
+
throw new Error(`${this.constructor.name} is not implemented in Node.js`)
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
import { AbstractHandler } from './AbstractHandler.js'
|
|
3
|
+
|
|
4
|
+
export class GenerateLibHandler extends AbstractHandler {
|
|
5
|
+
/**
|
|
6
|
+
* @param {any} command
|
|
7
|
+
*/
|
|
8
|
+
handleCommand(command) {
|
|
9
|
+
throw new Error(`${this.constructor.name} is not implemented in Node.js`)
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
import { AbstractHandler } from './AbstractHandler.js'
|
|
3
|
+
|
|
4
|
+
export class GetAsyncOperationResultHandler extends AbstractHandler {
|
|
5
|
+
/**
|
|
6
|
+
* @param {any} command
|
|
7
|
+
*/
|
|
8
|
+
handleCommand(command) {
|
|
9
|
+
throw new Error(`${this.constructor.name} is not implemented in Node.js`)
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
import { AbstractHandler } from './AbstractHandler.js'
|
|
3
|
+
|
|
4
|
+
export class GetEnumItemHandler extends AbstractHandler {
|
|
5
|
+
/**
|
|
6
|
+
* @param {any} command
|
|
7
|
+
*/
|
|
8
|
+
handleCommand(command) {
|
|
9
|
+
throw new Error(`${this.constructor.name} is not implemented in Node.js`)
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
import { AbstractHandler } from './AbstractHandler.js'
|
|
3
|
+
|
|
4
|
+
export class GetEnumNameHandler extends AbstractHandler {
|
|
5
|
+
/**
|
|
6
|
+
* @param {any} command
|
|
7
|
+
*/
|
|
8
|
+
handleCommand(command) {
|
|
9
|
+
throw new Error(`${this.constructor.name} is not implemented in Node.js`)
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
import { AbstractHandler } from './AbstractHandler.js'
|
|
3
|
+
|
|
4
|
+
export class GetEnumValueHandler extends AbstractHandler {
|
|
5
|
+
/**
|
|
6
|
+
* @param {any} command
|
|
7
|
+
*/
|
|
8
|
+
handleCommand(command) {
|
|
9
|
+
throw new Error(`${this.constructor.name} is not implemented in Node.js`)
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { AbstractHandler } from './AbstractHandler.js'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {import('../../utils/Command.js').Command} Command
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
class GetGlobalFieldHandler extends AbstractHandler {
|
|
8
|
+
requiredParametersCount = 1
|
|
9
|
+
|
|
10
|
+
constructor() {
|
|
11
|
+
super()
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @param {Command} command
|
|
16
|
+
* @returns {any}
|
|
17
|
+
*/
|
|
18
|
+
process(command) {
|
|
19
|
+
try {
|
|
20
|
+
if (command.payload.length < this.requiredParametersCount) {
|
|
21
|
+
throw new Error('Invoke Global Field parameters mismatch')
|
|
22
|
+
}
|
|
23
|
+
const { payload } = command
|
|
24
|
+
const fieldName = payload[0]
|
|
25
|
+
|
|
26
|
+
if (fieldName in global && typeof global[fieldName] !== 'function') {
|
|
27
|
+
return global[fieldName]
|
|
28
|
+
} else {
|
|
29
|
+
const fields = Object.getOwnPropertyNames(global).filter(
|
|
30
|
+
(property) => typeof global[property] !== 'function'
|
|
31
|
+
)
|
|
32
|
+
let message = `Field ${fieldName} not found in global. Available fields:\n`
|
|
33
|
+
fields.forEach((field) => {
|
|
34
|
+
message += `${field}\n`
|
|
35
|
+
})
|
|
36
|
+
throw new Error(message)
|
|
37
|
+
}
|
|
38
|
+
} catch (error) {
|
|
39
|
+
throw this.process_stack_trace(error, this.constructor.name)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { GetGlobalFieldHandler }
|
|
@@ -66,9 +66,9 @@ class GetInstanceMethodAsDelegateHandler extends AbstractHandler {
|
|
|
66
66
|
* @returns {Error} The error with detailed message.
|
|
67
67
|
*/
|
|
68
68
|
createMethodNotFoundError(type, methodName) {
|
|
69
|
-
const methods = Object.getOwnPropertyNames(
|
|
70
|
-
|
|
71
|
-
)
|
|
69
|
+
const methods = Object.getOwnPropertyNames(
|
|
70
|
+
/** @type {{prototype: Object}} */ (type).prototype
|
|
71
|
+
).filter((key) => typeof (/** @type {any} */ (type).prototype[key]) === 'function')
|
|
72
72
|
const availableMethods = methods.map((name) => `${name}()`)
|
|
73
73
|
const message = `Method ${methodName} not found in class ${/** @type {{name: string}} */ (type).name}. Available instance public methods:\n${availableMethods.join('\n')}`
|
|
74
74
|
return new Error(message)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
import { AbstractHandler } from './AbstractHandler.js'
|
|
3
|
+
|
|
4
|
+
export class GetModuleHandler extends AbstractHandler {
|
|
5
|
+
/**
|
|
6
|
+
* @param {any} command
|
|
7
|
+
*/
|
|
8
|
+
handleCommand(command) {
|
|
9
|
+
throw new Error(`${this.constructor.name} is not implemented in Node.js`)
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
import { AbstractHandler } from './AbstractHandler.js'
|
|
3
|
+
|
|
4
|
+
export class GetRefValueHandler extends AbstractHandler {
|
|
5
|
+
/**
|
|
6
|
+
* @param {any} command
|
|
7
|
+
*/
|
|
8
|
+
handleCommand(command) {
|
|
9
|
+
throw new Error(`${this.constructor.name} is not implemented in Node.js`)
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
import { TypesHandler } from '../../utils/TypesHandler.js'
|
|
3
|
+
import { AbstractHandler } from './AbstractHandler.js'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @typedef {import('../../utils/Command.js').Command} Command
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* GetResultTypeHandler class handles the conversion of JType to Type.
|
|
11
|
+
*/
|
|
12
|
+
class GetResultTypeHandler extends AbstractHandler {
|
|
13
|
+
constructor() {
|
|
14
|
+
super()
|
|
15
|
+
/** @type {number} */
|
|
16
|
+
this.requiredParametersCount = 1
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Processes the given command to convert JType to Type.
|
|
21
|
+
* @param {Command} command - The command to process.
|
|
22
|
+
* @returns {any} The converted type.
|
|
23
|
+
*/
|
|
24
|
+
process(command) {
|
|
25
|
+
return command.payload[0].constructor.name
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { GetResultTypeHandler }
|
|
@@ -64,7 +64,9 @@ class GetStaticMethodAsDelegateHandler extends AbstractHandler {
|
|
|
64
64
|
* @returns {Error} The error with detailed message.
|
|
65
65
|
*/
|
|
66
66
|
createMethodNotFoundError(type, methodName) {
|
|
67
|
-
const methods = Object.keys(type).filter(
|
|
67
|
+
const methods = Object.keys(type).filter(
|
|
68
|
+
(key) => typeof (/** @type {any} */ (type)[key]) === 'function'
|
|
69
|
+
)
|
|
68
70
|
const availableMethods = methods.map((name) => `${name}()`)
|
|
69
71
|
const message = `Method ${methodName} not found in class ${/** @type {{name: string}} */ (type).name}. Available public static methods:\n${availableMethods.join('\n')}`
|
|
70
72
|
return new Error(message)
|