@oslo-flanders/core 0.0.4-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.
Files changed (42) hide show
  1. package/README.md +75 -75
  2. package/index.d.ts +21 -20
  3. package/index.js +37 -36
  4. package/lib/ServiceIdentifier.d.ts +7 -7
  5. package/lib/ServiceIdentifier.js +14 -14
  6. package/lib/enums/PropertyTypes.d.ts +5 -5
  7. package/lib/enums/PropertyTypes.js +9 -9
  8. package/lib/enums/Scope.d.ts +6 -6
  9. package/lib/enums/Scope.js +10 -10
  10. package/lib/interfaces/AppRunner.d.ts +19 -19
  11. package/lib/interfaces/AppRunner.js +26 -26
  12. package/lib/interfaces/IConfiguration.d.ts +7 -7
  13. package/lib/interfaces/IConfiguration.js +2 -2
  14. package/lib/interfaces/IOutputHandler.d.ts +7 -7
  15. package/lib/interfaces/IOutputHandler.js +2 -2
  16. package/lib/interfaces/IService.d.ts +11 -11
  17. package/lib/interfaces/IService.js +2 -2
  18. package/lib/logging/LogLevel.d.ts +5 -5
  19. package/lib/logging/LogLevel.js +4 -4
  20. package/lib/logging/LogUtil.d.ts +4 -4
  21. package/lib/logging/LogUtil.js +16 -16
  22. package/lib/logging/Logger.d.ts +20 -20
  23. package/lib/logging/Logger.js +35 -35
  24. package/lib/logging/LoggerFactory.d.ts +11 -11
  25. package/lib/logging/LoggerFactory.js +2 -2
  26. package/lib/logging/VoidLogger.d.ts +7 -7
  27. package/lib/logging/VoidLogger.js +27 -27
  28. package/lib/logging/VoidLoggerFactory.d.ts +9 -9
  29. package/lib/logging/VoidLoggerFactory.js +16 -16
  30. package/lib/logging/WinstonLogger.d.ts +8 -8
  31. package/lib/logging/WinstonLogger.js +30 -30
  32. package/lib/logging/WinstonLoggerFactory.d.ts +10 -10
  33. package/lib/logging/WinstonLoggerFactory.js +23 -23
  34. package/lib/store/QuadStore.d.ts +165 -180
  35. package/lib/store/QuadStore.js +305 -329
  36. package/lib/utils/fetchFileOrUrl.d.ts +2 -2
  37. package/lib/utils/fetchFileOrUrl.js +22 -22
  38. package/lib/utils/namespaces.d.ts +24 -24
  39. package/lib/utils/namespaces.js +35 -35
  40. package/lib/utils/uniqueId.d.ts +1 -1
  41. package/lib/utils/uniqueId.js +13 -13
  42. package/package.json +8 -3
@@ -1,2 +1,2 @@
1
- /// <reference types="node" />
2
- export declare function fetchFileOrUrl(file: string): Promise<Buffer>;
1
+ /// <reference types="node" />
2
+ export declare function fetchFileOrUrl(file: string): Promise<Buffer>;
@@ -1,23 +1,23 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.fetchFileOrUrl = void 0;
7
- const fs_1 = require("fs");
8
- const promises_1 = require("fs/promises");
9
- const node_fetch_1 = __importDefault(require("node-fetch"));
10
- async function fetchFileOrUrl(file) {
11
- if (file.startsWith('http://') || file.startsWith('https://')) {
12
- return (await (0, node_fetch_1.default)(file)).buffer();
13
- }
14
- if (file.startsWith('file://')) {
15
- file = file.slice(7);
16
- }
17
- if (!(0, fs_1.existsSync)(file) || !(await (0, promises_1.stat)(file)).isFile()) {
18
- throw new Error(`Path does not refer to a valid file: ${file}`);
19
- }
20
- return (0, promises_1.readFile)(file);
21
- }
22
- exports.fetchFileOrUrl = fetchFileOrUrl;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.fetchFileOrUrl = void 0;
7
+ const fs_1 = require("fs");
8
+ const promises_1 = require("fs/promises");
9
+ const node_fetch_1 = __importDefault(require("node-fetch"));
10
+ async function fetchFileOrUrl(file) {
11
+ if (file.startsWith('http://') || file.startsWith('https://')) {
12
+ return (await (0, node_fetch_1.default)(file)).buffer();
13
+ }
14
+ if (file.startsWith('file://')) {
15
+ file = file.slice(7);
16
+ }
17
+ if (!(0, fs_1.existsSync)(file) || !(await (0, promises_1.stat)(file)).isFile()) {
18
+ throw new Error(`Path does not refer to a valid file: ${file}`);
19
+ }
20
+ return (0, promises_1.readFile)(file);
21
+ }
22
+ exports.fetchFileOrUrl = fetchFileOrUrl;
23
23
  //# sourceMappingURL=fetchFileOrUrl.js.map
