@_linked/core 2.22.8 → 2.22.9

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 (91) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/lib/esm/collections/CoreSet.js.map +1 -1
  3. package/lib/esm/collections/ShapeSet.js.map +1 -1
  4. package/lib/esm/expressions/Expr.js.map +1 -1
  5. package/lib/esm/expressions/ExpressionMethods.js.map +1 -1
  6. package/lib/esm/expressions/ExpressionNode.js.map +1 -1
  7. package/lib/esm/index.js.map +1 -1
  8. package/lib/esm/interfaces/ICoreIterable.js.map +1 -1
  9. package/lib/esm/interfaces/IDataset.js.map +1 -1
  10. package/lib/esm/interfaces/IFileStore.js.map +1 -1
  11. package/lib/esm/ontologies/linked-core.js.map +1 -1
  12. package/lib/esm/ontologies/npm.js.map +1 -1
  13. package/lib/esm/ontologies/owl.js.map +1 -1
  14. package/lib/esm/ontologies/rdf.js.map +1 -1
  15. package/lib/esm/ontologies/rdfs.js.map +1 -1
  16. package/lib/esm/ontologies/shacl.js.map +1 -1
  17. package/lib/esm/ontologies/xsd.js.map +1 -1
  18. package/lib/esm/package.js.map +1 -1
  19. package/lib/esm/paths/PropertyPathExpr.js.map +1 -1
  20. package/lib/esm/paths/normalizePropertyPath.js.map +1 -1
  21. package/lib/esm/paths/pathExprToSparql.js.map +1 -1
  22. package/lib/esm/queries/AskBuilder.js.map +1 -1
  23. package/lib/esm/queries/AskQuery.js.map +1 -1
  24. package/lib/esm/queries/ContextRef.js.map +1 -1
  25. package/lib/esm/queries/CountBuilder.js.map +1 -1
  26. package/lib/esm/queries/CountQuery.js.map +1 -1
  27. package/lib/esm/queries/CreateBuilder.js.map +1 -1
  28. package/lib/esm/queries/CreateQuery.js.map +1 -1
  29. package/lib/esm/queries/DeleteBuilder.js.map +1 -1
  30. package/lib/esm/queries/DeleteQuery.js.map +1 -1
  31. package/lib/esm/queries/DslJsonExpression.js.map +1 -1
  32. package/lib/esm/queries/FieldSet.js.map +1 -1
  33. package/lib/esm/queries/IRAliasScope.js.map +1 -1
  34. package/lib/esm/queries/IRCanonicalize.js.map +1 -1
  35. package/lib/esm/queries/IRDesugar.js.map +1 -1
  36. package/lib/esm/queries/IRLower.js.map +1 -1
  37. package/lib/esm/queries/IRMutation.js.map +1 -1
  38. package/lib/esm/queries/IRPipeline.js.map +1 -1
  39. package/lib/esm/queries/IRProjection.js.map +1 -1
  40. package/lib/esm/queries/IntermediateRepresentation.js.map +1 -1
  41. package/lib/esm/queries/MutationQuery.js.map +1 -1
  42. package/lib/esm/queries/MutationSerialization.js.map +1 -1
  43. package/lib/esm/queries/MutationThenable.js.map +1 -1
  44. package/lib/esm/queries/PropertyPath.js.map +1 -1
  45. package/lib/esm/queries/ProxiedPathBuilder.js.map +1 -1
  46. package/lib/esm/queries/QueryBuilder.js.map +1 -1
  47. package/lib/esm/queries/QueryBuilderSerialization.js.map +1 -1
  48. package/lib/esm/queries/QueryContext.js.map +1 -1
  49. package/lib/esm/queries/QueryFactory.js.map +1 -1
  50. package/lib/esm/queries/SelectQuery.js.map +1 -1
  51. package/lib/esm/queries/UpdateBuilder.js.map +1 -1
  52. package/lib/esm/queries/UpdateQuery.js.map +1 -1
  53. package/lib/esm/queries/fromJSON.js.map +1 -1
  54. package/lib/esm/queries/lower.js.map +1 -1
  55. package/lib/esm/queries/lowerMutationJSON.js.map +1 -1
  56. package/lib/esm/queries/mutationLowerSpec.js.map +1 -1
  57. package/lib/esm/queries/queryDispatch.js.map +1 -1
  58. package/lib/esm/queries/reservedQueryNames.js.map +1 -1
  59. package/lib/esm/queries/resolveShape.js.map +1 -1
  60. package/lib/esm/queries/wireVersion.js.map +1 -1
  61. package/lib/esm/shapes/List.js.map +1 -1
  62. package/lib/esm/shapes/PathNode.js.map +1 -1
  63. package/lib/esm/shapes/SHACL.js.map +1 -1
  64. package/lib/esm/shapes/Shape.js.map +1 -1
  65. package/lib/esm/shapes/nodeShapeData.js.map +1 -1
  66. package/lib/esm/shapes/nodeShapeWire.js.map +1 -1
  67. package/lib/esm/shapes/propertyShapeTerms.js.map +1 -1
  68. package/lib/esm/shapes/registerRuntimeShape.js.map +1 -1
  69. package/lib/esm/shapes/serializePathToNodeData.js.map +1 -1
  70. package/lib/esm/shapes/syncShapes.js.map +1 -1
  71. package/lib/esm/shapes/validation.js.map +1 -1
  72. package/lib/esm/sparql/SparqlAlgebra.js.map +1 -1
  73. package/lib/esm/sparql/SparqlDataset.js.map +1 -1
  74. package/lib/esm/sparql/algebraToString.js.map +1 -1
  75. package/lib/esm/sparql/index.js.map +1 -1
  76. package/lib/esm/sparql/irToAlgebra.js.map +1 -1
  77. package/lib/esm/sparql/resultMapping.js.map +1 -1
  78. package/lib/esm/sparql/sparqlUtils.js.map +1 -1
  79. package/lib/esm/utils/LinkedErrorLogging.js.map +1 -1
  80. package/lib/esm/utils/LinkedFileStorage.js.map +1 -1
  81. package/lib/esm/utils/LinkedStorage.js.map +1 -1
  82. package/lib/esm/utils/NameSpace.js.map +1 -1
  83. package/lib/esm/utils/NodeReference.js.map +1 -1
  84. package/lib/esm/utils/Package.js.map +1 -1
  85. package/lib/esm/utils/Prefix.js.map +1 -1
  86. package/lib/esm/utils/ShapeClass.js.map +1 -1
  87. package/lib/esm/utils/URI.js.map +1 -1
  88. package/lib/esm/utils/cached.js.map +1 -1
  89. package/lib/esm/utils/loadStores.js.map +1 -1
  90. package/lib/esm/utils/parseDatasetsConfig.js.map +1 -1
  91. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ShapeClass.js","sourceRoot":"","sources":["../../../src/utils/ShapeClass.ts"],"names":[],"mappings":";AACA,sFAAsF;AACtF,6FAA6F;AAC7F,sFAAsF;AACtF,wFAAwF;AACxF,OAAO,KAAK,WAAW,MAAM,oBAAoB,CAAC;AAClD,OAAO,EACL,gBAAgB,GAGjB,MAAM,4BAA4B,CAAC;AAIpC,MAAM,oBAAoB,GAAG,CAC3B,WAAuC,EACxB,EAAE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,IAAI,CAAC,CAAC,aAAa,EAAE,EAAE;YACvC,OAAO,aAAa,CAAC,SAAS,YAAY,QAAQ,CAAC;QACrD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,SAAS,2BAA2B,CAAC,YAAY;IAC/C,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE;QACxC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,EAAE;YAC5C,OAAO,CACL,eAAe,KAAK,UAAU;gBAC9B,UAAU,CAAC,SAAS,YAAY,eAAe,CAChD,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,MAAM,CAAC,KAAsC;IACpD,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QACzB,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAC5C,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AACzB,CAAC;AAED,SAAS,WAAW,CAAC,KAAmB;IACtC,uCAAuC;IACvC,OAAO,CACL,oBAAoB,CAAC,KAAK,CAAC,WAAW,CAAC;QACvC,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CACrE,CAAC;AACJ,CAAC","sourcesContent":["import {type Shape, type ShapeConstructor} from '../shapes/Shape.js';\n// Namespace import, read at CALL time rather than captured at module-evaluation time.\n// `getOrCreateShapeAdapter` subclasses `Shape` at runtime, and under some import orders this\n// module finishes evaluating before `Shape.js` does — a named import captured then is\n// permanently `undefined`, and the subclass fails with \"Class extends value undefined\".\nimport * as ShapeModule from '../shapes/Shape.js';\nimport {\n getPropertyShape,\n type NodeShapeData,\n type PropertyShapeData,\n} from '../shapes/nodeShapeData.js';\nimport type {ICoreIterable} from '../interfaces/ICoreIterable.js';\nimport type {NodeReferenceValue} from './NodeReference.js';\n\nconst resolveTargetClassId = (\n targetClass?: NodeReferenceValue | null,\n): string | null => {\n if (!targetClass) return null;\n return targetClass.id ?? null;\n};\n\n/**\n * The shape registries live on `globalThis`, not in module scope.\n *\n * A module can evaluate more than once in one process, and in a built app it does: an\n * app's backend is assembled from two graphs, one loaded by the bundler from `src/` and\n * one resolved by Node to `lib/esm/`. A module-scope `Map` then exists twice — shapes\n * register into one copy and every lookup reads the other, which finds nothing.\n *\n * The symptom never mentions module identity. It is `Invalid property key: projectSlug.\n * The shape Project does not have a registered property with this name` for a property\n * that is declared correctly two files away, because validation ran on the copy the\n * decorators never reached. See docs/reports/043-module-identity-in-the-backend.md.\n *\n * Sharing the state makes duplication harmless rather than merely absent: the graphs\n * still hold two copies of this module, but only one registry. `LinkedStorage` already\n * keeps its instance counter here; this keeps the data itself.\n */\nconst shapeRegistryGlobal: any =\n typeof globalThis !== 'undefined' ? globalThis : ({} as any);\n\n/**\n * Counts DISTINCT physical copies of this module, not evaluations of it.\n *\n * The difference matters. A bare `count++` here is incremented by Vite's HMR every time\n * the module is re-evaluated in the same process, against the same `globalThis` — so a\n * developer who edits a file a few times sees a count of 4 and goes hunting a\n * dual-resolution problem that does not exist. Recording a token per copy and counting\n * the tokens survives re-evaluation: HMR replaces the module, and its token with it.\n */\nconst copyToken: object = {};\nconst copies: Set<object> = (shapeRegistryGlobal.__linkedShapeRegistryCopies ??= new Set());\ncopies.add(copyToken);\n\n/**\n * More than one copy of this module means shapes register into one registry and are\n * looked up in another, and the resulting failures never mention module identity — they\n * say a declared property is not declared, or that a pinned shape has no pin.\n *\n * Reported rather than thrown. A throw from a library module at import time breaks\n * tooling that legitimately loads a module twice, and the shared state above means a\n * second copy is survivable: it is a correctness hazard for anything holding a class\n * reference, not an immediate failure. So this says so, once, as loudly as a log can.\n */\nif (copies.size > 1) {\n console.error(\n `[linked] ${copies.size} copies of @_linked/core's shape registry have loaded in ` +\n `this process. They share one registry, so lookups still resolve — but each copy ` +\n `has its own \\`Shape\\` base class, so \\`instanceof\\` comparisons across them are ` +\n `false and adapters built by one copy do not satisfy the other. This is a module ` +\n `resolution problem: part of the app is reaching this package by a path that ` +\n `resolves to its source and part by one that resolves to its build output.`,\n );\n}\n\n/**\n * One shared container, created by whichever copy evaluates first.\n *\n * `registryVersion` belongs here too: every derived cache in this module is keyed on it,\n * so a version that is not shared would let one copy's writes leave another copy's caches\n * looking valid. The caches themselves stay per-copy — they are rebuilt whenever the\n * shared version moves past them.\n */\nconst registryState: {\n nodeShapeToShapeClass: Map<string, typeof Shape>;\n nodeShapeRegistry: Map<string, NodeShapeData>;\n shapeAdapters: Map<string, typeof Shape>;\n registryVersion: number;\n} = (shapeRegistryGlobal.__linkedShapeRegistry ??= {\n nodeShapeToShapeClass: new Map(),\n nodeShapeRegistry: new Map(),\n shapeAdapters: new Map(),\n registryVersion: 0,\n});\n\n/** How many distinct copies of this module are loaded. One is expected. */\nexport function getShapeRegistryInstanceCount(): number {\n return copies.size;\n}\n\nlet subShapesCache: Map<string, (typeof Shape)[]> = new Map();\nlet mostSpecificSubShapesCache: Map<string, (typeof Shape)[]> = new Map();\nconst nodeShapeToShapeClass = registryState.nodeShapeToShapeClass;\nconst warnedDuplicateBases = new Set<string>();\n\n/**\n * The PRIMARY shape registry: node-shape IRI → its metadata.\n *\n * Every shape is here — those declared by a `@linkedShape` class and those known only\n * as data (a project-authored shape read from the graph). `nodeShapeToShapeClass` above\n * is the SECONDARY registry, holding only the shapes that have a TypeScript class, and\n * exists for the few callers that genuinely need a class (a `ShapeProvider` lookup, a\n * typed accessor). Query lowering, predicate resolution and containment all read\n * metadata, so they use this map and work identically for both kinds of shape.\n */\nconst nodeShapeRegistry = registryState.nodeShapeRegistry;\n\n/** Version the sub-shape caches above were filled at. */\nlet subShapesCacheVersion = -1;\n\n/**\n * The current registration version — a monotonic counter, bumped on every write.\n *\n * Every derived cache in this module, and in `irToAlgebra`, is keyed on it. It replaces\n * two earlier invalidation strategies that were both unsound: a `setTimeout(…, 0)` cache\n * clear (which missed anything registered later in the same session) and comparing the\n * registry SIZE (which silently reuses a stale cache when a registration and a removal\n * coincide, or when a shape is re-registered in place).\n *\n * It lives on the shared state, not in module scope: a cache keyed on a per-copy version\n * would look valid after another copy had written.\n */\nexport function getRegistryVersion(): number {\n return registryState.registryVersion;\n}\n\n/** Reverse index parentIri → direct child IRIs, rebuilt when the registry changes. */\nlet childIndex: Map<string, string[]> | null = null;\nlet childIndexVersion = -1;\n\nfunction getChildIndex(): Map<string, string[]> {\n if (childIndex && childIndexVersion === registryState.registryVersion) return childIndex;\n const index = new Map<string, string[]>();\n nodeShapeRegistry.forEach((shape, id) => {\n const parent = shape.extends?.id;\n if (!parent) return;\n const siblings = index.get(parent);\n if (siblings) siblings.push(id);\n else index.set(parent, [id]);\n });\n childIndex = index;\n childIndexVersion = registryState.registryVersion;\n return index;\n}\n\nfunction invalidateRegistryCaches() {\n registryState.registryVersion++;\n subShapesCache.clear();\n mostSpecificSubShapesCache.clear();\n childIndex = null;\n}\n\n/** Drop the adapter for a shape whose metadata was replaced. */\nfunction invalidateShapeAdapter(id: string) {\n shapeAdapters.delete(id);\n}\n\n/**\n * Register a shape known only as data — no TypeScript class is created.\n *\n * This is the return leg of the round trip: `@linkedShape` is class → metadata,\n * `syncShapes` is metadata → RDF, and this is RDF → metadata. Idempotent: re-registering\n * the same IRI replaces the metadata (a shape edited in the builder), which is why cache\n * invalidation cannot be keyed on registry size.\n */\nexport function registerNodeShape(nodeShape: NodeShapeData): void {\n if (!nodeShape?.id) return;\n nodeShapeRegistry.set(nodeShape.id, nodeShape);\n invalidateShapeAdapter(nodeShape.id);\n invalidateRegistryCaches();\n}\n\n/** The metadata for a node-shape IRI, whether or not it has a TypeScript class. */\nexport function getNodeShape(\n nodeShape: NodeReferenceValue | {id: string} | string,\n): NodeShapeData | undefined {\n const id = typeof nodeShape === 'string' ? nodeShape : nodeShape?.id;\n if (!id) return undefined;\n return nodeShapeRegistry.get(id);\n}\n\n/** Every registered shape's metadata, keyed by node-shape IRI. */\nexport function getAllNodeShapes(): ReadonlyMap<string, NodeShapeData> {\n return nodeShapeRegistry;\n}\n\n/**\n * Lazily-built constructors for shapes that exist only as data.\n *\n * The builder entry points (`QueryBuilder`, `CreateBuilder`, `UpdateBuilder`,\n * `DeleteBuilder` via `resolveShape`) take a `ShapeConstructor` and instantiate result\n * proxies from it, so they need *a* class. Rather than have every caller hand-roll one —\n * which is what `create-now-js`'s `registerRuntimeShape` used to do, losing `extends` and\n * every value constraint on the way — core derives one on demand from the registered\n * metadata and caches it.\n *\n * These adapters are deliberately NOT in `nodeShapeToShapeClass`: `getShapeClass` keeps\n * telling the truth about which shapes have a real, authored class. An adapter carries\n * the metadata verbatim, so nothing is lost, and inheritance is read from\n * `nodeShape.extends` (not from the adapter's prototype, which is always `Shape`).\n */\nconst shapeAdapters = registryState.shapeAdapters;\n\n/**\n * A constructor for a shape known only as data, created on first use.\n *\n * Returns undefined when the IRI is not registered at all. Prefer `getShapeClass` when\n * you specifically need an authored class; use this when you need *something*\n * constructor-shaped to drive the query builders.\n */\nexport function getOrCreateShapeAdapter(\n nodeShape: NodeShapeData | string,\n): typeof Shape | undefined {\n const data =\n typeof nodeShape === 'string' ? nodeShapeRegistry.get(nodeShape) : nodeShape;\n if (!data?.id) return undefined;\n\n const authored = nodeShapeToShapeClass.get(data.id);\n if (authored) return authored;\n\n const cached = shapeAdapters.get(data.id);\n // Re-registering a shape replaces its metadata, so an adapter built from the old\n // object must not be reused.\n if (cached && cached.shape === data) return cached;\n\n class RuntimeShape extends ShapeModule.Shape {\n static shape = data as NodeShapeData;\n static targetClass = (data as NodeShapeData).targetClass ?? null;\n }\n Object.defineProperty(RuntimeShape, 'name', {\n value: (data as NodeShapeData).label || 'RuntimeShape',\n });\n shapeAdapters.set(data.id, RuntimeShape);\n return RuntimeShape;\n}\n\n/** Anything that can identify a shape: its metadata, its class, or its IRI. */\nexport type ShapeLike = NodeShapeData | typeof Shape | Function | string;\n\n/** Resolve a ShapeLike to node-shape metadata, or undefined if it isn't a shape. */\nfunction toNodeShapeData(shape: ShapeLike): NodeShapeData | undefined {\n if (!shape) return undefined;\n if (typeof shape === 'string') return nodeShapeRegistry.get(shape);\n const asData = shape as NodeShapeData;\n // NodeShapeData is a plain object with an id; a Shape class is a function.\n if (typeof shape === 'object' && typeof asData.id === 'string') {\n return nodeShapeRegistry.get(asData.id) ?? asData;\n }\n const asClass = shape as typeof Shape;\n const shapeData = asClass?.shape;\n if (shapeData?.id) return nodeShapeRegistry.get(shapeData.id) ?? shapeData;\n return undefined;\n}\n\nconst warnedUnresolvedExtends = new Set<string>();\n\n/**\n * Every shape the given shape extends, most specific first.\n *\n * THE canonical inheritance walk — `getPropertyShapes(shape, true)` delegates to it, so\n * there is exactly one answer to \"what does this shape extend\". Two earlier walks\n * disagreed (one over the prototype chain, one over `extends`) and that divergence, not\n * either strategy, was the bug: `selectAll` listed labels from one and resolved them\n * through the other, so an inherited property became unresolvable and the query proxy\n * threw.\n *\n * Strategy is chosen by what is available:\n *\n * - **A class-backed shape walks its prototype chain.** This is authoritative and\n * includes the framework `Shape` root, whose own property shapes (`label`, `type`) are\n * genuinely inherited. `applyLinkedShape` deliberately does NOT record `extends` for\n * that root — it is not a domain shape and must not appear as an `extends` triple in\n * materialized SHACL — so the data alone cannot see it.\n * - **A shape known only as data walks `extends` through the registry.** This is what\n * makes inheritance work for a project-authored shape with no class, which the\n * prototype chain cannot express.\n *\n * `extends` is a REFERENCE, so a parent that was never registered ends the walk. The\n * prototype chain has no such failure mode, so it warns once per shape rather than\n * throwing — this runs on read paths.\n */\nexport function getSuperShapes(shape: ShapeLike): NodeShapeData[] {\n const start = toNodeShapeData(shape);\n const chain: NodeShapeData[] = [];\n if (!start) return chain;\n\n // Class-backed: the prototype chain is the authority.\n const startClass = nodeShapeToShapeClass.get(start.id);\n if (startClass) {\n let current: typeof Shape | undefined = startClass;\n while (current) {\n const parent = Object.getPrototypeOf(current) as typeof Shape | undefined;\n if (!parent?.shape) break;\n chain.push(parent.shape);\n if ((parent as unknown) === (ShapeModule.Shape as unknown)) break;\n current = parent;\n }\n return chain;\n }\n\n const seen = new Set<string>([start.id]);\n let current: NodeShapeData | undefined = start;\n while (current?.extends?.id) {\n const parentId = current.extends.id;\n if (seen.has(parentId)) break; // cycle guard — malformed data must not hang a read\n seen.add(parentId);\n const parent = nodeShapeRegistry.get(parentId);\n if (!parent) {\n if (!warnedUnresolvedExtends.has(current.id)) {\n warnedUnresolvedExtends.add(current.id);\n console.warn(\n `[linked] Shape '${current.id}' extends '${parentId}', which is not registered. ` +\n `Inherited properties from it are unavailable. Register the parent shape first ` +\n `(import its module, or register its metadata before the child).`,\n );\n }\n break;\n }\n chain.push(parent);\n current = parent;\n }\n return chain;\n}\n\n/** Every shape that extends the given shape, transitively. Most specific last. */\nexport function getSubShapes(shape: ShapeLike): NodeShapeData[] {\n const start = toNodeShapeData(shape);\n if (!start) return [];\n const index = getChildIndex();\n const out: NodeShapeData[] = [];\n const seen = new Set<string>([start.id]);\n const queue = [start.id];\n while (queue.length) {\n const current = queue.shift()!;\n for (const childId of index.get(current) ?? []) {\n if (seen.has(childId)) continue;\n seen.add(childId);\n const child = nodeShapeRegistry.get(childId);\n if (child) {\n out.push(child);\n queue.push(childId);\n }\n }\n }\n return out;\n}\n\n/** True when `a` extends `b` (strictly — a shape is not a sub-shape of itself). */\nexport function isSubShapeOf(a: ShapeLike, b: ShapeLike): boolean {\n const target = toNodeShapeData(b);\n if (!target) return false;\n return getSuperShapes(a).some((superShape) => superShape.id === target.id);\n}\n\nexport function addNodeShapeToShapeClass(\n nodeShape: NodeShapeData,\n shapeClass: typeof Shape,\n) {\n if (!nodeShape?.id) {\n return;\n }\n // Dev guardrail for IDENTITY duplication. Shape URIs embed `constructor.name`\n // (getNodeShapeUri). If a bundler emits >1 copy of a framework package, the copies\n // are renamed `Person`→`Person2`/`3`, so a mangled URI registers alongside the clean\n // one — the exact failure that silently breaks cross-runtime shape lookup (`Person3`\n // on the FE ≠ `Person` on the backend). Warn ONCE per base so a build-config\n // regression (e.g. a dropped `optimizeDeps.exclude`) surfaces loudly instead of\n // no-op'ing a query at forward time.\n //\n // This used to be dev-only, on the reasoning that production is minified and\n // the check would false-fire. It does not: full minification renames a class\n // to something like `za`, so `base === id` and nothing fires. What DOES fire\n // is the case worth catching — a bundler appending a digit to disambiguate\n // `BackendAPIStore` from the ontology term of the same name, which is exactly\n // the collision that breaks shape lookup, and it only happens in a production\n // build. Suppressing the warning there hid it from the one place it occurs.\n {\n const id = nodeShape.id;\n const base = id.replace(/\\d+$/, '');\n const existing = nodeShapeToShapeClass.get(base);\n if (base !== id && existing && !warnedDuplicateBases.has(base)) {\n // A real duplicate is the SAME logical shape (same targetClass) registered under\n // a mangled name; a legit digit-suffixed sibling (e.g. `OAuth2` vs `OAuth`)\n // targets a different class. Warn only when they match (or targetClass is absent).\n const newTarget = (shapeClass as any).targetClass?.id;\n const existingTarget = (existing as any).targetClass?.id;\n if (!newTarget || !existingTarget || newTarget === existingTarget) {\n warnedDuplicateBases.add(base);\n console.warn(\n `[linked] Shape identity duplication: '${id}' registered alongside '${base}'. ` +\n `A bundler emitted >1 copy of this package — cross-runtime shape lookup will ` +\n `break. Check the cli vite-config single-instance levers (optimizeDeps.exclude ` +\n `/ ssr.noExternal).`,\n );\n }\n }\n }\n nodeShapeToShapeClass.set(nodeShape.id, shapeClass);\n // The class-backed shape goes into the primary registry too, so metadata consumers\n // see one map regardless of how a shape was declared. This also bumps the version,\n // which invalidates every derived cache immediately rather than on a next-tick timer.\n registerNodeShape(nodeShape);\n}\n\n/**\n * The constructor for a shape IRI — an authored class if there is one, otherwise one\n * derived from the registered metadata.\n *\n * This is what the query layer wants in every case, and `getShapeClass` alone is not:\n * it answers `undefined` for a shape that exists only as data, which is every shape\n * authored in a project. Five call sites used to spell this fallback out by hand, in\n * four different ways.\n *\n * `getShapeClass` is NOT consulted first. `getOrCreateShapeAdapter` already returns the\n * authored class when one exists, and a class-backed shape is always mirrored into the\n * primary registry, so the adapter path cannot miss a shape `getShapeClass` would find.\n */\nexport function resolveShapeConstructor(\n nodeShape: NodeReferenceValue | {id: string} | string,\n): ShapeConstructor | undefined {\n const id = typeof nodeShape === 'string' ? nodeShape : nodeShape?.id;\n if (!id) return undefined;\n // SAFETY: both paths yield a concrete subclass of Shape with a static .shape —\n // i.e. a ShapeConstructor. Same cast getShapeClass documents.\n return getOrCreateShapeAdapter(id) as unknown as ShapeConstructor | undefined;\n}\n\nexport function getShapeClass(\n nodeShape: NodeReferenceValue | {id: string} | string,\n): ShapeConstructor | undefined {\n const id = typeof nodeShape === 'string' ? nodeShape : nodeShape?.id;\n if (!id) {\n return undefined;\n }\n // SAFETY: The map stores `typeof Shape` (abstract), but registered shapes are always\n // concrete subclasses with a constructor and static .shape — i.e. ShapeConstructor.\n return nodeShapeToShapeClass.get(id) as unknown as ShapeConstructor | undefined;\n}\n\n/**\n * Returns all registered shape classes (keyed by NodeShape URI).\n */\nexport function getAllShapeClasses(): Map<string, typeof Shape> {\n return nodeShapeToShapeClass;\n}\n\n/**\n * Returns all the sub shapes of the given shape\n * That is all the shapes that extend this shape\n * @param shape\n */\n\nexport function getSubShapesClasses(\n shape: typeof Shape | (typeof Shape)[],\n _internalKey?: string,\n): (typeof Shape)[] {\n let key = _internalKey || getKey(shape);\n if (subShapesCacheVersion !== registryState.registryVersion) {\n subShapesCache.clear();\n mostSpecificSubShapesCache.clear();\n subShapesCacheVersion = registryState.registryVersion;\n }\n if (!subShapesCache.has(key)) {\n //apply the hasSuperclass function to the shape\n let filterFunction = applyFnToShapeOrArray(shape, hasSubClass);\n //filter and then sort the results based on their inheritance (most specific classes first, so we use hasSuperClass for the sorting)\n subShapesCache.set(\n key,\n filterShapeClasses(filterFunction).sort((a, b) => {\n return hasSubClass(a, b) ? 1 : -1;\n }),\n );\n }\n //return a copy of the array to prevent it from being modified\n return [...subShapesCache.get(key)];\n}\n\n/**\n * Returns all the superclasses of the given shape\n * That is all the shapes that it extends.\n * Results are sorted from most specific to least specific\n * @param shape\n */\nexport function getSuperShapesClasses(\n shape: typeof Shape | (typeof Shape)[],\n): (typeof Shape)[] {\n //apply the hasSuperclass function to the shape\n let filterFunction = applyFnToShapeOrArray(shape, hasSuperClass);\n //filter and then sort the results based on their inheritance\n return filterShapeClasses(filterFunction).sort((a, b) => {\n return hasSubClass(a, b) ? 1 : -1;\n });\n}\n\nexport function getPropertyShapeByLabel(\n shapeClass: typeof Shape,\n label: string,\n): PropertyShapeData | undefined {\n if (!shapeClass.shape) return undefined;\n return getPropertyShape(shapeClass.shape, label, true);\n}\n\n/**\n * True when `a` extends `b`.\n *\n * Inheritance is read from `nodeShape.extends` (data), not from the JS prototype chain.\n * `applyLinkedShape` derives `extends` FROM the prototype chain, so for a class-backed\n * shape the two agree — but only the data form also works for a shape that has no\n * class, which is the whole point. The prototype comparison is kept as a fallback for\n * classes that are not registered as shapes at all (an abstract intermediate class).\n */\nexport function hasSuperClass(a: ShapeLike, b: ShapeLike) {\n if (!a || !b) return false;\n const aData = toNodeShapeData(a);\n const bData = toNodeShapeData(b);\n if (aData && bData) return isSubShapeOf(aData, bData);\n return typeof a === 'function' && typeof b === 'function'\n ? (a as Function).prototype instanceof (b as Function)\n : false;\n}\n\n/** True when `b` extends `a` — the mirror of {@link hasSuperClass}. */\nexport function hasSubClass(a: ShapeLike, b: ShapeLike) {\n return hasSuperClass(b, a);\n}\n\nfunction applyFnToShapeOrArray(shape, filterFn) {\n if (Array.isArray(shape)) {\n return (shapeClass) => {\n //returns true if one of the given shapes extends the shapeClass passed as argument\n return (shape as Function[]).some((s) => filterFn(s, shapeClass));\n };\n } else {\n //first argument will be the given shape class, second argument will be each stored shape class in the map\n //will filter down where the given shape extends the stored shape\n return filterFn.bind(null, shape);\n }\n}\n\nfunction filterShapeClasses(filterFn) {\n let result = [];\n nodeShapeToShapeClass.forEach((shapeClass) => {\n if (filterFn(shapeClass)) {\n result.push(shapeClass);\n }\n });\n return result;\n}\n\nexport function getLeastSpecificShapeClasses(shapes: ICoreIterable<Shape>) {\n let shapeClasses = shapes.map((shape) =>\n getShapeClass(shape.nodeShape.id),\n );\n return filterShapesToLeastSpecific(shapeClasses);\n}\n\nexport function getMostSpecificSubShapes(\n shape: typeof Shape | (typeof Shape)[],\n): (typeof Shape)[] {\n if (!Array.isArray(shape)) {\n shape = [shape];\n }\n //get the subshapes of the given shapes\n let key = shape.map((s) => s.name).join(',');\n if (subShapesCacheVersion !== registryState.registryVersion) {\n subShapesCache.clear();\n mostSpecificSubShapesCache.clear();\n subShapesCacheVersion = registryState.registryVersion;\n }\n if (!mostSpecificSubShapesCache.has(key)) {\n //get the subshapes of the given shapes\n let subShapes: (typeof Shape)[] = getSubShapesClasses(shape, key);\n //filter them down to the most specific ones (that are not extended by any other shape)\n mostSpecificSubShapesCache.set(key, filterShapesToMostSpecific(subShapes));\n }\n return mostSpecificSubShapesCache.get(key);\n}\n\n/**\n * Filters out all shapes that are extended by any other shape in the given set/array\n * @param subShapes\n */\nfunction filterShapesToMostSpecific(subShapes) {\n return subShapes.filter((subShape) => {\n return !subShapes.some((otherSubShape) => {\n return otherSubShape.prototype instanceof subShape;\n });\n });\n}\n\n/**\n * Filters out all shapes that extend any other shape in the given set/array\n * @param shapeClasses\n */\nfunction filterShapesToLeastSpecific(shapeClasses) {\n return shapeClasses.filter((shapeClass) => {\n return !shapeClasses.some((otherShapeClass) => {\n return (\n otherShapeClass !== shapeClass &&\n shapeClass.prototype instanceof otherShapeClass\n );\n });\n });\n}\n\nfunction getKey(shape: typeof Shape | (typeof Shape)[]) {\n return Array.isArray(shape)\n ? shape.map((s) => getShapeKey(s)).join(',')\n : getShapeKey(shape);\n}\n\nfunction getShapeKey(shape: typeof Shape) {\n //return a unique string for each shape\n return (\n resolveTargetClassId(shape.targetClass) ||\n shape.name + shape.prototype.constructor.toString().substring(0, 80)\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"URI.js","sourceRoot":"","sources":["../../../src/utils/URI.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,OAAO,GAAG;IACd;;;;;;;OAOG;IACH,MAAM,CAAC,QAAQ,CAAC,MAAM;QACpB,IAAI,CAAC,MAAM;YAAE,OAAO,MAAM,CAAC;QAC3B,2JAA2J;QAC3J,OAAO,MAAM;aACV,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC;aACtB,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC;aACvB,WAAW,EAAE,CAAC;IACnB,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,GAAW;QACtB,oCAAoC;QACpC,OAAO,kCAAkC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACtD,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,GAAG,aAAuB;QACxC,OAAO,CACL,OAAO,CAAC,GAAG,CAAC,SAAS;YACrB,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAChE,CAAC;IACJ,CAAC;CACF"}
