@_linked/server 2.0.3 → 2.1.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.
Files changed (69) hide show
  1. package/.github/workflows/publish.yml +13 -1
  2. package/CHANGELOG.md +32 -0
  3. package/lib/esm/index.d.ts +1 -1
  4. package/lib/esm/index.js +1 -1
  5. package/lib/esm/index.js.map +1 -1
  6. package/lib/esm/ontologies/lincd-server.d.ts +42 -25
  7. package/lib/esm/shapes/LincdAPI.d.ts +3 -3
  8. package/lib/esm/shapes/LincdWebApp.d.ts +1 -1
  9. package/lib/esm/shapes/{LincdServer.d.ts → LinkedServer.d.ts} +30 -2
  10. package/lib/esm/shapes/{LincdServer.js → LinkedServer.js} +444 -158
  11. package/lib/esm/shapes/LinkedServer.js.map +1 -0
  12. package/lib/esm/shapes/quadstores/BackendAPIStore.d.ts +1 -1
  13. package/lib/esm/shapes/quadstores/BackendAPIStore.js +7 -7
  14. package/lib/esm/shapes/quadstores/BackendAPIStore.js.map +1 -1
  15. package/lib/esm/shapes/quadstores/BackendAPIStoreProvider.d.ts +10 -5
  16. package/lib/esm/shapes/quadstores/BackendAPIStoreProvider.js +15 -9
  17. package/lib/esm/shapes/quadstores/BackendAPIStoreProvider.js.map +1 -1
  18. package/lib/esm/utils/Shapes.d.ts +1 -1
  19. package/lib/esm/utils/Shapes.js +4 -3
  20. package/lib/esm/utils/Shapes.js.map +1 -1
  21. package/package.json +15 -17
  22. package/readme.md +100 -0
  23. package/tsconfig-esm.json +1 -1
  24. package/lib/cjs/backend.d.ts +0 -6
  25. package/lib/cjs/backend.js +0 -58
  26. package/lib/cjs/backend.js.map +0 -1
  27. package/lib/cjs/data/lincd-server.json +0 -47
  28. package/lib/cjs/index.d.ts +0 -9
  29. package/lib/cjs/index.js +0 -13
  30. package/lib/cjs/index.js.map +0 -1
  31. package/lib/cjs/ontologies/lincd-server.d.ts +0 -31
  32. package/lib/cjs/ontologies/lincd-server.js +0 -86
  33. package/lib/cjs/ontologies/lincd-server.js.map +0 -1
  34. package/lib/cjs/package.d.ts +0 -4
  35. package/lib/cjs/package.js +0 -7
  36. package/lib/cjs/package.js.map +0 -1
  37. package/lib/cjs/package.json +0 -90
  38. package/lib/cjs/shapes/LincdAPI.d.ts +0 -41
  39. package/lib/cjs/shapes/LincdAPI.js +0 -124
  40. package/lib/cjs/shapes/LincdAPI.js.map +0 -1
  41. package/lib/cjs/shapes/LincdServer.d.ts +0 -79
  42. package/lib/cjs/shapes/LincdServer.js +0 -1339
  43. package/lib/cjs/shapes/LincdServer.js.map +0 -1
  44. package/lib/cjs/shapes/LincdWebApp.d.ts +0 -7
  45. package/lib/cjs/shapes/LincdWebApp.js +0 -43
  46. package/lib/cjs/shapes/LincdWebApp.js.map +0 -1
  47. package/lib/cjs/shapes/filestores/LocalFileStore.d.ts +0 -42
  48. package/lib/cjs/shapes/filestores/LocalFileStore.js +0 -146
  49. package/lib/cjs/shapes/filestores/LocalFileStore.js.map +0 -1
  50. package/lib/cjs/shapes/quadstores/BackendAPIStore.d.ts +0 -33
  51. package/lib/cjs/shapes/quadstores/BackendAPIStore.js +0 -79
  52. package/lib/cjs/shapes/quadstores/BackendAPIStore.js.map +0 -1
  53. package/lib/cjs/shapes/quadstores/BackendAPIStoreProvider.d.ts +0 -13
  54. package/lib/cjs/shapes/quadstores/BackendAPIStoreProvider.js +0 -30
  55. package/lib/cjs/shapes/quadstores/BackendAPIStoreProvider.js.map +0 -1
  56. package/lib/cjs/types/RouteConfig.d.ts +0 -56
  57. package/lib/cjs/types/RouteConfig.js +0 -3
  58. package/lib/cjs/types/RouteConfig.js.map +0 -1
  59. package/lib/cjs/types.d.ts +0 -12
  60. package/lib/cjs/types.js +0 -1
  61. package/lib/cjs/types.js.map +0 -1
  62. package/lib/cjs/utils/Shapes.d.ts +0 -7
  63. package/lib/cjs/utils/Shapes.js +0 -76
  64. package/lib/cjs/utils/Shapes.js.map +0 -1
  65. package/lib/cjs/utils/accessUrl.d.ts +0 -6
  66. package/lib/cjs/utils/accessUrl.js +0 -13
  67. package/lib/cjs/utils/accessUrl.js.map +0 -1
  68. package/lib/esm/package.json +0 -90
  69. 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: ${{ secrets.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,37 @@
1
1
  # @\_linked/server
2
2
 
3
+ ## 2.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#15](https://github.com/linked-cm/server/pull/15) [`e98441f`](https://github.com/linked-cm/server/commit/e98441fbef10dd3583e7fd04a3e45b5ad73e03cd) Thanks [@flyon](https://github.com/flyon)! - Replace removed `CoreMap` with native `Map` (core dropped CoreMap in `b2de3ad`). Fixes `Cannot find module @_linked/core/collections/CoreMap` from LinkedServer on a clean install.
8
+
9
+ ## 2.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#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`).
14
+
15
+ ### Patch Changes
16
+
17
+ - [#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).
18
+
19
+ - 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.
20
+ - `BackendAPIStoreProvider` rehydrates it with `fromJSON(json)` back into a live query before routing through `LinkedStorage` — the backend store lowers it to SPARQL itself.
21
+
22
+ No API change for callers; the round-trip is `lower(fromJSON(query.toJSON())) ≡ lower(query)`.
23
+
24
+ - [#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
25
+ confirmed no source file in `packages/server/src` imports from sioc;
26
+ the dep was vestigial.
27
+
28
+ No API change. Consumers that depended on `@_linked/server` transitively
29
+ pulling sioc into their lockfile will need to add `@_linked/sioc` (the
30
+ new name; see its own release notes) as a direct dep if they actually
31
+ use it.
32
+
33
+ Context: see create-now plan-011 report (docs/reports/009-legacy-lincd-eradication.md).
34
+
3
35
  ## 2.0.3
4
36
 
5
37
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  import './types.js';
2
2
  import './ontologies/lincd-server.js';
3
- import './shapes/LincdServer.js';
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/LincdServer.js';
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';
@@ -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,yBAAyB,CAAC;AACjC,OAAO,sBAAsB,CAAC;AAC9B,OAAO,wCAAwC,CAAC;AAChD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,yBAAyB,CAAC;AAEjC,iBAAiB;AACjB,OAAO,sBAAsB,CAAC"}
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<any>;
6
- export declare var ns: (term: string) => import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
7
- export declare var _self: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
8
- export declare var LincdServer: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
9
- export declare var BackendFileStore: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
10
- export declare var NodeFileStore: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
11
- export declare var BackendStore: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
12
- export declare var BackendAPIStore: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
13
- export declare var LincdWebApp: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
14
- export declare var ownPackage: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
15
- export declare var maintainsPackage: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
16
- export declare var N3FileStore: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
17
- export declare var LincdAPI: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
18
- export declare var hasAPI: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
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.js").NodeReferenceValue;
21
- BackendFileStore: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
22
- NodeFileStore: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
23
- BackendStore: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
24
- N3FileStore: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
25
- BackendAPIStore: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
26
- LincdWebApp: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
27
- ownPackage: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
28
- maintainsPackage: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
29
- LincdAPI: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
30
- hasAPI: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
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.js").NodeReferenceValue;
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.js").DeleteResponse>;
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.js").SparqlJsonResults>;
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.js").NodeReferenceValue;
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 LincdServer extends Shape {
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.js").NodeReferenceValue;
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>;