@@ -1,24 +1,24 @@
1
- declare enum Prefixes {
2
- example = "http://example.org/",
3
- adms = "http://www.w3.org/ns/adms#",
4
- dcat = "http://www.w3.org/ns/dcat#",
5
- dcterms = "http://purl.org/dc/terms/",
6
- foaf = "http://xmlns.com/foaf/0.1/",
7
- owl = "http://www.w3.org/2002/07/owl#",
8
- vlaanderen = "https://data.vlaanderen.be/ns/",
9
- void = "http://rdfs.org/ns/void#",
10
- rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
11
- rdfs = "http://www.w3.org/2000/01/rdf-schema#",
12
- qb = "http://purl.org/linked-data/cube#",
13
- skos = "http://www.w3.org/2004/02/skos/core#",
14
- xsd = "http://www.w3.org/2001/XMLSchema#",
15
- person = "http://www.w3.org/ns/person#",
16
- vann = "http://purl.org/vocab/vann/",
17
- shacl = "http://w3.org/ns/shacl#",
18
- prov = "http://www.w3.org/ns/prov#"
19
- }
20
- export declare type Namespace = {
21
- [T in keyof typeof Prefixes]: Function;
22
- };
23
- export declare const ns: Namespace;
24
- export {};
1
+ declare enum Prefixes {
2
+ adms = "http://www.w3.org/ns/adms#",
3
+ dcat = "http://www.w3.org/ns/dcat#",
4
+ dcterms = "http://purl.org/dc/terms/",
5
+ foaf = "http://xmlns.com/foaf/0.1/",
6
+ owl = "http://www.w3.org/2002/07/owl#",
7
+ vlaanderen = "https://data.vlaanderen.be/ns/",
8
+ void = "http://rdfs.org/ns/void#",
9
+ rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
10
+ rdfs = "http://www.w3.org/2000/01/rdf-schema#",
11
+ qb = "http://purl.org/linked-data/cube#",
12
+ skos = "http://www.w3.org/2004/02/skos/core#",
13
+ xsd = "http://www.w3.org/2001/XMLSchema#",
14
+ person = "http://www.w3.org/ns/person#",
15
+ vann = "http://purl.org/vocab/vann/",
16
+ shacl = "http://w3.org/ns/shacl#",
17
+ prov = "http://www.w3.org/ns/prov#",
18
+ oslo = "https://implementatie.data.vlaanderen.be/ns/oslo-toolchain#"
19
+ }
20
+ export type Namespace = {
21
+ [T in keyof typeof Prefixes]: Function;
22
+ };
23
+ export declare const ns: Namespace;
24
+ export {};
@@ -1,36 +1,36 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ns = void 0;
4
- const rdf_data_factory_1 = require("rdf-data-factory");
5
- const factory = new rdf_data_factory_1.DataFactory();
6
- // TODO: remove example.org from prefixes
7
- var Prefixes;
8
- (function (Prefixes) {
9
- Prefixes["example"] = "http://example.org/";
10
- Prefixes["adms"] = "http://www.w3.org/ns/adms#";
11
- Prefixes["dcat"] = "http://www.w3.org/ns/dcat#";
12
- Prefixes["dcterms"] = "http://purl.org/dc/terms/";
13
- Prefixes["foaf"] = "http://xmlns.com/foaf/0.1/";
14
- Prefixes["owl"] = "http://www.w3.org/2002/07/owl#";
15
- Prefixes["vlaanderen"] = "https://data.vlaanderen.be/ns/";
16
- Prefixes["void"] = "http://rdfs.org/ns/void#";
17
- Prefixes["rdf"] = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
18
- Prefixes["rdfs"] = "http://www.w3.org/2000/01/rdf-schema#";
19
- Prefixes["qb"] = "http://purl.org/linked-data/cube#";
20
- Prefixes["skos"] = "http://www.w3.org/2004/02/skos/core#";
21
- Prefixes["xsd"] = "http://www.w3.org/2001/XMLSchema#";
22
- Prefixes["person"] = "http://www.w3.org/ns/person#";
23
- Prefixes["vann"] = "http://purl.org/vocab/vann/";
24
- Prefixes["shacl"] = "http://w3.org/ns/shacl#";
25
- Prefixes["prov"] = "http://www.w3.org/ns/prov#";
26
- })(Prefixes || (Prefixes = {}));
27
- const vocab = () => {
28
- const namespaces = {};
29
- for (const prefix in Prefixes) {
30
- const expansion = Prefixes[prefix];
31
- namespaces[prefix] = (localName = '') => factory.namedNode(expansion + localName);
32
- }
33
- return namespaces;
34
- };
35
- exports.ns = vocab();
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ns = void 0;
4
+ const rdf_data_factory_1 = require("rdf-data-factory");
5
+ const factory = new rdf_data_factory_1.DataFactory();
6
+ // TODO: remove example.org from prefixes
7
+ var Prefixes;
8
+ (function (Prefixes) {
9
+ Prefixes["adms"] = "http://www.w3.org/ns/adms#";
10
+ Prefixes["dcat"] = "http://www.w3.org/ns/dcat#";
11
+ Prefixes["dcterms"] = "http://purl.org/dc/terms/";
12
+ Prefixes["foaf"] = "http://xmlns.com/foaf/0.1/";
13
+ Prefixes["owl"] = "http://www.w3.org/2002/07/owl#";
14
+ Prefixes["vlaanderen"] = "https://data.vlaanderen.be/ns/";
15
+ Prefixes["void"] = "http://rdfs.org/ns/void#";
16
+ Prefixes["rdf"] = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
17
+ Prefixes["rdfs"] = "http://www.w3.org/2000/01/rdf-schema#";
18
+ Prefixes["qb"] = "http://purl.org/linked-data/cube#";
19
+ Prefixes["skos"] = "http://www.w3.org/2004/02/skos/core#";
20
+ Prefixes["xsd"] = "http://www.w3.org/2001/XMLSchema#";
21
+ Prefixes["person"] = "http://www.w3.org/ns/person#";
22
+ Prefixes["vann"] = "http://purl.org/vocab/vann/";
23
+ Prefixes["shacl"] = "http://w3.org/ns/shacl#";
24
+ Prefixes["prov"] = "http://www.w3.org/ns/prov#";
25
+ Prefixes["oslo"] = "https://implementatie.data.vlaanderen.be/ns/oslo-toolchain#";
26
+ })(Prefixes || (Prefixes = {}));
27
+ const vocab = () => {
28
+ const namespaces = {};
29
+ for (const prefix in Prefixes) {
30
+ const expansion = Prefixes[prefix];
31
+ namespaces[prefix] = (localName = '') => factory.namedNode(expansion + localName);
32
+ }
33
+ return namespaces;
34
+ };
35
+ exports.ns = vocab();
36
36
  //# sourceMappingURL=namespaces.js.map
