@_linked/server 2.23.0 → 2.24.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/.changeset/config.json +1 -1
- package/CHANGELOG.md +32 -0
- package/lib/esm/backend.d.ts +1 -2
- package/lib/esm/backend.js +0 -7
- package/lib/esm/backend.js.map +1 -1
- package/lib/esm/ontologies/server.d.ts +24 -24
- package/lib/esm/package.d.ts +1 -1
- package/lib/esm/shapes/LincdAPI.d.ts +3 -23
- package/lib/esm/shapes/LincdAPI.js +1 -50
- package/lib/esm/shapes/LincdAPI.js.map +1 -1
- package/lib/esm/shapes/LincdWebApp.d.ts +1 -1
- package/lib/esm/shapes/LinkedServer.d.ts +6 -3
- package/lib/esm/shapes/LinkedServer.js +5 -6
- package/lib/esm/shapes/LinkedServer.js.map +1 -1
- package/lib/esm/utils/resizedImagesPurpose.d.ts +1 -1
- package/package.json +5 -6
- package/readme.md +1 -1
- package/lib/esm/utils/Shapes.d.ts +0 -7
- package/lib/esm/utils/Shapes.js +0 -68
- package/lib/esm/utils/Shapes.js.map +0 -1
|
@@ -30,4 +30,4 @@ export declare const resizedImagesPurpose = "resizedImages";
|
|
|
30
30
|
* request handler surfaces as a hung request rather than an error. Registering
|
|
31
31
|
* on the way past is idempotent and removes the ordering rule entirely.
|
|
32
32
|
*/
|
|
33
|
-
export declare function getResizedImagesStore(): import("@_linked/core/interfaces/IFileStore").IFileStore;
|
|
33
|
+
export declare function getResizedImagesStore(): import("@_linked/core/interfaces/IFileStore.js").IFileStore;
|
package/package.json
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "git+https://github.com/linked-fw/server.git"
|
|
12
12
|
},
|
|
13
|
-
"version": "2.
|
|
14
|
-
"packageManager": "npm@11.
|
|
13
|
+
"version": "2.24.0",
|
|
14
|
+
"packageManager": "npm@11.21.0",
|
|
15
15
|
"linkedPackage": true,
|
|
16
16
|
"type": "module",
|
|
17
17
|
"main": "lib/esm/index.js",
|
|
@@ -37,14 +37,13 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@_linked/cli": "^1.2",
|
|
39
39
|
"@_linked/core": "^2.22.8",
|
|
40
|
-
"@_linked/server-utils": "^1.
|
|
40
|
+
"@_linked/server-utils": "^1.12.0",
|
|
41
41
|
"autoprefixer": "^10.4.18",
|
|
42
42
|
"compression": "^1.7.4",
|
|
43
43
|
"cors": "^2.8.5",
|
|
44
44
|
"cron": "^4.3.4",
|
|
45
45
|
"express": "^4.18.3",
|
|
46
46
|
"fetch-cookie": "^3.1.0",
|
|
47
|
-
"n3": "^1.17.2",
|
|
48
47
|
"node-addon-api": "^8.2.2",
|
|
49
48
|
"open": "^8.4.0",
|
|
50
49
|
"proper-lockfile": "^4.1.2",
|
|
@@ -65,12 +64,12 @@
|
|
|
65
64
|
"@changesets/changelog-github": "^1.0.0",
|
|
66
65
|
"@changesets/cli": "^3.0.0",
|
|
67
66
|
"@jest/globals": "^30.0.0",
|
|
68
|
-
"@types/jest": "^
|
|
67
|
+
"@types/jest": "^30.0.0",
|
|
69
68
|
"@types/node": "^24.0.0",
|
|
70
69
|
"@types/react-dom": "^19.3.0",
|
|
71
70
|
"copyfiles": "^2.4.1",
|
|
72
71
|
"cross-env": "^7.0.3",
|
|
73
|
-
"jest": "^
|
|
72
|
+
"jest": "^30.0.0",
|
|
74
73
|
"prettier": "3.9.9",
|
|
75
74
|
"ts-jest": "^29.4.12",
|
|
76
75
|
"typescript-plugin-css-modules": "^5.1.0"
|
package/readme.md
CHANGED
|
@@ -442,7 +442,7 @@ LinkedFileStorage.setDefaultStore(store);
|
|
|
442
442
|
is the server's own upload folder — that is the only folder the server serves.
|
|
443
443
|
|
|
444
444
|
Registering stores per purpose (`LinkedFileStorage.setStore`, `getStore`, `registerPurpose`) is core's concern — see
|
|
445
|
-
[`@_linked/core`](https://github.com/linked-
|
|
445
|
+
[`@_linked/core`](https://github.com/linked-fw/core), `utils/LinkedFileStorage` and `interfaces/IFileStore`. This
|
|
446
446
|
package declares one purpose of its own, for the image resize cache — see [Resizing images](#resizing-images).
|
|
447
447
|
|
|
448
448
|
#### Saving files
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export type { ShapeDetails, PropertyDetails } from '@_linked/server-utils/types/ShapeDetails';
|
|
2
|
-
export { getShapeFromIndex, getShapeIndex } from '@_linked/server-utils/utils/ShapeIndex';
|
|
3
|
-
/**
|
|
4
|
-
* Build the shape index from locally-registered NodeShape instances.
|
|
5
|
-
* Backend-only — populates the shared shapeIndex from @_linked/server-utils.
|
|
6
|
-
*/
|
|
7
|
-
export declare function indexShapesIntoMemory(): Promise<void>;
|
package/lib/esm/utils/Shapes.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shape metadata index builder (backend-only).
|
|
3
|
-
*
|
|
4
|
-
* Types and read-only access (ShapeDetails, PropertyDetails, getShapeIndex)
|
|
5
|
-
* are in @_linked/server-utils. This module provides indexShapesIntoMemory()
|
|
6
|
-
* which populates the shared in-memory index at startup. (Distinct from core's
|
|
7
|
-
* `syncShapes`, which materializes shapes into the RDF store as SHACL.)
|
|
8
|
-
*/
|
|
9
|
-
import { getNodeShapeUri } from '@_linked/core/shapes/SHACL';
|
|
10
|
-
import { getAllShapeClasses } from '@_linked/core/utils/ShapeClass';
|
|
11
|
-
import { shapeIndex } from '@_linked/server-utils/utils/ShapeIndex';
|
|
12
|
-
export { getShapeFromIndex, getShapeIndex } from '@_linked/server-utils/utils/ShapeIndex';
|
|
13
|
-
/**
|
|
14
|
-
* Helper: convert a PathExpr to `{id: string}` or `{id: string}[]` for the shape index.
|
|
15
|
-
*/
|
|
16
|
-
function pathToIndexValue(path) {
|
|
17
|
-
if (typeof path === 'string') {
|
|
18
|
-
return { id: path };
|
|
19
|
-
}
|
|
20
|
-
if (path && 'id' in path) {
|
|
21
|
-
return { id: path.id };
|
|
22
|
-
}
|
|
23
|
-
// Complex path (seq, alt, inv, etc.) — omit for now
|
|
24
|
-
return { id: '' };
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Build the shape index from locally-registered NodeShape instances.
|
|
28
|
-
* Backend-only — populates the shared shapeIndex from @_linked/server-utils.
|
|
29
|
-
*/
|
|
30
|
-
export async function indexShapesIntoMemory() {
|
|
31
|
-
var _a, _b;
|
|
32
|
-
const allShapeClasses = getAllShapeClasses();
|
|
33
|
-
for (let [_uri, shapeClass] of allShapeClasses) {
|
|
34
|
-
const localShape = shapeClass.shape;
|
|
35
|
-
if (!localShape)
|
|
36
|
-
continue;
|
|
37
|
-
shapeIndex[localShape.id] = {
|
|
38
|
-
id: localShape.id,
|
|
39
|
-
label: localShape.label,
|
|
40
|
-
description: localShape.description,
|
|
41
|
-
extends: localShape.extends ? { id: localShape.extends.id } : undefined,
|
|
42
|
-
targetClass: localShape.targetClass
|
|
43
|
-
? { id: localShape.targetClass.id }
|
|
44
|
-
: undefined,
|
|
45
|
-
// Two core generations are in play. Older core (the range this package
|
|
46
|
-
// declares) exposes a `NodeShape.properties` getter over a private
|
|
47
|
-
// `propertyShapes`; newer core stores metadata as a plain object with a
|
|
48
|
-
// public `propertyShapes` and dropped the getter. Reading only
|
|
49
|
-
// `.properties` therefore yielded undefined against newer core and threw
|
|
50
|
-
// on `.map`, aborting the loop before the first shape was indexed and
|
|
51
|
-
// leaving the whole index empty. Accept either shape.
|
|
52
|
-
properties: ((_b = (_a = localShape.properties) !== null && _a !== void 0 ? _a : localShape.propertyShapes) !== null && _b !== void 0 ? _b : []).map((p) => ({
|
|
53
|
-
id: p.id,
|
|
54
|
-
label: p.label,
|
|
55
|
-
path: pathToIndexValue(p.path),
|
|
56
|
-
valueShape: p.valueShape ? { id: p.valueShape.id } : undefined,
|
|
57
|
-
datatype: p.datatype ? { id: p.datatype.id } : undefined,
|
|
58
|
-
description: p.description,
|
|
59
|
-
maxCount: p.maxCount,
|
|
60
|
-
minCount: p.minCount,
|
|
61
|
-
nodeKind: p.nodeKind ? { id: p.nodeKind.id } : undefined,
|
|
62
|
-
name: p.name,
|
|
63
|
-
})),
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
delete shapeIndex[getNodeShapeUri('lincd', 'shape')];
|
|
67
|
-
}
|
|
68
|
-
//# sourceMappingURL=Shapes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Shapes.js","sourceRoot":"","sources":["../../../src/utils/Shapes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGpE,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAIpE,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAE1F;;GAEG;AACH,SAAS,gBAAgB,CAAC,IAAc;IACtC,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;IACtB,CAAC;IACD,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;QACzB,OAAO,EAAE,EAAE,EAAG,IAAuB,CAAC,EAAE,EAAE,CAAC;IAC7C,CAAC;IACD,oDAAoD;IACpD,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;AACpB,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB;;IACzC,MAAM,eAAe,GAAG,kBAAkB,EAAE,CAAC;IAE7C,KAAK,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,eAAe,EAAE,CAAC;QAC/C,MAAM,UAAU,GAAI,UAAkB,CAAC,KAAsB,CAAC;QAC9D,IAAI,CAAC,UAAU;YAAE,SAAS;QAC1B,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC,GAAG;YAC1B,EAA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AQ,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS;gBACxD,IAAI,EAAE,CAAC,CAAC,IAAI;aACb,CAAC,CAAC;SACmB,CAAC;IAC3B,CAAC;IAED,OAAO,UAAU,CAAC,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AACvD,CAAC","sourcesContent":["/**\n * Shape metadata index builder (backend-only).\n *\n * Types and read-only access (ShapeDetails, PropertyDetails, getShapeIndex)\n * are in @_linked/server-utils. This module provides indexShapesIntoMemory()\n * which populates the shared in-memory index at startup. (Distinct from core's\n * `syncShapes`, which materializes shapes into the RDF store as SHACL.)\n */\nimport { getNodeShapeUri } from '@_linked/core/shapes/SHACL';\nimport type { NodeShapeData } from '@_linked/core/shapes/nodeShapeData';\nimport { getAllShapeClasses } from '@_linked/core/utils/ShapeClass';\nimport type { PathExpr } from '@_linked/core/paths/PropertyPathExpr';\nimport type { ShapeDetails } from '@_linked/server-utils/types/ShapeDetails';\nimport { shapeIndex } from '@_linked/server-utils/utils/ShapeIndex';\n\n// Re-export for backward compatibility\nexport type { ShapeDetails, PropertyDetails } from '@_linked/server-utils/types/ShapeDetails';\nexport { getShapeFromIndex, getShapeIndex } from '@_linked/server-utils/utils/ShapeIndex';\n\n/**\n * Helper: convert a PathExpr to `{id: string}` or `{id: string}[]` for the shape index.\n */\nfunction pathToIndexValue(path: PathExpr): { id: string } | { id: string }[] {\n if (typeof path === 'string') {\n return { id: path };\n }\n if (path && 'id' in path) {\n return { id: (path as { id: string }).id };\n }\n // Complex path (seq, alt, inv, etc.) — omit for now\n return { id: '' };\n}\n\n/**\n * Build the shape index from locally-registered NodeShape instances.\n * Backend-only — populates the shared shapeIndex from @_linked/server-utils.\n */\nexport async function indexShapesIntoMemory() {\n const allShapeClasses = getAllShapeClasses();\n\n for (let [_uri, shapeClass] of allShapeClasses) {\n const localShape = (shapeClass as any).shape as NodeShapeData;\n if (!localShape) continue;\n shapeIndex[localShape.id] = {\n id: localShape.id,\n label: localShape.label,\n description: localShape.description,\n extends: localShape.extends ? { id: localShape.extends.id } : undefined,\n targetClass: localShape.targetClass\n ? { id: localShape.targetClass.id }\n : undefined,\n // Two core generations are in play. Older core (the range this package\n // declares) exposes a `NodeShape.properties` getter over a private\n // `propertyShapes`; newer core stores metadata as a plain object with a\n // public `propertyShapes` and dropped the getter. Reading only\n // `.properties` therefore yielded undefined against newer core and threw\n // on `.map`, aborting the loop before the first shape was indexed and\n // leaving the whole index empty. Accept either shape.\n properties: ((localShape as any).properties ??\n (localShape as any).propertyShapes ??\n []\n ).map((p) => ({\n id: p.id,\n label: p.label,\n path: pathToIndexValue(p.path),\n valueShape: p.valueShape ? { id: p.valueShape.id } : undefined,\n datatype: p.datatype ? { id: p.datatype.id } : undefined,\n description: p.description,\n maxCount: p.maxCount,\n minCount: p.minCount,\n nodeKind: p.nodeKind ? { id: p.nodeKind.id } : undefined,\n name: p.name,\n })),\n } as any as ShapeDetails;\n }\n\n delete shapeIndex[getNodeShapeUri('lincd', 'shape')];\n}\n"]}
|