@_linked/server 2.12.3 → 2.13.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 CHANGED
@@ -1,5 +1,52 @@
1
1
  # @\_linked/server
2
2
 
3
+ ## 2.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#84](https://github.com/linked-fw/server/pull/84) [`7c743e3`](https://github.com/linked-fw/server/commit/7c743e30665889b99e866cc5aff87e45c8c16b1a) Thanks [@flyon](https://github.com/flyon)! - `BackendAPIStore` is no longer a Shape; it addresses the backend by package name.
8
+
9
+ It used to call `Server.call(this, …)`, whose transport derives the target from
10
+ `shape instanceof Shape && shape.id` (which instance) and `shapeClass.shape.id` (which class).
11
+ That was the only reason this class was a Shape — and the reason the server had to rebuild it
12
+ with `new (providerShapeClass)({id})` on every request, instantiating a Shape purely to discard
13
+ it.
14
+
15
+ None of that carried meaning. The provider took the store as its first argument and never read
16
+ it, and query routing is decided by the QUERY's shape via `LinkedStorage`, not by the store. So
17
+ the instance identity was pure addressing.
18
+
19
+ It now uses `Server.call`'s existing package-name overload, which sends `{args}` to
20
+ `/call/<packageName>/<method>` with no shape fields, and is answered by this package's generic
21
+ backend provider without any shape resolution. The five query methods moved from
22
+ `BackendAPIStoreProvider` onto `LincdServerBackendProvider`, losing the unused first argument;
23
+ `BackendAPIStoreProvider` is removed.
24
+
25
+ **Breaking** for anyone importing `BackendAPIStoreProvider`, or relying on `BackendAPIStore`
26
+ being a Shape (`instanceof Shape`, `.shape`, `targetClass`). The constructor signature is
27
+ unchanged and `IDataset` is implemented in full, so ordinary use through
28
+ `linked.{frontend,backend}.datasets.json` is unaffected.
29
+
30
+ This removes the last of the four classes blocking core's deferred Shape-instantiation guard.
31
+
32
+ ## 2.12.4
33
+
34
+ ### Patch Changes
35
+
36
+ - [#81](https://github.com/linked-fw/server/pull/81) [`ff6d03a`](https://github.com/linked-fw/server/commit/ff6d03ae1fb0a1e74447f1802dd273cf7b229630) Thanks [@flyon](https://github.com/flyon)! - Declare this package's server-only surface.
37
+
38
+ ```jsonc
39
+ "linked": { "serverOnly": [".", "./shapes/*", "./server/*", "./utils/*"] }
40
+ ```
41
+
42
+ A consuming application's client/server boundary check can now derive that this
43
+ package must not appear in a frontend bundle, instead of hardcoding its name.
44
+ That matters because this package is meant to be replaceable — a check that
45
+ knows it by name only holds for one arrangement of the framework, and a
46
+ replacement would inherit none of the protection.
47
+
48
+ Purely declarative: no code, no exports and no resolution behaviour changes.
49
+
3
50
  ## 2.12.3
4
51
 
5
52
  ### Patch Changes
@@ -1,6 +1,10 @@
1
1
  import { BackendProvider } from '@_linked/server-utils/utils/BackendProvider';
2
- export * from './shapes/quadstores/BackendAPIStoreProvider.js';
3
2
  export default class LincdServerBackendProvider extends BackendProvider {
4
3
  setupBeforeControllers(): Promise<void>;
5
4
  getShapes(): Record<string, import("@_linked/server-utils/types/ShapeDetails.js").ShapeDetails>;
5
+ selectQuery(json: any): Promise<unknown>;
6
+ askQuery(json: any): Promise<boolean>;
7
+ updateQuery(json: any): Promise<unknown>;
8
+ createQuery(json: any): Promise<unknown>;
9
+ deleteQuery(json: any): Promise<import("@_linked/core/queries/DeleteQuery").DeleteResponse>;
6
10
  }
@@ -1,10 +1,11 @@
1
1
  import { BackendProvider } from '@_linked/server-utils/utils/BackendProvider';
2
2
  import { LinkedFileStorage } from '@_linked/core/utils/LinkedFileStorage';
3
+ import { LinkedStorage } from '@_linked/core/utils/LinkedStorage';
4
+ import { fromJSON } from '@_linked/core';
3
5
  import { LocalFileStore } from './shapes/filestores/LocalFileStore.js';
4
6
  import { getShapeIndex } from './utils/Shapes.js';
5
7
  import path from 'path';
6
8
  import fs from 'fs/promises';
7
- export * from './shapes/quadstores/BackendAPIStoreProvider.js';
8
9
  export default class LincdServerBackendProvider extends BackendProvider {
9
10
  async setupBeforeControllers() {
10
11
  if (!LinkedFileStorage.getDefaultStore()) {
@@ -23,5 +24,36 @@ export default class LincdServerBackendProvider extends BackendProvider {
23
24
  getShapes() {
24
25
  return getShapeIndex();
25
26
  }
27
+ // ── BackendAPIStore query execution ──────────────────────────────────────
28
+ //
29
+ // These answer the frontend `BackendAPIStore`, which calls
30
+ // `Server.call(packageName, {method}, json)` — the PACKAGE form, so the request
31
+ // arrives here on the generic provider rather than through Shape resolution.
32
+ //
33
+ // They used to live on `BackendAPIStoreProvider`, a `ShapeProvider`, whose methods
34
+ // took the store as a first argument and never read it. Reaching that provider meant
35
+ // the transport had to carry a `shapeURI` and an `instanceNode`, and the server had to
36
+ // rebuild the store with `new (providerShapeClass)({id})` — instantiating a Shape only
37
+ // to discard it. Addressing by package removes all of that.
38
+ //
39
+ // A query cannot cross the wire live (core 2.10.0 contract flip), so the client ships
40
+ // `toJSON()` and `fromJSON()` rehydrates it here into a live, closed query.
41
+ // `LinkedStorage` then routes it by the QUERY's shape — which is, and always was, what
42
+ // decides the target dataset. The store instance never participated.
43
+ selectQuery(json) {
44
+ return LinkedStorage.selectQuery(fromJSON(json));
45
+ }
46
+ askQuery(json) {
47
+ return LinkedStorage.askQuery(fromJSON(json));
48
+ }
49
+ updateQuery(json) {
50
+ return LinkedStorage.updateQuery(fromJSON(json));
51
+ }
52
+ createQuery(json) {
53
+ return LinkedStorage.createQuery(fromJSON(json));
54
+ }
55
+ deleteQuery(json) {
56
+ return LinkedStorage.deleteQuery(fromJSON(json));
57
+ }
26
58
  }
27
59
  //# sourceMappingURL=backend.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"backend.js","sourceRoot":"","sources":["../../src/backend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OA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Q,CAAC,IAAI,CAAQ,CAAC,CAAC;IAC1D,CAAC;IAED,WAAW,CAAC,IAAS;QACnB,OAAO,aAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAQ,CAAC,CAAC;IAC1D,CAAC;CACF"}
@@ -1,4 +1,3 @@
1
- import { Shape } from '@_linked/core/shapes/Shape';
2
1
  import type { IDataset } from '@_linked/core/interfaces/IDataset';
3
2
  import type { SelectQuery } from '@_linked/core/queries/SelectQuery';
4
3
  import type { AskQuery } from '@_linked/core/queries/AskQuery';
@@ -18,11 +17,28 @@ export interface BackendAPIStoreConfig {
18
17
  id?: string;
19
18
  }
20
19
  /**
21
- * Frontend-side store that routes all queries to the backend via Server.call().
22
- * The backend's BackendAPIStoreProvider handles execution against the actual store.
20
+ * Frontend-side store that routes all queries to the backend via `Server.call()`.
21
+ * The backend's generic provider for this package executes them against the real store.
22
+ *
23
+ * A store is not a Shape. This class used to `extends Shape` and carry `@linkedShape`
24
+ * with a `targetClass`, purely so that `Server.call(this, …)` could address it: the
25
+ * transport derived the target from `shape instanceof Shape && shape.id` (the instance)
26
+ * and `shapeClass.shape.id` (the class). Neither carried any meaning — the backend
27
+ * provider never read the store it was handed, and query routing is decided by the
28
+ * QUERY's shape, not the store's.
29
+ *
30
+ * It now uses `Server.call`'s package form instead, which addresses the backend by
31
+ * package name and sends no shape fields at all. That removes the last reason for this
32
+ * class to be a Shape, and with it the `new (providerShapeClass)({id})` the backend had
33
+ * to perform to rebuild a store instance nobody used.
23
34
  */
24
- export declare class BackendAPIStore extends Shape implements IDataset {
25
- static targetClass: import("@_linked/core/utils/NodeReference").NodeReferenceValue;
35
+ export declare class BackendAPIStore implements IDataset {
36
+ /**
37
+ * Kept so the config form is still accepted and a store can be named, but it is no
38
+ * longer an addressing mechanism — nothing transmits or resolves it. Retained because
39
+ * `linked.{frontend,backend}.datasets.json` may still pass `name`/`id`.
40
+ */
41
+ readonly id?: string;
26
42
  constructor(config?: BackendAPIStoreConfig | string | {
27
43
  id?: string;
28
44
  });
@@ -1,41 +1,37 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- };
10
- import { lincdServer } from '../../ontologies/lincd-server.js';
11
- import { linkedShape } from '../../package.js';
12
- import { Shape } from '@_linked/core/shapes/Shape';
1
+ import { packageName } from '../../package.js';
13
2
  import { Server } from '@_linked/server-utils/utils/Server';
14
3
  /**
15
- * Frontend-side store that routes all queries to the backend via Server.call().
16
- * The backend's BackendAPIStoreProvider handles execution against the actual store.
4
+ * Frontend-side store that routes all queries to the backend via `Server.call()`.
5
+ * The backend's generic provider for this package executes them against the real store.
6
+ *
7
+ * A store is not a Shape. This class used to `extends Shape` and carry `@linkedShape`
8
+ * with a `targetClass`, purely so that `Server.call(this, …)` could address it: the
9
+ * transport derived the target from `shape instanceof Shape && shape.id` (the instance)
10
+ * and `shapeClass.shape.id` (the class). Neither carried any meaning — the backend
11
+ * provider never read the store it was handed, and query routing is decided by the
12
+ * QUERY's shape, not the store's.
13
+ *
14
+ * It now uses `Server.call`'s package form instead, which addresses the backend by
15
+ * package name and sends no shape fields at all. That removes the last reason for this
16
+ * class to be a Shape, and with it the `new (providerShapeClass)({id})` the backend had
17
+ * to perform to rebuild a store instance nobody used.
17
18
  */
18
- let BackendAPIStore = class BackendAPIStore extends Shape {
19
+ export class BackendAPIStore {
19
20
  constructor(config) {
20
- if (!config) {
21
- super();
21
+ if (!config)
22
22
  return;
23
- }
24
23
  if (typeof config === 'string') {
25
- // Legacy string-as-name form. Wrap into config shape.
26
- super({ id: `${process.env.DATA_ROOT}/backend-api-store/${config}` });
24
+ this.id = `${process.env.DATA_ROOT}/backend-api-store/${config}`;
27
25
  return;
28
26
  }
29
27
  if (config.id) {
30
- super({ id: config.id });
28
+ this.id = config.id;
31
29
  return;
32
30
  }
33
31
  if (config.name) {
34
32
  const name = config.name;
35
- super({ id: `${process.env.DATA_ROOT}/backend-api-store/${name}` });
36
- return;
33
+ this.id = `${process.env.DATA_ROOT}/backend-api-store/${name}`;
37
34
  }
38
- super();
39
35
  }
40
36
  async init() {
41
37
  // No initialization needed — queries are routed to the backend
@@ -65,13 +61,11 @@ let BackendAPIStore = class BackendAPIStore extends Shape {
65
61
  * Whatever a successful call returns, `undefined` included, resolves as is.
66
62
  */
67
63
  callBackend(method, json) {
68
- return Server.call(this, { method, rejectOnError: true }, json);
64
+ // The PACKAGE form, not the shape form. It posts to
65
+ // `/call/<packageName>/<method>` with a body of `{args}` only — no `shapeURI`,
66
+ // no `instanceNode` — and the backend answers from this package's generic
67
+ // provider without resolving or instantiating any Shape.
68
+ return Server.call(packageName, { method, rejectOnError: true }, json);
69
69
  }
70
- };
71
- BackendAPIStore.targetClass = lincdServer.BackendAPIStore;
72
- BackendAPIStore = __decorate([
73
- linkedShape,
74
- __metadata("design:paramtypes", [Object])
75
- ], BackendAPIStore);
76
- export { BackendAPIStore };
70
+ }
77
71
  //# sourceMappingURL=BackendAPIStore.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BackendAPIStore.js","sourceRoot":"","sources":["../../../../src/shapes/quadstores/BackendAPIStore.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAC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AC,IAAK,CAAC;YACrD,IAAI,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,sBAAsB,IAAI,EAAE,CAAC;QACjE,CAAC;IACH,CAAC;IAED,KAAK,CAAC,IAAI;QACR,+DAA+D;IACjE,CAAC;IAED,8EAA8E;IAC9E,+EAA+E;IAC/E,2EAA2E;IAC3E,WAAW,CAAC,KAAkB;QAC5B,OAAO,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;IACzD,CAAC;IAED,QAAQ,CAAC,KAAe;QACtB,OAAO,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,WAAW,CAAC,KAAkB;QAC5B,OAAO,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;IACzD,CAAC;IAED,WAAW,CAAC,KAAkB;QAC5B,OAAO,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;IACzD,CAAC;IAED,WAAW,CAAC,KAAkB;QAC5B,OAAO,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;IACzD,CAAC;IAED;;;;;OAKG;IACK,WAAW,CAAI,MAAc,EAAE,IAAa;QAClD,oDAAoD;QACpD,+EAA+E;QAC/E,0EAA0E;QAC1E,yDAAyD;QACzD,OAAO,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC;IACzE,CAAC;CACF"}
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "type": "git",
11
11
  "url": "git+https://github.com/linked-fw/server.git"
12
12
  },
13
- "version": "2.12.3",
13
+ "version": "2.13.0",
14
14
  "packageManager": "npm@11.19.1",
15
15
  "linkedPackage": true,
16
16
  "type": "module",
@@ -92,6 +92,14 @@
92
92
  "import": "./lib/esm/*.js"
93
93
  }
94
94
  },
95
+ "linked": {
96
+ "serverOnly": [
97
+ ".",
98
+ "./shapes/*",
99
+ "./server/*",
100
+ "./utils/*"
101
+ ]
102
+ },
95
103
  "publishConfig": {
96
104
  "access": "public"
97
105
  },
@@ -1,19 +0,0 @@
1
- import { BackendAPIStore } from './BackendAPIStore.js';
2
- import { ShapeProvider } from '@_linked/server-utils/utils/ShapeProvider';
3
- /**
4
- * Server-side provider that handles BackendAPIStore query requests.
5
- *
6
- * The client (BackendAPIStore) ships each query as DSL-JSON over Server.call
7
- * (core 2.10.0 contract flip — the live query can't cross the wire). Here we
8
- * rehydrate it with `fromJSON()` back into a live (closed) query, then route it
9
- * through LinkedStorage, which delegates to the actual backend store (e.g.
10
- * FusekiStore) — the store lowers the live query to IR/SPARQL itself.
11
- */
12
- export declare class BackendAPIStoreProvider extends ShapeProvider {
13
- shape: typeof BackendAPIStore;
14
- selectQuery(store: BackendAPIStore, json: any): Promise<unknown>;
15
- askQuery(store: BackendAPIStore, json: any): Promise<boolean>;
16
- updateQuery(store: BackendAPIStore, json: any): Promise<unknown>;
17
- createQuery(store: BackendAPIStore, json: any): Promise<unknown>;
18
- deleteQuery(store: BackendAPIStore, json: any): Promise<import("@_linked/core/queries/DeleteQuery").DeleteResponse>;
19
- }
@@ -1,35 +0,0 @@
1
- import { BackendAPIStore } from './BackendAPIStore.js';
2
- import { ShapeProvider } from '@_linked/server-utils/utils/ShapeProvider';
3
- import { LinkedStorage } from '@_linked/core/utils/LinkedStorage';
4
- import { fromJSON } from '@_linked/core';
5
- /**
6
- * Server-side provider that handles BackendAPIStore query requests.
7
- *
8
- * The client (BackendAPIStore) ships each query as DSL-JSON over Server.call
9
- * (core 2.10.0 contract flip — the live query can't cross the wire). Here we
10
- * rehydrate it with `fromJSON()` back into a live (closed) query, then route it
11
- * through LinkedStorage, which delegates to the actual backend store (e.g.
12
- * FusekiStore) — the store lowers the live query to IR/SPARQL itself.
13
- */
14
- export class BackendAPIStoreProvider extends ShapeProvider {
15
- constructor() {
16
- super(...arguments);
17
- this.shape = BackendAPIStore;
18
- }
19
- selectQuery(store, json) {
20
- return LinkedStorage.selectQuery(fromJSON(json));
21
- }
22
- askQuery(store, json) {
23
- return LinkedStorage.askQuery(fromJSON(json));
24
- }
25
- updateQuery(store, json) {
26
- return LinkedStorage.updateQuery(fromJSON(json));
27
- }
28
- createQuery(store, json) {
29
- return LinkedStorage.createQuery(fromJSON(json));
30
- }
31
- deleteQuery(store, json) {
32
- return LinkedStorage.deleteQuery(fromJSON(json));
33
- }
34
- }
35
- //# sourceMappingURL=BackendAPIStoreProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BackendAPIStoreProvider.js","sourceRoot":"","sources":["../../../../src/shapes/quadstores/BackendAPIStoreProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;;;;;;;GAQG;AACH,MAAM,OAAO,uBAAwB,SAAQ,aAAa;IAA1D;;QACS,UAAK,GAAG,eAAe,CAAC;IAqBjC,CAAC;IAnBC,WAAW,CAAC,KAAsB,EAAE,IAAS;QAC3C,OAAO,aAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAQ,CAAC,CAAC;IAC1D,CAAC;IAED,QAAQ,CAAC,KAAsB,EAAE,IAAS;QACxC,OAAO,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAQ,CAAC,CAAC;IACvD,CAAC;IAED,WAAW,CAAC,KAAsB,EAAE,IAAS;QAC3C,OAAO,aAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAQ,CAAC,CAAC;IAC1D,CAAC;IAED,WAAW,CAAC,KAAsB,EAAE,IAAS;QAC3C,OAAO,aAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAQ,CAAC,CAAC;IAC1D,CAAC;IAED,WAAW,CAAC,KAAsB,EAAE,IAAS;QAC3C,OAAO,aAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAQ,CAAC,CAAC;IAC1D,CAAC;CACF"}