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.
Files changed (172) hide show
  1. package/dist/core/handler/AbstractHandler.cjs +4 -4
  2. package/dist/core/handler/AddEventListenerHandler.cjs +36 -0
  3. package/dist/core/handler/ArrayReferenceHandler.cjs +36 -0
  4. package/dist/core/handler/AsKwargsHandler.cjs +36 -0
  5. package/dist/core/handler/AsOutHandler.cjs +36 -0
  6. package/dist/core/handler/AsRefHandler.cjs +36 -0
  7. package/dist/core/handler/CreateNullHandler.cjs +36 -0
  8. package/dist/core/handler/ExceptionHandler.cjs +36 -0
  9. package/dist/core/handler/GenerateLibHandler.cjs +36 -0
  10. package/dist/core/handler/GetAsyncOperationResultHandler.cjs +36 -0
  11. package/dist/core/handler/GetEnumItemHandler.cjs +36 -0
  12. package/dist/core/handler/GetEnumNameHandler.cjs +36 -0
  13. package/dist/core/handler/GetEnumValueHandler.cjs +36 -0
  14. package/dist/core/handler/GetGlobalFieldHandler.cjs +63 -0
  15. package/dist/core/handler/GetInstanceMethodAsDelegateHandler.cjs +2 -4
  16. package/dist/core/handler/GetModuleHandler.cjs +36 -0
  17. package/dist/core/handler/GetRefValueHandler.cjs +36 -0
  18. package/dist/core/handler/GetResultTypeHandler.cjs +43 -0
  19. package/dist/core/handler/GetStaticMethodAsDelegateHandler.cjs +4 -2
  20. package/dist/core/handler/GetTypeHandler.cjs +3 -3
  21. package/dist/core/handler/Handler.cjs +55 -11
  22. package/dist/core/handler/HeartBeatHandler.cjs +36 -0
  23. package/dist/core/handler/InvokeGenericMethodHandler.cjs +36 -0
  24. package/dist/core/handler/InvokeGenericStaticMethodHandler.cjs +36 -0
  25. package/dist/core/handler/OptimizeHandler.cjs +36 -0
  26. package/dist/core/handler/PluginWrapperHandler.cjs +36 -0
  27. package/dist/core/handler/RetrieveArrayHandler.cjs +36 -0
  28. package/dist/core/transmitter/Transmitter.cjs +4 -4
  29. package/dist/sdk/ActivatorDetails.cjs +37 -0
  30. package/dist/sdk/ConfigRuntimeFactory.cjs +50 -47
  31. package/dist/sdk/InvocationContext.cjs +91 -0
  32. package/dist/sdk/Javonet.cjs +22 -1
  33. package/dist/sdk/RuntimeContext.cjs +19 -0
  34. package/dist/sdk/RuntimeFactory.cjs +33 -1
  35. package/dist/sdk/configuration/Config.cjs +55 -0
  36. package/dist/sdk/configuration/ConfigPriority.cjs +38 -0
  37. package/dist/sdk/configuration/ConfigSourceResolver.cjs +100 -0
  38. package/dist/sdk/configuration/ConfigsDictionary.cjs +121 -0
  39. package/dist/sdk/configuration/configResolvers/ConfigResolver.cjs +121 -0
  40. package/dist/sdk/configuration/configResolvers/ConnectionStringConfigResolver.cjs +123 -0
  41. package/dist/sdk/configuration/configResolvers/JsonConfigResolver.cjs +125 -0
  42. package/dist/sdk/configuration/configResolvers/YamlConfigResolver.cjs +125 -0
  43. package/dist/sdk/tools/ComplexTypeResolver.cjs +114 -0
  44. package/dist/sdk/tools/JsonResolver.cjs +4 -1
  45. package/dist/sdk/tools/typeParsingFunctions/JavaTypeParsingFunctions.cjs +44 -0
  46. package/dist/sdk/tools/typeParsingFunctions/NetcoreTypeParsingFunctions.cjs +44 -0
  47. package/dist/sdk/tools/typeParsingFunctions/NodejsTypeParsingFunctions.cjs +44 -0
  48. package/dist/sdk/tools/typeParsingFunctions/PythonTypeParsingFunctions.cjs +44 -0
  49. package/dist/sdk/tools/typeParsingFunctions/TypeParsingUtils.cjs +34 -0
  50. package/dist/types/core/handler/AddEventListenerHandler.d.ts +7 -0
  51. package/dist/types/core/handler/ArrayReferenceHandler.d.ts +7 -0
  52. package/dist/types/core/handler/AsKwargsHandler.d.ts +7 -0
  53. package/dist/types/core/handler/AsOutHandler.d.ts +7 -0
  54. package/dist/types/core/handler/AsRefHandler.d.ts +7 -0
  55. package/dist/types/core/handler/CreateNullHandler.d.ts +7 -0
  56. package/dist/types/core/handler/ExceptionHandler.d.ts +7 -0
  57. package/dist/types/core/handler/GenerateLibHandler.d.ts +7 -0
  58. package/dist/types/core/handler/GetAsyncOperationResultHandler.d.ts +7 -0
  59. package/dist/types/core/handler/GetEnumItemHandler.d.ts +7 -0
  60. package/dist/types/core/handler/GetEnumNameHandler.d.ts +7 -0
  61. package/dist/types/core/handler/GetEnumValueHandler.d.ts +7 -0
  62. package/dist/types/core/handler/GetGlobalFieldHandler.d.ts +13 -0
  63. package/dist/types/core/handler/GetModuleHandler.d.ts +7 -0
  64. package/dist/types/core/handler/GetRefValueHandler.d.ts +7 -0
  65. package/dist/types/core/handler/GetResultTypeHandler.d.ts +18 -0
  66. package/dist/types/core/handler/HeartBeatHandler.d.ts +7 -0
  67. package/dist/types/core/handler/InvokeGenericMethodHandler.d.ts +7 -0
  68. package/dist/types/core/handler/InvokeGenericStaticMethodHandler.d.ts +7 -0
  69. package/dist/types/core/handler/OptimizeHandler.d.ts +7 -0
  70. package/dist/types/core/handler/PluginWrapperHandler.d.ts +7 -0
  71. package/dist/types/core/handler/RetrieveArrayHandler.d.ts +7 -0
  72. package/dist/types/core/transmitter/Transmitter.d.ts +1 -1
  73. package/dist/types/sdk/ActivatorDetails.d.ts +12 -0
  74. package/dist/types/sdk/ConfigRuntimeFactory.d.ts +3 -0
  75. package/dist/types/sdk/InvocationContext.d.ts +22 -0
  76. package/dist/types/sdk/Javonet.d.ts +15 -1
  77. package/dist/types/sdk/RuntimeContext.d.ts +8 -0
  78. package/dist/types/sdk/RuntimeFactory.d.ts +14 -0
  79. package/dist/types/sdk/configuration/Config.d.ts +14 -0
  80. package/dist/types/sdk/configuration/ConfigPriority.d.ts +8 -0
  81. package/dist/types/sdk/configuration/ConfigSourceResolver.d.ts +7 -0
  82. package/dist/types/sdk/configuration/ConfigsDictionary.d.ts +30 -0
  83. package/dist/types/sdk/configuration/configResolvers/ConfigResolver.d.ts +30 -0
  84. package/dist/types/sdk/configuration/configResolvers/ConnectionStringConfigResolver.d.ts +23 -0
  85. package/dist/types/sdk/configuration/configResolvers/JsonConfigResolver.d.ts +26 -0
  86. package/dist/types/sdk/configuration/configResolvers/YamlConfigResolver.d.ts +32 -0
  87. package/dist/types/sdk/tools/ComplexTypeResolver.d.ts +28 -0
  88. package/dist/types/sdk/tools/JsonResolver.d.ts +4 -2
  89. package/dist/types/sdk/tools/typeParsingFunctions/JavaTypeParsingFunctions.d.ts +11 -0
  90. package/dist/types/sdk/tools/typeParsingFunctions/NetcoreTypeParsingFunctions.d.ts +11 -0
  91. package/dist/types/sdk/tools/typeParsingFunctions/NodejsTypeParsingFunctions.d.ts +11 -0
  92. package/dist/types/sdk/tools/typeParsingFunctions/PythonTypeParsingFunctions.d.ts +11 -0
  93. package/dist/types/sdk/tools/typeParsingFunctions/TypeParsingUtils.d.ts +1 -0
  94. package/dist/types/utils/CommandType.d.ts +3 -0
  95. package/dist/types/utils/IsThenable.d.ts +6 -0
  96. package/dist/types/utils/Runtime.d.ts +4 -3
  97. package/dist/types/utils/RuntimeNameHandler.d.ts +5 -0
  98. package/dist/utils/CommandType.cjs +4 -1
  99. package/dist/utils/IsThenable.cjs +30 -0
  100. package/dist/utils/RuntimeNameHandler.cjs +34 -0
  101. package/dist/utils/connectionData/InMemoryConnectionData.cjs +7 -1
  102. package/dist/utils/connectionData/WsConnectionData.cjs +6 -0
  103. package/dist/utils/exception/ExceptionSerializer.cjs +6 -2
  104. package/dist/utils/nodejs/connectionData/TcpConnectionData.cjs +15 -6
  105. package/lib/core/handler/AbstractHandler.js +7 -5
  106. package/lib/core/handler/AddEventListenerHandler.js +11 -0
  107. package/lib/core/handler/ArrayReferenceHandler.js +11 -0
  108. package/lib/core/handler/AsKwargsHandler.js +11 -0
  109. package/lib/core/handler/AsOutHandler.js +11 -0
  110. package/lib/core/handler/AsRefHandler.js +11 -0
  111. package/lib/core/handler/CreateNullHandler.js +11 -0
  112. package/lib/core/handler/ExceptionHandler.js +11 -0
  113. package/lib/core/handler/GenerateLibHandler.js +11 -0
  114. package/lib/core/handler/GetAsyncOperationResultHandler.js +11 -0
  115. package/lib/core/handler/GetEnumItemHandler.js +11 -0
  116. package/lib/core/handler/GetEnumNameHandler.js +11 -0
  117. package/lib/core/handler/GetEnumValueHandler.js +11 -0
  118. package/lib/core/handler/GetGlobalFieldHandler.js +44 -0
  119. package/lib/core/handler/GetInstanceMethodAsDelegateHandler.js +3 -3
  120. package/lib/core/handler/GetModuleHandler.js +11 -0
  121. package/lib/core/handler/GetRefValueHandler.js +11 -0
  122. package/lib/core/handler/GetResultTypeHandler.js +29 -0
  123. package/lib/core/handler/GetStaticFieldHandler.js +0 -1
  124. package/lib/core/handler/GetStaticMethodAsDelegateHandler.js +3 -1
  125. package/lib/core/handler/GetTypeHandler.js +3 -3
  126. package/lib/core/handler/Handler.js +55 -11
  127. package/lib/core/handler/HeartBeatHandler.js +11 -0
  128. package/lib/core/handler/InvokeGenericMethodHandler.js +11 -0
  129. package/lib/core/handler/InvokeGenericStaticMethodHandler.js +11 -0
  130. package/lib/core/handler/InvokeStaticMethodHandler.js +1 -1
  131. package/lib/core/handler/OptimizeHandler.js +11 -0
  132. package/lib/core/handler/PluginWrapperHandler.js +11 -0
  133. package/lib/core/handler/ResolveReferenceHandler.js +1 -3
  134. package/lib/core/handler/RetrieveArrayHandler.js +11 -0
  135. package/lib/core/receiver/Receiver.js +5 -7
  136. package/lib/core/transmitter/Transmitter.js +5 -5
  137. package/lib/core/webSocketClient/WebSocketClientBrowser.js +2 -2
  138. package/lib/sdk/ActivatorDetails.js +15 -0
  139. package/lib/sdk/ConfigRuntimeFactory.js +65 -48
  140. package/lib/sdk/InvocationContext.js +95 -0
  141. package/lib/sdk/Javonet.js +31 -3
  142. package/lib/sdk/RuntimeContext.js +21 -0
  143. package/lib/sdk/RuntimeFactory.js +49 -1
  144. package/lib/sdk/configuration/Config.js +37 -0
  145. package/lib/sdk/configuration/ConfigPriority.js +9 -0
  146. package/lib/sdk/configuration/ConfigSourceResolver.js +84 -0
  147. package/lib/sdk/configuration/ConfigsDictionary.js +118 -0
  148. package/lib/sdk/configuration/configResolvers/ConfigResolver.js +109 -0
  149. package/lib/sdk/configuration/configResolvers/ConnectionStringConfigResolver.js +119 -0
  150. package/lib/sdk/configuration/configResolvers/JsonConfigResolver.js +99 -0
  151. package/lib/sdk/configuration/configResolvers/YamlConfigResolver.js +109 -0
  152. package/lib/sdk/tools/ActivationHelper.js +1 -1
  153. package/lib/sdk/tools/ComplexTypeResolver.js +103 -0
  154. package/lib/sdk/tools/JsonResolver.js +5 -1
  155. package/lib/sdk/tools/typeParsingFunctions/JavaTypeParsingFunctions.js +25 -0
  156. package/lib/sdk/tools/typeParsingFunctions/NetcoreTypeParsingFunctions.js +25 -0
  157. package/lib/sdk/tools/typeParsingFunctions/NodejsTypeParsingFunctions.js +25 -0
  158. package/lib/sdk/tools/typeParsingFunctions/PythonTypeParsingFunctions.js +25 -0
  159. package/lib/sdk/tools/typeParsingFunctions/TypeParsingUtils.js +13 -0
  160. package/lib/utils/CommandType.js +3 -0
  161. package/lib/utils/CustomError.js +1 -1
  162. package/lib/utils/IsThenable.js +10 -0
  163. package/lib/utils/Runtime.js +11 -4
  164. package/lib/utils/RuntimeLoggerBrowser.js +0 -1
  165. package/lib/utils/RuntimeNameHandler.js +37 -0
  166. package/lib/utils/TypesHandler.js +11 -5
  167. package/lib/utils/connectionData/InMemoryConnectionData.js +8 -1
  168. package/lib/utils/connectionData/WsConnectionData.js +7 -0
  169. package/lib/utils/exception/ExceptionSerializer.js +6 -2
  170. package/lib/utils/nodejs/connectionData/TcpConnectionData.js +16 -6
  171. package/lib/utils/nodejs/uuid/v4.js +0 -1
  172. package/package.json +4 -2
