@_linked/server 2.0.3 → 2.1.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/.github/workflows/publish.yml +13 -1
- package/CHANGELOG.md +26 -0
- 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 +42 -25
- package/lib/esm/shapes/LincdAPI.d.ts +3 -3
- package/lib/esm/shapes/LincdWebApp.d.ts +1 -1
- package/lib/esm/shapes/{LincdServer.d.ts → LinkedServer.d.ts} +30 -2
- package/lib/esm/shapes/{LincdServer.js → LinkedServer.js} +442 -155
- package/lib/esm/shapes/LinkedServer.js.map +1 -0
- package/lib/esm/shapes/quadstores/BackendAPIStore.d.ts +1 -1
- package/lib/esm/shapes/quadstores/BackendAPIStore.js +7 -7
- package/lib/esm/shapes/quadstores/BackendAPIStore.js.map +1 -1
- package/lib/esm/shapes/quadstores/BackendAPIStoreProvider.d.ts +10 -5
- package/lib/esm/shapes/quadstores/BackendAPIStoreProvider.js +15 -9
- package/lib/esm/shapes/quadstores/BackendAPIStoreProvider.js.map +1 -1
- package/lib/esm/utils/Shapes.d.ts +1 -1
- package/lib/esm/utils/Shapes.js +4 -3
- package/lib/esm/utils/Shapes.js.map +1 -1
- package/package.json +15 -17
- package/readme.md +100 -0
- package/tsconfig-esm.json +1 -1
- package/lib/cjs/backend.d.ts +0 -6
- package/lib/cjs/backend.js +0 -58
- package/lib/cjs/backend.js.map +0 -1
- package/lib/cjs/data/lincd-server.json +0 -47
- package/lib/cjs/index.d.ts +0 -9
- package/lib/cjs/index.js +0 -13
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/ontologies/lincd-server.d.ts +0 -31
- package/lib/cjs/ontologies/lincd-server.js +0 -86
- package/lib/cjs/ontologies/lincd-server.js.map +0 -1
- package/lib/cjs/package.d.ts +0 -4
- package/lib/cjs/package.js +0 -7
- package/lib/cjs/package.js.map +0 -1
- package/lib/cjs/package.json +0 -90
- package/lib/cjs/shapes/LincdAPI.d.ts +0 -41
- package/lib/cjs/shapes/LincdAPI.js +0 -124
- package/lib/cjs/shapes/LincdAPI.js.map +0 -1
- package/lib/cjs/shapes/LincdServer.d.ts +0 -79
- package/lib/cjs/shapes/LincdServer.js +0 -1339
- package/lib/cjs/shapes/LincdServer.js.map +0 -1
- package/lib/cjs/shapes/LincdWebApp.d.ts +0 -7
- package/lib/cjs/shapes/LincdWebApp.js +0 -43
- package/lib/cjs/shapes/LincdWebApp.js.map +0 -1
- package/lib/cjs/shapes/filestores/LocalFileStore.d.ts +0 -42
- package/lib/cjs/shapes/filestores/LocalFileStore.js +0 -146
- package/lib/cjs/shapes/filestores/LocalFileStore.js.map +0 -1
- package/lib/cjs/shapes/quadstores/BackendAPIStore.d.ts +0 -33
- package/lib/cjs/shapes/quadstores/BackendAPIStore.js +0 -79
- package/lib/cjs/shapes/quadstores/BackendAPIStore.js.map +0 -1
- package/lib/cjs/shapes/quadstores/BackendAPIStoreProvider.d.ts +0 -13
- package/lib/cjs/shapes/quadstores/BackendAPIStoreProvider.js +0 -30
- package/lib/cjs/shapes/quadstores/BackendAPIStoreProvider.js.map +0 -1
- package/lib/cjs/types/RouteConfig.d.ts +0 -56
- package/lib/cjs/types/RouteConfig.js +0 -3
- package/lib/cjs/types/RouteConfig.js.map +0 -1
- package/lib/cjs/types.d.ts +0 -12
- package/lib/cjs/types.js +0 -1
- package/lib/cjs/types.js.map +0 -1
- package/lib/cjs/utils/Shapes.d.ts +0 -7
- package/lib/cjs/utils/Shapes.js +0 -76
- package/lib/cjs/utils/Shapes.js.map +0 -1
- package/lib/cjs/utils/accessUrl.d.ts +0 -6
- package/lib/cjs/utils/accessUrl.js +0 -13
- package/lib/cjs/utils/accessUrl.js.map +0 -1
- package/lib/esm/package.json +0 -90
- package/lib/esm/shapes/LincdServer.js.map +0 -1
|
@@ -15,8 +15,20 @@ jobs:
|
|
|
15
15
|
contents: write
|
|
16
16
|
pull-requests: write
|
|
17
17
|
steps:
|
|
18
|
+
# Author the changesets "Version Packages" PR as the org release App (not the default
|
|
19
|
+
# GITHUB_TOKEN) so its CI runs without a manual "Approve and run" gate. Requires the org
|
|
20
|
+
# App installed on this repo + org secrets RELEASE_APP_ID / RELEASE_APP_PRIVATE_KEY.
|
|
21
|
+
- name: Generate GitHub App token
|
|
22
|
+
id: app-token
|
|
23
|
+
uses: actions/create-github-app-token@v2
|
|
24
|
+
with:
|
|
25
|
+
app-id: ${{ secrets.RELEASE_APP_ID }}
|
|
26
|
+
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
|
|
27
|
+
|
|
18
28
|
- name: Checkout
|
|
19
29
|
uses: actions/checkout@v4
|
|
30
|
+
with:
|
|
31
|
+
token: ${{ steps.app-token.outputs.token }}
|
|
20
32
|
|
|
21
33
|
- name: Setup Node.js
|
|
22
34
|
uses: actions/setup-node@v4
|
|
@@ -37,6 +49,6 @@ jobs:
|
|
|
37
49
|
title: 'chore: release'
|
|
38
50
|
commit: 'chore: release'
|
|
39
51
|
env:
|
|
40
|
-
GITHUB_TOKEN: ${{
|
|
52
|
+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
41
53
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
|
|
42
54
|
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @\_linked/server
|
|
2
2
|
|
|
3
|
+
## 2.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#13](https://github.com/linked-cm/server/pull/13) [`8932811`](https://github.com/linked-cm/server/commit/89328117fa9500897a5a57b86e07efe5860d81cd) Thanks [@flyon](https://github.com/flyon)! - **ESM-only.** Dropped the CommonJS build; the package now ships ES modules only (`type: module`, no `require` export condition, no `lib/cjs`). All first-party consumers are ESM; CJS projects on Node 22+ can still `require()` it (sync ESM) or use dynamic `import()`. Also fixed the root `types` field (was a non-existent `./index.d.ts`).
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [#13](https://github.com/linked-cm/server/pull/13) [`daef98d`](https://github.com/linked-cm/server/commit/daef98d777144285c2f63ed43821902371df2c66) Thanks [@flyon](https://github.com/flyon)! - `BackendAPIStore` now speaks DSL-JSON over the wire, adapting to the `@_linked/core` query-contract flip (datasets receive the live/closed query, not IR).
|
|
12
|
+
|
|
13
|
+
- The frontend store serializes each query with `query.toJSON()` before `Server.call` (the live query can't cross the wire), replacing the removed `getQueryObject()` path.
|
|
14
|
+
- `BackendAPIStoreProvider` rehydrates it with `fromJSON(json)` back into a live query before routing through `LinkedStorage` — the backend store lowers it to SPARQL itself.
|
|
15
|
+
|
|
16
|
+
No API change for callers; the round-trip is `lower(fromJSON(query.toJSON())) ≡ lower(query)`.
|
|
17
|
+
|
|
18
|
+
- [#13](https://github.com/linked-cm/server/pull/13) [`28d0f49`](https://github.com/linked-cm/server/commit/28d0f497b332a663af9d40162d017a2a35cbfb31) Thanks [@flyon](https://github.com/flyon)! - Dropped `lincd-sioc: ~1.0` from `package.json` dependencies. Audit
|
|
19
|
+
confirmed no source file in `packages/server/src` imports from sioc;
|
|
20
|
+
the dep was vestigial.
|
|
21
|
+
|
|
22
|
+
No API change. Consumers that depended on `@_linked/server` transitively
|
|
23
|
+
pulling sioc into their lockfile will need to add `@_linked/sioc` (the
|
|
24
|
+
new name; see its own release notes) as a direct dep if they actually
|
|
25
|
+
use it.
|
|
26
|
+
|
|
27
|
+
Context: see create-now plan-011 report (docs/reports/009-legacy-lincd-eradication.md).
|
|
28
|
+
|
|
3
29
|
## 2.0.3
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './types.js';
|
|
2
2
|
import './ontologies/lincd-server.js';
|
|
3
|
-
import './shapes/
|
|
3
|
+
import './shapes/LinkedServer.js';
|
|
4
4
|
import './shapes/LincdAPI.js';
|
|
5
5
|
import './shapes/quadstores/BackendAPIStore.js';
|
|
6
6
|
import './shapes/filestores/LocalFileStore.js';
|
package/lib/esm/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './types.js';
|
|
2
2
|
import './ontologies/lincd-server.js';
|
|
3
3
|
//SHAPES FIRST
|
|
4
|
-
import './shapes/
|
|
4
|
+
import './shapes/LinkedServer.js';
|
|
5
5
|
import './shapes/LincdAPI.js';
|
|
6
6
|
import './shapes/quadstores/BackendAPIStore.js';
|
|
7
7
|
import './shapes/filestores/LocalFileStore.js';
|
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,8BAA8B,CAAC;AAEtC,cAAc;AACd,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAC;AACpB,OAAO,8BAA8B,CAAC;AAEtC,cAAc;AACd,OAAO,0BAA0B,CAAC;AAClC,OAAO,sBAAsB,CAAC;AAC9B,OAAO,wCAAwC,CAAC;AAChD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,yBAAyB,CAAC;AAEjC,iBAAiB;AACjB,OAAO,sBAAsB,CAAC"}
|
|
@@ -2,30 +2,47 @@
|
|
|
2
2
|
* Load the data of this ontology.
|
|
3
3
|
* In @_linked/core, loadData returns the raw JSON import — no JSONLD.parse() needed.
|
|
4
4
|
*/
|
|
5
|
-
export declare var loadData: () => Promise<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
5
|
+
export declare var loadData: () => Promise<{
|
|
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
|
+
export declare var ns: (term: string) => import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
24
|
+
export declare var _self: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
25
|
+
export declare var LincdServer: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
26
|
+
export declare var BackendFileStore: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
27
|
+
export declare var NodeFileStore: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
28
|
+
export declare var BackendStore: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
29
|
+
export declare var BackendAPIStore: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
30
|
+
export declare var LincdWebApp: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
31
|
+
export declare var ownPackage: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
32
|
+
export declare var maintainsPackage: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
33
|
+
export declare var N3FileStore: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
34
|
+
export declare var LincdAPI: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
35
|
+
export declare var hasAPI: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
19
36
|
export declare const lincdServer: {
|
|
20
|
-
LincdServer: import("@_linked/core/utils/NodeReference
|
|
21
|
-
BackendFileStore: import("@_linked/core/utils/NodeReference
|
|
22
|
-
NodeFileStore: import("@_linked/core/utils/NodeReference
|
|
23
|
-
BackendStore: import("@_linked/core/utils/NodeReference
|
|
24
|
-
N3FileStore: import("@_linked/core/utils/NodeReference
|
|
25
|
-
BackendAPIStore: import("@_linked/core/utils/NodeReference
|
|
26
|
-
LincdWebApp: import("@_linked/core/utils/NodeReference
|
|
27
|
-
ownPackage: import("@_linked/core/utils/NodeReference
|
|
28
|
-
maintainsPackage: import("@_linked/core/utils/NodeReference
|
|
29
|
-
LincdAPI: import("@_linked/core/utils/NodeReference
|
|
30
|
-
hasAPI: import("@_linked/core/utils/NodeReference
|
|
37
|
+
LincdServer: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
38
|
+
BackendFileStore: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
39
|
+
NodeFileStore: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
40
|
+
BackendStore: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
41
|
+
N3FileStore: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
42
|
+
BackendAPIStore: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
43
|
+
LincdWebApp: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
44
|
+
ownPackage: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
45
|
+
maintainsPackage: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
46
|
+
LincdAPI: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
47
|
+
hasAPI: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
31
48
|
};
|
|
@@ -13,7 +13,7 @@ export type ShapeSummary = {
|
|
|
13
13
|
numInstances: number;
|
|
14
14
|
};
|
|
15
15
|
export declare class LincdAPI extends Shape {
|
|
16
|
-
static targetClass: import("@_linked/core/utils/NodeReference
|
|
16
|
+
static targetClass: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
17
17
|
process(request: any, response: any, httpMethod: 'get' | 'post' | 'put' | 'delete'): Promise<void>;
|
|
18
18
|
get_shape_details({ shapes, }: {
|
|
19
19
|
shapes: string[];
|
|
@@ -33,9 +33,9 @@ export declare class LincdAPI extends Shape {
|
|
|
33
33
|
}): Promise<unknown>;
|
|
34
34
|
post_delete({ query }: {
|
|
35
35
|
query: any;
|
|
36
|
-
}): Promise<import("@_linked/core/queries/DeleteQuery
|
|
36
|
+
}): Promise<import("@_linked/core/queries/DeleteQuery").DeleteResponse>;
|
|
37
37
|
post_select_raw({ query }: {
|
|
38
38
|
query: any;
|
|
39
|
-
}): Promise<void | import("@_linked/core/sparql/resultMapping
|
|
39
|
+
}): Promise<void | import("@_linked/core/sparql/resultMapping").SparqlJsonResults>;
|
|
40
40
|
private checkRawQuerySupport;
|
|
41
41
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Shape } from '@_linked/core/shapes/Shape';
|
|
2
2
|
import { Lincd_API_Client } from '@_linked/server-utils/shapes/Lincd_API_Client';
|
|
3
3
|
export declare class LincdWebApp extends Shape {
|
|
4
|
-
static targetClass: import("@_linked/core/utils/NodeReference
|
|
4
|
+
static targetClass: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
5
5
|
static get localApp(): LincdWebApp;
|
|
6
6
|
get api(): Lincd_API_Client;
|
|
7
7
|
}
|
|
@@ -2,11 +2,11 @@ import { Express as ExpressServer } from 'express';
|
|
|
2
2
|
import { Server as HttpServer } from 'http';
|
|
3
3
|
import type { LinkedConfig } from '@_linked/cli/interfaces';
|
|
4
4
|
import { Shape } from '@_linked/core/shapes/Shape';
|
|
5
|
-
export declare class
|
|
5
|
+
export declare class LinkedServer extends Shape {
|
|
6
6
|
/**
|
|
7
7
|
* indicates that instances of this shape need to have this rdf.type
|
|
8
8
|
*/
|
|
9
|
-
static targetClass: import("@_linked/core/utils/NodeReference
|
|
9
|
+
static targetClass: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
|
|
10
10
|
private config;
|
|
11
11
|
private cachedPaths;
|
|
12
12
|
private assets;
|
|
@@ -31,6 +31,21 @@ export declare class LincdServer extends Shape {
|
|
|
31
31
|
get app(): ExpressServer;
|
|
32
32
|
initPackage(): void;
|
|
33
33
|
initOnly(): Promise<this>;
|
|
34
|
+
/**
|
|
35
|
+
* Materialize this server's registered shapes into the RDF store as SHACL
|
|
36
|
+
* (core `syncShapes` → pure `sh:NodeShape` + property shapes), so a running
|
|
37
|
+
* app's app-data holds the shapes its instances validate/query against
|
|
38
|
+
* (plan-010 T1e.2). This is the canonical, uniform reuse+create mechanism:
|
|
39
|
+
* whatever shapes the app package registers (published re-exports + generated)
|
|
40
|
+
* get materialized on boot (and re-run on shape-file HMR).
|
|
41
|
+
*
|
|
42
|
+
* Gated to servers whose DEFAULT dataset is a **concrete** materializable store
|
|
43
|
+
* (detected via `rawQuery`) — i.e. an app pointing at its app-data FusekiStore.
|
|
44
|
+
* CN's default is the context-routing `AppDataRouter` (no `rawQuery`; a bare
|
|
45
|
+
* `syncShapes` orphan-read would throw with no active project), so CN is skipped
|
|
46
|
+
* here — it materializes its own pinned native shapes in its storage config.
|
|
47
|
+
*/
|
|
48
|
+
private materializeShapesIntoStore;
|
|
34
49
|
start(): Promise<this>;
|
|
35
50
|
initOntologies(): Promise<void>;
|
|
36
51
|
/**
|
|
@@ -58,6 +73,19 @@ export declare class LincdServer extends Shape {
|
|
|
58
73
|
backendProviderExports: any;
|
|
59
74
|
shapeProviders: any[];
|
|
60
75
|
}>;
|
|
76
|
+
/**
|
|
77
|
+
* Plan-011 phase 2 — HMR re-index entry point.
|
|
78
|
+
*
|
|
79
|
+
* Called by the CLI orchestrator's Vite watcher whenever a `.ts`/`.tsx`
|
|
80
|
+
* file inside a workspace package changes. Disposes the package's
|
|
81
|
+
* existing providers (so routes, listeners, timers don't accumulate),
|
|
82
|
+
* drops them from the registry, and re-runs indexPackageBackendProviders
|
|
83
|
+
* to pick up the freshly-imported module.
|
|
84
|
+
*
|
|
85
|
+
* Dispose calls have a 5 s soft timeout. A hanging dispose logs a
|
|
86
|
+
* warning and is abandoned so HMR doesn't stall the whole dev loop.
|
|
87
|
+
*/
|
|
88
|
+
onSourceChange(pkg: string): Promise<void>;
|
|
61
89
|
processBackendMethodCall(request: any, response: any): Promise<void>;
|
|
62
90
|
noCache(response: any): void;
|
|
63
91
|
processAPICall(request: any, response: any, method: 'get' | 'post' | 'put' | 'delete'): Promise<void>;
|