Inner StoreClient receiving the validated requests
Optional validation options, and the default retrieval scope
Optional Readonlytrusted?: booleanWhether to skip re-validation of lookup responses against the shape, as narrowed by
the caller's model.
Optional Readonlyscope?: StoreScopeThe retrieval scope that fills in the members a lookup scope
leaves out, one by one, before the model of the lookup is checked against its bounds.
It is a fallback, not a ceiling. A bound the lookup states wins even when it is wider, so a service taking the scope from an untrusted client must cap it before calling the store, as this option never will.
An immutable StoreClient wrapping store with input validation
Creates a validating store backed by a delegate.
Each method validates its inputs against the supplied shape before forwarding the request to
store:entrymust be an absolute IRI with no query string and no fragment; otherwise the request is rejected with a RangeErrormodelis validated as a template for lookup, within the bounds of the caller's retrieval scope, and as a collection slice for create, which no retrieval bound applies to as it retrieves nothingstate.id, if present, must be nested underentryfor create, and equal toentryfor update and insert; otherwise the request is rejected with a RangeErrorstateis validated as a resource with captive expansion capped at depth0, so inline captive batches are rejected; create validates it against the shape of the collected resources, and update and insert against the supplied shapeThe
trustedoption controls whether lookup responses are re-validated against the shape, as narrowed by the caller'smodel. It defaults tofalse, the safe choice for connectors whose source may deliver non-conforming data, such as a remote REST endpoint. Local stores that compute results themselves can passtrusted: trueto skip the redundant check.The
scopeoption fills in the members a lookup scope leaves out. A deployment that trusts its callers states wide bounds there once, and the wrapped store receives each lookup scope as filled in. The option is a fallback rather than a ceiling, so it never caps the bounds a lookup states for itself.Validation failures surface as TraceError or RangeError rejections, in line with the unified Store error channel.