@mistriwork/engine 1.0.0-rc.80 → 1.0.0-rc.81

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.
@@ -61,6 +61,11 @@ export interface QueryPerson {
61
61
  * refused rather than read as text.
62
62
  */
63
63
  chosen?: Readonly<Record<string, string | number | null>>;
64
+ /**
65
+ * With `chosen`: declared choices the door was not told (an API call that named some picks and not others). Each
66
+ * reads as `chosen` itself being absent does, so the words say what to do rather than that the name is unknown.
67
+ */
68
+ chosenUnset?: readonly string[];
64
69
  }
65
70
  /** One column of a tenant's profile row, as a member may read it. */
66
71
  export type TenantValue = string | number | boolean | null;
@@ -113,10 +113,13 @@ export function chosenOperand(ctx, word, quoted) {
113
113
  return me.once
114
114
  ? { error: `${word} is a choice of one request's person, and this query is read once for every request, so it cannot ask it.` }
115
115
  : { value: word };
116
+ const personLess = {
117
+ error: `${word} is the person's App choice, and nothing here runs for a person at a desk (a job, a workflow step, an API call): take it as input, or quote it ("${word}") to mean the text.`,
118
+ };
116
119
  if (!me?.chosen)
117
- return {
118
- error: `${word} is the person's App choice, and nothing here runs for a person at a desk (a job, a workflow step, an API call): take it as input, or quote it ("${word}") to mean the text.`,
119
- };
120
+ return personLess;
121
+ if (!Object.hasOwn(me.chosen, match[1]) && me.chosenUnset?.includes(match[1]))
122
+ return personLess;
120
123
  if (!Object.hasOwn(me.chosen, match[1]))
121
124
  return { error: `${word} names no choice: the App's choose declares ${Object.keys(me.chosen).join(', ') || 'none'}.` };
122
125
  const value = me.chosen[match[1]];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mistriwork/engine",
3
- "version": "1.0.0-rc.80",
3
+ "version": "1.0.0-rc.81",
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": {