jitar 0.2.2 → 0.3.1

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 (206) hide show
  1. package/CHANGELOG.md +11 -2
  2. package/package.json +7 -7
  3. package/dist/client.d.ts +0 -3
  4. package/dist/client.js +0 -24
  5. package/dist/core/ErrorManager.d.ts +0 -3
  6. package/dist/core/ErrorManager.js +0 -11
  7. package/dist/core/Implementation.d.ts +0 -10
  8. package/dist/core/Implementation.js +0 -39
  9. package/dist/core/Procedure.d.ts +0 -13
  10. package/dist/core/Procedure.js +0 -58
  11. package/dist/core/Segment.d.ts +0 -13
  12. package/dist/core/Segment.js +0 -36
  13. package/dist/core/SegmentBuilder.d.ts +0 -6
  14. package/dist/core/SegmentBuilder.js +0 -32
  15. package/dist/core/Version.d.ts +0 -13
  16. package/dist/core/Version.js +0 -50
  17. package/dist/core/definitions/AccessLevel.d.ts +0 -2
  18. package/dist/core/definitions/AccessLevel.js +0 -2
  19. package/dist/core/errors/ImplementationNotFound.d.ts +0 -3
  20. package/dist/core/errors/ImplementationNotFound.js +0 -6
  21. package/dist/core/errors/InvalidVersionNumber.d.ts +0 -3
  22. package/dist/core/errors/InvalidVersionNumber.js +0 -6
  23. package/dist/core/errors/MissingParameterValue.d.ts +0 -3
  24. package/dist/core/errors/MissingParameterValue.js +0 -6
  25. package/dist/core/errors/NotImplemented.d.ts +0 -3
  26. package/dist/core/errors/NotImplemented.js +0 -6
  27. package/dist/core/errors/ProcedureNotFound.d.ts +0 -3
  28. package/dist/core/errors/ProcedureNotFound.js +0 -6
  29. package/dist/core/errors/UnknownParameter.d.ts +0 -3
  30. package/dist/core/errors/UnknownParameter.js +0 -6
  31. package/dist/core/interfaces/Runner.d.ts +0 -4
  32. package/dist/core/interfaces/Runner.js +0 -1
  33. package/dist/core/reflection/ParameterParser.d.ts +0 -5
  34. package/dist/core/reflection/ParameterParser.js +0 -51
  35. package/dist/core/reflection/ReflectionHelper.d.ts +0 -13
  36. package/dist/core/reflection/ReflectionHelper.js +0 -69
  37. package/dist/core/reflection/models/ReflectionField.d.ts +0 -8
  38. package/dist/core/reflection/models/ReflectionField.js +0 -14
  39. package/dist/core/reflection/models/ReflectionParameter.d.ts +0 -7
  40. package/dist/core/reflection/models/ReflectionParameter.js +0 -11
  41. package/dist/core/types/Component.d.ts +0 -5
  42. package/dist/core/types/Component.js +0 -1
  43. package/dist/core/types/FlexObject.d.ts +0 -4
  44. package/dist/core/types/FlexObject.js +0 -1
  45. package/dist/core/types/Module.d.ts +0 -3
  46. package/dist/core/types/Module.js +0 -1
  47. package/dist/core/types/SegmentImplementation.d.ts +0 -6
  48. package/dist/core/types/SegmentImplementation.js +0 -1
  49. package/dist/core/types/SegmentModule.d.ts +0 -5
  50. package/dist/core/types/SegmentModule.js +0 -1
  51. package/dist/core/types/SegmentProcedure.d.ts +0 -7
  52. package/dist/core/types/SegmentProcedure.js +0 -1
  53. package/dist/core/utils/FqnBuilder.d.ts +0 -3
  54. package/dist/core/utils/FqnBuilder.js +0 -5
  55. package/dist/hooks.d.ts +0 -2
  56. package/dist/hooks.js +0 -2
  57. package/dist/lib.d.ts +0 -31
  58. package/dist/lib.js +0 -27
  59. package/dist/runtime/ClientId.d.ts +0 -4
  60. package/dist/runtime/ClientId.js +0 -11
  61. package/dist/runtime/Gateway.d.ts +0 -10
  62. package/dist/runtime/Gateway.js +0 -3
  63. package/dist/runtime/LocalGateway.d.ts +0 -14
  64. package/dist/runtime/LocalGateway.js +0 -61
  65. package/dist/runtime/LocalNode.d.ts +0 -18
  66. package/dist/runtime/LocalNode.js +0 -75
  67. package/dist/runtime/LocalRepository.d.ts +0 -17
  68. package/dist/runtime/LocalRepository.js +0 -94
  69. package/dist/runtime/Node.d.ts +0 -8
  70. package/dist/runtime/Node.js +0 -3
  71. package/dist/runtime/NodeBalancer.d.ts +0 -10
  72. package/dist/runtime/NodeBalancer.js +0 -34
  73. package/dist/runtime/NodeMonitor.d.ts +0 -7
  74. package/dist/runtime/NodeMonitor.js +0 -38
  75. package/dist/runtime/Proxy.d.ts +0 -19
  76. package/dist/runtime/Proxy.js +0 -31
  77. package/dist/runtime/Remote.d.ts +0 -15
  78. package/dist/runtime/Remote.js +0 -100
  79. package/dist/runtime/RemoteGateway.d.ts +0 -11
  80. package/dist/runtime/RemoteGateway.js +0 -22
  81. package/dist/runtime/RemoteNode.d.ts +0 -12
  82. package/dist/runtime/RemoteNode.js +0 -29
  83. package/dist/runtime/RemoteRepository.d.ts +0 -14
  84. package/dist/runtime/RemoteRepository.js +0 -34
  85. package/dist/runtime/Repository.d.ts +0 -11
  86. package/dist/runtime/Repository.js +0 -3
  87. package/dist/runtime/Runtime.d.ts +0 -9
  88. package/dist/runtime/Runtime.js +0 -27
  89. package/dist/runtime/caching/CacheBuilder.d.ts +0 -6
  90. package/dist/runtime/caching/CacheBuilder.js +0 -249
  91. package/dist/runtime/caching/ImportRewriter.d.ts +0 -4
  92. package/dist/runtime/caching/ImportRewriter.js +0 -49
  93. package/dist/runtime/caching/RemoteBuilder.d.ts +0 -5
  94. package/dist/runtime/caching/RemoteBuilder.js +0 -31
  95. package/dist/runtime/caching/SourceAppender.d.ts +0 -5
  96. package/dist/runtime/caching/SourceAppender.js +0 -30
  97. package/dist/runtime/caching/definitions/Keywords.d.ts +0 -2
  98. package/dist/runtime/caching/definitions/Keywords.js +0 -2
  99. package/dist/runtime/caching/errors/InvalidSegmentFilename.d.ts +0 -3
  100. package/dist/runtime/caching/errors/InvalidSegmentFilename.js +0 -5
  101. package/dist/runtime/caching/errors/MissingModuleExport.d.ts +0 -3
  102. package/dist/runtime/caching/errors/MissingModuleExport.js +0 -5
  103. package/dist/runtime/caching/errors/SegmentFileNotLoaded.d.ts +0 -3
  104. package/dist/runtime/caching/errors/SegmentFileNotLoaded.js +0 -5
  105. package/dist/runtime/caching/errors/SegmentModuleNotLoaded.d.ts +0 -3
  106. package/dist/runtime/caching/errors/SegmentModuleNotLoaded.js +0 -5
  107. package/dist/runtime/caching/models/ApplicationModule.d.ts +0 -9
  108. package/dist/runtime/caching/models/ApplicationModule.js +0 -19
  109. package/dist/runtime/caching/models/Implementation.d.ts +0 -12
  110. package/dist/runtime/caching/models/Implementation.js +0 -27
  111. package/dist/runtime/caching/models/Procedure.d.ts +0 -9
  112. package/dist/runtime/caching/models/Procedure.js +0 -15
  113. package/dist/runtime/caching/models/Segment.d.ts +0 -10
  114. package/dist/runtime/caching/models/Segment.js +0 -16
  115. package/dist/runtime/caching/models/SegmentModule.d.ts +0 -10
  116. package/dist/runtime/caching/models/SegmentModule.js +0 -14
  117. package/dist/runtime/caching/types/SegmentFile.d.ts +0 -5
  118. package/dist/runtime/caching/types/SegmentFile.js +0 -1
  119. package/dist/runtime/caching/types/SegmentImportProperties.d.ts +0 -6
  120. package/dist/runtime/caching/types/SegmentImportProperties.js +0 -1
  121. package/dist/runtime/caching/types/SegmentImports.d.ts +0 -5
  122. package/dist/runtime/caching/types/SegmentImports.js +0 -1
  123. package/dist/runtime/errors/ClientNotFound.d.ts +0 -3
  124. package/dist/runtime/errors/ClientNotFound.js +0 -6
  125. package/dist/runtime/errors/FileNotFound.d.ts +0 -3
  126. package/dist/runtime/errors/FileNotFound.js +0 -6
  127. package/dist/runtime/errors/InvalidClientId.d.ts +0 -3
  128. package/dist/runtime/errors/InvalidClientId.js +0 -6
  129. package/dist/runtime/errors/InvalidJitarHooks.d.ts +0 -3
  130. package/dist/runtime/errors/InvalidJitarHooks.js +0 -6
  131. package/dist/runtime/errors/InvalidSegmentFile.d.ts +0 -3
  132. package/dist/runtime/errors/InvalidSegmentFile.js +0 -6
  133. package/dist/runtime/errors/ModuleNotLoaded.d.ts +0 -3
  134. package/dist/runtime/errors/ModuleNotLoaded.js +0 -6
  135. package/dist/runtime/errors/NoNodeAvailable.d.ts +0 -3
  136. package/dist/runtime/errors/NoNodeAvailable.js +0 -6
  137. package/dist/runtime/errors/RepositoryNotAvaiable.d.ts +0 -3
  138. package/dist/runtime/errors/RepositoryNotAvaiable.js +0 -6
  139. package/dist/runtime/errors/RuntimeNotAvailable.d.ts +0 -3
  140. package/dist/runtime/errors/RuntimeNotAvailable.js +0 -6
  141. package/dist/runtime/errors/SegmentNotFound.d.ts +0 -3
  142. package/dist/runtime/errors/SegmentNotFound.js +0 -6
  143. package/dist/runtime/hooks/dependencies.d.ts +0 -2
  144. package/dist/runtime/hooks/dependencies.js +0 -9
  145. package/dist/runtime/hooks/runtime.d.ts +0 -3
  146. package/dist/runtime/hooks/runtime.js +0 -14
  147. package/dist/runtime/interfaces/FileManager.d.ts +0 -11
  148. package/dist/runtime/interfaces/FileManager.js +0 -1
  149. package/dist/runtime/interfaces/HealthCheck.d.ts +0 -3
  150. package/dist/runtime/interfaces/HealthCheck.js +0 -1
  151. package/dist/runtime/interfaces/ProcedureContainer.d.ts +0 -5
  152. package/dist/runtime/interfaces/ProcedureContainer.js +0 -1
  153. package/dist/runtime/models/File.d.ts +0 -9
  154. package/dist/runtime/models/File.js +0 -14
  155. package/dist/runtime/serialization/ArrayBufferSerializer.d.ts +0 -10
  156. package/dist/runtime/serialization/ArrayBufferSerializer.js +0 -54
  157. package/dist/runtime/serialization/ArraySerializer.d.ts +0 -7
  158. package/dist/runtime/serialization/ArraySerializer.js +0 -15
  159. package/dist/runtime/serialization/ClassSerializer.d.ts +0 -10
  160. package/dist/runtime/serialization/ClassSerializer.js +0 -74
  161. package/dist/runtime/serialization/DateSerializer.d.ts +0 -9
  162. package/dist/runtime/serialization/DateSerializer.js +0 -21
  163. package/dist/runtime/serialization/MapSerializer.d.ts +0 -9
  164. package/dist/runtime/serialization/MapSerializer.js +0 -35
  165. package/dist/runtime/serialization/ObjectSerializer.d.ts +0 -9
  166. package/dist/runtime/serialization/ObjectSerializer.js +0 -21
  167. package/dist/runtime/serialization/SetSerializer.d.ts +0 -9
  168. package/dist/runtime/serialization/SetSerializer.js +0 -23
  169. package/dist/runtime/serialization/ValueSerializer.d.ts +0 -8
  170. package/dist/runtime/serialization/ValueSerializer.js +0 -69
  171. package/dist/runtime/serialization/errors/ClassNotFound.d.ts +0 -3
  172. package/dist/runtime/serialization/errors/ClassNotFound.js +0 -6
  173. package/dist/runtime/serialization/errors/InvalidClass.d.ts +0 -3
  174. package/dist/runtime/serialization/errors/InvalidClass.js +0 -6
  175. package/dist/runtime/serialization/errors/InvalidPropertyType.d.ts +0 -3
  176. package/dist/runtime/serialization/errors/InvalidPropertyType.js +0 -6
  177. package/dist/runtime/serialization/interfaces/Serializer.d.ts +0 -4
  178. package/dist/runtime/serialization/interfaces/Serializer.js +0 -1
  179. package/dist/runtime/serialization/types/SerializableObject.d.ts +0 -3
  180. package/dist/runtime/serialization/types/SerializableObject.js +0 -1
  181. package/dist/runtime/serialization/types/Serialized.d.ts +0 -5
  182. package/dist/runtime/serialization/types/Serialized.js +0 -1
  183. package/dist/runtime/serialization/types/SerializedArrayBuffer.d.ts +0 -6
  184. package/dist/runtime/serialization/types/SerializedArrayBuffer.js +0 -1
  185. package/dist/runtime/serialization/types/SerializedClass.d.ts +0 -8
  186. package/dist/runtime/serialization/types/SerializedClass.js +0 -1
  187. package/dist/runtime/serialization/types/SerializedDate.d.ts +0 -5
  188. package/dist/runtime/serialization/types/SerializedDate.js +0 -1
  189. package/dist/runtime/serialization/types/SerializedMap.d.ts +0 -8
  190. package/dist/runtime/serialization/types/SerializedMap.js +0 -1
  191. package/dist/runtime/serialization/types/SerializedObject.d.ts +0 -4
  192. package/dist/runtime/serialization/types/SerializedObject.js +0 -1
  193. package/dist/runtime/serialization/types/SerializedSet.d.ts +0 -5
  194. package/dist/runtime/serialization/types/SerializedSet.js +0 -1
  195. package/dist/runtime/serialization/types/TypedArray.d.ts +0 -2
  196. package/dist/runtime/serialization/types/TypedArray.js +0 -1
  197. package/dist/runtime/types/JitarHooks.d.ts +0 -6
  198. package/dist/runtime/types/JitarHooks.js +0 -1
  199. package/dist/runtime/types/ModuleImporter.d.ts +0 -3
  200. package/dist/runtime/types/ModuleImporter.js +0 -1
  201. package/dist/runtime/utils/ModuleAnalyser.d.ts +0 -7
  202. package/dist/runtime/utils/ModuleAnalyser.js +0 -34
  203. package/dist/runtime/utils/ModuleLoader.d.ts +0 -8
  204. package/dist/runtime/utils/ModuleLoader.js +0 -30
  205. package/dist/runtime/utils/UrlRewriter.d.ts +0 -4
  206. package/dist/runtime/utils/UrlRewriter.js +0 -36
