@_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.
- package/CHANGELOG.md +6 -0
- package/lib/esm/collections/CoreSet.js.map +1 -1
- package/lib/esm/collections/ShapeSet.js.map +1 -1
- package/lib/esm/expressions/Expr.js.map +1 -1
- package/lib/esm/expressions/ExpressionMethods.js.map +1 -1
- package/lib/esm/expressions/ExpressionNode.js.map +1 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/interfaces/ICoreIterable.js.map +1 -1
- package/lib/esm/interfaces/IDataset.js.map +1 -1
- package/lib/esm/interfaces/IFileStore.js.map +1 -1
- package/lib/esm/ontologies/linked-core.js.map +1 -1
- package/lib/esm/ontologies/npm.js.map +1 -1
- package/lib/esm/ontologies/owl.js.map +1 -1
- package/lib/esm/ontologies/rdf.js.map +1 -1
- package/lib/esm/ontologies/rdfs.js.map +1 -1
- package/lib/esm/ontologies/shacl.js.map +1 -1
- package/lib/esm/ontologies/xsd.js.map +1 -1
- package/lib/esm/package.js.map +1 -1
- package/lib/esm/paths/PropertyPathExpr.js.map +1 -1
- package/lib/esm/paths/normalizePropertyPath.js.map +1 -1
- package/lib/esm/paths/pathExprToSparql.js.map +1 -1
- package/lib/esm/queries/AskBuilder.js.map +1 -1
- package/lib/esm/queries/AskQuery.js.map +1 -1
- package/lib/esm/queries/ContextRef.js.map +1 -1
- package/lib/esm/queries/CountBuilder.js.map +1 -1
- package/lib/esm/queries/CountQuery.js.map +1 -1
- package/lib/esm/queries/CreateBuilder.js.map +1 -1
- package/lib/esm/queries/CreateQuery.js.map +1 -1
- package/lib/esm/queries/DeleteBuilder.js.map +1 -1
- package/lib/esm/queries/DeleteQuery.js.map +1 -1
- package/lib/esm/queries/DslJsonExpression.js.map +1 -1
- package/lib/esm/queries/FieldSet.js.map +1 -1
- package/lib/esm/queries/IRAliasScope.js.map +1 -1
- package/lib/esm/queries/IRCanonicalize.js.map +1 -1
- package/lib/esm/queries/IRDesugar.js.map +1 -1
- package/lib/esm/queries/IRLower.js.map +1 -1
- package/lib/esm/queries/IRMutation.js.map +1 -1
- package/lib/esm/queries/IRPipeline.js.map +1 -1
- package/lib/esm/queries/IRProjection.js.map +1 -1
- package/lib/esm/queries/IntermediateRepresentation.js.map +1 -1
- package/lib/esm/queries/MutationQuery.js.map +1 -1
- package/lib/esm/queries/MutationSerialization.js.map +1 -1
- package/lib/esm/queries/MutationThenable.js.map +1 -1
- package/lib/esm/queries/PropertyPath.js.map +1 -1
- package/lib/esm/queries/ProxiedPathBuilder.js.map +1 -1
- package/lib/esm/queries/QueryBuilder.js.map +1 -1
- package/lib/esm/queries/QueryBuilderSerialization.js.map +1 -1
- package/lib/esm/queries/QueryContext.js.map +1 -1
- package/lib/esm/queries/QueryFactory.js.map +1 -1
- package/lib/esm/queries/SelectQuery.js.map +1 -1
- package/lib/esm/queries/UpdateBuilder.js.map +1 -1
- package/lib/esm/queries/UpdateQuery.js.map +1 -1
- package/lib/esm/queries/fromJSON.js.map +1 -1
- package/lib/esm/queries/lower.js.map +1 -1
- package/lib/esm/queries/lowerMutationJSON.js.map +1 -1
- package/lib/esm/queries/mutationLowerSpec.js.map +1 -1
- package/lib/esm/queries/queryDispatch.js.map +1 -1
- package/lib/esm/queries/reservedQueryNames.js.map +1 -1
- package/lib/esm/queries/resolveShape.js.map +1 -1
- package/lib/esm/queries/wireVersion.js.map +1 -1
- package/lib/esm/shapes/List.js.map +1 -1
- package/lib/esm/shapes/PathNode.js.map +1 -1
- package/lib/esm/shapes/SHACL.js.map +1 -1
- package/lib/esm/shapes/Shape.js.map +1 -1
- package/lib/esm/shapes/nodeShapeData.js.map +1 -1
- package/lib/esm/shapes/nodeShapeWire.js.map +1 -1
- package/lib/esm/shapes/propertyShapeTerms.js.map +1 -1
- package/lib/esm/shapes/registerRuntimeShape.js.map +1 -1
- package/lib/esm/shapes/serializePathToNodeData.js.map +1 -1
- package/lib/esm/shapes/syncShapes.js.map +1 -1
- package/lib/esm/shapes/validation.js.map +1 -1
- package/lib/esm/sparql/SparqlAlgebra.js.map +1 -1
- package/lib/esm/sparql/SparqlDataset.js.map +1 -1
- package/lib/esm/sparql/algebraToString.js.map +1 -1
- package/lib/esm/sparql/index.js.map +1 -1
- package/lib/esm/sparql/irToAlgebra.js.map +1 -1
- package/lib/esm/sparql/resultMapping.js.map +1 -1
- package/lib/esm/sparql/sparqlUtils.js.map +1 -1
- package/lib/esm/utils/LinkedErrorLogging.js.map +1 -1
- package/lib/esm/utils/LinkedFileStorage.js.map +1 -1
- package/lib/esm/utils/LinkedStorage.js.map +1 -1
- package/lib/esm/utils/NameSpace.js.map +1 -1
- package/lib/esm/utils/NodeReference.js.map +1 -1
- package/lib/esm/utils/Package.js.map +1 -1
- package/lib/esm/utils/Prefix.js.map +1 -1
- package/lib/esm/utils/ShapeClass.js.map +1 -1
- package/lib/esm/utils/URI.js.map +1 -1
- package/lib/esm/utils/cached.js.map +1 -1
- package/lib/esm/utils/loadStores.js.map +1 -1
- package/lib/esm/utils/parseDatasetsConfig.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateBuilder.js","sourceRoot":"","sources":["../../../src/queries/UpdateBuilder.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAC,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAC,oBAAoB,EAAC,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAC,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAC,uBAAuB,EAAC,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAC,YAAY,EAAE,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAC,mBAAmB,EAAE,eAAe,EAAE,sBAAsB,EAAC,MAAM,mBAAmB,CAAC;AAC/F,OAAO,EAAC,gBAAgB,EAAE,gBAAgB,EAAC,MAAM,iBA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C;YACpD,CAAC;YACD,OAAO,MAAoB,CAAC;QAC9B,CAAC;KAAA;CAEF","sourcesContent":["import {Shape, type ShapeConstructor} from '../shapes/Shape.js';\nimport {resolveShape} from './resolveShape.js';\nimport {type AddId, type UpdatePartial, NodeReferenceValue} from './QueryFactory.js';\nimport {MutationQueryFactory} from './MutationQuery.js';\nimport {MutationThenable} from './MutationThenable.js';\nimport {resolveMutationDispatch} from './queryDispatch.js';\nimport type {IDataset} from '../interfaces/IDataset.js';\nimport {WIRE_VERSION, assertWireVersion} from './wireVersion.js';\nimport {PendingQueryContext, getQueryContext, UnresolvedContextError} from './QueryContext.js';\nimport {encodeContextRef, isContextRefJSON} from './ContextRef.js';\nimport type {NodeShapeData} from '../shapes/SHACL.js';\nimport {type WhereClause, type WherePath, processWhereClause} from './SelectQuery.js';\nimport type {ExpressionUpdateProxy, ExpressionUpdateResult} from '../expressions/ExpressionMethods.js';\nimport {\n encodeNodeData,\n decodeNodeDataToRaw,\n type UpdateMutationJSON,\n type UpsertMutationJSON,\n} from './MutationSerialization.js';\nimport {serializeWherePath, deserializeWherePath} from './QueryBuilderSerialization.js';\nimport type {UpdateLowerSpec} from './mutationLowerSpec.js';\n\ntype UpdateMode = 'for' | 'forAll' | 'where';\n\n/**\n * Internal state bag for UpdateBuilder.\n */\ninterface UpdateBuilderInit<S extends Shape> {\n shape: ShapeConstructor<S>;\n data?: UpdatePartial<S>;\n targetId?: string;\n mode?: UpdateMode;\n whereFn?: WhereClause<S>;\n /** A pre-resolved where path (used by fromJSON; no live callback). */\n where?: WherePath;\n /** A query-context name used as the target subject (resolved at lowering). */\n targetContextName?: string;\n /**\n * Upsert mode — create-or-replace against a known id. Set by `Shape.upsert()`.\n * The builder is otherwise identical to an update, which is why it reuses this class;\n * only the lowered IR kind and the `.where()`/`.forAll()` guards differ.\n */\n upsert?: boolean;\n}\n\n/**\n * An immutable, fluent builder for update mutations.\n *\n * Every mutation method returns a new UpdateBuilder — the original is never modified.\n *\n * Implements PromiseLike so mutations execute on `await`:\n * ```ts\n * const result = await UpdateBuilder.from(Person).for({id: '...'}).set({name: 'Bob'});\n * await UpdateBuilder.from(Person).set({hobby: 'x'}).forAll(); // returns void\n * ```\n *\n * R is the resolved type: AddId<U> for ID-based, void for bulk operations.\n */\nexport class UpdateBuilder<S extends Shape = Shape, U extends UpdatePartial<S> = UpdatePartial<S>, R = AddId<U>>\n extends MutationThenable<R>\n{\n protected readonly _tag = 'UpdateBuilder';\n private readonly _shape: ShapeConstructor<S>;\n private readonly _data?: UpdatePartial<S>;\n private readonly _targetId?: string;\n private readonly _mode?: UpdateMode;\n private readonly _whereFn?: WhereClause<S>;\n private readonly _where?: WherePath;\n private readonly _targetContextName?: string;\n private readonly _upsert: boolean;\n\n private constructor(init: UpdateBuilderInit<S>) {\n super();\n this._shape = init.shape;\n this._data = init.data;\n this._targetId = init.targetId;\n this._mode = init.mode;\n this._whereFn = init.whereFn;\n this._where = init.where;\n this._targetContextName = init.targetContextName;\n this._upsert = init.upsert ?? false;\n }\n\n private clone(overrides: Partial<UpdateBuilderInit<S>> = {}): UpdateBuilder<S, any, any> {\n return new UpdateBuilder<S, any>({\n shape: this._shape,\n data: this._data,\n targetId: this._targetId,\n mode: this._mode,\n whereFn: this._whereFn,\n where: this._where,\n targetContextName: this._targetContextName,\n upsert: this._upsert,\n ...overrides,\n });\n }\n\n // ---------------------------------------------------------------------------\n // Static constructors\n // ---------------------------------------------------------------------------\n\n static from<S extends Shape>(shape: ShapeConstructor<S> | string): UpdateBuilder<S> {\n const resolved = resolveShape<S>(shape);\n return new UpdateBuilder<S>({shape: resolved});\n }\n\n /** Builder for a create-or-replace against a known id. See `Shape.upsert()`. */\n static upsertFrom<S extends Shape>(shape: ShapeConstructor<S> | string): UpdateBuilder<S> {\n const resolved = resolveShape<S>(shape);\n return new UpdateBuilder<S>({shape: resolved, upsert: true});\n }\n\n /** Reconstruct an UpdateBuilder from its DSL-JSON (inverse of `toJSON`). */\n static fromJSON(json: UpdateMutationJSON | UpsertMutationJSON): UpdateBuilder {\n assertWireVersion(json.v);\n const resolved = resolveShape(json.shape);\n const data = decodeNodeDataToRaw(json.data, resolved.shape) as any;\n\n // Branch on `op` first so each envelope keeps its own narrowed type; an upsert has\n // only the `for` form, so its modes are not the update modes.\n if (json.op === 'upsert') {\n // The type says `mode: 'for'`, but an inbound envelope is untrusted data — the\n // cast keeps the runtime check that the type alone cannot enforce.\n if ((json.mode as string) !== 'for') {\n throw new Error(\n `upsert mode \"${String(json.mode)}\" is invalid — an upsert targets one known id.`,\n );\n }\n if (isContextRefJSON(json.targetId)) {\n return new UpdateBuilder({\n shape: resolved, data, targetContextName: json.targetId['@ctx'], mode: 'for', upsert: true,\n });\n }\n return new UpdateBuilder({shape: resolved, data, targetId: json.targetId, mode: 'for', upsert: true});\n }\n\n if (json.mode === 'for') {\n if (isContextRefJSON(json.targetId)) {\n return new UpdateBuilder({shape: resolved, data, targetContextName: json.targetId['@ctx'], mode: 'for'});\n }\n return new UpdateBuilder({shape: resolved, data, targetId: json.targetId, mode: 'for'});\n }\n if (json.mode === 'forAll') {\n return new UpdateBuilder({shape: resolved, data, mode: 'forAll'});\n }\n const where = deserializeWherePath(resolved.shape, json.where!);\n return new UpdateBuilder({shape: resolved, data, mode: 'where', where});\n }\n\n // ---------------------------------------------------------------------------\n // Fluent API\n // ---------------------------------------------------------------------------\n\n /** Target a specific entity by ID. */\n for(id: string | NodeReferenceValue | PendingQueryContext): UpdateBuilder<S, U, AddId<U>> {\n if (id instanceof PendingQueryContext) {\n return this.clone({targetContextName: id.contextName, targetId: undefined, mode: 'for'}) as unknown as UpdateBuilder<S, U, AddId<U>>;\n }\n const resolvedId = typeof id === 'string' ? id : id.id;\n return this.clone({targetId: resolvedId, targetContextName: undefined, mode: 'for'}) as unknown as UpdateBuilder<S, U, AddId<U>>;\n }\n\n /** Update all instances of this shape type. Returns void. */\n forAll(): UpdateBuilder<S, U, void> {\n this._assertNotUpsert('forAll()');\n return this.clone({mode: 'forAll', targetId: undefined, whereFn: undefined}) as unknown as UpdateBuilder<S, U, void>;\n }\n\n /** Update instances matching a condition. Returns void. */\n where(fn: WhereClause<S>): UpdateBuilder<S, U, void> {\n this._assertNotUpsert('where()');\n return this.clone({mode: 'where', whereFn: fn, targetId: undefined}) as unknown as UpdateBuilder<S, U, void>;\n }\n\n /**\n * An upsert has to know which node to create, so it only makes sense against a single\n * known id. `forAll()` and `where()` select existing nodes — there is nothing to create\n * when they match nothing, and no single id to create it under.\n */\n private _assertNotUpsert(method: string): void {\n if (this._upsert) {\n throw new Error(\n `upsert does not support .${method} — an upsert targets one known id, ` +\n `so use .for(id). (.${method} selects existing nodes, which is what update does.)`,\n );\n }\n }\n\n /** Replace the update data. */\n set(fn: (p: ExpressionUpdateProxy<S>) => ExpressionUpdateResult<S>): UpdateBuilder<S, any, R>;\n set<NewU extends UpdatePartial<S>>(data: NewU): UpdateBuilder<S, NewU, R>;\n set(data: any): any {\n return this.clone({data}) as any;\n }\n\n // ---------------------------------------------------------------------------\n // Build & execute\n // ---------------------------------------------------------------------------\n\n /** Discriminator for the free `lower()` function and dataset routing. */\n readonly __queryKind = 'update' as const;\n\n /** The shape this query targets — the routing key datasets/`LinkedStorage` use. */\n get shape(): NodeShapeData {\n return this._shape.shape;\n }\n\n /** @internal The IR-free lowering spec consumed by `lower()`. Validates inputs. */\n _lowerSpec(): UpdateLowerSpec<S> {\n if (!this._data) {\n throw new Error(\n 'UpdateBuilder requires .set(data) before it can be lowered. Specify what to update.',\n );\n }\n\n const mode = this._mode || (this._targetId ? 'for' : undefined);\n\n if (mode === 'forAll') {\n return {shapeClass: this._shape, data: this._data, mode: 'forAll'};\n }\n\n if (mode === 'where') {\n if (!this._whereFn && !this._where) {\n throw new Error('UpdateBuilder.where() requires a condition callback.');\n }\n const wherePath =\n this._where ?? processWhereClause(this._whereFn!, this._shape);\n return {shapeClass: this._shape, data: this._data, mode: 'where', wherePath};\n }\n\n // Default: ID-based update (target id may come from a query context)\n const targetId = this._resolveTargetId();\n if (!targetId) {\n if (this._targetContextName) {\n throw new UnresolvedContextError(this._targetContextName);\n }\n // A caller arriving from `create({__id: id, ...values})` — which upsert is meant to\n // replace — naturally writes the id into the data object. That form is rejected\n // further down (\"cannot use id in the top level\"), but only once a target exists;\n // without one they would otherwise get a bare \"requires .for(id)\" that never\n // mentions the id they did pass. Name it here instead.\n const strayId = this._strayTopLevelId();\n if (strayId) {\n throw new Error(\n `${this._upsert ? 'upsert' : 'update'} takes the target id in .for(id), not in the data: ` +\n `move \"${strayId}\" out of the data object — ` +\n `${this._upsert ? 'upsert' : 'update'}(values).for({id}). ` +\n `(create() is the one that takes an id in its data, because there it names the node being created.)`,\n );\n }\n throw new Error(\n this._upsert\n ? 'upsert requires .for(id) before it can be lowered — an upsert targets one known id.'\n : 'UpdateBuilder requires .for(id), .forAll(), or .where() before it can be lowered.',\n );\n }\n return {\n shapeClass: this._shape,\n data: this._data,\n mode: 'for',\n targetId,\n ...(this._upsert ? {upsert: true} : {}),\n };\n }\n\n /**\n * The key name of a top-level `id`/`__id` in the update data, if present. Used only to\n * improve the missing-target error; the data object itself is validated downstream.\n */\n private _strayTopLevelId(): string | undefined {\n const data = this._data as Record<string, unknown> | undefined;\n if (!data || typeof data !== 'object') return undefined;\n return ['id', '__id'].find((k) => k in data);\n }\n\n /** Resolve the target id from an explicit id or a query-context reference. */\n private _resolveTargetId(): string | undefined {\n if (this._targetId) return this._targetId;\n if (this._targetContextName) return getQueryContext(this._targetContextName)?.id;\n return undefined;\n }\n\n /**\n * Serialize this update mutation to lightweight DSL-JSON. Normalizes the update\n * data through the IR-free factory base (handles the expression-callback form\n * of `.set()`), and serializes the where clause for `where`-mode updates.\n */\n toJSON(): UpdateMutationJSON | UpsertMutationJSON {\n if (!this._data) {\n throw new Error('UpdateBuilder requires .set(data) before .toJSON().');\n }\n const mode = this._mode || (this._targetId ? 'for' : undefined);\n if (!mode) {\n throw new Error(\n 'UpdateBuilder requires .for(id), .forAll(), or .where() before .toJSON().',\n );\n }\n const fields = new MutationQueryFactory().describe(\n this._shape.shape,\n this._data,\n {validate: 'partial'},\n );\n if (this._upsert && mode !== 'for') {\n throw new Error('upsert requires .for(id) before it can be serialized.');\n }\n const json = {\n v: WIRE_VERSION,\n op: this._upsert ? 'upsert' : 'update',\n shape: this._shape.shape.id,\n mode,\n data: encodeNodeData(fields, this._shape.shape),\n } as UpdateMutationJSON | UpsertMutationJSON;\n if (mode === 'for') {\n if (this._targetContextName) json.targetId = encodeContextRef(this._targetContextName);\n else json.targetId = this._targetId;\n }\n if (mode === 'where') {\n const wherePath = this._where ?? (this._whereFn ? processWhereClause(this._whereFn, this._shape) : undefined);\n if (!wherePath) {\n throw new Error('UpdateBuilder.where() requires a condition callback.');\n }\n // `mode === 'where'` is unreachable for an upsert (guarded in `.where()` and again\n // above), so this branch is always the update envelope.\n (json as UpdateMutationJSON).where = serializeWherePath(wherePath, this._shape.shape);\n }\n return json;\n }\n\n /**\n * Execute the mutation.\n *\n * @param target Optional explicit dataset (a store or a router) to run against. Omitted →\n * the global query dispatch. A `target` runs on that dataset only; the global router is\n * untouched. Rejects if the target dataset doesn't implement update.\n */\n async exec(target?: IDataset): Promise<R> {\n const mode = this._mode || (this._targetId ? 'for' : undefined);\n const result = resolveMutationDispatch('update', target).updateQuery(this);\n // Bulk (forAll/where) resolves to void; id-based resolves to the updated node.\n if (mode === 'forAll' || mode === 'where') {\n return result.then(() => undefined) as Promise<R>;\n }\n return result as Promise<R>;\n }\n\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateQuery.js","sourceRoot":"","sources":["../../../src/queries/UpdateQuery.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"UpdateQuery.js","sourceRoot":"","sources":["../../../src/queries/UpdateQuery.ts"],"names":[],"mappings":"","sourcesContent":["import type {AddId} from './QueryFactory.js';\nimport type {\n IRUpdateMutation,\n IRUpdateWhereMutation,\n IRUpsertMutation,\n} from './IntermediateRepresentation.js';\nimport type {NodeShapeData} from '../shapes/SHACL.js';\nimport type {UpdateMutationJSON, UpsertMutationJSON} from './MutationSerialization.js';\nimport type {UpdateLowerSpec} from './mutationLowerSpec.js';\n\n/**\n * The closed, read-only update query a dataset receives (implemented by\n * `UpdateBuilder`). The IR is `IRUpdateQuery`, produced by `lower(query)` — the\n * IR construction lives in the IR tier, not here, so this module stays IR-free.\n */\nexport interface UpdateQuery {\n readonly __queryKind: 'update';\n readonly shape: NodeShapeData;\n toJSON(): UpdateMutationJSON | UpsertMutationJSON;\n /** @internal IR-free lowering spec consumed by `lower()`. */\n _lowerSpec(): UpdateLowerSpec;\n}\n\n/** The lowered IR for an update mutation (what `lower()` produces). */\nexport type IRUpdateQuery =\n | IRUpdateMutation\n | IRUpdateWhereMutation\n | IRUpsertMutation;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fromJSON.js","sourceRoot":"","sources":["../../../src/queries/fromJSON.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;GAOG;AACH,OAAO,EAAC,aAAa,EAAwB,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAC,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAI/C,OAAO,EAAC,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AASnD,MAAM,UAAU,QAAQ,CACtB,IAAe;IAQf,iBAAiB,CAAE,IAAsB,aAAtB,IAAI,uBAAJ,IAAI,CAAoB,CAAC,CAAC,CAAC;IAC9C,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;QACrD,QA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AAtB,IAAI,uBAAJ,IAAI,CAAoB,CAAC,CAAC,CAAC;IAC9C,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;QACrD,QAAQ,IAAI,CAAC,EAAE,EAAE,CAAC;YAChB,KAAK,KAAK;gBACR,OAAO,UAAU,CAAC,QAAQ,CAAC,IAAoB,CAAC,CAAC;YACnD,KAAK,OAAO;gBACV,OAAO,YAAY,CAAC,QAAQ,CAAC,IAAsB,CAAC,CAAC;YACvD,KAAK,QAAQ;gBACX,OAAO,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACtC,KAAK,QAAQ,CAAC;YACd,KAAK,QAAQ;gBACX,wEAAwE;gBACxE,OAAO,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACtC,KAAK,QAAQ;gBACX,OAAO,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACtC;gBACE,oEAAoE;gBACpE,qEAAqE;gBACrE,uCAAuC;gBACvC,MAAM,IAAI,KAAK,CACb,qBAAqB,MAAM,CAAE,IAAsB,CAAC,EAAE,CAAC,yBAAyB,CACjF,CAAC;QACN,CAAC;IACH,CAAC;IACD,OAAO,aAAa,CAAC,QAAQ,CAAC,IAAwB,CAAC,CAAC;AAC1D,CAAC","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 */\n\n/**\n * Kind-detecting `fromJSON` — rehydrate any query DSL-JSON back into its builder.\n *\n * Ask, count and mutation envelopes carry an `op` discriminator; select envelopes\n * (`QueryBuilderJSON`) do not. This is the inbound boundary helper: a receiving\n * process turns wire JSON into a live query with `fromJSON(json).exec()` (the\n * existing generic dispatch), no per-op routing needed.\n */\nimport {SelectBuilder, type QueryBuilderJSON} from './QueryBuilder.js';\nimport {CreateBuilder} from './CreateBuilder.js';\nimport {UpdateBuilder} from './UpdateBuilder.js';\nimport {DeleteBuilder} from './DeleteBuilder.js';\nimport {AskBuilder} from './AskBuilder.js';\nimport {CountBuilder} from './CountBuilder.js';\nimport type {AskQueryJSON} from './AskQuery.js';\nimport type {CountQueryJSON} from './CountQuery.js';\nimport type {MutationJSON} from './MutationSerialization.js';\nimport {assertWireVersion} from './wireVersion.js';\n\n/** Any query in its wire (DSL-JSON) form. */\nexport type QueryJSON =\n | QueryBuilderJSON\n | AskQueryJSON\n | CountQueryJSON\n | MutationJSON;\n\nexport function fromJSON(\n json: QueryJSON,\n):\n | SelectBuilder\n | AskBuilder\n | CountBuilder\n | CreateBuilder\n | UpdateBuilder\n | DeleteBuilder {\n assertWireVersion((json as {v?: unknown})?.v);\n if (json && typeof json === 'object' && 'op' in json) {\n switch (json.op) {\n case 'ask':\n return AskBuilder.fromJSON(json as AskQueryJSON);\n case 'count':\n return CountBuilder.fromJSON(json as CountQueryJSON);\n case 'create':\n return CreateBuilder.fromJSON(json);\n case 'update':\n case 'upsert':\n // Both reconstruct an UpdateBuilder; the op selects upsert mode inside.\n return UpdateBuilder.fromJSON(json);\n case 'delete':\n return DeleteBuilder.fromJSON(json);\n default:\n // An `op` is present but not one we know — a malformed/corrupted or\n // future-versioned mutation envelope. Fail loud rather than silently\n // reinterpreting it as a select query.\n throw new Error(\n `Unknown query op \"${String((json as {op: unknown}).op)}\" in DSL-JSON envelope.`,\n );\n }\n }\n return SelectBuilder.fromJSON(json as QueryBuilderJSON);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lower.js","sourceRoot":"","sources":["../../../src/queries/lower.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;GAWG;AACH,OAAO,EAAC,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAC,oBAAoB,EAAC,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAC,sBAAsB,EAA4B,MAAM,mBAAmB,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KAAK,QAAQ;YACX,OAAO,WAAW,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC;QACzC,KAAK,QAAQ;YACX,OAAO,WAAW,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC;QACzC,KAAK,QAAQ;YACX,OAAO,WAAW,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC;IAC3C,CAAC;AACH,CAAC","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 */\n\n/**\n * `lower(query)` — turn a live query (builder) into its canonical IR algebra.\n *\n * This is the single, **free** lowering entry point, and the *only* place the\n * canonical-IR pipeline (`IRPipeline` / `IRMutation` / `IRLower` / …) is reached\n * from. The builders are deliberately IR-free: they hand `lower()` a plain\n * \"lowering spec\" (`mutationLowerSpec`) or raw select input, and all IR\n * construction happens here. A client that authors/serializes/forwards queries\n * but never calls `lower()` therefore tree-shakes the entire IR pipeline away.\n * The IR is an implementation detail of stores that want it (e.g. SPARQL) — not\n * the contract.\n */\nimport {buildSelectQuery} from './IRPipeline.js';\nimport {MutationQueryFactory} from './MutationQuery.js';\nimport {isSetModificationValue, type NodeDescriptionValue} from './QueryFactory.js';\nimport {PendingQueryContext} from './QueryContext.js';\nimport {resolveContextId} from './ContextRef.js';\nimport {\n buildCanonicalCreateMutationIR,\n buildCanonicalUpdateMutationIR,\n buildCanonicalUpsertMutationIR,\n buildCanonicalUpdateWhereMutationIR,\n buildCanonicalDeleteMutationIR,\n buildCanonicalDeleteAllMutationIR,\n buildCanonicalDeleteWhereMutationIR,\n} from './IRMutation.js';\nimport {toWhere} from './IRDesugar.js';\nimport {lowerWhereToIR} from './IRLower.js';\nimport type {WherePath} from './SelectQuery.js';\nimport type {\n IRAskQuery,\n IRCountQuery,\n IRSelectQuery,\n} from './IntermediateRepresentation.js';\nimport type {RawAskInput} from './AskQuery.js';\nimport type {RawCountInput} from './CountQuery.js';\nimport type {IRCreateQuery} from './CreateQuery.js';\nimport type {IRUpdateQuery} from './UpdateQuery.js';\nimport type {IRDeleteQuery} from './DeleteQuery.js';\nimport type {\n CreateLowerSpec,\n UpdateLowerSpec,\n DeleteLowerSpec,\n} from './mutationLowerSpec.js';\n\n/** A select query that can be lowered (the select builder). */\nexport type LowerableSelect = {readonly __queryKind: 'select'; toRawInput(): any};\n/** An ask query that can be lowered (the ask builder). */\nexport type LowerableAsk = {readonly __queryKind: 'ask'; toRawInput(): RawAskInput};\n/** A count query that can be lowered (the count builder). */\nexport type LowerableCount = {readonly __queryKind: 'count'; toRawInput(): RawCountInput};\n/** A mutation query that can be lowered (the mutation builders). */\nexport type LowerableCreate = {readonly __queryKind: 'create'; _lowerSpec(): CreateLowerSpec};\nexport type LowerableUpdate = {readonly __queryKind: 'update'; _lowerSpec(): UpdateLowerSpec};\nexport type LowerableDelete = {readonly __queryKind: 'delete'; _lowerSpec(): DeleteLowerSpec};\nexport type LowerableQuery =\n | LowerableSelect\n | LowerableAsk\n | LowerableCount\n | LowerableCreate\n | LowerableUpdate\n | LowerableDelete;\n\n/** Lower a pre-evaluated where path to its canonical IR fragment. */\nfunction lowerWherePath(where: WherePath) {\n return lowerWhereToIR(toWhere(where));\n}\n\n/**\n * Resolve any query-context reference carried as a mutation field value. The\n * builder preserves a live `PendingQueryContext` through normalization (so it can\n * serialize as `{@ctx}`); at lowering a mutation must hit a concrete node, so the\n * context is resolved here and an unset one throws `UnresolvedContextError`.\n */\nfunction resolveValueContexts(val: unknown): unknown {\n if (val instanceof PendingQueryContext) {\n return {id: resolveContextId(val.contextName, true)!};\n }\n if (Array.isArray(val)) {\n return val.map(resolveValueContexts);\n }\n if (val && typeof val === 'object') {\n if (isSetModificationValue(val)) {\n const mod = val as {$add?: unknown[]; $remove?: unknown[]};\n const out: {$add?: unknown[]; $remove?: unknown[]} = {};\n if (mod.$add) out.$add = mod.$add.map(resolveValueContexts);\n if (mod.$remove) out.$remove = mod.$remove.map(resolveValueContexts);\n return out;\n }\n if ('fields' in val) {\n return resolveDescriptionContexts(val as NodeDescriptionValue);\n }\n }\n return val;\n}\n\n/** Deep-resolve context references in a normalized node description (returns a new copy). */\nfunction resolveDescriptionContexts(desc: NodeDescriptionValue): NodeDescriptionValue {\n return {\n ...desc,\n fields: desc.fields.map((f) => ({...f, val: resolveValueContexts(f.val) as typeof f.val})),\n };\n}\n\nfunction lowerCreate(spec: CreateLowerSpec): IRCreateQuery {\n const description = resolveDescriptionContexts(\n new MutationQueryFactory().describe(spec.shapeClass.shape, spec.data, {\n allowTopLevelId: true,\n validate: 'complete',\n }),\n );\n return buildCanonicalCreateMutationIR({shape: spec.shapeClass.shape, description});\n}\n\nfunction lowerUpdate(spec: UpdateLowerSpec): IRUpdateQuery {\n const shape = spec.shapeClass.shape;\n const updates = resolveDescriptionContexts(\n new MutationQueryFactory().describe(shape, spec.data, {validate: 'partial'}),\n );\n if (spec.mode === 'for') {\n return spec.upsert\n ? buildCanonicalUpsertMutationIR({id: spec.targetId!, shape, updates})\n : buildCanonicalUpdateMutationIR({id: spec.targetId!, shape, updates});\n }\n // forAll / where\n const lowered = spec.wherePath ? lowerWherePath(spec.wherePath) : undefined;\n return buildCanonicalUpdateWhereMutationIR({\n shape,\n updates,\n where: lowered?.where,\n wherePatterns: lowered?.wherePatterns,\n });\n}\n\nfunction lowerDelete(spec: DeleteLowerSpec): IRDeleteQuery {\n const shape = spec.shapeClass.shape;\n if (spec.mode === 'all') {\n return buildCanonicalDeleteAllMutationIR({shape});\n }\n if (spec.mode === 'where') {\n const {where, wherePatterns} = lowerWherePath(spec.wherePath!);\n return buildCanonicalDeleteWhereMutationIR({shape, where, wherePatterns});\n }\n // Resolve any context-ref ids ({@ctx}) against the live map — a delete must hit\n // a concrete node, so an unresolved one throws (never a silent `{id: undefined}`).\n const resolvedIds = spec.ids!.map((id) =>\n id instanceof PendingQueryContext\n ? {id: resolveContextId(id.contextName, true)!}\n : id,\n );\n const ids = new MutationQueryFactory().normalizeNodeRefs(resolvedIds);\n return buildCanonicalDeleteMutationIR({shape, ids});\n}\n\n/**\n * Lower an ask to its canonical IR.\n *\n * The shaped case reuses the select pipeline to build the pattern — one\n * implementation of shape scans, traversals, filters and minus — and then keeps\n * only the pattern-bearing part. The rootless (shapeless) case has no pattern to\n * build: it is a bare subject.\n */\nfunction lowerAsk(input: RawAskInput): IRAskQuery {\n if (input.nullSubject) {\n // \"Does the node with no id exist?\" is answered `false` without querying —\n // `AskBuilder.exec` does that before dispatching. Reaching lowering means a\n // store took the builder off the normal path; a subject-less pattern would\n // match every instance of the shape and answer `true`, so refuse it loudly.\n throw new Error(\n 'Cannot lower an ask query with no subject (`.for(null)`). It resolves to ' +\n '`false` without querying — execute it through `exec()` rather than lowering it.',\n );\n }\n const subject = input.subject;\n if (!input.shape) {\n // Shapeless: no rdf:type constraint, so no shape scan and no property refs.\n const id =\n subject instanceof PendingQueryContext\n ? resolveContextId(subject.contextName, true)!\n : (subject as {id?: string} | undefined)?.id;\n return {kind: 'ask', patterns: [], subjectId: id};\n }\n const selected = buildSelectQuery({\n entries: [],\n shape: input.shape,\n subject,\n subjects: input.subjects,\n where: input.where,\n minusEntries: input.minusEntries,\n });\n return {\n kind: 'ask',\n root: selected.root,\n patterns: selected.patterns,\n where: selected.where,\n subjectId: selected.subjectId,\n subjectIds: selected.subjectIds,\n };\n}\n\n/**\n * The variable a root count binds its `COUNT` to.\n *\n * Chosen not to collide with the `a<N>` alias scheme the pipeline generates for\n * the root and every traversal, so it never needs the collision rename\n * `selectToAlgebra` applies to aggregate aliases.\n */\nexport const COUNT_ALIAS = 'count';\n\n/**\n * Lower a count to its canonical IR.\n *\n * Reuses the select pipeline to build the pattern — one implementation of shape\n * scans, traversals, filters and minus — and then keeps only the pattern-bearing\n * part, exactly as {@link lowerAsk} does. The `entries: []` is why nothing is\n * projected: a count has no projection to build.\n */\nfunction lowerCount(input: RawCountInput): IRCountQuery {\n if (input.nullSubject) {\n // \"How many nodes with no id match?\" is answered `0` without querying —\n // `CountBuilder.exec` does that before dispatching. Reaching lowering means a\n // store took the builder off the normal path; a subject-less pattern would\n // count every instance of the shape and report it as the count of one node.\n throw new Error(\n 'Cannot lower a count query with no subject (`.for(null)`). It resolves to ' +\n '`0` without querying — execute it through `exec()` rather than lowering it.',\n );\n }\n if (!input.shape) {\n throw new Error(\n 'Cannot lower a count query with no shape. A shapeless count would count ' +\n 'every node in the store, under any type or none.',\n );\n }\n // A `{\"@ctx\": name}` subject arrives here as a live PendingQueryContext, and\n // `buildSelectQuery` narrows a subject with `'id' in subject` — so an UNRESOLVED\n // one would quietly yield `subjectId: undefined` and the count would be of every\n // instance of the shape, reported as the count of one node. `CountBuilder.exec`\n // answers `0` for that case before dispatching, but this path is reached without\n // it: a receiver that rehydrates an envelope with `fromJSON` and hands the builder\n // straight to a store. Resolve it here, which throws `UnresolvedContextError` when\n // the context is unset — the same \"not ready\" a where-clause reference raises, and\n // never a plausible number.\n const subject =\n input.subject instanceof PendingQueryContext\n ? {id: resolveContextId(input.subject.contextName, true)!}\n : input.subject;\n const selected = buildSelectQuery({\n entries: [],\n shape: input.shape,\n subject,\n subjects: input.subjects,\n where: input.where,\n minusEntries: input.minusEntries,\n });\n return {\n kind: 'count',\n root: selected.root,\n patterns: selected.patterns,\n where: selected.where,\n subjectId: selected.subjectId,\n subjectIds: selected.subjectIds,\n alias: COUNT_ALIAS,\n };\n}\n\nexport function lower(query: LowerableSelect): IRSelectQuery;\nexport function lower(query: LowerableAsk): IRAskQuery;\nexport function lower(query: LowerableCount): IRCountQuery;\nexport function lower(query: LowerableCreate): IRCreateQuery;\nexport function lower(query: LowerableUpdate): IRUpdateQuery;\nexport function lower(query: LowerableDelete): IRDeleteQuery;\nexport function lower(\n query: LowerableQuery,\n):\n | IRSelectQuery\n | IRAskQuery\n | IRCountQuery\n | IRCreateQuery\n | IRUpdateQuery\n | IRDeleteQuery {\n switch (query.__queryKind) {\n case 'select':\n return buildSelectQuery(query.toRawInput());\n case 'ask':\n return lowerAsk(query.toRawInput());\n case 'count':\n return lowerCount(query.toRawInput());\n case 'create':\n return lowerCreate(query._lowerSpec());\n case 'update':\n return lowerUpdate(query._lowerSpec());\n case 'delete':\n return lowerDelete(query._lowerSpec());\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lowerMutationJSON.js","sourceRoot":"","sources":["../../../src/queries/lowerMutationJSON.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,EAAC,gBAAgB,EAAC,MAAM,4BAA4B,CAAC;AAQ5D,OAAO,EAAC,cAAc,EAAC,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAC,YAAY,EAAE,aAAa,EAAC,MAAM,wBAAwB,CAAC;AAEnE,OAAO,EACL,oBAAoB,GAErB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAC,cAAc,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,EAC9B,8BAA8B,EAC9B,mCAAmC,EACnC,8BAA8B,EAC9B,iCAAiC,EACjC,mCAAmC,GACpC,MAAM,iBAAiB,CAAC;AAIzB,OAAO,EAAC,gBAAgB,EAAE,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAC,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AACnD,OAAO,EACL,mBAAmB,EACnB,YAAY,GAIb,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAC,WAAW,EAAsB,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAC,eAAe,EAAoB,MAAM,wBAAwB,CAAC;AAG1E,SAAS,YAAY,CAAC,OAAe;;IACnC,mFAAmF;IACnF,+EAA+E;IAC/E,MAAM,KAAK,GAAG,MAAA,MAAA,aAAa,CAAC,OAAO,CAAC,0CAAE,KAAK,mCAAI,YAAY,CAAC,OAAO,CA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E,EAAE,EAAE,CACvB,gBAAgB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAC,EAAE,EAAE,gBAAgB,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,IAAI,CAAE,EAAC,CAAC,CAAC,CAAC,EAAC,EAAE,EAAC,CACxE;iBACF,CAAC,CAAC;YACL,CAAC;YACD,IAAI,IAAI,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;gBACxB,OAAO,iCAAiC,CAAC,EAAC,KAAK,EAAC,CAAC,CAAC;YACpD,CAAC;YACD,MAAM,EAAC,KAAK,EAAE,aAAa,EAAC,GAAG,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;YAC7D,OAAO,mCAAmC,CAAC,EAAC,KAAK,EAAE,KAAK,EAAE,aAAa,EAAC,CAAC,CAAC;QAC5E,CAAC;IACH,CAAC;AACH,CAAC","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 */\n\n/**\n * Lower mutation DSL-JSON to canonical IR.\n *\n * This is the **IR side** of mutation (de)serialization, kept deliberately\n * separate from the IR-free wire codec in `MutationSerialization.ts`. The\n * canonical-IR builders (`IRMutation` / `IRLower` / …) are reachable only from\n * here and from `lower()`, so a client that serializes mutations to JSON and\n * forwards them (without ever lowering) tree-shakes the whole IR pipeline away.\n */\nimport type {NodeShapeData} from '../shapes/SHACL.js';\nimport {getPropertyShape} from '../shapes/nodeShapeData.js';\nimport {\n type NodeDescriptionValue,\n type PropUpdateValue,\n type SetModificationValue,\n type SinglePropertyUpdateValue,\n type UpdateNodePropertyValue,\n} from './QueryFactory.js';\nimport {ExpressionNode} from '../expressions/ExpressionNode.js';\nimport {getNodeShape, getShapeClass} from '../utils/ShapeClass.js';\nimport type {IRExpression, IRGraphPattern} from './IntermediateRepresentation.js';\nimport {\n deserializeWherePath,\n type WherePathJSON,\n} from './QueryBuilderSerialization.js';\nimport {toWhere} from './IRDesugar.js';\nimport {lowerWhereToIR} from './IRLower.js';\nimport {\n buildCanonicalCreateMutationIR,\n buildCanonicalUpdateMutationIR,\n buildCanonicalUpsertMutationIR,\n buildCanonicalUpdateWhereMutationIR,\n buildCanonicalDeleteMutationIR,\n buildCanonicalDeleteAllMutationIR,\n buildCanonicalDeleteWhereMutationIR,\n} from './IRMutation.js';\nimport type {IRCreateQuery} from './CreateQuery.js';\nimport type {IRUpdateQuery} from './UpdateQuery.js';\nimport type {IRDeleteQuery} from './DeleteQuery.js';\nimport {isContextRefJSON, resolveContextId} from './ContextRef.js';\nimport {assertWireVersion} from './wireVersion.js';\nimport {\n decodeNodeDataToRaw,\n valueShapeOf,\n type MutationJSON,\n type MutationNodeDataJSON,\n type MutationValueJSON,\n} from './MutationSerialization.js';\nimport {assertValid, type ValidationMode} from '../shapes/validation.js';\nimport {decodeValueExpr, type DslJsonValue} from './DslJsonExpression.js';\nimport type {PropertyShapeData} from '../shapes/SHACL.js';\n\nfunction requireShape(shapeId: string): NodeShapeData {\n // Either registry: a project-authored shape arrives as metadata with no class, and\n // requiring a class here made every mutation against one fail at the boundary.\n const shape = getShapeClass(shapeId)?.shape ?? getNodeShape(shapeId);\n if (!shape) {\n throw new Error(\n `Shape '${shapeId}' is not registered. The receiving side must have the shape registered to lower mutation DSL-JSON.`,\n );\n }\n return shape;\n}\n\n// Bound the DSL-JSON decode recursion so a deeply-nested payload from\n// `fromJSON()` cannot exhaust the stack (RangeError DoS). Normal mutation data\n// nests only a handful of levels; 128 is far above any real query.\nconst MAX_DECODE_DEPTH = 128;\nlet _decodeDepth = 0;\n\n/**\n * Decode a DSL-JSON value to the normalized form the canonical-IR builders consume.\n * `currentShape` resolves computed `{@path}`/S-expr; `prop` gives a nested node's shape.\n * Depth-guarded wrapper around {@link decodeValueInner}.\n */\nfunction decodeValue(\n json: MutationValueJSON,\n currentShape: NodeShapeData,\n prop?: PropertyShapeData,\n): PropUpdateValue {\n if (++_decodeDepth > MAX_DECODE_DEPTH) {\n _decodeDepth = 0;\n throw new Error('DSL-JSON value nested too deeply');\n }\n try {\n return decodeValueInner(json, currentShape, prop);\n } finally {\n _decodeDepth--;\n }\n}\n\nfunction decodeValueInner(\n json: MutationValueJSON,\n currentShape: NodeShapeData,\n prop?: PropertyShapeData,\n): PropUpdateValue {\n // S-expr computed value (no IR on the wire)\n if (Array.isArray(json)) {\n const {ir, refs} = decodeValueExpr(json as DslJsonValue, currentShape);\n return new ExpressionNode(ir, refs) as unknown as PropUpdateValue;\n }\n if (json === null) return null as unknown as PropUpdateValue;\n if (typeof json !== 'object') return json as PropUpdateValue; // bare scalar literal\n const o = json as Record<string, unknown>;\n if ('@unset' in o) return undefined;\n if ('@date' in o) return new Date(o['@date'] as string) as unknown as PropUpdateValue;\n if ('@ctx' in o) {\n // Lowering path: a mutation must hit a concrete node, so resolve the\n // context now and throw if it isn't set.\n const id = resolveContextId(o['@ctx'] as string, true)!;\n return {id} as PropUpdateValue;\n }\n if ('@id' in o) return {id: o['@id']} as PropUpdateValue;\n if ('@list' in o) {\n return (o['@list'] as MutationValueJSON[]).map(\n (item) => decodeValue(item, currentShape, prop) as SinglePropertyUpdateValue,\n );\n }\n if ('@add' in o || '@remove' in o) {\n const mod: SetModificationValue = {};\n if (o['@add']) {\n mod.$add = (o['@add'] as MutationValueJSON[]).map((v) =>\n decodeValue(v, currentShape, prop),\n ) as SetModificationValue['$add'];\n }\n if (o['@remove']) mod.$remove = (o['@remove'] as string[]).map((id) => ({id}));\n return mod as PropUpdateValue;\n }\n if ('@path' in o) {\n const {ir, refs} = decodeValueExpr(json as DslJsonValue, currentShape);\n return new ExpressionNode(ir, refs) as unknown as PropUpdateValue;\n }\n // Otherwise: a bare path-keyed nested-node create.\n return decodeNodeData(\n o as MutationNodeDataJSON,\n valueShapeOf(prop) ?? currentShape,\n ) as unknown as PropUpdateValue;\n}\n\n/**\n * Rebuild a normalized node description from path-keyed JSON, resolving labels via the\n * shape. `shape` is the shape inferred from context; `__shape` overrides it.\n */\nexport function decodeNodeData(\n json: MutationNodeDataJSON,\n shape?: NodeShapeData,\n): NodeDescriptionValue {\n const nodeShape =\n typeof json.__shape === 'string' ? requireShape(json.__shape) : shape!;\n const fields: UpdateNodePropertyValue[] = [];\n for (const [key, val] of Object.entries(json)) {\n if (key === '__id' || key === '__shape' || val === undefined) continue;\n const prop = getPropertyShape(nodeShape, key);\n if (!prop) {\n throw new Error(\n `Property '${key}' not found on shape '${nodeShape.label || nodeShape.id}'`,\n );\n }\n fields.push({prop, val: decodeValue(val as MutationValueJSON, nodeShape, prop)} as UpdateNodePropertyValue);\n }\n const desc: NodeDescriptionValue = {shape: nodeShape, fields};\n if (typeof json.__id === 'string') desc.__id = json.__id;\n return desc;\n}\n\nfunction lowerWhere(\n shape: NodeShapeData,\n json: WherePathJSON,\n): {where: IRExpression; wherePatterns: IRGraphPattern[]} {\n const wherePath = deserializeWherePath(shape, json);\n return lowerWhereToIR(toWhere(wherePath));\n}\n\n/**\n * Lower a mutation DSL-JSON envelope to the canonical IR mutation the dataset\n * expects. Mirrors the IR that `lower()` produces from the live builder.\n */\n/**\n * Validate inbound node data against its shape before it becomes IR.\n *\n * The builders validate through `describe()`, which sees raw DSL data. This path\n * never touches a builder, so without this an inbound mutation would be held to\n * a weaker standard than a locally-built one — on the *less* trusted input, at\n * that. `decodeNodeDataToRaw` produces exactly the raw form `describe()` would\n * have validated (it is what `CreateBuilder.fromJSON` feeds through `.set()`),\n * so both paths run the same checks. The second decode is the cost of validating\n * at a boundary; it happens once per inbound mutation.\n */\nfunction assertInboundDataValid(\n json: MutationNodeDataJSON,\n shape: NodeShapeData,\n mode: ValidationMode,\n): void {\n assertValid(shape, decodeNodeDataToRaw(json, shape), {mode});\n}\n\nexport function lowerMutationJSON(\n json: MutationJSON,\n): IRCreateQuery | IRUpdateQuery | IRDeleteQuery {\n assertWireVersion(json.v);\n switch (json.op) {\n case 'create': {\n const shape = requireShape(json.shape);\n assertInboundDataValid(json.data, shape, 'complete');\n return buildCanonicalCreateMutationIR({\n shape,\n description: decodeNodeData(json.data, shape),\n });\n }\n case 'upsert': {\n const shape = requireShape(json.shape);\n assertInboundDataValid(json.data, shape, 'partial');\n const updates = decodeNodeData(json.data, shape);\n const id = isContextRefJSON(json.targetId)\n ? resolveContextId(json.targetId['@ctx'], true)\n : json.targetId;\n if (!id) {\n throw new Error('upsert requires a targetId');\n }\n return buildCanonicalUpsertMutationIR({id, shape, updates});\n }\n case 'update': {\n const shape = requireShape(json.shape);\n assertInboundDataValid(json.data, shape, 'partial');\n const updates = decodeNodeData(json.data, shape);\n if (json.mode === 'for') {\n // A `{@ctx}` target resolves against the current context map; a mutation\n // must hit a concrete subject, so an unresolved context throws.\n const id = isContextRefJSON(json.targetId)\n ? resolveContextId(json.targetId['@ctx'], true)\n : json.targetId;\n if (!id) {\n throw new Error('update mode \"for\" requires a targetId');\n }\n return buildCanonicalUpdateMutationIR({id, shape, updates});\n }\n let where: IRExpression | undefined;\n let wherePatterns: IRGraphPattern[] | undefined;\n if (json.mode === 'where') {\n if (!json.where) throw new Error('update mode \"where\" requires a where clause');\n ({where, wherePatterns} = lowerWhere(shape, json.where));\n }\n return buildCanonicalUpdateWhereMutationIR({shape, updates, where, wherePatterns});\n }\n case 'delete': {\n const shape = requireShape(json.shape);\n if (json.mode === 'ids') {\n return buildCanonicalDeleteMutationIR({\n shape,\n // A `{@ctx}` id resolves against the live map; a delete must hit a\n // concrete node, so an unresolved context throws.\n ids: json.ids.map((id) =>\n isContextRefJSON(id) ? {id: resolveContextId(id['@ctx'], true)!} : {id},\n ),\n });\n }\n if (json.mode === 'all') {\n return buildCanonicalDeleteAllMutationIR({shape});\n }\n const {where, wherePatterns} = lowerWhere(shape, json.where);\n return buildCanonicalDeleteWhereMutationIR({shape, where, wherePatterns});\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutationLowerSpec.js","sourceRoot":"","sources":["../../../src/queries/mutationLowerSpec.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
1
|
+
{"version":3,"file":"mutationLowerSpec.js","sourceRoot":"","sources":["../../../src/queries/mutationLowerSpec.ts"],"names":[],"mappings":"AAAA;;;;GAIG","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 */\n\n/**\n * IR-free \"lowering specs\" — the minimal, plain description each mutation\n * builder hands to `lower()` so the canonical-IR construction can live entirely\n * in the IR tier. The builders depend only on these types (no IR), keeping the\n * IR pipeline reachable solely through `lower()`.\n */\nimport type {Shape, ShapeConstructor} from '../shapes/Shape.js';\nimport type {UpdatePartial} from './QueryFactory.js';\nimport type {WherePath} from './SelectQuery.js';\nimport type {NodeId} from './MutationQuery.js';\nimport type {PendingQueryContext} from './QueryContext.js';\n\nexport interface CreateLowerSpec<S extends Shape = Shape> {\n shapeClass: ShapeConstructor<S>;\n /** The create data, with any fixed id already injected as `__id`. */\n data: UpdatePartial<S>;\n}\n\nexport interface UpdateLowerSpec<S extends Shape = Shape> {\n shapeClass: ShapeConstructor<S>;\n data: UpdatePartial<S>;\n mode: 'for' | 'forAll' | 'where';\n /** Resolved target id (id-based update); the builder already resolved any context. */\n targetId?: string;\n /** A pre-evaluated where path (where-mode). */\n wherePath?: WherePath;\n /** Create-or-replace: lowers to an upsert mutation. Only valid with mode 'for'. */\n upsert?: boolean;\n}\n\nexport interface DeleteLowerSpec<S extends Shape = Shape> {\n shapeClass: ShapeConstructor<S>;\n /** Ids to delete: concrete ids/`{id}` refs, or unresolved context refs (resolved at lower). */\n ids?: (NodeId | PendingQueryContext)[];\n mode: 'ids' | 'all' | 'where';\n wherePath?: WherePath;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryDispatch.js","sourceRoot":"","sources":["../../../src/queries/queryDispatch.ts"],"names":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gBAAgB,EAAE,CAAC;IACvC,IAAI,OAAO,MAAM,CAAC,GAAG,IAAI,OAAO,CAAC,KAAK,UAAU,EAAE,CAAC;QACjD,MAAM,IAAI,KAAK,CAAC,uCAAuC,IAAI,WAAW,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO,MAAkC,CAAC;AAC5C,CAAC","sourcesContent":["import type {SelectQuery} from './SelectQuery.js';\nimport type {CreateQuery} from './CreateQuery.js';\nimport type {UpdateQuery} from './UpdateQuery.js';\nimport type {DeleteQuery, DeleteResponse} from './DeleteQuery.js';\nimport type {IDataset} from '../interfaces/IDataset.js';\nimport type {AskQuery} from './AskQuery.js';\nimport type {CountQuery} from './CountQuery.js';\n\n/**\n * Abstraction boundary between the DSL layer (Shape) and the storage layer\n * (LinkedStorage / IDataset). Both sides import this leaf module; neither\n * imports the other.\n *\n * Return types are intentionally `any` — the DSL layer threads precise\n * result types through its own generics; the dispatch is a runtime bridge.\n */\nexport interface QueryDispatch {\n /**\n * Answer a select query — **and a count**, which travels this channel too: a\n * count is a select with an aggregate projection, not a query form of its own, so\n * it needs no method here and no router has to grow an arm for it. It arrives as a\n * {@link CountQuery} and resolves to a `number`; see {@link resolveCount}.\n */\n selectQuery<R = any>(query: SelectQuery | CountQuery): Promise<R>;\n /** Answer an ask query — a boolean, not a result set. */\n askQuery(query: AskQuery): Promise<boolean>;\n createQuery<R = any>(query: CreateQuery): Promise<R>;\n updateQuery<R = any>(query: UpdateQuery): Promise<R>;\n deleteQuery(query: DeleteQuery): Promise<DeleteResponse>;\n}\n\n/** A target that can answer an ask query. */\ntype ExistenceTarget = {askQuery(query: AskQuery): Promise<boolean>};\n\n/**\n * Answer an ask query against `target` — the single entry point for every\n * boolean-answered query in the library. `AskBuilder.exec()` and\n * `LinkedStorage.askQuery` both come here rather than calling `askQuery`\n * directly, so the contract below is enforced once for every store.\n *\n * There is deliberately **no translation to a select query anywhere in this\n * package.** An ask goes to `IDataset.askQuery` and a SPARQL-backed store turns\n * it into `ASK`. A store that lacks a boolean primitive implements `askQuery`\n * itself, in whatever way its backend allows — that decision belongs to the\n * store, and making it here would hide it.\n *\n * `askQuery` must resolve to a real boolean: anything else rejects rather than\n * being coerced, since a truthy non-boolean would read as \"exists\". Errors\n * propagate for the same reason — \"could not ask\" is never `false`.\n */\nexport async function resolveExistence(\n target: ExistenceTarget,\n query: AskQuery,\n): Promise<boolean> {\n if (typeof target?.askQuery !== 'function') {\n throw new Error(\n 'This dataset does not implement the required IDataset.askQuery(query). ' +\n 'An ask query is answered with a boolean — a SPARQL store emits ASK — and is ' +\n 'never rewritten as a select on its behalf.',\n );\n }\n const answer = await target.askQuery(query);\n if (typeof answer !== 'boolean') {\n throw new Error(\n `askQuery must resolve to a boolean; got ${answer === null ? 'null' : typeof answer}. ` +\n 'An ask query will not coerce a non-boolean into an answer — a truthy ' +\n 'value would silently read as \"exists\".',\n );\n }\n return answer;\n}\n\n/**\n * A target that can answer a count query — which is to say, any target that can\n * answer a select. There is no count-specific member to look for.\n */\ntype CountTarget = {selectQuery?(query: any): Promise<any>};\n\n/**\n * Answer a count query against `target` — the single entry point for every\n * number-answered query in the library, as {@link resolveExistence} is for boolean\n * ones. `CountBuilder.exec()` comes here rather than calling the store directly, so\n * the contract below is enforced once for every store.\n *\n * **A count is dispatched over the SELECT channel.** It is not a separate query\n * form: `SELECT (COUNT(DISTINCT ?s) AS ?count) WHERE { … }` is a select with an\n * aggregate projection, run over the same transport and answered with the same\n * result-set response — which is exactly why an ask, which really is a different\n * form (`ASK WHERE { … }`), has its own `IDataset.askQuery` and a count does not.\n * Riding `selectQuery` is what lets a count reach a store through every router that\n * already forwards a select, rather than needing a new arm in each of them (the\n * arm `LinkedStorage` never grew, which is how a count came to fail on every\n * application path while passing against a store held directly).\n *\n * There is still deliberately **no translation to a row query anywhere in this\n * package.** A store receives the count query itself and decides how to answer it;\n * one extending `SparqlDataset` branches on the lowered IR and emits the aggregate.\n * Nothing here fetches every row and measures the array — that would hide an\n * unbounded read behind a call that looks cheap.\n *\n * The answer must be a **finite, non-negative integer**: anything else rejects\n * rather than being coerced. That validation lives here, at the dispatch, because\n * this is where the count result is read — and it is load-bearing. Errors propagate\n * for the same reason a failed ask is never `false`, and more sharply, because `0`\n * is a *plausible* count: a count that reported an unreachable store as `0` would\n * render an empty table that looks exactly like real data. A store that ignored the\n * count and answered with rows is caught by the same check.\n */\nexport async function resolveCount(\n target: CountTarget,\n query: CountQuery,\n): Promise<number> {\n if (typeof target?.selectQuery !== 'function') {\n throw new Error(\n 'This dataset does not implement IDataset.selectQuery(query), which is how a ' +\n 'count query is dispatched: a count is a select with an aggregate projection ' +\n '(a SPARQL store emits SELECT (COUNT(DISTINCT ?s) AS ?count)), not a query ' +\n 'form of its own.',\n );\n }\n const answer = await target.selectQuery(query);\n if (typeof answer !== 'number' || !Number.isInteger(answer) || answer < 0) {\n throw new Error(\n `A count query must be answered with a non-negative integer; got ${\n answer === null\n ? 'null'\n : typeof answer === 'number'\n ? String(answer)\n : Array.isArray(answer)\n ? 'an array of rows'\n : typeof answer\n }. It is not coerced — a NaN or a missing value that fell through as 0 would ` +\n 'silently read as \"no matches\". A store that answered with rows ran the ' +\n 'pattern as a row query instead of counting it: it must branch on the lowered ' +\n \"IR's `kind === 'count'` and emit an aggregate.\",\n );\n }\n return answer;\n}\n\n// Global-backed so it is SHARED across duplicate copies of this module. In dev,\n// `@_linked/core` can be evaluated twice (Vite/`src` + Node/`lib` — an accepted\n// 2-instance state, see report-011). The module REGISTRY already lives on the\n// shared global; the query dispatch must too, or `setDefaultDataset()` on one\n// copy is invisible to queries on the other (\"No query dispatch configured\").\n// Whichever copy runs the storage config sets it; every copy reads it.\nconst dispatchGlobal: any =\n typeof globalThis !== 'undefined' ? globalThis : ({} as any);\nif (!('__linkedQueryDispatch' in dispatchGlobal)) {\n dispatchGlobal.__linkedQueryDispatch = {current: null as QueryDispatch | null};\n}\n\nexport function setQueryDispatch(d: QueryDispatch): void {\n dispatchGlobal.__linkedQueryDispatch.current = d;\n}\n\nexport function getQueryDispatch(): QueryDispatch {\n const dispatch = dispatchGlobal.__linkedQueryDispatch.current as QueryDispatch | null;\n if (!dispatch) {\n throw new Error(\n 'No query dispatch configured. Call LinkedStorage.setDefaultDataset() first.',\n );\n }\n return dispatch;\n}\n\n/** The mutating query kinds — the `IDataset` methods that are optional per-store. */\nexport type MutationKind = 'create' | 'update' | 'delete';\n\n/**\n * Pick the object a mutation `exec(target?)` dispatches through: the explicit `target`\n * dataset (validated to implement the op) when a target is given, otherwise the global\n * dispatch. Unlike `selectQuery`, a store's mutation methods are optional on `IDataset`,\n * so a target that can't perform `kind` is a caller error.\n *\n * Throws synchronously if the target lacks the method — callers invoke this from within an\n * `async exec`, so the throw surfaces as a rejected promise rather than a synchronous throw.\n */\nexport function resolveMutationDispatch(\n kind: MutationKind,\n target?: IDataset,\n): QueryDispatch {\n if (!target) return getQueryDispatch();\n if (typeof target[`${kind}Query`] !== 'function') {\n throw new Error(`The target dataset does not support ${kind} queries.`);\n }\n return target as unknown as QueryDispatch;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reservedQueryNames.js","sourceRoot":"","sources":["../../../src/queries/reservedQueryNames.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAwB,IAAI,GAAG,CAAC;IACnE,mEAAmE;IACnE,KAAK;IACL,IAAI;IACJ,0BAA0B;IAC1B,2BAA2B;IAC3B,QAAQ;IACR,aAAa;IACb,QAAQ;IACR,OAAO;IACP,kBAAkB;IAClB,iBAAiB;IACjB,iBAAiB;IACjB,IAAI;IACJ,OAAO;IACP,MAAM;IACN,UAAU;IACV,OAAO;IACP,YAAY;IACZ,QAAQ;IACR,WAAW;IACX,MAAM;IACN,MAAM;IACN,OAAO;IACP,4CAA4C;IAC5C,eAAe;IACf,MAAM;IACN,UAAU;IACV,OAAO;IACP,aAAa;IACb,QAAQ;IAC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AK,wBAAwB;YAC1E,2BAA2B,KAAK,qDAAqD;YACrF,YAAY,KAAK,CAAC,WAAW,EAAE,KAAK,KAAK,8CAA8C;YACvF,oBAAoB,KAAK,iBAAiB,MAAM,EAAE,CACrD,CAAC;QACF,OAAO;IACT,CAAC;IAED,OAAO,CAAC,IAAI,CACV,YAAY,KAAK,IAAI,KAAK,4BAA4B,KAAK,6BAA6B;QACtF,+BAA+B,KAAK,kDAAkD;QACtF,6CAA6C,MAAM,EAAE,CACxD,CAAC;AACJ,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,kCAAkC;IAChD,QAAQ,CAAC,KAAK,EAAE,CAAC;AACnB,CAAC"}
|
|
1
|
+
{"version":3,"file":"reservedQueryNames.js","sourceRoot":"","sources":["../../../src/queries/reservedQueryNames.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAwB,IAAI,GAAG,CAAC;IACnE,mEAAmE;IACnE,KAAK;IACL,IAAI;IACJ,0BAA0B;IAC1B,2BAA2B;IAC3B,QAAQ;IACR,aAAa;IACb,QAAQ;IACR,OAAO;IACP,kBAAkB;IAClB,iBAAiB;IACjB,iBAAiB;IACjB,IAAI;IACJ,OAAO;IACP,MAAM;IACN,UAAU;IACV,OAAO;IACP,YAAY;IACZ,QAAQ;IACR,WAAW;IACX,MAAM;IACN,MAAM;IACN,OAAO;IACP,4CAA4C;IAC5C,eAAe;IACf,MAAM;IACN,UAAU;IACV,OAAO;IACP,aAAa;IACb,QAAQ;IACR,SAAS;IACT,WAAW;CACZ,CAAC,CAAC;AAEH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAwB,IAAI,GAAG,CAAC;IACjE,KAAK;IACL,0BAA0B;IAC1B,2BAA2B;IAC3B,QAAQ;IACR,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IACN,OAAO;CACR,CAAC,CAAC;AAEH,MAAM,UAAU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A+B,KAAK,kDAAkD;QACtF,6CAA6C,MAAM,EAAE,CACxD,CAAC;AACJ,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,kCAAkC;IAChD,QAAQ,CAAC,KAAK,EAAE,CAAC;AACnB,CAAC","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 */\n\n/**\n * The names the query proxies answer themselves.\n *\n * `QueryShape`/`QueryShapeSet` resolve a key against their own surface (`key in\n * queryShape`) before they look for a property shape with that label, so a property\n * named after one of these is unreachable through the builder: the caller gets the DSL\n * method, and the field tracer then fails on a native function. Registration warns about\n * such a label (see `warnOnReservedPropertyLabel`).\n *\n * Deliberately a literal, not derived from the classes: the shape registry must not\n * import the query builder (that edge would close an import cycle through `SHACL.ts`).\n * `dsl-property-name-collisions.test.ts` compares this list against the live prototypes,\n * so a DSL method added later cannot drift out of it unnoticed.\n */\nexport const RESERVED_QUERY_DSL_NAMES: ReadonlySet<string> = new Set([\n // prototype surface of QueryShape / QueryShapeSet (and their base)\n 'add',\n 'as',\n 'buildPredicateExpression',\n 'callPropertyShapeAccessor',\n 'concat',\n 'constructor',\n 'equals',\n 'every',\n 'getOriginalValue',\n 'getPropertyPath',\n 'getPropertyStep',\n 'id',\n 'limit',\n 'none',\n 'notOneOf',\n 'oneOf',\n 'preloadFor',\n 'select',\n 'selectAll',\n 'size',\n 'some',\n 'where',\n // instance fields — `in` sees these as well\n 'originalValue',\n 'prop',\n 'property',\n 'proxy',\n 'queryShapes',\n 'source',\n 'subject',\n 'wherePath',\n]);\n\n/**\n * The subset that only bites through a MULTI-VALUED hop.\n *\n * These are on `QueryShapeSet` but not on `QueryShape`, so `widget.size` resolves to the\n * property perfectly well — it is `article.widgets.size` that returns the set's size\n * instead. Which matters because `size`, `some`, `every` and `where` are among the most\n * ordinary names a domain model has, and warning about them as if they were always broken\n * trains people to ignore the warning.\n */\nexport const SET_CONTEXT_ONLY_NAMES: ReadonlySet<string> = new Set([\n 'add',\n 'buildPredicateExpression',\n 'callPropertyShapeAccessor',\n 'concat',\n 'every',\n 'none',\n 'size',\n 'some',\n 'where',\n]);\n\nexport function isReservedQueryDslName(label: string | undefined): boolean {\n return !!label && RESERVED_QUERY_DSL_NAMES.has(label);\n}\n\n/** True when the name is only shadowed when the shape is reached as a set. */\nexport function isSetContextOnlyName(label: string | undefined): boolean {\n return !!label && SET_CONTEXT_ONLY_NAMES.has(label);\n}\n\n/** One warning per shape + label; a shape re-registered on hot reload must not spam. */\nconst reported = new Set<string>();\n\n/**\n * Tell the model author about a colliding label while they can still rename it.\n *\n * A warning rather than a throw, on purpose. `size`, `id` and `some` are legitimate\n * names for a domain property, and the property still works everywhere except the\n * proxy-traced builder. Throwing here would break existing apps on upgrade over a property\n * they may never select through the builder. (Contrast `RESERVED_PROPERTY_LABELS` in\n * `SHACL.ts`, which does throw: a DSL-JSON combinator name has no escape hatch at all.)\n *\n * Two messages, because the two cases are genuinely different: a `QueryShape` member is\n * always shadowed, while a set-only member is fine until the shape is reached through a\n * multi-valued property. Saying \"broken\" about the second kind is how a warning gets\n * ignored.\n *\n * Both name the way out. The escape hatch already exists and is easy to miss:\n * `select(['size'])` takes the label as a string and never touches the proxy, so it\n * resolves the property whatever it is called. It accepts dot-paths too.\n */\nexport function warnOnReservedPropertyLabel(\n label: string | undefined,\n shapeLabel: string | undefined,\n shapeId?: string,\n): void {\n if (!isReservedQueryDslName(label)) return;\n const key = `${shapeId ?? shapeLabel ?? ''}#${label}`;\n if (reported.has(key)) return;\n reported.add(key);\n const owner = shapeLabel ?? shapeId ?? 'shape';\n const escape = `Use \\`select(['${label}'])\\`, which takes the label as a string and never touches the proxy. Renaming the property also works; the RDF predicate can stay the same.`;\n\n if (isSetContextOnlyName(label)) {\n console.warn(\n `[linked] ${owner}.${label} is shadowed when ${owner} is reached through a ` +\n `multi-valued property: '${label}' is a method of the query builder's SET proxy, so ` +\n `\\`parent.${owner.toLowerCase()}s.${label}\\` returns that method. Reading it directly ` +\n `(\\`select(s => s.${label})\\`) is fine. ${escape}`,\n );\n return;\n }\n\n console.warn(\n `[linked] ${owner}.${label} shadows the query DSL: '${label}' is a method of the query ` +\n `builder, so \\`select(s => s.${label})\\` returns that method instead of the property ` +\n `and the query fails while tracing fields. ${escape}`,\n );\n}\n\n/** Test seam: forget which collisions were already reported. */\nexport function resetReservedPropertyLabelWarnings(): void {\n reported.clear();\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveShape.js","sourceRoot":"","sources":["../../../src/queries/resolveShape.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,uBAAuB,EAAE,aAAa,EAAC,MAAM,wBAAwB,CAAC;AAE9E;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAC1B,KAAmC;;IAEnC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,+EAA+E;QAC/E,+EAA+E;QAC/E,MAAM,UAAU,GAAG,MAAA,aAAa,CAAC,KAAK,CAAC,mCAAI,uBAAuB,CAAC,KAAK,CAAC,CAAC;QAC1E,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,6BAA6B,KAAK,GAAG,CAAC,CAAC;QACzD,CAAC;QACD,OAAO,UAAiC,CAAC;IAC3C,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
1
|
+
{"version":3,"file":"resolveShape.js","sourceRoot":"","sources":["../../../src/queries/resolveShape.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,uBAAuB,EAAE,aAAa,EAAC,MAAM,wBAAwB,CAAC;AAE9E;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAC1B,KAAmC;;IAEnC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,+EAA+E;QAC/E,+EAA+E;QAC/E,MAAM,UAAU,GAAG,MAAA,aAAa,CAAC,KAAK,CAAC,mCAAI,uBAAuB,CAAC,KAAK,CAAC,CAAC;QAC1E,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,6BAA6B,KAAK,GAAG,CAAC,CAAC;QACzD,CAAC;QACD,OAAO,UAAiC,CAAC;IAC3C,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import {Shape, type ShapeConstructor} from '../shapes/Shape.js';\nimport {getOrCreateShapeAdapter, getShapeClass} from '../utils/ShapeClass.js';\n\n/**\n * Resolve a shape class or IRI string to a ShapeConstructor.\n *\n * Shared utility used by QueryBuilder, CreateBuilder, UpdateBuilder, and DeleteBuilder\n * to normalize their shape input.\n *\n * @throws If a string IRI cannot be resolved via the shape registry.\n */\nexport function resolveShape<S extends Shape>(\n shape: ShapeConstructor<S> | string,\n): ShapeConstructor<S> {\n if (typeof shape === 'string') {\n // An authored class first; otherwise a constructor derived from the registered\n // metadata, so a project-authored shape that exists only as data resolves too.\n const shapeClass = getShapeClass(shape) ?? getOrCreateShapeAdapter(shape);\n if (!shapeClass) {\n throw new Error(`Cannot resolve shape for '${shape}'`);\n }\n return shapeClass as ShapeConstructor<S>;\n }\n return shape;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wireVersion.js","sourceRoot":"","sources":["../../../src/queries/wireVersion.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,yFAAyF;AACzF,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC;AAElC;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,CAAU;IAC1C,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO;IAC1C,MAAM,aAAa,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9C,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5C,IAAI,aAAa,KAAK,QAAQ,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CACb,sCAAsC,CAAC,wBAAwB,YAAY,GAAG,CAC/E,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
1
|
+
{"version":3,"file":"wireVersion.js","sourceRoot":"","sources":["../../../src/queries/wireVersion.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,yFAAyF;AACzF,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC;AAElC;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,CAAU;IAC1C,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO;IAC1C,MAAM,aAAa,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9C,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5C,IAAI,aAAa,KAAK,QAAQ,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CACb,sCAAsC,CAAC,wBAAwB,YAAY,GAAG,CAC/E,CAAC;IACJ,CAAC;AACH,CAAC","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 */\n\n/** Current DSL-JSON wire-format version, stamped onto every `toJSON` envelope as `v`. */\nexport const WIRE_VERSION = '1.1';\n\n/**\n * Validate an incoming envelope's `v`. A missing `v` is tolerated (pre-versioned /\n * assumed current). A different MAJOR version is rejected — the structures may differ.\n */\nexport function assertWireVersion(v: unknown): void {\n if (v === undefined || v === null) return;\n const incomingMajor = String(v).split('.')[0];\n const ourMajor = WIRE_VERSION.split('.')[0];\n if (incomingMajor !== ourMajor) {\n throw new Error(\n `Unsupported DSL-JSON wire version \"${v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AAC,EAAC,SAAS,EAAE,IAAI,EAAC,CAAC;GAClB,IAAI,CAYhB;;AASD;;;;;;GAMG;AACH,MAAM,UAAU,OAAO,CACrB,KAAU,EACV,IAAsB;IAEtB,MAAM,IAAI,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,CAAC;IACxB,MAAM,KAAK,GAAG,CAAC,CAAS,EAAmB,EAAE;QAC3C,IAAI,CAAC,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;YACtB,OAAO,EAAC,EAAE,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,EAAC,CAAC;QAC1B,CAAC;QACD,MAAM,IAAI,GAAoB;YAC5B,KAAK,EAAE,IAAI;YACX,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;YACf,IAAI,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;SACnB,CAAC;QACF,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,IAAI,CAAC,IAAI,GAAG,GAAG,IAAI,IAAI,CAAC,EAAE,CAAC;QAC7B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;IACF,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC","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 */\nimport {linkedShape} from '../package.js';\nimport {Shape} from './Shape.js';\nimport {linkedProperty, objectProperty} from './SHACL.js';\nimport {rdf} from '../ontologies/rdf.js';\n\n/**\n * SHACL/RDF ordered-list cell shape (`rdf:List`).\n *\n * A list is a chain of cells: `first` holds the value, `rest` points to the next cell\n * (or `rdf:nil`). The cell is `dependent` (it has no independent existence) and `rest` is\n * a `contains` edge, so deleting/replacing a list cascade-cleans the whole spine — while\n * `first` is NOT a `contains` edge, so the list's *contents* (shared IRIs/values) are kept.\n */\n@linkedShape({dependent: true})\nexport class List<T = unknown> extends Shape {\n static targetClass = rdf.List;\n\n @linkedProperty({path: rdf.first, maxCount: 1})\n get first(): T {\n return null;\n }\n\n @objectProperty({path: rdf.rest, maxCount: 1, shape: List, contains: true})\n get rest(): List<T> {\n return null;\n }\n}\n\n/**\n * Node-data for a single cell / the `rdf:nil` terminal. Accepted by the create pipeline.\n */\nexport type RdfListNodeData =\n | {id: string}\n | {shape: typeof List; first: unknown; rest: RdfListNodeData; __id?: string};\n\n/**\n * Build the nested `List` node-data chain for an ordered `rdf:List`, terminating at `rdf:nil`.\n * Pass `opts.base` to mint deterministic cell ids (`{base}/0`, `{base}/1`, …); otherwise the\n * create pipeline mints ids. The empty list serializes to `rdf:nil`.\n *\n * @example Playlist.create({ tracks: rdfList([t1, t2, t3]) })\n */\nexport function rdfList<T>(\n items: T[],\n opts?: {base?: string},\n): RdfListNodeData {\n const base = opts?.base;\n const build = (i: number): RdfListNodeData => {\n if (i >= items.length) {\n return {id: rdf.nil.id};\n }\n const cell: RdfListNodeData = {\n shape: List,\n first: items[i],\n rest: build(i + 1),\n };\n if (base !== undefined) {\n cell.__id = `${base}/${i}`;\n }\n return cell;\n };\n return build(0);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PathNode.js","sourceRoot":"","sources":["../../../src/shapes/PathNode.ts"],"names":[],"mappings":";;;;;;AAAA;;;;GAIG;AACH,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AACjC,OAAO,EAAC,cAAc,EAAC,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAC,KAAK,EAAC,MAAM,wBAAwB,CAAC;AAC7C,OAAO,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAE/B;;;;;;;;;GASG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,KAAK;IAIjC,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AC,aAAa,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;6CAGxE;AA1BU,QAAQ;IADpB,WAAW,CAAC,EAAC,SAAS,EAAE,IAAI,EAAC,CAAC;GAClB,QAAQ,CA2BpB","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 */\nimport {linkedShape} from '../package.js';\nimport {Shape} from './Shape.js';\nimport {objectProperty} from './SHACL.js';\nimport {shacl} from '../ontologies/shacl.js';\nimport {coreOntology} from '../ontologies/linked-core.js';\nimport {List} from './List.js';\n\n/**\n * Operator node for SHACL property paths that are NOT a simple predicate or a sequence:\n * inverse (`sh:inversePath`), alternative (`sh:alternativePath` → an `rdf:List`), and the\n * cardinality forms (`sh:zeroOrMorePath`/`sh:oneOrMorePath`/`sh:zeroOrOnePath`).\n *\n * Each operator edge is `contains` (the operand subtree is owned), and the node itself is\n * `dependent`, so a property-shape's complex `sh:path` cascade-cleans on delete/replace.\n * Operands are polymorphic (a predicate IRI, a nested `PathNode`, or a `List`), so no fixed\n * `valueShape` is declared except for `alternativePath`, which is always an `rdf:List`.\n */\n@linkedShape({dependent: true})\nexport class PathNode extends Shape {\n static targetClass = coreOntology.PathNode;\n\n @objectProperty({path: shacl.inversePath, maxCount: 1, contains: true})\n get inversePath(): unknown {\n return null;\n }\n\n @objectProperty({path: shacl.alternativePath, maxCount: 1, shape: List, contains: true})\n get alternativePath(): List {\n return null;\n }\n\n @objectProperty({path: shacl.zeroOrMorePath, maxCount: 1, contains: true})\n get zeroOrMorePath(): unknown {\n return null;\n }\n\n @objectProperty({path: shacl.oneOrMorePath, maxCount: 1, contains: true})\n get oneOrMorePath(): unknown {\n return null;\n }\n\n @objectProperty({path: shacl.zeroOrOnePath, maxCount: 1, contains: true})\n get zeroOrOnePath(): unknown {\n return null;\n }\n}\n"]}
|
|
@@ -1 +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AAC;AACjF,MAAM,UAAU,oBAAoB,CAClC,WAAmB;IAEnB,MAAM,SAAS,GAAG,kBAAkB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACtD,kBAAkB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACvC,OAAO,SAAS,CAAC;AACnB,CAAC;AACD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,WAAmB,EACnB,QAAwC,EACxC,EAAE;IACF,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;QACzC,kBAAkB,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IAC1C,CAAC;IACD,kBAAkB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACrD,CAAC,CAAC","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 */\nimport {type NodeReferenceValue, toNodeReference} from '../utils/NodeReference.js';\nimport {Shape, type ShapeConstructor} from './Shape.js';\nimport {shacl} from '../ontologies/shacl.js';\nimport {warnOnReservedPropertyLabel} from '../queries/reservedQueryNames.js';\nimport {getShapeClass} from '../utils/ShapeClass.js';\nimport type {PathExpr} from '../paths/PropertyPathExpr.js';\nimport {normalizePropertyPath, type PropertyPathDecoratorInput} from '../paths/normalizePropertyPath.js';\nimport {\n createPropertyShapeData,\n getPropertyShape as getPropertyShapeData,\n addPropertyShape as addPropertyShapeData,\n clonePropertyShape,\n type NodeShapeData,\n type PropertyShapeData,\n} from './nodeShapeData.js';\n\n// Metadata types now live in nodeShapeData.js (plain objects); re-exported here for\n// existing importers of `NodeShape`/`PropertyShape`-adjacent types.\nexport type {NodeShapeData, PropertyShapeData, PropertyShapeResult} from './nodeShapeData.js';\n// Metadata operations (formerly NodeShape/PropertyShape instance methods).\nexport {\n getPropertyShapes,\n getUniquePropertyShapes,\n getPropertyShape,\n addPropertyShape,\n clonePropertyShape,\n propertyShapeToResult,\n nodeShapeEquals,\n createNodeShapeData,\n createPropertyShapeData,\n} from './nodeShapeData.js';\n\n/**\n * Default identity root for shape & package IRIs. Public/first-party packages\n * publish under `linked.cm` (arch-02 §Domains). Packages may override per-package\n * via `linkedPackage(name, { baseUri })` — CN injects a workspace-scoped root\n * (`{workspaceSlug}.id.create.now`) for private packages; first-party packages\n * keep this default.\n */\nexport const LINKED_DATA_ROOT: string = 'https://linked.cm/';\n\n/**\n * Derive the public package slug — the npm package **basename** with the\n * `@scope/` dropped, kebab-cased (arch-02 §Slug rules: `^[a-z0-9]+(?:-[a-z0-9]+)*$`).\n * The package name is the single source of truth; there is no separate slug.\n * `@_linked/core` → `core`, `@linked.cm/blog` → `blog`, `mypkg` → `mypkg`.\n *\n * Both first-party (`@_linked`) and community (`@linked.cm`) packages publish into\n * the one `linked.cm/{shape,pkg}` space, so the basename must be globally unique —\n * enforced by the registry, which reserves the (handful of) first-party names.\n */\nexport function packageNameToSlug(packageName: string): string {\n return packageName\n .replace(/^@[^/]+\\//, '') // drop the npm scope (@scope/), keep the basename\n .replace(/[^a-zA-Z0-9]+/g, '-') // any run of non-alphanumerics → single hyphen\n .replace(/^-+|-+$/g, '') // trim stray hyphens\n .toLowerCase();\n}\n\n/**\n * Where each package publishes its IRIs (the identity root). The slug is always\n * derived from the package name; only the root is configurable — `linkedPackage`\n * defaults it to `LINKED_DATA_ROOT` (linked.cm), and CN injects a workspace-scoped\n * root (`{workspaceSlug}.id.create.now`) for private packages.\n */\nconst packageBaseUri = new Map<string, string>();\n\n/** Record a package's publish root. Called by `linkedPackage()`. */\nexport function setPackagePublishConfig(\n packageName: string,\n config?: {baseUri?: string},\n): void {\n packageBaseUri.set(packageName, config?.baseUri ?? LINKED_DATA_ROOT);\n}\n\n/** Resolve a package's publish root, defaulting to linked.cm if undeclared. */\nfunction resolveBaseUri(packageName: string): string {\n return packageBaseUri.get(packageName) ?? LINKED_DATA_ROOT;\n}\n\n/** Public/first-party package IRI — arch-02: `{baseUri}pkg/{slug}`. */\nexport function getPackageUri(packageName: string): string {\n return `${resolveBaseUri(packageName)}pkg/${packageNameToSlug(packageName)}`;\n}\n\ntype NodeKindConfig = NodeReferenceValue | NodeReferenceValue[];\n\nexport type PropertyPathInput = PropertyPathDecoratorInput;\nexport type PropertyPathInputList = PropertyPathDecoratorInput;\n\nconst normalizeNodeKind = (\n nodeKind?: NodeKindConfig,\n defaultNodeKind?: NodeReferenceValue,\n): NodeReferenceValue | undefined => {\n if (!nodeKind) {\n return defaultNodeKind;\n }\n if (Array.isArray(nodeKind)) {\n const ids = nodeKind.map((entry) => entry?.id);\n const includesBlank = ids.includes(shacl.BlankNode.id);\n const includesNamed = ids.includes(shacl.IRI.id);\n const includesLiteral = ids.includes(shacl.Literal.id);\n if (includesBlank && includesNamed) {\n return shacl.BlankNodeOrIRI;\n }\n if (includesLiteral && includesNamed) {\n return shacl.IRIOrLiteral;\n }\n if (includesLiteral && includesBlank) {\n return shacl.BlankNodeOrLiteral;\n }\n return nodeKind[0];\n }\n return nodeKind;\n};\n\nexport interface NodeShapeConfig {\n /**\n * Set to true to close the shape. This means any target node of this shape\n * that has properties outside the defined properties of this shape is invalid.\n */\n closed?: boolean;\n /**\n * Optional list of properties that are also permitted in addition to those explicitly listed by this shape.\n */\n ignoredProperties?: NodeReferenceValue[];\n}\n\nexport interface LiteralPropertyShapeConfig extends PropertyShapeConfig {\n nodeKind?: NodeReferenceValue;\n /**\n * Values of the configured property must be less than the values of this 'lessThan' property.\n * Value is always a property IRI (pair constraint).\n */\n lessThan?: NodeReferenceValue;\n /**\n * Values of the configured property must be less than or equal the values of this 'lessThanOrEquals' property.\n * Value is always a property IRI (pair constraint).\n */\n lessThanOrEquals?: NodeReferenceValue;\n /**\n * All values of this property must be higher than this number\n */\n minExclusive?: number | string;\n /**\n * All values of this property must be higher than or equal this number\n */\n minInclusive?: number;\n /**\n * All values of this property must be lower than this number\n */\n maxExclusive?: number;\n /**\n * All values of this property must be lower than or equal this number\n */\n maxInclusive?: number;\n /**\n * All literal values of this property must at least be this long\n */\n minLength?: number;\n /**\n * All literal values of this property must at most be this long\n */\n maxLength?: number;\n /**\n * All literal values of this property must match this regular expression\n */\n pattern?: RegExp;\n /**\n * All literal values of this property must have one of these languages as their language tag\n */\n languageIn?: string[];\n /**\n * No pair of values may use the same language tag.\n */\n uniqueLang?: boolean;\n /**\n * Each literal value of this property must use this datatype\n */\n datatype?: NodeReferenceValue;\n /**\n * Each value of the property must occur in this set.\n * Use {id: '...'} for IRI nodes, or plain strings/numbers/booleans for literal values.\n */\n in?: (NodeReferenceValue | string | number | boolean)[];\n}\n\nexport interface ObjectPropertyShapeConfig extends PropertyShapeConfig {\n nodeKind?: NodeReferenceValue;\n /**\n * Each value of this property must have this class as its rdf:type\n */\n class?: NodeReferenceValue;\n /**\n * The shape that values of this property path need to confirm to.\n * You need to provide a class that extends Shape.\n */\n shape?: typeof Shape | [string, string];\n /**\n * Marks this property as *containment* (composition): the value(s) are owned by the subject\n * and the delete/update cascade removes the owned subtree.\n */\n contains?: boolean;\n}\n\nexport interface PropertyShapeConfig {\n /**\n * The property path of this property shape.\n *\n * Four accepted forms, all equivalent where they overlap:\n *\n * - **An ontology term** — `documents.confidence`. The idiom for real shapes: it reuses the\n * ontology, so a namespace changes in one place. `createNameSpace` returns a `{id}` ref, so\n * the term IS the second form and is passed DIRECTLY — never `documents.confidence.id`,\n * which unwraps it back to a bare string.\n * - **A node reference** — `{id: 'https://example.org/vocab#startsAt'}`. What the first form\n * produces. Convenient in tests, or wherever an ontology module would be overkill.\n * - **A bare IRI or prefixed name** — `'https://example.org/vocab#startsAt'`, `'ex:startsAt'`.\n * - **A path expression** — `'ex:a/ex:b'`, `{seq: [...]}`, `{inv: ...}`, and the other\n * operators. An array is read as a sequence.\n *\n * A string is parsed as an expression only when it is not a bare absolute IRI: `ex:a/ex:b` is\n * a sequence, while the `/` inside `https://example.org/vocab#x` belongs to the IRI.\n */\n path: PropertyPathInputList;\n /**\n * Indicates that this property must exist.\n * Shorthand for minCount=1\n */\n required?: boolean;\n /**\n * Each value must be of this node type.\n */\n nodeKind?: NodeKindConfig;\n /**\n * Minimum number of values required\n */\n minCount?: number;\n /**\n * Maximum number of values allowed\n */\n maxCount?: number;\n /**\n * Values of the configured property must equal the values of this 'equals' property.\n * Value is always a property IRI (pair constraint).\n */\n equals?: NodeReferenceValue;\n /**\n * Values of the configured property must differ from the values of this 'disjoint' property.\n * Value is always a property IRI (pair constraint).\n */\n disjoint?: NodeReferenceValue;\n /**\n * At least one value of this property must equal the given value.\n * Use {id: '...'} for IRI nodes, or a plain string for literal values.\n */\n hasValue?: NodeReferenceValue | string | number | boolean;\n name?: string;\n description?: string;\n order?: number;\n group?: string;\n /**\n * Display importance, lower = more important (`linked_core:displayRank`).\n * A renderer that can show only N properties shows the N lowest ranks.\n */\n displayRank?: number;\n /** Omit this property from generic rendering (`linked_core:displayHidden`). */\n displayHidden?: boolean;\n /**\n * should correlate to the given datatype or class\n */\n defaultValue?: unknown;\n /**\n * Each value of the property must occur in this set.\n * Use {id: '...'} for IRI nodes, or plain strings for literal values.\n *\n * @example\n * in: ['ACTIVE', 'PENDING', 'CLOSED']\n * in: [{id: 'http://example.org/StatusA'}, {id: 'http://example.org/StatusB'}]\n */\n in?: (NodeReferenceValue | string | number | boolean)[];\n /**\n * Values of the configured property path are sorted by the values of this property path.\n */\n sortBy?: PropertyPathInputList;\n}\n\nconst EXPLICIT_NODE_KIND_SYMBOL = Symbol('explicitNodeKind');\nconst EXPLICIT_MIN_COUNT_SYMBOL = Symbol('explicitMinCount');\nconst EXPLICIT_MAX_COUNT_SYMBOL = Symbol('explicitMaxCount');\n\n/** Internal symbol-keyed flags on a PropertyShapeData object to track which fields were explicitly configured. */\ninterface ExplicitFlags {\n [EXPLICIT_NODE_KIND_SYMBOL]?: boolean;\n [EXPLICIT_MIN_COUNT_SYMBOL]?: boolean;\n [EXPLICIT_MAX_COUNT_SYMBOL]?: boolean;\n}\n\nexport interface ParameterConfig {\n optional?: number;\n}\n\n/**\n * Static-only DSL handle for the SHACL `sh:NodeShape` meta-shape.\n *\n * Never instantiated — a shape's metadata is a plain {@link NodeShapeData} object\n * (see nodeShapeData.js), and the instance methods that used to live here are now\n * free functions in that module. This class exists only to carry the meta-shape's\n * static `.shape` self-description and to serve as the DSL entry point for reading\n * and writing node-shape SHACL data (`NodeShape.create/select/delete`).\n */\nexport class NodeShape extends Shape {\n static targetClass = shacl.NodeShape;\n}\n\n/**\n * Static-only DSL handle for the SHACL `sh:PropertyShape` meta-shape.\n *\n * Never instantiated — property-shape metadata is a plain {@link PropertyShapeData}\n * object (see nodeShapeData.js). Exists only for its static `.shape` self-description\n * and as a DSL entry point (`PropertyShape.create/select`).\n */\nexport class PropertyShape extends Shape {\n static targetClass = shacl.PropertyShape;\n}\n\nconst connectValueShape = <\n Config extends LiteralPropertyShapeConfig | ObjectPropertyShapeConfig,\n>(\n config: Config,\n propertyKey: string,\n property: PropertyShapeData,\n) => {\n if ((config as ObjectPropertyShapeConfig).shape) {\n const shapeConfig = (config as ObjectPropertyShapeConfig).shape;\n\n if (Array.isArray(shapeConfig)) {\n const [packageName, shapeName] = shapeConfig;\n const nodeShapeUri = getNodeShapeUri(packageName, shapeName);\n property.valueShape = {id: nodeShapeUri};\n } else {\n const shapeClass = shapeConfig as typeof Shape;\n if (shapeClass.shape) {\n property.valueShape = {id: shapeClass.shape.id};\n } else {\n onShapeSetup(\n shapeConfig,\n (nodeShape: NodeShapeData) => {\n property.valueShape = {id: nodeShape.id};\n },\n propertyKey,\n );\n }\n }\n }\n};\n\n/**\n * The DSL-JSON where-clause combinators. A property may not be named after one,\n * because a condition key in those positions has no `{path}` escape (the key is a\n * bare string). See documentation/dsl-json.md (Reserved words).\n */\nconst RESERVED_PROPERTY_LABELS = new Set(['and', 'or', 'not']);\n\nexport function registerPropertyShape(\n shape: NodeShapeData,\n propertyShape: PropertyShapeData,\n) {\n if (RESERVED_PROPERTY_LABELS.has(propertyShape.label)) {\n throw new Error(\n `Property label '${propertyShape.label}' is reserved (a DSL-JSON boolean combinator) ` +\n `and cannot be used as a property name. See documentation/dsl-json.md (Reserved words).`,\n );\n }\n // Not fatal, but the author needs to hear it here rather than from the field tracer.\n warnOnReservedPropertyLabel(propertyShape.label, shape.label, shape.id);\n const inherited = getPropertyShapeData(shape, propertyShape.label, true);\n const existing = getPropertyShapeData(shape, propertyShape.label, false);\n if (!existing && inherited) {\n if (!(propertyShape as unknown as ExplicitFlags)[EXPLICIT_MIN_COUNT_SYMBOL]) {\n propertyShape.minCount = inherited.minCount;\n }\n if (!(propertyShape as unknown as ExplicitFlags)[EXPLICIT_MAX_COUNT_SYMBOL]) {\n propertyShape.maxCount = inherited.maxCount;\n }\n if (!(propertyShape as unknown as ExplicitFlags)[EXPLICIT_NODE_KIND_SYMBOL]) {\n propertyShape.nodeKind = inherited.nodeKind;\n }\n validateOverrideTightening(shape, inherited, propertyShape);\n }\n if (existing) {\n Object.assign(existing, propertyShape);\n return existing;\n }\n propertyShape.id = `${shape.id}/${propertyShape.label}`;\n addPropertyShapeData(shape, propertyShape);\n return propertyShape;\n}\n\nconst ATOMIC_NODE_KINDS = [\n shacl.BlankNode.id,\n shacl.IRI.id,\n shacl.Literal.id,\n];\n\nconst nodeKindToAtomics = (nodeKind?: NodeReferenceValue): Set<string> => {\n if (!nodeKind?.id) {\n return new Set();\n }\n switch (nodeKind.id) {\n case shacl.BlankNode.id:\n case shacl.IRI.id:\n case shacl.Literal.id:\n return new Set([nodeKind.id]);\n case shacl.BlankNodeOrIRI.id:\n return new Set([shacl.BlankNode.id, shacl.IRI.id]);\n case shacl.IRIOrLiteral.id:\n return new Set([shacl.IRI.id, shacl.Literal.id]);\n case shacl.BlankNodeOrLiteral.id:\n return new Set([shacl.BlankNode.id, shacl.Literal.id]);\n default:\n return new Set(ATOMIC_NODE_KINDS);\n }\n};\n\nconst throwOverrideError = (\n shape: NodeShapeData,\n propertyShape: PropertyShapeData,\n message: string,\n) => {\n throw new Error(\n `Invalid override for ${shape.label}.${propertyShape.label}: ${message}`,\n );\n};\n\nconst validateOverrideTightening = (\n shape: NodeShapeData,\n base: PropertyShapeData,\n override: PropertyShapeData,\n) => {\n if (\n typeof base.minCount === 'number' &&\n typeof override.minCount === 'number' &&\n override.minCount < base.minCount\n ) {\n throwOverrideError(\n shape,\n override,\n `minCount cannot be lowered (${base.minCount} -> ${override.minCount}).`,\n );\n }\n\n if (\n typeof base.maxCount === 'number' &&\n typeof override.maxCount === 'number' &&\n override.maxCount > base.maxCount\n ) {\n throwOverrideError(\n shape,\n override,\n `maxCount cannot be increased (${base.maxCount} -> ${override.maxCount}).`,\n );\n }\n\n if (base.nodeKind && override.nodeKind) {\n const baseKinds = nodeKindToAtomics(base.nodeKind);\n const overrideKinds = nodeKindToAtomics(override.nodeKind);\n const widensNodeKind = [...overrideKinds].some((kind) => !baseKinds.has(kind));\n if (widensNodeKind) {\n throwOverrideError(\n shape,\n override,\n `nodeKind cannot be widened (${base.nodeKind.id} -> ${override.nodeKind.id}).`,\n );\n }\n }\n};\n\nexport function createPropertyShape<\n Config extends LiteralPropertyShapeConfig | ObjectPropertyShapeConfig,\n>(\n config: Config,\n propertyKey: string,\n defaultNodeKind: NodeReferenceValue = null,\n shapeClass: typeof Shape | [string, string] = null,\n) {\n const propertyShape = createPropertyShapeData();\n propertyShape.path = normalizePropertyPath(config.path);\n propertyShape.label = propertyKey;\n\n if (config.name) {\n propertyShape.name = config.name;\n }\n if (config.description) {\n propertyShape.description = config.description;\n }\n\n if (config.required) {\n propertyShape.minCount = 1;\n } else if (config.minCount !== undefined) {\n propertyShape.minCount = config.minCount;\n }\n (propertyShape as unknown as ExplicitFlags)[EXPLICIT_MIN_COUNT_SYMBOL] =\n config.required === true || config.minCount !== undefined;\n\n if (config.maxCount !== undefined) {\n propertyShape.maxCount = config.maxCount;\n }\n (propertyShape as unknown as ExplicitFlags)[EXPLICIT_MAX_COUNT_SYMBOL] =\n config.maxCount !== undefined;\n if ((config as LiteralPropertyShapeConfig).datatype) {\n propertyShape.datatype = toNodeReference(\n (config as LiteralPropertyShapeConfig).datatype,\n );\n }\n\n if ((config as ObjectPropertyShapeConfig).class) {\n propertyShape.class = toNodeReference(\n (config as ObjectPropertyShapeConfig).class,\n );\n }\n\n if ((config as ObjectPropertyShapeConfig).contains) {\n propertyShape.contains = true;\n }\n\n if (config.equals) {\n propertyShape.equalsConstraint = toNodeReference(config.equals);\n }\n if (config.disjoint) {\n propertyShape.disjoint = toNodeReference(config.disjoint);\n }\n if ((config as LiteralPropertyShapeConfig).lessThan) {\n propertyShape.lessThan = toNodeReference((config as LiteralPropertyShapeConfig).lessThan);\n }\n if ((config as LiteralPropertyShapeConfig).lessThanOrEquals) {\n propertyShape.lessThanOrEquals = toNodeReference((config as LiteralPropertyShapeConfig).lessThanOrEquals);\n }\n // Value-range / string-length / pattern constraints (report 021 §3, G5). These are\n // recorded on the shape and serialized to SHACL; there is no DSL-side runtime\n // enforcement — they describe the shape for validators / introspection.\n {\n const lit = config as LiteralPropertyShapeConfig;\n if (lit.minInclusive !== undefined) propertyShape.minInclusive = lit.minInclusive;\n if (lit.maxInclusive !== undefined) propertyShape.maxInclusive = lit.maxInclusive;\n if (lit.minExclusive !== undefined) propertyShape.minExclusive = lit.minExclusive;\n if (lit.maxExclusive !== undefined) propertyShape.maxExclusive = lit.maxExclusive;\n if (lit.minLength !== undefined) propertyShape.minLength = lit.minLength;\n if (lit.maxLength !== undefined) propertyShape.maxLength = lit.maxLength;\n if (lit.pattern !== undefined) propertyShape.pattern = lit.pattern;\n }\n if (config.hasValue !== undefined) {\n const v = config.hasValue;\n propertyShape.hasValueConstraint = typeof v === 'object' && v !== null ? toNodeReference(v) : v;\n }\n if (config.defaultValue !== undefined) {\n propertyShape.defaultValue = config.defaultValue;\n }\n if (config.in) {\n propertyShape.in = config.in.map((entry) =>\n typeof entry === 'object' && entry !== null ? toNodeReference(entry) : entry,\n );\n }\n if (config.sortBy) {\n propertyShape.sortBy = normalizePropertyPath(config.sortBy);\n }\n // Arrangement + display metadata. `order` and `group` were declared on the config\n // but never copied onto the property shape, so a declared `sh:order` was silently\n // dropped and every renderer fell back to array position. Carried now, alongside\n // the two display terms.\n if (config.order !== undefined) propertyShape.order = config.order;\n if (config.group !== undefined) propertyShape.group = config.group;\n if (config.displayRank !== undefined) propertyShape.displayRank = config.displayRank;\n if (config.displayHidden !== undefined)\n propertyShape.displayHidden = config.displayHidden;\n\n propertyShape.nodeKind = normalizeNodeKind(config.nodeKind, defaultNodeKind);\n (propertyShape as unknown as ExplicitFlags)[EXPLICIT_NODE_KIND_SYMBOL] =\n config.nodeKind !== undefined;\n\n if (shapeClass) {\n onShapeSetup(shapeClass, (shape: NodeShapeData) => {\n connectValueShape(config, propertyKey, propertyShape);\n registerPropertyShape(shape, propertyShape);\n });\n }\n\n return propertyShape;\n}\n\nexport function onShapeSetup(\n shapeClass: typeof Shape | [string, string],\n callback: (shape: NodeShapeData) => void,\n propertyName?: string,\n waitForSuperShapes?: boolean,\n) {\n const cb = waitForSuperShapes\n ? (shape: NodeShapeData) => {\n const superClass = Object.getPrototypeOf(shapeClass) as typeof Shape;\n if (superClass.name === 'Shape') {\n callback(shape);\n return;\n }\n if (superClass.name === '') {\n console.error(\n `Shape ${shape.label} does not extend base class lincd/shapes/Shape. Make sure it extends Shape.`,\n );\n return;\n }\n onShapeSetup(\n superClass,\n () => {\n callback(shape);\n },\n propertyName,\n waitForSuperShapes,\n );\n }\n : callback;\n\n const safeCallback = (\n targetShapeClass: typeof Shape,\n innerCallback: (shape: NodeShapeData) => void,\n ) => {\n if (targetShapeClass.hasOwnProperty('shape')) {\n innerCallback((targetShapeClass as typeof Shape).shape);\n } else {\n if (!targetShapeClass['shapeCallbacks']) {\n targetShapeClass['shapeCallbacks'] = [];\n }\n targetShapeClass['shapeCallbacks'].push(innerCallback);\n }\n };\n\n if (Array.isArray(shapeClass)) {\n const [packageName, shapeName] = shapeClass;\n const nodeShapeId = getNodeShapeUri(packageName, shapeName);\n if (typeof document !== 'undefined') {\n window.addEventListener('load', () => {\n const resolved = getShapeClass(nodeShapeId);\n if (!resolved) {\n console.warn(\n `Could not find value shape (${packageName}/${shapeName}) for accessor get ${propertyName}(). Likely because it is not bundled.`,\n );\n return;\n }\n safeCallback(resolved as unknown as typeof Shape, cb);\n });\n } else {\n addNodeShapeCallback(nodeShapeId, cb);\n }\n } else {\n safeCallback(shapeClass, cb);\n }\n}\n\nconst _linkedProperty = <\n Config extends ObjectPropertyShapeConfig | LiteralPropertyShapeConfig,\n>(\n config: Config,\n defaultNodeKind: NodeReferenceValue = null,\n) => {\n return function (\n target: any,\n propertyKey: string,\n _descriptor: PropertyDescriptor,\n ) {\n createPropertyShape(config, propertyKey, defaultNodeKind, target.constructor);\n };\n};\n\nexport const literalProperty = (config: LiteralPropertyShapeConfig) => {\n return _linkedProperty<LiteralPropertyShapeConfig>(config, shacl.Literal);\n};\n\nexport const objectProperty = (config: ObjectPropertyShapeConfig) => {\n return _linkedProperty<ObjectPropertyShapeConfig>(config, shacl.IRI);\n};\n\nexport const linkedProperty = (\n config: ObjectPropertyShapeConfig | LiteralPropertyShapeConfig,\n) => {\n return _linkedProperty(config);\n};\n\nexport function disallowProperty(\n target: any,\n propertyKey: string,\n _descriptor: PropertyDescriptor,\n) {\n onShapeSetup(\n target.constructor,\n (shape: NodeShapeData) => {\n const superClass = Object.getPrototypeOf(target.constructor) as typeof Shape;\n const superNodeShape = superClass.shape;\n const superPropertyShape = getPropertyShapeData(\n superNodeShape,\n propertyKey,\n true,\n );\n if (!superPropertyShape) {\n console.warn(\n `Property ${propertyKey} not found in super class ${superClass.name} or any of its super classes. Does it have a property decorator? Cannot disallow property ${target.constructor.name}.${propertyKey}`,\n );\n return;\n }\n const clonedPropertyShape = clonePropertyShape(superPropertyShape);\n clonedPropertyShape.maxCount = 0;\n registerPropertyShape(shape, clonedPropertyShape);\n },\n '',\n true,\n );\n}\n\nexport function getNodeShapeUri(packageName: string, shapeName: string): string {\n // arch-02: `{baseUri}shape/{packageSlug}/{ShapeName}` — ShapeName kept PascalCase\n // (it is a class name, already URI-safe), packageSlug derived from the name.\n return `${resolveBaseUri(packageName)}shape/${packageNameToSlug(packageName)}/${shapeName}`;\n}\n\nconst nodeShapeCallbacks = new Map<string, ((shape: NodeShapeData) => void)[]>();\nexport function getAndClearCallbacks(\n nodeShapeId: string,\n): ((shape: NodeShapeData) => void)[] {\n const callbacks = nodeShapeCallbacks.get(nodeShapeId);\n nodeShapeCallbacks.delete(nodeShapeId);\n return callbacks;\n}\nexport const addNodeShapeCallback = (\n nodeShapeId: string,\n callback: (shape: NodeShapeData) => void,\n) => {\n if (!nodeShapeCallbacks.has(nodeShapeId)) {\n nodeShapeCallbacks.set(nodeShapeId, []);\n }\n nodeShapeCallbacks.get(nodeShapeId).push(callback);\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Shape.js","sourceRoot":"","sources":["../../../src/shapes/Shape.ts"],"names":[],"mappings":";;;;;;;;;AAcA,OAAO,EAAC,YAAY,EAAC,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAC,YAAY,EAAC,MAAM,4BAA4B,CAAC;AAGxD,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAC,aAAa,EAAgB,MAAM,6BAA6B,CAAC;AAEzE,OAAO,EAAC,uBAAuB,EAAC,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAC,QAAQ,EAAC,MAAM,4BAA4B,CAAC;AA2BpD;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAC/B,UAA8C,EAC9C,EAAW;IAEX,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAA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W,EACtB,GAAG,CAAC,QAAQ,EAAE,CACf,CAAC;wBACF,IAAI,aAAa,EAAE,CAAC;4BAClB,OAAO,aAAa,CAAC;wBACvB,CAAC;wBACD,MAAM,IAAI,KAAK,CACb,GAAG,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,QAAQ,EAAE,iGAAiG,CAChI,CAAC;oBACJ,CAAC;gBACH,CAAC;YACH,CAAC;SACF,CAAC,CAAC;QACH,OAAO,WAAW,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,CAEb,MAAiD;QAEjD,MAAM,GAAG,GAAG,IAAI,QAAQ,EAAK,CAAC;QAC9B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;gBAC3B,GAAG,CAAC,GAAG,CAAC,KAAU,CAAC,CAAC;YACtB,CAAC;iBAAM,CAAC;gBACN,MAAM,QAAQ,GAAG,iBAAiB,CAChC,IAAI,EACJ,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAC7C,CAAC;gBACF,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YACpB,CAAC;QACH,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;;AAtYM,iBAAW,GAAuB,IAAI,CAAC;AAEvC,mBAAa,GAAmC,IAAI,GAAG,EAAE,CAAC","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 */\nimport type {NodeShapeData, PropertyShapeData} from './nodeShapeData.js';\nimport type {\n QueryBuildFn,\n QueryResponseToResultType,\n SelectAllQueryResponse,\n WhereClause,\n} from '../queries/SelectQuery.js';\nimport type {NodeReferenceValue, UpdatePartial} from '../queries/QueryFactory.js';\nimport type {NodeId} from '../queries/MutationQuery.js';\nimport {QueryBuilder} from '../queries/QueryBuilder.js';\nimport {AskBuilder} from '../queries/AskBuilder.js';\nimport {CountBuilder} from '../queries/CountBuilder.js';\nimport type {PendingQueryContext} from '../queries/QueryContext.js';\nimport type {IDataset} from '../interfaces/IDataset.js';\nimport {CreateBuilder} from '../queries/CreateBuilder.js';\nimport {UpdateBuilder} from '../queries/UpdateBuilder.js';\nimport {DeleteBuilder, type DeleteId} from '../queries/DeleteBuilder.js';\nimport type {ExpressionUpdateProxy, ExpressionUpdateResult} from '../expressions/ExpressionMethods.js';\nimport {getPropertyShapeByLabel} from '../utils/ShapeClass.js';\nimport {ShapeSet} from '../collections/ShapeSet.js';\n\n//shape that returns property shapes for its keys\ntype AccessPropertiesShape<T extends Shape> = {\n [P in keyof T]: PropertyShapeData;\n};\ntype PropertyShapeMapFunction<T extends Shape, ResponseType> = (\n p: AccessPropertiesShape<T>,\n) => ResponseType;\n\n/**\n * Concrete constructor type for Shape subclasses — used at runtime boundaries\n * (Builder `from()` methods, Shape static `this` parameters, mutation factories).\n *\n * Uses concrete `new` (not `abstract new`) so TypeScript accepts the class as a\n * value and reads its static `.shape`/`.targetClass` without casts. NOTE: `new\n * shape()` is only a *type-level* capability — at runtime the `Shape` constructor\n * throws (shapes are metadata, not data). The framework builds proxy targets via\n * `createShapeTarget()` (Object.create), never `new`.\n */\nexport type ShapeConstructor<S extends Shape = Shape> = (new (\n ...args: any[]\n) => S) & {\n shape: NodeShapeData;\n targetClass?: NodeReferenceValue;\n};\n\n/**\n * @internal\n * Build a constructor-less, prototype-linked Shape used ONLY as a proxy /\n * metadata-carrier target inside the query DSL (never handed to consumers and\n * never persisted). It is a genuine `Shape` on the prototype chain — so\n * `.constructor`, the `nodeShape` getter, `ShapeSet`, and `getLeastSpecificShape`\n * all work — but it deliberately bypasses the `Shape` constructor, which is\n * guarded to reject direct instantiation. Not exported from the package index.\n */\nexport function createShapeTarget<S extends Shape>(\n shapeClass: ShapeConstructor<S> | typeof Shape,\n id?: string,\n): S {\n const target = Object.create(shapeClass.prototype) as S;\n if (id !== undefined) {\n target.id = id;\n }\n return target;\n}\n\nexport abstract class Shape {\n static targetClass: NodeReferenceValue = null;\n static shape: NodeShapeData;\n static typesToShapes: Map<string, Set<typeof Shape>> = new Map();\n\n __queryContextId?: string;\n /** The query-context name this shape was registered under (for `{@ctx}` refs). */\n __queryContextName?: string;\n id?: string;\n\n // Instantiation guard DEFERRED on the `lego-demo` branch (per René): some\n // framework shapes (e.g. server `LocalFileStore`) legitimately `extends Shape`\n // and are constructed as runtime service objects, which the upstream guard\n // (core report 026) rejects at backend boot. The `validate()`/`assertValid()`\n // work from the same dev merge is KEPT; only the constructor throw is relaxed —\n // restoring pre-guard behaviour: accept an optional node ref and set `id`\n // (mirrors `createShapeTarget`). Re-enable the guard once those shapes migrate.\n constructor(node?: string | {id?: string}) {\n if (node !== undefined) {\n this.id = typeof node === 'string' ? node : node.id;\n }\n }\n\n get nodeShape(): NodeShapeData {\n return (this.constructor as typeof Shape).shape;\n }\n\n get uri(): string {\n return this.id;\n }\n\n set uri(value: string) {\n this.id = value;\n }\n\n /**\n * @internal\n * @param shapeClass\n * @param type\n */\n static registerByType(shapeClass: typeof Shape, type?: NodeReferenceValue) {\n if (!type) {\n if (shapeClass === Shape) {\n return;\n }\n const shapeType = shapeClass.targetClass;\n if (shapeType) {\n type = shapeType;\n }\n }\n if (!type) {\n return;\n }\n const typeId = type.id;\n if (!this.typesToShapes.has(typeId)) {\n this.typesToShapes.set(typeId, new Set());\n }\n this.typesToShapes.get(typeId).add(shapeClass);\n }\n\n /**\n * Select properties of instances of this shape.\n * Chain `.for(id)` to target a single entity, or `.forAll(ids)` for multiple.\n * The select callback receives a proxy of the shape for type-safe property access.\n */\n static select<\n S extends Shape,\n R = unknown,\n ResultType = QueryResponseToResultType<R, S>[],\n >(\n this: ShapeConstructor<S>,\n selectFn: QueryBuildFn<S, R>,\n ): QueryBuilder<S, R, ResultType>;\n static select<\n S extends Shape,\n R = unknown,\n ResultType = QueryResponseToResultType<R, S>[],\n >(\n this: ShapeConstructor<S>,\n ): QueryBuilder<S, R, ResultType>;\n static select<\n S extends Shape,\n R = unknown,\n ResultType = QueryResponseToResultType<R, S>[],\n >(\n this: ShapeConstructor<S>,\n selectFn?: QueryBuildFn<S, R>,\n ): QueryBuilder<S, R, ResultType> {\n let builder = QueryBuilder.from(this) as QueryBuilder<S, any, any>;\n if (selectFn) {\n builder = builder.select(selectFn as any);\n }\n return builder as QueryBuilder<S, R, ResultType>;\n }\n\n /**\n * Select all decorated properties of this shape.\n * Chain `.for(id)` to target a single entity.\n */\n static selectAll<\n S extends Shape,\n ResultType = QueryResponseToResultType<\n SelectAllQueryResponse<S>,\n S\n >[],\n >(\n this: ShapeConstructor<S>,\n ): QueryBuilder<S, any, ResultType> {\n return QueryBuilder.from(this).selectAll() as QueryBuilder<S, any, ResultType>;\n }\n\n /**\n * Whether a node with this id exists as an instance of this shape.\n *\n * On the base class — `Shape.exists(uri)` — it means something different and\n * weaker: does a node with this IRI exist **at all**, under any type or none.\n * There is no shape to constrain by, so no `rdf:type` triple is emitted and the\n * query is `ASK { <uri> ?p ?o }`. (`Shape` is free to mean this because the\n * shapes themselves are described by `NodeShape` and `PropertyShape`, so\n * `Shape.exists` is not needed for \"is this a shape?\".) Because a shapeless ask\n * has no shape to route on, a router asks every dataset it knows — see\n * `LinkedStorage.askQuery`.\n *\n * ```typescript\n * if (await SourceDocument.exists({id})) {\n * await SourceDocument.update(values).for({id});\n * } else {\n * await SourceDocument.create({id, ...values});\n * }\n * ```\n *\n * Resolves to a real `boolean` — unlike `select().where(…).one()`, which resolves\n * to a row or `null` and leaves the conversion (and the failure modes) to the\n * caller. Runs the cheapest correct query: against a SPARQL store, an\n * `ASK WHERE { ?a0 rdf:type <ShapeClass> . FILTER(?a0 = <id>) }` — the shape's\n * type triple and an equality filter on the subject, nothing else.\n *\n * Note the type triple: this asks whether the node exists **as an instance of\n * this shape**. A node with that IRI and a different type answers `false`.\n *\n * A `null`/`undefined` id resolves to `false` without touching the store — as does\n * a `PendingQueryContext` whose value has not landed yet, since there is no subject\n * to ask about. (An unresolved context inside a *where clause* rejects instead; see\n * {@link QueryBuilder.exists}.)\n *\n * **Errors reject — they are never reported as `false`.** Do not wrap this in a\n * `.catch(() => false)`: that is exactly how a broken existence check hides,\n * turning every `exists ? update : create` into an unconditional `create`.\n *\n * For \"does *anything* match?\", compose on the builder instead:\n * `await Person.select().where(p => p.name.equals('Semmy')).exists()`.\n *\n * @param id The node id: a string IRI, a `{id}` reference, or a `PendingQueryContext`.\n * A malformed string IRI rejects (it does not throw synchronously).\n * @param target Optional explicit dataset to run against; omitted uses the\n * global query dispatch.\n */\n static async exists<S extends Shape>(\n this: ShapeConstructor<S> | typeof Shape,\n id: string | NodeReferenceValue | PendingQueryContext | null | undefined,\n target?: IDataset,\n ): Promise<boolean> {\n // `async`, so that a bad string IRI (resolveUriOrThrow) rejects rather than\n // throwing synchronously past the caller's .catch().\n if ((this as unknown) === Shape) {\n // Called on the base class: no shape to constrain by, so no rdf:type triple.\n // `ASK { <iri> ?p ?o }` — does this node exist at all?\n return AskBuilder.forNode(id).exec(target);\n }\n return QueryBuilder.from(this as ShapeConstructor<S>).for(id).exists(target);\n }\n\n /**\n * How many instances of this shape exist — a real `number`.\n *\n * ```typescript\n * const total = await Person.count();\n * ```\n *\n * This is the unfiltered total. For a filtered one, compose on the builder, which\n * is the form a paging table wants:\n *\n * ```typescript\n * await Person.select().where(p => p.name.equals('Semmy')).count();\n * ```\n *\n * Runs the cheapest correct query: against a SPARQL store,\n * `SELECT (COUNT(DISTINCT ?a0) AS ?count) WHERE { ?a0 rdf:type <ShapeClass> }` —\n * the shape's type triple and nothing else. Note the type triple: this counts\n * instances **of this shape**, not nodes in general.\n *\n * **On the base class — `Shape.count()` — this throws.** Unlike\n * {@link Shape.exists}, whose shapeless reading (\"does this node exist at all?\")\n * is useful and cheap, a shapeless count would count every node in every dataset\n * the router knows. No caller means that, so it is refused rather than answered.\n *\n * **Errors reject — they are never reported as `0`.** Do not wrap this in a\n * `.catch(() => 0)`: `0` is a plausible count, so a broken one renders an empty\n * table that looks exactly like real data.\n *\n * @param target Optional explicit dataset to run against; omitted uses the\n * global query dispatch.\n */\n static async count<S extends Shape>(\n this: ShapeConstructor<S> | typeof Shape,\n target?: IDataset,\n ): Promise<number> {\n // `async`, so the base-class refusal rejects rather than throwing synchronously\n // past the caller's `.catch()`.\n if ((this as unknown) === Shape) {\n throw new Error(\n 'Shape.count() has no meaning on the base class: there is no shape to ' +\n 'constrain by, so it would count every node in the store, under any type or ' +\n 'none. Call it on a shape subclass (`Person.count()`), or compose a filter ' +\n 'on the builder (`Person.select().where(…).count()`).',\n );\n }\n return CountBuilder.of({\n shapeClass: this as ShapeConstructor<S>,\n }).exec(target);\n }\n\n /**\n * Update properties of an instance of this shape.\n * Chain `.for(id)` to target a specific entity.\n *\n * ```typescript\n * await Person.update({name: 'Alice'}).for({id: '...'});\n * ```\n *\n * **`__id` is for *new* nodes only** — a fixed id for a nested node being\n * created (here, when **adding** to a relation: `update({friends: {add: {__id, name}}})`).\n * Do NOT put `__id` on a plain single-valued *replace* (`update({image: {__id, contentUrl}})`):\n * it re-targets that same node and *adds* another value instead of replacing\n * (breaks `sh:maxCount 1`). For a replace, **omit `__id`** — the engine drops the\n * old edge and writes a fresh node, so the value replaces cleanly. (Use `Shape.create`\n * for `__id` at creation; use `.delete()` or `{remove: […]}` for full owned-node cleanup.)\n *\n * **On a node that does not exist, this still writes — untyped.** `update`'s WHERE is a\n * bare `OPTIONAL`, so it matches whether or not the subject exists, and the INSERT fires\n * either way. What it never writes is `rdf:type`, so the result is an id carrying\n * properties that no shape-scoped select can find, and the call reports success. If the\n * node may be absent, use {@link Shape.upsert} instead, which asserts the type. (Whether\n * `update` should instead no-op on an absent node is an open semantic question — core\n * backlog 039.)\n */\n static update<S extends Shape>(\n this: ShapeConstructor<S>,\n data: (p: ExpressionUpdateProxy<S>) => ExpressionUpdateResult<S>,\n ): UpdateBuilder<S, any>;\n static update<S extends Shape, U extends UpdatePartial<S>>(\n this: ShapeConstructor<S>,\n data: U,\n ): UpdateBuilder<S, U>;\n static update<S extends Shape>(\n this: ShapeConstructor<S>,\n data: any,\n ): UpdateBuilder<S, any> {\n return UpdateBuilder.from(this).set(data) as unknown as UpdateBuilder<S, any>;\n }\n\n /**\n * Create the node if it is absent, replace the named properties if it is present —\n * in one request.\n *\n * ```ts\n * await SourceDocument.upsert(values).for({id});\n * ```\n *\n * This replaces the branch callers otherwise hand-roll:\n *\n * ```ts\n * if (await S.exists({id})) await S.update(values).for({id});\n * else await S.create({id, ...values});\n * ```\n *\n * which costs two round-trips, races between them, and — if the check is wrong in the\n * `false` direction — takes the `create` branch silently, duplicating single-valued\n * properties rather than erroring.\n *\n * Semantics:\n * - Replaces **only the properties named**; others on an existing node are untouched.\n * It is not a whole-node replace.\n * - Always asserts the node's type, which `update().for({id})` does not — an update\n * against an absent id writes its properties onto an untyped node.\n * - Returns what `update` returns. It deliberately does **not** report whether it\n * created or replaced: knowing that needs the extra read this avoids.\n * - `.where()` / `.forAll()` are rejected — an upsert targets one known id.\n * - **The id goes in `.for(id)`, not in the data object** — unlike `create`, where an\n * `id`/`__id` in the data names the node being created. Here the data object is\n * properties only; an `id` in it is rejected.\n * - Expression-valued fields are rejected: an expression reads the node's current\n * value, which does not exist when upsert creates it, and the property would be\n * silently skipped.\n */\n static upsert<S extends Shape, U extends UpdatePartial<S>>(\n this: ShapeConstructor<S>,\n data: U,\n ): UpdateBuilder<S, U> {\n return UpdateBuilder.upsertFrom(this).set(data) as unknown as UpdateBuilder<S, U>;\n }\n\n static create<S extends Shape, U extends UpdatePartial<S>>(\n this: ShapeConstructor<S>,\n updateObjectOrFn?: U,\n ): CreateBuilder<S, U> {\n let builder = CreateBuilder.from(this) as CreateBuilder<S, any>;\n if (updateObjectOrFn) {\n builder = builder.set(updateObjectOrFn);\n }\n return builder as unknown as CreateBuilder<S, U>;\n }\n\n static delete<S extends Shape>(\n this: ShapeConstructor<S>,\n id: DeleteId | DeleteId[] | NodeReferenceValue[],\n ): DeleteBuilder<S> {\n return DeleteBuilder.from(this, id) as DeleteBuilder<S>;\n }\n\n /** Delete all instances of this shape type. Returns void. */\n static deleteAll<S extends Shape>(\n this: ShapeConstructor<S>,\n ): DeleteBuilder<S, void> {\n return (DeleteBuilder.from(this) as DeleteBuilder<S>).all();\n }\n\n /** Delete instances matching a condition. Sugar for `.delete().where(fn)`. Returns void. */\n static deleteWhere<S extends Shape>(\n this: ShapeConstructor<S>,\n fn: WhereClause<S>,\n ): DeleteBuilder<S, void> {\n return (DeleteBuilder.from(this) as DeleteBuilder<S>).where(fn);\n }\n\n /**\n * @deprecated Unused; the DSL reads property shapes via `nodeShapeData` free\n * functions and static metadata. Scheduled for removal.\n */\n static mapPropertyShapes<S extends Shape, ResponseType = unknown>(\n this: ShapeConstructor<S>,\n mapFunction?: PropertyShapeMapFunction<S, ResponseType>,\n ): ResponseType {\n // SAFETY: dummyShape is used as a dynamic proxy target — we assign .proxy and\n // access arbitrary property names on it, which S doesn't declare.\n let dummyShape: any = createShapeTarget(this);\n dummyShape.proxy = new Proxy(dummyShape, {\n get(target, key, receiver) {\n if (typeof key === 'string') {\n if (key in dummyShape) {\n if (typeof dummyShape[key] === 'function') {\n return target[key].bind(target);\n }\n let propertyShape = getPropertyShapeByLabel(\n dummyShape.constructor,\n key.toString(),\n );\n if (propertyShape) {\n return propertyShape;\n }\n throw new Error(\n `${this.name}.${key.toString()} is missing a @linkedProperty decorator. This method can only access decorated get/set methods.`,\n );\n }\n }\n },\n });\n return mapFunction(dummyShape.proxy);\n }\n\n /**\n * @deprecated Unused; shapes are metadata and no longer materialized into\n * `ShapeSet`s of instances. Scheduled for removal.\n */\n static getSetOf<T extends Shape>(\n this: ShapeConstructor<T>,\n values: Iterable<T | NodeReferenceValue | string>,\n ): ShapeSet<T> {\n const set = new ShapeSet<T>();\n for (const value of values) {\n if (value instanceof Shape) {\n set.add(value as T);\n } else {\n const instance = createShapeTarget(\n this,\n typeof value === 'string' ? value : value.id,\n );\n set.add(instance);\n }\n }\n return set;\n }\n}\n"]}
|