@oslo-flanders/core 0.0.3-alpha.0 → 0.0.5-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 -75
- package/index.d.ts +21 -17
- package/index.js +37 -33
- package/lib/ServiceIdentifier.d.ts +7 -7
- package/lib/ServiceIdentifier.js +14 -14
- package/lib/enums/PropertyTypes.d.ts +5 -5
- package/lib/enums/PropertyTypes.js +9 -9
- package/lib/enums/Scope.d.ts +6 -6
- package/lib/enums/Scope.js +10 -10
- package/lib/interfaces/AppRunner.d.ts +19 -15
- package/lib/interfaces/AppRunner.js +26 -14
- package/lib/interfaces/IConfiguration.d.ts +7 -7
- package/lib/interfaces/IConfiguration.js +2 -2
- package/lib/interfaces/IOutputHandler.d.ts +7 -7
- package/lib/interfaces/IOutputHandler.js +2 -2
- package/lib/interfaces/IService.d.ts +11 -0
- package/lib/interfaces/{IConversionService.js → IService.js} +3 -3
- package/lib/logging/LogLevel.d.ts +5 -5
- package/lib/logging/LogLevel.js +4 -4
- package/lib/logging/LogUtil.d.ts +4 -0
- package/lib/logging/LogUtil.js +17 -0
- package/lib/logging/Logger.d.ts +20 -19
- package/lib/logging/Logger.js +35 -34
- package/lib/logging/LoggerFactory.d.ts +11 -0
- package/lib/{interfaces/IGenerationService.js → logging/LoggerFactory.js} +3 -3
- package/lib/logging/VoidLogger.d.ts +7 -7
- package/lib/logging/VoidLogger.js +27 -27
- package/lib/logging/VoidLoggerFactory.d.ts +9 -0
- package/lib/logging/VoidLoggerFactory.js +17 -0
- package/lib/logging/WinstonLogger.d.ts +8 -7
- package/lib/logging/WinstonLogger.js +30 -38
- package/lib/logging/WinstonLoggerFactory.d.ts +10 -0
- package/lib/logging/WinstonLoggerFactory.js +24 -0
- package/lib/store/QuadStore.d.ts +165 -0
- package/lib/store/QuadStore.js +306 -0
- package/lib/utils/fetchFileOrUrl.d.ts +2 -2
- package/lib/utils/fetchFileOrUrl.js +22 -22
- package/lib/utils/namespaces.d.ts +24 -24
- package/lib/utils/namespaces.js +35 -35
- package/lib/utils/uniqueId.d.ts +1 -1
- package/lib/utils/uniqueId.js +13 -13
- package/package.json +11 -4
- package/lib/interfaces/IConversionService.d.ts +0 -10
- package/lib/interfaces/IGenerationService.d.ts +0 -8
- package/lib/utils/N3StoreFunctions.d.ts +0 -136
- package/lib/utils/N3StoreFunctions.js +0 -257
package/README.md
CHANGED
|
@@ -1,75 +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
|
-
```
|
|
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.d.ts
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import 'reflect-metadata';
|
|
2
|
-
|
|
3
|
-
export * from '
|
|
4
|
-
export * from '
|
|
5
|
-
export * from '
|
|
6
|
-
export * from '
|
|
7
|
-
export * from '
|
|
8
|
-
export * from '
|
|
9
|
-
export * from '
|
|
10
|
-
export * from '
|
|
11
|
-
export * from '
|
|
12
|
-
export * from '
|
|
13
|
-
export * from '
|
|
14
|
-
export * from '
|
|
15
|
-
export * from '
|
|
16
|
-
export * from '
|
|
17
|
-
export * from '
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import 'module-alias/register';
|
|
3
|
+
export * from '@oslo-core/interfaces/AppRunner';
|
|
4
|
+
export * from '@oslo-core/interfaces/IConfiguration';
|
|
5
|
+
export * from '@oslo-core/interfaces/IOutputHandler';
|
|
6
|
+
export * from '@oslo-core/interfaces/IService';
|
|
7
|
+
export * from '@oslo-core/utils/fetchFileOrUrl';
|
|
8
|
+
export * from '@oslo-core/utils/namespaces';
|
|
9
|
+
export * from '@oslo-core/utils/uniqueId';
|
|
10
|
+
export * from '@oslo-core/store/QuadStore';
|
|
11
|
+
export * from '@oslo-core/ServiceIdentifier';
|
|
12
|
+
export * from '@oslo-core/enums/Scope';
|
|
13
|
+
export * from '@oslo-core/enums/PropertyTypes';
|
|
14
|
+
export * from '@oslo-core/logging/LogLevel';
|
|
15
|
+
export * from '@oslo-core/logging/Logger';
|
|
16
|
+
export * from '@oslo-core/logging/VoidLogger';
|
|
17
|
+
export * from '@oslo-core/logging/WinstonLogger';
|
|
18
|
+
export * from '@oslo-core/logging/LogUtil';
|
|
19
|
+
export * from '@oslo-core/logging/LoggerFactory';
|
|
20
|
+
export * from '@oslo-core/logging/VoidLoggerFactory';
|
|
21
|
+
export * from '@oslo-core/logging/WinstonLoggerFactory';
|
package/index.js
CHANGED
|
@@ -1,34 +1,38 @@
|
|
|
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
|
-
|
|
19
|
-
__exportStar(require("
|
|
20
|
-
__exportStar(require("
|
|
21
|
-
__exportStar(require("
|
|
22
|
-
__exportStar(require("
|
|
23
|
-
__exportStar(require("
|
|
24
|
-
__exportStar(require("
|
|
25
|
-
__exportStar(require("
|
|
26
|
-
__exportStar(require("
|
|
27
|
-
__exportStar(require("
|
|
28
|
-
__exportStar(require("
|
|
29
|
-
__exportStar(require("
|
|
30
|
-
__exportStar(require("
|
|
31
|
-
__exportStar(require("
|
|
32
|
-
__exportStar(require("
|
|
33
|
-
__exportStar(require("
|
|
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
|
+
require("module-alias/register");
|
|
19
|
+
__exportStar(require("@oslo-core/interfaces/AppRunner"), exports);
|
|
20
|
+
__exportStar(require("@oslo-core/interfaces/IConfiguration"), exports);
|
|
21
|
+
__exportStar(require("@oslo-core/interfaces/IOutputHandler"), exports);
|
|
22
|
+
__exportStar(require("@oslo-core/interfaces/IService"), exports);
|
|
23
|
+
__exportStar(require("@oslo-core/utils/fetchFileOrUrl"), exports);
|
|
24
|
+
__exportStar(require("@oslo-core/utils/namespaces"), exports);
|
|
25
|
+
__exportStar(require("@oslo-core/utils/uniqueId"), exports);
|
|
26
|
+
__exportStar(require("@oslo-core/store/QuadStore"), exports);
|
|
27
|
+
__exportStar(require("@oslo-core/ServiceIdentifier"), exports);
|
|
28
|
+
__exportStar(require("@oslo-core/enums/Scope"), exports);
|
|
29
|
+
__exportStar(require("@oslo-core/enums/PropertyTypes"), exports);
|
|
30
|
+
__exportStar(require("@oslo-core/logging/LogLevel"), exports);
|
|
31
|
+
__exportStar(require("@oslo-core/logging/Logger"), exports);
|
|
32
|
+
__exportStar(require("@oslo-core/logging/VoidLogger"), exports);
|
|
33
|
+
__exportStar(require("@oslo-core/logging/WinstonLogger"), exports);
|
|
34
|
+
__exportStar(require("@oslo-core/logging/LogUtil"), exports);
|
|
35
|
+
__exportStar(require("@oslo-core/logging/LoggerFactory"), exports);
|
|
36
|
+
__exportStar(require("@oslo-core/logging/VoidLoggerFactory"), exports);
|
|
37
|
+
__exportStar(require("@oslo-core/logging/WinstonLoggerFactory"), exports);
|
|
34
38
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare class ServiceIdentifier {
|
|
2
|
-
static readonly
|
|
3
|
-
static readonly
|
|
4
|
-
static readonly
|
|
5
|
-
static readonly
|
|
6
|
-
static readonly
|
|
7
|
-
}
|
|
1
|
+
export declare class ServiceIdentifier {
|
|
2
|
+
static readonly Service: unique symbol;
|
|
3
|
+
static readonly Configuration: unique symbol;
|
|
4
|
+
static readonly OutputHandler: unique symbol;
|
|
5
|
+
static readonly Logger: unique symbol;
|
|
6
|
+
static readonly QuadStore: unique symbol;
|
|
7
|
+
}
|
package/lib/ServiceIdentifier.js
CHANGED
|
@@ -1,15 +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.
|
|
11
|
-
ServiceIdentifier.
|
|
12
|
-
ServiceIdentifier.
|
|
13
|
-
ServiceIdentifier.
|
|
14
|
-
ServiceIdentifier.
|
|
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.Service = Symbol.for('Service');
|
|
11
|
+
ServiceIdentifier.Configuration = Symbol.for('Configuration');
|
|
12
|
+
ServiceIdentifier.OutputHandler = Symbol.for('OutputHandler');
|
|
13
|
+
ServiceIdentifier.Logger = Symbol.for('Logger');
|
|
14
|
+
ServiceIdentifier.QuadStore = Symbol.for('QuadStore');
|
|
15
15
|
//# sourceMappingURL=ServiceIdentifier.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare enum PropertyType {
|
|
2
|
-
DataTypeProperty = "http://www.w3.org/2002/07/owl#DatatypeProperty",
|
|
3
|
-
ObjectProperty = "http://www.w3.org/2002/07/owl#ObjectProperty",
|
|
4
|
-
Property = "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"
|
|
5
|
-
}
|
|
1
|
+
export declare enum PropertyType {
|
|
2
|
+
DataTypeProperty = "http://www.w3.org/2002/07/owl#DatatypeProperty",
|
|
3
|
+
ObjectProperty = "http://www.w3.org/2002/07/owl#ObjectProperty",
|
|
4
|
+
Property = "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"
|
|
5
|
+
}
|
|
@@ -1,10 +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 = {}));
|
|
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
10
|
//# sourceMappingURL=PropertyTypes.js.map
|
package/lib/enums/Scope.d.ts
CHANGED
|
@@ -1,6 +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
|
-
}
|
|
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
|
+
}
|
package/lib/enums/Scope.js
CHANGED
|
@@ -1,11 +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 = {}));
|
|
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
11
|
//# sourceMappingURL=Scope.js.map
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type { Container } from 'inversify';
|
|
3
|
+
import type { IConfiguration } from '@oslo-core/interfaces/IConfiguration';
|
|
4
|
+
import type { IService } from '@oslo-core/interfaces/IService';
|
|
5
|
+
export type CliArgv = string[];
|
|
6
|
+
export type YargsParams = {
|
|
7
|
+
[x: string]: unknown;
|
|
8
|
+
_: (string | number)[];
|
|
9
|
+
$0: string;
|
|
10
|
+
} | {
|
|
11
|
+
[x: string]: unknown;
|
|
12
|
+
_: (string | number)[];
|
|
13
|
+
$0: string;
|
|
14
|
+
};
|
|
15
|
+
export declare abstract class AppRunner<T extends IService, K extends IConfiguration> {
|
|
16
|
+
runCliSync(process: NodeJS.Process): void;
|
|
17
|
+
abstract runCli(argv: CliArgv): Promise<void>;
|
|
18
|
+
startApp(params: YargsParams, container: Container): Promise<void>;
|
|
19
|
+
}
|
|
@@ -1,15 +1,27 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AppRunner = void 0;
|
|
4
|
-
const process_1 = require("process");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppRunner = void 0;
|
|
4
|
+
const process_1 = require("process");
|
|
5
|
+
const LogUtil_1 = require("@oslo-core/logging/LogUtil");
|
|
6
|
+
const ServiceIdentifier_1 = require("@oslo-core/ServiceIdentifier");
|
|
7
|
+
class AppRunner {
|
|
8
|
+
runCliSync(process) {
|
|
9
|
+
this.runCli(process.argv).catch((error) => {
|
|
10
|
+
process_1.stderr.write(error.message);
|
|
11
|
+
// eslint-disable-next-line unicorn/no-process-exit
|
|
12
|
+
process.exit(1);
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
async startApp(params, container) {
|
|
16
|
+
const configuration = container.get(ServiceIdentifier_1.ServiceIdentifier.Configuration);
|
|
17
|
+
await configuration.createFromCli(params);
|
|
18
|
+
(0, LogUtil_1.setLoggerFactory)(params);
|
|
19
|
+
container.bind(ServiceIdentifier_1.ServiceIdentifier.Logger).toDynamicValue(() => (0, LogUtil_1.createLogger)()).inSingletonScope();
|
|
20
|
+
const service = container.get(ServiceIdentifier_1.ServiceIdentifier.Service);
|
|
21
|
+
service.init()
|
|
22
|
+
.then(() => service.run())
|
|
23
|
+
.catch(error => console.error(error));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.AppRunner = AppRunner;
|
|
15
27
|
//# sourceMappingURL=AppRunner.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { YargsParams } from '
|
|
2
|
-
/**
|
|
3
|
-
* Interface that must be implemented by classes that contain configuration properties
|
|
4
|
-
*/
|
|
5
|
-
export interface IConfiguration {
|
|
6
|
-
createFromCli: (params: YargsParams) => Promise<void>;
|
|
7
|
-
}
|
|
1
|
+
import type { YargsParams } from '@oslo-core/interfaces/AppRunner';
|
|
2
|
+
/**
|
|
3
|
+
* Interface that must be implemented by classes that contain configuration properties
|
|
4
|
+
*/
|
|
5
|
+
export interface IConfiguration {
|
|
6
|
+
createFromCli: (params: YargsParams) => Promise<void>;
|
|
7
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=IConfiguration.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
/**
|
|
3
|
-
* Writes the triples in an RDF store to a write stream
|
|
4
|
-
*/
|
|
5
|
-
export interface IOutputHandler {
|
|
6
|
-
write: (store:
|
|
7
|
-
}
|
|
1
|
+
import type { QuadStore } from '@oslo-core/store/QuadStore';
|
|
2
|
+
/**
|
|
3
|
+
* Writes the triples in an RDF store to a write stream
|
|
4
|
+
*/
|
|
5
|
+
export interface IOutputHandler {
|
|
6
|
+
write: (store: QuadStore, writeStream: any) => Promise<void>;
|
|
7
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=IOutputHandler.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IConfiguration } from '@oslo-core/interfaces/IConfiguration';
|
|
2
|
+
import type { Logger } from '@oslo-core/logging/Logger';
|
|
3
|
+
/**
|
|
4
|
+
* Interface that must be implemented by conversion of generation services
|
|
5
|
+
*/
|
|
6
|
+
export interface IService {
|
|
7
|
+
logger: Logger;
|
|
8
|
+
configuration: IConfiguration;
|
|
9
|
+
init: () => Promise<void>;
|
|
10
|
+
run: () => Promise<void>;
|
|
11
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
//# sourceMappingURL=
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
//# sourceMappingURL=IService.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const LOG_LEVELS: readonly ["error", "warn", "info", "verbose", "debug", "silly"];
|
|
2
|
-
/**
|
|
3
|
-
* Different log levels, from most important to least important.
|
|
4
|
-
*/
|
|
5
|
-
export
|
|
1
|
+
export declare const LOG_LEVELS: readonly ["error", "warn", "info", "verbose", "debug", "silly"];
|
|
2
|
+
/**
|
|
3
|
+
* Different log levels, from most important to least important.
|
|
4
|
+
*/
|
|
5
|
+
export type LogLevel = typeof LOG_LEVELS[number];
|
package/lib/logging/LogLevel.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LOG_LEVELS = void 0;
|
|
4
|
-
exports.LOG_LEVELS = ['error', 'warn', 'info', 'verbose', 'debug', 'silly'];
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LOG_LEVELS = void 0;
|
|
4
|
+
exports.LOG_LEVELS = ['error', 'warn', 'info', 'verbose', 'debug', 'silly'];
|
|
5
5
|
//# sourceMappingURL=LogLevel.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setLoggerFactory = exports.createLogger = void 0;
|
|
4
|
+
const VoidLoggerFactory_1 = require("@oslo-core/logging/VoidLoggerFactory");
|
|
5
|
+
const WinstonLoggerFactory_1 = require("@oslo-core/logging/WinstonLoggerFactory");
|
|
6
|
+
let loggerFactory = new VoidLoggerFactory_1.VoidLoggerFactory();
|
|
7
|
+
function createLogger() {
|
|
8
|
+
return loggerFactory.createLogger();
|
|
9
|
+
}
|
|
10
|
+
exports.createLogger = createLogger;
|
|
11
|
+
function setLoggerFactory(params) {
|
|
12
|
+
if (!params.silent) {
|
|
13
|
+
loggerFactory = new WinstonLoggerFactory_1.WinstonLoggerFactory(params.logLevel);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.setLoggerFactory = setLoggerFactory;
|
|
17
|
+
//# sourceMappingURL=LogUtil.js.map
|
package/lib/logging/Logger.d.ts
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import type { LogLevel } from '@oslo-core/logging/LogLevel';
|
|
3
|
+
export interface Logger {
|
|
4
|
+
log: (level: LogLevel, message: string) => Logger;
|
|
5
|
+
error: (message: string) => Logger;
|
|
6
|
+
warn: (message: string) => Logger;
|
|
7
|
+
info: (message: string) => Logger;
|
|
8
|
+
verbose: (message: string) => Logger;
|
|
9
|
+
debug: (message: string) => Logger;
|
|
10
|
+
silly: (message: string) => Logger;
|
|
11
|
+
}
|
|
12
|
+
export declare abstract class BaseLogger implements Logger {
|
|
13
|
+
abstract log(level: LogLevel, message: string): Logger;
|
|
14
|
+
error(message: string): Logger;
|
|
15
|
+
warn(message: string): Logger;
|
|
16
|
+
info(message: string): Logger;
|
|
17
|
+
verbose(message: string): Logger;
|
|
18
|
+
debug(message: string): Logger;
|
|
19
|
+
silly(message: string): Logger;
|
|
20
|
+
}
|