@mistriwork/engine 1.0.0-rc.18 → 1.0.0-rc.20

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.
@@ -189,14 +189,16 @@ function alias(name, n) {
189
189
  * columns, then the filter, then the sort. Aliases are handed out on first
190
190
  * use, so the same view always produces the same statement.
191
191
  */
192
- export function compileView(schema, view, style, offset = 0, scope) {
192
+ export function compileView(schema, view, style, offset = 0, scope,
193
+ /** The catalog a row scope's `via` targets resolve in, where the reader's own is pruned (rowScope.ts ScopedRelations). */
194
+ policy = schema) {
193
195
  // The App's soft keys, where this catalog is the database's own (declaredReferences.ts).
194
196
  schema = withViewReferences(schema, view.references);
195
197
  const base = findTable(schema, view.base);
196
198
  if (!base) {
197
199
  throw new PathError(`No table called "${view.base}" in this database, so the view has nothing to start from.`, view.base, view.base, 0);
198
200
  }
199
- const relations = new ScopedRelations(schema, style, scope);
201
+ const relations = new ScopedRelations(schema, style, scope, policy);
200
202
  const baseRelation = relations.table(base.id);
201
203
  const plan = new JoinPlan(schema, base, style, relations.table);
202
204
  const { resolve, qualify, membership, exists, typeOf } = viewPaths(schema, view, plan, style, relations);
@@ -755,13 +757,13 @@ function anyRowsOf(schema, base, body, now, options, anys, extra) {
755
757
  * design rests on: a view never multiplies, so counting it is counting the
756
758
  * table it started from. With `limit`, it stops after that many.
757
759
  */
758
- export function compileViewCount(schema, view, style, scope, limit) {
760
+ export function compileViewCount(schema, view, style, scope, limit, policy = schema) {
759
761
  schema = withViewReferences(schema, view.references);
760
762
  const base = findTable(schema, view.base);
761
763
  if (!base) {
762
764
  throw new PathError(`No table called "${view.base}" in this database, so the view has nothing to start from.`, view.base, view.base, 0);
763
765
  }
764
- const relations = new ScopedRelations(schema, style, scope);
766
+ const relations = new ScopedRelations(schema, style, scope, policy);
765
767
  const baseRelation = relations.table(base.id);
766
768
  const plan = new JoinPlan(schema, base, style, relations.table);
767
769
  const { qualify, membership, exists, typeOf } = viewPaths(schema, view, plan, style, relations);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mistriwork/engine",
3
- "version": "1.0.0-rc.18",
3
+ "version": "1.0.0-rc.20",
4
4
  "description": "The engine both products stand on: the adapters (SQLite, Postgres), the catalog, the query language, keyset pages, the HTTP kit and the shared rules. No React.",
5
5
  "homepage": "https://mistriwork.dev",
6
6
  "bugs": {
package/schema/theme.d.ts CHANGED
@@ -172,6 +172,7 @@ export type ThemePart =
172
172
  | 'banner'
173
173
  | 'steps.step'
174
174
  | 'avatar'
175
+ | 'identityMark'
175
176
  | 'menu'
176
177
  | 'dialog'
177
178
  | 'chart';