1
+ {"version":3,"file":"URI.js","sourceRoot":"","sources":["../../../src/utils/URI.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,OAAO,GAAG;IACd;;;;;;;OAOG;IACH,MAAM,CAAC,QAAQ,CAAC,MAAM;QACpB,IAAI,CAAC,MAAM;YAAE,OAAO,MAAM,CAAC;QAC3B,2JAA2J;QAC3J,OAAO,MAAM;aACV,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC;aACtB,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC;aACvB,WAAW,EAAE,CAAC;IACnB,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,GAAW;QACtB,oCAAoC;QACpC,OAAO,kCAAkC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACtD,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,GAAG,aAAuB;QACxC,OAAO,CACL,OAAO,CAAC,GAAG,CAAC,SAAS;YACrB,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAChE,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nexport class URI {\n /**\n * Function: sanitize\n * Returns a sanitized string, typically for URLs.\n *\n * Parameters:\n * $string - The string to sanitize.\n * $force_lowercase - Force the string to lowercase?\n */\n static sanitize(string) {\n if (!string) return string;\n //\\u200B is the ZERO WIDTH SPACE, often introduced by WYSIWYG editors. This causes a hyphen (-) at the end of a string sometimes, so we filter it out first\n return string\n .replace(/\\u200B/g, '')\n .replace(/[^\\w]+/g, '-')\n .toLowerCase();\n }\n\n static isURI(uri: string) {\n //must have a scheme followed by ://\n return /([A-Za-z][A-Za-z0-9+\\-.]*)\\:\\/\\//.test(uri);\n }\n\n /**\n * Generate a new URI based on the given URI components (labels / identifiers).\n * This URI will start with the DATA_ROOT environment variable\n * @param uriComponents\n */\n static generate(...uriComponents: string[]) {\n return (\n process.env.DATA_ROOT +\n uriComponents.filter(Boolean).map(encodeURIComponent).join('/')\n );\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"cached.js","sourceRoot":"","sources":["../../../src/utils/cached.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,oBAAoB,CAAC;AAIzC,8EAA8E;AAC9E,gFAAgF;AAChF,+EAA+E;AAC/E,qCAAqC;AACrC,MAAM,MAAM,GAAG,IAAI,OAAO,EAAsC,CAAC;AAEjE;;;;;;;;;;;;GAYG;AACH,MAAM,U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D,IAAI,KAAK,CAAC,OAAO;YAAE,MAAM,KAAK,CAAC,KAAK,CAAC;QACrC,OAAO,KAAK,CAAC,KAAK,CAAC;IACrB,CAAC;SAAM,CAAC;QACN,OAAO,EAAE,EAAE,CAAC;IACd,CAAC;AACH,CAAC","sourcesContent":["import {Shape} from '../shapes/Shape.js';\n\ntype CacheEntry = {timeout: number; value: any; isError: boolean};\n\n// Per-function caches. Keying by the function identity (WeakMap) instead of a\n// single global string map means two different functions with identical args no\n// longer collide, and a function's cache is reclaimed once the function itself\n// is unreferenced (bounding growth).\nconst _cache = new WeakMap<() => any, Map<string, CacheEntry>>();\n\n/**\n * Caches the result of a function call based on its arguments for a specified time.\n * Arguments are converted to strings for comparison.\n * Use cacheTimeMs = 0 to disable caching.\n * Use cacheTimeMs = Infinity to never expire the cache.\n * When `alsoCacheErrors` is set, a thrown error is remembered for the window so\n * the function is not re-invoked — but it is re-thrown to the caller, never\n * returned as if it were a value.\n * @param fn\n * @param args\n * @param cacheTimeMs\n * @param alsoCacheErrors\n */\nexport function cached(fn: () => any, args: any[], cacheTimeMs?: number,alsoCacheErrors?: boolean) {\n if (cacheTimeMs !== 0) {\n const now = Date.now();\n const keyArgs = args.map((a) => {\n if (a instanceof Shape) {\n return a.id ?? a.uri;\n } else if (a && typeof a === 'object' && 'id' in a) {\n return (a as {id: string}).id;\n } else {\n return a?.toString();\n }\n });\n const key = JSON.stringify(keyArgs);\n let fnCache = _cache.get(fn);\n if (!fnCache) {\n fnCache = new Map<string, CacheEntry>();\n _cache.set(fn, fnCache);\n }\n let entry = fnCache.get(key);\n if (entry && entry.timeout < now) {\n fnCache.delete(key);\n entry = undefined;\n }\n if (!entry) {\n try {\n entry = {timeout: now + cacheTimeMs, value: fn(), isError: false};\n } catch (e) {\n if (alsoCacheErrors) {\n entry = {timeout: now + cacheTimeMs, value: e, isError: true};\n } else {\n throw e;\n }\n }\n fnCache.set(key, entry);\n }\n if (entry.isError) throw entry.value;\n return entry.value;\n } else {\n return fn();\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"loadStores.js","sourceRoot":"","sources":["../../../src/utils/loadStores.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,qEAAqE;AACrE,wEAAwE;AACxE,qEAAqE;AACrE,EAAE;AACF,qDAAqD;;;;;;;;;;AAIrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,UAAgB,UAAU,CAC9B,MAAsB;;;QAEtB,MAAM,MAAM,GAAsB,EAAE,CAAC;QACrC,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC7D,0EAA0E;YAC1E,0EAA0E;YAC1E,0EAA0E;YAC1E,yDAAyD;YACzD,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACtC,MAAM,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAG,CAAC;YACjD,MAAM,UAAU,GACd,MAAA,CAAC,GAAG,IAAK,GAA+B,CAAC,UAAU,CAAC,CAAC,mCACrD,CAAC,GAAG,IAAK,GAA2B,CAAC,OAAO,CAAC,CAAC;YAChD,IAAI,OAAO,UAAU,KAAK,UAAU,EAAE,CAAC;gBACrC,MAAM,IAAI,KAAK,CACb,sDAAsD,KAAK,CAAC,KAAK,gBAAgB,KAAK,KAAK;oBACzF,4BAA4B,UAAU,wCAAwC,CACjF,CAAC;YACJ,CAAC;YACD,MAAM,CAAC,KAAK,CAAC,GAAG,IAAK,UAAsC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC5E,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CAAA"}
1
+ {"version":3,"file":"loadStores.js","sourceRoot":"","sources":["../../../src/utils/loadStores.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,qEAAqE;AACrE,wEAAwE;AACxE,qEAAqE;AACrE,EAAE;AACF,qDAAqD;;;;;;;;;;AAIrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,UAAgB,UAAU,CAC9B,MAAsB;;;QAEtB,MAAM,MAAM,GAAsB,EAAE,CAAC;QACrC,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC7D,0EAA0E;YAC1E,0EAA0E;YAC1E,0EAA0E;YAC1E,yDAAyD;YACzD,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACtC,MAAM,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAG,CAAC;YACjD,MAAM,UAAU,GACd,MAAA,CAAC,GAAG,IAAK,GAA+B,CAAC,UAAU,CAAC,CAAC,mCACrD,CAAC,GAAG,IAAK,GAA2B,CAAC,OAAO,CAAC,CAAC;YAChD,IAAI,OAAO,UAAU,KAAK,UAAU,EAAE,CAAC;gBACrC,MAAM,IAAI,KAAK,CACb,sDAAsD,KAAK,CAAC,KAAK,gBAAgB,KAAK,KAAK;oBACzF,4BAA4B,UAAU,wCAAwC,CACjF,CAAC;YACJ,CAAC;YACD,MAAM,CAAC,KAAK,CAAC,GAAG,IAAK,UAAsC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC5E,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CAAA","sourcesContent":["// Backend-side store loader. Lives in its own file so that frontend\n// bundlers (webpack) consuming parseDatasetsConfig don't pull in the\n// dynamic-import code below — webpack flags `import(variableString)` as\n// a critical dependency when it can't analyse the target statically.\n//\n// Backends import this directly; frontends never do.\n\nimport type {DatasetsConfig} from './parseDatasetsConfig.js';\n\n/**\n * Dynamically imports each alias's `store` (an npm specifier) and\n * instantiates the resolved class with the entry's `config` verbatim —\n * `new StoreClass(entry.config)`. Returns alias → store.\n *\n * Convention: the last segment of the `store` path is the named export\n * to use (e.g. `@_linked/fuseki/shapes/FusekiStore` → `FusekiStore`).\n * Falls back to the module's `default` export if the named export is\n * absent. Each store class must accept a single config-object argument.\n *\n * Async + uses runtime dynamic import; works in Node where the module\n * specifier can be resolved at runtime. Frontends should instead\n * import each store class explicitly in their storage-config file and\n * instantiate per alias by hand (webpack can't bundle\n * `import(variableString)`).\n *\n * @example\n * ```ts\n * import rawConfig from './linked.backend.datasets.json' assert { type: 'json' };\n * import { parseDatasetsConfig } from '@_linked/core/utils/parseDatasetsConfig';\n * import { loadStores } from '@_linked/core/utils/loadStores';\n * import { LinkedStorage } from '@_linked/core/utils/LinkedStorage';\n *\n * const config = parseDatasetsConfig(rawConfig, process.env);\n * const stores = await loadStores(config);\n * LinkedStorage.setDefaultDataset(stores.appData);\n * ```\n *\n * @param config Parsed config from {@link parseDatasetsConfig}.\n * @returns Map of alias → constructed store instance.\n * @throws If a `store` path can't be resolved to a class export.\n */\nexport async function loadStores<T = unknown>(\n config: DatasetsConfig,\n): Promise<Record<string, T>> {\n const stores: Record<string, T> = {};\n for (const [alias, entry] of Object.entries(config.datasets)) {\n // SECURITY: `entry.store` is a module specifier loaded and executed here.\n // It must come from a trusted developer artifact (datasets.json) and must\n // NEVER be attacker-influenced — an arbitrary specifier is arbitrary code\n // execution. Do not source this from request/user input.\n const mod = await import(entry.store);\n const exportName = entry.store.split('/').pop()!;\n const StoreClass =\n (mod && (mod as Record<string, unknown>)[exportName]) ??\n (mod && (mod as {default?: unknown}).default);\n if (typeof StoreClass !== 'function') {\n throw new Error(\n `loadStores: could not resolve a class export from \"${entry.store}\" for alias \"${alias}\". ` +\n `Expected a named export \"${exportName}\" or a default export that is a class.`,\n );\n }\n stores[alias] = new (StoreClass as new (cfg: unknown) => T)(entry.config);\n }\n return stores;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"par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AO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,qBAAqB,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;IACzD,CAAC;IACD,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACvC,MAAM,GAAG,GAA4B,EAAE,CAAC;QACxC,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,KAAgC,CAAC,EAAE,CAAC;YAChE,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC;gBAAE,SAAS,CAAC,uBAAuB;YAC1D,GAAG,CAAC,GAAG,CAAC,GAAG,qBAAqB,CAC7B,KAAiC,CAAC,GAAG,CAAC,EACvC,GAAG,CACJ,CAAC;QACJ,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,6EAA6E;AAC7E,gDAAgD;AAChD,MAAM,SAAS,GAAG,mCAAmC,CAAC;AAEtD,SAAS,aAAa,CACpB,KAAa,EACb,GAAuC;IAEvC,OAAO,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,OAAe,EAAE,YAAqB,EAAE,EAAE;QAChF,MAAM,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC;QACvB,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,EAAE;YAAE,OAAO,CAAC,CAAC;QAC1C,IAAI,YAAY,KAAK,SAAS;YAAE,OAAO,YAAY,CAAC;QACpD,MAAM,IAAI,KAAK,CACb,qBAAqB,OAAO,iEAAiE,CAC9F,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["// Pure parser + dispatcher for linked.{backend,frontend}.datasets.json.\n//\n// Per the spec in docs/backlog/016-ejection-export-flow.md:\n//\n// {\n// \"datasets\": {\n// \"<alias>\": {\n// \"store\": \"<npm-import-path>\",\n// \"config\": { /* passed verbatim to the store's constructor */ }\n// }\n// }\n// }\n//\n// `store` is an npm import path string (e.g. \"@_linked/fuseki/shapes/FusekiStore\").\n// `config` is the store class's own concern — the runtime never inspects it.\n// `${VAR}` / `${VAR:-default}` placeholders inside string values are resolved\n// against an env map at parse time.\n\n/** One entry under `datasets`. Keyed by alias name in the parent object. */\nexport interface DatasetEntry {\n /** npm import path to the IDataset class — e.g. \"@_linked/fuseki/shapes/FusekiStore\". */\n store: string;\n /** Constructor argument forwarded to the store class. Shape is store-specific. */\n config: Record<string, unknown>;\n}\n\n/** Top-level structure of linked.{backend,frontend}.datasets.json. */\nexport interface DatasetsConfig {\n /** Alias → store entry. */\n datasets: Record<string, DatasetEntry>;\n /** Reserved for future top-level sections (fileStorage, services, etc.). */\n [section: string]: unknown;\n}\n\n/**\n * Parse + env-resolve a raw datasets config object.\n *\n * - Requires a top-level `datasets` object (other top-level sections are passed\n * through unchanged for future extension).\n * - Resolves `${VAR}` and `${VAR:-default}` placeholders against `env` recursively\n * across all string leaves.\n * - Strips keys starting with `_` (treated as comments / `_note` fields).\n * - Throws on a referenced env var with no default that is unset or empty.\n *\n * Pure + browser-safe — no file I/O, no dynamic imports. Use this on both\n * backend and frontend. The companion `loadStores` (separate file) does the\n * runtime dynamic-import dispatch for the backend.\n *\n * @example Backend\n * ```ts\n * import rawConfig from './linked.backend.datasets.json' assert { type: 'json' };\n * const config = parseDatasetsConfig(rawConfig, process.env);\n * ```\n *\n * @example Frontend\n * ```ts\n * import rawConfig from './linked.frontend.datasets.json' assert { type: 'json' };\n * // No runtime env in the browser; pass empty {}\n * const config = parseDatasetsConfig(rawConfig, {});\n * const appData = new BackendAPIStore(config.datasets.appData.config);\n * ```\n *\n * @param raw Parsed JSON object (or anything object-shaped). Throws otherwise.\n * @param env Env map. Defaults to {} (no interpolation).\n * @returns Typed, env-resolved {@link DatasetsConfig}.\n * @throws On missing/malformed `datasets`, on malformed alias entry, or\n * on an unresolved `${VAR}` with no default.\n */\nexport function parseDatasetsConfig(\n raw: unknown,\n env: Record<string, string | undefined> = {},\n): DatasetsConfig {\n if (!raw || typeof raw !== 'object' || Array.isArray(raw)) {\n throw new Error(\n 'Invalid datasets config: expected a top-level JSON object',\n );\n }\n const resolved = resolveInterpolations(raw, env) as Record<string, unknown>;\n const datasets = resolved.datasets;\n if (!datasets || typeof datasets !== 'object' || Array.isArray(datasets)) {\n throw new Error(\n 'Invalid datasets config: missing or malformed \"datasets\" section',\n );\n }\n for (const [alias, entry] of Object.entries(datasets)) {\n if (!entry || typeof entry !== 'object' || Array.isArray(entry)) {\n throw new Error(\n `Invalid datasets config: alias \"${alias}\" must be an object`,\n );\n }\n const e = entry as DatasetEntry;\n if (typeof e.store !== 'string' || !e.store) {\n throw new Error(\n `Invalid datasets config: alias \"${alias}\" is missing a string \"store\" (npm import path)`,\n );\n }\n if (e.config !== undefined && (typeof e.config !== 'object' || Array.isArray(e.config))) {\n throw new Error(\n `Invalid datasets config: alias \"${alias}\" \"config\" must be an object if present`,\n );\n }\n if (e.config === undefined) e.config = {};\n }\n return resolved as DatasetsConfig;\n}\n\nfunction resolveInterpolations(\n value: unknown,\n env: Record<string, string | undefined>,\n): unknown {\n if (typeof value === 'string') return resolveString(value, env);\n if (Array.isArray(value)) {\n return value.map((v) => resolveInterpolations(v, env));\n }\n if (value && typeof value === 'object') {\n const out: Record<string, unknown> = {};\n for (const key of Object.keys(value as Record<string, unknown>)) {\n if (key.startsWith('_')) continue; // _note, _comment, ...\n out[key] = resolveInterpolations(\n (value as Record<string, unknown>)[key],\n env,\n );\n }\n return out;\n }\n return value;\n}\n\n// Matches ${VAR} or ${VAR:-default}. VAR is uppercase alphanum + underscore.\n// Default text may contain anything except `}`.\nconst INTERP_RE = /\\$\\{([A-Z0-9_]+)(?::-([^}]*))?\\}/g;\n\nfunction resolveString(\n input: string,\n env: Record<string, string | undefined>,\n): string {\n return input.replace(INTERP_RE, (_full, varName: string, defaultValue?: string) => {\n const v = env[varName];\n if (v !== undefined && v !== '') return v;\n if (defaultValue !== undefined) return defaultValue;\n throw new Error(\n `Required env var \"${varName}\" is not set and has no default (referenced in datasets config)`,\n );\n });\n}\n\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@_linked/core",
3
- "version": "2.22.8",
3
+ "version": "2.22.9",
4
4
  "packageManager": "npm@11.19.1",
5
5
  "license": "MIT",
6
6
  "linkedPackage": true,