@oslo-flanders/core 0.0.4-alpha.0 → 0.0.6-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.
Files changed (45) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +75 -75
  3. package/index.d.ts +22 -20
  4. package/index.js +38 -36
  5. package/lib/ServiceIdentifier.d.ts +7 -7
  6. package/lib/ServiceIdentifier.js +14 -14
  7. package/lib/enums/PropertyTypes.d.ts +5 -5
  8. package/lib/enums/PropertyTypes.js +9 -9
  9. package/lib/enums/Scope.d.ts +6 -6
  10. package/lib/enums/Scope.js +10 -10
  11. package/lib/interfaces/AppRunner.d.ts +19 -19
  12. package/lib/interfaces/AppRunner.js +26 -26
  13. package/lib/interfaces/IConfiguration.d.ts +7 -7
  14. package/lib/interfaces/IConfiguration.js +2 -2
  15. package/lib/interfaces/IOutputHandler.d.ts +7 -7
  16. package/lib/interfaces/IOutputHandler.js +2 -2
  17. package/lib/interfaces/IService.d.ts +11 -11
  18. package/lib/interfaces/IService.js +2 -2
  19. package/lib/logging/LogLevel.d.ts +5 -5
  20. package/lib/logging/LogLevel.js +4 -4
  21. package/lib/logging/LogUtil.d.ts +4 -4
  22. package/lib/logging/LogUtil.js +16 -16
  23. package/lib/logging/Logger.d.ts +20 -20
  24. package/lib/logging/Logger.js +35 -35
  25. package/lib/logging/LoggerFactory.d.ts +11 -11
  26. package/lib/logging/LoggerFactory.js +2 -2
  27. package/lib/logging/VoidLogger.d.ts +7 -7
  28. package/lib/logging/VoidLogger.js +27 -27
  29. package/lib/logging/VoidLoggerFactory.d.ts +9 -9
  30. package/lib/logging/VoidLoggerFactory.js +16 -16
  31. package/lib/logging/WinstonLogger.d.ts +8 -8
  32. package/lib/logging/WinstonLogger.js +30 -30
  33. package/lib/logging/WinstonLoggerFactory.d.ts +10 -10
  34. package/lib/logging/WinstonLoggerFactory.js +23 -23
  35. package/lib/store/QuadStore.d.ts +165 -180
  36. package/lib/store/QuadStore.js +305 -329
  37. package/lib/utils/fetchFileOrUrl.d.ts +2 -2
  38. package/lib/utils/fetchFileOrUrl.js +22 -22
  39. package/lib/utils/namespaces.d.ts +24 -24
  40. package/lib/utils/namespaces.js +34 -35
  41. package/lib/utils/storeUtils.d.ts +8 -0
  42. package/lib/utils/storeUtils.js +85 -0
  43. package/lib/utils/uniqueId.d.ts +1 -1
  44. package/lib/utils/uniqueId.js +13 -13
  45. package/package.json +11 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Digitaal Vlaanderen
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
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,20 +1,22 @@
1
- import 'reflect-metadata';
2
- export * from './lib/interfaces/AppRunner';
3
- export * from './lib/interfaces/IConfiguration';
4
- export * from './lib/interfaces/IOutputHandler';
5
- export * from './lib/interfaces/IService';
6
- export * from './lib/utils/fetchFileOrUrl';
7
- export * from './lib/utils/namespaces';
8
- export * from './lib/utils/uniqueId';
9
- export * from './lib/store/QuadStore';
10
- export * from './lib/ServiceIdentifier';
11
- export * from './lib/enums/Scope';
12
- export * from './lib/enums/PropertyTypes';
13
- export * from './lib/logging/LogLevel';
14
- export * from './lib/logging/Logger';
15
- export * from './lib/logging/VoidLogger';
16
- export * from './lib/logging/WinstonLogger';
17
- export * from './lib/logging/LogUtil';
18
- export * from './lib/logging/LoggerFactory';
19
- export * from './lib/logging/VoidLoggerFactory';
20
- export * from './lib/logging/WinstonLoggerFactory';
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';
22
+ export * from '@oslo-core/utils/storeUtils';
package/index.js CHANGED
@@ -1,37 +1,39 @@
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/IOutputHandler"), exports);
21
- __exportStar(require("./lib/interfaces/IService"), exports);
22
- __exportStar(require("./lib/utils/fetchFileOrUrl"), exports);
23
- __exportStar(require("./lib/utils/namespaces"), exports);
24
- __exportStar(require("./lib/utils/uniqueId"), exports);
25
- __exportStar(require("./lib/store/QuadStore"), exports);
26
- __exportStar(require("./lib/ServiceIdentifier"), exports);
27
- __exportStar(require("./lib/enums/Scope"), exports);
28
- __exportStar(require("./lib/enums/PropertyTypes"), exports);
29
- __exportStar(require("./lib/logging/LogLevel"), exports);
30
- __exportStar(require("./lib/logging/Logger"), exports);
31
- __exportStar(require("./lib/logging/VoidLogger"), exports);
32
- __exportStar(require("./lib/logging/WinstonLogger"), exports);
33
- __exportStar(require("./lib/logging/LogUtil"), exports);
34
- __exportStar(require("./lib/logging/LoggerFactory"), exports);
35
- __exportStar(require("./lib/logging/VoidLoggerFactory"), exports);
36
- __exportStar(require("./lib/logging/WinstonLoggerFactory"), exports);
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);
38
+ __exportStar(require("@oslo-core/utils/storeUtils"), exports);
37
39
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,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
- }
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
+ }
@@ -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.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');
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
@@ -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
+ }
@@ -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,19 +1,19 @@
1
- /// <reference types="node" />
2
- import type { Container } from 'inversify';
3
- import type { IConfiguration } from './IConfiguration';
4
- import type { IService } from './IService';
5
- export declare type CliArgv = string[];
6
- export declare 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
+ /// <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,27 +1,27 @@
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("../logging/LogUtil");
6
- const ServiceIdentifier_1 = require("../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;
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;
27
27
  //# sourceMappingURL=AppRunner.js.map
@@ -1,7 +1,7 @@
1
- import type { YargsParams } from './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
+ 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 { QuadStore } from '../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
+ 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
@@ -1,11 +1,11 @@
1
- import type { Logger } from '../logging/Logger';
2
- import type { IConfiguration } from './IConfiguration';
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
+ 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 });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
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 declare type LogLevel = typeof LOG_LEVELS[number];
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];
@@ -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
@@ -1,4 +1,4 @@
1
- import type { YargsParams } from '../interfaces/AppRunner';
2
- import type { Logger } from './Logger';
3
- export declare function createLogger(): Logger;
4
- export declare function setLoggerFactory(params: YargsParams): void;
1
+ import type { YargsParams } from '@oslo-core/interfaces/AppRunner';
2
+ import type { Logger } from '@oslo-core/logging/Logger';
3
+ export declare function createLogger(): Logger;
4
+ export declare function setLoggerFactory(params: YargsParams): void;