@oslo-flanders/core 0.0.1-alpha.0
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/README.md +75 -0
- package/index.js +34 -0
- package/lib/ServiceIdentifier.d.ts +7 -0
- package/lib/ServiceIdentifier.js +15 -0
- package/lib/ServiceIdentifier.js.map +1 -0
- package/lib/ServiceIdentifier.ts +10 -0
- package/lib/enums/PropertyTypes.d.ts +5 -0
- package/lib/enums/PropertyTypes.js +10 -0
- package/lib/enums/PropertyTypes.js.map +1 -0
- package/lib/enums/PropertyTypes.ts +5 -0
- package/lib/enums/Scope.d.ts +6 -0
- package/lib/enums/Scope.js +11 -0
- package/lib/enums/Scope.js.map +1 -0
- package/lib/enums/Scope.ts +6 -0
- package/lib/interfaces/AppRunner.d.ts +15 -0
- package/lib/interfaces/AppRunner.js +15 -0
- package/lib/interfaces/AppRunner.js.map +1 -0
- package/lib/interfaces/AppRunner.ts +25 -0
- package/lib/interfaces/IConfiguration.d.ts +7 -0
- package/lib/interfaces/IConfiguration.js +3 -0
- package/lib/interfaces/IConfiguration.js.map +1 -0
- package/lib/interfaces/IConfiguration.ts +8 -0
- package/lib/interfaces/IConversionService.d.ts +10 -0
- package/lib/interfaces/IConversionService.js +3 -0
- package/lib/interfaces/IConversionService.js.map +1 -0
- package/lib/interfaces/IConversionService.ts +11 -0
- package/lib/interfaces/IGenerationService.d.ts +8 -0
- package/lib/interfaces/IGenerationService.js +3 -0
- package/lib/interfaces/IGenerationService.js.map +1 -0
- package/lib/interfaces/IGenerationService.ts +9 -0
- package/lib/interfaces/IOutputHandler.d.ts +7 -0
- package/lib/interfaces/IOutputHandler.js +3 -0
- package/lib/interfaces/IOutputHandler.js.map +1 -0
- package/lib/interfaces/IOutputHandler.ts +8 -0
- package/lib/logging/LogLevel.d.ts +5 -0
- package/lib/logging/LogLevel.js +5 -0
- package/lib/logging/LogLevel.js.map +1 -0
- package/lib/logging/LogLevel.ts +6 -0
- package/lib/logging/Logger.d.ts +19 -0
- package/lib/logging/Logger.js +35 -0
- package/lib/logging/Logger.js.map +1 -0
- package/lib/logging/Logger.ts +41 -0
- package/lib/logging/VoidLogger.d.ts +7 -0
- package/lib/logging/VoidLogger.js +28 -0
- package/lib/logging/VoidLogger.js.map +1 -0
- package/lib/logging/VoidLogger.ts +15 -0
- package/lib/logging/WinstonLogger.d.ts +7 -0
- package/lib/logging/WinstonLogger.js +39 -0
- package/lib/logging/WinstonLogger.js.map +1 -0
- package/lib/logging/WinstonLogger.ts +33 -0
- package/lib/utils/N3StoreFunctions.d.ts +136 -0
- package/lib/utils/N3StoreFunctions.js +257 -0
- package/lib/utils/N3StoreFunctions.js.map +1 -0
- package/lib/utils/N3StoreFunctions.ts +268 -0
- package/lib/utils/fetchFileOrUrl.d.ts +2 -0
- package/lib/utils/fetchFileOrUrl.js +23 -0
- package/lib/utils/fetchFileOrUrl.js.map +1 -0
- package/lib/utils/fetchFileOrUrl.ts +19 -0
- package/lib/utils/namespaces.d.ts +24 -0
- package/lib/utils/namespaces.js +36 -0
- package/lib/utils/namespaces.js.map +1 -0
- package/lib/utils/namespaces.ts +41 -0
- package/lib/utils/uniqueId.d.ts +1 -0
- package/lib/utils/uniqueId.js +14 -0
- package/lib/utils/uniqueId.js.map +1 -0
- package/lib/utils/uniqueId.ts +11 -0
- package/package.json +56 -0
package/README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# OSLO Core
|
|
2
|
+
|
|
3
|
+
> Package that contains the core interfaces, classes and functions that can be used across other packages
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @oslo-flanders/Core
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
Everything can be imported through named imports from the core packages.
|
|
14
|
+
```node
|
|
15
|
+
import { XXX } from '@oslo-flanders/core'
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Package content
|
|
19
|
+
|
|
20
|
+
The core package contains general interfaces and utility functions
|
|
21
|
+
|
|
22
|
+
### Interfaces
|
|
23
|
+
|
|
24
|
+
#### `IConversionService`
|
|
25
|
+
Interface that must be implemented when creating a new conversion service
|
|
26
|
+
|
|
27
|
+
#### `IGenerationService`
|
|
28
|
+
Interface that must be implemented when creating a new generator.
|
|
29
|
+
|
|
30
|
+
#### `IOutputHandler`
|
|
31
|
+
Interface that must be implemented when creating a new output handler.
|
|
32
|
+
|
|
33
|
+
#### `IConfiguration`
|
|
34
|
+
Interface that must be implemented when creating a new configuration class.
|
|
35
|
+
|
|
36
|
+
#### `AppRunner`
|
|
37
|
+
**Abstract** class that contains the CLI service to start a conversion or generator service.
|
|
38
|
+
|
|
39
|
+
### Utils
|
|
40
|
+
|
|
41
|
+
Small and easy functions that can be used in other packages
|
|
42
|
+
|
|
43
|
+
#### `fetchFileOrUrl`
|
|
44
|
+
|
|
45
|
+
Fetches a file or URL and returns a `Buffer`.
|
|
46
|
+
```node
|
|
47
|
+
import { fetchFileOrUrl } from '@oslo-flanders/core'
|
|
48
|
+
|
|
49
|
+
const buffer = fetchFileOrUrl('/path/or/url/to/file');
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
#### `namespaces`
|
|
53
|
+
|
|
54
|
+
Function that ensures that we don't have to write full URIs anymore. Takes the local identifier as string parameter and returns an RDF.NamedNode:
|
|
55
|
+
```
|
|
56
|
+
import { ns } from '@oslo-flanders/core'
|
|
57
|
+
|
|
58
|
+
const exampleNamedNode = ns.example('test');
|
|
59
|
+
|
|
60
|
+
// exampleNamedNode.value is equal to 'http://example.org/test'
|
|
61
|
+
|
|
62
|
+
const rdfType = ns.rdf('type');
|
|
63
|
+
|
|
64
|
+
// rdfType.value will be 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
#### `uniqueId`
|
|
68
|
+
|
|
69
|
+
Function that returns random string, with a very low probability that the same string is going to be returned multiple times.
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
import { uniqueId } from '@oslo-flanders/core'
|
|
73
|
+
|
|
74
|
+
const id = uniqueId();
|
|
75
|
+
```
|
package/index.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
require("reflect-metadata");
|
|
18
|
+
__exportStar(require("./lib/interfaces/AppRunner"), exports);
|
|
19
|
+
__exportStar(require("./lib/interfaces/IConfiguration"), exports);
|
|
20
|
+
__exportStar(require("./lib/interfaces/IConversionService"), exports);
|
|
21
|
+
__exportStar(require("./lib/interfaces/IGenerationService"), exports);
|
|
22
|
+
__exportStar(require("./lib/interfaces/IOutputHandler"), exports);
|
|
23
|
+
__exportStar(require("./lib/utils/fetchFileOrUrl"), exports);
|
|
24
|
+
__exportStar(require("./lib/utils/namespaces"), exports);
|
|
25
|
+
__exportStar(require("./lib/utils/uniqueId"), exports);
|
|
26
|
+
__exportStar(require("./lib/utils/N3StoreFunctions"), exports);
|
|
27
|
+
__exportStar(require("./lib/ServiceIdentifier"), exports);
|
|
28
|
+
__exportStar(require("./lib/enums/Scope"), exports);
|
|
29
|
+
__exportStar(require("./lib/enums/PropertyTypes"), exports);
|
|
30
|
+
__exportStar(require("./lib/logging/LogLevel"), exports);
|
|
31
|
+
__exportStar(require("./lib/logging/Logger"), exports);
|
|
32
|
+
__exportStar(require("./lib/logging/VoidLogger"), exports);
|
|
33
|
+
__exportStar(require("./lib/logging/WinstonLogger"), exports);
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare class ServiceIdentifier {
|
|
2
|
+
static readonly ConversionService: unique symbol;
|
|
3
|
+
static readonly GenerationService: unique symbol;
|
|
4
|
+
static readonly Configuration: unique symbol;
|
|
5
|
+
static readonly OutputHandler: unique symbol;
|
|
6
|
+
static readonly Logger: unique symbol;
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ServiceIdentifier = void 0;
|
|
4
|
+
/* eslint-disable eslint-comments/disable-enable-pair */
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-extraneous-class */
|
|
6
|
+
// This must be a class, because it must be possible to extend it in implementations
|
|
7
|
+
class ServiceIdentifier {
|
|
8
|
+
}
|
|
9
|
+
exports.ServiceIdentifier = ServiceIdentifier;
|
|
10
|
+
ServiceIdentifier.ConversionService = Symbol.for('ConversionService');
|
|
11
|
+
ServiceIdentifier.GenerationService = Symbol.for('GenerationService');
|
|
12
|
+
ServiceIdentifier.Configuration = Symbol.for('Configuration');
|
|
13
|
+
ServiceIdentifier.OutputHandler = Symbol.for('OutputHandler');
|
|
14
|
+
ServiceIdentifier.Logger = Symbol.for('Logger');
|
|
15
|
+
//# sourceMappingURL=ServiceIdentifier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServiceIdentifier.js","sourceRoot":"","sources":["ServiceIdentifier.ts"],"names":[],"mappings":";;;AAAA,wDAAwD;AACxD,2DAA2D;AAC3D,oFAAoF;AACpF,MAAa,iBAAiB;;AAA9B,8CAMC;AALwB,mCAAiB,GAAG,MAAM,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;AACpD,mCAAiB,GAAG,MAAM,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;AACpD,+BAAa,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AAC5C,+BAAa,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AAC5C,wBAAM,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC","sourcesContent":["/* eslint-disable eslint-comments/disable-enable-pair */\r\n/* eslint-disable @typescript-eslint/no-extraneous-class */\r\n// This must be a class, because it must be possible to extend it in implementations\r\nexport class ServiceIdentifier {\r\n public static readonly ConversionService = Symbol.for('ConversionService');\r\n public static readonly GenerationService = Symbol.for('GenerationService');\r\n public static readonly Configuration = Symbol.for('Configuration');\r\n public static readonly OutputHandler = Symbol.for('OutputHandler');\r\n public static readonly Logger = Symbol.for('Logger');\r\n}\r\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/* eslint-disable eslint-comments/disable-enable-pair */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-extraneous-class */
|
|
3
|
+
// This must be a class, because it must be possible to extend it in implementations
|
|
4
|
+
export class ServiceIdentifier {
|
|
5
|
+
public static readonly ConversionService = Symbol.for('ConversionService');
|
|
6
|
+
public static readonly GenerationService = Symbol.for('GenerationService');
|
|
7
|
+
public static readonly Configuration = Symbol.for('Configuration');
|
|
8
|
+
public static readonly OutputHandler = Symbol.for('OutputHandler');
|
|
9
|
+
public static readonly Logger = Symbol.for('Logger');
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PropertyType = void 0;
|
|
4
|
+
var PropertyType;
|
|
5
|
+
(function (PropertyType) {
|
|
6
|
+
PropertyType["DataTypeProperty"] = "http://www.w3.org/2002/07/owl#DatatypeProperty";
|
|
7
|
+
PropertyType["ObjectProperty"] = "http://www.w3.org/2002/07/owl#ObjectProperty";
|
|
8
|
+
PropertyType["Property"] = "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property";
|
|
9
|
+
})(PropertyType = exports.PropertyType || (exports.PropertyType = {}));
|
|
10
|
+
//# sourceMappingURL=PropertyTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PropertyTypes.js","sourceRoot":"","sources":["PropertyTypes.ts"],"names":[],"mappings":";;;AAAA,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,mFAAmE,CAAA;IACnE,+EAA+D,CAAA;IAC/D,gFAAgE,CAAA;AAClE,CAAC,EAJW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAIvB","sourcesContent":["export enum PropertyType {\r\n DataTypeProperty = 'http://www.w3.org/2002/07/owl#DatatypeProperty',\r\n ObjectProperty = 'http://www.w3.org/2002/07/owl#ObjectProperty',\r\n Property = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#Property',\r\n}\r\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare enum Scope {
|
|
2
|
+
InPackage = "https://data.vlaanderen.be/id/concept/scope/InPackage",
|
|
3
|
+
InPublicationEnvironment = "https://data.vlaanderen.be/id/concept/scope/InPublicationEnvironment",
|
|
4
|
+
External = "https://data.vlaanderen.be/id/concept/scope/External",
|
|
5
|
+
Undefined = "https://data.vlaanderen.be/id/concept/scope/Undefined"
|
|
6
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Scope = void 0;
|
|
4
|
+
var Scope;
|
|
5
|
+
(function (Scope) {
|
|
6
|
+
Scope["InPackage"] = "https://data.vlaanderen.be/id/concept/scope/InPackage";
|
|
7
|
+
Scope["InPublicationEnvironment"] = "https://data.vlaanderen.be/id/concept/scope/InPublicationEnvironment";
|
|
8
|
+
Scope["External"] = "https://data.vlaanderen.be/id/concept/scope/External";
|
|
9
|
+
Scope["Undefined"] = "https://data.vlaanderen.be/id/concept/scope/Undefined";
|
|
10
|
+
})(Scope = exports.Scope || (exports.Scope = {}));
|
|
11
|
+
//# sourceMappingURL=Scope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Scope.js","sourceRoot":"","sources":["Scope.ts"],"names":[],"mappings":";;;AAAA,IAAY,KAKX;AALD,WAAY,KAAK;IACf,4EAAmE,CAAA;IACnE,0GAAiG,CAAA;IACjG,0EAAiE,CAAA;IACjE,4EAAmE,CAAA;AACrE,CAAC,EALW,KAAK,GAAL,aAAK,KAAL,aAAK,QAKhB","sourcesContent":["export enum Scope {\r\n InPackage = 'https://data.vlaanderen.be/id/concept/scope/InPackage',\r\n InPublicationEnvironment = 'https://data.vlaanderen.be/id/concept/scope/InPublicationEnvironment',\r\n External = 'https://data.vlaanderen.be/id/concept/scope/External',\r\n Undefined = 'https://data.vlaanderen.be/id/concept/scope/Undefined'\r\n}\r\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export enum Scope {
|
|
2
|
+
InPackage = 'https://data.vlaanderen.be/id/concept/scope/InPackage',
|
|
3
|
+
InPublicationEnvironment = 'https://data.vlaanderen.be/id/concept/scope/InPublicationEnvironment',
|
|
4
|
+
External = 'https://data.vlaanderen.be/id/concept/scope/External',
|
|
5
|
+
Undefined = 'https://data.vlaanderen.be/id/concept/scope/Undefined'
|
|
6
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
export declare type CliArgv = string[];
|
|
3
|
+
export declare type YargsParams = {
|
|
4
|
+
[x: string]: unknown;
|
|
5
|
+
_: (string | number)[];
|
|
6
|
+
$0: string;
|
|
7
|
+
} | {
|
|
8
|
+
[x: string]: unknown;
|
|
9
|
+
_: (string | number)[];
|
|
10
|
+
$0: string;
|
|
11
|
+
};
|
|
12
|
+
export declare abstract class AppRunner {
|
|
13
|
+
runCliSync(process: NodeJS.Process): void;
|
|
14
|
+
abstract runCli(argv: CliArgv): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppRunner = void 0;
|
|
4
|
+
const process_1 = require("process");
|
|
5
|
+
class AppRunner {
|
|
6
|
+
runCliSync(process) {
|
|
7
|
+
this.runCli(process.argv).catch((error) => {
|
|
8
|
+
process_1.stderr.write(error.message);
|
|
9
|
+
// eslint-disable-next-line unicorn/no-process-exit
|
|
10
|
+
process.exit(1);
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.AppRunner = AppRunner;
|
|
15
|
+
//# sourceMappingURL=AppRunner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppRunner.js","sourceRoot":"","sources":["AppRunner.ts"],"names":[],"mappings":";;;AAAA,qCAAiC;AAcjC,MAAsB,SAAS;IACtB,UAAU,CAAC,OAAuB;QACvC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAS,EAAE;YAC/C,gBAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAC5B,mDAAmD;YACnD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC;CAGF;AAVD,8BAUC","sourcesContent":["import { stderr } from 'process';\r\n\r\nexport type CliArgv = string[];\r\n\r\nexport type YargsParams = {\r\n [x: string]: unknown;\r\n _: (string | number)[];\r\n $0: string;\r\n} | {\r\n [x: string]: unknown;\r\n _: (string | number)[];\r\n $0: string;\r\n};\r\n\r\nexport abstract class AppRunner {\r\n public runCliSync(process: NodeJS.Process): void {\r\n this.runCli(process.argv).catch((error): never => {\r\n stderr.write(error.message);\r\n // eslint-disable-next-line unicorn/no-process-exit\r\n process.exit(1);\r\n });\r\n }\r\n\r\n public abstract runCli(argv: CliArgv): Promise<void>;\r\n}\r\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { stderr } from 'process';
|
|
2
|
+
|
|
3
|
+
export type CliArgv = string[];
|
|
4
|
+
|
|
5
|
+
export type YargsParams = {
|
|
6
|
+
[x: string]: unknown;
|
|
7
|
+
_: (string | number)[];
|
|
8
|
+
$0: string;
|
|
9
|
+
} | {
|
|
10
|
+
[x: string]: unknown;
|
|
11
|
+
_: (string | number)[];
|
|
12
|
+
$0: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export abstract class AppRunner {
|
|
16
|
+
public runCliSync(process: NodeJS.Process): void {
|
|
17
|
+
this.runCli(process.argv).catch((error): never => {
|
|
18
|
+
stderr.write(error.message);
|
|
19
|
+
// eslint-disable-next-line unicorn/no-process-exit
|
|
20
|
+
process.exit(1);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public abstract runCli(argv: CliArgv): Promise<void>;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IConfiguration.js","sourceRoot":"","sources":["IConfiguration.ts"],"names":[],"mappings":"","sourcesContent":["import type { YargsParams } from './AppRunner';\r\n\r\n/**\r\n * Interface that must be implemented by classes that contain configuration properties\r\n */\r\nexport interface IConfiguration {\r\n createFromCli: (params: YargsParams) => Promise<void>;\r\n}\r\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Logger } from '../logging/Logger';
|
|
2
|
+
import type { IConfiguration } from './IConfiguration';
|
|
3
|
+
/**
|
|
4
|
+
* Interface that must be implemented by classes that convert a UML diagram to an RDF file
|
|
5
|
+
*/
|
|
6
|
+
export interface IConversionService {
|
|
7
|
+
logger: Logger;
|
|
8
|
+
configuration: IConfiguration;
|
|
9
|
+
run: () => Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IConversionService.js","sourceRoot":"","sources":["IConversionService.ts"],"names":[],"mappings":"","sourcesContent":["import type { Logger } from '../logging/Logger';\r\nimport type { IConfiguration } from './IConfiguration';\r\n\r\n/**\r\n * Interface that must be implemented by classes that convert a UML diagram to an RDF file\r\n */\r\nexport interface IConversionService {\r\n logger: Logger;\r\n configuration: IConfiguration;\r\n run: () => Promise<void>;\r\n}\r\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Logger } from '../logging/Logger';
|
|
2
|
+
import type { IConfiguration } from './IConfiguration';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Interface that must be implemented by classes that convert a UML diagram to an RDF file
|
|
6
|
+
*/
|
|
7
|
+
export interface IConversionService {
|
|
8
|
+
logger: Logger;
|
|
9
|
+
configuration: IConfiguration;
|
|
10
|
+
run: () => Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IConfiguration } from './IConfiguration';
|
|
2
|
+
/**
|
|
3
|
+
* Interface that must be implemented by classes that use an RDF file as input and generates an artefact
|
|
4
|
+
*/
|
|
5
|
+
export interface IGenerationService {
|
|
6
|
+
configuration: IConfiguration;
|
|
7
|
+
run: () => Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IGenerationService.js","sourceRoot":"","sources":["IGenerationService.ts"],"names":[],"mappings":"","sourcesContent":["import type { IConfiguration } from './IConfiguration';\r\n\r\n/**\r\n * Interface that must be implemented by classes that use an RDF file as input and generates an artefact\r\n */\r\nexport interface IGenerationService {\r\n configuration: IConfiguration;\r\n run: () => Promise<void>;\r\n}\r\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IConfiguration } from './IConfiguration';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Interface that must be implemented by classes that use an RDF file as input and generates an artefact
|
|
5
|
+
*/
|
|
6
|
+
export interface IGenerationService {
|
|
7
|
+
configuration: IConfiguration;
|
|
8
|
+
run: () => Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IOutputHandler.js","sourceRoot":"","sources":["IOutputHandler.ts"],"names":[],"mappings":"","sourcesContent":["import type { Quad, Store } from 'n3';\r\n\r\n/**\r\n * Writes the triples in an RDF store to a write stream\r\n */\r\nexport interface IOutputHandler {\r\n write: (store: Store<Quad>, writeStream: any) => Promise<void>;\r\n}\r\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogLevel.js","sourceRoot":"","sources":["LogLevel.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAU,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC","sourcesContent":["export const LOG_LEVELS = <const>['error', 'warn', 'info', 'verbose', 'debug', 'silly'];\r\n\r\n/**\r\n * Different log levels, from most important to least important.\r\n */\r\nexport type LogLevel = typeof LOG_LEVELS[number];\r\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { LogLevel } from './LogLevel';
|
|
2
|
+
export interface Logger {
|
|
3
|
+
log: (level: LogLevel, message: string) => Logger;
|
|
4
|
+
error: (message: string) => Logger;
|
|
5
|
+
warn: (message: string) => Logger;
|
|
6
|
+
info: (message: string) => Logger;
|
|
7
|
+
verbose: (message: string) => Logger;
|
|
8
|
+
debug: (message: string) => Logger;
|
|
9
|
+
silly: (message: string) => Logger;
|
|
10
|
+
}
|
|
11
|
+
export declare abstract class BaseLogger implements Logger {
|
|
12
|
+
abstract log(level: LogLevel, message: string): Logger;
|
|
13
|
+
error(message: string): Logger;
|
|
14
|
+
warn(message: string): Logger;
|
|
15
|
+
info(message: string): Logger;
|
|
16
|
+
verbose(message: string): Logger;
|
|
17
|
+
debug(message: string): Logger;
|
|
18
|
+
silly(message: string): Logger;
|
|
19
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.BaseLogger = void 0;
|
|
10
|
+
const inversify_1 = require("inversify");
|
|
11
|
+
let BaseLogger = class BaseLogger {
|
|
12
|
+
error(message) {
|
|
13
|
+
return this.log('error', message);
|
|
14
|
+
}
|
|
15
|
+
warn(message) {
|
|
16
|
+
return this.log('warn', message);
|
|
17
|
+
}
|
|
18
|
+
info(message) {
|
|
19
|
+
return this.log('info', message);
|
|
20
|
+
}
|
|
21
|
+
verbose(message) {
|
|
22
|
+
return this.log('verbose', message);
|
|
23
|
+
}
|
|
24
|
+
debug(message) {
|
|
25
|
+
return this.log('debug', message);
|
|
26
|
+
}
|
|
27
|
+
silly(message) {
|
|
28
|
+
return this.log('silly', message);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
BaseLogger = __decorate([
|
|
32
|
+
(0, inversify_1.injectable)()
|
|
33
|
+
], BaseLogger);
|
|
34
|
+
exports.BaseLogger = BaseLogger;
|
|
35
|
+
//# sourceMappingURL=Logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Logger.js","sourceRoot":"","sources":["Logger.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yCAAuC;AAchC,IAAe,UAAU,GAAzB,MAAe,UAAU;IAGvB,KAAK,CAAC,OAAe;QAC1B,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACpC,CAAC;IAEM,IAAI,CAAC,OAAe;QACzB,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,CAAC;IAEM,IAAI,CAAC,OAAe;QACzB,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,CAAC;IAEM,OAAO,CAAC,OAAe;QAC5B,OAAO,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;IAEM,KAAK,CAAC,OAAe;QAC1B,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACpC,CAAC;IAEM,KAAK,CAAC,OAAe;QAC1B,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACpC,CAAC;CACF,CAAA;AA1BqB,UAAU;IAD/B,IAAA,sBAAU,GAAE;GACS,UAAU,CA0B/B;AA1BqB,gCAAU","sourcesContent":["import { injectable } from 'inversify';\r\nimport type { LogLevel } from './LogLevel';\r\n\r\nexport interface Logger {\r\n log: (level: LogLevel, message: string) => Logger;\r\n error: (message: string) => Logger;\r\n warn: (message: string) => Logger;\r\n info: (message: string) => Logger;\r\n verbose: (message: string) => Logger;\r\n debug: (message: string) => Logger;\r\n silly: (message: string) => Logger;\r\n}\r\n\r\n@injectable()\r\nexport abstract class BaseLogger implements Logger {\r\n public abstract log(level: LogLevel, message: string): Logger;\r\n\r\n public error(message: string): Logger {\r\n return this.log('error', message);\r\n }\r\n\r\n public warn(message: string): Logger {\r\n return this.log('warn', message);\r\n }\r\n\r\n public info(message: string): Logger {\r\n return this.log('info', message);\r\n }\r\n\r\n public verbose(message: string): Logger {\r\n return this.log('verbose', message);\r\n }\r\n\r\n public debug(message: string): Logger {\r\n return this.log('debug', message);\r\n }\r\n\r\n public silly(message: string): Logger {\r\n return this.log('silly', message);\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { injectable } from 'inversify';
|
|
2
|
+
import type { LogLevel } from './LogLevel';
|
|
3
|
+
|
|
4
|
+
export interface Logger {
|
|
5
|
+
log: (level: LogLevel, message: string) => Logger;
|
|
6
|
+
error: (message: string) => Logger;
|
|
7
|
+
warn: (message: string) => Logger;
|
|
8
|
+
info: (message: string) => Logger;
|
|
9
|
+
verbose: (message: string) => Logger;
|
|
10
|
+
debug: (message: string) => Logger;
|
|
11
|
+
silly: (message: string) => Logger;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@injectable()
|
|
15
|
+
export abstract class BaseLogger implements Logger {
|
|
16
|
+
public abstract log(level: LogLevel, message: string): Logger;
|
|
17
|
+
|
|
18
|
+
public error(message: string): Logger {
|
|
19
|
+
return this.log('error', message);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public warn(message: string): Logger {
|
|
23
|
+
return this.log('warn', message);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
public info(message: string): Logger {
|
|
27
|
+
return this.log('info', message);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
public verbose(message: string): Logger {
|
|
31
|
+
return this.log('verbose', message);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
public debug(message: string): Logger {
|
|
35
|
+
return this.log('debug', message);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
public silly(message: string): Logger {
|
|
39
|
+
return this.log('silly', message);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.VoidLogger = void 0;
|
|
13
|
+
const inversify_1 = require("inversify");
|
|
14
|
+
const Logger_1 = require("./Logger");
|
|
15
|
+
let VoidLogger = class VoidLogger extends Logger_1.BaseLogger {
|
|
16
|
+
constructor() {
|
|
17
|
+
super();
|
|
18
|
+
}
|
|
19
|
+
log(level, message) {
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
VoidLogger = __decorate([
|
|
24
|
+
(0, inversify_1.injectable)(),
|
|
25
|
+
__metadata("design:paramtypes", [])
|
|
26
|
+
], VoidLogger);
|
|
27
|
+
exports.VoidLogger = VoidLogger;
|
|
28
|
+
//# sourceMappingURL=VoidLogger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoidLogger.js","sourceRoot":"","sources":["VoidLogger.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAuC;AAEvC,qCAAsC;AAI/B,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,mBAAU;IACxC;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAEM,GAAG,CAAC,KAAe,EAAE,OAAe;QACzC,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAA;AARY,UAAU;IADtB,IAAA,sBAAU,GAAE;;GACA,UAAU,CAQtB;AARY,gCAAU","sourcesContent":["import { injectable } from 'inversify';\r\nimport type { Logger } from './Logger';\r\nimport { BaseLogger } from './Logger';\r\nimport type { LogLevel } from './LogLevel';\r\n\r\n@injectable()\r\nexport class VoidLogger extends BaseLogger {\r\n public constructor() {\r\n super();\r\n }\r\n\r\n public log(level: LogLevel, message: string): Logger {\r\n return this;\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { injectable } from 'inversify';
|
|
2
|
+
import type { Logger } from './Logger';
|
|
3
|
+
import { BaseLogger } from './Logger';
|
|
4
|
+
import type { LogLevel } from './LogLevel';
|
|
5
|
+
|
|
6
|
+
@injectable()
|
|
7
|
+
export class VoidLogger extends BaseLogger {
|
|
8
|
+
public constructor() {
|
|
9
|
+
super();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public log(level: LogLevel, message: string): Logger {
|
|
13
|
+
return this;
|
|
14
|
+
}
|
|
15
|
+
}
|