@@ -1 +1 @@
1
- export declare function uniqueId(guid: string, label: string, id: number): string;
1
+ export declare function uniqueId(guid: string, label: string, id: number): string;
@@ -1,14 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.uniqueId = void 0;
4
- const crypto_js_1 = require("crypto-js");
5
- function uniqueId(guid, label, id) {
6
- const object = {
7
- guid,
8
- label,
9
- id,
10
- };
11
- return (0, crypto_js_1.SHA256)(JSON.stringify(object)).toString();
12
- }
13
- exports.uniqueId = uniqueId;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.uniqueId = void 0;
4
+ const crypto_js_1 = require("crypto-js");
5
+ function uniqueId(guid, label, id) {
6
+ const object = {
7
+ guid,
8
+ label,
9
+ id,
10
+ };
11
+ return (0, crypto_js_1.SHA256)(JSON.stringify(object)).toString();
12
+ }
13
+ exports.uniqueId = uniqueId;
14
14
  //# sourceMappingURL=uniqueId.js.map
package/package.json CHANGED
@@ -1,11 +1,14 @@
1
1
  {
2
2
  "name": "@oslo-flanders/core",
3
- "version": "0.0.4-alpha.0",
3
+ "version": "0.0.5-alpha.0",
4
4
  "description": "Core interfaces and utilities",
5
5
  "author": "Digitaal Vlaanderen <https://data.vlaanderen.be/id/organisatie/OVO002949>",
6
6
  "homepage": "https://github.com/informatievlaanderen/OSLO-UML-Transformer/tree/main/packages/oslo-core#readme",
7
7
  "license": "MIT",
8
8
  "main": "index.js",
9
+ "_moduleAliases": {
10
+ "@oslo-core": "./lib"
11
+ },
9
12
  "directories": {
10
13
  "lib": "lib"
11
14
  },
@@ -63,9 +66,11 @@
63
66
  "devDependencies": {
64
67
  "@rdfjs/types": "^1.1.0",
65
68
  "@types/crypto-js": "^4.1.1",
69
+ "@types/n3": "^1.10.4",
66
70
  "@types/node-fetch": "^2.6.2",
67
71
  "@types/streamify-string": "^1.0.0",
68
- "@types/tmp": "^0.2.3"
72
+ "@types/tmp": "^0.2.3",
73
+ "module-alias": "^2.2.3"
69
74
  },
70
- "gitHead": "f749c71908781f533e0e35f0e3394ce43a8dd7c0"
75
+ "gitHead": "d6d439321b37ffa74063682fcd8a90d1b7ca12ed"
71
76
  }