jitar 0.3.0 → 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.
- package/CHANGELOG.md +5 -0
- package/package.json +7 -7
- package/dist/client.d.ts +0 -3
- package/dist/client.js +0 -24
- package/dist/core/Context.d.ts +0 -5
- package/dist/core/Context.js +0 -7
- package/dist/core/ErrorManager.d.ts +0 -3
- package/dist/core/ErrorManager.js +0 -11
- package/dist/core/Implementation.d.ts +0 -10
- package/dist/core/Implementation.js +0 -44
- package/dist/core/Procedure.d.ts +0 -13
- package/dist/core/Procedure.js +0 -58
- package/dist/core/Segment.d.ts +0 -13
- package/dist/core/Segment.js +0 -36
- package/dist/core/SegmentBuilder.d.ts +0 -6
- package/dist/core/SegmentBuilder.js +0 -32
- package/dist/core/Version.d.ts +0 -13
- package/dist/core/Version.js +0 -50
- package/dist/core/definitions/AccessLevel.d.ts +0 -2
- package/dist/core/definitions/AccessLevel.js +0 -2
- package/dist/core/errors/BadRequest.d.ts +0 -3
- package/dist/core/errors/BadRequest.js +0 -6
- package/dist/core/errors/Forbidden.d.ts +0 -3
- package/dist/core/errors/Forbidden.js +0 -6
- package/dist/core/errors/ImplementationNotFound.d.ts +0 -4
- package/dist/core/errors/ImplementationNotFound.js +0 -7
- package/dist/core/errors/InvalidVersionNumber.d.ts +0 -4
- package/dist/core/errors/InvalidVersionNumber.js +0 -7
- package/dist/core/errors/MissingParameterValue.d.ts +0 -4
- package/dist/core/errors/MissingParameterValue.js +0 -7
- package/dist/core/errors/NotFound.d.ts +0 -3
- package/dist/core/errors/NotFound.js +0 -6
- package/dist/core/errors/NotImplemented.d.ts +0 -3
- package/dist/core/errors/NotImplemented.js +0 -6
- package/dist/core/errors/PaymentRequired.d.ts +0 -3
- package/dist/core/errors/PaymentRequired.js +0 -6
- package/dist/core/errors/ProcedureNotFound.d.ts +0 -4
- package/dist/core/errors/ProcedureNotFound.js +0 -7
- package/dist/core/errors/Teapot.d.ts +0 -3
- package/dist/core/errors/Teapot.js +0 -6
- package/dist/core/errors/Unauthorized.d.ts +0 -3
- package/dist/core/errors/Unauthorized.js +0 -6
- package/dist/core/errors/UnknownParameter.d.ts +0 -4
- package/dist/core/errors/UnknownParameter.js +0 -7
- package/dist/core/interfaces/Runner.d.ts +0 -4
- package/dist/core/interfaces/Runner.js +0 -1
- package/dist/core/reflection/ParameterParser.d.ts +0 -5
- package/dist/core/reflection/ParameterParser.js +0 -51
- package/dist/core/reflection/ReflectionHelper.d.ts +0 -13
- package/dist/core/reflection/ReflectionHelper.js +0 -69
- package/dist/core/reflection/models/ReflectionField.d.ts +0 -8
- package/dist/core/reflection/models/ReflectionField.js +0 -14
- package/dist/core/reflection/models/ReflectionParameter.d.ts +0 -7
- package/dist/core/reflection/models/ReflectionParameter.js +0 -11
- package/dist/core/types/Component.d.ts +0 -5
- package/dist/core/types/Component.js +0 -1
- package/dist/core/types/FlexObject.d.ts +0 -4
- package/dist/core/types/FlexObject.js +0 -1
- package/dist/core/types/Module.d.ts +0 -3
- package/dist/core/types/Module.js +0 -1
- package/dist/core/types/SegmentImplementation.d.ts +0 -6
- package/dist/core/types/SegmentImplementation.js +0 -1
- package/dist/core/types/SegmentModule.d.ts +0 -5
- package/dist/core/types/SegmentModule.js +0 -1
- package/dist/core/types/SegmentProcedure.d.ts +0 -7
- package/dist/core/types/SegmentProcedure.js +0 -1
- package/dist/core/utils/FqnBuilder.d.ts +0 -3
- package/dist/core/utils/FqnBuilder.js +0 -5
- package/dist/hooks.d.ts +0 -2
- package/dist/hooks.js +0 -2
- package/dist/lib.d.ts +0 -34
- package/dist/lib.js +0 -29
- package/dist/runtime/ClientId.d.ts +0 -4
- package/dist/runtime/ClientId.js +0 -11
- package/dist/runtime/Gateway.d.ts +0 -5
- package/dist/runtime/Gateway.js +0 -3
- package/dist/runtime/LocalGateway.d.ts +0 -14
- package/dist/runtime/LocalGateway.js +0 -61
- package/dist/runtime/LocalNode.d.ts +0 -18
- package/dist/runtime/LocalNode.js +0 -75
- package/dist/runtime/LocalRepository.d.ts +0 -17
- package/dist/runtime/LocalRepository.js +0 -94
- package/dist/runtime/Node.d.ts +0 -3
- package/dist/runtime/Node.js +0 -3
- package/dist/runtime/NodeBalancer.d.ts +0 -9
- package/dist/runtime/NodeBalancer.js +0 -34
- package/dist/runtime/NodeMonitor.d.ts +0 -7
- package/dist/runtime/NodeMonitor.js +0 -38
- package/dist/runtime/ProcedureRunner.d.ts +0 -9
- package/dist/runtime/ProcedureRunner.js +0 -9
- package/dist/runtime/ProcedureRuntime.d.ts +0 -13
- package/dist/runtime/ProcedureRuntime.js +0 -25
- package/dist/runtime/Proxy.d.ts +0 -18
- package/dist/runtime/Proxy.js +0 -33
- package/dist/runtime/Remote.d.ts +0 -15
- package/dist/runtime/Remote.js +0 -102
- package/dist/runtime/RemoteGateway.d.ts +0 -11
- package/dist/runtime/RemoteGateway.js +0 -22
- package/dist/runtime/RemoteNode.d.ts +0 -12
- package/dist/runtime/RemoteNode.js +0 -29
- package/dist/runtime/RemoteRepository.d.ts +0 -14
- package/dist/runtime/RemoteRepository.js +0 -34
- package/dist/runtime/Repository.d.ts +0 -11
- package/dist/runtime/Repository.js +0 -3
- package/dist/runtime/Runtime.d.ts +0 -9
- package/dist/runtime/Runtime.js +0 -27
- package/dist/runtime/caching/CacheBuilder.d.ts +0 -6
- package/dist/runtime/caching/CacheBuilder.js +0 -249
- package/dist/runtime/caching/ImportRewriter.d.ts +0 -4
- package/dist/runtime/caching/ImportRewriter.js +0 -49
- package/dist/runtime/caching/RemoteBuilder.d.ts +0 -5
- package/dist/runtime/caching/RemoteBuilder.js +0 -31
- package/dist/runtime/caching/SourceAppender.d.ts +0 -5
- package/dist/runtime/caching/SourceAppender.js +0 -30
- package/dist/runtime/caching/definitions/Keywords.d.ts +0 -2
- package/dist/runtime/caching/definitions/Keywords.js +0 -2
- package/dist/runtime/caching/errors/InvalidSegmentFilename.d.ts +0 -3
- package/dist/runtime/caching/errors/InvalidSegmentFilename.js +0 -5
- package/dist/runtime/caching/errors/MissingModuleExport.d.ts +0 -3
- package/dist/runtime/caching/errors/MissingModuleExport.js +0 -5
- package/dist/runtime/caching/errors/SegmentFileNotLoaded.d.ts +0 -3
- package/dist/runtime/caching/errors/SegmentFileNotLoaded.js +0 -5
- package/dist/runtime/caching/errors/SegmentModuleNotLoaded.d.ts +0 -3
- package/dist/runtime/caching/errors/SegmentModuleNotLoaded.js +0 -5
- package/dist/runtime/caching/models/ApplicationModule.d.ts +0 -9
- package/dist/runtime/caching/models/ApplicationModule.js +0 -19
- package/dist/runtime/caching/models/Implementation.d.ts +0 -12
- package/dist/runtime/caching/models/Implementation.js +0 -27
- package/dist/runtime/caching/models/Procedure.d.ts +0 -9
- package/dist/runtime/caching/models/Procedure.js +0 -15
- package/dist/runtime/caching/models/Segment.d.ts +0 -10
- package/dist/runtime/caching/models/Segment.js +0 -16
- package/dist/runtime/caching/models/SegmentModule.d.ts +0 -10
- package/dist/runtime/caching/models/SegmentModule.js +0 -14
- package/dist/runtime/caching/types/SegmentFile.d.ts +0 -5
- package/dist/runtime/caching/types/SegmentFile.js +0 -1
- package/dist/runtime/caching/types/SegmentImportProperties.d.ts +0 -6
- package/dist/runtime/caching/types/SegmentImportProperties.js +0 -1
- package/dist/runtime/caching/types/SegmentImports.d.ts +0 -5
- package/dist/runtime/caching/types/SegmentImports.js +0 -1
- package/dist/runtime/errors/ClientNotFound.d.ts +0 -3
- package/dist/runtime/errors/ClientNotFound.js +0 -6
- package/dist/runtime/errors/FileNotFound.d.ts +0 -3
- package/dist/runtime/errors/FileNotFound.js +0 -6
- package/dist/runtime/errors/InvalidClientId.d.ts +0 -3
- package/dist/runtime/errors/InvalidClientId.js +0 -6
- package/dist/runtime/errors/InvalidJitarHooks.d.ts +0 -3
- package/dist/runtime/errors/InvalidJitarHooks.js +0 -6
- package/dist/runtime/errors/InvalidSegmentFile.d.ts +0 -3
- package/dist/runtime/errors/InvalidSegmentFile.js +0 -6
- package/dist/runtime/errors/ModuleNotLoaded.d.ts +0 -3
- package/dist/runtime/errors/ModuleNotLoaded.js +0 -6
- package/dist/runtime/errors/NoNodeAvailable.d.ts +0 -3
- package/dist/runtime/errors/NoNodeAvailable.js +0 -6
- package/dist/runtime/errors/RepositoryNotAvaiable.d.ts +0 -3
- package/dist/runtime/errors/RepositoryNotAvaiable.js +0 -6
- package/dist/runtime/errors/RuntimeNotAvailable.d.ts +0 -3
- package/dist/runtime/errors/RuntimeNotAvailable.js +0 -6
- package/dist/runtime/errors/SegmentNotFound.d.ts +0 -3
- package/dist/runtime/errors/SegmentNotFound.js +0 -6
- package/dist/runtime/hooks/dependencies.d.ts +0 -2
- package/dist/runtime/hooks/dependencies.js +0 -9
- package/dist/runtime/hooks/runtime.d.ts +0 -3
- package/dist/runtime/hooks/runtime.js +0 -16
- package/dist/runtime/interfaces/FileManager.d.ts +0 -11
- package/dist/runtime/interfaces/FileManager.js +0 -1
- package/dist/runtime/interfaces/HealthCheck.d.ts +0 -3
- package/dist/runtime/interfaces/HealthCheck.js +0 -1
- package/dist/runtime/interfaces/Middleware.d.ts +0 -5
- package/dist/runtime/interfaces/Middleware.js +0 -1
- package/dist/runtime/models/File.d.ts +0 -9
- package/dist/runtime/models/File.js +0 -14
- package/dist/runtime/serialization/ArrayBufferSerializer.d.ts +0 -10
- package/dist/runtime/serialization/ArrayBufferSerializer.js +0 -54
- package/dist/runtime/serialization/ArraySerializer.d.ts +0 -7
- package/dist/runtime/serialization/ArraySerializer.js +0 -15
- package/dist/runtime/serialization/ClassSerializer.d.ts +0 -10
- package/dist/runtime/serialization/ClassSerializer.js +0 -74
- package/dist/runtime/serialization/DateSerializer.d.ts +0 -9
- package/dist/runtime/serialization/DateSerializer.js +0 -21
- package/dist/runtime/serialization/MapSerializer.d.ts +0 -9
- package/dist/runtime/serialization/MapSerializer.js +0 -35
- package/dist/runtime/serialization/ObjectSerializer.d.ts +0 -9
- package/dist/runtime/serialization/ObjectSerializer.js +0 -21
- package/dist/runtime/serialization/SetSerializer.d.ts +0 -9
- package/dist/runtime/serialization/SetSerializer.js +0 -23
- package/dist/runtime/serialization/ValueSerializer.d.ts +0 -8
- package/dist/runtime/serialization/ValueSerializer.js +0 -69
- package/dist/runtime/serialization/errors/ClassNotFound.d.ts +0 -3
- package/dist/runtime/serialization/errors/ClassNotFound.js +0 -6
- package/dist/runtime/serialization/errors/InvalidClass.d.ts +0 -3
- package/dist/runtime/serialization/errors/InvalidClass.js +0 -6
- package/dist/runtime/serialization/errors/InvalidPropertyType.d.ts +0 -4
- package/dist/runtime/serialization/errors/InvalidPropertyType.js +0 -7
- package/dist/runtime/serialization/interfaces/Serializer.d.ts +0 -4
- package/dist/runtime/serialization/interfaces/Serializer.js +0 -1
- package/dist/runtime/serialization/types/SerializableObject.d.ts +0 -3
- package/dist/runtime/serialization/types/SerializableObject.js +0 -1
- package/dist/runtime/serialization/types/Serialized.d.ts +0 -5
- package/dist/runtime/serialization/types/Serialized.js +0 -1
- package/dist/runtime/serialization/types/SerializedArrayBuffer.d.ts +0 -6
- package/dist/runtime/serialization/types/SerializedArrayBuffer.js +0 -1
- package/dist/runtime/serialization/types/SerializedClass.d.ts +0 -8
- package/dist/runtime/serialization/types/SerializedClass.js +0 -1
- package/dist/runtime/serialization/types/SerializedDate.d.ts +0 -5
- package/dist/runtime/serialization/types/SerializedDate.js +0 -1
- package/dist/runtime/serialization/types/SerializedMap.d.ts +0 -8
- package/dist/runtime/serialization/types/SerializedMap.js +0 -1
- package/dist/runtime/serialization/types/SerializedObject.d.ts +0 -4
- package/dist/runtime/serialization/types/SerializedObject.js +0 -1
- package/dist/runtime/serialization/types/SerializedSet.d.ts +0 -5
- package/dist/runtime/serialization/types/SerializedSet.js +0 -1
- package/dist/runtime/serialization/types/TypedArray.d.ts +0 -2
- package/dist/runtime/serialization/types/TypedArray.js +0 -1
- package/dist/runtime/types/JitarHooks.d.ts +0 -6
- package/dist/runtime/types/JitarHooks.js +0 -1
- package/dist/runtime/types/ModuleImporter.d.ts +0 -3
- package/dist/runtime/types/ModuleImporter.js +0 -1
- package/dist/runtime/types/NextHandler.d.ts +0 -2
- package/dist/runtime/types/NextHandler.js +0 -1
- package/dist/runtime/utils/ModuleAnalyser.d.ts +0 -7
- package/dist/runtime/utils/ModuleAnalyser.js +0 -34
- package/dist/runtime/utils/ModuleLoader.d.ts +0 -8
- package/dist/runtime/utils/ModuleLoader.js +0 -30
- package/dist/runtime/utils/UrlRewriter.d.ts +0 -4
- package/dist/runtime/utils/UrlRewriter.js +0 -36
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import BadRequest from '../../../core/errors/BadRequest.js';
|
|
2
|
-
export default class InvalidPropertyType extends BadRequest {
|
|
3
|
-
constructor(typeName, propertyName, expectedType) {
|
|
4
|
-
super(`The ${typeName} property '${propertyName}' has an invalid type (expected '${expectedType}')`);
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
InvalidPropertyType.source = '/jitar/runtime/serialization/errors/InvalidPropertyType.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import Module from '../../core/types/Module.js';
|
|
2
|
-
export default class ModuleAnalyser {
|
|
3
|
-
#private;
|
|
4
|
-
static filterObjects(module: Module): Map<string, Object>;
|
|
5
|
-
static filterFunctions(module: Module): Map<string, Function>;
|
|
6
|
-
static filterClasses(module: Module): Map<string, Function>;
|
|
7
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export default class ModuleAnalyser {
|
|
2
|
-
static filterObjects(module) {
|
|
3
|
-
return this.#filterexported(module, Object);
|
|
4
|
-
}
|
|
5
|
-
static filterFunctions(module) {
|
|
6
|
-
const functions = this.#filterexported(module, Function);
|
|
7
|
-
return this.#filterFunctionTypes(functions, false);
|
|
8
|
-
}
|
|
9
|
-
static filterClasses(module) {
|
|
10
|
-
const functions = this.#filterexported(module, Function);
|
|
11
|
-
return this.#filterFunctionTypes(functions, true);
|
|
12
|
-
}
|
|
13
|
-
static #filterexported(module, type) {
|
|
14
|
-
const keys = Object.keys(module);
|
|
15
|
-
const filtered = new Map();
|
|
16
|
-
for (const key of keys) {
|
|
17
|
-
const exported = module[key];
|
|
18
|
-
if (exported instanceof type) {
|
|
19
|
-
filtered.set(key, exported);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return filtered;
|
|
23
|
-
}
|
|
24
|
-
static #filterFunctionTypes(functions, filterClasses) {
|
|
25
|
-
const filtered = new Map();
|
|
26
|
-
for (const [key, value] of functions) {
|
|
27
|
-
const code = value.toString();
|
|
28
|
-
if (code.startsWith('class') === filterClasses) {
|
|
29
|
-
filtered.set(key, value);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return filtered;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import Module from '../../core/types/Module.js';
|
|
2
|
-
import ModuleImporter from '../types/ModuleImporter.js';
|
|
3
|
-
export default class ModuleLoader {
|
|
4
|
-
static setBaseUrl(baseUrl: string): void;
|
|
5
|
-
static setImporter(importer: ModuleImporter): void;
|
|
6
|
-
static load(url: string): Promise<Module>;
|
|
7
|
-
static import(specifier: string): Promise<import("../../core/types/FlexObject.js").default>;
|
|
8
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import ModuleNotLoaded from '../errors/ModuleNotLoaded.js';
|
|
2
|
-
import UrlRewriter from './UrlRewriter.js';
|
|
3
|
-
let _baseUrl;
|
|
4
|
-
let _import = async (name) => { return import(name); };
|
|
5
|
-
export default class ModuleLoader {
|
|
6
|
-
static setBaseUrl(baseUrl) {
|
|
7
|
-
_baseUrl = baseUrl;
|
|
8
|
-
}
|
|
9
|
-
static setImporter(importer) {
|
|
10
|
-
_import = importer;
|
|
11
|
-
}
|
|
12
|
-
static async load(url) {
|
|
13
|
-
if (url.startsWith('/jitar')) {
|
|
14
|
-
url = `../..${url}`;
|
|
15
|
-
}
|
|
16
|
-
if (_baseUrl !== undefined && url.startsWith(_baseUrl) === false) {
|
|
17
|
-
url = UrlRewriter.addBase(url, _baseUrl);
|
|
18
|
-
}
|
|
19
|
-
return this.import(url);
|
|
20
|
-
}
|
|
21
|
-
static async import(specifier) {
|
|
22
|
-
try {
|
|
23
|
-
return await _import(specifier);
|
|
24
|
-
}
|
|
25
|
-
catch (error) {
|
|
26
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
27
|
-
throw new ModuleNotLoaded(specifier, message);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export default class UrlRewriter {
|
|
2
|
-
static addBase(url, base) {
|
|
3
|
-
url = this.#ensureStartsWithoutSlash(url);
|
|
4
|
-
base = this.#assureEndWithSlash(base);
|
|
5
|
-
return this.#translateRelativeParts(`${base}${url}`);
|
|
6
|
-
}
|
|
7
|
-
static #ensureStartsWithoutSlash(url) {
|
|
8
|
-
if (url.startsWith('/')) {
|
|
9
|
-
return url.substring(1);
|
|
10
|
-
}
|
|
11
|
-
return url;
|
|
12
|
-
}
|
|
13
|
-
static #assureEndWithSlash(base) {
|
|
14
|
-
if (base.endsWith('/')) {
|
|
15
|
-
return base;
|
|
16
|
-
}
|
|
17
|
-
return `${base}/`;
|
|
18
|
-
}
|
|
19
|
-
static #translateRelativeParts(url) {
|
|
20
|
-
const parts = url.split('/');
|
|
21
|
-
const translated = [];
|
|
22
|
-
translated.push(parts[0]);
|
|
23
|
-
for (let index = 1; index < parts.length; index++) {
|
|
24
|
-
const part = parts[index].trim();
|
|
25
|
-
if (part === '.' || part === '') {
|
|
26
|
-
continue;
|
|
27
|
-
}
|
|
28
|
-
else if (part === '..') {
|
|
29
|
-
translated.pop();
|
|
30
|
-
continue;
|
|
31
|
-
}
|
|
32
|
-
translated.push(part);
|
|
33
|
-
}
|
|
34
|
-
return translated.join('/');
|
|
35
|
-
}
|
|
36
|
-
}
|