@@ -1,30 +0,0 @@
1
- import * as Keywords from './definitions/Keywords.js';
2
- export default class SourceAppender {
3
- static append(module, code, filename) {
4
- const classNames = this.#extractClassNames(module);
5
- if (classNames.length === 0) {
6
- return code;
7
- }
8
- const sourceCode = this.#createSourceCode(filename, classNames);
9
- return `${code}\n${sourceCode}`;
10
- }
11
- static #extractClassNames(module) {
12
- const classes = module.classes;
13
- const names = [];
14
- for (const key of classes.keys()) {
15
- const clazz = classes.get(key);
16
- if (clazz.name === '') {
17
- continue;
18
- }
19
- if (key !== Keywords.DEFAULT && key !== clazz.name) {
20
- continue;
21
- }
22
- names.push(clazz.name);
23
- }
24
- return names;
25
- }
26
- static #createSourceCode(filename, classNames) {
27
- const codes = classNames.map(className => `${className}.source = '${filename}';`);
28
- return codes.join('\n');
29
- }
30
- }
@@ -1,2 +0,0 @@
1
- export declare const DEFAULT = "default";
2
- export declare const JITAR = "jitar";
@@ -1,2 +0,0 @@
1
- export const DEFAULT = 'default';
2
- export const JITAR = 'jitar';
@@ -1,3 +0,0 @@
1
- export default class InvalidSegmentFilename extends Error {
2
- constructor(filename: string);
3
- }
@@ -1,5 +0,0 @@
1
- export default class InvalidSegmentFilename extends Error {
2
- constructor(filename) {
3
- super(`Segment filename '${filename}' is invalid`);
4
- }
5
- }
@@ -1,3 +0,0 @@
1
- export default class MissingModuleExport extends Error {
2
- constructor(filename: string, key: string);
3
- }
@@ -1,5 +0,0 @@
1
- export default class MissingModuleExport extends Error {
2
- constructor(filename, key) {
3
- super(`Module '${filename}' does not export '${key}'`);
4
- }
5
- }
@@ -1,3 +0,0 @@
1
- export default class SegmentFileNotLoaded extends Error {
2
- constructor(filename: string);
3
- }
@@ -1,5 +0,0 @@
1
- export default class SegmentFileNotLoaded extends Error {
2
- constructor(filename) {
3
- super(`Failed to load segment file '${filename}'`);
4
- }
5
- }
@@ -1,3 +0,0 @@
1
- export default class SegmentModuleNotLoaded extends Error {
2
- constructor(filename: string);
3
- }
@@ -1,5 +0,0 @@
1
- export default class SegmentModuleNotLoaded extends Error {
2
- constructor(filename) {
3
- super(`Segment module could not be loaded from '${filename}'`);
4
- }
5
- }
@@ -1,9 +0,0 @@
1
- export default class ApplicationModule {
2
- #private;
3
- constructor(filename: string, classes: Map<string, Function>, functions: Map<string, Function>);
4
- get filename(): string;
5
- get classes(): Map<string, Function>;
6
- get functions(): Map<string, Function>;
7
- hasClasses(): boolean;
8
- hasFunctions(): boolean;
9
- }
@@ -1,19 +0,0 @@
1
- export default class ApplicationModule {
2
- #filename;
3
- #classes;
4
- #functions;
5
- constructor(filename, classes, functions) {
6
- this.#filename = filename;
7
- this.#classes = classes;
8
- this.#functions = functions;
9
- }
10
- get filename() { return this.#filename; }
11
- get classes() { return this.#classes; }
12
- get functions() { return this.#functions; }
13
- hasClasses() {
14
- return this.#classes.size > 0;
15
- }
16
- hasFunctions() {
17
- return this.#functions.size > 0;
18
- }
19
- }
@@ -1,12 +0,0 @@
1
- import Component from '../../../core/types/Component.js';
2
- export default class Implementation {
3
- #private;
4
- constructor(module: string, name: string, access: string, version: string, executable: Component);
5
- get id(): number;
6
- get module(): string;
7
- get name(): string;
8
- get fqn(): string;
9
- get access(): string;
10
- get version(): string;
11
- get executable(): Component;
12
- }
@@ -1,27 +0,0 @@
1
- import FqnBuilder from '../../../core/utils/FqnBuilder.js';
2
- let lastId = 0;
3
- export default class Implementation {
4
- #id;
5
- #module;
6
- #name;
7
- #fqn;
8
- #access;
9
- #version;
10
- #executable;
11
- constructor(module, name, access, version, executable) {
12
- this.#id = ++lastId;
13
- this.#module = module;
14
- this.#name = name;
15
- this.#fqn = FqnBuilder.build(module, name);
16
- this.#access = access;
17
- this.#version = version;
18
- this.#executable = executable;
19
- }
20
- get id() { return this.#id; }
21
- get module() { return this.#module; }
22
- get name() { return this.#name; }
23
- get fqn() { return this.#fqn; }
24
- get access() { return this.#access; }
25
- get version() { return this.#version; }
26
- get executable() { return this.#executable; }
27
- }
@@ -1,9 +0,0 @@
1
- import Implementation from './Implementation.js';
2
- export default class Procedure {
3
- #private;
4
- constructor(module: string, name: string);
5
- get module(): string;
6
- get name(): string;
7
- get implementations(): Implementation[];
8
- addImplementation(implementation: Implementation): void;
9
- }
@@ -1,15 +0,0 @@
1
- export default class Procedure {
2
- #module;
3
- #name;
4
- #implementations = [];
5
- constructor(module, name) {
6
- this.#module = module;
7
- this.#name = name;
8
- }
9
- get module() { return this.#module; }
10
- get name() { return this.#name; }
11
- get implementations() { return this.#implementations; }
12
- addImplementation(implementation) {
13
- this.#implementations.push(implementation);
14
- }
15
- }
@@ -1,10 +0,0 @@
1
- import Procedure from './Procedure.js';
2
- import SegmentModule from './SegmentModule.js';
3
- export default class Segment {
4
- #private;
5
- constructor(filename: string, modules: SegmentModule[], procedures: Map<string, Procedure>);
6
- get filename(): string;
7
- get modules(): SegmentModule[];
8
- get procedures(): Map<string, Procedure>;
9
- getFilenames(): string[];
10
- }
@@ -1,16 +0,0 @@
1
- export default class Segment {
2
- #filename;
3
- #modules;
4
- #procedures;
5
- constructor(filename, modules, procedures) {
6
- this.#filename = filename;
7
- this.#modules = modules;
8
- this.#procedures = procedures;
9
- }
10
- get filename() { return this.#filename; }
11
- get modules() { return this.#modules; }
12
- get procedures() { return this.#procedures; }
13
- getFilenames() {
14
- return this.#modules.map((module) => module.filename);
15
- }
16
- }
@@ -1,10 +0,0 @@
1
- import Module from '../../../core/types/Module.js';
2
- import Implementation from './Implementation.js';
3
- export default class SegmentModule {
4
- #private;
5
- constructor(filename: string, exports: Module, implementations: Map<string, Implementation>);
6
- get filename(): string;
7
- get exports(): import("../../../core/types/FlexObject.js").default;
8
- get implementations(): Map<string, Implementation>;
9
- getImportKeys(): string[];
10
- }
@@ -1,14 +0,0 @@
1
- export default class SegmentModule {
2
- #filename;
3
- #exports;
4
- #implementations;
5
- constructor(filename, exports, implementations) {
6
- this.#filename = filename;
7
- this.#exports = exports;
8
- this.#implementations = implementations;
9
- }
10
- get filename() { return this.#filename; }
11
- get exports() { return this.#exports; }
12
- get implementations() { return this.#implementations; }
13
- getImportKeys() { return [...this.#implementations.keys()]; }
14
- }
@@ -1,5 +0,0 @@
1
- import SegmentImports from './SegmentImports.js';
2
- type SegmentFile = {
3
- [key: string]: SegmentImports;
4
- };
5
- export default SegmentFile;
@@ -1 +0,0 @@
1
- export {};
@@ -1,6 +0,0 @@
1
- type SegmentImportProperties = {
2
- as?: string;
3
- access?: string;
4
- version?: string;
5
- };
6
- export default SegmentImportProperties;
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- import SegmentImportProperties from './SegmentImportProperties.js';
2
- type SegmentImports = {
3
- [key: string]: SegmentImportProperties;
4
- };
5
- export default SegmentImports;
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +0,0 @@
1
- export default class ClientNotFound extends Error {
2
- constructor(clientId: string);
3
- }
@@ -1,6 +0,0 @@
1
- export default class ClientNotFound extends Error {
2
- constructor(clientId) {
3
- super(`Client found for id '${clientId}'`);
4
- }
5
- }
6
- ClientNotFound.source = '/jitar/runtime/errors/ClientNotFound.js';
@@ -1,3 +0,0 @@
1
- export default class FileNotFound extends Error {
2
- constructor(filename: string);
3
- }
@@ -1,6 +0,0 @@
1
- export default class FileNotFound extends Error {
2
- constructor(filename) {
3
- super(`The file '${filename} could not be found'`);
4
- }
5
- }
6
- FileNotFound.source = '/jitar/runtime/errors/FileNotFound.js';
@@ -1,3 +0,0 @@
1
- export default class InvalidClientId extends Error {
2
- constructor(clientId: string);
3
- }
@@ -1,6 +0,0 @@
1
- export default class InvalidClientId extends Error {
2
- constructor(clientId) {
3
- super(`Invalid client id '${clientId}'`);
4
- }
5
- }
6
- InvalidClientId.source = '/jitar/runtime/errors/InvalidClientId.js';
@@ -1,3 +0,0 @@
1
- export default class InvalidJitarHooks extends Error {
2
- constructor();
3
- }
@@ -1,6 +0,0 @@
1
- export default class InvalidJitarHooks extends Error {
2
- constructor() {
3
- super(`Invalid Jitar hooks`);
4
- }
5
- }
6
- InvalidJitarHooks.source = '/jitar/runtime/errors/InvalidJitarHooks.js';
@@ -1,3 +0,0 @@
1
- export default class InvalidSegmentFile extends Error {
2
- constructor(filename: string);
3
- }
@@ -1,6 +0,0 @@
1
- export default class InvalidSegmentFile extends Error {
2
- constructor(filename) {
3
- super(`Missing files array in segment file '${filename}'`);
4
- }
5
- }
6
- InvalidSegmentFile.source = '/jitar/runtime/errors/InvalidSegmentFile.js';
@@ -1,3 +0,0 @@
1
- export default class ModuleNotLoaded extends Error {
2
- constructor(url: string, message?: string);
3
- }
@@ -1,6 +0,0 @@
1
- export default class ModuleNotLoaded extends Error {
2
- constructor(url, message) {
3
- super(`Module '${url}' could not be loaded${message !== undefined ? ` | ${message}` : ''}`);
4
- }
5
- }
6
- ModuleNotLoaded.source = '/jitar/runtime/errors/ModuleNotLoaded.js';
@@ -1,3 +0,0 @@
1
- export default class NoNodeAvailable extends Error {
2
- constructor(name: string);
3
- }
@@ -1,6 +0,0 @@
1
- export default class NoNodeAvailable extends Error {
2
- constructor(name) {
3
- super(`No node available for procedure '${name}'`);
4
- }
5
- }
6
- NoNodeAvailable.source = '/jitar/runtime/errors/NoNodeAvailable.js';
@@ -1,3 +0,0 @@
1
- export default class RepositoryNotAvailable extends Error {
2
- constructor();
3
- }
@@ -1,6 +0,0 @@
1
- export default class RepositoryNotAvailable extends Error {
2
- constructor() {
3
- super(`Repository not available`);
4
- }
5
- }
6
- RepositoryNotAvailable.source = '/jitar/runtime/errors/RepositoryNotAvailable.js';
@@ -1,3 +0,0 @@
1
- export default class RuntimeNotAvailable extends Error {
2
- constructor();
3
- }
@@ -1,6 +0,0 @@
1
- export default class RuntimeNotAvailable extends Error {
2
- constructor() {
3
- super(`Runtime not available`);
4
- }
5
- }
6
- RuntimeNotAvailable.source = '/jitar/runtime/errors/RuntimeNotAvailable.js';
@@ -1,3 +0,0 @@
1
- export default class SegmentNotFound extends Error {
2
- constructor(source: string);
3
- }
@@ -1,6 +0,0 @@
1
- export default class SegmentNotFound extends Error {
2
- constructor(source) {
3
- super(`Segment found for '${source}'`);
4
- }
5
- }
6
- SegmentNotFound.source = '/jitar/runtime/errors/SegmentNotFound.js';
@@ -1,2 +0,0 @@
1
- export declare function setDependencyLoader(loader: Function): void;
2
- export declare function getDependency(name: string): Promise<unknown>;
@@ -1,9 +0,0 @@
1
- import ModuleLoader from '../utils/ModuleLoader.js';
2
- let _loader = ModuleLoader.import;
3
- export function setDependencyLoader(loader) {
4
- _loader = loader;
5
- }
6
- export async function getDependency(name) {
7
- const module = await _loader(name);
8
- return module.default !== undefined ? module.default : module;
9
- }
@@ -1,3 +0,0 @@
1
- import LocalNode from '../LocalNode.js';
2
- export declare function setRuntime(runtime: LocalNode): void;
3
- export declare function runProcedure(fqn: string, versionNumber: string, args: object): Promise<unknown>;
@@ -1,14 +0,0 @@
1
- import Version from '../../core/Version.js';
2
- import RuntimeNotAvailable from '../errors/RuntimeNotAvailable.js';
3
- let _runtime;
4
- export function setRuntime(runtime) {
5
- _runtime = runtime;
6
- }
7
- export async function runProcedure(fqn, versionNumber, args) {
8
- if (_runtime === undefined) {
9
- throw new RuntimeNotAvailable();
10
- }
11
- const version = Version.parse(versionNumber);
12
- const argsMap = new Map(Object.entries(args));
13
- return _runtime.run(fqn, version, argsMap);
14
- }
@@ -1,11 +0,0 @@
1
- /// <reference types="node" />
2
- import File from '../models/File.js';
3
- export default interface FileManager {
4
- getRootLocation(): string;
5
- getAbsoluteLocation(filename: string): string;
6
- getRelativeLocation(filename: string): string;
7
- getType(filename: string): Promise<string>;
8
- getContent(filename: string): Promise<Buffer | string>;
9
- load(filename: string): Promise<File>;
10
- store(filename: string, content: string): Promise<void>;
11
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +0,0 @@
1
- export default interface HealthCheck {
2
- isHealthy(): Promise<boolean>;
3
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- import Runner from '../../core/interfaces/Runner.js';
2
- export default interface ProcedureContainer extends Runner {
3
- getProcedureNames(): string[];
4
- hasProcedure(name: string): boolean;
5
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,9 +0,0 @@
1
- /// <reference types="node" />
2
- export default class File {
3
- #private;
4
- constructor(location: string, type: string, content: Buffer | string);
5
- get location(): string;
6
- get type(): string;
7
- get content(): string | Buffer;
8
- get size(): number;
9
- }
@@ -1,14 +0,0 @@
1
- export default class File {
2
- #location;
3
- #type;
4
- #content;
5
- constructor(location, type, content) {
6
- this.#location = location;
7
- this.#type = type;
8
- this.#content = content;
9
- }
10
- get location() { return this.#location; }
11
- get type() { return this.#type; }
12
- get content() { return this.#content; }
13
- get size() { return this.#content.length; }
14
- }
@@ -1,10 +0,0 @@
1
- import Serializer from './interfaces/Serializer.js';
2
- import SerializedArrayBuffer from './types/SerializedArrayBuffer.js';
3
- import TypedArray from './types/TypedArray.js';
4
- declare class ArrayBufferSerializer implements Serializer {
5
- #private;
6
- serialize(data: TypedArray): SerializedArrayBuffer;
7
- deserialize(object: SerializedArrayBuffer): Promise<TypedArray>;
8
- }
9
- declare const instance: ArrayBufferSerializer;
10
- export default instance;
@@ -1,54 +0,0 @@
1
- import InvalidPropertyType from './errors/InvalidPropertyType.js';
2
- import ReflectionHelper from '../../core/reflection/ReflectionHelper.js';
3
- class ArrayBufferSerializer {
4
- serialize(data) {
5
- const type = data.constructor.name;
6
- const view = new DataView(data.buffer);
7
- const bytes = [];
8
- for (let index = 0; index < view.byteLength; index++) {
9
- bytes.push(view.getUint8(index));
10
- }
11
- const returnvalue = { serialized: true, name: 'ArrayBuffer', type: type, bytes: bytes };
12
- return returnvalue;
13
- }
14
- async deserialize(object) {
15
- this.#validateSerializedArrayBuffer(object);
16
- const type = object.type;
17
- const bytes = object.bytes;
18
- const buffer = new ArrayBuffer(bytes.length);
19
- const view = new DataView(buffer);
20
- for (let index = 0; index < bytes.length; index++) {
21
- view.setUint8(index, bytes[index]);
22
- }
23
- const clazz = globalThis[type];
24
- return ReflectionHelper.createInstance(clazz, [buffer]);
25
- }
26
- #validateSerializedArrayBuffer(object) {
27
- if ((object.bytes instanceof Array) === false) {
28
- throw new InvalidPropertyType('ArrayBuffer', 'bytes', 'Array');
29
- }
30
- if (this.#isValidType(object.type) === false) {
31
- throw new InvalidPropertyType('ArrayBuffer', 'type', 'TypedArray');
32
- }
33
- }
34
- #isValidType(type) {
35
- switch (type) {
36
- case 'Int8Array':
37
- case 'Uint8Array':
38
- case 'Uint8ClampedArray':
39
- case 'Int16Array':
40
- case 'Uint16Array':
41
- case 'Int32Array':
42
- case 'Uint32Array':
43
- case 'Float32Array':
44
- case 'Float64Array':
45
- case 'BigInt64Array':
46
- case 'BigUint64Array':
47
- return true;
48
- default:
49
- return false;
50
- }
51
- }
52
- }
53
- const instance = new ArrayBufferSerializer();
54
- export default instance;
@@ -1,7 +0,0 @@
1
- import Serializer from './interfaces/Serializer.js';
2
- declare class ArraySerializer implements Serializer {
3
- serialize(array: unknown[]): unknown[];
4
- deserialize(values: unknown[]): Promise<unknown[]>;
5
- }
6
- declare const instance: ArraySerializer;
7
- export default instance;
@@ -1,15 +0,0 @@
1
- import ValueSerializer from './ValueSerializer.js';
2
- class ArraySerializer {
3
- serialize(array) {
4
- const values = [];
5
- for (const value of array) {
6
- values.push(ValueSerializer.serialize(value));
7
- }
8
- return values;
9
- }
10
- async deserialize(values) {
11
- return await Promise.all(values.map(async (value) => await ValueSerializer.deserialize(value)));
12
- }
13
- }
14
- const instance = new ArraySerializer();
15
- export default instance;
@@ -1,10 +0,0 @@
1
- import Serializer from './interfaces/Serializer.js';
2
- import SerializableObject from './types/SerializableObject.js';
3
- import SerializedClass from './types/SerializedClass.js';
4
- declare class ClassSerializer implements Serializer {
5
- #private;
6
- serialize(object: SerializableObject): SerializedClass;
7
- deserialize(object: SerializedClass): Promise<SerializableObject>;
8
- }
9
- declare const instance: ClassSerializer;
10
- export default instance;