@_linked/server 2.19.0 → 2.20.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/CHANGELOG.md +10 -0
- package/lib/esm/data/{lincd-server.json → server.json} +9 -9
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/ontologies/lincd-server.d.ts +4 -47
- package/lib/esm/ontologies/lincd-server.js +4 -55
- package/lib/esm/ontologies/lincd-server.js.map +1 -1
- package/lib/esm/ontologies/lincd-server.register.d.ts +5 -1
- package/lib/esm/ontologies/lincd-server.register.js +3 -14
- package/lib/esm/ontologies/lincd-server.register.js.map +1 -1
- package/lib/esm/ontologies/server.d.ts +66 -0
- package/lib/esm/ontologies/server.js +63 -0
- package/lib/esm/ontologies/server.js.map +1 -0
- package/lib/esm/ontologies/server.register.d.ts +1 -0
- package/lib/esm/ontologies/server.register.js +24 -0
- package/lib/esm/ontologies/server.register.js.map +1 -0
- package/lib/esm/shapes/LincdAPI.js +2 -2
- package/lib/esm/shapes/LincdAPI.js.map +1 -1
- package/lib/esm/shapes/LincdWebApp.js +3 -3
- package/lib/esm/shapes/LincdWebApp.js.map +1 -1
- package/lib/esm/shapes/LinkedServer.js +2 -2
- package/lib/esm/shapes/LinkedServer.js.map +1 -1
- package/lib/esm/shapes/index.d.ts +1 -1
- package/lib/esm/shapes/index.js +1 -1
- package/lib/esm/shapes/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @\_linked/server
|
|
2
2
|
|
|
3
|
+
## 2.20.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#132](https://github.com/linked-fw/server/pull/132) [`6db7feb`](https://github.com/linked-fw/server/commit/6db7feb0d3520f2e91732b094bc8d004056a78a9) Thanks [@flyon](https://github.com/flyon)! - The server ontology's prefix label is now `server`, matching its namespace slug (`https://linked.cm/ont/server/`), so compaction emits `server:LincdAPI` where it used to emit `lincd-server:LincdAPI`. The ontology moves to `ontologies/server` (export `server`) and `ontologies/server.register`, and its data file to `data/server.json`, whose `@context` key and prefixed names now use `server:`. The IRIs themselves are unchanged.
|
|
8
|
+
|
|
9
|
+
Deprecated, still working: the `lincd-server` prefix stays registered as an alias, so `lincd-server:X` names still expand to the same IRIs; `ontologies/lincd-server` re-exports `ontologies/server`, `ontologies/lincd-server.register` registers the ontology, and `lincdServer` is the same object as `server`. Only the published `data/lincd-server.json` path is gone, renamed to `data/server.json`.
|
|
10
|
+
|
|
11
|
+
No IRI changes, so stored data is unaffected; any data written under the older `http://lincd.org/ont/lincd-server/` IRIs is still not migrated (clear dev datasets).
|
|
12
|
+
|
|
3
13
|
## 2.19.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
|
@@ -4,42 +4,42 @@
|
|
|
4
4
|
"owl": "http://www.w3.org/2002/07/owl#",
|
|
5
5
|
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
|
|
6
6
|
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
|
|
7
|
-
"
|
|
7
|
+
"server": "https://linked.cm/ont/server/"
|
|
8
8
|
},
|
|
9
9
|
"@graph": [
|
|
10
10
|
{
|
|
11
|
-
"@id": "
|
|
11
|
+
"@id": "server:LincdServer",
|
|
12
12
|
"@type": "rdfs:Class",
|
|
13
13
|
"rdfs:comment": "A HTTP server for LINCD applications, running on node.js.",
|
|
14
14
|
"rdfs:isDefinedBy": {
|
|
15
|
-
"@id": "
|
|
15
|
+
"@id": "server:"
|
|
16
16
|
},
|
|
17
17
|
"rdfs:label": "LINCD Server"
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
|
-
"@id": "
|
|
20
|
+
"@id": "server:NodeFileStore",
|
|
21
21
|
"@type": "rdfs:Class",
|
|
22
22
|
"rdfs:comment": "Stores quads in a file in JSONLD format. Made for node.js environments.",
|
|
23
23
|
"rdfs:isDefinedBy": {
|
|
24
|
-
"@id": "
|
|
24
|
+
"@id": "server:"
|
|
25
25
|
},
|
|
26
26
|
"rdfs:label": "Node file store"
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
|
-
"@id": "
|
|
29
|
+
"@id": "server:BackendFileStore",
|
|
30
30
|
"@type": "rdfs:Class",
|
|
31
31
|
"rdfs:comment": "A simple quad store for frontends that are served by a LINCD Nodejs Server. Quads get loaded and updated through API calls to the backend. All quads are loaded into local memory in the frontend upon initiation of the app.",
|
|
32
32
|
"rdfs:isDefinedBy": {
|
|
33
|
-
"@id": "
|
|
33
|
+
"@id": "server:"
|
|
34
34
|
},
|
|
35
35
|
"rdfs:label": "Backend file store"
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
|
-
"@id": "
|
|
38
|
+
"@id": "server:BackendStore",
|
|
39
39
|
"@type": "rdfs:Class",
|
|
40
40
|
"rdfs:comment": "A base class for backend quad stores. These are quad stores for frontends that are served by a LINCD Nodejs Server. Quads get loaded and updated through API calls to the backend. All quads are loaded into local memory in the frontend upon initiation of the app.",
|
|
41
41
|
"rdfs:isDefinedBy": {
|
|
42
|
-
"@id": "
|
|
42
|
+
"@id": "server:"
|
|
43
43
|
},
|
|
44
44
|
"rdfs:label": "Backend store"
|
|
45
45
|
}
|
package/lib/esm/index.d.ts
CHANGED
package/lib/esm/index.js
CHANGED
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAC;AACpB,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAC;AACpB,OAAO,iCAAiC,CAAC;AAEzC,cAAc;AACd,OAAO,mBAAmB,CAAC;AAC3B,mFAAmF;AACnF,OAAO,wCAAwC,CAAC;AAChD,OAAO,uCAAuC,CAAC;AAE/C,iBAAiB;AACjB,OAAO,sBAAsB,CAAC;AAE9B,8EAA8E;AAC9E,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC","sourcesContent":["import './types.js';\nimport './ontologies/server.register.js';\n\n//SHAPES FIRST\nimport './shapes/index.js';\n// Not shapes (plain store classes); kept so the entry's module graph is unchanged.\nimport './shapes/quadstores/BackendAPIStore.js';\nimport './shapes/filestores/LocalFileStore.js';\n\n//THEN COMPONENTS\nimport './utils/accessUrl.js';\n\n// The fatal-error contract a provider uses to refuse to let the server start.\nexport { FatalStartupError, isFatalError } from './utils/fatalError.js';\nexport type { FatalError } from './utils/fatalError.js';\n\n//TYPES — re-exported from @_linked/server-utils (canonical location)\nexport type {\n RouteConfig,\n RoutesConfig,\n RoutesModule,\n} from '@_linked/server-utils/types/RouteConfig';\n"]}
|
|
@@ -1,49 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* @deprecated import from `./server.js` instead. This module path is kept so existing
|
|
3
|
+
* `@_linked/server/ontologies/lincd-server` imports keep working; `lincdServer` is
|
|
4
|
+
* re-exported as a deprecated alias of `server`.
|
|
4
5
|
*/
|
|
5
|
-
export
|
|
6
|
-
"@context": {
|
|
7
|
-
dc: string;
|
|
8
|
-
owl: string;
|
|
9
|
-
rdf: string;
|
|
10
|
-
rdfs: string;
|
|
11
|
-
"lincd-server": string;
|
|
12
|
-
};
|
|
13
|
-
"@graph": {
|
|
14
|
-
"@id": string;
|
|
15
|
-
"@type": string;
|
|
16
|
-
"rdfs:comment": string;
|
|
17
|
-
"rdfs:isDefinedBy": {
|
|
18
|
-
"@id": string;
|
|
19
|
-
};
|
|
20
|
-
"rdfs:label": string;
|
|
21
|
-
}[];
|
|
22
|
-
}>;
|
|
23
|
-
/**
|
|
24
|
-
* The namespace of this ontology.
|
|
25
|
-
*
|
|
26
|
-
* First-party ontologies live on linked.cm: `https://linked.cm/ont/{ontologySlug}/`, and a
|
|
27
|
-
* package's own ontology takes the package's publicSlug (`@_linked/server` → `server`), the same
|
|
28
|
-
* slug its shapes use under `https://linked.cm/shape/server/`.
|
|
29
|
-
*
|
|
30
|
-
* Until this release it was `http://lincd.org/ont/lincd-server/`. No stored data is typed with
|
|
31
|
-
* these terms; the only store triples that carried them were the synced shape descriptions of
|
|
32
|
-
* `LinkedServer`, `LincdAPI` and `LincdWebApp` (`sh:targetClass`, `sh:path`), which boot sync
|
|
33
|
-
* rewrites (delete, then recreate) the next time the server starts.
|
|
34
|
-
*/
|
|
35
|
-
export declare var ns: (term: string) => import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
36
|
-
export declare var _self: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
37
|
-
export declare const lincdServer: {
|
|
38
|
-
LincdServer: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
39
|
-
BackendFileStore: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
40
|
-
NodeFileStore: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
41
|
-
BackendStore: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
42
|
-
N3FileStore: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
43
|
-
BackendAPIStore: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
44
|
-
LincdWebApp: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
45
|
-
ownPackage: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
46
|
-
maintainsPackage: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
47
|
-
LincdAPI: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
48
|
-
hasAPI: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
49
|
-
};
|
|
6
|
+
export * from './server.js';
|
|
@@ -1,58 +1,7 @@
|
|
|
1
|
-
import { createNameSpace } from '@_linked/core/utils/NameSpace';
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* @deprecated import from `./server.js` instead. This module path is kept so existing
|
|
3
|
+
* `@_linked/server/ontologies/lincd-server` imports keep working; `lincdServer` is
|
|
4
|
+
* re-exported as a deprecated alias of `server`.
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
7
|
-
//@ts-ignore
|
|
8
|
-
const data = await import('../data/lincd-server.json', {
|
|
9
|
-
with: { type: 'json' },
|
|
10
|
-
});
|
|
11
|
-
return data.default || data;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* The namespace of this ontology.
|
|
15
|
-
*
|
|
16
|
-
* First-party ontologies live on linked.cm: `https://linked.cm/ont/{ontologySlug}/`, and a
|
|
17
|
-
* package's own ontology takes the package's publicSlug (`@_linked/server` → `server`), the same
|
|
18
|
-
* slug its shapes use under `https://linked.cm/shape/server/`.
|
|
19
|
-
*
|
|
20
|
-
* Until this release it was `http://lincd.org/ont/lincd-server/`. No stored data is typed with
|
|
21
|
-
* these terms; the only store triples that carried them were the synced shape descriptions of
|
|
22
|
-
* `LinkedServer`, `LincdAPI` and `LincdWebApp` (`sh:targetClass`, `sh:path`), which boot sync
|
|
23
|
-
* rewrites (delete, then recreate) the next time the server starts.
|
|
24
|
-
*/
|
|
25
|
-
export var ns = createNameSpace('https://linked.cm/ont/server/');
|
|
26
|
-
export var _self = ns('');
|
|
27
|
-
// Terms are properties of the namespace object below, not module-scope
|
|
28
|
-
// exports. Most of these names are also SHAPE CLASS names in this package
|
|
29
|
-
// (BackendAPIStore, LincdWebApp, LincdAPI, ...). Two bindings of the same name
|
|
30
|
-
// in one bundle scope make the bundler rename one of them, and when the loser
|
|
31
|
-
// is the class, `constructor.name` becomes `BackendAPIStore2` -- which is the
|
|
32
|
-
// shape's IRI and the name `Server.call` routes on. The client then asks a
|
|
33
|
-
// backend that has no such shape, and every store round-trip answers 501.
|
|
34
|
-
const LincdServer = ns('LincdServer');
|
|
35
|
-
const BackendFileStore = ns('BackendFileStore');
|
|
36
|
-
const NodeFileStore = ns('NodeFileStore');
|
|
37
|
-
const BackendStore = ns('BackendStore');
|
|
38
|
-
const BackendAPIStore = ns('BackendAPIStore');
|
|
39
|
-
const LincdWebApp = ns('LincdWebApp');
|
|
40
|
-
const ownPackage = ns('ownPackage');
|
|
41
|
-
const maintainsPackage = ns('maintainsPackage');
|
|
42
|
-
const N3FileStore = ns('N3FileStore');
|
|
43
|
-
const LincdAPI = ns('LincdAPI');
|
|
44
|
-
const hasAPI = ns('hasAPI');
|
|
45
|
-
export const lincdServer = {
|
|
46
|
-
LincdServer,
|
|
47
|
-
BackendFileStore,
|
|
48
|
-
NodeFileStore,
|
|
49
|
-
BackendStore,
|
|
50
|
-
N3FileStore,
|
|
51
|
-
BackendAPIStore,
|
|
52
|
-
LincdWebApp,
|
|
53
|
-
ownPackage,
|
|
54
|
-
maintainsPackage,
|
|
55
|
-
LincdAPI,
|
|
56
|
-
hasAPI,
|
|
57
|
-
};
|
|
6
|
+
export * from './server.js';
|
|
58
7
|
//# sourceMappingURL=lincd-server.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lincd-server.js","sourceRoot":"","sources":["../../../src/ontologies/lincd-server.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"lincd-server.js","sourceRoot":"","sources":["../../../src/ontologies/lincd-server.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,aAAa,CAAC","sourcesContent":["/**\n * @deprecated import from `./server.js` instead. This module path is kept so existing\n * `@_linked/server/ontologies/lincd-server` imports keep working; `lincdServer` is\n * re-exported as a deprecated alias of `server`.\n */\nexport * from './server.js';\n"]}
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Kept out of `lincd-server.ts` because registration needs that module's whole export
|
|
5
|
-
* namespace, and a module cannot import itself once a bundler is involved: Rollup
|
|
6
|
-
* treats a static self-reference as a circular import and elides it, so the binding is
|
|
7
|
-
* undefined at runtime and the consuming app dies at boot with `_this is not
|
|
8
|
-
* defined`. `tsc` preserves it, which is why the pattern survived for as long as
|
|
9
|
-
* packages were built with `tsc` alone.
|
|
10
|
-
*
|
|
11
|
-
* From a sibling module the same import is ordinary and survives.
|
|
2
|
+
* @deprecated import `./server.register.js` instead. This module path is kept so existing
|
|
3
|
+
* `@_linked/server/ontologies/lincd-server.register` imports keep registering the ontology.
|
|
12
4
|
*/
|
|
13
|
-
import
|
|
14
|
-
import { loadData, ns } from './lincd-server.js';
|
|
15
|
-
import { linkedOntology } from '../package.js';
|
|
16
|
-
linkedOntology(terms, ns, 'lincd-server', loadData, '../data/lincd-server.json');
|
|
5
|
+
import './server.register.js';
|
|
17
6
|
//# sourceMappingURL=lincd-server.register.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lincd-server.register.js","sourceRoot":"","sources":["../../../src/ontologies/lincd-server.register.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"lincd-server.register.js","sourceRoot":"","sources":["../../../src/ontologies/lincd-server.register.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,sBAAsB,CAAC","sourcesContent":["/**\n * @deprecated import `./server.register.js` instead. This module path is kept so existing\n * `@_linked/server/ontologies/lincd-server.register` imports keep registering the ontology.\n */\nimport './server.register.js';\n"]}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Load the data of this ontology.
|
|
3
|
+
* In @_linked/core, loadData returns the raw JSON import — no JSONLD.parse() needed.
|
|
4
|
+
*/
|
|
5
|
+
export declare var loadData: () => Promise<{
|
|
6
|
+
"@context": {
|
|
7
|
+
dc: string;
|
|
8
|
+
owl: string;
|
|
9
|
+
rdf: string;
|
|
10
|
+
rdfs: string;
|
|
11
|
+
server: string;
|
|
12
|
+
};
|
|
13
|
+
"@graph": {
|
|
14
|
+
"@id": string;
|
|
15
|
+
"@type": string;
|
|
16
|
+
"rdfs:comment": string;
|
|
17
|
+
"rdfs:isDefinedBy": {
|
|
18
|
+
"@id": string;
|
|
19
|
+
};
|
|
20
|
+
"rdfs:label": string;
|
|
21
|
+
}[];
|
|
22
|
+
}>;
|
|
23
|
+
/**
|
|
24
|
+
* The namespace of this ontology.
|
|
25
|
+
*
|
|
26
|
+
* First-party ontologies live on linked.cm: `https://linked.cm/ont/{ontologySlug}/`, and a
|
|
27
|
+
* package's own ontology takes the package's publicSlug (`@_linked/server` → `server`), the same
|
|
28
|
+
* slug its shapes use under `https://linked.cm/shape/server/`.
|
|
29
|
+
*
|
|
30
|
+
* Its prefix label is the same slug, `server` (`server:LincdAPI`). It used to be `lincd-server`,
|
|
31
|
+
* which is still registered as a deprecated alias so `lincd-server:` names keep expanding.
|
|
32
|
+
*
|
|
33
|
+
* Until an earlier release the namespace was `http://lincd.org/ont/lincd-server/`. No stored
|
|
34
|
+
* data is typed with these terms; the only store triples that carried them were the synced shape descriptions of
|
|
35
|
+
* `LinkedServer`, `LincdAPI` and `LincdWebApp` (`sh:targetClass`, `sh:path`), which boot sync
|
|
36
|
+
* rewrites (delete, then recreate) the next time the server starts.
|
|
37
|
+
*/
|
|
38
|
+
export declare var ns: (term: string) => import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
39
|
+
export declare var _self: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
40
|
+
export declare const server: {
|
|
41
|
+
LincdServer: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
42
|
+
BackendFileStore: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
43
|
+
NodeFileStore: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
44
|
+
BackendStore: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
45
|
+
N3FileStore: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
46
|
+
BackendAPIStore: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
47
|
+
LincdWebApp: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
48
|
+
ownPackage: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
49
|
+
maintainsPackage: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
50
|
+
LincdAPI: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
51
|
+
hasAPI: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
52
|
+
};
|
|
53
|
+
/** @deprecated use `server` — same object, kept under its old name. */
|
|
54
|
+
export declare const lincdServer: {
|
|
55
|
+
LincdServer: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
56
|
+
BackendFileStore: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
57
|
+
NodeFileStore: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
58
|
+
BackendStore: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
59
|
+
N3FileStore: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
60
|
+
BackendAPIStore: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
61
|
+
LincdWebApp: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
62
|
+
ownPackage: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
63
|
+
maintainsPackage: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
64
|
+
LincdAPI: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
65
|
+
hasAPI: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
66
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { createNameSpace } from '@_linked/core/utils/NameSpace';
|
|
2
|
+
/**
|
|
3
|
+
* Load the data of this ontology.
|
|
4
|
+
* In @_linked/core, loadData returns the raw JSON import — no JSONLD.parse() needed.
|
|
5
|
+
*/
|
|
6
|
+
export var loadData = async () => {
|
|
7
|
+
//@ts-ignore
|
|
8
|
+
const data = await import('../data/server.json', {
|
|
9
|
+
with: { type: 'json' },
|
|
10
|
+
});
|
|
11
|
+
return data.default || data;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* The namespace of this ontology.
|
|
15
|
+
*
|
|
16
|
+
* First-party ontologies live on linked.cm: `https://linked.cm/ont/{ontologySlug}/`, and a
|
|
17
|
+
* package's own ontology takes the package's publicSlug (`@_linked/server` → `server`), the same
|
|
18
|
+
* slug its shapes use under `https://linked.cm/shape/server/`.
|
|
19
|
+
*
|
|
20
|
+
* Its prefix label is the same slug, `server` (`server:LincdAPI`). It used to be `lincd-server`,
|
|
21
|
+
* which is still registered as a deprecated alias so `lincd-server:` names keep expanding.
|
|
22
|
+
*
|
|
23
|
+
* Until an earlier release the namespace was `http://lincd.org/ont/lincd-server/`. No stored
|
|
24
|
+
* data is typed with these terms; the only store triples that carried them were the synced shape descriptions of
|
|
25
|
+
* `LinkedServer`, `LincdAPI` and `LincdWebApp` (`sh:targetClass`, `sh:path`), which boot sync
|
|
26
|
+
* rewrites (delete, then recreate) the next time the server starts.
|
|
27
|
+
*/
|
|
28
|
+
export var ns = createNameSpace('https://linked.cm/ont/server/');
|
|
29
|
+
export var _self = ns('');
|
|
30
|
+
// Terms are properties of the namespace object below, not module-scope
|
|
31
|
+
// exports. Most of these names are also SHAPE CLASS names in this package
|
|
32
|
+
// (BackendAPIStore, LincdWebApp, LincdAPI, ...). Two bindings of the same name
|
|
33
|
+
// in one bundle scope make the bundler rename one of them, and when the loser
|
|
34
|
+
// is the class, `constructor.name` becomes `BackendAPIStore2` -- which is the
|
|
35
|
+
// shape's IRI and the name `Server.call` routes on. The client then asks a
|
|
36
|
+
// backend that has no such shape, and every store round-trip answers 501.
|
|
37
|
+
const LincdServer = ns('LincdServer');
|
|
38
|
+
const BackendFileStore = ns('BackendFileStore');
|
|
39
|
+
const NodeFileStore = ns('NodeFileStore');
|
|
40
|
+
const BackendStore = ns('BackendStore');
|
|
41
|
+
const BackendAPIStore = ns('BackendAPIStore');
|
|
42
|
+
const LincdWebApp = ns('LincdWebApp');
|
|
43
|
+
const ownPackage = ns('ownPackage');
|
|
44
|
+
const maintainsPackage = ns('maintainsPackage');
|
|
45
|
+
const N3FileStore = ns('N3FileStore');
|
|
46
|
+
const LincdAPI = ns('LincdAPI');
|
|
47
|
+
const hasAPI = ns('hasAPI');
|
|
48
|
+
export const server = {
|
|
49
|
+
LincdServer,
|
|
50
|
+
BackendFileStore,
|
|
51
|
+
NodeFileStore,
|
|
52
|
+
BackendStore,
|
|
53
|
+
N3FileStore,
|
|
54
|
+
BackendAPIStore,
|
|
55
|
+
LincdWebApp,
|
|
56
|
+
ownPackage,
|
|
57
|
+
maintainsPackage,
|
|
58
|
+
LincdAPI,
|
|
59
|
+
hasAPI,
|
|
60
|
+
};
|
|
61
|
+
/** @deprecated use `server` — same object, kept under its old name. */
|
|
62
|
+
export const lincdServer = server;
|
|
63
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../src/ontologies/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE;;;GAGG;AACH,MAAM,CAAC,IAAI,QAAQ,GAAG,KAAK,IAAI,EAAE;IAC/B,YAAY;IACZ,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,qBAAqB,EAAE;QAC/C,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;KACvB,CAAC,CAAC;IACH,OAAO,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC;AAC9B,CAAC,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,IAAI,EAAE,GAAG,eAAe,CAAC,+BAA+B,CAAC,CAAC;AAEjE,MAAM,CAAC,IAAI,KAAK,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;AAE1B,uEAAuE;AACvE,0EAA0E;AAC1E,+EAA+E;AAC/E,8EAA8E;AAC9E,8EAA8E;AAC9E,2EAA2E;AAC3E,0EAA0E;AAC1E,MAAM,WAAW,GAAG,EAAE,CAAC,aAAa,CAAC,CAAC;AACtC,MAAM,gBAAgB,GAAG,EAAE,CAAC,kBAAkB,CAAC,CAAC;AAChD,MAAM,aAAa,GAAG,EAAE,CAAC,eAAe,CAAC,CAAC;AAC1C,MAAM,YAAY,GAAG,EAAE,CAAC,cAAc,CAAC,CAAC;AACxC,MAAM,eAAe,GAAG,EAAE,CAAC,iBAAiB,CAAC,CAAC;AAC9C,MAAM,WAAW,GAAG,EAAE,CAAC,aAAa,CAAC,CAAC;AACtC,MAAM,UAAU,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC;AACpC,MAAM,gBAAgB,GAAG,EAAE,CAAC,kBAAkB,CAAC,CAAC;AAChD,MAAM,WAAW,GAAG,EAAE,CAAC,aAAa,CAAC,CAAC;AACtC,MAAM,QAAQ,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC;AAChC,MAAM,MAAM,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC;AAE5B,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,WAAW;IACX,gBAAgB;IAChB,aAAa;IACb,YAAY;IACZ,WAAW;IACX,eAAe;IACf,WAAW;IACX,UAAU;IACV,gBAAgB;IAChB,QAAQ;IACR,MAAM;CACP,CAAC;AAEF,uEAAuE;AACvE,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC","sourcesContent":["import { createNameSpace } from '@_linked/core/utils/NameSpace';\n\n/**\n * Load the data of this ontology.\n * In @_linked/core, loadData returns the raw JSON import — no JSONLD.parse() needed.\n */\nexport var loadData = async () => {\n //@ts-ignore\n const data = await import('../data/server.json', {\n with: { type: 'json' },\n });\n return data.default || data;\n};\n\n/**\n * The namespace of this ontology.\n *\n * First-party ontologies live on linked.cm: `https://linked.cm/ont/{ontologySlug}/`, and a\n * package's own ontology takes the package's publicSlug (`@_linked/server` → `server`), the same\n * slug its shapes use under `https://linked.cm/shape/server/`.\n *\n * Its prefix label is the same slug, `server` (`server:LincdAPI`). It used to be `lincd-server`,\n * which is still registered as a deprecated alias so `lincd-server:` names keep expanding.\n *\n * Until an earlier release the namespace was `http://lincd.org/ont/lincd-server/`. No stored\n * data is typed with these terms; the only store triples that carried them were the synced shape descriptions of\n * `LinkedServer`, `LincdAPI` and `LincdWebApp` (`sh:targetClass`, `sh:path`), which boot sync\n * rewrites (delete, then recreate) the next time the server starts.\n */\nexport var ns = createNameSpace('https://linked.cm/ont/server/');\n\nexport var _self = ns('');\n\n// Terms are properties of the namespace object below, not module-scope\n// exports. Most of these names are also SHAPE CLASS names in this package\n// (BackendAPIStore, LincdWebApp, LincdAPI, ...). Two bindings of the same name\n// in one bundle scope make the bundler rename one of them, and when the loser\n// is the class, `constructor.name` becomes `BackendAPIStore2` -- which is the\n// shape's IRI and the name `Server.call` routes on. The client then asks a\n// backend that has no such shape, and every store round-trip answers 501.\nconst LincdServer = ns('LincdServer');\nconst BackendFileStore = ns('BackendFileStore');\nconst NodeFileStore = ns('NodeFileStore');\nconst BackendStore = ns('BackendStore');\nconst BackendAPIStore = ns('BackendAPIStore');\nconst LincdWebApp = ns('LincdWebApp');\nconst ownPackage = ns('ownPackage');\nconst maintainsPackage = ns('maintainsPackage');\nconst N3FileStore = ns('N3FileStore');\nconst LincdAPI = ns('LincdAPI');\nconst hasAPI = ns('hasAPI');\n\nexport const server = {\n LincdServer,\n BackendFileStore,\n NodeFileStore,\n BackendStore,\n N3FileStore,\n BackendAPIStore,\n LincdWebApp,\n ownPackage,\n maintainsPackage,\n LincdAPI,\n hasAPI,\n};\n\n/** @deprecated use `server` — same object, kept under its old name. */\nexport const lincdServer = server;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registers this ontology.
|
|
3
|
+
*
|
|
4
|
+
* Kept out of `server.ts` because registration needs that module's whole export
|
|
5
|
+
* namespace, and a module cannot import itself once a bundler is involved: Rollup
|
|
6
|
+
* treats a static self-reference as a circular import and elides it, so the binding is
|
|
7
|
+
* undefined at runtime and the consuming app dies at boot with `_this is not
|
|
8
|
+
* defined`. `tsc` preserves it, which is why the pattern survived for as long as
|
|
9
|
+
* packages were built with `tsc` alone.
|
|
10
|
+
*
|
|
11
|
+
* From a sibling module the same import is ordinary and survives.
|
|
12
|
+
*/
|
|
13
|
+
import * as terms from './server.js';
|
|
14
|
+
import { loadData, ns } from './server.js';
|
|
15
|
+
import { linkedOntology } from '../package.js';
|
|
16
|
+
import { Prefix } from '@_linked/core/utils/Prefix';
|
|
17
|
+
// Deprecated prefix label, kept so `lincd-server:X` names still expand. It is added
|
|
18
|
+
// BEFORE the registration below because Prefix keeps one prefix per namespace and the
|
|
19
|
+
// last add wins: registering `server` second makes compaction emit `server:X`.
|
|
20
|
+
Prefix.add('lincd-server', ns('').id);
|
|
21
|
+
// The prefix is also the key this ontology is registered under in the package tree,
|
|
22
|
+
// and the name of its data file: `server` → `../data/server.json`.
|
|
23
|
+
linkedOntology(terms, ns, 'server', loadData, '../data/server.json');
|
|
24
|
+
//# sourceMappingURL=server.register.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.register.js","sourceRoot":"","sources":["../../../src/ontologies/server.register.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;AACrC,OAAO,EAAC,QAAQ,EAAE,EAAE,EAAC,MAAM,aAAa,CAAC;AACzC,OAAO,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAC,MAAM,EAAC,MAAM,4BAA4B,CAAC;AAElD,oFAAoF;AACpF,sFAAsF;AACtF,+EAA+E;AAC/E,MAAM,CAAC,GAAG,CAAC,cAAc,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;AAEtC,oFAAoF;AACpF,mEAAmE;AACnE,cAAc,CAAC,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["/**\n * Registers this ontology.\n *\n * Kept out of `server.ts` because registration needs that module's whole export\n * namespace, and a module cannot import itself once a bundler is involved: Rollup\n * treats a static self-reference as a circular import and elides it, so the binding is\n * undefined at runtime and the consuming app dies at boot with `_this is not\n * defined`. `tsc` preserves it, which is why the pattern survived for as long as\n * packages were built with `tsc` alone.\n *\n * From a sibling module the same import is ordinary and survives.\n */\nimport * as terms from './server.js';\nimport {loadData, ns} from './server.js';\nimport {linkedOntology} from '../package.js';\nimport {Prefix} from '@_linked/core/utils/Prefix';\n\n// Deprecated prefix label, kept so `lincd-server:X` names still expand. It is added\n// BEFORE the registration below because Prefix keeps one prefix per namespace and the\n// last add wins: registering `server` second makes compaction emit `server:X`.\nPrefix.add('lincd-server', ns('').id);\n\n// The prefix is also the key this ontology is registered under in the package tree,\n// and the name of its data file: `server` → `../data/server.json`.\nlinkedOntology(terms, ns, 'server', loadData, '../data/server.json');\n"]}
|
|
@@ -6,7 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { Shape } from '@_linked/core/shapes/Shape';
|
|
8
8
|
import { linkedShape } from '../package.js';
|
|
9
|
-
import {
|
|
9
|
+
import { server } from '../ontologies/server.js';
|
|
10
10
|
import { JSONParser } from '@_linked/server-utils/utils/JSONParser';
|
|
11
11
|
import { LinkedStorage } from '@_linked/core/utils/LinkedStorage';
|
|
12
12
|
import { JSONWriter } from '@_linked/server-utils/utils/JSONWriter';
|
|
@@ -109,7 +109,7 @@ let LincdAPI = class LincdAPI extends Shape {
|
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
};
|
|
112
|
-
LincdAPI.targetClass =
|
|
112
|
+
LincdAPI.targetClass = server.LincdAPI;
|
|
113
113
|
LincdAPI = __decorate([
|
|
114
114
|
linkedShape({ name: 'LincdAPI' })
|
|
115
115
|
], LincdAPI);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LincdAPI.js","sourceRoot":"","sources":["../../../src/shapes/LincdAPI.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"LincdAPI.js","sourceRoot":"","sources":["../../../src/shapes/LincdAPI.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,aAAa,EAAgB,MAAM,oBAAoB,CAAC;AAGjE,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;AASxE,iGAAiG;AACjG,gGAAgG;AAChG,4EAA4E;AAErE,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,KAAK;IAGjC,KAAK,CAAC,OAAO,CACX,OAAO,EACP,QAAQ,EACR,UAA6C;QAE7C,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;QACxC,MAAM,IAAI,GAAG,UAAU,CAAC,WAAW,CAAM,OAAO,CAAC,IAAI,CAAC,CAAC;QAEvD,kCAAkC;QAClC,IAAI,WAAW,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_linked/core/shapes/Shape';\nimport { linkedShape } from '../package.js';\nimport { server } from '../ontologies/server.js';\nimport { JSONParser } from '@_linked/server-utils/utils/JSONParser';\nimport { LinkedStorage } from '@_linked/core/utils/LinkedStorage';\nimport { JSONWriter } from '@_linked/server-utils/utils/JSONWriter';\nimport { cached } from '@_linked/core/utils/cached';\nimport { getShapeIndex, ShapeDetails } from '../utils/Shapes.js';\nimport { SparqlDataset as SPARQLStore } from '@_linked/core/sparql/SparqlDataset';\n\nconst cacheTime = process.env.NODE_ENV === 'development' ? 0 : Infinity;\nexport type ShapeSummary = {\n id: string;\n label: string;\n description: string;\n target: { id: string };\n extends?: { id: string };\n numInstances: number;\n};\n// Named explicitly: tsc emits `let X = class X`, and any later esbuild pass over that JS (Vite's\n// SSR `define` replacement runs one on every file mentioning a defined `process.env.*`) renames\n// the inner binding to `X2`, which would otherwise become this shape's IRI.\n@linkedShape({name: 'LincdAPI'})\nexport class LincdAPI extends Shape {\n static targetClass = server.LincdAPI;\n\n async process(\n request,\n response,\n httpMethod: 'get' | 'post' | 'put' | 'delete'\n ) {\n let { method, action } = request.params;\n const body = JSONParser.parseObject<any>(request.body);\n\n //replace - with _ in action names\n let localMethod = httpMethod + '_' + method.replace(/-/g, '_');\n if (typeof this[localMethod] !== 'function') {\n throw new Error('Unknown method: ' + localMethod);\n }\n\n //TODO: access rights, check if the current user is allowed to execute this method\n try {\n const result = await this[localMethod](body, request, response);\n if (typeof result !== 'undefined' || !response.headersSent) {\n const jsonObject = JSONWriter.toJsObject(result);\n response.json(jsonObject);\n }\n } catch (error) {\n console.error(`Error while processing ${localMethod}:`, error);\n if (!response.headersSent) {\n const message =\n error instanceof Error ? error.message : 'Unknown server error';\n response.status(500).json({ error: message });\n }\n }\n }\n\n get_shape_details({\n shapes,\n }: {\n shapes: string[];\n }): Record<string, ShapeDetails> {\n return cached(\n () => {\n const shapeIndex = getShapeIndex();\n const filteredShapeIndex = {};\n for (const shapeId of shapes) {\n if (shapeIndex[shapeId]) {\n filteredShapeIndex[shapeId] = shapeIndex[shapeId];\n }\n }\n return filteredShapeIndex;\n },\n [shapes],\n cacheTime\n );\n }\n\n get_all_shapes(): Promise<{\n shapes: Record<string, ShapeDetails>;\n defaultGraph: string;\n }> {\n return cached(\n async () => {\n const shapeIndex = getShapeIndex();\n\n const typesWithInstances = new Map<string, number>();\n this.checkRawQuerySupport();\n await (LinkedStorage.getDefaultDataset() as unknown as SPARQLStore)\n .rawQuery(\n `SELECT (COUNT(?s) AS ?count) ?type WHERE { ?s a ?type } GROUP BY ?type`\n )\n .then((results) => {\n // rawQuery also types ASK results (a boolean envelope); this is a SELECT.\n if (!results || !('results' in results)) return;\n results.results.bindings.forEach((binding) => {\n if (binding.type && binding.type.value) {\n typesWithInstances.set(\n binding.type.value,\n parseInt(binding.count.value)\n );\n }\n });\n })\n .catch(console.error);\n\n const shapesWithInstances: Record<string, ShapeDetails> = {};\n for (const shapeId in shapeIndex) {\n const shape = shapeIndex[shapeId];\n shapesWithInstances[shapeId] = {\n ...shape,\n numInstances: typesWithInstances.get(shape.targetClass?.id) || 0,\n };\n }\n return {\n shapes: shapesWithInstances,\n defaultGraph: process.env.DATA_ROOT,\n };\n },\n [],\n cacheTime\n );\n }\n\n post_select({ query }) {\n return LinkedStorage.selectQuery(query);\n }\n post_create({ query }) {\n return LinkedStorage.createQuery(query);\n }\n post_update({ query }) {\n return LinkedStorage.updateQuery(query);\n }\n post_delete({ query }) {\n return LinkedStorage.deleteQuery(query);\n }\n\n post_select_raw({ query }) {\n this.checkRawQuerySupport();\n return (LinkedStorage.getDefaultDataset() as unknown as SPARQLStore).rawQuery(\n query\n );\n }\n\n private checkRawQuerySupport() {\n if (!(LinkedStorage.getDefaultDataset() as unknown as SPARQLStore).rawQuery) {\n throw new Error(\n `Default store (${\n Object.getPrototypeOf(LinkedStorage.getDefaultDataset()).constructor\n .name\n }) does not support raw SPARQL queries`\n );\n }\n }\n}\n"]}
|
|
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
};
|
|
10
10
|
var LincdWebApp_1;
|
|
11
11
|
import { linkedShape } from '../package.js';
|
|
12
|
-
import {
|
|
12
|
+
import { server } from '../ontologies/server.js';
|
|
13
13
|
import { Shape } from '@_linked/core/shapes/Shape';
|
|
14
14
|
import { objectProperty } from '@_linked/core/shapes/SHACL';
|
|
15
15
|
import { Lincd_API_Client } from '@_linked/server-utils/shapes/Lincd_API_Client';
|
|
@@ -26,10 +26,10 @@ let LincdWebApp = LincdWebApp_1 = class LincdWebApp extends Shape {
|
|
|
26
26
|
return undefined;
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
|
-
LincdWebApp.targetClass =
|
|
29
|
+
LincdWebApp.targetClass = server.LincdWebApp;
|
|
30
30
|
__decorate([
|
|
31
31
|
objectProperty({
|
|
32
|
-
path:
|
|
32
|
+
path: server.hasAPI,
|
|
33
33
|
shape: Lincd_API_Client,
|
|
34
34
|
maxCount: 1,
|
|
35
35
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LincdWebApp.js","sourceRoot":"","sources":["../../../src/shapes/LincdWebApp.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"LincdWebApp.js","sourceRoot":"","sources":["../../../src/shapes/LincdWebApp.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AAEjF,iGAAiG;AACjG,gGAAgG;AAChG,4EAA4E;AAErE,IAAM,WAAW,mBAAjB,MAAM,WAAY,SAAQ,KAAK;IAGpC,MAAM,KAAK,QAAQ;QACjB,OAAO,IAAI,aAAW,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC;IACxD,CAAC;IAED,4EAA4E;IAC5E,8FAA8F;IAE9F,IAKI,GAAG;QACL,OAAO,SAAgB,CAAC;IAC1B,CAAC;;AAhBM,uBAAW,GAAG,MAAM,CAAC,WAAW,AAArB,CAAsB;AASxC;IAAC,cAAc,CAAC;QACd,IAAI,EAAE,MAAM,CAAC,MAAM;QACnB,KAAK,EAAE,gBAAgB;QACvB,QAAQ,EAAE,CAAC;KACZ,CAAC;8BACS,gBAAgB;;sCAE1B;AAjBU,WAAW;IADvB,WAAW,CAAC,EAAC,IAAI,EAAE,aAAa,EAAC,CAAC;GACtB,WAAW,CAkBvB","sourcesContent":["import { linkedShape } from '../package.js';\nimport { server } from '../ontologies/server.js';\nimport { Shape } from '@_linked/core/shapes/Shape';\nimport { objectProperty } from '@_linked/core/shapes/SHACL';\nimport { Lincd_API_Client } from '@_linked/server-utils/shapes/Lincd_API_Client';\n\n// Named explicitly: tsc emits `let X = class X`, and any later esbuild pass over that JS (Vite's\n// SSR `define` replacement runs one on every file mentioning a defined `process.env.*`) renames\n// the inner binding to `X2`, which would otherwise become this shape's IRI.\n@linkedShape({name: 'LincdWebApp'})\nexport class LincdWebApp extends Shape {\n static targetClass = server.LincdWebApp;\n\n static get localApp() {\n return new LincdWebApp({ id: process.env.SITE_ROOT });\n }\n\n // Module and packages properties removed — lincd-modules is in modules_old.\n // These will be re-added when the shape is properly migrated to @_linked/core query patterns.\n\n @objectProperty({\n path: server.hasAPI,\n shape: Lincd_API_Client,\n maxCount: 1,\n })\n get api(): Lincd_API_Client {\n return undefined as any;\n }\n}\n"]}
|
|
@@ -104,7 +104,7 @@ import sharp from 'sharp';
|
|
|
104
104
|
import { findStoredKey, resolveResizeSource, } from '../utils/resizeSource.js';
|
|
105
105
|
import { Transform } from 'stream';
|
|
106
106
|
import { CookieJar } from 'tough-cookie';
|
|
107
|
-
import {
|
|
107
|
+
import { server } from '../ontologies/server.js';
|
|
108
108
|
import { linkedShape } from '../package.js';
|
|
109
109
|
import { resolveStaticAccessURL, staticAssetURL, } from '../utils/releaseManifest.js';
|
|
110
110
|
import { resolveBootstrapEntry, resolveViteMainEntry, resolveViteServingMode, } from '../utils/bootstrapEntry.js';
|
|
@@ -1972,7 +1972,7 @@ let LinkedServer = class LinkedServer extends Shape {
|
|
|
1972
1972
|
/**
|
|
1973
1973
|
* indicates that instances of this shape need to have this rdf.type
|
|
1974
1974
|
*/
|
|
1975
|
-
LinkedServer.targetClass =
|
|
1975
|
+
LinkedServer.targetClass = server.LincdServer;
|
|
1976
1976
|
LinkedServer = __decorate([
|
|
1977
1977
|
linkedShape({ name: 'LinkedServer' }),
|
|
1978
1978
|
__metadata("design:paramtypes", [Object])
|