@_linked/server 3.11.0 → 3.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/LICENSE +21 -0
- package/lib/esm/shapes/LinkedServer.d.ts +6 -0
- package/lib/esm/shapes/LinkedServer.js +16 -4
- package/lib/esm/shapes/LinkedServer.js.map +1 -1
- package/lib/esm/utils/effectiveRoutes.d.ts +8 -7
- package/lib/esm/utils/effectiveRoutes.js +2 -2
- package/lib/esm/utils/effectiveRoutes.js.map +1 -1
- package/lib/esm/utils/graphTargets.d.ts +33 -11
- package/lib/esm/utils/graphTargets.js +93 -33
- package/lib/esm/utils/graphTargets.js.map +1 -1
- package/lib/esm/utils/ontologySync.js +1 -1
- package/lib/esm/utils/ontologySync.js.map +1 -1
- package/lib/esm/utils/syncShapes.d.ts +3 -3
- package/lib/esm/utils/syncShapes.js +1 -1
- package/lib/esm/utils/syncShapes.js.map +1 -1
- package/package.json +5 -4
- package/readme.md +26 -18
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @\_linked/server
|
|
2
2
|
|
|
3
|
+
## 3.12.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#214](https://github.com/linked-fw/server/pull/214) [`654a3c2`](https://github.com/linked-fw/server/commit/654a3c2941ef49e317dd2ba58324f0221e894ca3) Thanks [@flyon](https://github.com/flyon)! - License: MIT (data under its original license)
|
|
8
|
+
|
|
9
|
+
## 3.12.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#212](https://github.com/linked-fw/server/pull/212) [`2ac07c4`](https://github.com/linked-fw/server/commit/2ac07c49918f31d94bcec03821a0ab29b1811f85) Thanks [@flyon](https://github.com/flyon)! - The graph targets are one global setting (`@_linked/core` 2.42). At boot the server reads `LINKED_ONTOLOGY_GRAPH` / `LINKED_SHAPE_GRAPH` (an invalid value is still a fatal boot error) and calls core's `setGraphTargets` once, before the boot initialises the stores and before the syncs; it no longer sets targets on each store. `GET /admin/routes` reports the setting as `graphTargets` (`{ontologyGraph, shapeGraph}`) next to `graphTargetEnv`; the per-dataset `ontologyGraph` / `shapeGraph` fields are gone. New boot warning: when routing pins `NodeShape` / `PropertyShape` or the ontology term shapes (`rdfs:Class`, `owl:Class`, `rdf:Property`, `owl:ObjectProperty`, `owl:DatatypeProperty`, `owl:AnnotationProperty`) to a dataset other than the default one, the server names them and the dataset and says the syncs write into the default dataset only. `applyGraphTargetsFromEnv(env)` takes no stores any more. Requires `@_linked/core` 2.42.0.
|
|
14
|
+
|
|
3
15
|
## 3.11.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Semantu
|
|
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.
|
|
@@ -133,6 +133,12 @@ export declare class LinkedServer extends Shape {
|
|
|
133
133
|
private syncRegisteredShapes;
|
|
134
134
|
/** The root directory of a package with shapes: the app, a discovered linked package, or one the app resolves. */
|
|
135
135
|
private shapePackageDir;
|
|
136
|
+
/**
|
|
137
|
+
* Boot: one warning when routing pins the shape shapes or the ontology term shapes to a dataset
|
|
138
|
+
* other than the default one, since the syncs write into the default dataset only (see
|
|
139
|
+
* {@link syncPinWarning}).
|
|
140
|
+
*/
|
|
141
|
+
private warnOfSyncPins;
|
|
136
142
|
/**
|
|
137
143
|
* Boot: sync the registered ontologies into their graphs in app data and run the shape
|
|
138
144
|
* check, before the shape sync (see utils/ontologySync). The sync follows the shape sync's
|
|
@@ -139,7 +139,7 @@ import { resolveRouteAssets } from '../utils/routeAssets.js';
|
|
|
139
139
|
import { resolveRouteComponent, ssrCssInlineUrls, ssrCssScope, } from '../utils/ssrCss.js';
|
|
140
140
|
import { appShapesGraph, bootOrphanScope, loadShapeGraphCore, syncShapeGraphsInto, viteShapesTurtleGenerator, } from '../utils/syncShapes.js';
|
|
141
141
|
import { bootSyncsOntologies, loadOntologyCore, runOntologyPhase, ontologyPackageDirs, sourceModuleImporter, shapeSyncOn, syncOntologiesThenShapes, } from '../utils/ontologySync.js';
|
|
142
|
-
import { applyGraphTargetsFromEnv } from '../utils/graphTargets.js';
|
|
142
|
+
import { applyGraphTargetsFromEnv, syncPinWarning } from '../utils/graphTargets.js';
|
|
143
143
|
import { AdminRequestError, assertReloadablePackages, registerAdminRoutes, resolveAdminSecret, } from '../utils/adminChannel.js';
|
|
144
144
|
import { envMs, withTimeout } from '../utils/withTimeout.js';
|
|
145
145
|
import { invalidateSourceUnder } from '../utils/reloadSource.js';
|
|
@@ -364,6 +364,7 @@ let LinkedServer = class LinkedServer extends Shape {
|
|
|
364
364
|
this.initPackage();
|
|
365
365
|
this.server = express();
|
|
366
366
|
await this.initBackendProviders();
|
|
367
|
+
this.warnOfSyncPins();
|
|
367
368
|
await this.syncOntologiesOnBoot();
|
|
368
369
|
await this.materializeShapesIntoStore();
|
|
369
370
|
return this;
|
|
@@ -437,6 +438,16 @@ let LinkedServer = class LinkedServer extends Shape {
|
|
|
437
438
|
const installed = readInstalledPackage(name, process.cwd());
|
|
438
439
|
return installed === null || installed === void 0 ? void 0 : installed.root;
|
|
439
440
|
}
|
|
441
|
+
/**
|
|
442
|
+
* Boot: one warning when routing pins the shape shapes or the ontology term shapes to a dataset
|
|
443
|
+
* other than the default one, since the syncs write into the default dataset only (see
|
|
444
|
+
* {@link syncPinWarning}).
|
|
445
|
+
*/
|
|
446
|
+
warnOfSyncPins() {
|
|
447
|
+
const warning = syncPinWarning();
|
|
448
|
+
if (warning)
|
|
449
|
+
console.warn(warning);
|
|
450
|
+
}
|
|
440
451
|
/**
|
|
441
452
|
* Boot: sync the registered ontologies into their graphs in app data and run the shape
|
|
442
453
|
* check, before the shape sync (see utils/ontologySync). The sync follows the shape sync's
|
|
@@ -684,6 +695,7 @@ let LinkedServer = class LinkedServer extends Shape {
|
|
|
684
695
|
// });
|
|
685
696
|
// before controllers
|
|
686
697
|
await this.initBackendProviders();
|
|
698
|
+
this.warnOfSyncPins();
|
|
687
699
|
await this.syncOntologiesOnBoot();
|
|
688
700
|
await this.materializeShapesIntoStore();
|
|
689
701
|
//START OF EXPRESS ROUTES AND MIDDLEWARE
|
|
@@ -808,11 +820,11 @@ let LinkedServer = class LinkedServer extends Shape {
|
|
|
808
820
|
*/
|
|
809
821
|
async initStores() {
|
|
810
822
|
var _a;
|
|
811
|
-
// LINKED_ONTOLOGY_GRAPH / LINKED_SHAPE_GRAPH: checked (an invalid value stops the boot) and
|
|
812
|
-
//
|
|
823
|
+
// LINKED_ONTOLOGY_GRAPH / LINKED_SHAPE_GRAPH: checked (an invalid value stops the boot) and set
|
|
824
|
+
// once as core's global graph targets, before any store is initialised and before the syncs.
|
|
813
825
|
// A rejected boot does not end the process by itself, so the error is fatal.
|
|
814
826
|
try {
|
|
815
|
-
applyGraphTargetsFromEnv(process.env
|
|
827
|
+
applyGraphTargetsFromEnv(process.env);
|
|
816
828
|
}
|
|
817
829
|
catch (err) {
|
|
818
830
|
throw new FatalStartupError(`[LinkedServer] ${(_a = err === null || err === void 0 ? void 0 : err.message) !== null && _a !== void 0 ? _a : err}`, { cause: err });
|