@@ -0,0 +1,44 @@
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 PythonTypeParsingFunctions_exports = {};
20
+ __export(PythonTypeParsingFunctions_exports, {
21
+ PythonTypeParsingFunctions: () => PythonTypeParsingFunctions,
22
+ parseDatetime: () => parseDatetime
23
+ });
24
+ module.exports = __toCommonJS(PythonTypeParsingFunctions_exports);
25
+ var import_TypeParsingUtils = require("./TypeParsingUtils.cjs");
26
+ function parseDatetime(invocationContext) {
27
+ const result = invocationContext.invokeInstanceMethod("timestamp").execute();
28
+ const action = (timestamp) => {
29
+ if (!timestamp) {
30
+ throw new Error("timestamp returned null");
31
+ }
32
+ return new Date(
33
+ /** @type {number} */
34
+ timestamp
35
+ );
36
+ };
37
+ return (0, import_TypeParsingUtils.handleResultWithAction)(result, action);
38
+ }
39
+ const PythonTypeParsingFunctions = /* @__PURE__ */ new Map([["datetime.datetime", parseDatetime]]);
40
+ // Annotate the CommonJS export names for ESM import in node:
41
+ 0 && (module.exports = {
42
+ PythonTypeParsingFunctions,
43
+ parseDatetime
44
+ });
@@ -0,0 +1,34 @@
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 TypeParsingUtils_exports = {};
20
+ __export(TypeParsingUtils_exports, {
21
+ handleResultWithAction: () => handleResultWithAction
22
+ });
23
+ module.exports = __toCommonJS(TypeParsingUtils_exports);
24
+ var import_IsThenable = require("../../../utils/IsThenable.cjs");
25
+ const handleResultWithAction = (result, action) => {
26
+ if ((0, import_IsThenable.isThenable)(result)) {
27
+ return result.then((result2) => action(result2.getValue()));
28
+ }
29
+ return action(result.getValue());
30
+ };
31
+ // Annotate the CommonJS export names for ESM import in node:
32
+ 0 && (module.exports = {
33
+ handleResultWithAction
34
+ });
@@ -0,0 +1,7 @@
1
+ export class AddEventListenerHandler extends AbstractHandler {
2
+ /**
3
+ * @param {any} command
4
+ */
5
+ handleCommand(command: any): void;
6
+ }
7
+ import { AbstractHandler } from './AbstractHandler.js';
@@ -0,0 +1,7 @@
1
+ export class ArrayReferenceHandler extends AbstractHandler {
2
+ /**
3
+ * @param {any} command
4
+ */
5
+ handleCommand(command: any): void;
6
+ }
7
+ import { AbstractHandler } from './AbstractHandler.js';
@@ -0,0 +1,7 @@
1
+ export class AsKwargsHandler extends AbstractHandler {
2
+ /**
3
+ * @param {any} command
4
+ */
5
+ handleCommand(command: any): void;
6
+ }
7
+ import { AbstractHandler } from './AbstractHandler.js';
@@ -0,0 +1,7 @@
1
+ export class AsOutHandler extends AbstractHandler {
2
+ /**
3
+ * @param {any} command
4
+ */
5
+ handleCommand(command: any): void;
6
+ }
7
+ import { AbstractHandler } from './AbstractHandler.js';
@@ -0,0 +1,7 @@
1
+ export class AsRefHandler extends AbstractHandler {
2
+ /**
3
+ * @param {any} command
4
+ */
5
+ handleCommand(command: any): void;
6
+ }
7
+ import { AbstractHandler } from './AbstractHandler.js';
@@ -0,0 +1,7 @@
1
+ export class CreateNullHandler extends AbstractHandler {
2
+ /**
3
+ * @param {any} command
4
+ */
5
+ handleCommand(command: any): void;
6
+ }
7
+ import { AbstractHandler } from './AbstractHandler.js';
@@ -0,0 +1,7 @@
1
+ export class ExceptionHandler extends AbstractHandler {
2
+ /**
3
+ * @param {any} command
4
+ */
5
+ handleCommand(command: any): void;
6
+ }
7
+ import { AbstractHandler } from './AbstractHandler.js';
@@ -0,0 +1,7 @@
1
+ export class GenerateLibHandler extends AbstractHandler {
2
+ /**
3
+ * @param {any} command
4
+ */
5
+ handleCommand(command: any): void;
6
+ }
7
+ import { AbstractHandler } from './AbstractHandler.js';
@@ -0,0 +1,7 @@
1
+ export class GetAsyncOperationResultHandler extends AbstractHandler {
2
+ /**
3
+ * @param {any} command
4
+ */
5
+ handleCommand(command: any): void;
6
+ }
7
+ import { AbstractHandler } from './AbstractHandler.js';
@@ -0,0 +1,7 @@
1
+ export class GetEnumItemHandler extends AbstractHandler {
2
+ /**
3
+ * @param {any} command
4
+ */
5
+ handleCommand(command: any): void;
6
+ }
7
+ import { AbstractHandler } from './AbstractHandler.js';
@@ -0,0 +1,7 @@
1
+ export class GetEnumNameHandler extends AbstractHandler {
2
+ /**
3
+ * @param {any} command
4
+ */
5
+ handleCommand(command: any): void;
6
+ }
7
+ import { AbstractHandler } from './AbstractHandler.js';
@@ -0,0 +1,7 @@
1
+ export class GetEnumValueHandler extends AbstractHandler {
2
+ /**
3
+ * @param {any} command
4
+ */
5
+ handleCommand(command: any): void;
6
+ }
7
+ import { AbstractHandler } from './AbstractHandler.js';
@@ -0,0 +1,13 @@
1
+ export type Command = import("../../utils/Command.js").Command;
2
+ /**
3
+ * @typedef {import('../../utils/Command.js').Command} Command
4
+ */
5
+ export class GetGlobalFieldHandler extends AbstractHandler {
6
+ requiredParametersCount: number;
7
+ /**
8
+ * @param {Command} command
9
+ * @returns {any}
10
+ */
11
+ process(command: Command): any;
12
+ }
13
+ import { AbstractHandler } from './AbstractHandler.js';
@@ -0,0 +1,7 @@
1
+ export class GetModuleHandler extends AbstractHandler {
2
+ /**
3
+ * @param {any} command
4
+ */
5
+ handleCommand(command: any): void;
6
+ }
7
+ import { AbstractHandler } from './AbstractHandler.js';
@@ -0,0 +1,7 @@
1
+ export class GetRefValueHandler extends AbstractHandler {
2
+ /**
3
+ * @param {any} command
4
+ */
5
+ handleCommand(command: any): void;
6
+ }
7
+ import { AbstractHandler } from './AbstractHandler.js';
@@ -0,0 +1,18 @@
1
+ export type Command = import("../../utils/Command.js").Command;
2
+ /**
3
+ * @typedef {import('../../utils/Command.js').Command} Command
4
+ */
5
+ /**
6
+ * GetResultTypeHandler class handles the conversion of JType to Type.
7
+ */
8
+ export class GetResultTypeHandler extends AbstractHandler {
9
+ /** @type {number} */
10
+ requiredParametersCount: number;
11
+ /**
12
+ * Processes the given command to convert JType to Type.
13
+ * @param {Command} command - The command to process.
14
+ * @returns {any} The converted type.
15
+ */
16
+ process(command: Command): any;
17
+ }
18
+ import { AbstractHandler } from './AbstractHandler.js';
@@ -0,0 +1,7 @@
1
+ export class HeartBeatHandler extends AbstractHandler {
2
+ /**
3
+ * @param {any} command
4
+ */
5
+ handleCommand(command: any): void;
6
+ }
7
+ import { AbstractHandler } from './AbstractHandler.js';
@@ -0,0 +1,7 @@
1
+ export class InvokeGenericMethodHandler extends AbstractHandler {
2
+ /**
3
+ * @param {any} command
4
+ */
5
+ handleCommand(command: any): void;
6
+ }
7
+ import { AbstractHandler } from './AbstractHandler.js';
@@ -0,0 +1,7 @@
1
+ export class InvokeGenericStaticMethodHandler extends AbstractHandler {
2
+ /**
3
+ * @param {any} command
4
+ */
5
+ handleCommand(command: any): void;
6
+ }
7
+ import { AbstractHandler } from './AbstractHandler.js';
@@ -0,0 +1,7 @@
1
+ export class OptimizeHandler extends AbstractHandler {
2
+ /**
3
+ * @param {any} command
4
+ */
5
+ handleCommand(command: any): void;
6
+ }
7
+ import { AbstractHandler } from './AbstractHandler.js';
@@ -0,0 +1,7 @@
1
+ export class PluginWrapperHandler extends AbstractHandler {
2
+ /**
3
+ * @param {any} command
4
+ */
5
+ handleCommand(command: any): void;
6
+ }
7
+ import { AbstractHandler } from './AbstractHandler.js';
@@ -0,0 +1,7 @@
1
+ export class RetrieveArrayHandler extends AbstractHandler {
2
+ /**
3
+ * @param {any} command
4
+ */
5
+ handleCommand(command: any): void;
6
+ }
7
+ import { AbstractHandler } from './AbstractHandler.js';
@@ -12,7 +12,7 @@ export class Transmitter {
12
12
  /**
13
13
  * @param {string} configSource
14
14
  * @returns {void}
15
- */
15
+ */
16
16
  static setConfigSource(configSource: string): void;
17
17
  /**
18
18
  * @param {string} workingDirectory
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Details for activating a type with constructor arguments
3
+ */
4
+ export class ActivatorDetails {
5
+ /**
6
+ * @param {Function} type - The constructor function/class
7
+ * @param {any[]} [args] - Arguments to pass to constructor
8
+ */
9
+ constructor(type: Function, args?: any[]);
10
+ type: Function;
11
+ arguments: any[];
12
+ }
@@ -8,6 +8,9 @@
8
8
  * @see [Javonet Guides](https://www.javonet.com/guides/v2/javascript/foundations/runtime-context)
9
9
  */
10
10
  export class ConfigRuntimeFactory {
11
+ static _IN_MEMORY_CONNECTION_TYPES: string[];
12
+ static _WEB_SOCKET_CONNECTION_TYPES: string[];
13
+ static _TCP_CONNECTION_TYPES: string[];
11
14
  /**
12
15
  * @param {ConfigSource | string} configSource
13
16
  */
@@ -194,6 +194,20 @@ export class InvocationContext {
194
194
  * @method
195
195
  */
196
196
  getInstanceMethodAsDelegate(methodName: string, ...args: any[]): InvocationContext | InvocationWsContext;
197
+ /**
198
+ * Retrieves the type of the object from the target runtime.
199
+ * @returns {string} The type of the object.
200
+ * @see [Javonet Guides](https://www.javonet.com/guides/v2/javascript/type-handling/getting-object-type)
201
+ * @method
202
+ */
203
+ getResultType(): string;
204
+ /**
205
+ * Retrieves the name of the runtime where the command is executed.
206
+ * @returns {number} The name of the runtime.
207
+ * @see [Javonet Guides](https://www.javonet.com/guides/v2/javascript/runtime-name)
208
+ * @method
209
+ */
210
+ getRuntimeName(): number;
197
211
  /**
198
212
  * Retrieves an array from the target runtime.
199
213
  * @returns {InvocationContext} A new InvocationContext instance that wraps the command to retrieve the array.
@@ -234,6 +248,14 @@ export class InvocationWsContext extends InvocationContext {
234
248
  * @method
235
249
  */
236
250
  execute(): Promise<InvocationWsContext>;
251
+ /**
252
+ * Retrieves the type of the object from the target runtime.
253
+ * @returns {Promise<string>} The type of the object.
254
+ * @see [Javonet Guides](https://www.javonet.com/guides/v2/javascript/type-handling/getting-object-type)
255
+ * @async
256
+ * @method
257
+ */
258
+ getResultType(): Promise<string>;
237
259
  #private;
238
260
  }
239
261
  import { Command } from '../utils/Command.js';
@@ -58,11 +58,25 @@ export class Javonet {
58
58
  * @returns {void}
59
59
  */
60
60
  static setJavonetWorkingDirectory(path: string): void;
61
+ /**
62
+ * Adds a configuration to the ConfigSourceResolver with the specified priority and source.
63
+ * @param {number} priority - The priority of the configuration.
64
+ * @param {string} configSource - The configuration source.
65
+ */
66
+ static addConfig(priority: number, configSource: string): void;
67
+ /**
68
+ * Initializes a RuntimeContext instance based on the specified configuration name.
69
+ * @param {string} configName - The name of the configuration to use.
70
+ * @returns {RuntimeContext} A RuntimeContext instance initialized with the specified configuration.
71
+ */
72
+ static initializeRc(configName: string): RuntimeContext;
61
73
  }
62
74
  import { TcpConnectionData } from '../utils/nodejs/connectionData/TcpConnectionData.js';
63
75
  import { WsConnectionData } from '../utils/connectionData/WsConnectionData.js';
64
76
  import { CommandSerializer } from '../core/protocol/CommandSerializer.js';
65
77
  import { CommandDeserializer } from '../core/protocol/CommandDeserializer.js';
78
+ import { ConfigPriority } from './configuration/ConfigPriority.js';
66
79
  import { RuntimeFactory } from './RuntimeFactory.js';
67
80
  import { ConfigRuntimeFactory } from './ConfigRuntimeFactory.js';
68
- export { TcpConnectionData, WsConnectionData, CommandSerializer, CommandDeserializer };
81
+ import { RuntimeContext } from './RuntimeContext.js';
82
+ export { TcpConnectionData, WsConnectionData, CommandSerializer, CommandDeserializer, ConfigPriority };
@@ -102,6 +102,14 @@ export class RuntimeContext {
102
102
  * @method
103
103
  */
104
104
  asOut(...args: any[]): InvocationContext;
105
+ /**
106
+ * Retrieves the value of an global field from the target runtime.
107
+ * @param {string} fieldName - The name of the field to get.
108
+ * @returns {InvocationContext} A new InvocationContext instance that wraps the command to get the global field.
109
+ * @see [Javonet Guides](https://www.javonet.com/guides/v2/javascript/fields-and-properties/getting-values-for-global-fields)
110
+ * @method
111
+ */
112
+ getGlobalField(fieldName: string): InvocationContext;
105
113
  /**
106
114
  * Invokes a function from the called runtime. This method is used when working with functions from the called runtime.
107
115
  * The arguments include the function name and the arguments to be passed to the function.
@@ -7,6 +7,14 @@
7
7
  * @see [Javonet Guides](https://www.javonet.com/guides/v2/javascript/foundations/runtime-context)
8
8
  */
9
9
  export class RuntimeFactory {
10
+ /**
11
+ * @param {{ runtime: import("../types.js").RuntimeName; connectionData: import("../utils/connectionData/IConnectionData.js").IConnectionData; modules: any; }} config
12
+ */
13
+ static initializeRuntimeContext(config: {
14
+ runtime: import("../types.js").RuntimeName;
15
+ connectionData: import("../utils/connectionData/IConnectionData.js").IConnectionData;
16
+ modules: any;
17
+ }): RuntimeContext;
10
18
  /**
11
19
  * @param {IConnectionData} connectionData
12
20
  */
@@ -54,6 +62,12 @@ export class RuntimeFactory {
54
62
  * @see [Javonet Guides](https://www.javonet.com/guides/v2/javascript/foundations/runtime-context)
55
63
  */
56
64
  nodejs(): RuntimeContext;
65
+ /**
66
+ * Creates RuntimeContext instance to interact with the PHP runtime.
67
+ * @return {RuntimeContext} a RuntimeContext instance for the PHP runtime
68
+ * @see [Javonet Guides](https://www.javonet.com/guides/v2/javascript/foundations/runtime-context)
69
+ */
70
+ php(): RuntimeContext;
57
71
  /**
58
72
  * Creates RuntimeContext instance to interact with the Python runtime.
59
73
  * @return {RuntimeContext} a RuntimeContext instance for the Python runtime
@@ -0,0 +1,14 @@
1
+ export class Config {
2
+ /**
3
+ * @param {*} runtime
4
+ * @param {*} connectionData
5
+ * @param {string} [plugins=""]
6
+ * @param {string} [modules=""]
7
+ */
8
+ constructor(runtime: any, connectionData: any, plugins?: string, modules?: string);
9
+ runtime: any;
10
+ connectionData: any;
11
+ plugins: string;
12
+ modules: string;
13
+ toString(): string;
14
+ }
@@ -0,0 +1,8 @@
1
+ export namespace ConfigPriority {
2
+ let RuntimeSpecificEnv: 1;
3
+ let GlobalEnv: 2;
4
+ let RuntimeSpecificFile: 3;
5
+ let GlobalFile: 4;
6
+ let User: 5;
7
+ let DefaultLibrary: 6;
8
+ }
@@ -0,0 +1,7 @@
1
+ export class ConfigSourceResolver {
2
+ static addConfigs(priority: any, configSource: any): void;
3
+ static getConfig(configName: any): any;
4
+ static clearConfigs(): void;
5
+ static _getConfigSourceAsString(configSource: any): any;
6
+ static _parseConfigsAndAddToCollection(priority: any, configString: any): void;
7
+ }
@@ -0,0 +1,30 @@
1
+ export class ConfigsDictionary {
2
+ /** @type {Map<string, Map<number, any>>} */
3
+ static _configurations_collection: Map<string, Map<number, any>>;
4
+ /**
5
+ * Normalize priority to a numeric value.
6
+ * Accepts either a number or an object with a numeric `value` property.
7
+ * @param {any} priority
8
+ * @returns {number|undefined}
9
+ */
10
+ static _normalizePriority(priority: any): number | undefined;
11
+ /**
12
+ * Add a configuration for a given name and priority.
13
+ * If the same name+priority already exists, it will not be overwritten.
14
+ * @param {string} name
15
+ * @param {number|{value:number}} priority
16
+ * @param {*} config
17
+ */
18
+ static addConfig(name: string, priority: number | {
19
+ value: number;
20
+ }, config: any): void;
21
+ /**
22
+ * Retrieve the configuration with the numerically smallest priority for the given name.
23
+ * Throws if name is invalid or no configuration is found.
24
+ * @param {string} name
25
+ * @returns {*}
26
+ */
27
+ static getConfig(name: string): any;
28
+ /** Clear all stored configurations. */
29
+ static clearConfigs(): void;
30
+ }
@@ -0,0 +1,30 @@
1
+ export class ConfigResolver {
2
+ /**
3
+ * Parse a runtime string into the runtime enum/name using RuntimeNameHandler.
4
+ * @param {string} runtime
5
+ * @returns {*}
6
+ */
7
+ static tryParseRuntime(runtime: string): any;
8
+ /**
9
+ * Build appropriate connection data object from a host string.
10
+ * - empty / null => InMemoryConnectionData
11
+ * - "inmemory" or "in-memory" => InMemoryConnectionData
12
+ * - ws:// or wss:// => WsConnectionData(fullAddress)
13
+ * - tcp://... => parsed by parseTcp
14
+ * - host:port or host:port/... => TcpConnectionData(host, port) if valid, otherwise InMemoryConnectionData
15
+ * @param {string} hostValue
16
+ * @returns {InMemoryConnectionData|WsConnectionData|TcpConnectionData}
17
+ */
18
+ static buildConnectionData(hostValue: string): InMemoryConnectionData | WsConnectionData | TcpConnectionData;
19
+ /**
20
+ * Parse tcp address portion (after tcp://) into TcpConnectionData.
21
+ * Expected formats: host:port or host:port/...
22
+ * Throws Error on invalid format or port.
23
+ * @param {string} address
24
+ * @returns {TcpConnectionData}
25
+ */
26
+ static parseTcp(address: string): TcpConnectionData;
27
+ }
28
+ import { InMemoryConnectionData } from '../../../utils/connectionData/InMemoryConnectionData.js';
29
+ import { WsConnectionData } from '../../../utils/connectionData/WsConnectionData.js';
30
+ import { TcpConnectionData } from '../../../utils/nodejs/connectionData/TcpConnectionData.js';
@@ -0,0 +1,23 @@
1
+ export class ConnectionStringConfigResolver extends ConfigResolver {
2
+ /**
3
+ * Parse and add multiple configuration lines from a connection string source.
4
+ * @param {any} priority
5
+ * @param {string} connectionStringSource
6
+ */
7
+ static addConfigs(priority: any, connectionStringSource: string): void;
8
+ /**
9
+ * Extract and set temporary license key from a line like "licensekey=VALUE;..."
10
+ * @param {string} line
11
+ * @private
12
+ */
13
+ private static _setLicenseKey;
14
+ /**
15
+ * Parse semicolon-separated key=value tokens into an object.
16
+ * Ignores malformed tokens and logs them.
17
+ * @param {string} line
18
+ * @returns {Record<string, string>}
19
+ * @private
20
+ */
21
+ private static _parseKeyValues;
22
+ }
23
+ import { ConfigResolver } from './ConfigResolver.js';
@@ -0,0 +1,26 @@
1
+ export class JsonConfigResolver extends ConfigResolver {
2
+ /**
3
+ * Parse and add configurations from a JSON object.
4
+ * @param {any} priority
5
+ * @param {Record<string, unknown>} jsonObject
6
+ */
7
+ static addConfigs(priority: any, jsonObject: Record<string, unknown>): void;
8
+ /**
9
+ * Get a required string property from an object, trimmed.
10
+ * Throws if missing or empty.
11
+ * @param {Record<string, unknown>} obj
12
+ * @param {string} property
13
+ * @returns {string}
14
+ * @private
15
+ */
16
+ private static _getRequiredString;
17
+ /**
18
+ * Get an optional string property; return empty string when missing or not a string.
19
+ * @param {Record<string, unknown>} obj
20
+ * @param {string} property
21
+ * @returns {string}
22
+ * @private
23
+ */
24
+ private static _getOptionalString;
25
+ }
26
+ import { ConfigResolver } from './ConfigResolver.js';
@@ -0,0 +1,32 @@
1
+ export type RootYaml = {
2
+ licenseKey?: string;
3
+ configurations?: Record<string, Record<string, unknown>>;
4
+ };
5
+ /**
6
+ * @typedef {{ licenseKey?: string, configurations?: Record<string, Record<string, unknown>> }} RootYaml
7
+ */
8
+ export class YamlConfigResolver extends ConfigResolver {
9
+ /**
10
+ * Parse YAML string and add configurations.
11
+ * @param {any} priority
12
+ * @param {string} yamlString
13
+ */
14
+ static addConfigs(priority: any, yamlString: string): void;
15
+ /**
16
+ * Get required string from mapping, trimmed. Throws if missing/invalid.
17
+ * @param {Record<string, unknown>} mapping
18
+ * @param {string} key
19
+ * @returns {string}
20
+ * @private
21
+ */
22
+ private static _getRequiredString;
23
+ /**
24
+ * Get optional string from mapping, or empty string if missing/not a string.
25
+ * @param {Record<string, unknown>} mapping
26
+ * @param {string} key
27
+ * @returns {string}
28
+ * @private
29
+ */
30
+ private static _getOptionalString;
31
+ }
32
+ import { ConfigResolver } from './ConfigResolver.js';
@@ -0,0 +1,28 @@
1
+ export type RuntimeName = import("../../types.d.ts").RuntimeName;
2
+ /**
3
+ * @typedef {import('../../types.d.ts').RuntimeName} RuntimeName
4
+ */
5
+ export class ComplexTypeResolver {
6
+ /**
7
+ * Resolve type from string name and optional module
8
+ * @param {string} typeName - Name of the type to resolve
9
+ * @param {string} [moduleName] - Optional module name to import from
10
+ * @returns {Function} The resolved type/constructor function
11
+ */
12
+ static resolveType(typeName: string, moduleName?: string): Function;
13
+ /**
14
+ * Register a custom type mapping
15
+ * @param {string} resultType - The type name from the target runtime
16
+ * @param {Function} type - The JavaScript constructor function
17
+ * @param {any[]} [args] - Default arguments for the constructor
18
+ */
19
+ register(resultType: string, type: Function, args?: any[]): void;
20
+ /**
21
+ * Convert InvocationContext result to appropriate JavaScript type
22
+ * @param {InvocationContext} ic - The invocation context
23
+ * @returns {any} The converted result
24
+ */
25
+ convertResult(ic: InvocationContext): any;
26
+ #private;
27
+ }
28
+ import { InvocationContext } from '../InvocationContext.js';