import * as react from 'react'; import { ReactNode } from 'react'; declare const ACTOR_VOCABULARY: readonly ["user", "agent", "system"]; /** The three words the store still accepts and rewrites, and what each becomes. */ declare const RETIRED_ACTOR_WORDS: { readonly ai: "agent"; readonly code: "system"; readonly human: "user"; }; declare const ABSENCE_REASONS: readonly ["never asked", "none", "refused", "conflicting"]; declare const VALUE_ENVELOPE_KEYS: readonly ["ver", "src", "actor", "on_behalf_of", "at", "absent", "alternates", "dated", "pinned"]; declare const VALUE_ALTERNATE_KEYS: readonly ["value", "src", "rank"]; declare const STORAGE_MODES: readonly ["light", "heavy"]; declare const RULE_USES: readonly ["validate", "compute", "membership", "applicability"]; declare const PER_VALUE_ACCESS_WORDS: readonly ["visibility", "access", "share", "acl", "permission", "permissions", "secret"]; /** FLD-11's parity floor, each with the behavior it is MADE OF (FLD-1). */ declare const PARITY_FIELD_TYPES: readonly [{ readonly parity_type: "attachment"; readonly behavior: "relation"; readonly made_of: "REC-31: a File record reached through a relation, target the kernel `File` Table"; }, { readonly parity_type: "checkbox"; readonly behavior: "boolean"; readonly made_of: "a ticked or unticked answer, stored as a REAL boolean — and a record that never answered holds neither, so filters and group-by see three states, not two"; }, { readonly parity_type: "currency"; readonly behavior: "range"; readonly made_of: "FLD-N-1: a number whose UNIT is the currency and whose format is currency — on the Field, never in presentation"; }, { readonly parity_type: "datetime"; readonly behavior: "range"; readonly made_of: "a range of kind date or datetime — the dated modifier says the VALUES are dated, which is a different question"; }, { readonly parity_type: "email"; readonly behavior: "text"; readonly made_of: "text whose format is email"; }, { readonly parity_type: "formula"; readonly behavior: "formula"; readonly made_of: "FLD-9: a declared computation, on read or on write, evaluated by custom.rule_eval"; }, { readonly parity_type: "lookup"; readonly behavior: "formula"; readonly made_of: "a Value read THROUGH a relation — config.via names the relation field, config.pick the Value on the far side"; }, { readonly parity_type: "member"; readonly behavior: "relation"; readonly made_of: "a person: a relation whose target is the kernel `Person` Table"; }, { readonly parity_type: "multi_select"; readonly behavior: "list"; readonly made_of: "many choices from the same Table — the multi modifier, never a second behaviour"; }, { readonly parity_type: "percent"; readonly behavior: "range"; readonly made_of: "a number whose unit is % and whose format is percent"; }, { readonly parity_type: "phone"; readonly behavior: "text"; readonly made_of: "text whose format is phone"; }, { readonly parity_type: "rollup"; readonly behavior: "formula"; readonly made_of: "an aggregate ALONG a relation — config.via, config.of, config.agg; far-side ids are taken DISTINCT, so nothing is counted twice"; }, { readonly parity_type: "select"; readonly behavior: "list"; readonly made_of: "one choice from a Table shown as a list (FLD-5/FLD-6)"; }, { readonly parity_type: "url"; readonly behavior: "text"; readonly made_of: "text whose format is url, with the pattern Rule that makes the format enforceable"; }]; /** * THE ONE REGISTRY: every kind a column can be DECLARED as, from * `custom.field_kinds()`. `parity` says whether the kind is one of FLD-11's parity * floor; the rest are the behaviors and formats the declaration door answers to and * nothing else enumerated — which is how `signature` came to be a shape * `custom.doc_sign` accepted and no screen could offer. */ declare const DECLARABLE_FIELD_KINDS: readonly [{ readonly kind: "address"; readonly behavior: "text"; readonly parity: false; readonly made_of: "P4: behaviour text, format address; the value is {street, city, region, postal_code, country}, every part optional, at least one filled"; }, { readonly kind: "attachment"; readonly behavior: "relation"; readonly parity: true; readonly made_of: "REC-31: a File record reached through a relation, target the kernel `File` Table"; }, { readonly kind: "barcode"; readonly behavior: "text"; readonly parity: false; readonly made_of: "P4: behaviour text, format barcode; one printable line a scanner reads, config.symbology optional (custom.barcode_symbologies()), EAN/UPC digits and check digit enforced"; }, { readonly kind: "button"; readonly behavior: "text"; readonly parity: false; readonly made_of: "NOTION-PROPS-2: behaviour text, format button; holds no value. config.button says what a press does through custom.button_press: open_url (url, {{field id}} filled from the row), run_automation (one of the table's automations, on this row) or run_action (one of its row actions, which sets fields), or add_row (a new row in this table or table_id's, prefilled from this row by prefill, opened); a button with no do yet is a label only"; }, { readonly kind: "checkbox"; readonly behavior: "boolean"; readonly parity: true; readonly made_of: "a ticked or unticked answer, stored as a REAL boolean — and a record that never answered holds neither, so filters and group-by see three states, not two"; }, { readonly kind: "count"; readonly behavior: "formula"; readonly parity: false; readonly made_of: "P4: a roll-up whose config.agg is count, with format count: how many records a many-relation points at, as a number of its own"; }, { readonly kind: "created_by"; readonly behavior: "formula"; readonly parity: false; readonly made_of: "P4: a formula Field whose config.system is created_by: who made the record, {id, name}, filled by the store from the record's writer on read and never typed"; }, { readonly kind: "currency"; readonly behavior: "range"; readonly parity: true; readonly made_of: "FLD-N-1: a number whose UNIT is the currency and whose format is currency — on the Field, never in presentation"; }, { readonly kind: "datetime"; readonly behavior: "range"; readonly parity: true; readonly made_of: "a range of kind date or datetime — the dated modifier says the VALUES are dated, which is a different question"; }, { readonly kind: "duration"; readonly behavior: "range"; readonly parity: false; readonly made_of: "P4: behaviour range, format duration, unit seconds; a length of time kept as seconds, never below zero"; }, { readonly kind: "email"; readonly behavior: "text"; readonly parity: true; readonly made_of: "text whose format is email"; }, { readonly kind: "entity_reference"; readonly behavior: "relation"; readonly parity: false; readonly made_of: "SC-R / P12: a relation whose target mode is any (REL-8), restricted by config.allowed_types to the platform kinds it may name (custom.entity_reference_kinds() — agents, notes, web sites, workbooks, datasets, conversations …); each value is {token, id}, the edge a platform.associations row record → . File and Person stay relations to their kernel Tables"; }, { readonly kind: "formula"; readonly behavior: "formula"; readonly parity: true; readonly made_of: "FLD-9: a declared computation, on read or on write, evaluated by custom.rule_eval"; }, { readonly kind: "json"; readonly behavior: "text"; readonly parity: false; readonly made_of: "W2-A: behaviour text, format json; any JSON value (object, list, number, words, yes/no) kept as jsonb, shown collapsed"; }, { readonly kind: "long_text"; readonly behavior: "text"; readonly parity: false; readonly made_of: "behaviour text with format long and config.multiline, for several lines rather than one"; }, { readonly kind: "lookup"; readonly behavior: "formula"; readonly parity: true; readonly made_of: "a Value read THROUGH a relation — config.via names the relation field, config.pick the Value on the far side"; }, { readonly kind: "member"; readonly behavior: "relation"; readonly parity: true; readonly made_of: "a person: a relation whose target is the kernel `Person` Table"; }, { readonly kind: "modified_by"; readonly behavior: "formula"; readonly parity: false; readonly made_of: "P4: a formula Field whose config.system is modified_by: who last changed the record, {id, name}, filled by the store on read and never typed"; }, { readonly kind: "multi_select"; readonly behavior: "list"; readonly parity: true; readonly made_of: "many choices from the same Table — the multi modifier, never a second behaviour"; }, { readonly kind: "number"; readonly behavior: "range"; readonly parity: false; readonly made_of: "a plain number: behaviour range with no date kind and neither the currency nor the percent format"; }, { readonly kind: "percent"; readonly behavior: "range"; readonly parity: true; readonly made_of: "a number whose unit is % and whose format is percent"; }, { readonly kind: "phone"; readonly behavior: "text"; readonly parity: true; readonly made_of: "text whose format is phone"; }, { readonly kind: "rating"; readonly behavior: "range"; readonly parity: false; readonly made_of: "P4: behaviour range, format rating; a whole number of stars from 0 to its max Rule (1 to 10, default 5), shown as stars"; }, { readonly kind: "relation"; readonly behavior: "relation"; readonly parity: false; readonly made_of: "REL / FLD-11: a relation a person aims themselves — relation_target names a Table of this organization, and it is a BEHAVIOUR, never a parity type of its own"; }, { readonly kind: "rich_text"; readonly behavior: "text"; readonly parity: false; readonly made_of: "P4: behaviour text, format rich_text; Markdown with no raw HTML and no script links, shown formatted"; }, { readonly kind: "rollup"; readonly behavior: "formula"; readonly parity: true; readonly made_of: "an aggregate ALONG a relation — config.via, config.of, config.agg; far-side ids are taken DISTINCT, so nothing is counted twice"; }, { readonly kind: "select"; readonly behavior: "list"; readonly parity: true; readonly made_of: "one choice from a Table shown as a list (FLD-5/FLD-6)"; }, { readonly kind: "signature"; readonly behavior: "text"; readonly parity: false; readonly made_of: "VAL-10: behaviour text whose format is signature — the one shape custom.doc_sign accepts, sealed by custom.doc_signature_write and checked by custom.doc_signature_intact"; }, { readonly kind: "status"; readonly behavior: "list"; readonly parity: false; readonly made_of: "P4: a single-choice list with format status; config.status_groups puts each choice key in todo, in_progress or done (Notion's Status)"; }, { readonly kind: "text"; readonly behavior: "text"; readonly parity: false; readonly made_of: "plain text: behaviour text with no format — it carries no parity type, which is exactly what custom.parity_type answers for it"; }, { readonly kind: "time"; readonly behavior: "text"; readonly parity: false; readonly made_of: "W2-A: behaviour text, format time; a time of day with no date kept as 24-hour HH:MM or HH:MM:SS (zero-padded, so its text order is its time order); HOUR, MINUTE and SECOND read it"; }, { readonly kind: "url"; readonly behavior: "text"; readonly parity: true; readonly made_of: "text whose format is url, with the pattern Rule that makes the format enforceable"; }]; /** The node kinds `custom.rule_eval` evaluates, and the lane that owns each. */ declare const RULE_NODE_KINDS: readonly [{ readonly node: "actor_at_least"; readonly evaluated_by: "PIPELINES"; }, { readonly node: "add"; readonly evaluated_by: "W1-RULE"; }, { readonly node: "and"; readonly evaluated_by: "W1-RULE"; }, { readonly node: "concat"; readonly evaluated_by: "W1-RULE"; }, { readonly node: "const"; readonly evaluated_by: "W1-RULE"; }, { readonly node: "contains"; readonly evaluated_by: "NOTION-Q"; }, { readonly node: "div"; readonly evaluated_by: "W1-RULE"; }, { readonly node: "eq"; readonly evaluated_by: "W1-RULE"; }, { readonly node: "field"; readonly evaluated_by: "W1-RULE"; }, { readonly node: "fx.abs"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.add"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.and"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.arraycompact"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.arrayflatten"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.arrayjoin"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.arrayslice"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.arrayunique"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.at"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.autonumber"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.average"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.blank"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.ceiling"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.concatenate"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.contains"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.count"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.counta"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.countall"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.created_time"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.current"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.current1"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.current2"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.dateadd"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.datediff"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.datestr"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.datetime_diff"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.datetime_format"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.datetime_parse"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.day"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.div"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.encode_url_component"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.eq"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.error"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.even"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.every"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.exp"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.false"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.filter"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.find"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.findfirst"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.first"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.floor"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.fromnow"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.gt"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.gte"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.hour"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.if"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.includes"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.index"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.int"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.is_after"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.is_before"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.is_same"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.isblank"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.iserror"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.join"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.last"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.last_modified_time"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.left"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.len"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.length"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.log"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.lower"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.lt"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.lte"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.map"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.max"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.median"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.mid"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.min"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.minute"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.mod"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.modified_time"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.month"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.mul"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.ne"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.neg"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.not"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.now"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.odd"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.or"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.power"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.record_id"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.recprop"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.regex_extract"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.regex_match"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.regex_replace"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.regexreplace"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.replace"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.rept"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.reverse"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.right"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.round"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.rounddown"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.roundup"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.search"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.second"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.set_locale"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.set_timezone"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.slice"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.some"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.sort"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.split"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.sqrt"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.sub"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.substitute"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.sum"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.switch"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.t"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.timestr"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.today"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.tonow"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.trim"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.true"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.unique"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.upper"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.value"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.weekday"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.weeknum"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.workday"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.workday_diff"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.xor"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "fx.year"; readonly evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)"; }, { readonly node: "gt"; readonly evaluated_by: "W1-RULE"; }, { readonly node: "gte"; readonly evaluated_by: "W1-RULE"; }, { readonly node: "has_all"; readonly evaluated_by: "NOTION-Q"; }, { readonly node: "has_any"; readonly evaluated_by: "NOTION-Q"; }, { readonly node: "has_none"; readonly evaluated_by: "NOTION-Q"; }, { readonly node: "is_empty"; readonly evaluated_by: "NOTION-Q"; }, { readonly node: "is_exactly"; readonly evaluated_by: "NOTION-Q"; }, { readonly node: "is_not_empty"; readonly evaluated_by: "NOTION-Q"; }, { readonly node: "length"; readonly evaluated_by: "W1-RULE"; }, { readonly node: "linked"; readonly evaluated_by: "NOTION-Q"; }, { readonly node: "lt"; readonly evaluated_by: "W1-RULE"; }, { readonly node: "lte"; readonly evaluated_by: "W1-RULE"; }, { readonly node: "matches"; readonly evaluated_by: "W1-RULE"; }, { readonly node: "merge_field"; readonly evaluated_by: "W5-MERGE-B"; }, { readonly node: "mul"; readonly evaluated_by: "W1-RULE"; }, { readonly node: "ne"; readonly evaluated_by: "W1-RULE"; }, { readonly node: "not"; readonly evaluated_by: "W1-RULE"; }, { readonly node: "not_contains"; readonly evaluated_by: "NOTION-Q"; }, { readonly node: "or"; readonly evaluated_by: "W1-RULE"; }, { readonly node: "parent_field"; readonly evaluated_by: "W1-RULE-APPLY"; }, { readonly node: "present"; readonly evaluated_by: "W1-RULE"; }, { readonly node: "previous"; readonly evaluated_by: "PIPELINES"; }, { readonly node: "sibling_count"; readonly evaluated_by: "STAGE-RULES"; }, { readonly node: "stage_count"; readonly evaluated_by: "PIPELINES"; }, { readonly node: "sub"; readonly evaluated_by: "W1-RULE"; }, { readonly node: "within"; readonly evaluated_by: "CHAIR-FILTER"; }]; /** * What each formula node answers (`custom.formula_node_kinds()`): number, text, boolean, date or unknown. * Generated, so a function the store adds can never be missing from a screen that types a formula. */ declare const FORMULA_NODE_RESULTS: Readonly>; /** REC-27. The kernel, by name and by id, as the store holds it. */ declare const KERNEL_TABLES: readonly [{ readonly id: "11111111-0000-4000-8000-000000000002"; readonly name: "Field"; }, { readonly id: "11111111-0000-4000-8000-000000000006"; readonly name: "File"; }, { readonly id: "11111111-0000-4000-8000-000000000009"; readonly name: "Merge Field"; }, { readonly id: "11111111-0000-4000-8000-000000000004"; readonly name: "Organization"; }, { readonly id: "11111111-0000-4000-8000-000000000005"; readonly name: "Person"; }, { readonly id: "11111111-0000-4000-8000-000000000007"; readonly name: "Presentation"; }, { readonly id: "11111111-0000-4000-8000-000000000003"; readonly name: "Rule"; }, { readonly id: "11111111-0000-4000-8000-000000000001"; readonly name: "Table"; }, { readonly id: "11111111-0000-4000-8000-000000000008"; readonly name: "Widget"; }]; /** * Every door the store actually has, with the argument list and the result the * catalog reports. A client call whose door is not in this list is answered * `door_absent` by name — never a guess, never a silent no-op. */ declare const STORE_DOORS: readonly [{ readonly name: "absence_reasons"; readonly args: ""; readonly returns: "text[]"; readonly security: "invoker"; }, { readonly name: "action_declare"; readonly args: "p_organization_id uuid, p_table_id uuid, p_actions jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "action_run"; readonly args: "p_organization_id uuid, p_action_id uuid, p_record_ids uuid[]"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "actor_vocabulary"; readonly args: ""; readonly returns: "text[]"; readonly security: "invoker"; }, { readonly name: "actor_word"; readonly args: "p_declared text"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "addressed_cap"; readonly args: "p_user_id uuid, p_type text, p_id uuid, p_organization_id uuid DEFAULT NULL::uuid, p_table_id uuid DEFAULT NULL::uuid"; readonly returns: "permission_level"; readonly security: "definer"; }, { readonly name: "addressed_cap_specific"; readonly args: "p_user_id uuid, p_type text, p_id uuid, p_organization_id uuid DEFAULT NULL::uuid, p_table_id uuid DEFAULT NULL::uuid"; readonly returns: "permission_level"; readonly security: "definer"; }, { readonly name: "admin_all_tables"; readonly args: ""; readonly returns: "TABLE(table_id uuid, table_name text, organization_id uuid, organization_name text, updated_at timestamp with time zone, platform_owned boolean, system boolean)"; readonly security: "definer"; }, { readonly name: "agent_change_approval"; readonly args: "p_organization uuid, p_conversation uuid DEFAULT NULL::uuid, p_table uuid DEFAULT NULL::uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "agent_change_trust"; readonly args: "p_organization_id uuid, p_approval_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "agent_context"; readonly args: "p_organization_id uuid, p_table_id uuid, p_limit integer DEFAULT 50"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "agent_context_value"; readonly args: "p_doc jsonb, p_key text, p_type text, p_organization_id uuid, p_record_id uuid, p_cap bigint"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "agent_context_value_cap"; readonly args: "p_organization_id uuid"; readonly returns: "bigint"; readonly security: "invoker"; }, { readonly name: "agent_table_claim"; readonly args: "p_organization uuid, p_table uuid, p_conversation uuid DEFAULT NULL::uuid"; readonly returns: "void"; readonly security: "definer"; }, { readonly name: "agg_assert_key"; readonly args: "p_key text"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "agg_bucket_ordinal"; readonly args: "p_by text, p_window_from timestamp without time zone, p_at timestamp without time zone, p_week_start text"; readonly returns: "integer"; readonly security: "invoker"; }, { readonly name: "agg_buckets"; readonly args: ""; readonly returns: "text[]"; readonly security: "invoker"; }, { readonly name: "agg_cadence_normalize"; readonly args: "p_cadence text"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "agg_calendar"; readonly args: "p_organization_id uuid"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "agg_compare_kinds"; readonly args: ""; readonly returns: "text[]"; readonly security: "invoker"; }, { readonly name: "agg_compare_windows"; readonly args: "p_organization_id uuid, p_compare jsonb, p_bucket jsonb DEFAULT NULL::jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "agg_deliver"; readonly args: "p_organization_id uuid, p_rule_id uuid, p_record_id uuid, p_channel text, p_recipient_user_id uuid, p_event_key text, p_subject text, p_body text, p_payload jsonb DEFAULT '{}'::jsonb, p_dedupe_suffix text DEFAULT NULL::text"; readonly returns: "uuid"; readonly security: "invoker"; }, { readonly name: "agg_deliver_quietly"; readonly args: "p_organization_id uuid, p_rule_id uuid, p_subject_id uuid, p_channel text, p_recipient_user_id uuid, p_event_key text, p_subject text, p_body text, p_payload jsonb, p_quiet_hours jsonb, p_link text, p_dedupe_suffix text DEFAULT NULL::text"; readonly returns: "uuid"; readonly security: "invoker"; }, { readonly name: "agg_delta"; readonly args: "p_current jsonb, p_prior jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "agg_digest_assemble"; readonly args: "p_organization_id uuid, p_rule_id uuid, p_since timestamp with time zone DEFAULT NULL::timestamp with time zone, p_until timestamp with time zone DEFAULT NULL::timestamp with time zone"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "agg_digest_due_at"; readonly args: "p_cadence text, p_schedule text, p_quiet jsonb, p_after timestamp with time zone"; readonly returns: "timestamp with time zone"; readonly security: "invoker"; }, { readonly name: "agg_digest_judged_at"; readonly args: "p_organization_id uuid, p_rule_id uuid"; readonly returns: "timestamp with time zone"; readonly security: "invoker"; }, { readonly name: "agg_digest_run"; readonly args: "p_organization_id uuid, p_rule_id uuid DEFAULT NULL::uuid, p_since timestamp with time zone DEFAULT NULL::timestamp with time zone"; readonly returns: "integer"; readonly security: "invoker"; }, { readonly name: "agg_digest_run_at"; readonly args: "p_organization_id uuid, p_rule_id uuid, p_since timestamp with time zone, p_now timestamp with time zone"; readonly returns: "integer"; readonly security: "invoker"; }, { readonly name: "agg_digest_tick"; readonly args: ""; readonly returns: "integer"; readonly security: "invoker"; }, { readonly name: "agg_digest_tick_at"; readonly args: "p_now timestamp with time zone, p_organization_id uuid DEFAULT NULL::uuid"; readonly returns: "integer"; readonly security: "invoker"; }, { readonly name: "agg_explain"; readonly args: "p_organization_id uuid, p_table_id uuid, p_group_by jsonb DEFAULT '[]'::jsonb, p_measures jsonb DEFAULT '[]'::jsonb, p_bucket jsonb DEFAULT NULL::jsonb, p_filter jsonb DEFAULT '{}'::jsonb, p_required text DEFAULT 'viewer'::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "agg_field_kind"; readonly args: "p_organization_id uuid, p_table_id uuid, p_key text"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "agg_field_value_sql"; readonly args: "p_organization_id uuid, p_table_id uuid, p_key text"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "agg_fields_readable_assert"; readonly args: "p_organization_id uuid, p_table_id uuid, p_keys text[], p_required text DEFAULT 'viewer'::text"; readonly returns: "void"; readonly security: "invoker"; }, { readonly name: "agg_group_value"; readonly args: "p_value text, p_kind text"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "agg_last_digest_at"; readonly args: "p_organization_id uuid, p_rule_id uuid"; readonly returns: "timestamp with time zone"; readonly security: "invoker"; }, { readonly name: "agg_local_label"; readonly args: "p_local timestamp without time zone, p_tz text"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "agg_moment_sql"; readonly args: "p_key text, p_tz text"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "agg_operations"; readonly args: ""; readonly returns: "text[]"; readonly security: "invoker"; }, { readonly name: "agg_parse_moment"; readonly args: "p_raw text, p_tz text, p_what text"; readonly returns: "timestamp with time zone"; readonly security: "invoker"; }, { readonly name: "agg_period_start"; readonly args: "p_local timestamp without time zone, p_by text, p_week_start text DEFAULT 'monday'::text"; readonly returns: "timestamp without time zone"; readonly security: "invoker"; }, { readonly name: "agg_period_step"; readonly args: "p_by text"; readonly returns: "interval"; readonly security: "invoker"; }, { readonly name: "agg_quiet_until"; readonly args: "p_quiet jsonb, p_at timestamp with time zone"; readonly returns: "timestamp with time zone"; readonly security: "invoker"; }, { readonly name: "agg_record_name"; readonly args: "p_organization_id uuid, p_record_id uuid, p_state jsonb DEFAULT NULL::jsonb"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "agg_split_parts"; readonly args: "p_organization_id uuid, p_table_id uuid, p_key text, p_alias text"; readonly returns: "text[]"; readonly security: "invoker"; }, { readonly name: "agg_sql"; readonly args: "p_organization_id uuid, p_table_id uuid, p_group_by jsonb DEFAULT '[]'::jsonb, p_measures jsonb DEFAULT '[]'::jsonb, p_bucket jsonb DEFAULT NULL::jsonb, p_filter jsonb DEFAULT '{}'::jsonb, p_limit integer DEFAULT 200, p_required text DEFAULT 'viewer'::text, p_window jsonb DEFAULT NULL::jsonb, p_search text DEFAULT NULL::text, p_time_zone text DEFAULT NULL::text, p_split_multi boolean DEFAULT false"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "agg_subscription_cadences"; readonly args: ""; readonly returns: "text[]"; readonly security: "invoker"; }, { readonly name: "agg_subscription_fire"; readonly args: "p_organization_id uuid, p_record_id uuid, p_table_id uuid DEFAULT NULL::uuid, p_changed_field_ids jsonb DEFAULT '[]'::jsonb"; readonly returns: "integer"; readonly security: "invoker"; }, { readonly name: "agg_subscription_fire_entered"; readonly args: "p_organization_id uuid, p_record_id uuid, p_table_id uuid DEFAULT NULL::uuid, p_since timestamp with time zone DEFAULT NULL::timestamp with time zone"; readonly returns: "integer"; readonly security: "invoker"; }, { readonly name: "agg_subscription_tick"; readonly args: "p_window interval DEFAULT '00:15:00'::interval"; readonly returns: "integer"; readonly security: "invoker"; }, { readonly name: "agg_subscriptions"; readonly args: "p_organization_id uuid, p_saved_view_id uuid DEFAULT NULL::uuid, p_cadence text DEFAULT NULL::text"; readonly returns: "TABLE(rule_id uuid, saved_view_id uuid, table_id uuid, cadence text, schedule text, quiet_hours jsonb, channel text, recipient_user_id uuid, event_key text, name text)"; readonly security: "invoker"; }, { readonly name: "agg_value_sql"; readonly args: "p_key text"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "agg_value_text"; readonly args: "p_value jsonb"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "agg_view_admits"; readonly args: "p_organization_id uuid, p_saved_view_id uuid, p_record_id uuid"; readonly returns: "boolean"; readonly security: "invoker"; }, { readonly name: "agg_view_admits_state"; readonly args: "p_definition jsonb, p_state jsonb"; readonly returns: "boolean"; readonly security: "invoker"; }, { readonly name: "agg_withheld_marker"; readonly args: "p_organization_id uuid, p_table_id uuid, p_key text, p_required text DEFAULT 'viewer'::text"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "agg_zero"; readonly args: "p_measures jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "anon_capture"; readonly args: "p_organization_id uuid, p_client_key text, p_table_id uuid, p_payload jsonb, p_device text DEFAULT NULL::text, p_captured_at timestamp with time zone DEFAULT NULL::timestamp with time zone"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "anon_clear"; readonly args: "p_organization_id uuid, p_submission_id uuid"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "anon_inbound_land"; readonly args: "p_address text, p_secret text, p_payload jsonb, p_raw_payload jsonb DEFAULT '{}'::jsonb, p_client_key text DEFAULT NULL::text"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "anon_publish"; readonly args: "p_organization_id uuid, p_form_id uuid, p_published boolean DEFAULT true"; readonly returns: "timestamp with time zone"; readonly security: "definer"; }, { readonly name: "anon_rate_take"; readonly args: "p_organization_id uuid, p_form_id uuid, p_bucket text, p_token_id uuid DEFAULT NULL::uuid"; readonly returns: "integer"; readonly security: "definer"; }, { readonly name: "anon_submissions"; readonly args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid, p_state text DEFAULT NULL::text, p_limit integer DEFAULT 100, p_offset integer DEFAULT 0"; readonly returns: "TABLE(id uuid, form_id uuid, inbound_id uuid, table_id uuid, source text, state text, payload jsonb, raw_payload jsonb, client_key text, record_id uuid, remote_origin text, rejection_reason text, created_at timestamp with time zone, cleared_at timestamp with time zone)"; readonly security: "definer"; }, { readonly name: "anon_token_issue"; readonly args: "p_organization_id uuid, p_mode text, p_allowed_origins jsonb, p_form_id uuid DEFAULT NULL::uuid, p_saved_view_id uuid DEFAULT NULL::uuid, p_record_id uuid DEFAULT NULL::uuid, p_expires_at timestamp with time zone DEFAULT NULL::timestamp with time zone"; readonly returns: "TABLE(token_id uuid, secret text)"; readonly security: "definer"; }, { readonly name: "anon_token_revoke"; readonly args: "p_organization_id uuid, p_token_id uuid"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "anon_token_verify"; readonly args: "p_secret text, p_origin text, p_required_mode text"; readonly returns: "TABLE(token_id uuid, organization_id uuid, form_id uuid, saved_view_id uuid, record_id uuid, mode text)"; readonly security: "definer"; }, { readonly name: "anon_write"; readonly args: "p_secret text, p_origin text, p_payload jsonb, p_client_key text DEFAULT NULL::text, p_raw_payload jsonb DEFAULT '{}'::jsonb"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "applicable_fields"; readonly args: "p_organization_id uuid, p_table_id uuid, p_record_type text DEFAULT NULL::text"; readonly returns: "SETOF custom.record"; readonly security: "definer"; }, { readonly name: "archive_event_of"; readonly args: "p_organization_id uuid, p_record_id uuid"; readonly returns: "history.migration_log"; readonly security: "definer"; }, { readonly name: "archive_guard_count"; readonly args: "p_value jsonb"; readonly returns: "integer"; readonly security: "invoker"; }, { readonly name: "archive_guard_decide"; readonly args: "p_organization_id uuid, p_scope text, p_live_before integer, p_ids text[], p_confirm text, p_log jsonb, p_now timestamp with time zone DEFAULT now(), p_share numeric DEFAULT NULL::numeric, p_hours numeric DEFAULT NULL::numeric"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "archive_guard_knob"; readonly args: "p_key text, p_organization_id uuid"; readonly returns: "numeric"; readonly security: "invoker"; }, { readonly name: "archive_guard_log_add"; readonly args: "p_log jsonb, p_entry jsonb, p_organization_id uuid, p_now timestamp with time zone DEFAULT now()"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "archive_guard_when"; readonly args: "p_value jsonb"; readonly returns: "timestamp with time zone"; readonly security: "invoker"; }, { readonly name: "archive_hold_answer"; readonly args: "p_organization_id uuid, p_table_id uuid, p_answer text, p_token text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "archived_tables_everywhere"; readonly args: "p_lane text DEFAULT 'org'::text, p_limit integer DEFAULT 100, p_offset integer DEFAULT 0, p_sort text DEFAULT 'archived_at'::text, p_desc boolean DEFAULT true"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "assert_client_may_change"; readonly args: "p_organization_id uuid, p_subject_id uuid, p_door text, p_required permission_level DEFAULT 'editor'::permission_level, p_subject_word text DEFAULT 'record'::text"; readonly returns: "void"; readonly security: "invoker"; }, { readonly name: "assert_client_may_open"; readonly args: "p_organization_id uuid, p_subject_id uuid, p_door text, p_required permission_level DEFAULT 'viewer'::permission_level, p_subject_word text DEFAULT 'record'::text"; readonly returns: "void"; readonly security: "invoker"; }, { readonly name: "assert_client_may_reach"; readonly args: "p_organization_id uuid, p_door text"; readonly returns: "void"; readonly security: "invoker"; }, { readonly name: "assert_columns_are_defined"; readonly args: "p_organization_id uuid, p_record_id uuid, p_patch jsonb"; readonly returns: "void"; readonly security: "definer"; }, { readonly name: "assert_entity_door"; readonly args: "p_organization_id uuid, p_door text"; readonly returns: "void"; readonly security: "definer"; }, { readonly name: "assert_entity_is_organization_scoped"; readonly args: "p_token text, p_label text, p_scoped boolean"; readonly returns: "void"; readonly security: "invoker"; }, { readonly name: "assert_may_know_table"; readonly args: "p_organization_id uuid, p_table_id uuid, p_door text"; readonly returns: "void"; readonly security: "invoker"; }, { readonly name: "assert_organization_admin"; readonly args: "p_organization_id uuid, p_door text, p_what text"; readonly returns: "void"; readonly security: "invoker"; }, { readonly name: "assert_organization_wall"; readonly args: "p_kind text, p_organization_id uuid, p_row jsonb"; readonly returns: "void"; readonly security: "invoker"; }, { readonly name: "assert_public_reader_names_a_public_table"; readonly args: "p_organization_id uuid, p_table_id uuid, p_door text"; readonly returns: "void"; readonly security: "definer"; }, { readonly name: "assert_scope_door"; readonly args: "p_organization_id uuid, p_door text"; readonly returns: "void"; readonly security: "definer"; }, { readonly name: "assert_store_door"; readonly args: "p_organization_id uuid, p_door text"; readonly returns: "void"; readonly security: "invoker"; }, { readonly name: "automation_app_event"; readonly args: "p_automation_id uuid, p_items jsonb, p_cursor jsonb, p_expected_owner text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "automation_app_may_edit"; readonly args: "p_automation_id uuid, p_user_id uuid"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "automation_app_note"; readonly args: "p_automation_id uuid, p_says text, p_cursor jsonb, p_expected_owner text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "automation_app_stop"; readonly args: "p_automation_id uuid, p_says text, p_expected_owner text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "automation_app_watch"; readonly args: "p_automation_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "automation_archive"; readonly args: "p_organization_id uuid, p_automation_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "automation_claim_pending"; readonly args: "p_worker text, p_limit integer DEFAULT 5, p_lease_seconds integer DEFAULT 180"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "automation_declare"; readonly args: "p_organization_id uuid, p_table_id uuid, p_spec jsonb, p_automation_id uuid DEFAULT NULL::uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "automation_delivery_tick"; readonly args: ""; readonly returns: "integer"; readonly security: "invoker"; }, { readonly name: "automation_note"; readonly args: "p_run_id uuid, p_says text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "automation_restore"; readonly args: "p_organization_id uuid, p_automation_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "automation_resume"; readonly args: "p_run_id uuid, p_output jsonb, p_error text DEFAULT NULL::text, p_logs jsonb DEFAULT NULL::jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "automation_revision_restore"; readonly args: "p_organization_id uuid, p_automation_id uuid, p_revision_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "automation_revisions"; readonly args: "p_organization_id uuid, p_automation_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "automation_runs"; readonly args: "p_automation_id uuid, p_limit integer DEFAULT 50, p_cursor timestamp with time zone DEFAULT NULL::timestamp with time zone, p_organization_id uuid DEFAULT NULL::uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "automation_set_enabled"; readonly args: "p_organization_id uuid, p_automation_id uuid, p_enabled boolean"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "automation_step_mark"; readonly args: "p_run_id uuid, p_n integer, p_state text, p_output jsonb DEFAULT NULL::jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "automation_test"; readonly args: "p_organization_id uuid, p_automation_id uuid, p_record_id uuid DEFAULT NULL::uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "automation_time_tick"; readonly args: ""; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "automation_webhook_receive"; readonly args: "p_automation_id uuid, p_secret text, p_body jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "automations"; readonly args: "p_table_id uuid, p_organization_id uuid DEFAULT NULL::uuid, p_include_archived boolean DEFAULT false"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "autonumber_backfill"; readonly args: "p_organization_id uuid, p_field_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "barcode_symbologies"; readonly args: ""; readonly returns: "text[]"; readonly security: "invoker"; }, { readonly name: "base_activity"; readonly args: "p_organization_id uuid, p_subject_id uuid, p_limit integer DEFAULT 50, p_before bigint DEFAULT NULL::bigint"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "base_copy_finish"; readonly args: "p_organization_id uuid, p_pairs jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "base_move"; readonly args: "p_home_id uuid, p_to_organization_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "base_move_access_kept"; readonly args: "p_home_id uuid, p_to_organization_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "base_move_remove_access"; readonly args: "p_home_id uuid, p_user_ids uuid[]"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "booking_busy_due"; readonly args: "p_form_id uuid"; readonly returns: "TABLE(feed text, due boolean, timezone text, days integer, read_at timestamp with time zone)"; readonly security: "definer"; }, { readonly name: "booking_busy_set"; readonly args: "p_form_id uuid, p_busy jsonb, p_problem text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "booking_cancel"; readonly args: "p_booking_ref text, p_origin text DEFAULT NULL::text"; readonly returns: "TABLE(booking_ref text, record_id uuid, slot_key text, state text, message text)"; readonly security: "definer"; }, { readonly name: "booking_confirm"; readonly args: "p_form_id uuid, p_hold_id uuid, p_origin text, p_payload jsonb, p_bucket text, p_honeypot text DEFAULT NULL::text, p_client_key text DEFAULT NULL::text"; readonly returns: "TABLE(booking_ref text, record_id uuid, submission_id uuid, slot_key text, slot_at timestamp with time zone, state text, message text)"; readonly security: "definer"; }, { readonly name: "booking_declare"; readonly args: "p_organization_id uuid, p_table_id uuid, p_title text, p_questions jsonb, p_availability jsonb DEFAULT '{}'::jsonb, p_presentation jsonb DEFAULT '{}'::jsonb, p_submission_cap integer DEFAULT NULL::integer, p_quarantine_rule_id uuid DEFAULT NULL::uuid, p_notify_rule_id uuid DEFAULT NULL::uuid, p_form_id uuid DEFAULT NULL::uuid, p_slug text DEFAULT NULL::text, p_home_id uuid DEFAULT NULL::uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "booking_hold"; readonly args: "p_form_id uuid, p_slot_key text, p_origin text, p_bucket text, p_client_key text DEFAULT NULL::text"; readonly returns: "TABLE(hold_id uuid, slot_key text, expires_at timestamp with time zone, member_user_id uuid, state text, message text)"; readonly security: "definer"; }, { readonly name: "booking_manage"; readonly args: "p_booking_ref text, p_days integer DEFAULT NULL::integer"; readonly returns: "TABLE(booking_ref text, form_id uuid, title text, slot_key text, slot_at timestamp with time zone, status text, slots jsonb, availability jsonb, state text, message text)"; readonly security: "definer"; }, { readonly name: "booking_messages"; readonly args: "p_organization_id uuid, p_form_id uuid, p_record_id uuid, p_submission_id uuid, p_event text"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "booking_notify"; readonly args: "p_organization_id uuid, p_form_id uuid, p_record_id uuid, p_submission_id uuid, p_event text, p_when text"; readonly returns: "uuid"; readonly security: "invoker"; }, { readonly name: "booking_public"; readonly args: "p_form_id uuid, p_days integer DEFAULT NULL::integer"; readonly returns: "TABLE(form_id uuid, organization_id uuid, table_id uuid, title text, presentation jsonb, fields jsonb, honeypot_key text, availability jsonb, slots jsonb, state text, message text)"; readonly security: "definer"; }, { readonly name: "booking_reschedule"; readonly args: "p_booking_ref text, p_slot_key text, p_origin text, p_bucket text DEFAULT NULL::text"; readonly returns: "TABLE(booking_ref text, record_id uuid, slot_key text, slot_at timestamp with time zone, state text, message text)"; readonly security: "definer"; }, { readonly name: "booking_sms_consent"; readonly args: "p_booking_ref text, p_phone text, p_text_shown text, p_origin text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "bookings"; readonly args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid"; readonly returns: "TABLE(form_id uuid, table_id uuid, title text, slug text, published_at timestamp with time zone, closed_at timestamp with time zone, slot_minutes integer, timezone text, slot_table_id uuid, booked bigint, cancelled bigint, upcoming bigint, held bigint, next_at timestamp with time zone, state text)"; readonly security: "definer"; }, { readonly name: "bump_epoch"; readonly args: "p_entity_type text, p_entity_id uuid, p_organization_id uuid DEFAULT NULL::uuid"; readonly returns: "bigint"; readonly security: "definer"; }, { readonly name: "button_press"; readonly args: "p_organization_id uuid, p_record_id uuid, p_field_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "cache_lookup"; readonly args: "p_container_type text, p_container_id uuid, p_item_type text, p_item_id uuid"; readonly returns: "permission_level"; readonly security: "definer"; }, { readonly name: "caller_role"; readonly args: ""; readonly returns: "name"; readonly security: "invoker"; }, { readonly name: "capture_open"; readonly args: "p_organization_id uuid, p_sheet_id uuid"; readonly returns: "TABLE(sheet_id uuid, organization_id uuid, table_id uuid, title text, presentation jsonb, fields jsonb, state text, may_capture boolean, message text)"; readonly security: "definer"; }, { readonly name: "capture_publish"; readonly args: "p_organization_id uuid, p_sheet_id uuid, p_open boolean DEFAULT true"; readonly returns: "timestamp with time zone"; readonly security: "definer"; }, { readonly name: "capture_sheet_declare"; readonly args: "p_organization_id uuid, p_table_id uuid, p_title text, p_questions jsonb, p_presentation jsonb DEFAULT '{}'::jsonb, p_sheet_id uuid DEFAULT NULL::uuid, p_notify_rule_id uuid DEFAULT NULL::uuid"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "capture_sheets"; readonly args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid"; readonly returns: "TABLE(sheet_id uuid, table_id uuid, title text, slug text, state text, opened_at timestamp with time zone, captures bigint, replays bigint, last_capture_at timestamp with time zone, presentation jsonb)"; readonly security: "definer"; }, { readonly name: "capture_submit"; readonly args: "p_organization_id uuid, p_sheet_id uuid, p_client_key text, p_payload jsonb, p_files jsonb DEFAULT '[]'::jsonb, p_device text DEFAULT NULL::text, p_captured_at timestamp with time zone DEFAULT NULL::timestamp with time zone, p_location jsonb DEFAULT NULL::jsonb"; readonly returns: "TABLE(record_id uuid, state text, message text, replay boolean, file_ids uuid[])"; readonly security: "definer"; }, { readonly name: "carry_unchanged_value_stamps"; readonly args: "p_old jsonb, p_new jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "carrying_edges_in"; readonly args: "p_organization_id uuid"; readonly returns: "TABLE(container_type text, container_id uuid, item_type text, item_id uuid, conveys_max permission_level)"; readonly security: "definer"; }, { readonly name: "carrying_edges_of"; readonly args: "p_item_type text, p_item_id uuid"; readonly returns: "TABLE(container_type text, container_id uuid, conveys_max permission_level)"; readonly security: "definer"; }, { readonly name: "checklist_declare"; readonly args: "p_organization_id uuid, p_spec jsonb, p_template_id uuid DEFAULT NULL::uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "checklist_refusal"; readonly args: "p_spec jsonb"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "checklist_run"; readonly args: "p_organization_id uuid, p_run_id uuid"; readonly returns: "TABLE(step_id uuid, step_order integer, ref text, title text, role text, assignee_name text, assignee_user_id uuid, due_on timestamp with time zone, due_state text, status text, finished boolean, requires text, requires_key text, requires_label text, requires_id uuid, evidence jsonb, blocked_by text[], may_complete boolean, refusal text)"; readonly security: "definer"; }, { readonly name: "checklist_runs"; readonly args: "p_organization_id uuid, p_about_table_id uuid DEFAULT NULL::uuid, p_about_record_id uuid DEFAULT NULL::uuid, p_include_closed boolean DEFAULT true, p_limit integer DEFAULT 100"; readonly returns: "TABLE(run_id uuid, name text, template_id uuid, template text, about_record_id uuid, about text, about_table_id uuid, started_at timestamp with time zone, started_by uuid, origin text, step_count integer, done integer, overdue integer, next_step text, next_due timestamp with time zone, closed_at timestamp with time zone)"; readonly security: "definer"; }, { readonly name: "checklist_start"; readonly args: "p_organization_id uuid, p_template_id uuid, p_about_record_id uuid DEFAULT NULL::uuid, p_roles jsonb DEFAULT '{}'::jsonb, p_starting_at timestamp with time zone DEFAULT NULL::timestamp with time zone"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "checklist_step_complete"; readonly args: "p_organization_id uuid, p_step_id uuid, p_evidence jsonb DEFAULT '{}'::jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "checklist_step_refusal"; readonly args: "p_organization_id uuid, p_step_id uuid"; readonly returns: "text"; readonly security: "definer"; }, { readonly name: "checklist_steps_table"; readonly args: "p_organization_id uuid"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "checklist_template_shape"; readonly args: "p_organization_id uuid, p_template_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "checklist_templates"; readonly args: "p_organization_id uuid, p_about_table_id uuid DEFAULT NULL::uuid, p_limit integer DEFAULT 100"; readonly returns: "TABLE(template_id uuid, name text, about_table_id uuid, about_table text, steps integer, roles integer, trigger_kind text, trigger_status text, open_runs integer, total_runs integer, updated_at timestamp with time zone)"; readonly security: "definer"; }, { readonly name: "checklist_templates_archived"; readonly args: "p_organization_id uuid, p_about_table_id uuid DEFAULT NULL::uuid, p_limit integer DEFAULT 100"; readonly returns: "TABLE(template_id uuid, name text, about_table_id uuid, about_table text, steps integer, archived_at timestamp with time zone, archived_by uuid, table_archived boolean)"; readonly security: "definer"; }, { readonly name: "choice_census"; readonly args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "choice_field_map"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "choice_filter_normalize"; readonly args: "p_map jsonb, p_filter jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "choice_key_for"; readonly args: "p_organization_id uuid, p_options_table_id uuid, p_title text, p_exclude uuid DEFAULT NULL::uuid"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "choice_key_of"; readonly args: "p_field jsonb, p_token text"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "choice_nudge"; readonly args: "p_organization_id uuid"; readonly returns: "text"; readonly security: "definer"; }, { readonly name: "choice_options"; readonly args: "p_organization_id uuid, p_options_table_id uuid"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "choice_render"; readonly args: "p_organization_id uuid, p_table_id uuid, p_doc jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "choice_render_groups"; readonly args: "p_map jsonb, p_groups jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "choice_render_note"; readonly args: "p_field jsonb, p_value jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "choice_render_plan"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "choice_render_value"; readonly args: "p_field jsonb, p_value jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "choice_render_with"; readonly args: "p_organization_id uuid, p_table_id uuid, p_doc jsonb, p_plan jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "choice_slug"; readonly args: "p_word text"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "choice_synonyms"; readonly args: "p_organization_id uuid, p_table_id uuid, p_token text"; readonly returns: "text[]"; readonly security: "invoker"; }, { readonly name: "choice_synonyms_in"; readonly args: "p_map jsonb, p_token text"; readonly returns: "text[]"; readonly security: "invoker"; }, { readonly name: "choice_value_keys"; readonly args: "p_field jsonb, p_value jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "choice_words"; readonly args: "p_field jsonb"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "choice_words_normalize"; readonly args: "p_field jsonb, p_const jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "client_write_grants"; readonly args: ""; readonly returns: "TABLE(role_name text, object_name text, privilege text)"; readonly security: "invoker"; }, { readonly name: "comment_counts"; readonly args: "p_organization_id uuid, p_record_ids uuid[]"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "comment_mention_deliver"; readonly args: "p_organization_id uuid, p_record_id uuid, p_table_id uuid, p_comment_id uuid, p_recipient uuid, p_author_name text, p_record_title text, p_body text"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "comment_thread"; readonly args: "p_organization_id uuid, p_record_id uuid, p_include_resolved boolean DEFAULT false"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "comment_write"; readonly args: "p_organization_id uuid, p_record_id uuid, p_body text, p_anchor jsonb DEFAULT '{}'::jsonb, p_parent_comment_id uuid DEFAULT NULL::uuid, p_mentions uuid[] DEFAULT NULL::uuid[]"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "computed_block"; readonly args: "p_block jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "computed_provenance"; readonly args: "p_organization_id uuid, p_record_id uuid"; readonly returns: "TABLE(field_key text, field_id uuid, value jsonb, rule_id uuid, rule_version integer, computed_at timestamp with time zone)"; readonly security: "definer"; }, { readonly name: "computed_refresh"; readonly args: "p_org uuid, p_table uuid, p_ids uuid[]"; readonly returns: "integer"; readonly security: "invoker"; }, { readonly name: "computed_refresh"; readonly args: "p_table_id uuid, p_max_rows integer DEFAULT 200"; readonly returns: "integer"; readonly security: "definer"; }, { readonly name: "computed_refresh_drain"; readonly args: "p_ms integer DEFAULT 8000"; readonly returns: "integer"; readonly security: "invoker"; }, { readonly name: "computed_refresh_progress"; readonly args: "p_org uuid"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "computed_sort_ceiling"; readonly args: ""; readonly returns: "integer"; readonly security: "invoker"; }, { readonly name: "computed_warm"; readonly args: "p_table_id uuid"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "confidential_anchor"; readonly args: "p_id uuid"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "confidential_answer"; readonly args: "p_user uuid, p_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "confidential_header"; readonly args: "p_user uuid, p_id uuid"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "confidential_names"; readonly args: "p_organization_id uuid, p_value jsonb, p_user uuid"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "containment_chain"; readonly args: "p_organization_id uuid, p_record_id uuid"; readonly returns: "TABLE(ancestor_id uuid, depth integer)"; readonly security: "invoker"; }, { readonly name: "containment_depth_ceiling"; readonly args: "p_organization_id uuid DEFAULT NULL::uuid"; readonly returns: "integer"; readonly security: "invoker"; }, { readonly name: "containment_edges"; readonly args: "p_organization_id uuid"; readonly returns: "TABLE(parent_id uuid, child_id uuid, via text)"; readonly security: "invoker"; }, { readonly name: "containment_parent"; readonly args: "p_data jsonb"; readonly returns: "uuid"; readonly security: "invoker"; }, { readonly name: "context_archived_types"; readonly args: "p_organization_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "context_class_for_checkout"; readonly args: "p_scope_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "context_compare_facts"; readonly args: "p_user_id uuid, p_record_ids uuid[], p_item_ids uuid[] DEFAULT NULL::uuid[], p_cells jsonb DEFAULT NULL::jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "context_item_archive"; readonly args: "p_item_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "context_item_restore"; readonly args: "p_item_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "context_item_row_of"; readonly args: "p_field custom.record"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "context_item_write"; readonly args: "p_item_id uuid, p_scope_type_id uuid, p_spec jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "context_items"; readonly args: "p_scope_type_ids uuid[]"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "context_policy_rank"; readonly args: "p_policy text"; readonly returns: "integer"; readonly security: "invoker"; }, { readonly name: "context_resolve"; readonly args: "p_bindings jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "context_scope_archive"; readonly args: "p_scope_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "context_scope_restore"; readonly args: "p_scope_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "context_scope_write"; readonly args: "p_organization_id uuid, p_scope_id uuid, p_type_id uuid, p_spec jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "context_scopes"; readonly args: "p_scope_ids uuid[]"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "context_system_items"; readonly args: ""; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "context_tags_set"; readonly args: "p_entity_type text, p_entity_id uuid, p_scope_ids uuid[]"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "context_template_define"; readonly args: "p_organization_id uuid, p_definition jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "context_templates"; readonly args: ""; readonly returns: "SETOF jsonb"; readonly security: "invoker"; }, { readonly name: "context_tree"; readonly args: "p_organization_ids uuid[]"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "context_tree_search"; readonly args: "p_organization_ids uuid[], p_query text, p_limit integer DEFAULT 100"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "context_tree_type_scopes"; readonly args: "p_scope_type_id uuid, p_offset integer DEFAULT 0, p_limit integer DEFAULT 200"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "context_tree_types"; readonly args: "p_organization_ids uuid[], p_with_counts boolean DEFAULT true"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "context_type_archive"; readonly args: "p_type_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "context_type_restore"; readonly args: "p_type_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "context_type_write"; readonly args: "p_organization_id uuid, p_type_id uuid, p_spec jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "context_value_write"; readonly args: "p_payload jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "context_values"; readonly args: "p_scope_ids uuid[]"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "conversation_scope"; readonly args: "p_organization_id uuid, p_conversation_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "conversation_scope_bind"; readonly args: "p_organization_id uuid, p_conversation_id uuid, p_record_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "conversation_scope_context"; readonly args: "p_organization_id uuid, p_conversation_id uuid, p_relations integer DEFAULT 12, p_history integer DEFAULT 15, p_siblings integer DEFAULT 8"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "conversation_scope_unbind"; readonly args: "p_organization_id uuid, p_conversation_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "copy_table_extras"; readonly args: "p_organization_id uuid, p_pairs jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "count_records_archived"; readonly args: "p_organization_id uuid, p_table_ids uuid[], p_lane text DEFAULT 'org'::text"; readonly returns: "TABLE(table_id uuid, n integer)"; readonly security: "definer"; }, { readonly name: "cross_organization_links_open"; readonly args: "p_source_organization_id uuid, p_target_organization_id uuid"; readonly returns: "boolean"; readonly security: "invoker"; }, { readonly name: "custom_fields_on"; readonly args: "p_organization_id uuid, p_table_token text"; readonly returns: "TABLE(field_id uuid, field_key text, field_label text, field_type text, field_source text, field_required boolean, field_sort numeric, table_label text)"; readonly security: "definer"; }, { readonly name: "custom_fields_tables"; readonly args: ""; readonly returns: "TABLE(token text, schema_name text, table_name text)"; readonly security: "invoker"; }, { readonly name: "dashboard_block_normalize"; readonly args: "p_organization_id uuid, p_subject_table_id uuid, p_block jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "dashboard_class"; readonly args: ""; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "dashboard_declare"; readonly args: "p_organization_id uuid, p_table_id uuid, p_name text, p_blocks jsonb DEFAULT '[]'::jsonb, p_presentation jsonb DEFAULT '{}'::jsonb, p_dashboard_id uuid DEFAULT NULL::uuid"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "dashboard_delete"; readonly args: "p_organization_id uuid, p_dashboard_id uuid"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "dashboard_field_keys"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "text[]"; readonly security: "definer"; }, { readonly name: "dashboard_kinds"; readonly args: ""; readonly returns: "text[]"; readonly security: "invoker"; }, { readonly name: "dashboard_moment_sql"; readonly args: "p_key text"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "dashboard_restore"; readonly args: "p_organization_id uuid, p_dashboard_id uuid"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "dashboard_run"; readonly args: "p_organization_id uuid, p_dashboard_id uuid, p_filter jsonb DEFAULT '{}'::jsonb, p_compare jsonb DEFAULT NULL::jsonb, p_grain text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "dashboard_stuck"; readonly args: "p_organization_id uuid, p_table_id uuid, p_state_key text, p_days integer DEFAULT 14, p_filter jsonb DEFAULT '{}'::jsonb, p_limit integer DEFAULT 50, p_required text DEFAULT 'viewer'::text"; readonly returns: "TABLE(record_id uuid, title text, state text, last_changed_at timestamp with time zone, days_unchanged numeric, measured_from text)"; readonly security: "definer"; }, { readonly name: "dashboard_target_field_assert"; readonly args: "p_organization_id uuid, p_table_id uuid, p_field_key text"; readonly returns: "void"; readonly security: "invoker"; }, { readonly name: "dashboard_window_sql"; readonly args: "p_key text, p_window jsonb"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "dashboards"; readonly args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid"; readonly returns: "TABLE(dashboard_id uuid, table_id uuid, name text, blocks jsonb, presentation jsonb, block_count integer, version integer, created_at timestamp with time zone, updated_at timestamp with time zone)"; readonly security: "definer"; }, { readonly name: "data_home"; readonly args: "p_organization_id uuid DEFAULT NULL::uuid, p_search text DEFAULT NULL::text, p_include_platform_tables boolean DEFAULT false"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "data_home_changed_by"; readonly args: "p_asks jsonb"; readonly returns: "TABLE(organization_id uuid, id uuid, at timestamp with time zone, who text)"; readonly security: "definer"; }, { readonly name: "data_home_custom_fields"; readonly args: "p_organization_id uuid DEFAULT NULL::uuid"; readonly returns: "TABLE(organization_id uuid, organization_name text, table_token text, table_label text, field_count integer, updated_at timestamp with time zone)"; readonly security: "definer"; }, { readonly name: "data_home_first"; readonly args: "p_organization_id uuid DEFAULT NULL::uuid, p_include_platform_tables boolean DEFAULT false, p_limit integer DEFAULT 100"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "data_home_items"; readonly args: "p_organization_id uuid DEFAULT NULL::uuid"; readonly returns: "TABLE(kind text, organization_id uuid, organization_name text, item_id uuid, table_id uuid, table_name text, item_row jsonb)"; readonly security: "definer"; }, { readonly name: "data_home_slim"; readonly args: "p_organization_id uuid DEFAULT NULL::uuid, p_search text DEFAULT NULL::text, p_include_platform_tables boolean DEFAULT false"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "data_home_tables"; readonly args: "p_organization_id uuid DEFAULT NULL::uuid"; readonly returns: "TABLE(table_id uuid, table_name text, organization_id uuid, organization_name text, member boolean, visibility text, updated_at timestamp with time zone, mine boolean, shared_with_me boolean, platform_owned boolean, kind text, team boolean, system boolean, created_by uuid)"; readonly security: "definer"; }, { readonly name: "data_home_tables"; readonly args: "p_organization_id uuid, p_include_platform_tables boolean"; readonly returns: "TABLE(table_id uuid, table_name text, organization_id uuid, organization_name text, member boolean, visibility text, updated_at timestamp with time zone, mine boolean, shared_with_me boolean, platform_owned boolean, kind text, team boolean, system boolean, created_by uuid)"; readonly security: "invoker"; }, { readonly name: "day_zone"; readonly args: "p_organization_id uuid DEFAULT NULL::uuid"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "declared_conversation"; readonly args: ""; readonly returns: "uuid"; readonly security: "invoker"; }, { readonly name: "decoration_colors"; readonly args: ""; readonly returns: "text[]"; readonly security: "invoker"; }, { readonly name: "decoration_rule_ops"; readonly args: ""; readonly returns: "TABLE(op text, takes_value boolean, label text)"; readonly security: "invoker"; }, { readonly name: "delete_cascade_closure"; readonly args: "p_organization_id uuid, p_record_id uuid"; readonly returns: "uuid[]"; readonly security: "invoker"; }, { readonly name: "delete_preview"; readonly args: "p_organization_id uuid, p_record_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "delete_rule"; readonly args: "p_organization_id uuid, p_record_id uuid, p_apply boolean DEFAULT true"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "dependency_cycle"; readonly args: "p_organization_id uuid, p_row custom.record"; readonly returns: "text[]"; readonly security: "invoker"; }, { readonly name: "dependency_label"; readonly args: "p_organization_id uuid, p_node text"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "derive_visibility"; readonly args: "p_container_type text, p_container_id uuid"; readonly returns: "TABLE(item_type text, item_id uuid, depth integer, max_level permission_level)"; readonly security: "definer"; }, { readonly name: "derived_value"; readonly args: "p_organization_id uuid, p_record_id uuid, p_field_data jsonb, p_values jsonb DEFAULT NULL::jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "derived_values"; readonly args: "p_organization_id uuid, p_record_id uuid"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "derived_values_of"; readonly args: "v_rec custom.record"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "display_format_ids"; readonly args: ""; readonly returns: "text[]"; readonly security: "invoker"; }, { readonly name: "doc_content_hash"; readonly args: "p_body text"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "doc_format_value"; readonly args: "p_field_data jsonb, p_value jsonb"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "doc_letterhead"; readonly args: "p_organization_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "doc_name_token_pattern"; readonly args: ""; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "doc_name_tokens"; readonly args: "p_body text"; readonly returns: "TABLE(ordinal integer, raw text)"; readonly security: "invoker"; }, { readonly name: "doc_render_body"; readonly args: "p_organization_id uuid, p_template_id uuid, p_record_id uuid"; readonly returns: "text"; readonly security: "definer"; }, { readonly name: "doc_render_delete"; readonly args: "p_organization_id uuid, p_render_id uuid"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "doc_render_document"; readonly args: "p_organization_id uuid, p_template_id uuid, p_record_id uuid"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "doc_render_read"; readonly args: "p_organization_id uuid, p_render_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "doc_render_restore"; readonly args: "p_organization_id uuid, p_render_id uuid"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "doc_render_write"; readonly args: "p_organization_id uuid, p_template_id uuid, p_record_id uuid, p_table_id uuid, p_template_version integer, p_body text, p_content_hash text"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "doc_renders"; readonly args: "p_organization_id uuid, p_record_id uuid"; readonly returns: "TABLE(render_id uuid, template_id uuid, record_id uuid, table_id uuid, template_version integer, body text, content_hash text, rendered_at timestamp with time zone)"; readonly security: "definer"; }, { readonly name: "doc_sign"; readonly args: "p_organization_id uuid, p_render_id uuid, p_field_key text, p_signer_name text, p_signer_user_id uuid DEFAULT NULL::uuid"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "doc_signature_field_ok"; readonly args: "p_field_data jsonb"; readonly returns: "boolean"; readonly security: "invoker"; }, { readonly name: "doc_signature_intact"; readonly args: "p_organization_id uuid, p_signature_id uuid"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "doc_signature_read"; readonly args: "p_organization_id uuid, p_signature_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "doc_signature_write"; readonly args: "p_organization_id uuid, p_render_id uuid, p_record_id uuid, p_field_key text, p_signer_name text, p_signer_user_id uuid, p_document_hash text, p_document_version integer"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "doc_signatures"; readonly args: "p_organization_id uuid, p_record_id uuid"; readonly returns: "TABLE(signature_id uuid, render_id uuid, record_id uuid, field_key text, signer_name text, signer_user_id uuid, signed_at timestamp with time zone, document_hash text, document_version integer)"; readonly security: "definer"; }, { readonly name: "doc_template_delete"; readonly args: "p_organization_id uuid, p_template_id uuid"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "doc_template_read"; readonly args: "p_organization_id uuid, p_template_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "doc_template_restore"; readonly args: "p_organization_id uuid, p_template_id uuid"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "doc_template_save"; readonly args: "p_organization_id uuid, p_table_id uuid, p_name text, p_body text, p_template_id uuid DEFAULT NULL::uuid"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "doc_templates"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "TABLE(template_id uuid, renders_table_id uuid, name text, body text, template_version integer, token_count bigint, updated_at timestamp with time zone)"; readonly security: "definer"; }, { readonly name: "doc_token_pattern"; readonly args: ""; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "doc_tokens"; readonly args: "p_body text"; readonly returns: "TABLE(ordinal integer, raw text, field_id uuid)"; readonly security: "invoker"; }, { readonly name: "doc_unresolved_tokens"; readonly args: "p_organization_id uuid, p_table_id uuid, p_body text"; readonly returns: "TABLE(raw text, field_id uuid, why text)"; readonly security: "invoker"; }, { readonly name: "door_reads_only"; readonly args: "p_door text"; readonly returns: "boolean"; readonly security: "invoker"; }, { readonly name: "doors_not_deciding_the_caller"; readonly args: ""; readonly returns: "TABLE(function_name text, identity_args text)"; readonly security: "invoker"; }, { readonly name: "doors_not_deciding_the_record"; readonly args: ""; readonly returns: "TABLE(function_name text, identity_args text, why text)"; readonly security: "invoker"; }, { readonly name: "doors_not_masking_fields"; readonly args: ""; readonly returns: "TABLE(function_name text, identity_args text, why text)"; readonly security: "invoker"; }, { readonly name: "doors_not_on_one_ladder"; readonly args: ""; readonly returns: "TABLE(function_name text, identity_args text, why text)"; readonly security: "invoker"; }, { readonly name: "doors_refusing_in_another_doors_name"; readonly args: ""; readonly returns: "TABLE(function_name text, identity_args text, why text)"; readonly security: "invoker"; }, { readonly name: "drill_resolve"; readonly args: "p_organization_id uuid, p_table_id uuid, p_group_by jsonb, p_measures jsonb, p_bucket jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "effective_level"; readonly args: "p_user_id uuid, p_organization_id uuid, p_id uuid, p_type text DEFAULT 'record'::text"; readonly returns: "permission_level"; readonly security: "definer"; }, { readonly name: "effective_level_many"; readonly args: "p_user_id uuid, p_ids uuid[], p_type text DEFAULT 'record'::text"; readonly returns: "TABLE(id uuid, level permission_level)"; readonly security: "definer"; }, { readonly name: "enrich_cells"; readonly args: "p_organization_id uuid, p_table_id uuid, p_field_keys text[] DEFAULT NULL::text[], p_record_ids uuid[] DEFAULT NULL::uuid[]"; readonly returns: "TABLE(record_id uuid, field_key text, agent_owned boolean, value jsonb, value_version integer, actor text, on_behalf_of text, written_at timestamp with time zone, source jsonb, absent_reason text, alternates jsonb, pinned boolean, stale boolean, due_at timestamp with time zone)"; readonly security: "definer"; }, { readonly name: "enrich_data_source"; readonly args: "p_ds jsonb, p_inputs jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "enrich_declare"; readonly args: "p_organization_id uuid, p_field_id uuid, p_spec jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "enrich_due"; readonly args: "p_organization_id uuid, p_field_id uuid, p_limit integer DEFAULT 50, p_include_fresh boolean DEFAULT false, p_record_ids uuid[] DEFAULT NULL::uuid[]"; readonly returns: "TABLE(record_id uuid, title text, inputs jsonb, current_value jsonb, written_at timestamp with time zone, reason text, trimmed_to integer)"; readonly security: "definer"; }, { readonly name: "enrich_land"; readonly args: "p_organization_id uuid, p_field_id uuid, p_results jsonb, p_run jsonb DEFAULT '{}'::jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "enrich_normalize"; readonly args: "p_organization_id uuid, p_table_id uuid, p_field_key text, p_spec jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "enrich_pin"; readonly args: "p_organization_id uuid, p_record_id uuid, p_field_key text, p_pinned boolean DEFAULT true"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "enrich_refill_due_tick"; readonly args: ""; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "enrich_run_class"; readonly args: ""; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "enrich_runs"; readonly args: "p_organization_id uuid, p_field_id uuid DEFAULT NULL::uuid, p_limit integer DEFAULT 50"; readonly returns: "TABLE(run_id uuid, field_id uuid, field_key text, model text, trigger_word text, rows_seen integer, rows_written integer, rows_absent integer, rows_below_floor integer, rows_pinned integer, rows_refused integer, cost_cents numeric, cost_per_row_cents numeric, ran_at timestamp with time zone)"; readonly security: "definer"; }, { readonly name: "enrich_sensitivity_rank"; readonly args: "p_word text"; readonly returns: "integer"; readonly security: "invoker"; }, { readonly name: "enrich_triggers"; readonly args: ""; readonly returns: "text[]"; readonly security: "invoker"; }, { readonly name: "enrichments"; readonly args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid"; readonly returns: "TABLE(field_id uuid, table_id uuid, field_key text, label text, enrichment jsonb, enabled boolean, review_interval_days integer, rows_total integer, rows_filled integer, rows_stale integer, rows_pinned integer, rows_absent integer, runs integer, cost_cents numeric, cost_per_row_cents numeric, last_run_at timestamp with time zone, last_run jsonb)"; readonly security: "definer"; }, { readonly name: "entity_back_links"; readonly args: "p_organization_id uuid, p_token text, p_record_id uuid, p_limit integer DEFAULT 50, p_cursor text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "entity_custom_value_apply"; readonly args: "p_organization_id uuid, p_token text, p_record_id uuid, p_clear text[], p_patch jsonb, p_expected_version integer DEFAULT NULL::integer"; readonly returns: "integer"; readonly security: "definer"; }, { readonly name: "entity_custom_values_lock"; readonly args: "p_token text"; readonly returns: "TABLE(locked boolean, reason text)"; readonly security: "definer"; }, { readonly name: "entity_field_declare"; readonly args: "p_organization_id uuid, p_token text, p_spec jsonb"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "entity_field_protect_arman_explicitly_approved"; readonly args: "p_field_id uuid, p_readers jsonb, p_arman_words text, p_approved_on date"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "entity_field_retire"; readonly args: "p_organization_id uuid, p_field_id uuid"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "entity_field_rights"; readonly args: "p_organization_id uuid, p_token text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "entity_field_update"; readonly args: "p_organization_id uuid, p_field_id uuid, p_patch jsonb"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "entity_fields"; readonly args: "p_organization_id uuid, p_token text, p_include_retired boolean DEFAULT false"; readonly returns: "SETOF custom.record"; readonly security: "definer"; }, { readonly name: "entity_fields_across"; readonly args: "p_token text, p_organization_ids uuid[]"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "entity_read_mask"; readonly args: "p_organization_id uuid, p_token text, p_level permission_level, p_action text DEFAULT 'read'::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "entity_record_home"; readonly args: "p_token text, p_record_id uuid"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "entity_record_read"; readonly args: "p_organization_id uuid, p_token text, p_record_id uuid"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "entity_records_find"; readonly args: "p_organization_id uuid, p_token text, p_key text, p_value jsonb DEFAULT NULL::jsonb, p_limit integer DEFAULT 50, p_offset integer DEFAULT 0"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "entity_reference_fields"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "entity_reference_kinds"; readonly args: ""; readonly returns: "TABLE(token text, label text, category text)"; readonly security: "definer"; }, { readonly name: "entity_reference_render"; readonly args: "p_organization_id uuid, p_table_id uuid, p_doc jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "entity_reference_render_with"; readonly args: "p_organization_id uuid, p_table_id uuid, p_doc jsonb, p_fields jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "entity_reference_rows"; readonly args: "p_organization_id uuid, p_token text, p_ids uuid[]"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "entity_reference_search"; readonly args: "p_organization_id uuid, p_tokens text[], p_search text DEFAULT NULL::text, p_limit integer DEFAULT 20"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "entity_reference_target"; readonly args: "p_token text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "entity_reference_words"; readonly args: "p_organization_id uuid, p_refs jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "entity_row_propose"; readonly args: "p_organization_id uuid, p_token text, p_record_id uuid, p_columns jsonb DEFAULT '{}'::jsonb, p_custom jsonb DEFAULT '{}'::jsonb, p_expected_version integer DEFAULT NULL::integer, p_archive boolean DEFAULT NULL::boolean, p_note text DEFAULT NULL::text, p_conversation_id uuid DEFAULT NULL::uuid"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "entity_row_write"; readonly args: "p_organization_id uuid, p_token text, p_record_id uuid, p_columns jsonb DEFAULT '{}'::jsonb, p_custom jsonb DEFAULT '{}'::jsonb, p_expected_version integer DEFAULT NULL::integer, p_archive boolean DEFAULT NULL::boolean"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "entity_seat_level"; readonly args: "p_organization_id uuid, p_token text, p_record_id uuid"; readonly returns: "permission_level"; readonly security: "invoker"; }, { readonly name: "entity_table"; readonly args: "p_token text"; readonly returns: "TABLE(token text, schema_name text, table_name text, type text, title_column text, label text, has_organization boolean, has_deleted_at boolean)"; readonly security: "definer"; }, { readonly name: "entity_value_write"; readonly args: "p_organization_id uuid, p_token text, p_record_id uuid, p_patch jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "export_ceiling"; readonly args: "p_organization_id uuid DEFAULT NULL::uuid"; readonly returns: "integer"; readonly security: "invoker"; }, { readonly name: "export_records"; readonly args: "p_organization_id uuid, p_table_id uuid, p_limit integer DEFAULT 1000"; readonly returns: "TABLE(id uuid, document jsonb)"; readonly security: "invoker"; }, { readonly name: "external_foreign_table_findings"; readonly args: ""; readonly returns: "SETOF text"; readonly security: "definer"; }, { readonly name: "external_history_event"; readonly args: "p_organization_id uuid, p_link_id uuid, p_operation text"; readonly returns: "bigint"; readonly security: "definer"; }, { readonly name: "external_rows"; readonly args: "p_organization_id uuid, p_source_id uuid"; readonly returns: "SETOF jsonb"; readonly security: "definer"; }, { readonly name: "external_source_declare"; readonly args: "p_organization_id uuid, p_tier text, p_connection_token text, p_external_schema text, p_external_table text, p_link_template text"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "external_stub_upsert"; readonly args: "p_organization_id uuid, p_source_id uuid, p_table_id uuid, p_external_key text, p_link_url text, p_cached_title text"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "external_tier_contract"; readonly args: ""; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "external_write_through"; readonly args: "p_organization_id uuid, p_record_id uuid, p_patch jsonb"; readonly returns: "void"; readonly security: "definer"; }, { readonly name: "external_writes_set"; readonly args: "p_organization_id uuid, p_source_id uuid, p_enabled boolean"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "far_value"; readonly args: "p_organization_id uuid, p_record_id uuid, p_key text, p_reader jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "field_access"; readonly args: "p_user uuid, p_field_id uuid, p_token text, p_row_id uuid, p_action text, p_audit boolean DEFAULT true"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "field_access_set"; readonly args: "p_field_id uuid, p_part text, p_word text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "field_access_setup"; readonly args: "p_field_id uuid, p_proposed jsonb DEFAULT NULL::jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "field_add_rung"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "permission_level"; readonly security: "invoker"; }, { readonly name: "field_behaviour"; readonly args: "p_field_data jsonb"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "field_choice_usage"; readonly args: "p_organization_id uuid, p_field_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "field_context_policy_floor"; readonly args: "p_organization_id uuid, p_field_data jsonb, p_self uuid DEFAULT NULL::uuid"; readonly returns: "TABLE(context_policy text, reads jsonb)"; readonly security: "definer"; }, { readonly name: "field_cycle"; readonly args: "p_organization_id uuid, p_field_data jsonb, p_self uuid"; readonly returns: "text[]"; readonly security: "definer"; }, { readonly name: "field_declare"; readonly args: "p_organization_id uuid, p_table_id uuid, p_spec jsonb"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "field_declare_many"; readonly args: "p_organization_id uuid, p_table_id uuid, p_specs jsonb"; readonly returns: "uuid[]"; readonly security: "invoker"; }, { readonly name: "field_dependants"; readonly args: "p_organization_id uuid, p_field_id uuid"; readonly returns: "TABLE(kind text, dependant_id uuid, label text, how text)"; readonly security: "definer"; }, { readonly name: "field_duplicate"; readonly args: "p_organization_id uuid, p_field_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "field_history"; readonly args: "p_organization_id uuid, p_table_id uuid, p_field_key text, p_limit integer DEFAULT 100, p_offset integer DEFAULT 0, p_record_id uuid DEFAULT NULL::uuid"; readonly returns: "TABLE(record_id uuid, record_title text, version integer, occurred_at timestamp with time zone, operation_label text, actor jsonb, before jsonb, after jsonb)"; readonly security: "definer"; }, { readonly name: "field_input_closure"; readonly args: "p_organization_id uuid, p_field_data jsonb, p_self uuid DEFAULT NULL::uuid"; readonly returns: "TABLE(input_id uuid, input_key text, input_label text, input_table uuid, sensitivity text, retired boolean, depth integer)"; readonly security: "definer"; }, { readonly name: "field_input_closure_many"; readonly args: "p_organization_id uuid, p_ids uuid[]"; readonly returns: "TABLE(root_id uuid, input_id uuid, retired boolean, depth integer)"; readonly security: "definer"; }, { readonly name: "field_inputs_of"; readonly args: "p_organization_id uuid, p_field_data jsonb"; readonly returns: "TABLE(input_id uuid, input_key text, input_label text, input_table uuid, sensitivity text, retired boolean, how text)"; readonly security: "definer"; }, { readonly name: "field_is_protected"; readonly args: "p_data jsonb"; readonly returns: "boolean"; readonly security: "invoker"; }, { readonly name: "field_kernel_id"; readonly args: ""; readonly returns: "uuid"; readonly security: "invoker"; }, { readonly name: "field_kind_of"; readonly args: "p_field_data jsonb"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "field_kinds"; readonly args: ""; readonly returns: "TABLE(kind text, behavior text, parity boolean, made_of text)"; readonly security: "invoker"; }, { readonly name: "field_make_automatic"; readonly args: "p_organization_id uuid, p_field_id uuid, p_kind text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "field_notify_on_assign"; readonly args: "p_organization_id uuid, p_field_id uuid, p_on boolean"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "field_options"; readonly args: "p_organization_id uuid, p_field_id uuid"; readonly returns: "SETOF custom.record"; readonly security: "definer"; }, { readonly name: "field_protection_refusal"; readonly args: "p_op text, p_old jsonb, p_new jsonb, p_field_id uuid"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "field_restore"; readonly args: "p_organization_id uuid, p_field_id uuid"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "field_retire"; readonly args: "p_organization_id uuid, p_field_id uuid"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "field_retype_preview"; readonly args: "p_organization_id uuid, p_field_id uuid, p_patch jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "field_rules"; readonly args: "p_field_data jsonb"; readonly returns: "TABLE(kind text, spec jsonb)"; readonly security: "invoker"; }, { readonly name: "field_sensitivity_floor"; readonly args: "p_organization_id uuid, p_field_data jsonb, p_self uuid DEFAULT NULL::uuid"; readonly returns: "TABLE(sensitivity text, reads jsonb)"; readonly security: "definer"; }, { readonly name: "field_source_archived"; readonly args: "p_organization_id uuid, p_field_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "field_update"; readonly args: "p_organization_id uuid, p_field_id uuid, p_patch jsonb"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "field_update_rehoming_choices"; readonly args: "p_organization_id uuid, p_field_id uuid, p_patch jsonb, p_rehome jsonb DEFAULT NULL::jsonb, p_cells_back jsonb DEFAULT NULL::jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "field_value_convert"; readonly args: "p_to jsonb, p_value jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "field_value_kind"; readonly args: "p_organization_id uuid, p_field_data jsonb"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "field_words"; readonly args: "p_organization_id uuid, p_field_id uuid, p_value jsonb"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "file_kernel_id"; readonly args: ""; readonly returns: "uuid"; readonly security: "invoker"; }, { readonly name: "filter_is_rule"; readonly args: "p_filter jsonb"; readonly returns: "boolean"; readonly security: "invoker"; }, { readonly name: "filter_list_op"; readonly args: "p_op text, p_a jsonb, p_b jsonb DEFAULT NULL::jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "filter_list_op_words"; readonly args: ""; readonly returns: "text[]"; readonly security: "invoker"; }, { readonly name: "find_duplicates"; readonly args: "p_organization_id uuid, p_table_id uuid, p_fields text[], p_limit integer DEFAULT 50"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "form_archive"; readonly args: "p_organization_id uuid, p_form_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "form_declare"; readonly args: "p_organization_id uuid, p_table_id uuid, p_title text, p_questions jsonb, p_presentation jsonb DEFAULT '{}'::jsonb, p_submission_cap integer DEFAULT NULL::integer, p_quarantine_rule_id uuid DEFAULT NULL::uuid, p_notify_rule_id uuid DEFAULT NULL::uuid, p_form_id uuid DEFAULT NULL::uuid, p_slug text DEFAULT NULL::text"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "form_draft_read"; readonly args: "p_form_id uuid, p_secret text"; readonly returns: "TABLE(answers jsonb, saved_at timestamp with time zone, expires_at timestamp with time zone, state text, message text)"; readonly security: "definer"; }, { readonly name: "form_draft_save"; readonly args: "p_form_id uuid, p_answers jsonb, p_secret text DEFAULT NULL::text, p_bucket text DEFAULT NULL::text, p_origin text DEFAULT NULL::text"; readonly returns: "TABLE(draft_secret text, saved_at timestamp with time zone, expires_at timestamp with time zone, state text, message text)"; readonly security: "definer"; }, { readonly name: "form_knobs"; readonly args: "p_organization_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "form_look_options"; readonly args: "p_organization_id uuid, p_presentation jsonb DEFAULT '{}'::jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "form_notify"; readonly args: "p_organization_id uuid, p_form_id uuid, p_record_id uuid, p_submission_id uuid"; readonly returns: "uuid"; readonly security: "invoker"; }, { readonly name: "form_preview_asks"; readonly args: "p_organization_id uuid, p_table_id uuid, p_questions jsonb, p_values jsonb"; readonly returns: "TABLE(field_key text, asked boolean, decided boolean, said text)"; readonly security: "definer"; }, { readonly name: "form_preview_route"; readonly args: "p_organization_id uuid, p_table_id uuid, p_questions jsonb, p_endings jsonb, p_values jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "form_public"; readonly args: "p_form_id uuid"; readonly returns: "TABLE(form_id uuid, organization_id uuid, table_id uuid, title text, presentation jsonb, fields jsonb, honeypot_key text, state text, message text)"; readonly security: "definer"; }, { readonly name: "form_public_asks"; readonly args: "p_form_id uuid, p_values jsonb, p_secret text DEFAULT NULL::text, p_origin text DEFAULT NULL::text"; readonly returns: "TABLE(field_key text, asked boolean, decided boolean, said text)"; readonly security: "definer"; }, { readonly name: "form_public_options"; readonly args: "p_form_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "form_public_route"; readonly args: "p_form_id uuid, p_values jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "form_redirect_domains"; readonly args: "p_organization_id uuid"; readonly returns: "text[]"; readonly security: "invoker"; }, { readonly name: "form_redirect_refusal"; readonly args: "p_organization_id uuid, p_url text"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "form_respondent_copy"; readonly args: "p_organization_id uuid, p_form_id uuid, p_record_id uuid, p_submission_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "form_response_read"; readonly args: "p_form_id uuid, p_edit text, p_unlock text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "form_response_update"; readonly args: "p_form_id uuid, p_edit text, p_origin text, p_payload jsonb, p_bucket text"; readonly returns: "TABLE(submission_id uuid, record_id uuid, state text, message text)"; readonly security: "definer"; }, { readonly name: "form_restore"; readonly args: "p_organization_id uuid, p_form_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "form_results"; readonly args: "p_organization_id uuid, p_form_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "form_set_password"; readonly args: "p_organization_id uuid, p_form_id uuid, p_password text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "form_slug"; readonly args: "p_organization_id uuid, p_title text, p_form_id uuid DEFAULT NULL::uuid"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "form_submit"; readonly args: "p_form_id uuid, p_origin text, p_payload jsonb, p_bucket text, p_honeypot text DEFAULT NULL::text, p_client_key text DEFAULT NULL::text"; readonly returns: "TABLE(submission_id uuid, record_id uuid, state text, message text)"; readonly security: "definer"; }, { readonly name: "form_theme_options"; readonly args: ""; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "form_unlock"; readonly args: "p_form_id uuid, p_password text DEFAULT NULL::text, p_unlock text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "form_visit"; readonly args: "p_form_id uuid, p_visit text, p_event text, p_field text DEFAULT NULL::text"; readonly returns: "text"; readonly security: "definer"; }, { readonly name: "form_visit_admit"; readonly args: "p_form_id uuid, p_bucket text"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "forms"; readonly args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid"; readonly returns: "TABLE(form_id uuid, table_id uuid, title text, slug text, published_at timestamp with time zone, closed_at timestamp with time zone, submission_cap integer, responses bigint, in_table bigint, held bigint, rejected bigint, state text, quarantine_rule_id uuid, notify_rule_id uuid, presentation jsonb)"; readonly security: "definer"; }, { readonly name: "forms_archived"; readonly args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid, p_limit integer DEFAULT 100"; readonly returns: "TABLE(form_id uuid, table_id uuid, table_name text, kind text, title text, slug text, archived_at timestamp with time zone, archived_by uuid, table_archived boolean, can_restore boolean)"; readonly security: "definer"; }, { readonly name: "forms_archived_everywhere"; readonly args: ""; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "formula_compile_sql"; readonly args: "p_organization_id uuid, p_expr jsonb, p_values_sql text"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "formula_eval"; readonly args: "p_organization_id uuid, p_expr jsonb, p_values jsonb, p_context jsonb DEFAULT '{}'::jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "formula_field_keys"; readonly args: "p_organization_id uuid, p_expr jsonb"; readonly returns: "text[]"; readonly security: "invoker"; }, { readonly name: "formula_history"; readonly args: "p_organization_id uuid, p_record_id uuid, p_field_key text, p_limit integer DEFAULT 100"; readonly returns: "TABLE(occurred_at timestamp with time zone, cause text, record_version integer, formula_version integer, formula_text text, value jsonb, refused text, actor jsonb)"; readonly security: "definer"; }, { readonly name: "formula_node_kinds"; readonly args: ""; readonly returns: "TABLE(node text, min_args integer, max_args integer, result text, signature text, says text)"; readonly security: "invoker"; }, { readonly name: "formula_parse"; readonly args: "p_organization_id uuid, p_table_id uuid, p_text text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "formula_preview"; readonly args: "p_organization_id uuid, p_table_id uuid, p_record_id uuid, p_text text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "formula_result_kind"; readonly args: "p_organization_id uuid, p_expr jsonb"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "formula_translate_notion"; readonly args: "p_text text, p_types jsonb DEFAULT '{}'::jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "formula_value"; readonly args: "p_organization_id uuid, p_record_id uuid, p_field_data jsonb, p_values jsonb DEFAULT NULL::jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "freshness_verdict"; readonly args: "p_written_at timestamp with time zone, p_ceiling_seconds numeric"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "grid_layout"; readonly args: "p_organization_id uuid, p_table_id uuid, p_view_id uuid DEFAULT NULL::uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "grid_layout_check"; readonly args: "p_layout jsonb, p_scope text DEFAULT 'view'::text"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "guard_refusals_are_complete"; readonly args: ""; readonly returns: "TABLE(guard text, said text)"; readonly security: "invoker"; }, { readonly name: "has_visibility"; readonly args: "p_user_id uuid, p_type text, p_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "has_visibility_at"; readonly args: "p_user_id uuid, p_type text, p_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level, p_organization_id uuid DEFAULT NULL::uuid, p_min_version bigint DEFAULT NULL::bigint"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "hidden_field_notice"; readonly args: "p_field custom.record, p_action text DEFAULT 'read'::text"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "history_actor"; readonly args: "p_tier text, p_document jsonb, p_actor_id uuid, p_people jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "history_changes"; readonly args: "p_organization_id uuid, p_table_id uuid, p_old jsonb, p_new jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "history_people"; readonly args: "p_organization_id uuid, p_ids uuid[]"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "history_prune"; readonly args: "p_organization_id uuid, p_scope text DEFAULT 'values'::text, p_table_id uuid DEFAULT NULL::uuid, p_dry_run boolean DEFAULT true"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "history_restore_body"; readonly args: "p_current jsonb, p_target jsonb, p_field_key text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "history_restore_body"; readonly args: "p_current jsonb, p_target jsonb, p_field_key text, p_author jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "history_retention"; readonly args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "history_retention_floor_raise"; readonly args: "p_organization_id uuid, p_days integer"; readonly returns: "integer"; readonly security: "definer"; }, { readonly name: "history_retention_set"; readonly args: "p_organization_id uuid, p_table_id uuid, p_days integer"; readonly returns: "integer"; readonly security: "definer"; }, { readonly name: "home_add"; readonly args: "p_organization_id uuid, p_table_id uuid, p_home_record_id uuid"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "home_relations"; readonly args: ""; readonly returns: "TABLE(table_id uuid, home_record_id uuid, organization_id uuid, relation_id uuid)"; readonly security: "invoker"; }, { readonly name: "hot_doors_6_on"; readonly args: "p_person uuid"; readonly returns: "boolean"; readonly security: "invoker"; }, { readonly name: "hot_doors_7_on"; readonly args: "p_person uuid"; readonly returns: "boolean"; readonly security: "invoker"; }, { readonly name: "hub_changed_by"; readonly args: "p_organization_id uuid, p_kind text, p_ids uuid[]"; readonly returns: "TABLE(id uuid, at timestamp with time zone, who text)"; readonly security: "definer"; }, { readonly name: "hub_changed_by_many"; readonly args: "p_asks jsonb, p_door text DEFAULT NULL::text"; readonly returns: "TABLE(organization_id uuid, id uuid, at timestamp with time zone, who text)"; readonly security: "definer"; }, { readonly name: "hub_row_asked_alone"; readonly args: "p_org uuid, p_id uuid"; readonly returns: "boolean"; readonly security: "invoker"; }, { readonly name: "inbound_addresses"; readonly args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "inbound_declare"; readonly args: "p_organization_id uuid, p_table_id uuid, p_label text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "inbound_domain"; readonly args: "p_organization_id uuid"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "inbound_mail_land"; readonly args: "p_address text, p_mail jsonb, p_secret text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "inbound_mail_map"; readonly args: "p_organization_id uuid, p_table_id uuid, p_mail jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "inbound_set"; readonly args: "p_organization_id uuid, p_inbound_id uuid, p_enabled boolean"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "inbox_clear"; readonly args: "p_organization_id uuid, p_item_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "inbox_counts"; readonly args: "p_organization_id uuid DEFAULT NULL::uuid"; readonly returns: "TABLE(organization_id uuid, organization_name text, waiting integer, snoozed integer, cleared integer, overdue integer, oldest_waiting_at timestamp with time zone)"; readonly security: "definer"; }, { readonly name: "inbox_remind_tick"; readonly args: ""; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "inbox_snooze"; readonly args: "p_organization_id uuid, p_item_id uuid, p_until timestamp with time zone"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "inbox_unclear"; readonly args: "p_organization_id uuid, p_item_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "inbox_unsnooze"; readonly args: "p_organization_id uuid, p_item_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "index_payload"; readonly args: "p_organization_id uuid, p_table_id uuid, p_limit integer DEFAULT 1000"; readonly returns: "TABLE(id uuid, searchable text)"; readonly security: "invoker"; }, { readonly name: "interface_chart"; readonly args: "p_interface_id uuid, p_chart_id text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "interface_chart_formula_ok"; readonly args: "p_org uuid, p_table uuid, p_key text, p_allowed text[], p_depth integer"; readonly returns: "boolean"; readonly security: "invoker"; }, { readonly name: "interface_read"; readonly args: "p_interface_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "interface_rows"; readonly args: "p_interface_id uuid, p_element_id text, p_record_id uuid DEFAULT NULL::uuid, p_limit integer DEFAULT 200, p_offset integer DEFAULT 0"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "intern_provenance"; readonly args: "p_data jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "io_cell"; readonly args: "p_organization_id uuid, p_field jsonb, p_word text, p_date_order text DEFAULT 'mdy'::text"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "io_change_actor"; readonly args: ""; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "io_change_fields"; readonly args: "p_keys text[], p_old jsonb, p_new jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "io_change_via"; readonly args: ""; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "io_changed_field_ids"; readonly args: "p_organization_id uuid, p_table_id uuid, p_old jsonb, p_new jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "io_changed_keys"; readonly args: "p_old jsonb, p_new jsonb"; readonly returns: "text[]"; readonly security: "invoker"; }, { readonly name: "io_comment_resolve"; readonly args: "p_organization_id uuid, p_comment_id uuid, p_resolved boolean DEFAULT true"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "io_comment_write"; readonly args: "p_organization_id uuid, p_record_id uuid, p_body text, p_anchor jsonb DEFAULT '{}'::jsonb, p_parent_comment_id uuid DEFAULT NULL::uuid"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "io_comments"; readonly args: "p_organization_id uuid, p_record_id uuid, p_include_resolved boolean DEFAULT false"; readonly returns: "TABLE(id uuid, body text, anchor jsonb, parent_comment_id uuid, created_by uuid, created_at timestamp with time zone, resolved_at timestamp with time zone, resolved_by uuid)"; readonly security: "definer"; }, { readonly name: "io_csv_escape"; readonly args: "p_value text, p_delimiter text DEFAULT ','::text"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "io_csv_parse"; readonly args: "p_text text, p_delimiter text DEFAULT NULL::text"; readonly returns: "TABLE(row_number integer, cells text[])"; readonly security: "invoker"; }, { readonly name: "io_export"; readonly args: "p_organization_id uuid, p_table_id uuid, p_columns text[] DEFAULT NULL::text[], p_limit integer DEFAULT 10000, p_required text DEFAULT 'viewer'::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "io_export_csv"; readonly args: "p_organization_id uuid, p_table_id uuid, p_columns text[] DEFAULT NULL::text[], p_limit integer DEFAULT 10000, p_delimiter text DEFAULT chr(44), p_required text DEFAULT 'viewer'::text"; readonly returns: "text"; readonly security: "definer"; }, { readonly name: "io_import_begin"; readonly args: "p_organization_id uuid, p_table_id uuid, p_format text DEFAULT 'csv'::text, p_source_name text DEFAULT NULL::text, p_source_columns jsonb DEFAULT '[]'::jsonb, p_file_hash text DEFAULT NULL::text, p_policy jsonb DEFAULT '{}'::jsonb, p_dedupe_key text DEFAULT NULL::text, p_file_bytes bigint DEFAULT NULL::bigint, p_force boolean DEFAULT false"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "io_import_declare_columns"; readonly args: "p_organization_id uuid, p_table_id uuid, p_rows jsonb, p_mapping jsonb DEFAULT '{}'::jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "io_import_finish"; readonly args: "p_organization_id uuid, p_import_id uuid, p_unmapped text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "io_import_forget"; readonly args: "p_organization_id uuid, p_import_id uuid"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "io_import_open"; readonly args: "p_organization_id uuid, p_table_id uuid, p_format text DEFAULT 'csv'::text, p_source_name text DEFAULT NULL::text, p_source_columns jsonb DEFAULT '[]'::jsonb"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "io_import_plan"; readonly args: "p_organization_id uuid, p_table_id uuid, p_columns jsonb DEFAULT '[]'::jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "io_import_report"; readonly args: "p_organization_id uuid, p_import_id uuid, p_state text DEFAULT NULL::text, p_limit integer DEFAULT 100, p_offset integer DEFAULT 0"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "io_import_rows"; readonly args: "p_organization_id uuid, p_import_id uuid, p_rows jsonb, p_mapping jsonb DEFAULT '{}'::jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "io_imports"; readonly args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid, p_limit integer DEFAULT 25"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "io_infer_column"; readonly args: "p_organization_id uuid, p_table_id uuid, p_header text, p_samples jsonb DEFAULT '[]'::jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "io_infer_type"; readonly args: "p_samples jsonb"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "io_money_unit"; readonly args: "p_word text"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "io_outbox_announce"; readonly args: ""; readonly returns: "trigger"; readonly security: "definer"; }, { readonly name: "io_outbox_backlog"; readonly args: "p_consumer text, p_event_key text, p_older_than interval DEFAULT '00:00:00'::interval"; readonly returns: "TABLE(organization_id uuid, waiting bigint, oldest timestamp with time zone, last_carried timestamp with time zone)"; readonly security: "definer"; }, { readonly name: "io_outbox_broadcast_stmt"; readonly args: ""; readonly returns: "trigger"; readonly security: "definer"; }, { readonly name: "io_outbox_consumed_by"; readonly args: "p_event_id uuid, p_consumer text, p_consumed_at timestamp with time zone"; readonly returns: "boolean"; readonly security: "invoker"; }, { readonly name: "io_outbox_drain"; readonly args: "p_organization_id uuid, p_consumer text, p_limit integer DEFAULT 100, p_event_key text DEFAULT 'records.changed'::text"; readonly returns: "TABLE(outbox_id uuid, record_id uuid, table_id uuid, operation text, changed_field_ids jsonb, actor jsonb, occurred_at timestamp with time zone)"; readonly security: "definer"; }, { readonly name: "io_outbox_last_consumed"; readonly args: "p_consumer text, p_event_key text, p_organization_id uuid"; readonly returns: "timestamp with time zone"; readonly security: "invoker"; }, { readonly name: "io_outbox_pending_organizations"; readonly args: "p_consumer text, p_event_key text"; readonly returns: "SETOF uuid"; readonly security: "definer"; }, { readonly name: "io_outbox_per_consumer"; readonly args: ""; readonly returns: "boolean"; readonly security: "invoker"; }, { readonly name: "io_outbox_rearm"; readonly args: "p_organization_id uuid, p_dedupe_key text"; readonly returns: "void"; readonly security: "definer"; }, { readonly name: "io_outbox_release"; readonly args: "p_organization_id uuid, p_consumer text, p_older_than interval DEFAULT '00:15:00'::interval"; readonly returns: "integer"; readonly security: "definer"; }, { readonly name: "io_outbox_release_claimed"; readonly args: "p_organization_id uuid, p_consumer text, p_ids uuid[]"; readonly returns: "integer"; readonly security: "definer"; }, { readonly name: "io_outbox_subscribe"; readonly args: "p_consumer text, p_event_key text"; readonly returns: "timestamp with time zone"; readonly security: "definer"; }, { readonly name: "io_proposal_accept"; readonly args: "p_organization_id uuid, p_import_id uuid, p_column text, p_type text DEFAULT NULL::text, p_label text DEFAULT NULL::text"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "io_proposal_reject"; readonly args: "p_organization_id uuid, p_import_id uuid, p_column text"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "io_proposal_spec"; readonly args: "p_proposal jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "io_record_changed"; readonly args: ""; readonly returns: "trigger"; readonly security: "definer"; }, { readonly name: "io_record_changed_stmt_delete"; readonly args: ""; readonly returns: "trigger"; readonly security: "definer"; }, { readonly name: "io_record_changed_stmt_insert"; readonly args: ""; readonly returns: "trigger"; readonly security: "definer"; }, { readonly name: "io_record_changed_stmt_update"; readonly args: ""; readonly returns: "trigger"; readonly security: "definer"; }, { readonly name: "io_relation_candidate"; readonly args: "p_organization_id uuid, p_table_id uuid, p_words text[]"; readonly returns: "uuid"; readonly security: "invoker"; }, { readonly name: "io_restore"; readonly args: "p_organization_id uuid, p_record_id uuid, p_version integer"; readonly returns: "integer"; readonly security: "definer"; }, { readonly name: "io_restore"; readonly args: "p_organization_id uuid, p_record_id uuid, p_version integer, p_author jsonb"; readonly returns: "integer"; readonly security: "definer"; }, { readonly name: "io_revisions"; readonly args: "p_organization_id uuid, p_record_id uuid"; readonly returns: "TABLE(version integer, changed_at timestamp with time zone, changed_by uuid, summary text, operation text, changed_fields jsonb)"; readonly security: "definer"; }, { readonly name: "io_sample_words"; readonly args: "p_samples jsonb"; readonly returns: "TABLE(word text)"; readonly security: "invoker"; }, { readonly name: "io_value_shape"; readonly args: "p_envelope jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "io_workflow_chain"; readonly args: ""; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "is_a_retirement"; readonly args: "p_old_deleted timestamp with time zone, p_new_deleted timestamp with time zone, p_old_data jsonb, p_new_data jsonb, p_old_table uuid, p_new_table uuid, p_old_org uuid, p_new_org uuid, p_old_class text, p_new_class text"; readonly returns: "boolean"; readonly security: "invoker"; }, { readonly name: "kernel_viewer_sets"; readonly args: "p_user uuid, p_orgs uuid[]"; readonly returns: "TABLE(organization_id uuid, fallback boolean, all_visible boolean, granted_all uuid[], carried_visible uuid[])"; readonly security: "definer"; }, { readonly name: "ladder_replanners"; readonly args: "p_roots text[] DEFAULT ARRAY['custom.has_visibility'::text, 'custom.effective_level'::text, 'custom.reaches_directly'::text, 'custom.visible_set'::text]"; readonly returns: "TABLE(fn text, lang text, why text, remedy text)"; readonly security: "definer"; }, { readonly name: "level_floor"; readonly args: ""; readonly returns: "permission_level"; readonly security: "definer"; }, { readonly name: "levels_of"; readonly args: "p_user_id uuid, p_ids uuid[]"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "levels_raised_by_a_less_specific_rung"; readonly args: ""; readonly returns: "TABLE(organization_id uuid, organization_name text, member_id uuid, member_email text, record_id uuid, addressed_level permission_level, answered_level permission_level)"; readonly security: "definer"; }, { readonly name: "list_door_disagreements"; readonly args: "p_pretend text DEFAULT NULL::text, p_only_organization uuid DEFAULT NULL::uuid, p_sample integer DEFAULT 200"; readonly returns: "TABLE(organization_id uuid, organization_name text, member_id uuid, table_id uuid, record_id uuid, door text, why text)"; readonly security: "invoker"; }, { readonly name: "list_door_disagreements"; readonly args: "p_pretend text, p_only_organization uuid, p_sample integer, p_exhaustive boolean"; readonly returns: "TABLE(organization_id uuid, organization_name text, member_id uuid, table_id uuid, record_id uuid, door text, why text)"; readonly security: "invoker"; }, { readonly name: "list_portals"; readonly args: "p_organization_id uuid, p_archived text DEFAULT 'active'::text"; readonly returns: "TABLE(portal_id uuid, title text, slug text, client_table_id uuid, client_table text, is_active boolean, tables integer, invited integer, signed_in integer, sign_in_method text, opened_at timestamp with time zone)"; readonly security: "definer"; }, { readonly name: "list_portals_everywhere"; readonly args: "p_archived text DEFAULT 'active'::text"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "listed_predicate_sql"; readonly args: "p_user uuid, p_organization_id uuid, p_table_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level, p_alias text DEFAULT 'r'::text"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "lookup_value"; readonly args: "p_organization_id uuid, p_record_id uuid, p_field_data jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "mask_document"; readonly args: "p_document jsonb, p_visible_keys text[], p_notices jsonb, p_by_id boolean DEFAULT false, p_key_ids jsonb DEFAULT '{}'::jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "mask_document"; readonly args: "p_document jsonb, p_visible_keys text[], p_notices jsonb, p_by_id boolean DEFAULT false, p_key_ids jsonb DEFAULT '{}'::jsonb, p_declared_keys text[] DEFAULT NULL::text[]"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "mask_history_data"; readonly args: "p_data jsonb, p_mask jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "mask_says_withheld"; readonly args: "p_mask jsonb, p_key text"; readonly returns: "boolean"; readonly security: "invoker"; }, { readonly name: "may_invite_outside"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "may_see_table_structure"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "member_personal_tables"; readonly args: "p_organization_id uuid, p_person uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "member_records_take_over"; readonly args: "p_organization_id uuid, p_from uuid, p_to uuid, p_reason text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "merge_field_kernel_id"; readonly args: ""; readonly returns: "uuid"; readonly security: "invoker"; }, { readonly name: "migrate_choice_keys"; readonly args: "p_organization_id uuid, p_table_id uuid, p_dry_run boolean DEFAULT false"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "migrate_delete"; readonly args: "p_organization_id uuid, p_record_id uuid, p_note text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "migrate_demote"; readonly args: "p_organization_id uuid, p_table_id uuid, p_note text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "migrate_extract_parent"; readonly args: "p_organization_id uuid, p_id uuid, p_parent_table_id uuid, p_moved_keys text[], p_note text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "migrate_merge"; readonly args: "p_organization_id uuid, p_winner_id uuid, p_loser_id uuid, p_note text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "migrate_promote"; readonly args: "p_organization_id uuid, p_table_id uuid, p_note text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "migrate_purge"; readonly args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid, p_dry_run boolean DEFAULT true"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "migrate_purge_hard"; readonly args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid, p_compliance_reason text DEFAULT NULL::text, p_chunk integer DEFAULT 200, p_dry_run boolean DEFAULT true"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "migrate_purge_hard_request"; readonly args: "p_organization_id uuid, p_table_id uuid, p_compliance_reason text"; readonly returns: "void"; readonly security: "definer"; }, { readonly name: "migrate_reclass"; readonly args: "p_organization_id uuid, p_id uuid, p_to text DEFAULT 'field'::text, p_note text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "migrate_rename"; readonly args: "p_organization_id uuid, p_id uuid, p_to text, p_note text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "migrate_reparent"; readonly args: "p_organization_id uuid, p_id uuid, p_parent_id uuid, p_note text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "migrate_retype"; readonly args: "p_organization_id uuid, p_id uuid, p_to text, p_note text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "migrate_split"; readonly args: "p_organization_id uuid, p_record_id uuid, p_moved_keys text[], p_note text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "migrate_undo"; readonly args: "p_organization_id uuid, p_log_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "migrations"; readonly args: "p_organization_id uuid, p_target_id uuid DEFAULT NULL::uuid, p_limit integer DEFAULT 100"; readonly returns: "TABLE(id uuid, verb text, target_kind text, target_id uuid, note text, applied_at timestamp with time zone, applied_by uuid, undone_at timestamp with time zone)"; readonly security: "definer"; }, { readonly name: "mirror_asks_the_whole_database"; readonly args: ""; readonly returns: "TABLE(schema_name text, table_name text, policy_name text, why text)"; readonly security: "invoker"; }, { readonly name: "my_level"; readonly args: "p_organization_id uuid, p_id uuid, p_type text DEFAULT 'record'::text"; readonly returns: "permission_level"; readonly security: "definer"; }, { readonly name: "my_levels"; readonly args: "p_organization_id uuid, p_ids jsonb, p_type text DEFAULT 'record'::text"; readonly returns: "TABLE(id uuid, level permission_level)"; readonly security: "definer"; }, { readonly name: "my_levels_across"; readonly args: "p_asks jsonb"; readonly returns: "TABLE(organization_id uuid, id uuid, level permission_level, refused text)"; readonly security: "definer"; }, { readonly name: "opening_view_shape"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "organization_clear"; readonly args: "p_organization_id uuid, p_confirm text, p_and_destroy boolean DEFAULT false"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "organization_contents"; readonly args: "p_organization_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "organization_has_a_public_table"; readonly args: "p_organization_id uuid"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "organization_home_id"; readonly args: "p_organization_id uuid"; readonly returns: "uuid"; readonly security: "invoker"; }, { readonly name: "organization_kernel_id"; readonly args: ""; readonly returns: "uuid"; readonly security: "invoker"; }, { readonly name: "organization_pick_lists"; readonly args: "p_organization_id uuid"; readonly returns: "TABLE(id uuid, list_name text, description text, updated_at timestamp with time zone, lives_in text)"; readonly security: "definer"; }, { readonly name: "organization_references"; readonly args: "p_kind text, p_organization_id uuid, p_row jsonb"; readonly returns: "TABLE(site text, what text, ref_id uuid, openable boolean)"; readonly security: "invoker"; }, { readonly name: "owning_table"; readonly args: "p_organization_id uuid, p_record_id uuid"; readonly returns: "uuid"; readonly security: "invoker"; }, { readonly name: "owning_table_gone"; readonly args: "p_organization_id uuid, p_record_id uuid"; readonly returns: "boolean"; readonly security: "invoker"; }, { readonly name: "page_ceiling"; readonly args: "p_organization_id uuid DEFAULT NULL::uuid"; readonly returns: "integer"; readonly security: "invoker"; }, { readonly name: "page_contract"; readonly args: "p_organization_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "page_size"; readonly args: "p_organization_id uuid, p_door text, p_limit integer, p_default integer DEFAULT NULL::integer, p_ceiling integer DEFAULT NULL::integer"; readonly returns: "integer"; readonly security: "invoker"; }, { readonly name: "parity_field_types"; readonly args: ""; readonly returns: "TABLE(parity_type text, behavior text, made_of text)"; readonly security: "invoker"; }, { readonly name: "parity_type"; readonly args: "p_field_data jsonb"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "parity_values"; readonly args: "p_organization_id uuid, p_record_id uuid"; readonly returns: "TABLE(field_key text, field_id uuid, parity_type text, behavior text, unit text, format text, value jsonb, value_version integer, actor text, written_at timestamp with time zone)"; readonly security: "invoker"; }, { readonly name: "per_value_access_words"; readonly args: ""; readonly returns: "text[]"; readonly security: "invoker"; }, { readonly name: "person_kernel_id"; readonly args: ""; readonly returns: "uuid"; readonly security: "invoker"; }, { readonly name: "phone_canonical"; readonly args: "p_text text"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "phone_display"; readonly args: "p_text text"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "phone_pattern"; readonly args: ""; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "pick_list_create"; readonly args: "p_organization_id uuid, p_list_name text, p_description text DEFAULT NULL::text, p_items jsonb DEFAULT '[]'::jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "pick_list_for_selection"; readonly args: "p_list_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "pick_list_get"; readonly args: "p_list_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "pick_list_index"; readonly args: "p_organization_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "pick_list_index_everywhere"; readonly args: ""; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "pick_list_update"; readonly args: "p_list_id uuid, p_list_name text DEFAULT NULL::text, p_description text DEFAULT NULL::text, p_items jsonb DEFAULT NULL::jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "pin_agent_cells"; readonly args: "p_new jsonb, p_old jsonb, p_agent_keys text[]"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "pipeline_board"; readonly args: "p_organization_id uuid, p_table_id uuid, p_measure text DEFAULT NULL::text"; readonly returns: "TABLE(stage_key text, stage_label text, stage_position integer, cards bigint, total numeric, wip_limit integer, over_limit boolean)"; readonly security: "definer"; }, { readonly name: "pipeline_board"; readonly args: "p_organization_id uuid, p_table_id uuid, p_measure text, p_filter jsonb"; readonly returns: "TABLE(stage_key text, stage_label text, stage_position integer, cards bigint, total numeric, wip_limit integer, over_limit boolean)"; readonly security: "definer"; }, { readonly name: "pipeline_declare"; readonly args: "p_organization_id uuid, p_table_id uuid, p_spec jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "pipeline_gate_preview"; readonly args: "p_organization_id uuid, p_table_id uuid, p_stage text, p_gate jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "pipeline_move"; readonly args: "p_organization_id uuid, p_record_id uuid, p_to text, p_also jsonb DEFAULT '{}'::jsonb, p_expected_version integer DEFAULT NULL::integer"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "pipeline_move_many"; readonly args: "p_organization_id uuid, p_moves jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "pipeline_pending"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "pipeline_read"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "pipeline_transition_refusal"; readonly args: "p_organization_id uuid, p_record_id uuid, p_to text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "pipelines"; readonly args: "p_organization_id uuid"; readonly returns: "TABLE(table_id uuid, table_name text, stage_field text, stage_label text, stages integer, rules integer, broken text, updated_at timestamp with time zone, updated_by uuid)"; readonly security: "definer"; }, { readonly name: "plural_of"; readonly args: "p_word text"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "portal_accents"; readonly args: ""; readonly returns: "text[]"; readonly security: "invoker"; }, { readonly name: "portal_admits"; readonly args: "p_organization_id uuid, p_user_id uuid DEFAULT NULL::uuid"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "portal_archive"; readonly args: "p_organization_id uuid, p_portal_id uuid, p_confirm_title text, p_reason text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "portal_card"; readonly args: "p_organization_id uuid, p_portal_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "portal_declare"; readonly args: "p_organization_id uuid, p_title text, p_client_table_id uuid, p_tables jsonb, p_portal_id uuid DEFAULT NULL::uuid, p_slug text DEFAULT NULL::text, p_sign_in_method text DEFAULT 'magic_link'::text, p_config jsonb DEFAULT NULL::jsonb"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "portal_field_map"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "TABLE(field_id uuid, field_key text, field_type text, points_at uuid)"; readonly security: "definer"; }, { readonly name: "portal_form"; readonly args: "p_organization_id uuid, p_portal_id uuid, p_form_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "portal_form_submit"; readonly args: "p_organization_id uuid, p_portal_id uuid, p_form_id uuid, p_payload jsonb, p_client_key text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "portal_invitation"; readonly args: "p_slug text, p_email text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "portal_invite"; readonly args: "p_organization_id uuid, p_portal_id uuid, p_client_record_id uuid, p_email text, p_user_id uuid DEFAULT NULL::uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "portal_invite_accept"; readonly args: "p_token text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "portal_me"; readonly args: ""; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "portal_preview"; readonly args: "p_organization_id uuid, p_portal_id uuid, p_principal_id uuid, p_table_id uuid"; readonly returns: "TABLE(record_id uuid, title text)"; readonly security: "definer"; }, { readonly name: "portal_principal_bind"; readonly args: "p_organization_id uuid, p_principal_id uuid, p_user_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "portal_public"; readonly args: "p_slug text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "portal_record_title"; readonly args: "p_organization_id uuid, p_record_id uuid"; readonly returns: "text"; readonly security: "definer"; }, { readonly name: "portal_restore"; readonly args: "p_organization_id uuid, p_portal_id uuid, p_confirm_title text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "portal_revoke"; readonly args: "p_organization_id uuid, p_portal_id uuid, p_principal_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "portal_self_signup"; readonly args: "p_slug text, p_email text, p_name text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "portal_slug"; readonly args: "p_organization_id uuid, p_title text, p_portal_id uuid DEFAULT NULL::uuid"; readonly returns: "text"; readonly security: "definer"; }, { readonly name: "portal_tables"; readonly args: "p_organization_id uuid"; readonly returns: "TABLE(portal_id uuid, table_id uuid, name text)"; readonly security: "definer"; }, { readonly name: "portals"; readonly args: "p_organization_id uuid"; readonly returns: "TABLE(portal_id uuid, title text, slug text, client_table_id uuid, client_table text, is_active boolean, tables integer, invited integer, signed_in integer, sign_in_method text, opened_at timestamp with time zone)"; readonly security: "definer"; }, { readonly name: "presentation_kernel_id"; readonly args: ""; readonly returns: "uuid"; readonly security: "invoker"; }, { readonly name: "promote_field"; readonly args: "p_organization_id uuid, p_table_id uuid, p_field_id uuid"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "promote_table"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "promoted_field_cap"; readonly args: ""; readonly returns: "integer"; readonly security: "invoker"; }, { readonly name: "promoted_fields"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "TABLE(field_id uuid, field_key text, parity_type text, is_unique boolean, value_path text, index_arm text, index_expr text, index_name text, indexable boolean, why_not text)"; readonly security: "invoker"; }, { readonly name: "promoted_index_arm"; readonly args: "p_field_data jsonb"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "promoted_index_ddl"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "TABLE(step integer, purpose text, statement text)"; readonly security: "invoker"; }, { readonly name: "promoted_index_expr"; readonly args: "p_field_data jsonb"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "promoted_index_name"; readonly args: "p_table_id uuid, p_field_key text, p_unique boolean"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "promoted_query_sql"; readonly args: "p_organization_id uuid, p_table_id uuid, p_field_key text"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "promoted_read"; readonly args: "p_organization_id uuid, p_table_id uuid, p_field_key text, p_value text"; readonly returns: "SETOF uuid"; readonly security: "invoker"; }, { readonly name: "promoted_value_path"; readonly args: "p_field_data jsonb"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "promotion_inline_ceiling"; readonly args: ""; readonly returns: "integer"; readonly security: "invoker"; }, { readonly name: "protected_field_notice"; readonly args: "p_field custom.record"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "protected_field_query_refusal"; readonly args: "p_field_id uuid, p_verb text"; readonly returns: "text"; readonly security: "definer"; }, { readonly name: "protected_field_rule"; readonly args: "p_token text"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "protected_matches"; readonly args: "p_field_id uuid, p_value jsonb DEFAULT NULL::jsonb"; readonly returns: "TABLE(row_id uuid, value jsonb)"; readonly security: "definer"; }, { readonly name: "protected_readers_problem"; readonly args: "p_token text, p_readers jsonb"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "protected_value"; readonly args: "p_token text, p_row_id uuid, p_field_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "protected_value_leaks"; readonly args: "p_field_id uuid DEFAULT NULL::uuid"; readonly returns: "TABLE(place text, table_token text, field_key text, row_id uuid, ref text)"; readonly security: "definer"; }, { readonly name: "protected_values"; readonly args: "p_organization_id uuid, p_token text, p_row_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "provenance_prune"; readonly args: "p_organization_id uuid DEFAULT NULL::uuid, p_dry_run boolean DEFAULT true, p_limit integer DEFAULT 200000"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "provenance_retention_days"; readonly args: "p_organization_id uuid"; readonly returns: "integer"; readonly security: "definer"; }, { readonly name: "provenance_write"; readonly args: "p_organization_id uuid, p_conversation_id uuid, p_turn_id text, p_rows jsonb"; readonly returns: "integer"; readonly security: "definer"; }, { readonly name: "public_definition_owner"; readonly args: "p_organization_id uuid, p_table_id uuid, p_record_id uuid"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "publish_bind"; readonly args: "p_organization_id uuid, p_kind text, p_resource_id uuid, p_slug text, p_render_mode text DEFAULT 'page'::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "published_view_read"; readonly args: "p_slug text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "query_access_ids"; readonly args: "p_organization_id uuid, p_required text DEFAULT 'viewer'::text"; readonly returns: "uuid[]"; readonly security: "invoker"; }, { readonly name: "query_across_homes"; readonly args: "p_organization_id uuid, p_table_id uuid, p_limit integer DEFAULT 50, p_offset integer DEFAULT 0, p_required text DEFAULT 'viewer'::text"; readonly returns: "TABLE(record_id uuid, home_record_id uuid, data jsonb, created_at timestamp with time zone)"; readonly security: "definer"; }, { readonly name: "query_by_coordinates"; readonly args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid, p_coordinates jsonb DEFAULT '[]'::jsonb, p_limit integer DEFAULT 50, p_offset integer DEFAULT 0, p_required text DEFAULT 'viewer'::text"; readonly returns: "TABLE(record_id uuid, table_id uuid, data jsonb, coordinates_matched integer)"; readonly security: "definer"; }, { readonly name: "query_can_see"; readonly args: "p_organization_id uuid, p_record_id uuid, p_required text DEFAULT 'viewer'::text"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "query_hot_paths"; readonly args: ""; readonly returns: "TABLE(name text, statement text)"; readonly security: "invoker"; }, { readonly name: "query_hot_paths_prepared"; readonly args: ""; readonly returns: "TABLE(name text, prepared boolean, generic_plans bigint)"; readonly security: "invoker"; }, { readonly name: "query_is_store_owner"; readonly args: ""; readonly returns: "boolean"; readonly security: "invoker"; }, { readonly name: "query_prepare_hot"; readonly args: ""; readonly returns: "integer"; readonly security: "invoker"; }, { readonly name: "query_principal"; readonly args: ""; readonly returns: "uuid"; readonly security: "invoker"; }, { readonly name: "query_record_as_of"; readonly args: "p_organization_id uuid, p_record_id uuid, p_recorded_at timestamp with time zone DEFAULT NULL::timestamp with time zone, p_world_on date DEFAULT NULL::date, p_required text DEFAULT 'viewer'::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "query_record_document"; readonly args: "p_principal uuid, p_row custom.record"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "query_relation_edges"; readonly args: "p_organization_id uuid, p_flavor text DEFAULT NULL::text, p_role text DEFAULT NULL::text"; readonly returns: "TABLE(parent_id uuid, child_id uuid, role text, flavor text)"; readonly security: "definer"; }, { readonly name: "query_rollup"; readonly args: "p_organization_id uuid, p_roots uuid[], p_flavor text DEFAULT NULL::text, p_role text DEFAULT NULL::text, p_max_depth integer DEFAULT 33, p_required text DEFAULT 'viewer'::text"; readonly returns: "TABLE(record_id uuid, depth integer)"; readonly security: "definer"; }, { readonly name: "query_rollup_sum"; readonly args: "p_organization_id uuid, p_roots uuid[], p_field_key text, p_flavor text DEFAULT NULL::text, p_role text DEFAULT NULL::text, p_max_depth integer DEFAULT 33, p_required text DEFAULT 'viewer'::text"; readonly returns: "numeric"; readonly security: "definer"; }, { readonly name: "query_table_as_of"; readonly args: "p_organization_id uuid, p_table_id uuid, p_recorded_at timestamp with time zone DEFAULT NULL::timestamp with time zone, p_world_on date DEFAULT NULL::date, p_limit integer DEFAULT 50, p_offset integer DEFAULT 0, p_required text DEFAULT 'viewer'::text"; readonly returns: "TABLE(record_id uuid, data jsonb)"; readonly security: "definer"; }, { readonly name: "query_table_homes"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "SETOF uuid"; readonly security: "definer"; }, { readonly name: "query_visibility_parity"; readonly args: "p_organization_id uuid"; readonly returns: "TABLE(side text, container_type text, container_id uuid, item_type text, item_id uuid, stored_level permission_level, derived_level permission_level, reason text)"; readonly security: "definer"; }, { readonly name: "query_visible_ids"; readonly args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid, p_required text DEFAULT 'viewer'::text"; readonly returns: "SETOF uuid"; readonly security: "definer"; }, { readonly name: "reachable_from"; readonly args: "p_organization_id uuid, p_roots uuid[]"; readonly returns: "TABLE(record_id uuid, depth integer, via text)"; readonly security: "invoker"; }, { readonly name: "reaches_directly"; readonly args: "p_user_id uuid, p_type text, p_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "reaches_directly_many"; readonly args: "p_user_id uuid, p_targets uuid[], p_type text DEFAULT 'record'::text, p_required permission_level DEFAULT 'viewer'::permission_level"; readonly returns: "TABLE(target uuid, reaches boolean)"; readonly security: "definer"; }, { readonly name: "read_door_carried_ids"; readonly args: "p_user uuid, p_organization_id uuid, p_table_id uuid, p_required permission_level, OUT o_ids uuid[], OUT o_containers integer"; readonly returns: "record"; readonly security: "definer"; }, { readonly name: "read_door_granted_ids"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "uuid[]"; readonly security: "definer"; }, { readonly name: "read_door_ladder_ceiling"; readonly args: ""; readonly returns: "integer"; readonly security: "invoker"; }, { readonly name: "read_door_parity"; readonly args: "p_organization_id uuid, p_table_id uuid, p_user uuid, p_required permission_level, p_sample integer"; readonly returns: "TABLE(record_id uuid, set_based boolean, per_row boolean, verdict text)"; readonly security: "definer"; }, { readonly name: "read_mask"; readonly args: "p_organization_id uuid, p_record_id uuid, p_action text DEFAULT 'read'::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "read_mask_at"; readonly args: "p_record_id uuid, p_level_given boolean, p_level permission_level, p_action text DEFAULT 'read'::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "read_mask_for"; readonly args: "p_user_id uuid, p_organization_id uuid, p_table_id uuid, p_level permission_level, p_action text DEFAULT 'read'::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "read_paths_outside_the_door"; readonly args: ""; readonly returns: "TABLE(object_name text, why text)"; readonly security: "invoker"; }, { readonly name: "read_record"; readonly args: "p_organization_id uuid, p_record_id uuid, p_by_id boolean DEFAULT false"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "read_records"; readonly args: "p_organization_id uuid, p_table_id uuid, p_by_id boolean DEFAULT false, p_limit integer DEFAULT 200, p_offset integer DEFAULT 0"; readonly returns: "TABLE(id uuid, document jsonb, level permission_level)"; readonly security: "definer"; }, { readonly name: "read_records_archived"; readonly args: "p_organization_id uuid, p_table_id uuid, p_lane text DEFAULT 'org'::text, p_by_id boolean DEFAULT false, p_limit integer DEFAULT 200, p_offset integer DEFAULT 0"; readonly returns: "TABLE(id uuid, document jsonb, level permission_level, archived_at timestamp with time zone, archived_by uuid, archived_by_name text)"; readonly security: "definer"; }, { readonly name: "read_records_by_ids"; readonly args: "p_organization_id uuid, p_table_id uuid, p_record_ids uuid[], p_by_id boolean DEFAULT false"; readonly returns: "TABLE(id uuid, document jsonb, level permission_level)"; readonly security: "definer"; }, { readonly name: "read_records_in_view_order"; readonly args: "p_organization_id uuid, p_view_id uuid, p_by_id boolean DEFAULT false, p_limit integer DEFAULT 200, p_offset integer DEFAULT 0, p_filter jsonb DEFAULT NULL::jsonb"; readonly returns: "TABLE(id uuid, document jsonb, level permission_level, \"position\" numeric)"; readonly security: "definer"; }, { readonly name: "read_records_keyset"; readonly args: "p_organization_id uuid, p_table_id uuid, p_filter jsonb DEFAULT '{}'::jsonb, p_search text DEFAULT NULL::text, p_sort jsonb DEFAULT '[]'::jsonb, p_after jsonb DEFAULT NULL::jsonb, p_limit integer DEFAULT 50, p_time_zone text DEFAULT NULL::text, p_ids uuid[] DEFAULT NULL::uuid[]"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "read_records_matching"; readonly args: "p_organization_id uuid, p_table_id uuid, p_filter jsonb DEFAULT '{}'::jsonb, p_by_id boolean DEFAULT false, p_limit integer DEFAULT 200, p_offset integer DEFAULT 0"; readonly returns: "TABLE(id uuid, document jsonb, level permission_level)"; readonly security: "definer"; }, { readonly name: "read_records_page"; readonly args: "p_organization_id uuid, p_table_id uuid, p_filter jsonb DEFAULT '{}'::jsonb, p_search text DEFAULT NULL::text, p_sort jsonb DEFAULT '[]'::jsonb, p_view_id uuid DEFAULT NULL::uuid, p_by_id boolean DEFAULT false, p_limit integer DEFAULT 50, p_offset integer DEFAULT 0, p_time_zone text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "realtime_presence_topic_admits"; readonly args: "p_topic text"; readonly returns: "boolean"; readonly security: "invoker"; }, { readonly name: "realtime_topic_admits"; readonly args: "p_topic text"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "record_aggregate"; readonly args: "p_organization_id uuid, p_table_id uuid, p_group_by jsonb DEFAULT '[]'::jsonb, p_measures jsonb DEFAULT '[]'::jsonb, p_bucket jsonb DEFAULT NULL::jsonb, p_filter jsonb DEFAULT '{}'::jsonb, p_limit integer DEFAULT 200, p_required text DEFAULT 'viewer'::text, p_compare jsonb DEFAULT NULL::jsonb, p_search text DEFAULT NULL::text, p_time_zone text DEFAULT NULL::text, p_split_multi boolean DEFAULT false"; readonly returns: "TABLE(groups jsonb, measures jsonb, row_count bigint, prior_groups jsonb, prior_measures jsonb, prior_row_count bigint, delta jsonb, compare jsonb)"; readonly security: "definer"; }, { readonly name: "record_aggregate_as_of"; readonly args: "p_organization_id uuid, p_table_id uuid, p_recorded_at timestamp with time zone, p_measure text DEFAULT 'count'::text, p_field_key text DEFAULT NULL::text, p_group_by text DEFAULT NULL::text, p_match jsonb DEFAULT '{}'::jsonb"; readonly returns: "TABLE(bucket text, result numeric, row_count bigint, not_numbers bigint, a_non_number text)"; readonly security: "definer"; }, { readonly name: "record_applicability"; readonly args: "p_organization_id uuid, p_record_id uuid"; readonly returns: "TABLE(rule_id uuid, rule_name text, rule_version integer, applies boolean, answer jsonb)"; readonly security: "invoker"; }, { readonly name: "record_archiver"; readonly args: "p_organization_id uuid, p_record_id uuid"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "record_as_of"; readonly args: "p_organization_id uuid, p_record_id uuid, p_at timestamp with time zone"; readonly returns: "TABLE(state jsonb, replayed boolean)"; readonly security: "definer"; }, { readonly name: "record_card"; readonly args: "p_viewer uuid, p_organization_id uuid, p_record_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "record_carrying_edges"; readonly args: "p_id uuid, p_data_class text, p_data jsonb, p_deleted_at timestamp with time zone"; readonly returns: "TABLE(container_id uuid, item_id uuid, edge_role text)"; readonly security: "invoker"; }, { readonly name: "record_change_actions"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "record_change_many"; readonly args: "p_organization_id uuid, p_table_id uuid, p_changes jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "record_changes_drain"; readonly args: "p_organization_id uuid, p_consumer text, p_limit integer DEFAULT 100"; readonly returns: "TABLE(event_id uuid, organization_id uuid, table_id uuid, record_id uuid, kind text, operation text, version integer, fields jsonb, changed_field_ids jsonb, actor jsonb, chain jsonb, op_id uuid, occurred_at timestamp with time zone, via text)"; readonly security: "definer"; }, { readonly name: "record_delete"; readonly args: "p_organization_id uuid, p_record_id uuid"; readonly returns: "timestamp with time zone"; readonly security: "definer"; }, { readonly name: "record_drill"; readonly args: "p_organization_id uuid, p_table_id uuid, p_question jsonb DEFAULT '{}'::jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "record_entity_edges"; readonly args: "p_organization_id uuid, p_id uuid, p_table_id uuid, p_data_class text, p_data jsonb, p_deleted_at timestamp with time zone"; readonly returns: "TABLE(target_type text, target_id uuid, edge_role text, field_id uuid, ord integer)"; readonly security: "invoker"; }, { readonly name: "record_filter_sql"; readonly args: "p_filter jsonb"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "record_filter_sql"; readonly args: "p_organization_id uuid, p_table_id uuid, p_filter jsonb"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "record_follow_set"; readonly args: "p_organization_id uuid, p_record_id uuid, p_follow boolean DEFAULT true"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "record_followers"; readonly args: "p_organization_id uuid, p_record_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "record_headers"; readonly args: "p_organization_id uuid, p_ids uuid[]"; readonly returns: "TABLE(id uuid, table_id uuid, created_at timestamp with time zone, updated_at timestamp with time zone, version integer, deleted_at timestamp with time zone, mine boolean, created_by uuid)"; readonly security: "definer"; }, { readonly name: "record_history"; readonly args: "p_organization_id uuid, p_record_id uuid, p_limit integer DEFAULT 200, p_offset integer DEFAULT 0"; readonly returns: "TABLE(version integer, occurred_at timestamp with time zone, operation text, operation_label text, actor jsonb, changes jsonb, migration_id uuid, undoable boolean)"; readonly security: "definer"; }, { readonly name: "record_org_hint"; readonly args: "p_id uuid, p_organization_id uuid"; readonly returns: "uuid"; readonly security: "invoker"; }, { readonly name: "record_page_bundle"; readonly args: "p_organization_id uuid, p_record_id uuid"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "record_platform_keys"; readonly args: ""; readonly returns: "text[]"; readonly security: "invoker"; }, { readonly name: "record_relation_edges"; readonly args: "p_organization_id uuid, p_id uuid, p_table_id uuid, p_data_class text, p_data jsonb, p_deleted_at timestamp with time zone"; readonly returns: "TABLE(target_id uuid, edge_role text, field_id uuid, ord integer)"; readonly security: "invoker"; }, { readonly name: "record_reparent"; readonly args: "p_organization_id uuid, p_record_id uuid, p_parent_id uuid"; readonly returns: "void"; readonly security: "definer"; }, { readonly name: "record_resolve"; readonly args: "p_organization_id uuid, p_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "record_restore"; readonly args: "p_organization_id uuid, p_record_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "record_restore_preview"; readonly args: "p_organization_id uuid, p_record_id uuid, p_version integer, p_field_key text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "record_restore_version"; readonly args: "p_organization_id uuid, p_record_id uuid, p_version integer"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "record_restore_version"; readonly args: "p_organization_id uuid, p_record_id uuid, p_version integer, p_author jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "record_row_controls"; readonly args: "p_organization_id uuid, p_record_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "record_row_controls_set"; readonly args: "p_organization_id uuid, p_record_id uuid, p_controls jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "record_runs"; readonly args: "p_organization_id uuid, p_record_id uuid, p_limit integer DEFAULT 50"; readonly returns: "TABLE(run_id uuid, kind text, name text, trigger_name text, status text, started_at timestamp with time zone, finished_at timestamp with time zone, steps integer, says text, ran_by uuid)"; readonly security: "definer"; }, { readonly name: "record_scope_context"; readonly args: "p_organization_id uuid, p_record_id uuid, p_relations integer DEFAULT 12, p_history integer DEFAULT 15, p_siblings integer DEFAULT 8"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "record_search_sql"; readonly args: "p_organization_id uuid, p_table_id uuid, p_search text, p_alias text DEFAULT 'r'::text, p_time_zone text DEFAULT NULL::text"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "record_source_key"; readonly args: "p_table_id uuid"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "record_source_keys"; readonly args: "p_table_id uuid"; readonly returns: "text[]"; readonly security: "invoker"; }, { readonly name: "record_source_table"; readonly args: "p_key text"; readonly returns: "uuid"; readonly security: "invoker"; }, { readonly name: "record_stage_pending"; readonly args: "p_organization_id uuid, p_record_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "record_state_as_of"; readonly args: "p_record_id uuid, p_at timestamp with time zone"; readonly returns: "TABLE(state jsonb, replayed boolean)"; readonly security: "definer"; }, { readonly name: "record_table"; readonly args: "p_organization_id uuid, p_record_id uuid"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "record_triggers"; readonly args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid"; readonly returns: "TABLE(trigger_id uuid, name text, definition_id uuid, definition_name text, table_id uuid, event text, operations jsonb, field_ids jsonb, via jsonb, is_active boolean, last_fired_at timestamp with time zone, fire_count integer, updated_at timestamp with time zone)"; readonly security: "definer"; }, { readonly name: "record_update"; readonly args: "p_organization_id uuid, p_record_id uuid, p_patch jsonb, p_expected_version integer DEFAULT NULL::integer"; readonly returns: "integer"; readonly security: "definer"; }, { readonly name: "record_update_adding_choices"; readonly args: "p_organization_id uuid, p_record_id uuid, p_patch jsonb, p_add jsonb, p_expected_version integer DEFAULT NULL::integer"; readonly returns: "integer"; readonly security: "definer"; }, { readonly name: "record_upsert"; readonly args: "p_organization_id uuid, p_table_id uuid, p_key text[], p_data jsonb, p_expected_version integer DEFAULT NULL::integer"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "record_value_one"; readonly args: "p_organization_id uuid, p_record_id uuid, p_key text"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "record_values"; readonly args: "p_organization_id uuid, p_record_id uuid"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "record_values_of"; readonly args: "p_row custom.record"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "record_values_step"; readonly args: "p_row custom.record, p_cache jsonb DEFAULT '{}'::jsonb, OUT o_doc jsonb, OUT o_cache jsonb"; readonly returns: "record"; readonly security: "invoker"; }, { readonly name: "record_values_versioned"; readonly args: "p_organization_id uuid, p_record_id uuid"; readonly returns: "TABLE(field_key text, field_id uuid, value jsonb, value_version integer, source jsonb, absent_reason text, actor text, on_behalf_of text, written_at timestamp with time zone, alternates jsonb)"; readonly security: "definer"; }, { readonly name: "record_words"; readonly args: "p_organization_id uuid, p_record_id uuid, p_noun text DEFAULT NULL::text"; readonly returns: "text"; readonly security: "definer"; }, { readonly name: "record_write"; readonly args: "p_organization_id uuid, p_table_id uuid, p_data jsonb"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "record_write_graph"; readonly args: "p_organization_id uuid, p_table_id uuid, p_parent jsonb, p_edges jsonb DEFAULT '[]'::jsonb, p_children jsonb DEFAULT '[]'::jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "record_write_graph_superseding"; readonly args: "p_organization_id uuid, p_table_id uuid, p_lock_key text, p_idempotence jsonb DEFAULT NULL::jsonb, p_parent jsonb DEFAULT NULL::jsonb, p_edges jsonb DEFAULT '[]'::jsonb, p_children jsonb DEFAULT '[]'::jsonb, p_chain jsonb DEFAULT '{\"mode\": \"first\"}'::jsonb, p_rows_state jsonb DEFAULT NULL::jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "record_write_many"; readonly args: "p_organization_id uuid, p_table_id uuid, p_rows jsonb[], p_ids uuid[] DEFAULT NULL::uuid[]"; readonly returns: "uuid[]"; readonly security: "definer"; }, { readonly name: "records_limits"; readonly args: "p_organization_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "records_search"; readonly args: "p_search text, p_limit integer DEFAULT 50, p_offset integer DEFAULT 0, p_table_ids uuid[] DEFAULT NULL::uuid[], p_organization_ids uuid[] DEFAULT NULL::uuid[], p_include_platform_tables boolean DEFAULT false"; readonly returns: "TABLE(record_id uuid, table_id uuid, table_name text, name text, organization_id uuid, updated_at timestamp with time zone)"; readonly security: "definer"; }, { readonly name: "refusals_claiming_a_level_never_asked"; readonly args: ""; readonly returns: "TABLE(function_name text, identity_args text, why text)"; readonly security: "invoker"; }, { readonly name: "relation_carry"; readonly args: "p_organization_id uuid, p_container_id uuid, p_item_id uuid"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "relation_edges_withdraw"; readonly args: "p_organization_id uuid, p_field_ids uuid[], p_why text"; readonly returns: "integer"; readonly security: "definer"; }, { readonly name: "relation_halves_disagreements"; readonly args: "p_organization_id uuid DEFAULT NULL::uuid, p_record_id uuid DEFAULT NULL::uuid"; readonly returns: "TABLE(organization_id uuid, record_id uuid, field_key text, field_id uuid, target_id uuid, direction text, remedy text, why text)"; readonly security: "definer"; }, { readonly name: "relation_halves_repair"; readonly args: "p_organization_id uuid, p_record_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "relation_kernel_record"; readonly args: "p_organization_id uuid, p_kernel_table_id uuid, p_id uuid"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "relation_name_key"; readonly args: "p_text text"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "relation_names_match"; readonly args: "p_organization_id uuid, p_table_id uuid, p_names text[]"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "relation_own"; readonly args: "p_organization_id uuid, p_owner_id uuid, p_target_id uuid"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "relation_restore"; readonly args: "p_organization_id uuid, p_relation_id uuid"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "relation_reverse_field"; readonly args: "p_organization_id uuid, p_field_id uuid, p_label text DEFAULT NULL::text"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "relation_reverse_set"; readonly args: "p_organization_id uuid, p_record_id uuid, p_field_id uuid, p_add uuid[] DEFAULT '{}'::uuid[], p_remove uuid[] DEFAULT '{}'::uuid[]"; readonly returns: "integer"; readonly security: "definer"; }, { readonly name: "relation_target_card"; readonly args: "p_organization_id uuid, p_record_id uuid, p_via_key text DEFAULT NULL::text"; readonly returns: "TABLE(target_id uuid, target_organization_id uuid, is_foreign boolean, masked boolean, reader_level permission_level, card jsonb, why text)"; readonly security: "definer"; }, { readonly name: "relation_target_external"; readonly args: "p_connection_token text, p_external_table text, p_external_key text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "relation_target_ours"; readonly args: "p_entity_token text, p_row_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "relation_targets"; readonly args: "p_organization_id uuid, p_record_id uuid, p_via_key text"; readonly returns: "SETOF uuid"; readonly security: "definer"; }, { readonly name: "relation_uncarry"; readonly args: "p_organization_id uuid, p_container_id uuid, p_item_id uuid"; readonly returns: "integer"; readonly security: "definer"; }, { readonly name: "relation_value_target_ok"; readonly args: "p_organization_id uuid, p_field_id uuid, p_field_data jsonb, p_target_id uuid"; readonly returns: "boolean"; readonly security: "invoker"; }, { readonly name: "relation_words"; readonly args: "p_organization_id uuid, p_field_id uuid, p_value text"; readonly returns: "text"; readonly security: "definer"; }, { readonly name: "relation_words_many"; readonly args: "p_organization_id uuid, p_field_id uuid, p_record_ids uuid[]"; readonly returns: "TABLE(record_id uuid, words text, archived boolean)"; readonly security: "definer"; }, { readonly name: "relation_words_with_icons_many"; readonly args: "p_organization_id uuid, p_field_id uuid, p_record_ids uuid[]"; readonly returns: "TABLE(record_id uuid, words text, archived boolean, icon text, table_icon text)"; readonly security: "definer"; }, { readonly name: "relative_window_for_reader"; readonly args: "p_window jsonb, p_organization_id uuid, p_instants boolean DEFAULT false"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "relative_window_resolve"; readonly args: "p_window jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "reopen_declared_doors"; readonly args: ""; readonly returns: "TABLE(reopened text)"; readonly security: "definer"; }, { readonly name: "required_epoch"; readonly args: "p_container_type text, p_container_id uuid, p_item_type text, p_item_id uuid"; readonly returns: "bigint"; readonly security: "definer"; }, { readonly name: "resolve_context"; readonly args: "p_entity_type text, p_entity_id uuid, p_record_ids uuid[] DEFAULT NULL::uuid[], p_table_ids uuid[] DEFAULT NULL::uuid[], p_system_item_refs text[] DEFAULT NULL::text[]"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "resolve_first_match"; readonly args: "p_organization_id uuid, p_record_id uuid"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "resolve_id"; readonly args: "p_organization_id uuid, p_id uuid"; readonly returns: "uuid"; readonly security: "invoker"; }, { readonly name: "retired_actor_words"; readonly args: ""; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "reverse_columns"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "TABLE(key text, label text, source_field_id uuid, source_field_key text, source_field_label text, source_table_id uuid, source_table_name text, cardinality text, read_only boolean)"; readonly security: "definer"; }, { readonly name: "reverse_links_many"; readonly args: "p_organization_id uuid, p_table_id uuid, p_field_id uuid, p_record_ids uuid[], p_limit integer DEFAULT 10, p_offset integer DEFAULT 0"; readonly returns: "TABLE(record_id uuid, total integer, links jsonb)"; readonly security: "definer"; }, { readonly name: "reverse_links_many_fields"; readonly args: "p_organization_id uuid, p_table_id uuid, p_field_ids uuid[], p_record_ids uuid[], p_limit integer DEFAULT 10, p_offset integer DEFAULT 0"; readonly returns: "TABLE(field_id uuid, record_id uuid, total integer, links jsonb)"; readonly security: "invoker"; }, { readonly name: "revoke_view_share_link"; readonly args: "p_link_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "rollup_value"; readonly args: "p_organization_id uuid, p_record_id uuid, p_field_data jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "row_actions"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "row_sits_in_a_personal_table"; readonly args: "p_type text, p_organization_id uuid, p_id uuid"; readonly returns: "boolean"; readonly security: "invoker"; }, { readonly name: "row_template_bodies"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "TABLE(template_id uuid, body jsonb)"; readonly security: "definer"; }, { readonly name: "row_template_declare"; readonly args: "p_organization_id uuid, p_table_id uuid, p_spec jsonb"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "row_template_default"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "TABLE(template_id uuid, name text, \"values\" jsonb, body jsonb)"; readonly security: "definer"; }, { readonly name: "row_templates"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "TABLE(template_id uuid, name text, table_id uuid, \"values\" jsonb, created_at timestamp with time zone, updated_at timestamp with time zone)"; readonly security: "definer"; }, { readonly name: "rule_applies"; readonly args: "p_organization_id uuid, p_rule_id uuid, p_record_id uuid"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "rule_context"; readonly args: "p_organization_id uuid, p_record_id uuid"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "rule_declare"; readonly args: "p_organization_id uuid, p_spec jsonb, p_rule_id uuid DEFAULT NULL::uuid"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "rule_dependency_edges"; readonly args: "p_organization_id uuid, p_row custom.record DEFAULT NULL::custom.record"; readonly returns: "TABLE(needs text, needed text)"; readonly security: "invoker"; }, { readonly name: "rule_eval"; readonly args: "p_organization_id uuid, p_expr jsonb, p_values jsonb, p_context jsonb DEFAULT '{}'::jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "rule_field_key"; readonly args: "p_organization_id uuid, p_field_id uuid"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "rule_field_label"; readonly args: "p_organization_id uuid, p_field_id uuid"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "rule_filter_node_sql"; readonly args: "p_organization_id uuid, p_table_id uuid, p_node jsonb, p_map jsonb, p_visible text[]"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "rule_filter_skip_withheld"; readonly args: "p_organization_id uuid, p_table_id uuid, p_node jsonb, p_visible text[]"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "rule_is_me"; readonly args: "p_op text, p_a jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "rule_is_me"; readonly args: "p_op text, p_a jsonb, p_organization_id uuid"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "rule_kernel_id"; readonly args: ""; readonly returns: "uuid"; readonly security: "invoker"; }, { readonly name: "rule_members"; readonly args: "p_organization_id uuid, p_rule_id uuid"; readonly returns: "SETOF custom.record"; readonly security: "invoker"; }, { readonly name: "rule_members_visible"; readonly args: "p_organization_id uuid, p_rule_id uuid, p_limit integer DEFAULT 200, p_offset integer DEFAULT 0"; readonly returns: "TABLE(id uuid, document jsonb, level permission_level)"; readonly security: "definer"; }, { readonly name: "rule_membership"; readonly args: "p_organization_id uuid, p_rule_id uuid, p_record_id uuid"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "rule_node_kinds"; readonly args: ""; readonly returns: "TABLE(node text, evaluated_by text, note text)"; readonly security: "invoker"; }, { readonly name: "rule_restore"; readonly args: "p_organization_id uuid, p_rule_id uuid"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "rule_run"; readonly args: "p_organization_id uuid, p_rule_id uuid, p_values jsonb, p_context jsonb DEFAULT '{}'::jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "rule_sql_op"; readonly args: "p_op text, p_a jsonb, p_b jsonb DEFAULT NULL::jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "rule_truth"; readonly args: "p_answer jsonb"; readonly returns: "boolean"; readonly security: "invoker"; }, { readonly name: "rule_uses"; readonly args: ""; readonly returns: "text[]"; readonly security: "invoker"; }, { readonly name: "rule_version"; readonly args: "p_organization_id uuid, p_rule_id uuid"; readonly returns: "integer"; readonly security: "invoker"; }, { readonly name: "said"; readonly args: "p_value text, p_when_there_is_none text"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "scope_item_row_of"; readonly args: "p_field custom.record"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "scope_item_value_type"; readonly args: "p_field jsonb, p_carried jsonb"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "scope_items_of"; readonly args: "p_org uuid, p_table uuid"; readonly returns: "SETOF custom.record"; readonly security: "invoker"; }, { readonly name: "scope_member_reaches"; readonly args: "p_user_id uuid, p_record_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level"; readonly returns: "boolean"; readonly security: "invoker"; }, { readonly name: "scope_row_of"; readonly args: "p_rec custom.record"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "scope_rows_of"; readonly args: "p_org uuid, p_types uuid[] DEFAULT NULL::uuid[]"; readonly returns: "TABLE(id uuid, table_id uuid, type_sort integer, sort_order integer, name text, type_doc jsonb, row_doc jsonb)"; readonly security: "invoker"; }, { readonly name: "scope_setting_back"; readonly args: "p_value jsonb, p_behavior text"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "scope_table_provision"; readonly args: "p_organization_id uuid, p_item_id uuid, p_scope_id uuid, p_home_id uuid DEFAULT NULL::uuid"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "scope_type_row_of"; readonly args: "p_table custom.record"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "scope_value_columns"; readonly args: "p_org uuid, p_field jsonb, p_value_type text, p_value jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "seen_among"; readonly args: "p_user_id uuid, p_ids uuid[]"; readonly returns: "uuid[]"; readonly security: "definer"; }, { readonly name: "sensitivity_rank"; readonly args: "p_sensitivity text"; readonly returns: "integer"; readonly security: "invoker"; }, { readonly name: "set_table_confidential"; readonly args: "p_table_id uuid, p_readers jsonb, p_reason text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "set_table_confidential_arman_explicitly_approved"; readonly args: "p_table_id uuid, p_readers jsonb, p_arman_words text, p_approved_on date, p_maker_is_reader boolean DEFAULT NULL::boolean"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "set_table_organization"; readonly args: "p_table_id uuid, p_reason text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "set_view_share_link_copy"; readonly args: "p_link_id uuid, p_restrict boolean"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "set_view_share_link_protection"; readonly args: "p_link_id uuid, p_password text DEFAULT NULL::text, p_change_expiry boolean DEFAULT false, p_expires_at timestamp with time zone DEFAULT NULL::timestamp with time zone"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "share_access"; readonly args: "p_organization_id uuid, p_subject_id uuid"; readonly returns: "TABLE(principal_kind text, principal_id uuid, principal_label text, level permission_level, reason text, reason_detail text, via_type text, via_id uuid, revocable boolean)"; readonly security: "definer"; }, { readonly name: "share_grant"; readonly args: "p_organization_id uuid, p_subject_id uuid, p_principal_kind text, p_principal_id uuid, p_level permission_level DEFAULT 'viewer'::permission_level"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "share_lane_set"; readonly args: "p_organization_id uuid, p_subject_id uuid, p_choice text, p_level permission_level DEFAULT NULL::permission_level"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "share_lanes"; readonly args: ""; readonly returns: "TABLE(choice text, lane text, discoverable boolean, label text, means text)"; readonly security: "definer"; }, { readonly name: "share_levels"; readonly args: ""; readonly returns: "TABLE(level permission_level, ordinal integer, label text, means text)"; readonly security: "definer"; }, { readonly name: "share_lists_row"; readonly args: "p_id uuid"; readonly returns: "boolean"; readonly security: "invoker"; }, { readonly name: "share_people"; readonly args: "p_organization_id uuid, p_subject_id uuid DEFAULT NULL::uuid, p_query text DEFAULT NULL::text, p_limit integer DEFAULT 25"; readonly returns: "TABLE(user_id uuid, email text, display_name text, membership text, already_at permission_level, already_why text)"; readonly security: "definer"; }, { readonly name: "share_revoke"; readonly args: "p_organization_id uuid, p_subject_id uuid, p_principal_kind text, p_principal_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "share_subject_name"; readonly args: "p_organization_id uuid, p_type text, p_id uuid"; readonly returns: "text"; readonly security: "definer"; }, { readonly name: "shared_only_disagreements"; readonly args: "p_pretend text DEFAULT NULL::text"; readonly returns: "TABLE(organization_id uuid, organization_name text, member_id uuid, record_id uuid, table_id uuid, ladder boolean, read_door boolean, rls_mirror boolean, why text)"; readonly security: "invoker"; }, { readonly name: "shared_view_read"; readonly args: "p_token text, p_password text DEFAULT NULL::text, p_unlock text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "shares_outside"; readonly args: "p_organization_id uuid"; readonly returns: "TABLE(invitation_id uuid, table_id uuid, table_name text, email text, level text, level_label text, status text, joined boolean, expired boolean, invited_at timestamp with time zone, expires_at timestamp with time zone, say text)"; readonly security: "definer"; }, { readonly name: "sign_request_sentence"; readonly args: "p_data jsonb"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "sign_request_state"; readonly args: "p_data jsonb"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "sign_requests"; readonly args: "p_organization_id uuid, p_record_id uuid"; readonly returns: "TABLE(request_id uuid, render_id uuid, record_id uuid, field_key text, document_title text, signer_name text, signer_email text, signer_has_account boolean, state text, sentence text, document_version integer, document_hash text, sent_at timestamp with time zone, expires_at timestamp with time zone, viewed_at timestamp with time zone, signed_at timestamp with time zone, declined_at timestamp with time zone, invalidated_at timestamp with time zone, signature_id uuid, signature_mark text, reminder_count integer)"; readonly security: "definer"; }, { readonly name: "silent_page_doors"; readonly args: ""; readonly returns: "TABLE(door text, why text)"; readonly security: "definer"; }, { readonly name: "size_refusal"; readonly args: "p_organization_id uuid, p_data jsonb"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "source_next_pointer"; readonly args: "p_sources jsonb"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "source_pointer"; readonly args: "p_sources jsonb, p_source jsonb"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "space_templates"; readonly args: "p_filter jsonb DEFAULT '{}'::jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "stage_rule_enforcement"; readonly args: "p_organization_id uuid"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "stage_rule_on_fail_kinds"; readonly args: ""; readonly returns: "TABLE(behaviour text, note text)"; readonly security: "invoker"; }, { readonly name: "stamp_value_envelopes"; readonly args: "p_data jsonb, p_actor text, p_on_behalf_of text, p_at timestamp with time zone"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "status_groups_keyed"; readonly args: "p_organization_id uuid, p_options_table_id uuid, p_groups jsonb, p_kept jsonb, p_label text"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "status_groups_of"; readonly args: "p_groups jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "storage_modes"; readonly args: ""; readonly returns: "text[]"; readonly security: "invoker"; }, { readonly name: "store_census_pair_ceiling"; readonly args: ""; readonly returns: "integer"; readonly security: "invoker"; }, { readonly name: "store_field_part"; readonly args: "p_field_data jsonb"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "store_is_open"; readonly args: "p_organization_id uuid DEFAULT NULL::uuid"; readonly returns: "boolean"; readonly security: "invoker"; }, { readonly name: "store_off_sentence"; readonly args: "p_organization_id uuid"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "store_part_notice"; readonly args: "p_field custom.record, p_action text DEFAULT 'read'::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "store_part_who"; readonly args: "p_cells jsonb, p_action text DEFAULT 'read'::text"; readonly returns: "text"; readonly security: "definer"; }, { readonly name: "store_row_visible"; readonly args: "p_person uuid, p_table uuid, p_row custom.record, p_visible text[]"; readonly returns: "text[]"; readonly security: "definer"; }, { readonly name: "store_row_visible_with"; readonly args: "p_reveals jsonb, p_person uuid, p_row custom.record, p_visible text[]"; readonly returns: "text[]"; readonly security: "definer"; }, { readonly name: "store_seat_fallback"; readonly args: "p_org uuid"; readonly returns: "SETOF uuid"; readonly security: "definer"; }, { readonly name: "store_seat_has"; readonly args: "p_person uuid, p_record uuid, p_seat jsonb"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "store_seat_holders"; readonly args: "p_record uuid, p_seat jsonb"; readonly returns: "TABLE(user_id uuid, source text)"; readonly security: "definer"; }, { readonly name: "store_seat_invalid"; readonly args: "p_seat jsonb"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "store_seat_records"; readonly args: "p_person uuid, p_table uuid, p_seat jsonb"; readonly returns: "SETOF uuid"; readonly security: "definer"; }, { readonly name: "subscription_cadences"; readonly args: "p_organization_id uuid"; readonly returns: "text[]"; readonly security: "definer"; }, { readonly name: "subscription_declare"; readonly args: "p_organization_id uuid, p_table_id uuid, p_spec jsonb"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "subscription_mute"; readonly args: "p_organization_id uuid, p_rule_id uuid, p_muted boolean DEFAULT true"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "subscription_preview"; readonly args: "p_organization_id uuid, p_rule_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "subscriptions"; readonly args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid"; readonly returns: "TABLE(rule_id uuid, name text, table_id uuid, saved_view_id uuid, cadence text, schedule text, quiet_hours jsonb, channel text, recipient_user_id uuid, event_key text, muted boolean, mine boolean, i_may_mute boolean, last_sent_at timestamp with time zone, next_digest_at timestamp with time zone)"; readonly security: "definer"; }, { readonly name: "synced_source_archive_log"; readonly args: "p_id uuid, p_job text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "synced_source_archive_log_add"; readonly args: "p_id uuid, p_job text, p_entry jsonb, p_now timestamp with time zone DEFAULT now()"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "synced_source_by_ref"; readonly args: "p_organization_id uuid, p_source_kinds text[], p_source_ref text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "synced_source_finish"; readonly args: "p_id uuid, p_cursor jsonb, p_synced_at timestamp with time zone, p_report jsonb, p_mapping jsonb, p_run_id uuid"; readonly returns: "void"; readonly security: "definer"; }, { readonly name: "synced_source_read"; readonly args: "p_organization_id uuid, p_source_kind text, p_target uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "synced_source_save"; readonly args: "p_organization_id uuid, p_source_kind text, p_source_ref text, p_title text, p_target uuid, p_owner uuid, p_connector jsonb, p_actor uuid"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "synced_sources_for"; readonly args: "p_source_ref text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_access_setup"; readonly args: "p_table_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_access_setup_preview"; readonly args: "p_table_id uuid, p_setup jsonb, p_moves jsonb DEFAULT '{}'::jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_access_setup_revert"; readonly args: "p_table_id uuid, p_audit_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_access_setup_set"; readonly args: "p_table_id uuid, p_setup jsonb, p_moves jsonb DEFAULT '{}'::jsonb, p_reason text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_add_rung"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "permission_level"; readonly security: "invoker"; }, { readonly name: "table_agent_writable_set"; readonly args: "p_organization_id uuid, p_table_id uuid, p_agent_writable boolean"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_archive"; readonly args: "p_organization_id uuid, p_table_id uuid, p_chunk integer DEFAULT 50, p_include_table boolean DEFAULT true"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_archive_deliberately"; readonly args: "p_organization_id uuid, p_table_id uuid, p_typed_slug text, p_reason text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_capacity"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_carries_its_rows"; readonly args: "p_user_id uuid, p_table_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "table_column_source"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "table_contents"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "TABLE(record_id uuid, kind text, goes_at integer)"; readonly security: "invoker"; }, { readonly name: "table_copies_in_progress"; readonly args: ""; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_copy_sync"; readonly args: "p_organization_id uuid, p_spec jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_create"; readonly args: "p_organization_id uuid, p_spec jsonb, p_fields jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "table_declare"; readonly args: "p_organization_id uuid, p_spec jsonb"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "table_decorate"; readonly args: "p_organization_id uuid, p_table_id uuid, p_path text[], p_value jsonb DEFAULT NULL::jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_decorations"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_dimensions"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_dimensions_set"; readonly args: "p_organization_id uuid, p_table_id uuid, p_overrides jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_duplicate"; readonly args: "p_table_id uuid, p_with_records boolean DEFAULT false, p_name text DEFAULT NULL::text, p_organization_id uuid DEFAULT NULL::uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_duplicate_continue"; readonly args: "p_table_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_ensure"; readonly args: "p_organization_id uuid, p_spec jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_facts"; readonly args: "p_organization_id uuid DEFAULT NULL::uuid"; readonly returns: "TABLE(table_id uuid, visibility text, mine boolean, platform_owned boolean, kept_for text, offered_as_context boolean, keeper_group text, keeper_says text, used_in_kind text, used_in_id uuid, used_in_table_id uuid, foundation boolean)"; readonly security: "definer"; }, { readonly name: "table_find"; readonly args: "p_organization_id uuid, p_slug text DEFAULT NULL::text, p_name text DEFAULT NULL::text, p_kept_for text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_find_many"; readonly args: "p_organization_ids uuid[], p_slug text, p_kept_for text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_from_example"; readonly args: "p_organization_id uuid, p_home_id uuid, p_example jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_has_a_visible_record"; readonly args: "p_user uuid, p_organization_id uuid, p_table_id uuid"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "table_home"; readonly args: "p_table_id uuid, p_to_organization_id uuid DEFAULT NULL::uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_homes_named"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "TABLE(home_id uuid, name text, declared boolean)"; readonly security: "definer"; }, { readonly name: "table_is_foundation"; readonly args: "p_data jsonb"; readonly returns: "boolean"; readonly security: "invoker"; }, { readonly name: "table_is_live"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "boolean"; readonly security: "invoker"; }, { readonly name: "table_is_options_table"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "boolean"; readonly security: "invoker"; }, { readonly name: "table_is_platform_context"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "boolean"; readonly security: "invoker"; }, { readonly name: "table_kept_for_derived"; readonly args: "p_data jsonb, p_is_kernel boolean, p_is_options boolean"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "table_kept_out_of_lists"; readonly args: "p_kept_for text"; readonly returns: "boolean"; readonly security: "invoker"; }, { readonly name: "table_kernel_id"; readonly args: ""; readonly returns: "uuid"; readonly security: "invoker"; }, { readonly name: "table_kind_facts"; readonly args: "p_table_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_level_facts"; readonly args: "p_table_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_list_everywhere"; readonly args: "p_organization_id uuid DEFAULT NULL::uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_list_everywhere"; readonly args: "p_organization_id uuid, p_include_platform_tables boolean"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "table_map_fields"; readonly args: "p_organization_id uuid, p_table_ids uuid[]"; readonly returns: "TABLE(table_id uuid, field_key text, field_label text, field_type text, relation_target uuid, inverse_key text, field_sort numeric, is_link boolean)"; readonly security: "definer"; }, { readonly name: "table_move"; readonly args: "p_table_id uuid, p_to_organization_id uuid, p_expected_version integer DEFAULT NULL::integer"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_page_bundle"; readonly args: "p_organization_id uuid, p_table_id uuid, p_view_id uuid DEFAULT NULL::uuid"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "table_placement"; readonly args: "p_organization_id uuid, p_table_id uuid, p_data jsonb, p_is_kernel boolean DEFAULT false"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "table_record_ceiling"; readonly args: ""; readonly returns: "integer"; readonly security: "invoker"; }, { readonly name: "table_record_ceiling"; readonly args: "p_organization_id uuid"; readonly returns: "integer"; readonly security: "invoker"; }, { readonly name: "table_restore"; readonly args: "p_organization_id uuid, p_table_id uuid, p_chunk integer DEFAULT 20"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_row_counts"; readonly args: "p_organization_id uuid, p_table_ids uuid[]"; readonly returns: "TABLE(table_id uuid, visible_rows bigint)"; readonly security: "definer"; }, { readonly name: "table_row_defaults"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_row_defaults_apply"; readonly args: "p_organization_id uuid, p_table_id uuid, p_after uuid DEFAULT NULL::uuid, p_budget_ms integer DEFAULT 4000"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_row_defaults_set"; readonly args: "p_organization_id uuid, p_table_id uuid, p_defaults jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_row_label"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_row_label_set"; readonly args: "p_organization_id uuid, p_table_id uuid, p_formula text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_rules"; readonly args: "p_organization_id uuid, p_table_id uuid, p_use text, p_record_type text DEFAULT NULL::text"; readonly returns: "SETOF custom.record"; readonly security: "invoker"; }, { readonly name: "table_share_outside"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_share_outside_accept"; readonly args: "p_token text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_share_outside_for_me"; readonly args: ""; readonly returns: "TABLE(invitation_id uuid, organization_id uuid, organization text, table_id uuid, table_name text, level text, level_label text, token text, expires_at timestamp with time zone, say text)"; readonly security: "definer"; }, { readonly name: "table_share_outside_grant"; readonly args: "p_organization_id uuid, p_table_id uuid, p_person text, p_level permission_level DEFAULT 'viewer'::permission_level"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_share_outside_invite"; readonly args: "p_organization_id uuid, p_table_id uuid, p_email text, p_level permission_level DEFAULT 'viewer'::permission_level"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_share_outside_resend"; readonly args: "p_organization_id uuid, p_invitation_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_share_outside_revoke"; readonly args: "p_organization_id uuid, p_invitation_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_stage_field"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "text"; readonly security: "definer"; }, { readonly name: "table_storage"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "table_sync"; readonly args: "p_organization_id uuid, p_home_id uuid, p_spec jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_sync_cell"; readonly args: "p_organization_id uuid, p_record_id uuid, p_key text, p_land jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_sync_due_tick"; readonly args: ""; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_sync_settings_set"; readonly args: "p_organization_id uuid, p_table_id uuid, p_settings jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_template_declare"; readonly args: "p_org_id uuid, p_name text, p_description text, p_fields jsonb"; readonly returns: "uuid"; readonly security: "invoker"; }, { readonly name: "table_templates"; readonly args: "p_org_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_transfer_owner"; readonly args: "p_table_id uuid, p_to_person uuid, p_reason text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_type_field"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "text"; readonly security: "definer"; }, { readonly name: "table_unique_rule_fields"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "table_webhook_archive"; readonly args: "p_organization_id uuid, p_webhook_id uuid"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "table_webhook_declare"; readonly args: "p_organization_id uuid, p_table_id uuid, p_target_url text, p_events text[] DEFAULT NULL::text[], p_description text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "table_webhooks"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "TABLE(webhook_id uuid, target_url text, description text, events text[], is_active boolean, last_attempt_at timestamp with time zone, last_success_at timestamp with time zone, consecutive_failures integer, owner_id uuid, created_at timestamp with time zone)"; readonly security: "definer"; }, { readonly name: "table_work_kind"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "tables_at_home"; readonly args: "p_organization_id uuid, p_home_ids uuid[]"; readonly returns: "TABLE(table_id uuid, home_record_id uuid, kind text)"; readonly security: "definer"; }, { readonly name: "tables_described_without_asking"; readonly args: ""; readonly returns: "TABLE(function_name text, identity_args text, why text)"; readonly security: "invoker"; }, { readonly name: "tables_i_can_open"; readonly args: ""; readonly returns: "TABLE(table_id uuid, table_name text, organization_id uuid, organization_name text, member boolean, visibility text, updated_at timestamp with time zone)"; readonly security: "definer"; }, { readonly name: "tables_listed_among"; readonly args: "p_organization_id uuid, p_tables uuid[]"; readonly returns: "SETOF uuid"; readonly security: "invoker"; }, { readonly name: "tables_seen_among"; readonly args: "p_user_id uuid, p_organization_ids uuid[], p_among uuid[]"; readonly returns: "TABLE(organization_id uuid, id uuid, seen boolean)"; readonly security: "definer"; }, { readonly name: "tables_seen_once_per_group"; readonly args: "p_user_id uuid, p_organization_ids uuid[]"; readonly returns: "TABLE(organization_id uuid, id uuid, seen boolean)"; readonly security: "definer"; }, { readonly name: "tables_shared_with_me"; readonly args: ""; readonly returns: "TABLE(table_id uuid, organization_id uuid, organization text, table_name text, level text, level_label text, shared_at timestamp with time zone, opens boolean, say text)"; readonly security: "definer"; }, { readonly name: "template_archive"; readonly args: "p_template_id uuid, p_restore boolean DEFAULT false"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "template_declare"; readonly args: "p_scope text, p_spec jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "template_from_tables"; readonly args: "p_organization_id uuid, p_table_ids uuid[], p_include_rows boolean DEFAULT false, p_rows_per_table integer DEFAULT 25"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "template_install"; readonly args: "p_organization_id uuid, p_template_id uuid, p_budget_ms integer DEFAULT 4000"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "template_install_claim"; readonly args: "p_organization_id uuid, p_install_id uuid, p_kind text, p_label text, p_source_id uuid DEFAULT NULL::uuid, p_lease_seconds integer DEFAULT NULL::integer"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "template_install_fresh"; readonly args: "p_organization_id uuid, p_template_id uuid, p_title text DEFAULT NULL::text, p_install_id uuid DEFAULT NULL::uuid, p_budget_ms integer DEFAULT 4000"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "template_install_note"; readonly args: "p_organization_id uuid, p_install_id uuid, p_kind text, p_id uuid, p_label text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "template_instance_of_page"; readonly args: "p_organization_id uuid, p_page_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "template_instances"; readonly args: "p_organization_id uuid, p_catalogue_id text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "template_keep"; readonly args: "p_template_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "template_restore"; readonly args: "p_organization_id uuid, p_install_id uuid, p_budget_ms integer DEFAULT 4000"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "template_uninstall"; readonly args: "p_organization_id uuid, p_install_id uuid, p_budget_ms integer DEFAULT 4000"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "template_upgrade"; readonly args: "p_organization_id uuid, p_install_id uuid, p_template_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "templates"; readonly args: "p_filter jsonb DEFAULT '{}'::jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "text_head_bytes"; readonly args: "p_text text, p_bytes bigint"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "timeline_dependency_shift"; readonly args: "p_organization_id uuid"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "trg_associations_bump_visibility"; readonly args: ""; readonly returns: "trigger"; readonly security: "definer"; }, { readonly name: "undeclared_keys"; readonly args: "p_organization_id uuid, p_table_id uuid, p_data jsonb"; readonly returns: "text[]"; readonly security: "invoker"; }, { readonly name: "unmatched_people_resolve"; readonly args: "p_organization_id uuid, p_user_id uuid"; readonly returns: "integer"; readonly security: "definer"; }, { readonly name: "unresolved_sources_of"; readonly args: "p_sources jsonb, p_visible text[], p_by_id boolean DEFAULT false, p_key_ids jsonb DEFAULT '{}'::jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "validate_custom_fields"; readonly args: "p_token text, p_organization_id uuid, p_values jsonb"; readonly returns: "void"; readonly security: "invoker"; }, { readonly name: "validate_value_envelope"; readonly args: "p_organization_id uuid, p_fields custom.record[], p_data jsonb"; readonly returns: "void"; readonly security: "invoker"; }, { readonly name: "validate_values"; readonly args: "p_organization_id uuid, p_fields custom.record[], p_values jsonb, p_record_type text DEFAULT NULL::text"; readonly returns: "void"; readonly security: "invoker"; }, { readonly name: "value_alternate_keys"; readonly args: ""; readonly returns: "text[]"; readonly security: "invoker"; }, { readonly name: "value_envelope_keys"; readonly args: ""; readonly returns: "text[]"; readonly security: "invoker"; }, { readonly name: "value_envelope_ok"; readonly args: "p_data jsonb"; readonly returns: "boolean"; readonly security: "invoker"; }, { readonly name: "value_envelope_refusal"; readonly args: "p_data jsonb"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "value_read"; readonly args: "p_organization_id uuid, p_record_id uuid, p_key text"; readonly returns: "TABLE(field_key text, field_id uuid, value jsonb, value_version integer, source jsonb, absent_reason text, actor text, on_behalf_of text, written_at timestamp with time zone, alternates jsonb)"; readonly security: "definer"; }, { readonly name: "value_restore"; readonly args: "p_organization_id uuid, p_record_id uuid, p_field_key text, p_version integer"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "value_restore"; readonly args: "p_organization_id uuid, p_record_id uuid, p_field_key text, p_version integer, p_author jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "value_versions"; readonly args: "p_old jsonb, p_new jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "view_declare"; readonly args: "p_organization_id uuid, p_table_id uuid, p_spec jsonb"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "view_designate"; readonly args: "p_organization_id uuid, p_table_id uuid, p_view_id uuid, p_layout text DEFAULT NULL::text"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "view_keys"; readonly args: ""; readonly returns: "TABLE(path text, shape text, layouts text[], writer text, sentence text)"; readonly security: "invoker"; }, { readonly name: "view_keys_check"; readonly args: "p_organization_id uuid, p_table_id uuid, p_set jsonb, p_old jsonb DEFAULT '{}'::jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "view_look_read"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "view_look_set"; readonly args: "p_organization_id uuid, p_table_id uuid, p_view_id uuid, p_look jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "view_record_order_set"; readonly args: "p_organization_id uuid, p_view_id uuid, p_record_ids uuid[]"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "view_share_links"; readonly args: "p_view_id uuid"; readonly returns: "TABLE(id uuid, token text, permission_level text, label text, expires_at timestamp with time zone, use_count integer, last_used_at timestamp with time zone, created_at timestamp with time zone, created_by uuid, created_by_name text, made_by_me boolean, has_password boolean, restrict_copy boolean)"; readonly security: "definer"; }, { readonly name: "views"; readonly args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid"; readonly returns: "TABLE(view_id uuid, name text, table_id uuid, filters jsonb, definition jsonb, created_at timestamp with time zone)"; readonly security: "definer"; }, { readonly name: "visibility_ancestors"; readonly args: "p_item_type text, p_item_id uuid"; readonly returns: "TABLE(container_type text, container_id uuid, depth integer, max_level permission_level)"; readonly security: "definer"; }, { readonly name: "visibility_as_of"; readonly args: "p_organization_id uuid, p_record_id uuid, p_at timestamp with time zone"; readonly returns: "TABLE(principal_kind text, principal_id uuid, level permission_level, through_kind text, through_id uuid, reason text, replayed boolean, held_from timestamp with time zone, held_to timestamp with time zone)"; readonly security: "definer"; }, { readonly name: "visibility_cache_rebuild"; readonly args: ""; readonly returns: "integer"; readonly security: "definer"; }, { readonly name: "visibility_parity"; readonly args: ""; readonly returns: "TABLE(side text, container_type text, container_id uuid, item_type text, item_id uuid, stored_level permission_level, derived_level permission_level, reason text)"; readonly security: "definer"; }, { readonly name: "visibility_warm"; readonly args: "p_container_type text, p_container_id uuid"; readonly returns: "integer"; readonly security: "definer"; }, { readonly name: "visible_predicate_sql"; readonly args: "p_user uuid, p_organization_id uuid, p_table_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level, p_alias text DEFAULT 'r'::text"; readonly returns: "text"; readonly security: "definer"; }, { readonly name: "visible_record_ids"; readonly args: "p_user_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level"; readonly returns: "TABLE(id uuid)"; readonly security: "definer"; }, { readonly name: "visible_set"; readonly args: "p_user uuid, p_organization_id uuid, p_table_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level, OUT o_all_visible boolean, OUT o_true_visibility platform.visibility[], OUT o_granted_all uuid[], OUT o_granted_visible uuid[], OUT o_carried_visible uuid[], OUT o_ladder_calls integer, OUT o_fallback boolean, OUT o_note text"; readonly returns: "record"; readonly security: "definer"; }, { readonly name: "where_id_opens"; readonly args: "p_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "where_lists_live"; readonly args: "p_list_ids uuid[]"; readonly returns: "TABLE(list_id uuid, lives_in text, address text, why text)"; readonly security: "definer"; }, { readonly name: "where_tables_live"; readonly args: "p_table_ids uuid[]"; readonly returns: "TABLE(table_id uuid, lives_in text, why text)"; readonly security: "definer"; }, { readonly name: "who_could_see_on"; readonly args: "p_record_id uuid, p_at timestamp with time zone"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "whole_value_ceiling"; readonly args: "p_organization_id uuid"; readonly returns: "bigint"; readonly security: "invoker"; }, { readonly name: "whole_value_complete"; readonly args: "p_organization_id uuid, p_record_id uuid, p_field_key text, p_file_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "whole_value_head"; readonly args: "p_text text"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "whole_value_park"; readonly args: "p_organization_id uuid, p_table_id uuid, p_record_id uuid, p_owner_id uuid, p_visibility platform.visibility, p_data jsonb, p_park jsonb"; readonly returns: "void"; readonly security: "invoker"; }, { readonly name: "whole_value_pointer_of"; readonly args: "p_values jsonb, p_sources jsonb, p_key text"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "whole_value_source"; readonly args: "p_text text, p_writer_src jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "whole_values_waiting"; readonly args: "p_organization_id uuid, p_record_ids uuid[]"; readonly returns: "TABLE(record_id uuid, field_key text, pointer text, value_version integer, sha256 text, bytes bigint, chars bigint, owner_id uuid, record_visibility text, table_id uuid, table_name text)"; readonly security: "definer"; }, { readonly name: "widget_kernel_id"; readonly args: ""; readonly returns: "uuid"; readonly security: "invoker"; }, { readonly name: "with_retired"; readonly args: "p_doc jsonb, p_retired jsonb, p_visible text[], p_declared text[]"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "with_whole_value_pointers"; readonly args: "p_document jsonb, p_values jsonb, p_sources jsonb, p_visible text[], p_by_id boolean DEFAULT false, p_key_ids jsonb DEFAULT '{}'::jsonb"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "withheld_marker"; readonly args: "p_mask jsonb, p_key text"; readonly returns: "jsonb"; readonly security: "invoker"; }, { readonly name: "withheld_sentence"; readonly args: "p_mask jsonb, p_key text"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "work_approval_approvers"; readonly args: "p_organization_id uuid, p_subject_id uuid, p_approver_id uuid DEFAULT NULL::uuid"; readonly returns: "TABLE(user_id uuid, name text, why text)"; readonly security: "definer"; }, { readonly name: "work_approval_decide"; readonly args: "p_organization_id uuid, p_approval_id uuid, p_approve boolean, p_note text DEFAULT NULL::text"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "work_approval_host_run"; readonly args: "p_organization_id uuid, p_fingerprint text, p_conversation_id uuid DEFAULT NULL::uuid, p_approval_id uuid DEFAULT NULL::uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "work_approval_host_run_done"; readonly args: "p_organization_id uuid, p_approval_id uuid, p_ok boolean, p_outcome text, p_report jsonb DEFAULT NULL::jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "work_approval_is_approver"; readonly args: "p_organization_id uuid, p_subject_id uuid, p_approver_id uuid, p_user_id uuid"; readonly returns: "boolean"; readonly security: "invoker"; }, { readonly name: "work_approval_kinds"; readonly args: ""; readonly returns: "text[]"; readonly security: "invoker"; }, { readonly name: "work_approval_may_decide"; readonly args: "p_organization_id uuid, p_approval_id uuid"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "work_approval_read"; readonly args: "p_organization_id uuid, p_approval_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "work_approval_request"; readonly args: "p_organization_id uuid, p_subject_id uuid, p_change jsonb, p_note text DEFAULT NULL::text, p_approver_id uuid DEFAULT NULL::uuid, p_origin text DEFAULT 'person'::text, p_conversation_id uuid DEFAULT NULL::uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "work_approval_withdrawal"; readonly args: "p_organization_id uuid, p_data jsonb"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "work_assign"; readonly args: "p_organization_id uuid, p_record_id uuid, p_assignee_user_id uuid, p_due_date timestamp with time zone DEFAULT NULL::timestamp with time zone, p_clear_due boolean DEFAULT false"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "work_assignment_fields"; readonly args: "p_options_table_id uuid DEFAULT NULL::uuid"; readonly returns: "TABLE(key text, label text, spec jsonb)"; readonly security: "invoker"; }, { readonly name: "work_decide_many"; readonly args: "p_organization_id uuid, p_decisions jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "work_has_assignment"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "work_inbox"; readonly args: "p_organization_id uuid DEFAULT NULL::uuid, p_limit integer DEFAULT 50, p_offset integer DEFAULT 0, p_include_decided boolean DEFAULT false, p_view text DEFAULT 'inbox'::text"; readonly returns: "TABLE(item_id uuid, kind text, origin text, title text, subject_id uuid, subject_kind text, summary text, state text, due_on timestamp with time zone, due_state text, actionable boolean, requested_by uuid, requested_by_name text, at timestamp with time zone, table_id uuid, table_name text, decided_by uuid, decided_by_name text, decided_at timestamp with time zone, outcome text, snoozed_until timestamp with time zone, cleared_at timestamp with time zone, snoozed_count integer, cleared_count integer, undo_seconds integer, undo_refusal text)"; readonly security: "definer"; }, { readonly name: "work_instantiation_shape"; readonly args: "p_organization_id uuid, p_instantiation_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "work_list"; readonly args: "p_organization_id uuid DEFAULT NULL::uuid, p_flavour text DEFAULT 'mine'::text, p_include_finished boolean DEFAULT false, p_limit integer DEFAULT 100, p_offset integer DEFAULT 0"; readonly returns: "TABLE(record_id uuid, table_id uuid, table_name text, title text, assignee_id uuid, assignee_name text, assignee_user_id uuid, due_on timestamp with time zone, due_state text, status text, terminal boolean, assigned_by uuid, updated_at timestamp with time zone)"; readonly security: "definer"; }, { readonly name: "work_person"; readonly args: "p_organization_id uuid, p_user_id uuid, p_create boolean DEFAULT true"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "work_record_states"; readonly args: "p_organization_id uuid, p_record_id uuid"; readonly returns: "TABLE(state_id uuid, name text, sort integer, terminal boolean, is_current boolean, allowed boolean, refusal text)"; readonly security: "definer"; }, { readonly name: "work_relation_kinds"; readonly args: ""; readonly returns: "TABLE(kind text, available boolean, why text)"; readonly security: "invoker"; }, { readonly name: "work_set_state"; readonly args: "p_organization_id uuid, p_record_id uuid, p_state_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "work_slot_expire"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "integer"; readonly security: "definer"; }, { readonly name: "work_slot_hold"; readonly args: "p_organization_id uuid, p_table_id uuid, p_slot_key text, p_holder text, p_ttl interval DEFAULT '00:15:00'::interval"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "work_slot_holds"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "TABLE(hold_id uuid, slot_key text, holder text, expires_at timestamp with time zone, expired boolean)"; readonly security: "definer"; }, { readonly name: "work_slot_index_name"; readonly args: "p_table_id uuid"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "work_slot_release"; readonly args: "p_organization_id uuid, p_hold_id uuid"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "work_slots_declare"; readonly args: "p_organization_id uuid, p_name text, p_slug text, p_home_id uuid DEFAULT NULL::uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "work_state_id"; readonly args: "p_organization_id uuid, p_table_id uuid, p_value text"; readonly returns: "uuid"; readonly security: "invoker"; }, { readonly name: "work_states"; readonly args: ""; readonly returns: "TABLE(sort integer, name text, terminal boolean, next text[])"; readonly security: "invoker"; }, { readonly name: "work_take_assignment"; readonly args: "p_organization_id uuid, p_table_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "work_template_declare"; readonly args: "p_organization_id uuid, p_name text, p_graph jsonb"; readonly returns: "uuid"; readonly security: "definer"; }, { readonly name: "work_template_instantiate"; readonly args: "p_organization_id uuid, p_template_id uuid, p_overrides jsonb DEFAULT '{}'::jsonb"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "work_template_refusal"; readonly args: "p_graph jsonb"; readonly returns: "text"; readonly security: "invoker"; }, { readonly name: "work_template_shape"; readonly args: "p_organization_id uuid, p_template_id uuid"; readonly returns: "jsonb"; readonly security: "definer"; }, { readonly name: "work_templates"; readonly args: "p_organization_id uuid, p_limit integer DEFAULT 100"; readonly returns: "TABLE(template_id uuid, name text, nodes integer, relations integer, created_at timestamp with time zone)"; readonly security: "definer"; }, { readonly name: "work_transition_refusal"; readonly args: "p_organization_id uuid, p_from_state_id uuid, p_to_state_id uuid"; readonly returns: "text"; readonly security: "definer"; }, { readonly name: "work_whose_turn"; readonly args: "p_organization_id uuid, p_table_id uuid, p_include_finished boolean DEFAULT false"; readonly returns: "TABLE(record_id uuid, title text, assignee_id uuid, turn text, due_on timestamp with time zone, state text, status text, terminal boolean)"; readonly security: "definer"; }, { readonly name: "world_reader_may_know_row"; readonly args: "p_organization_id uuid, p_record_id uuid"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "world_reader_only"; readonly args: "p_organization_id uuid"; readonly returns: "boolean"; readonly security: "definer"; }, { readonly name: "world_reader_reads_public_definition"; readonly args: "p_organization_id uuid, p_table_id uuid, p_record_ids uuid[]"; readonly returns: "boolean"; readonly security: "definer"; }]; /** The campaign's own knobs, with the value the store resolves them to today. */ declare const STORE_KNOBS: readonly [{ readonly key: "accessible_entity_ids_guard"; readonly value: "true"; readonly type: "boolean"; }, { readonly key: "action_run_records_max"; readonly value: "5000"; readonly type: "integer"; }, { readonly key: "agent_context_value_cap_bytes"; readonly value: "0"; readonly type: "integer"; }, { readonly key: "agent_schema_changes"; readonly value: "\"never_ask\""; readonly type: "string"; }, { readonly key: "ai_column_decision_engine"; readonly value: "false"; readonly type: "boolean"; }, { readonly key: "ai_fill_default_rows"; readonly value: "3"; readonly type: "integer"; }, { readonly key: "ai_fill_rows_max"; readonly value: "50"; readonly type: "integer"; }, { readonly key: "ai_fill_try_max"; readonly value: "10"; readonly type: "integer"; }, { readonly key: "archive_confirm_over"; readonly value: "1000"; readonly type: "integer"; }, { readonly key: "automation_catch_up_hours"; readonly value: "48"; readonly type: "integer"; }, { readonly key: "back_links"; readonly value: "true"; readonly type: "boolean"; }, { readonly key: "base_snapshot_keep"; readonly value: "30"; readonly type: "integer"; }, { readonly key: "batch_items_max"; readonly value: "500"; readonly type: "integer"; }, { readonly key: "choice_nudge"; readonly value: "\"ask\""; readonly type: "string"; }, { readonly key: "closed_custom_field_tables"; readonly value: "[\"party\"]"; readonly type: "json"; }, { readonly key: "code_paths_enabled"; readonly value: "true"; readonly type: "boolean"; }, { readonly key: "consumer_chat_seeding_enabled"; readonly value: "false"; readonly type: "boolean"; }, { readonly key: "consumer_checkout_enabled"; readonly value: "false"; readonly type: "boolean"; }, { readonly key: "consumer_context_enabled"; readonly value: "false"; readonly type: "boolean"; }, { readonly key: "consumer_education_enabled"; readonly value: "false"; readonly type: "boolean"; }, { readonly key: "consumer_extension_enabled"; readonly value: "false"; readonly type: "boolean"; }, { readonly key: "consumer_grid_enabled"; readonly value: "false"; readonly type: "boolean"; }, { readonly key: "consumer_retirement_enabled"; readonly value: "false"; readonly type: "boolean"; }, { readonly key: "consumer_saved_ai_outputs_enabled"; readonly value: "false"; readonly type: "boolean"; }, { readonly key: "consumer_scopes_enabled"; readonly value: "false"; readonly type: "boolean"; }, { readonly key: "containment_depth_ceiling"; readonly value: "16"; readonly type: "integer"; }, { readonly key: "copy_stall_passes"; readonly value: "20"; readonly type: "integer"; }, { readonly key: "cross_organization_links"; readonly value: "false"; readonly type: "boolean"; }, { readonly key: "data_home_default_kind"; readonly value: "\"all\""; readonly type: "string"; }, { readonly key: "data_home_default_order"; readonly value: "\"updated\""; readonly type: "enum"; }, { readonly key: "data_home_default_scope"; readonly value: "\"all\""; readonly type: "enum"; }, { readonly key: "data_home_default_view"; readonly value: "\"table\""; readonly type: "enum"; }, { readonly key: "decision_undo_seconds"; readonly value: "5"; readonly type: "integer"; }, { readonly key: "decoration_rules_max"; readonly value: "50"; readonly type: "integer"; }, { readonly key: "decorations_max_bytes"; readonly value: "262144"; readonly type: "integer"; }, { readonly key: "document_letterhead"; readonly value: "{}"; readonly type: "json"; }, { readonly key: "document_max_bytes"; readonly value: "1048576"; readonly type: "integer"; }, { readonly key: "enrichment_batch_ceiling"; readonly value: "200"; readonly type: "integer"; }, { readonly key: "enrichment_confidence_floor"; readonly value: "0.6"; readonly type: "number"; }, { readonly key: "enrichment_cost_cap_cents"; readonly value: "2000"; readonly type: "integer"; }, { readonly key: "enrichment_estimate_output_tokens"; readonly value: "200"; readonly type: "integer"; }, { readonly key: "enrichment_sensitivity_ceiling"; readonly value: "\"internal\""; readonly type: "string"; }, { readonly key: "entity_types_guard"; readonly value: "false"; readonly type: "boolean"; }, { readonly key: "example_rows_max"; readonly value: "500"; readonly type: "integer"; }, { readonly key: "export_rows_ceiling"; readonly value: "100000"; readonly type: "integer"; }, { readonly key: "external_principal_enabled"; readonly value: "true"; readonly type: "boolean"; }, { readonly key: "field_sensitivity_levels"; readonly value: "{\"edit\": {\"public\": \"edit_content\", \"internal\": \"edit_content\", \"restricted\": \"admin\", \"confidential\": \"admin\"}, \"read\": {\"public\": \"viewer\", \"internal\": \"viewer\", \"restricted\": \"admin\", \"confidential\": \"admin\"}}"; readonly type: "json"; }, { readonly key: "form_draft_days"; readonly value: "30"; readonly type: "integer"; }, { readonly key: "form_draft_max_bytes"; readonly value: "65536"; readonly type: "integer"; }, { readonly key: "form_draft_saves_per_hour"; readonly value: "240"; readonly type: "integer"; }, { readonly key: "form_redirect_domains"; readonly value: "[]"; readonly type: "json"; }, { readonly key: "grid_layout"; readonly value: "{\"mode\": \"auto\", \"wrap\": false, \"row_height\": \"normal\", \"fit_max_columns\": 8, \"freeze_first_column\": false}"; readonly type: "json"; }, { readonly key: "host_run_approval_days"; readonly value: "7"; readonly type: "integer"; }, { readonly key: "inbound_domain"; readonly value: "\"inbound.matrxserver.com\""; readonly type: "string"; }, { readonly key: "inbox_reminder_after_days"; readonly value: "3"; readonly type: "integer"; }, { readonly key: "member_default_level"; readonly value: "\"editor\""; readonly type: "enum"; }, { readonly key: "outside_invite_who"; readonly value: "\"org_admins_and_table_owners\""; readonly type: "string"; }, { readonly key: "page_size_ceiling"; readonly value: "1000"; readonly type: "integer"; }, { readonly key: "protected_field_rules"; readonly value: "{\"hr_employee\": {\"arm\": \"hr.arm_write\", \"rule\": \"hr.custom_field_access\", \"readers\": [{\"field\": \"subject\"}, {\"capability\": \"hr.identity.read\"}, {\"capability\": \"hr.working_record.write\"}, {\"level\": \"editor\", \"capability\": \"hr.identity.write\"}]}, \"hr_candidate\": {\"arm\": \"hr.arm_write\", \"rule\": \"hr.custom_field_access\", \"readers\": [{\"field\": \"subject\"}, {\"capability\": \"hr.identity.read\"}, {\"capability\": \"hr.working_record.write\"}, {\"level\": \"editor\", \"capability\": \"hr.identity.write\"}]}, \"hr_position_assignment\": {\"arm\": \"hr.arm_write\", \"rule\": \"hr.custom_field_access\", \"readers\": [{\"field\": \"subject\"}, {\"capability\": \"hr.identity.read\"}, {\"capability\": \"hr.working_record.write\"}, {\"level\": \"editor\", \"capability\": \"hr.identity.write\"}]}, \"hr_training_assignment\": {\"arm\": \"hr.arm_write\", \"rule\": \"hr.custom_field_access\", \"readers\": [{\"field\": \"subject\"}, {\"capability\": \"hr.identity.read\"}, {\"capability\": \"hr.working_record.write\"}, {\"level\": \"editor\", \"capability\": \"hr.identity.write\"}]}}"; readonly type: "json"; }, { readonly key: "provenance_retention_days"; readonly value: "30"; readonly type: "number"; }, { readonly key: "retype_preview_bytes_max"; readonly value: "2000000"; readonly type: "integer"; }, { readonly key: "retype_preview_values_max"; readonly value: "100"; readonly type: "integer"; }, { readonly key: "row_action_steps_max"; readonly value: "60"; readonly type: "integer"; }, { readonly key: "row_actions_max"; readonly value: "24"; readonly type: "integer"; }, { readonly key: "sandbox_message_bytes"; readonly value: "65536"; readonly type: "integer"; }, { readonly key: "sandbox_org_components"; readonly value: "true"; readonly type: "boolean"; }, { readonly key: "scope_members_admitted"; readonly value: "true"; readonly type: "boolean"; }, { readonly key: "sheets_write_through"; readonly value: "true"; readonly type: "boolean"; }, { readonly key: "signup_provisioning_guard"; readonly value: "false"; readonly type: "boolean"; }, { readonly key: "stage_rule_enforcement"; readonly value: "\"refuse\""; readonly type: "enum"; }, { readonly key: "table_record_ceiling"; readonly value: "150000"; readonly type: "integer"; }, { readonly key: "table_sync_rows_max"; readonly value: "20000"; readonly type: "integer"; }, { readonly key: "table_webhooks_max"; readonly value: "10"; readonly type: "integer"; }, { readonly key: "time_zone"; readonly value: "\"UTC\""; readonly type: "string"; }, { readonly key: "value_max_bytes"; readonly value: "100000"; readonly type: "integer"; }, { readonly key: "view_record_order_max"; readonly value: "20000"; readonly type: "integer"; }, { readonly key: "week_start"; readonly value: "\"monday\""; readonly type: "enum"; }, { readonly key: "world_publish_enabled"; readonly value: "true"; readonly type: "boolean"; }]; /** * Every SQLSTATE the store's own function bodies raise, with the functions that * raise it. This is the list the client's refusal mapper is checked against: a * code the store can raise and the package cannot name is a hole, and the * real-door suite says so by name. */ declare const STORE_REFUSAL_CODES: readonly [{ readonly code: "02000"; readonly raised_by: "_checklist_instantiate,_entity_change_file,_org_admin_table_gate,_portal_config_judge,_portal_invite_payload,_read_record_with,_record_restore_one,_share_write_person,_table_share_invite_payload,checklist_declare,checklist_run,checklist_step_complete,checklist_step_refusal,checklist_template_shape,conversation_scope_bind,dashboard_delete,dashboard_restore,dashboard_run,doc_letterhead,doc_render_body,doc_render_delete,doc_render_document,doc_render_read,doc_render_restore,doc_sign,doc_signature_intact,doc_signature_read,doc_template_delete,doc_template_read,doc_template_restore,doc_template_save,enrich_pin,entity_back_links,entity_custom_value_apply,entity_field_protect_arman_explicitly_approved,entity_field_retire,entity_field_update,entity_record_read,entity_row_propose,entity_row_write,entity_value_write,external_history_event,external_rows,external_stub_upsert,external_writes_set,field_choice_usage,field_duplicate,field_restore,field_retype_preview,field_update_rehoming_choices,form_archive,form_response_update,form_restore,form_set_password,io_restore,migrate_delete,migrate_extract_parent,migrate_merge,migrate_reclass,migrate_rename,migrate_reparent,migrate_retype,migrate_split,migrate_undo,organization_clear,pick_list_update,portal_archive,portal_card,portal_declare,portal_form,portal_form_submit,portal_invite,portal_invite_accept,portal_preview,portal_principal_bind,portal_restore,portal_revoke,record_change_many,record_delete,record_restore_preview,record_row_controls,record_row_controls_set,record_table,record_update,record_write_graph_superseding,relation_halves_repair,relation_restore,relation_uncarry,rule_restore,set_table_confidential_arman_explicitly_approved,share_access,share_grant,share_lane_set,share_people,share_revoke,table_agent_writable_set,table_archive,table_archive_deliberately,table_restore,table_row_defaults,table_row_defaults_apply,table_row_defaults_set,table_row_label,table_row_label_set,table_share_outside_accept,table_share_outside_grant,table_share_outside_invite,table_share_outside_resend,table_share_outside_revoke,template_from_tables,visibility_as_of,work_approval_decide,work_approval_host_run,work_approval_host_run_done,work_approval_read,work_approval_request,work_assign,work_record_states,work_set_state"; }, { readonly code: "0A000"; readonly raised_by: "checklist_step_complete,entity_custom_value_apply,entity_row_write,external_rows,external_source_declare,external_write_through,promote_field,promoted_index_expr,promoted_query_sql,promoted_read,read_records_keyset,rule_eval,rule_filter_node_sql,template_restore,work_assign"; }, { readonly code: "22003"; readonly raised_by: "context_resolve"; }, { readonly code: "22004"; readonly raised_by: "_entity_change_file,_entity_custom_fields_guard,_io_outbox_claim,_org_admin_table_gate,_portal_config_judge,_record_restore_one,_share_write_person,_value_envelope,actor_word,agg_assert_key,agg_compare_windows,agg_sql,anon_capture,anon_token_issue,anon_write,assert_client_may_reach,assert_scope_door,base_copy_finish,base_move,booking_declare,capture_submit,checklist_declare,context_resolve,context_template_define,context_type_write,copy_table_extras,dashboard_block_normalize,dashboard_declare,dashboard_window_sql,doc_render_write,doc_sign,doc_signature_write,doc_template_save,enrich_land,enrich_normalize,entity_field_protect_arman_explicitly_approved,entity_row_propose,entity_row_write,external_history_event,external_rows,external_source_declare,external_stub_upsert,external_write_through,external_writes_set,field_history,form_declare,form_look_options,form_response_update,form_submit,home_add,inbox_snooze,io_comment_write,io_import_begin,io_infer_column,io_outbox_drain,io_outbox_release_claimed,io_outbox_subscribe,io_restore,migrate_choice_keys,migrate_purge,migrate_purge_hard,migrate_reclass,migrate_split,migrate_undo,organization_clear,organization_contents,pipeline_declare,pipeline_gate_preview,portal_declare,portal_form_submit,portal_invite,portal_principal_bind,provenance_retention_days,provenance_write,query_across_homes,query_by_coordinates,query_rollup,record_aggregate_as_of,record_delete,record_reparent,record_resolve,record_restore,record_update,record_upsert,record_write,record_write_graph,record_write_graph_superseding,record_write_many,relation_carry,relation_halves_repair,relation_own,row_template_declare,rule_declare,set_table_confidential_arman_explicitly_approved,share_grant,subscription_declare,table_agent_writable_set,table_archive,table_archive_deliberately,table_declare,table_duplicate,table_move,table_restore,table_share_outside_grant,table_share_outside_invite,template_declare,value_restore,view_declare,view_designate,view_look_read,view_look_set,whole_value_complete,work_approval_decide,work_approval_host_run,work_approval_request,work_template_declare"; }, { readonly code: "22007"; readonly raised_by: "_template_date,agg_parse_moment,dashboard_window_sql"; }, { readonly code: "22012"; readonly raised_by: "formula_eval,rule_eval,rule_sql_op"; }, { readonly code: "22023"; readonly raised_by: "_action_check,_automation_advance,_automation_cond_norm,_automation_step,_booking_availability,_ctx_reference_value_holds,_ctx_store_scope,_ctx_table_template_field_holds,_ctx_tree_part,_decorations_check,_entity_change_file,_entity_custom_fields_guard,_form_flow_judge,_form_look_judge,_fx_date,_fx_datetime_parse,_fx_dl,_fx_ext,_fx_listop,_fx_num,_fx_recprop,_fx_regex,_fx_unit,_fx_unit_norm,_fxp_level,_fxp_resolve,_fxp_tokens,_nfx_arglist,_nfx_bin,_nfx_call,_nfx_expr,_nfx_primary,_nfx_tokens,_nfx_unary,_portal_config_judge,_rule_eval_seated,_schedules_stand_down,_stamp_check,_table_dimensions_check,_take_op_id,_template_bind,_template_install_core,_value_envelope,_view_field_key,_view_key_value,_work_shape_guard,_write_via_mark,action_run,actor_word,agent_change_trust,agg_assert_key,agg_calendar,agg_compare_windows,agg_sql,anon_token_issue,archive_guard_decide,archive_hold_answer,automation_test,base_activity,base_move,booking_busy_set,booking_declare,booking_sms_consent,button_press,containment_parent,context_scope_archive,context_scope_write,context_scopes,context_template_define,context_type_archive,context_type_write,context_values,count_records_archived,dashboard_block_normalize,dashboard_run,dashboard_target_field_assert,dashboard_window_sql,data_home,data_home_changed_by,doc_render_body,doc_render_write,doc_signature_write,drill_resolve,enrich_data_source,enrich_declare,enrich_land,enrich_normalize,enrich_pin,entity_back_links,entity_custom_value_apply,entity_fields_across,entity_read_mask,entity_reference_rows,entity_reference_search,entity_reference_words,entity_row_write,entity_value_write,external_history_event,external_source_declare,external_stub_upsert,external_write_through,field_access,field_access_set,field_declare_many,field_duplicate,field_history,field_notify_on_assign,field_update,filter_list_op,find_duplicates,form_declare,form_draft_save,form_response_update,form_set_password,form_visit,formula_eval,formula_history,formula_parse,formula_preview,formula_translate_notion,grid_layout_check,hub_changed_by,hub_changed_by_many,inbound_domain,inbox_snooze,io_export,io_import_begin,io_import_finish,io_import_plan,io_import_report,io_proposal_accept,list_portals,listed_predicate_sql,member_records_take_over,migrate_merge,migrate_reclass,my_levels,my_levels_across,organization_clear,page_size,pick_list_create,pick_list_update,pin_agent_cells,pipeline_move,pipeline_move_many,portal_declare,portal_form_submit,provenance_write,publish_bind,query_by_coordinates,query_rollup,query_rollup_sum,read_records_archived,read_records_in_view_order,read_records_keyset,read_records_page,record_aggregate_as_of,record_change_many,record_drill,record_filter_sql,record_row_controls_set,record_search_sql,record_update,record_upsert,record_write_graph,record_write_graph_superseding,record_write_many,records_search,relation_carry,relation_names_match,relation_reverse_field,relation_reverse_set,relative_window_for_reader,relative_window_resolve,reverse_links_many_fields,row_template_declare,rule_eval,rule_filter_node_sql,rule_members,rule_members_visible,rule_sql_op,scope_table_provision,set_table_confidential,set_table_organization,share_grant,share_lane_set,subscription_declare,table_access_setup_set,table_archive_deliberately,table_copy_sync,table_create,table_ensure,table_find,table_find_many,table_from_example,table_move,table_row_defaults_set,table_row_label_set,table_rules,table_share_outside_grant,table_sync,table_sync_cell,table_sync_settings_set,table_template_declare,table_transfer_owner,table_webhook_declare,template_declare,template_from_tables,template_install_claim,template_install_note,template_upgrade,templates,view_declare,view_designate,view_keys_check,view_look_set,view_record_order_set,visibility_as_of,where_lists_live,where_tables_live,work_approval_host_run,work_approval_request,work_decide_many,work_inbox,work_list,work_slot_hold"; }, { readonly code: "23502"; readonly raised_by: "synced_source_save"; }, { readonly code: "23503"; readonly raised_by: "_action_check,_automation_advance,_automation_flip,_automation_step,_automation_time_item,_automation_view_rule,_booking_availability,_checklist_instantiate,_containment_guard,_ctx_store_value,_decorations_check,_display_spec_for,_field_document_for,_field_type_parity_guard,_form_flow_judge,_pipeline_stage_key,_record_rule_uses,action_declare,action_run,agg_digest_assemble,anon_publish,anon_rate_take,anon_token_issue,anon_write,assert_organization_wall,automation_declare,automation_revision_restore,automation_revisions,automation_runs,automation_test,automations,autonumber_backfill,booking_busy_set,booking_cancel,booking_confirm,booking_declare,booking_hold,booking_reschedule,booking_sms_consent,button_press,capture_publish,checklist_declare,checklist_steps_table,comment_write,dashboard_declare,delete_rule,doc_sign,doc_template_save,enrich_declare,enrich_due,enrich_land,field_make_automatic,field_notify_on_assign,field_update,form_declare,form_draft_save,form_response_update,form_results,form_submit,grid_layout,home_add,inbound_declare,inbound_mail_land,inbound_set,io_comment_write,io_import_begin,io_import_finish,io_import_report,io_import_rows,io_proposal_accept,migrate_demote,migrate_promote,migrate_purge_hard,pipeline_board,pipeline_declare,pipeline_move,pipeline_read,pipeline_transition_refusal,promote_field,promote_table,read_records_in_view_order,read_records_page,record_applicability,record_reparent,record_write_graph_superseding,relation_carry,relation_own,resolve_first_match,row_template_declare,rule_applies,rule_declare,rule_eval,rule_filter_node_sql,rule_members,rule_members_visible,rule_run,subscription_mute,subscription_preview,table_decorate,table_dimensions_set,table_from_example,table_webhook_archive,table_webhook_declare,view_declare,view_designate,view_look_set,view_record_order_set,whole_value_complete,work_set_state,work_take_assignment,work_template_instantiate"; }, { readonly code: "23505"; readonly raised_by: "_booking_seat_take,_ctx_store_item,_ctx_store_scope,_ctx_store_type,_portal_config_judge,_restore_guard_one,_share_write_person,_unique_rule_holds,doc_sign,doc_signature_write,entity_field_declare,field_declare,field_restore,field_update,form_restore,home_add,inbound_declare,io_proposal_accept,relation_carry,relation_own,relation_restore,table_share_outside_resend,work_approval_decide,work_slot_hold"; }, { readonly code: "23514"; readonly raised_by: "_checklist_instantiate,_checklist_step_guard,_containment_guard,_ctx_scope_parent_holds,_ctx_store_item,_ctx_table_template_field_holds,_ctx_value_fits_its_scope,_dated_values_guard,_derived_fields,_display_format_check,_display_spec_for,_entity_choice_keys,_entity_custom_fields_guard,_field_choices_save,_field_class_guard,_field_default_fitted,_field_document_for,_field_kind_shape_ok,_field_shape_guard,_field_type_parity_guard,_kind_value_ok,_merge_field_shape_guard,_merge_field_temporal_guard,_promoted_field_cap_guard,_record_restore_one,_record_rule_uses,_record_source_key_is_record,_relation_halves_agree,_relation_kernel_targets,_resolve_choice_words,_rule_shape_guard,_rule_topology_guard,_store_relation_edge_names_its_field,_table_columns_word_guard,_table_shape_guard,_undeclared_key_guard,_value_envelope,_with_display,_work_shape_guard,_workdoors_approval_guard,action_run,assert_columns_are_defined,assert_entity_is_organization_scoped,booking_declare,capture_publish,capture_sheet_declare,checklist_declare,checklist_step_complete,dashboard_restore,doc_sign,doc_signature_write,doc_template_restore,doc_template_save,entity_field_protect_arman_explicitly_approved,entity_field_retire,entity_field_update,entity_records_find,entity_table,entity_value_write,field_declare,field_make_automatic,field_restore,field_retire,field_update,field_update_rehoming_choices,form_restore,home_add,io_comment_write,io_import_rows,migrate_merge,migrate_purge_hard,portal_archive,portal_restore,record_reparent,record_update_adding_choices,record_upsert,record_write_graph,record_write_graph_superseding,relation_carry,relation_halves_repair,relation_own,relation_restore,rollup_value,row_template_declare,rule_restore,status_groups_keyed,status_groups_of,table_access_setup_set,table_from_example,table_restore,template_upgrade,validate_value_envelope,validate_values,whole_value_complete,work_set_state,work_slots_declare,work_take_assignment,work_template_instantiate"; }, { readonly code: "42501"; readonly raised_by: "_agent_change_gate,_computed_door_org,_context_copy_fence,_copy_evaluation_note,_copy_evaluation_reimage,_copy_in_progress_guard,_doc_render_immutable,_doc_signature_immutable,_entity_change_file,_entity_custom_fields_guard,_field_definition_write,_field_write_door,_io_outbox_server_only,_not_a_member_refusal,_org_admin_table_gate,_portal_config_judge,_portal_principal_here,_read_record_with,_rule_definition_write,_share_write_person,_stamp_token,_store_door,_table_dimensions_infer,_table_duplicate_step,_table_shape_guard,_template_bind,_template_call,_template_install_core,_value_envelope,_withdraw_approvals_for_batch,_workdoors_approval_guard,admin_all_tables,agent_change_trust,agent_table_claim,agg_fields_readable_assert,anon_capture,anon_inbound_land,anon_publish,anon_token_issue,anon_token_verify,anon_write,assert_client_may_change,assert_client_may_open,assert_may_know_table,assert_organization_admin,assert_scope_door,assert_store_door,automation_app_watch,automation_claim_pending,automation_note,automation_resume,automation_step_mark,automation_webhook_receive,base_copy_finish,base_move,base_move_access_kept,base_move_remove_access,booking_confirm,booking_declare,booking_hold,capture_submit,checklist_run,comment_write,computed_refresh,context_item_archive,context_item_restore,context_item_write,context_resolve,context_scope_archive,context_scope_restore,context_scope_write,context_tags_set,context_type_archive,context_type_restore,context_type_write,conversation_scope_bind,conversation_scope_unbind,copy_table_extras,count_records_archived,dashboard_target_field_assert,doc_sign,enrich_declare,enrich_due,enrich_land,enrich_normalize,entity_custom_value_apply,entity_field_declare,entity_field_retire,entity_field_update,entity_row_propose,entity_row_write,entity_value_write,external_write_through,field_access_set,field_restore,field_update,form_declare,form_draft_save,form_public_asks,form_response_update,form_set_password,form_submit,formula_history,inbound_mail_land,inbox_clear,inbox_snooze,inbox_unclear,inbox_unsnooze,io_comment_resolve,io_comment_write,io_import_begin,io_import_finish,io_restore,member_personal_tables,migrate_purge,migrate_purge_hard,migrate_purge_hard_request,migrate_reclass,my_levels,my_levels_across,organization_clear,organization_contents,pick_list_get,pick_list_update,portal_declare,portal_form,portal_form_submit,portal_invitation,portal_invite,portal_invite_accept,portal_principal_bind,portal_self_signup,promote_table,protected_matches,query_visibility_parity,read_record,read_records,read_records_archived,read_records_by_ids,read_records_keyset,read_records_matching,read_records_page,record_delete,record_follow_set,record_row_controls,record_table,record_write_graph,relation_halves_disagreements,relation_halves_repair,resolve_context,reverse_links_many,scope_table_provision,share_grant,share_lane_set,space_templates,subscription_mute,subscription_preview,table_access_setup_set,table_agent_writable_set,table_archive_deliberately,table_copies_in_progress,table_copy_sync,table_duplicate,table_duplicate_continue,table_kind_facts,table_level_facts,table_move,table_row_defaults_apply,table_row_defaults_set,table_row_label_set,table_share_outside_accept,table_share_outside_grant,table_share_outside_invite,table_share_outside_resend,table_sync,table_sync_cell,table_templates,table_transfer_owner,table_webhook_declare,template_declare,template_from_tables,template_instances,template_restore,template_upgrade,templates,view_declare,view_look_set,view_record_order_set,visibility_as_of,where_lists_live,where_tables_live,whole_value_complete,work_approval_decide,work_approval_host_run,work_approval_host_run_done,work_approval_read,work_approval_request,work_person"; }, { readonly code: "42703"; readonly raised_by: "entity_table,portal_declare"; }, { readonly code: "42883"; readonly raised_by: "_template_call"; }, { readonly code: "42P17"; readonly raised_by: "_field_reads_what_it_reads,far_value"; }, { readonly code: "53400"; readonly raised_by: "anon_rate_take,delete_cascade_closure,enrich_due,enrich_land,promote_field"; }, { readonly code: "54000"; readonly raised_by: "_table_dimensions_check,action_run,comment_counts,data_home_changed_by,form_draft_save,hub_changed_by,hub_changed_by_many,pipeline_move_many,read_records_page,record_change_many,record_headers,relation_names_match,reverse_links_many,table_copy_sync,table_decorate,table_from_example,table_map_fields,table_row_counts,table_sync,table_webhook_declare,view_record_order_set,work_decide_many"; }, { readonly code: "54001"; readonly raised_by: "record_delete"; }, { readonly code: "55000"; readonly raised_by: "_code_depends_refuse,_io_outbox_claim,_template_install_core,base_move,entity_field_protect_arman_explicitly_approved,inbox_clear,inbox_snooze,io_outbox_release,io_outbox_subscribe,table_duplicate,table_ensure,table_move,template_restore,template_upgrade,work_approval_decide,work_approval_host_run_done,work_approval_request"; }, { readonly code: "57014"; readonly raised_by: "formula_eval"; }, { readonly code: "MXD01"; readonly raised_by: "_held_change_refusal"; }, { readonly code: "MXD02"; readonly raised_by: "entity_row_propose"; }, { readonly code: "MXPV1"; readonly raised_by: "field_retype_preview"; }, { readonly code: "P0001"; readonly raised_by: "_guest_record_ceiling,action_run,context_scope_write"; }, { readonly code: "P0002"; readonly raised_by: "_template_install_core,inbox_clear,inbox_snooze,publish_bind,template_archive,template_install_claim,template_install_note,template_keep,template_restore,template_uninstall,template_upgrade,whole_value_complete"; }, { readonly code: "P0R01"; readonly raised_by: "template_upgrade"; }, { readonly code: "PT409"; readonly raised_by: "entity_row_write,has_visibility_at,record_change_many,record_update,record_upsert,record_write_graph_superseding,table_move,whole_value_complete"; }, { readonly code: "PT428"; readonly raised_by: "_record_rule_uses"; }]; /** `platform.entity_types` — the registered tokens a Table or relation may name. */ declare const ENTITY_TOKENS: readonly ["access_delta_probe", "access_delta_run", "access_request", "access_shadow_log", "access_version", "access_version_event", "account_addon", "account_closure", "account_facts", "acquisition_block", "activity", "admin_audit_log", "admin_email_log", "admin_markdown_sample", "admin_user", "admin_user_owned_resources_cache", "admission_config", "agent", "agent_card", "agent_definition_version", "agent_drift_alert", "agent_exemplar", "agent_mandate_note", "agent_prompt_block", "agent_prompt_block_variant", "agent_prompt_remediation", "agent_required_flag_change", "agent_run", "agent_run_stage", "agent_schedule", "agent_schedule_claim", "agent_shortcut", "agent_surface_binding", "agent_template", "agent_term_list", "agent_test_result", "agent_test_run", "agent_usage", "agent_user_kv", "ai_api", "ai_calls", "ai_device_model_file", "ai_device_model_root", "ai_endpoint", "ai_media_generation_cache", "ai_model", "ai_model_alias", "ai_model_artifact", "ai_model_candidate", "ai_model_presentation", "ai_model_upstream", "ai_model_variant", "ai_model_verification_run", "ai_model_want", "ai_offering", "ai_person_model_want", "ai_provider", "ai_request_latency", "ai_runtime", "ai_runtime_build", "ai_runtime_compat", "ai_setting", "ai_setting_profile", "ai_translation_cell", "ai_usage_execution_facts", "ai_usage_executions", "ai_usage_hourly", "ai_usage_hourly_watermark", "analysis_result", "anon_form", "anon_form_password", "anon_form_visit", "anon_function_birth_grandfather", "anon_hit", "anon_inbound", "anon_replay", "anon_submission", "anon_token", "api_field_warning", "api_request_log", "app", "app_config", "app_config_history", "app_definition_version", "app_error", "app_execution", "app_instance", "app_log", "app_log_hourly", "app_log_hourly_watermark", "app_log_lines", "app_log_muted_pattern", "app_log_norm_exception", "app_log_requests_hourly", "app_rate_limit", "app_setting", "app_sync_status", "applet_visitor_binding", "approach", "artifact", "assessment", "assessment_item", "assessment_result", "assignment_session", "assist", "assist_producer_policy", "assist_producer_policy_history", "association_type", "assurance_level", "attempt", "attention_audience_rule", "attention_audit", "attention_item_state", "attention_showing", "audit_broken_functions", "audit_canonical_findings", "audit_exemption", "audit_function_deps", "audit_function_runtime_probe", "audit_m2m_candidates", "audit_refresh_log", "audit_stale_registry", "audit_unregistered_candidates", "automation_delivery", "automation_fired", "base_entity_template", "batch_cost_event", "batch_provider_batch", "batch_work_item", "billing_capability", "billing_capability_limit", "billing_ci_package_build", "billing_connect_account", "billing_coupon", "billing_coupon_redemption", "billing_customer", "billing_external_call_vendor", "billing_free_network_counter", "billing_free_period_grant", "billing_free_use_counter", "billing_hard_cost_reconciliation", "billing_held_run", "billing_org_payment_account", "billing_payment", "billing_payment_ask", "billing_plan", "billing_plan_limit", "billing_price", "billing_product", "billing_provider_balance_snapshot", "billing_spend_alarm", "billing_spend_alarm_occurrence", "billing_spend_approval", "billing_spend_guardrail", "billing_spend_hold", "billing_stripe_event", "billing_subscription", "billing_usage_ledger", "billing_usage_reset", "billing_user_plan", "block_state", "board", "browser_account_binding", "browser_action_event", "browser_authenticator_window", "browser_capture", "browser_control_request", "browser_handoff", "browser_login_attempt", "browser_login_recipe", "browser_profile", "browser_profile_checkpoint", "browser_run", "browser_site_observation", "browser_site_policy", "browser_stream_ticket", "build_lock", "calendar_event", "campaign_watch_ramp_gate_run", "campaign_watch_switch_outbox", "campaign_watch_switch_window", "canvas_comment", "canvas_comment_like", "canvas_item", "canvas_item_state", "canvas_like", "canvas_score", "canvas_view", "capture_window", "carrying_rule", "catalog_entries_history", "catalog_entry", "category", "change_item", "change_job", "change_job_row", "change_plan", "change_type_default", "change_work", "chat_user_usage_summary", "citations", "class_purchase", "classifier_revision_ledger", "client_callable_door", "client_callable_door_retirement", "client_excluded_column_unregistered", "cmp_entry", "cmp_feedback", "code_file", "code_folder", "code_repository", "coding_session", "coding_session_entry", "collab_checkpoint", "collab_op", "collab_room", "comment", "commerce_asset_allocation", "commerce_asset_grading", "commerce_asset_identifier", "commerce_asset_lot_event", "commerce_asset_mandate_result", "commerce_asset_price_factor", "commerce_asset_reshoot_request", "commerce_asset_review", "commerce_asset_unknown", "commerce_certified_printer", "commerce_cloud_sync_connection", "commerce_ebay_business_policy", "commerce_ebay_category", "commerce_ebay_category_aspect", "commerce_ebay_category_tree", "commerce_ebay_custom_policy", "commerce_ebay_inventory_item", "commerce_ebay_inventory_item_group", "commerce_ebay_inventory_item_group_member", "commerce_ebay_inventory_location", "commerce_ebay_listing", "commerce_ebay_marketplace_policy", "commerce_ebay_media_asset", "commerce_ebay_notification_destination", "commerce_ebay_notification_event", "commerce_ebay_notification_subscription", "commerce_ebay_notification_topic", "commerce_ebay_offer", "commerce_ebay_order", "commerce_ebay_order_line_item", "commerce_ebay_shipping_fulfillment", "commerce_ebay_store_category", "commerce_human_correction", "commerce_intake_artifact", "commerce_intake_asset", "commerce_intake_batch", "commerce_label_batch", "commerce_label_code", "commerce_marketplace_account", "commerce_marketplace_account_deletion_audit", "commerce_marketplace_api_call", "commerce_marketplace_rate_budget", "commerce_marketplace_site", "commerce_marketplace_sync_run", "commerce_prediction_outcome", "commerce_print_order", "commerce_product", "commerce_product_channel_ref", "commerce_product_media", "commerce_product_variant", "commerce_recall_audit", "communication_calendar_selected_snapshot_state", "communication_channel_readiness", "comparison_set", "component_group", "computed_org_mark", "computed_reader_cols", "computed_reader_judgement", "config_manifest", "config_read_bucket", "contact_medium", "contact_submission", "content_certification", "content_ir_converter_definition", "content_ir_converter_run", "content_ir_kind", "content_ir_kind_component", "content_ir_kind_component_incident", "content_ir_kind_component_layer", "content_ir_kind_conformance", "content_ir_kind_edge", "content_ir_kind_example", "content_ir_kind_instance", "content_ir_kind_surface", "content_ir_render_inspection", "content_lane", "context_access_log", "context_item", "context_item_suggestion", "context_item_value", "context_value_refs", "conversation", "conversation_value", "courts", "credential_attachment", "credential_item", "credential_mutation_receipt", "crm_address", "crm_affiliation", "crm_blocklist_entry", "crm_contact_candidate", "crm_deal", "crm_deal_stage_event", "crm_enrichment_call", "crm_interaction", "crm_merge_candidate", "crm_outreach_list", "crm_outreach_list_member", "crm_party_merge", "crm_party_research", "crm_registry_ingest_run", "crm_registry_source", "crm_sending_claim", "crm_sending_event", "crm_sending_identity", "crm_sending_identity_check", "crm_sending_policy", "custom_agent_table_origin", "custom_agent_table_trust", "custom_agg_digest_checked", "custom_anon_form_draft", "custom_base", "custom_base_snapshot", "custom_entity_definition", "custom_field_definition", "custom_field_target", "custom_inbox_item_state", "custom_io_outbox_consumer", "custom_io_outbox_consumption", "custom_portal", "custom_portal_principal", "custom_portal_table", "custom_record", "custom_share_tails_mine_repair", "custom_synced_source", "custom_template", "custom_template_install", "custom_whole_value_parked", "cx_agent_memory", "cx_agent_plan", "cx_agent_task", "cx_code_edit", "cx_code_message_file", "cx_conversation_documents", "cx_media", "cx_observational_memory", "cx_observational_memory_event", "cx_pending_injection", "cx_request", "cx_request_snapshot", "cx_request_values", "cx_tool_trace", "cx_user_request", "cx_user_todo", "dashboard_saved_view", "data_rights_event", "data_store", "data_store_members", "dataset", "ddl_guard_log", "deck_suggestion", "definer_class_exemption", "definer_client_grant_grandfather", "definer_grant_baseline", "deprecated_relation", "derive_run", "desktop_app_account", "desktop_app_instance", "desktop_app_profile", "dev_login_audit", "device_handoff", "dict_entry", "dict_provider_publication", "dict_setting", "dm_conversation", "dm_message", "dm_participant", "dm_session_member", "doc_render", "doc_signature", "dockets", "document", "document_version", "domain_classification", "edge_payload_kind", "egress_device", "egress_pairing", "egress_ticket", "emails", "embedding_cache", "embeddings_google_gemini_2_1536", "embeddings_oai_3_small_1536", "embeddings_voyage_4_large_1024", "embeddings_voyage_code_3_1024", "endpoint_family_sweep_state", "engine_owner_task", "entity_grant", "entity_protected_value", "entity_protected_value_version", "entity_relationship", "entity_type", "esign_campaign", "esign_campaign_member", "esign_consent_disclosure", "esign_envelope", "esign_envelope_certificate", "esign_envelope_document", "esign_envelope_draft", "esign_envelope_event", "esign_envelope_external_ref", "esign_envelope_signer", "esign_provider", "esign_provider_binding", "esign_saved_signature", "esign_signing_key", "esign_template", "execution_event_cursor", "extension_auth_code", "external_api_reservation", "external_conversation", "external_delivery_event", "external_inbox", "external_link", "external_message", "external_provider_receipt", "external_source", "extract_sweep_state", "fc_card", "fc_detail", "fc_set", "feature_doc", "feature_knob", "feedback_comments", "feedback_user_messages", "field_component", "file", "file_analysis", "file_entities", "file_overrides", "file_page_annotations", "file_pages", "file_rag_job", "file_template", "file_version", "files_account_tier", "files_machine_written_prefix", "files_sync_mapping", "files_user_account", "flashcard_data", "flashcard_history", "flashcard_sets", "flexible_data", "folder", "function_contract", "game_badge", "game_result", "game_room", "global_execution", "global_execution_checkpoint", "global_execution_control", "global_execution_event", "global_meter_entry", "global_origin", "global_request", "google_document", "growth_loop_event", "growth_loop_run", "growth_loop_stage_run", "guardian_link", "guest_conversion_audit", "guest_execution_log", "guest_executions", "guided_checklist_run", "heatmap_save", "hindsight_enrollment", "hindsight_finding", "hindsight_regression_case", "hindsight_replay", "hindsight_replay_step", "hindsight_review", "hr_access_audit", "hr_access_role", "hr_accommodation_request", "hr_ai_evidence", "hr_alert_routing_rule", "hr_application", "hr_approval_authority", "hr_approval_delegation", "hr_asset", "hr_asset_assignment", "hr_attendance_exception", "hr_auto_close_rule", "hr_availability", "hr_background_check", "hr_benefits_event", "hr_calculation_snapshot", "hr_candidate", "hr_candidate_conversion", "hr_candidate_message", "hr_careers_portal", "hr_checklist_item", "hr_checklist_run", "hr_checklist_template", "hr_checklist_template_item", "hr_compensation", "hr_corrective_action", "hr_course", "hr_course_version", "hr_credential", "hr_crew", "hr_deduction_code", "hr_department", "hr_derived_grant", "hr_disposition_event", "hr_earning_code", "hr_eeo_response", "hr_emergency_contact", "hr_employee", "hr_employee_private", "hr_employer_profile", "hr_employment", "hr_employment_pin", "hr_engagement", "hr_establishment", "hr_external_identity", "hr_field_policy", "hr_goal", "hr_holiday", "hr_holiday_calendar", "hr_i9", "hr_i9_document", "hr_incident", "hr_incident_party", "hr_interview", "hr_interview_kit", "hr_job_title", "hr_jurisdiction", "hr_jurisdiction_rule", "hr_jurisdiction_rule_class", "hr_jurisdiction_rule_org_decision", "hr_jurisdiction_rule_test", "hr_kiosk_device", "hr_kiosk_session", "hr_labor_target", "hr_leave_case", "hr_leave_enrollment", "hr_leave_ledger", "hr_leave_policy", "hr_leave_request", "hr_legal_hold", "hr_legal_hold_item", "hr_location", "hr_new_hire_report", "hr_offer", "hr_opening", "hr_overtime_alert", "hr_overtime_alert_rule", "hr_overtime_preapproval", "hr_pay_group", "hr_pay_period", "hr_pay_period_employment", "hr_payroll_export", "hr_payroll_export_line", "hr_position_assignment", "hr_posting", "hr_posting_publication", "hr_provider_binding", "hr_provider_event", "hr_provisioning_result", "hr_punch", "hr_recalculation_batch", "hr_record_class", "hr_records_request", "hr_reference_check", "hr_reporting_line", "hr_requisition", "hr_restricted_note", "hr_retention_rule", "hr_review", "hr_review_cycle", "hr_review_peer_nomination", "hr_review_response", "hr_review_template", "hr_role_assignment", "hr_schedule", "hr_schedule_change", "hr_schedule_guidance", "hr_schedule_template", "hr_schedule_template_shift", "hr_scorecard", "hr_separation", "hr_shift", "hr_shift_claim", "hr_staffing_requirement", "hr_survey", "hr_survey_invitation", "hr_survey_question", "hr_survey_response", "hr_tax_registration", "hr_tax_withholding", "hr_time_adjustment", "hr_training_assignment", "hr_training_attempt", "hr_transcript_entry", "hr_verification_letter_request", "hr_work_interval", "hr_workflow_binding", "hr_workflow_decision", "hr_workflow_definition", "hr_workflow_event", "hr_workflow_failure", "hr_workflow_flow_type", "hr_workflow_instance", "hr_workflow_step", "hr_workflow_step_definition", "hr_workweek", "html_extraction", "iam_access_audit", "iam_access_setup", "iam_api_key", "iam_emergency_door_request", "iam_oauth_app", "iam_org_availability_key", "iam_org_domain", "iam_org_domain_route", "iam_publish_binding", "iam_publisher_verification", "iam_read_lane_v2_rollout", "iam_record_seat_change", "iam_sign_in_event", "iam_world_namespace", "iam_world_publish_admission", "idempotency", "industry", "industry_curator", "infra_status", "ingest_runs", "integration_connection", "integration_connection_resource", "interview_decision_interview", "interview_decision_question", "interview_document_revision", "interview_hole", "interview_question", "interview_session", "interview_turn", "invitation", "invitation_code", "invitation_request", "io_comment", "io_contract", "io_import", "io_outbox", "item", "item_mastery", "judge_verdict", "jurisdiction_policy", "keyword_classification_queue", "kg_alert", "kg_chunk_entities", "kg_chunks", "kg_clusters", "kg_edges", "kg_entities", "kg_entity_aliases", "kg_suggestion_ack", "kg_sweep_queue", "kg_sweep_run", "kg_sweep_state", "kg_value_match", "knob_override", "knob_override_audit", "knob_rung_lock", "knob_scope_kind", "knob_write_door", "league_membership", "learn_doc", "library_doc", "lifecycle_archive", "lifecycle_archive_row", "lifecycle_audit", "lifecycle_entity_plan", "lifecycle_map_build", "lifecycle_reference_map", "lifecycle_run", "lifecycle_tier_ledger", "location", "mandate", "mandate_advance_batch_row", "mandate_binding", "mandate_candidate", "mandate_candidate_run", "mandate_candidate_run_payload", "mandate_goal_clauses", "mandate_observation", "mandate_proposal", "mandate_readiness_verdict", "mandate_reference", "mandate_scan", "mandate_treatment", "marketing_initiative", "masterwork_corpus_item", "masterwork_run", "masterwork_run_kind", "masterwork_source", "math_course_structure", "math_problem", "matrx_action_ledger", "mcp_config", "mcp_server", "mcp_user_conn", "media_capture_handoff", "media_catalog_setting", "media_library_item", "media_selection_item", "media_selection_job", "media_source_library", "meet_call_invite", "meet_chat_message", "meet_connection", "meet_invitee", "meet_meeting", "meet_note", "meet_occurrence_override", "meet_participant", "meet_recording", "meet_session", "meet_transcript_segment", "membership", "membership_grant", "memory_trial", "memory_trial_step", "merge_field_provenance", "message", "message_template", "message_template_detail", "meta_excluded_schema", "meta_table_stats_history", "metadata_reserved_keys", "microservice_project", "migration_log", "mtx_media_heal_queue", "mtx_public_url_guard", "ner_shadow", "note", "note_folder", "notification", "notification_channel_preference", "notification_event_override", "notification_event_type", "notification_preference", "notification_submission", "notify_outsider_door_baseline", "oauth_handoff_claim", "opinion_clusters", "opinions", "ops_auth_lock_watchdog_log", "ops_check_item", "ops_check_run", "ops_db_host_sample", "ops_issue_class", "ops_issue_event", "ops_perf_client_event", "ops_perf_sample", "ops_perf_statement_snapshot", "ops_proof_check", "ops_proof_run", "ops_proof_scenario", "ops_source_read_cache", "ops_test_replay_cache", "org_admin_audit", "org_change_policy", "org_chart_publication", "org_context_ledger", "org_industries", "org_member_control", "org_module_config", "org_move_txn", "org_plan", "org_sweep_list", "organization", "organization_preferences", "organization_visibility_version", "output_feedback", "outreach_acceptance", "page_extraction_job", "page_extraction_page_run", "page_extraction_results", "page_extraction_runs", "page_intent_queue", "page_mapping_queue", "page_vitals", "part_config", "part_config_sub", "party", "party_contact_point", "passkey_credential", "pb_claim_appeals_fd31de", "pb_insurance_claims_fd31de", "pc_article", "pc_episode", "pc_show", "pc_studio_run", "pc_studio_run_asset", "pdf_consolidation_log", "pdf_redaction_audit", "pdf_redaction_key_escrow", "permission_grant", "personal_data_column", "plan_cms_fill_item", "plan_cms_fill_job", "plan_entity", "plan_node", "plan_node_artifact", "plan_node_step", "plan_profile", "platform_action_request", "platform_actor_session", "platform_actor_token", "platform_actor_token_event", "platform_class_approval_by_arman", "platform_class_approval_by_org_admin", "platform_continued_access", "platform_cutover_census_run", "platform_cutover_evaluation_replaced", "platform_cutover_evaluation_write", "platform_cutover_seam", "platform_cutover_seam_measure", "platform_cutover_seam_press", "platform_dated_change", "platform_doors_only_pending_cutover", "platform_google_calendar_event_create_intent", "platform_google_task_create_intent", "platform_hidden_item", "platform_kernel_fingerprint_record", "platform_org_knob_override", "platform_outcome_event", "platform_outsider_consumer", "platform_provision_base_contract_pending", "platform_reachability", "platform_reachability_rebuild_pending", "platform_realtime_topic_prefix", "platform_reference_category", "platform_reference_declaration", "platform_repo", "platform_saved_view", "platform_schema", "platform_secure_delivery", "platform_share_link", "platform_strict_class_probe", "platform_user_knob_override", "podcast_race", "position", "presentation", "processed_document", "processed_document_page", "product_capture_file", "product_capture_item", "product_capture_payload", "product_capture_product", "product_capture_question", "profile", "project", "prompt", "provider_account", "provider_account_credential", "provision", "provision_generate_target", "provision_grant", "provision_marker", "provision_rule_message", "provision_schema", "provision_shape_debt", "provision_snapshot", "provision_spec", "provision_spec_grandfather", "provision_vocabulary", "provlock_recall_visits_all8u5", "public_compat_wrapper", "public_placement_baseline", "public_placement_census", "public_placement_domain", "public_restore_permit", "purpose", "quiz_session", "rag_ingest_run", "rag_library_audit_log", "rate_limit_buckets", "reachability_pending", "read_mask_kept", "recompute_queue", "record", "record_alias", "record_computed", "record_follow", "redaction_mapping", "relationship_rule", "research_analysis", "research_content", "research_context_bundle", "research_document", "research_intent", "research_keyword", "research_media", "research_source", "research_synthesis", "research_tag", "research_template", "research_topic", "retention_policy", "retrieval_audit", "review_queue", "route_manifest_entry", "row_version", "rulebook", "run_approval", "run_approval_event", "runtime_operation_stream", "runtime_operation_stream_batch", "sandbox_instance", "sch_agent_task", "sch_run", "sch_task", "sch_trigger", "scheduler_automation_run_subject", "schema_client_exposure", "schema_migration_ledger", "schema_migration_legacy", "schema_migration_slot_grandfather", "schema_templates", "scope", "scope_association_suggestion", "scope_dataset_instance", "scope_door_registry", "scope_item_value_suggestion", "scope_suggestion", "scope_type", "scrape_domain", "scrape_domain_settings", "scrape_failure_log", "scrape_parsed_page", "scrape_path_override", "scrape_path_pattern", "scrape_retry_queue", "scraper_comparison_run", "scraper_data_fetch_job", "scraper_data_fetch_job_row", "scraper_data_source", "search_item", "seo_ai_capability", "seo_ai_visibility_brand_check", "seo_ai_visibility_citation", "seo_ai_visibility_claim", "seo_ai_visibility_design_artifact", "seo_ai_visibility_panel", "seo_ai_visibility_panel_version", "seo_ai_visibility_response", "seo_ai_visibility_signal", "seo_backlink", "seo_backlink_change_event", "seo_backlink_dimension_snapshot", "seo_backlink_observation", "seo_backlink_snapshot", "seo_change_assessment", "seo_change_event", "seo_change_item", "seo_change_metric", "seo_change_set", "seo_change_theory", "seo_collection_run", "seo_competitor", "seo_competitor_observation", "seo_competitor_opportunity", "seo_coverage_mention", "seo_coverage_tracker", "seo_dimension_value_matcher", "seo_engine_schedule", "seo_geo_place", "seo_gsc_dig_rule", "seo_keyword", "seo_keyword_class_rule", "seo_keyword_edge", "seo_keyword_facet", "seo_keyword_market", "seo_keyword_market_observation", "seo_keyword_place", "seo_keyword_saved_view", "seo_keyword_topic", "seo_landscape_brief", "seo_link_gap_domain", "seo_link_gap_match", "seo_map_facet", "seo_map_facet_value", "seo_map_topic", "seo_page_measurement_health", "seo_page_performance", "seo_pr_moment", "seo_provider_call", "seo_provider_task", "seo_rank_observation", "seo_rank_target", "seo_raw_payload", "seo_referring_domain_profile", "seo_reputation_case", "seo_search_performance_daily", "seo_serp_mention", "seo_serp_opportunity", "seo_serp_result", "seo_serp_snapshot", "seo_site_geo_area", "seo_site_keyword_offering", "seo_site_keyword_value", "seo_site_offering_value", "seo_site_topic_value", "seo_site_value_combo", "seo_site_value_worth", "seo_site_vocabulary", "seo_source_request", "seo_starter_pack", "seo_starter_pack_item", "seo_story_angle", "seo_topic", "seo_topical_map", "seo_tracker_story", "seo_web_analytics_daily", "share_link", "share_link_password", "shareable_resource_registry", "shared_canvas_item", "short_link", "shortcut_category", "sign_in_fk_legacy", "skill", "skill_category", "skill_detail", "skill_render_definition", "sms_consent", "sms_conversation", "sms_message", "sms_message_media", "sms_notification", "sms_notification_preference", "sms_phone_number", "sms_rate_limits", "sms_webhook_logs", "social_account_insight_daily", "social_ad", "social_captured_post", "social_kpi_goal", "social_own_post_metric", "social_post", "social_post_analysis", "social_post_comment", "social_post_metric_snapshot", "social_post_stat", "social_post_transcript", "social_profile", "social_profile_snapshot", "social_remix_output", "social_swipe_collection", "social_tracked_account", "social_video_composition_version", "social_video_project", "social_video_variant", "social_watchlist_hit", "soft_delete_cascade_job", "soft_delete_edge", "source_authority", "space_payload", "stage_ref_kind", "stamped_write_table", "structure", "structured_list", "studio_cleaned_segments", "studio_concept_items", "studio_documents", "studio_module_segments", "studio_raw_segments", "studio_recording_chunks", "studio_recording_segments", "studio_run", "studio_session", "studio_session_settings", "study_attempt", "study_goal", "study_media", "study_plan", "study_plan_block", "study_plan_day", "study_reminder_context", "study_reminder_delivery", "study_session", "study_source_chunk", "study_streak", "study_structured_section", "superseded_policy", "support_session", "support_session_event", "surface", "system_announcement", "system_context_item", "system_context_item_org_value", "system_error", "system_orgs", "system_write_failure", "t13_backfill_ledger", "t13_default_ledger", "t13_row_column_events", "tag", "task", "task_user_state", "taxonomy_node", "team", "template_context_items", "template_scope_types", "templates", "test_handset_inbox", "test_handset_verification", "thread", "tool", "tool_battle", "tool_battle_cell", "tool_binding", "tool_bundle", "tool_call", "tool_call_facts", "tool_canary_run", "tool_catalog_cache", "tool_catalog_call", "tool_catalog_call_attempt", "tool_catalog_call_detail", "tool_catalog_endpoint", "tool_catalog_entry", "tool_catalog_provider", "tool_definition_version", "tool_executor", "tool_feature_scorecard", "tool_surface_defaults", "tool_test_sample", "tool_ui", "tool_ui_incident", "tool_ui_version", "topic_placement_queue", "transcript", "trigger_event", "udt_dataset_fields", "udt_dataset_row_versions", "udt_dataset_rows", "udt_dataset_template", "udt_dataset_template_fields", "udt_document", "udt_document_snapshot", "udt_structured_list_items", "udt_workbook_snapshot", "ui_client", "ui_decision_pick", "ui_surface_action", "ui_surface_agent_pref", "ui_surface_agent_role", "ui_surface_client_tool", "ui_surface_config", "ui_surface_item_type", "ui_surface_value", "ui_surface_write_target", "univer_payload", "unsubscribe_token", "uploads_inflight", "user", "user_achievement", "user_acquisition_facts", "user_acquisition_facts_stored", "user_acquisition_facts_stored_watermark", "user_active_context", "user_analysis_preference", "user_email_preference", "user_entity_state", "user_feedback", "user_follows", "user_form_profile", "user_markdown_sample", "user_memory", "user_preference", "user_profile", "user_secret", "user_secret_audit", "user_secret_grant", "user_stat", "user_storage_usage", "user_surface_state", "users_calendar_feed", "users_notion_sync_source", "vault_fill_approvals", "vault_fill_devices", "vault_fill_nonces", "visibility_cache", "visibility_epoch", "voice", "war_room", "wbx_demo", "wbx_guidance", "wbx_highlight", "wbx_pattern", "wbx_recipe", "wbx_screenshot", "wbx_seo_audit", "wc_claim", "wc_impairment_definition", "wc_injury", "wc_report", "web_analysis_item", "web_brand", "web_brand_asset", "web_brand_choice", "web_brand_exclusion", "web_brand_offering", "web_brand_persona", "web_brand_relation_kind", "web_brand_review", "web_brand_testimony", "web_business_fact", "web_business_location", "web_channel_analytics_daily", "web_crawl_event", "web_crawl_preset", "web_crawl_schedule", "web_crawl_session", "web_crawl_url", "web_discovered_item", "web_domain_category", "web_domain_category_observation", "web_finding", "web_gsc_page_stat", "web_link_edge", "web_listing_publisher", "web_location_listing", "web_news_item", "web_offering_template", "web_page", "web_page_content", "web_page_evidence", "web_page_sitemap", "web_property", "web_provider", "web_result", "web_screenshot", "web_site", "web_site_endpoint_rule", "web_site_item_config", "web_site_offering", "web_sitemap", "web_snapshot", "web_tag_manager_snapshot", "web_temp_brand_firmographic", "web_temp_brand_presence", "web_temp_brand_recognition", "web_voice_fingerprint", "web_youtube_video", "webhook_deliveries", "webhook_dispatch_state", "webhook_test_receipt", "webhooks", "wf_node_data_slot", "work_claim", "work_item", "workbook", "worker_heartbeat", "workflow", "workflow_card", "workflow_checkpoint", "workflow_checkpoint_value", "workflow_comparison", "workflow_definition_overview", "workflow_definition_version", "workflow_idempotency", "workflow_job", "workflow_node_events", "workflow_node_outcome", "workflow_plan", "workflow_plan_event", "workflow_plan_sample", "workflow_recovery_audit", "workflow_review_issue", "workflow_run", "workflow_run_cost", "workflow_run_facts", "workflow_run_log", "workflow_runtime_surface", "workflow_template", "workflow_trigger", "workflow_trigger_fire", "workflow_work_item", "working_document", "write_guard_key", "youtube_quota_day", "youtube_search", "youtube_video"]; type StoreRefusalCode = (typeof STORE_REFUSAL_CODES)[number]["code"]; type StoreDoorName = (typeof STORE_DOORS)[number]["name"]; type EntityToken = (typeof ENTITY_TOKENS)[number]; type KernelTableName = (typeof KERNEL_TABLES)[number]["name"]; /** * VAL-8. Who wrote a value. `user`, `agent`, `system` — enforced by every write * door, and the three retired words (`human`, `ai`, `code`) are translated by * the store's own `custom.actor_word`, never by a caller. */ type Actor = (typeof ACTOR_VOCABULARY)[number]; /** The words the store still accepts and rewrites, mapped to what they become. */ type RetiredActorWord = keyof typeof RETIRED_ACTOR_WORDS; /** * VAL-2. Why a value is missing. A value is never blank for an unexplained * reason: it either holds something or it says one of these four words. */ type AbsenceReason = (typeof ABSENCE_REASONS)[number]; /** The closed key set of one value envelope (VAL-1 … VAL-4). */ type ValueEnvelopeKey = (typeof VALUE_ENVELOPE_KEYS)[number]; /** The closed key set of one ranked alternate (VAL-3). */ type ValueAlternateKey = (typeof VALUE_ALTERNATE_KEYS)[number]; /** * REC-4. `heavy` is indexed storage with Rules on write; `light` is * whole-document storage with Rules on read. Per Table, one store. */ type StorageMode = (typeof STORAGE_MODES)[number]; /** REC-15. One Rule object, four uses. */ type RuleUse = (typeof RULE_USES)[number]; /** * VAL-5 / VAL-6. The words that may NOT appear inside a value envelope: * Visibility and access belong to a Field and to a Record, never to a value. * The store refuses each of them by name and so does this package's mirror. */ type PerValueAccessWord = (typeof PER_VALUE_ACCESS_WORDS)[number]; /** FLD-11. The parity floor: the field type a person picks in the UI. */ type ParityFieldType = (typeof PARITY_FIELD_TYPES)[number]["parity_type"]; /** * THE ONE REGISTRY, as a type: every kind a column can be DECLARED as. * * `ParityFieldType` above is the parity FLOOR — the answer to "which of the fourteen * is this field". It is not the answer to "what may somebody pick", and reading it as * though it were is exactly how `signature` came to be a field shape the store accepted * (`custom.doc_sign` takes no other) and no screen could offer: VERIFIER-10, F6. * `custom.field_kinds()` is the registry, and this is generated from it. */ type DeclarableFieldKind = (typeof DECLARABLE_FIELD_KINDS)[number]["kind"]; /** FLD-1. The five behaviors a Field can have. One, exactly, and closed. */ type FieldBehavior = (typeof PARITY_FIELD_TYPES)[number]["behavior"]; /** The node kinds `custom.rule_eval` evaluates. */ type RuleNodeKind = (typeof RULE_NODE_KINDS)[number]["node"]; /** * REC-32. The seven table types, closed. The parenthesised names are the * retired ones the doctrine records; never coin an eighth. */ declare const TABLE_TYPES: readonly ["entity", "detail", "reference", "ledger", "restricted", "system", "deprecated"]; type TableType = (typeof TABLE_TYPES)[number]; /** REC-33. The two origins. A table we ship in schema `custom` is `standard`. */ declare const TABLE_ORIGINS: readonly ["standard", "custom"]; type TableOrigin = (typeof TABLE_ORIGINS)[number]; /** REL-1. Ownership is one fact, stored once, read from the field's side. */ declare const RELATION_FLAVORS: readonly ["owned", "referenced"]; type RelationFlavor = (typeof RELATION_FLAVORS)[number]; /** REL-2. What happens to the far side, separate from flavour. */ declare const ON_DELETE: readonly ["cascade", "set_null", "restrict"]; type OnDelete = (typeof ON_DELETE)[number]; /** REL-3. A snapshot is a frozen copy in the relation's payload, never a pointer. */ declare const RELATION_BINDINGS: readonly ["live", "snapshot"]; type RelationBinding = (typeof RELATION_BINDINGS)[number]; /** REL-7. */ declare const RELATION_CARDINALITIES: readonly ["one", "many"]; type RelationCardinality = (typeof RELATION_CARDINALITIES)[number]; /** FLD-7. Where a Field's values come from. */ declare const FIELD_SOURCES: readonly ["manual", "formula", "agent", "synced"]; type FieldSource = (typeof FIELD_SOURCES)[number]; /** FLD-9. A Formula declares whether it computes on read or on write. */ declare const COMPUTE_ON: readonly ["read", "write"]; type ComputeOn = (typeof COMPUTE_ON)[number]; /** * AGT-7 / FLD-12. A Field's sensitivity sets a ceiling a merge field can never * widen — and these are THE STORE'S four words, checked against its own guard. * * This list used to read `standard · sensitive · secret`, which the store has * never accepted: writing a Field with `sensitivity: "standard"` is refused * with "the field has to say how sensitive its values are, and it says * standard". The knob `custom/field_sensitivity_levels` keys off these same * four words to decide which level may read and edit each one, so a package * carrying three different words could never have agreed with it. Corrected * against the live store, 2026-09-18. */ declare const FIELD_SENSITIVITIES: readonly ["public", "internal", "confidential", "restricted"]; type FieldSensitivity = (typeof FIELD_SENSITIVITIES)[number]; /** DYN-17 / §D. Which tier a MERGE FIELD's value is delivered in. */ declare const DELIVERIES: readonly ["inline", "on_demand", "auto"]; type Delivery = (typeof DELIVERIES)[number]; /** * FLD-12. WHETHER AN AGENT MAY SEE A FIELD'S VALUES, and these are the STORE'S * four words — not the merge field's delivery tiers. * * `Field.context_policy` used to be typed as `Delivery` here, which is a * different question with a different vocabulary: writing a Field with * `context_policy: "inline"` is refused with "the field has to say * whether an agent may see its values, and it says inline". Delivery is about * HOW MUCH of a value a merge field carries into a turn; this is about WHETHER * the value reaches an agent at all, and conflating them let a screen offer a * word the store has never accepted. Corrected against the live store, * 2026-09-18. */ declare const CONTEXT_POLICIES: readonly ["include", "summarize", "exclude", "on_request"]; type ContextPolicy$1 = (typeof CONTEXT_POLICIES)[number]; /** DYN-3. The eight sources, closed. Relationships and rules are not sources. */ declare const MERGE_FIELD_SOURCES: readonly ["literal", "record", "state", "actor", "platform", "user_input", "tool", "derived"]; type MergeFieldSource = (typeof MERGE_FIELD_SOURCES)[number]; /** DYN-4. What a merge field resolves INTO. The consumer never learns which. */ declare const MERGE_FIELD_SEMANTIC_TYPES: readonly ["value", "reference", "resolver", "computed", "collection"]; type MergeFieldSemanticType = (typeof MERGE_FIELD_SEMANTIC_TYPES)[number]; /** DYNAMIC-VALUES §A. Any number of these; never fused into the source. */ declare const MERGE_FIELD_MODIFIERS: readonly ["scoped", "temporal", "collection", "live", "fallback", "formatted", "required"]; type MergeFieldModifier = (typeof MERGE_FIELD_MODIFIERS)[number]; /** DYN-12. The five override policies. Exactly one, and it outranks the ladder. */ declare const OVERRIDE_POLICIES: readonly ["must_supply", "shown_overridable", "shown_locked", "server_fixed", "derived"]; type OverridePolicy = (typeof OVERRIDE_POLICIES)[number]; /** DYNAMIC-VALUES §C. What a resolved merge field's freshness was. */ declare const FRESHNESS: readonly ["live", "cached", "snapshot"]; type Freshness = (typeof FRESHNESS)[number]; /** REC-1. How a Table shows itself. */ declare const TABLE_DISPLAYS: readonly ["list", "grid", "board", "calendar", "timeline"]; type TableDisplay = (typeof TABLE_DISPLAYS)[number]; /** * What KIND of refusal it was. The mapping from SQLSTATE to code lives in * `/core`, and it is checked against `STORE_REFUSAL_CODES` — the list of every * SQLSTATE the store's own bodies raise, generated from the live catalog. A * code the store can raise and this union cannot name is a hole, and the * real-door suite fails on it. */ type RecordsErrorCode = /** `PT409` — somebody else's write won. The record clock moved under you. */ "stale_write" /** * The call needs an organization and none was carried (the platform's `organization_required`; the entity * doors' MX002). Never resolved by guessing one: the person is shown their memberships and picks. */ | "organization_required" /** `42501` — a door. Either the schema is revoked, or the store is switched off, or this principal may not pass. */ | "door" /** `23514` — a Rule, a shape guard, or a validation the store enforces refused it. */ | "refused_by_rule" /** * `22004` / `22023` / `22P02` — the call itself was malformed: a missing id, a * patch that is not an object, or a value that does not fit the type the * store holds for that Field. The store's own message names the value and the * type it could not be read as. */ | "invalid_argument" /** `02000` — the record is not here (deleted, never existed, or another organization's). */ | "not_found" /** `23503` — something it points at is not there. */ | "missing_reference" /** `23505` — that thing is already here. */ | "already_exists" /** `0A000` — the store does not do this yet, and says which part. */ | "not_supported" /** `53400` / `22012` — the store ran out of something, or the arithmetic could not be done. */ | "store_limit" /** * `40001` — the read-access snapshot this connection carries is older than a * write the reader has already observed, so the store refused to answer at * all rather than hand back something they just lost. Retry on a fresh * connection; it is the one refusal in this list that is worth repeating. */ | "stale_read" /** * `57014` — the store cancelled the statement at its own timeout. Nothing was * refused on its merits and nothing was written; the same call can succeed on * a smaller page or a quieter moment. With `stale_read`, one of the only two * refusals in this list worth repeating. */ | "timed_out" /** * THE DOOR THAT DOES NOT EXIST YET. Not an error condition in the database — * this package asked for a door that is not in the live catalogue, so it * refused to guess. `door_absent` always names the door and the lane that * owns it; it is never a silent no-op and never an empty list. */ | "door_absent" /** * `PGRST202` / `PGRST205` — PostgREST could not find the function or the * schema. The database this client is pointed at is not serving the record * store: the schema is not exposed, or the grants are not there. */ | "store_not_served" /** * `PT428` — the move was not refused and it did not happen: a stage gate whose * `on_fail` is `require_approval` filed a request with the people who can * answer it, and left the record exactly where it was. The store's own * sentence is the gate's own sentence, and the DETAIL carries the approval. * * It is the one code in this list that is not a failure. A screen that drew it * as one would tell somebody their work was rejected when it is being * considered; a screen that drew it as success would move the card while * somebody is still deciding. `custom.pipeline_move` answers an object on this * path rather than raising, so a caller only meets PT428 when the move went * through the ORDINARY write door — which is most of them. */ | "needs_approval" /** * THE CALL NEVER REACHED THE STORE. Not a refusal — a transport failure: the * browser lost the network, the gateway answered with an HTTP status and no * body, the request was cancelled. supabase-js hands these back with an EMPTY * `code` (a `FetchError`) or with the HTTP status in it (`"404"`, `"502"`), * neither of which is a SQLSTATE, and until 2026-09-22 they all landed in * `internal` — which is the one classification that tells a screen nothing, * and which made the package print a sentence about ITSELF to the person * (lane TAILS-6). Nothing was written, and the same call can simply be made * again, which is what separates it from `internal`. */ | "unreachable" /** Anything the mapper could not place. It still carries the store's own words. */ | "internal"; /** A refusal, in the store's own words. */ interface RecordsError { code: RecordsErrorCode; /** THE STORE'S message, verbatim. Never paraphrased. */ message: string; /** THE STORE'S hint, verbatim — this is where the remedy is written. */ hint?: string; /** The SQLSTATE, so a caller can be exact when a code is not exact enough. */ sqlstate?: string; /** Whatever the store put in DETAIL, parsed when it was json. */ detail?: unknown; /** * TRUE when this package did not recognize the class it was handed, so a * caller can say so instead of reading the silence as "handled". * * 🚨 IT IS A FLAG AND A SEPARATE SENTENCE, NEVER AN APPENDIX TO `hint` * (lane TAILS-6, 2026-09-22). `mapPgError` used to append "@ai-matrx/records * did not recognize SQLSTATE … from checklistTemplates" ONTO `hint`, and * `hint` is the field every screen treats as THE REMEDY — the sentence a * person is told to act on. So a dropped connection on the Checklists tab * showed a plumbing company "Something went wrong at our end" over a line * about a TypeScript package and a SQLSTATE. A note this package writes about * ITSELF is for whoever debugs it and belongs nowhere a person reads. */ unmapped?: boolean; /** * THIS PACKAGE'S OWN NOTE, for an engineer. Never the store's words and never * a person's: screens render it out of sight (a `title` attribute, a * screen-reader line) or not at all. */ diagnostic?: string; } type RecordsResult = { ok: true; data: T; } | { ok: false; error: RecordsError; }; /** Narrowing helper for hosts compiled without `strictNullChecks`. */ declare function isRecordsErr(result: RecordsResult): result is { ok: false; error: RecordsError; }; /** * A result's data, or THROW its refusal as an `Error` carrying the store's sentence — for the places * a throw is the contract (a `createAsyncThunk` body, a loader whose caller catches and shows it). */ declare function unwrapRecords(result: RecordsResult): T; declare const ok: (data: T) => RecordsResult; declare const err: (error: RecordsError) => RecordsResult; /** * A `stale_write` carries everything the screen needs to show the conflict * rather than a toast: which version you wrote against, which one won, and the * value of every field you touched as it stands now. The store builds this and * this type is its shape — nothing is reconstructed on the client. */ interface StaleWriteDetail { expected_version: number; current_version: number; contested_fields: Record; } /** The parsed form of a `stale_write`, for `useRecordMutation`'s conflict state. */ interface WriteConflict extends StaleWriteDetail { record_id: Uuid; /** The store's own sentence — what the screen shows. */ message: string; /** The store's own remedy. */ hint: string; } /** * The structural shape of a PostgREST failure as supabase-js resolves it: a * PLAIN OBJECT parsed from the response body, NOT an `Error`. Reading * `.message` off `instanceof Error` discards the real database message on every * genuine failure. */ interface PgError { code?: string | null; message: string; details?: string | null; hint?: string | null; } /** What the validation mirror answers: the same sentence the trigger would raise. */ interface PredictedRefusal { /** The field key the store would name, when it names one. */ field_key?: string; /** The message the store's own body would raise, word for word. */ message: string; hint?: string; /** The store's structured detail, when its refusal carries one (e.g. `{ example }`). */ detail?: Record; sqlstate: string; /** * Which of the store's bodies would raise it, so a reader can go and check * that this mirror still tells the truth. */ predicted_by: string; } /** VAL-5 / VAL-6, named so a caller can say which word was the problem. */ interface ForbiddenEnvelopeWord { field_key: string; word: PerValueAccessWord; } /** A `uuid` as the store writes it. */ type Uuid = string; /** An ISO-8601 timestamp, as jsonb carries it. */ type Timestamp = string; /** * VAL-1. WHERE a value came from, addressed by a pointer the STORE interns — * `s1`, `s2`, `s3`. A writer supplies the source itself and the store interns * it; a writer that invents a pointer is refused by name. Interned once per * save: two pointers holding the same description is the defect the word * "interned" exists to prevent, and the store refuses that too. */ type ProvenancePointer = string; /** The description a pointer resolves to. Free-shaped by design: the store checks that it is an object, and the organization decides what it says. */ type ValueSource = Record; /** * VAL-3 / VAL-4. Another candidate for the same value, with the source it came * from and the RANK — the order an organization trusts its sources in, never a * score or a confidence a machine invented. Ranks are whole, start at 1, and * two alternates never claim the same one. They live INSIDE this record's * document; there is never a row per value. */ interface ValueAlternate { value: unknown; /** A pointer this record's `_sources` block resolves. */ src?: ProvenancePointer | null; rank: number; } /** * The value envelope. One per field key, in the record's `_values` block, with * the value itself sitting at the top level under the same key. * * The key set is CLOSED (`custom.value_envelope_keys()`). In particular it can * never carry any of the per-value access words (`PER_VALUE_ACCESS_WORDS`): VAL-5 puts those on the Field and on the Record, and VAL-6 says a * value that must be secret goes in a contained record with its own access. * The store refuses each of those words by name. */ interface ValueEnvelope { /** The per-value version, 1 or more. THE STORE WRITES IT — no caller sets it. */ ver: number; /** A provenance pointer this record's `_sources` block resolves. */ src?: ProvenancePointer | null; /** VAL-8. Who wrote it. */ actor: Actor; /** Only an agent acts on behalf of a person; a person's id. */ on_behalf_of?: Uuid | null; at?: Timestamp | null; /** VAL-2. Why it is missing. A value either holds something or says this. */ absent?: AbsenceReason | null; alternates?: ValueAlternate[] | null; /** * FLD-2's `dated` modifier: the WORLD clock for this value — when it was true * of the world, which is a different question from when it was written. Added * to the store's closed key set after this package's first generation, and * caught by `pnpm check:store-registry` rather than by anybody noticing. */ dated?: string | null; } /** * The one jsonb document. Field keys sit at the top level; the store's own * blocks are underscore-prefixed and are never a writer's value. */ interface RecordDocument { /** The store's interned provenance table: pointer -> source. */ _sources?: Record; /** The envelopes, keyed by field key. */ _values?: Record; /** FLD-10. Which type of record this is, selecting the Fields and Rules that apply. */ _type?: string; /** REC-7. Zero or one parent. Never two. */ _parent?: Uuid | null; [fieldKey: string]: unknown; } /** `custom.record` as the store holds it — the row around the document. */ /** * What `custom.record_write_graph` wrote — a parent, the rows that belong to it, and the * edges it stands on, all in one transaction. * * `edges` counts BOTH writers: the edges written through `public.assoc_add` (whose ids are * in `edge_ids`) and the relation targets written through `platform.relation_set`, which * answers a count rather than ids because a relation is one field's worth of targets and * not a list of independent edges. `relations` is that second number on its own, so a * caller can tell them apart instead of subtracting. */ interface RecordGraphWritten { parent_id: Uuid; table_id: Uuid | null; child_ids: Uuid[]; edge_ids: Uuid[]; children: number; edges: number; relations: number; /** The door's own sentence about what it did. Shown, never re-worded. */ how: string; } interface StoredRecord { id: Uuid; organization_id: Uuid; table_id: Uuid | null; /** `record` for ordinary rows, `kernel` for the nine kernel Tables (REC-27). */ data_class: string; data: RecordDocument; created_by: Uuid | null; updated_by: Uuid | null; created_at: Timestamp; updated_at: Timestamp; /** REC-23: soft, and reversible within `retention`. */ deleted_at: Timestamp | null; /** The RECORD clock. `recordUpdate` writes against it (optimistic concurrency). */ version: number; metadata: Record; custom_fields: Record; visibility: string; } /** * One value read back with everything the store knows about it — the shape * `custom.record_values_versioned` and `custom.value_read` answer in. This is * what a screen needs to explain a value (DYN-24) without a second query. */ interface ReadValue { field_key: string; field_id: Uuid | null; value: unknown; value_version: number | null; source: ValueSource | null; absent_reason: AbsenceReason | null; actor: Actor | null; on_behalf_of: Uuid | null; written_at: Timestamp | null; alternates: ValueAlternate[] | null; } /** * Why one field of a record came back empty — `custom.hidden_field_notice`, as * the read door attaches it under `_hidden`. It is the store's own sentence, so * a screen says "you need X to see this" instead of drawing a blank cell. */ interface HiddenFieldNotice { /** The field's sensitivity word. */ reason: string | null; /** The level this person would need. */ needs: string | null; /** The other way in — "a share of this one field with you". */ or: string | null; } /** * One row as the read door `custom.read_records` answers it: the id, the * document the store decided this reader may see, and the reader's level on the * Table. A field this reader may not see is PRESENT and null, with its reason * in `hidden` — the masking is the store's, never this client's. */ interface ReadRow { id: Uuid; document: RecordDocument; /** `public.permission_level` — the caller's level on the Table. */ level: string; hidden: Record; /** * A kept table's device copy holds a change to this row that has not reached the store yet (made * offline, or not sent so far). Only the offline data source sets it; a read from the store never does. */ waiting?: true; } /** * A ROW THE PERSON CANNOT OPEN (CHAIR-ACCESS b, by design): a row of a Confidential Table that the * reader is not named on comes back from the list doors as a bare header `{id, exists: true, * submitted_at}`, no values and no level. It is a fact ("it exists"), never a record to draw: a * screen that drew it painted a blank row. The client splits these out of `rows` and counts them in * `locked`; this is the one test for "is this the header". */ declare function isLockedStub(row: { document?: unknown; level?: unknown; } | null | undefined): boolean; /** Split a read page into the rows a person can open and the count of header-only stubs. */ declare function splitLockedRows(rows: readonly R[]): { rows: R[]; locked: number; }; /** * DOOR-SPEED. One key of a page's order, as `custom.read_records_page` takes it. `as` is the * column's own type — `number` sorts numerically (text that is not a number sorts last), * `date` sorts ISO dates and instants, `text` (the default) sorts by lower-cased text. A choice * column always sorts by the WORD a person sees; the store knows which columns are choices. * NULLS LAST both ways, record id as the tie-breaker. */ interface RecordPageSort { field: string; direction?: "asc" | "desc"; as?: "text" | "number" | "date"; } /** One page the store sorted, searched and counted: `total` is the matching set this reader may see. */ interface RecordPage { /** The rows this person can open. Header-only stubs of rows they cannot open are never in here. */ rows: ReadRow[]; /** * The matching set this reader can OPEN (stubs left out). Absent `locked` and `total` agree with * the old meaning. */ total: number; /** Rows the store listed only as a header (a Confidential row this person is not named on), across the whole table. */ locked?: number; limit: number; offset: number; /** * Sort keys the store SKIPPED because this reader cannot see that column (removed, or masked * from their seat). The page is still read; the screen says the sort was not applied. */ sort_ignored: string[]; /** * Columns of a SAVED VIEW's own filter the store SKIPPED because this reader cannot see them (WITHHELD-HONEST-2). * Only a filter marked `skip_withheld` is skipped; an explicit filter on such a column is refused by name. */ filter_ignored?: string[]; } /** * A row as the keyset door answers it: the read row plus the `version` and `organization_id` the * store read it at, in the same statement as its values (so a document and its version never * disagree). `version` is null only on a Confidential header row, which says nothing but "it exists". */ type KeysetRow = ReadRow & { version: number | null; organization_id: Uuid; }; /** * AP3-KEYSET-DOOR. One page of `custom.read_records_keyset`: the same rows and order as `RecordPage`, * paged by an opaque `cursor` (null on the last page) instead of an offset, so nothing is skipped or * repeated while others write. Re-reading named rows (`ids`) answers `total: null` and no cursor. */ interface RecordKeysetPage { rows: KeysetRow[]; total: number | null; /** Header-only stubs this page carried (rows this person cannot open); never in `rows`. */ locked?: number; limit: number; cursor: string | null; /** As on `RecordPage`: sort keys skipped because this reader cannot see that column. */ sort_ignored: string[]; /** As on `RecordPage`: filter columns of a saved view skipped because this reader cannot see them. */ filter_ignored?: string[]; } /** DOOR-SPEED. One change in a `recordChangeMany` batch. */ type RecordChange = { op: "insert"; data: RecordDocument; } | { op: "update"; record_id: Uuid; patch: RecordDocument; expected_version?: number | null; } | { op: "archive"; record_id: Uuid; }; /** What one change did, in the order the changes were handed in. */ type RecordChangeResult = { op: "insert"; id: Uuid; } | { op: "update"; id: Uuid; version: number; } | { op: "archive"; id: Uuid; archived_at: string; }; /** * One revision of one record, as `custom.io_revisions` answers it, newest * first. `version` is the record's own version at that point — the number a * screen hands back as `expectedVersion` so the store, not the screen, decides * whether someone else got there first. */ interface RecordRevision { version: number; changed_at: string; changed_by: Uuid | null; summary: string | null; } /** A whole record as `recordRead` answers it, through `custom.read_record`. */ interface RecordRead { record_id: Uuid; /** The masked document. A hidden field is present and null. */ document: RecordDocument; /** Why each masked field is masked, in the store's words. */ hidden: Record; /** * FLD-9 / REC-19. Which Rule version produced each computed value. Present * only where the store has computed provenance for this record. */ computed: Array<{ field_key: string; field_id: Uuid; value: unknown; rule_id: Uuid; rule_version: number; computed_at: Timestamp; }>; /** * WHY `computed` IS EMPTY, when it is empty because nobody could read it. * * `custom.computed_provenance` is a footnote beside the record and its door is not * open to a person's seat (no EXECUTE for `authenticated`, measured 2026-09-21). It * used to fail the WHOLE read, so an organization's own owner was told "You do not * have access to this" about a record he could read — see `core/client.ts`. The * record comes back now, and this carries what the footnote's door said, so a screen * that draws rule provenance can say it could not read it rather than draw nothing * and mean two different things by it. `null` means the footnote was read fine (or * was never asked for). */ computedUnavailable?: RecordsError | null; /** * Asked with `withVersion: true`: the version this read saw, so a safe edit (`recordUpdate` with `expected_version`) needs no * second call. Read beside the document in the same round of requests; `null` when the store * could not answer it (a write then refuses as "version unread", never as last-write-wins). */ version?: number | null; } /** * THE TWO LANES THE ARCHIVED-ITEMS LAW NAMES (Arman, 2026-09-09) — the same * split every other list in the platform makes between what is mine and what * is the organization's. * * · `mine` — what I archived. * · `org` — what anybody in this organization archived. * * `mine` is by construction a SUBSET of `org`: the store applies it as a * narrowing conjunct beside the read-access ladder, so a lane can never show a * record the ladder would have refused. */ declare const ARCHIVE_LANES: readonly ["mine", "org"]; type ArchiveLane = (typeof ARCHIVE_LANES)[number]; /** THE DEFAULT LANE. The organization's archive, because "where did that job go?" is almost never a question about yourself. */ declare const DEFAULT_ARCHIVE_LANE: ArchiveLane; /** What each lane is called on a screen, and what it actually answers. */ declare const ARCHIVE_LANE_LABEL: Record; declare const ARCHIVE_LANE_MEANS: Record; /** A word that is not a lane is not silently answered as one. */ declare function isArchiveLane(word: unknown): word is ArchiveLane; /** * One archived record, as `custom.read_records_archived` answers it: an * ordinary `ReadRow` — same id, same masked document, same level, same hidden * notices as it had while it was live — plus the two facts that only an archive * needs. * * `archivedBy` is null when the archiver is not a member of this organization * any more (their name is not this screen's to learn) or when the history * partition that held the SOFT_DELETE has rolled away. Null is an ANSWER and * gets its own sentence; it is never printed as an empty space. */ interface ArchivedRow extends ReadRow { archivedAt: Timestamp; archivedBy: Uuid | null; archivedByName: string | null; } /** The row shape the door returns over the wire, before it is folded. */ interface ArchivedDoorRow { id: Uuid; document: unknown; level: string; archived_at: Timestamp; archived_by: Uuid | null; archived_by_name: string | null; } /** * WHEN IT WAS ARCHIVED, THE WAY A PERSON SAYS IT — "22 September 2026 at 01:53". * Not an ISO string, and never a bare relative word like "yesterday" on its * own: somebody deciding whether to bring a record back is deciding about a * particular day's work. */ declare function archivedWhen(at: Timestamp, locale?: string): string; /** * THE WHOLE SENTENCE A ROW IN THE ARCHIVE CARRIES. Both halves of the question * the archived-items law asks — who, and when — and an honest sentence when the * store could not answer the first half, rather than a blank where a name goes. */ declare function archivedByLine(row: Pick, locale?: string): string; /** * WHAT AN EMPTY ARCHIVE SAYS, PER LANE. An empty list is an answer and it names * the lane it is empty for, so "nothing here" can never be read as "nothing was * ever archived" while the other lane holds twenty records. */ declare function emptyArchiveLine(lane: ArchiveLane): string; /** A document that survived the round trip is the same document — used by the guard. */ declare function sameDocument(a: RecordDocument, b: RecordDocument): boolean; /** `public.permission_level`, in the store's own order. */ /** * `edit_content` (Notion's "Can edit content") sits between `commenter` and `editor`: it may change * the rows and page content of a thing, never its structure (columns, views, settings) or its * sharing — those stay with `editor` and `admin`. */ type PermissionLevel = "viewer" | "commenter" | "edit_content" | "editor" | "admin"; /** The order the store writes them in, lowest first — `public.permission_level` itself, retired `edit_content` included (the code ladder that labels and offers levels is `@ai-matrx/data/access` PERMISSION_LEVELS). */ declare const STORE_PERMISSION_LEVELS: readonly PermissionLevel[]; /** Whether `held` is the same rung as `needed` or a higher one. Nothing held is never enough. */ declare function atLeast(held: PermissionLevel | null | undefined, needed: PermissionLevel): boolean; /** A level word the store sent, or null when it sent something this package does not know. */ declare function asPermissionLevel(word: unknown): PermissionLevel | null; /** The higher of two levels — what a person holds when two ways in both let them through. */ declare function highestLevel(left: PermissionLevel | null | undefined, right: PermissionLevel | null | undefined): PermissionLevel | null; /** * What one subject's level is, as `custom.my_levels` answers it. `null` is an * ANSWER — "you hold nothing on this" — and never a missing row: a screen that * could not tell "no access" from "not asked yet" would draw one of them as the * other. */ interface MyLevel { id: string; level: PermissionLevel | null; } /** The two levels a custom table can hold. */ type TableLevel = "organization" | "confidential"; /** One readers rule: `field` is one of the table's own fields that names a person or a team. */ interface TableReaderRule { field: string; level?: "viewer" | "commenter" | "editor"; } /** The last approval an organization's admin gave this table (`null` when none ever did). */ interface TableLevelApproval { level: TableLevel; reason: string; approver_role: "owner" | "admin"; approver_user_id: string; approved_on: string; } /** `custom.table_level_facts` verbatim. */ interface TableLevelFacts { table_id: string; organization_id: string; level: TableLevel; readers: TableReaderRule[]; maker_is_reader: boolean; /** Who approves a change of level: the table's organization admins, or the platform (Arman). */ set_by: "org_admin" | "platform"; /** True only for an owner/admin of the table's organization on an ordinary custom table. */ can_set: boolean; last_approval: TableLevelApproval | null; /** * True when THIS person is told the table's name and nothing about its columns (a Confidential * table, knob `access/confidential_hides_structure`, `custom.may_see_table_structure`). Its * column list is then empty by decision, never "no columns yet". Absent from a store that * predates it: read as false. */ structure_hidden?: boolean; } /** What `setTableConfidential` / `setTableOrganization` answer. */ interface TableLevelSet { token: string; table_id: string; level: TableLevel; approval_id: number; approver_role: "owner" | "admin"; from: TableLevel; readers?: TableReaderRule[]; } /** * REC-1. A Table declares its fields, exactly one Home, and the properties * `display`, `ordered`, `heavy` | `light`, `retention` and `detail`. */ interface Table { id: Uuid; organization_id: Uuid; /** * The access ladder's Table "Level": organization · public · confidential · private. Absent is * the organization's own. Confidential and Private records have no "Shown to". */ level?: string | null; /** The token this Table is addressed by. */ slug: string; name: string; label_singular: string | null; label_plural: string | null; icon: string | null; color: string | null; /** REC-32. One of the seven, closed. */ type: TableType; /** REC-11. A detail Table inherits only: no direct shares, never a Home. */ detail: boolean; parent_token: string | null; /** AGT-1 / AGT-2. On by default for a custom table; an organization turns it off. */ agent_writable: boolean; display: TableDisplay | null; ordered: boolean; /** REC-4. `heavy` is indexed with Rules on write; `light` is the whole document with Rules on read. */ weight: StorageMode; /** REC-23. How long a soft delete stays reversible. */ retention_days: number | null; /** REC-2. Every Table has one; without it a record cannot be a chip. */ title_field: string | null; /** * T8 / CD-CORE-15. The Field KEY whose value is each record's type (a Shape's Kind); which columns a record * has follows it (`applies_to_types` on a Field). Absent or null: every record has every column. */ type_field?: string | null; /** The field ids this Table declares, in declaration order. */ fields: Uuid[]; default_sort: string | null; row_order: string | null; /** REC-14. Where this Table lives. Exactly one primary Home. */ home_id: Uuid | null; /** The feature that keeps this Table out of the person's lists (`snapshot`, `copying`, …); absent for a person's own table. */ kept_for?: string | null; /** REC-27. One of the nine, defined in code and not editable by Migration. */ is_kernel: boolean; created_by: Uuid | null; updated_by: Uuid | null; created_at: Timestamp; updated_at: Timestamp; version: number; metadata: Record; /** The old lane word; read `shown_to` and `published_to_web` (access ladder), which the store answers now. */ visibility: string; /** Access ladder "Shown to" (which lists show it; never a lock). Absent on a store that does not answer it. */ shown_to?: string | null; /** Access ladder "Published to the web". Absent on a store that does not answer it. */ published_to_web?: boolean; /** * Lane 10 FD. Part of the business's day-one data (Patients, Therapists, Services) — a mark, not * storage. Absent is false. Only admin on the Table changes it (custom._table_shape_guard). */ foundation?: boolean; /** * Present only on what `tableFind({ …, keptFor })` answers for an ARCHIVED table of that slug and * kept_for (the store's `archived_at`); such an answer carries only `id`, `organization_id` and this. */ archived_at?: Timestamp | null; } /** * REC-33. `origin` is `standard` or `custom`, and it is orthogonal to `type`. * A Table we ship in schema `custom` is `standard` — the schema name is not the * origin. */ interface RegisteredTable { token: string; type: TableType; origin: TableOrigin; /** REC-34. Carried per table type: true for Entity and Detail, false for the other five. */ custom_fields_enabled: boolean; } /** * REC-3 / REC-26. A Home is where a Table appears. The declared organization * Home is the tree's root; every additional Home is a referenced carrying * relation from the Home record to the Table record, which is why this shape * names a relation id rather than a second placement column. */ interface Home { table_id: Uuid; home_record_id: Uuid; organization_id: Uuid; /** `declared` for the Table's own Home, `carried` for an additional one. */ kind: string; relation_id: Uuid | null; } /** What `tablePropose` / `tableList` hands back about how full a Table is (REC-N-5). */ interface TableCapacity { records: number; ceiling: number; full: boolean; /** The knob that decides the ceiling, named so a person can act on it. */ knob: string; } /** * WHAT ONE PASS OF `custom.table_archive` ANSWERS WITH — the numbers a screen * needs to draw a bar and write a sentence, instead of a spinner and an * SQLSTATE (VERIFIER-10 F3, VERIFIER-11 F3). * * Archiving a table is a JOB, NOT A STATEMENT. `custom.record_delete` on a * Table recurses through everything the Table contains inside one transaction, * which is unbounded by construction: at 1,430 records it dies on `57014`, * "canceling statement due to statement timeout", and nothing is changed. The * remedy for a thing that cannot finish in one statement is more statements, * never a longer one — so the caller loops, passing its own `chunk`, until * `done`. * * IT IS RESUMABLE BECAUSE IT IS STATELESS. There is no job row to lose: * `remaining` is read off the records themselves on every call, so a browser * closed halfway, a failed pass or a deploy mid-run all leave a table that is * half archived and a next call that picks up exactly where the last stopped. * Which is why a screen driving this may NEVER say "nothing was changed" after * a pass that moved rows — `archived_total` is what really landed. * * NOTHING IS DELETED. Every row goes through `custom.record_delete`, so every * guard, history capture and outbox row still happens and `recordRestore` * still brings any of them back. */ interface TableArchiveProgress { table_id: Uuid; /** The table's own name, so a sentence can use it rather than an id. */ table_name: string; /** What THIS pass archived. */ archived: number; /** Records of this table still live. Zero is the end of the row work. */ remaining: number; /** Records this table has ever held: `remaining` + `archived_total`. */ total: number; /** Records of this table already archived, across every pass ever made. */ archived_total: number; /** Whether the Table record itself has been archived. */ table_archived: boolean; /** Nothing live is left to do. The caller's loop ends here. */ done: boolean; /** The chunk the door actually took on — it clamps what it is handed. */ chunk: number; /** The store's own sentence about this pass, in the product's voice. */ message: string; /** * An earlier run of this archive was started and has not finished (an open archive event). A * screen reading this after a reload offers to carry on, never a fresh button (BREAKER-1 B-F13). * Absent from a store that predates it. */ in_progress?: boolean; /** * THE REVERSIBLE ACTION'S SIZE LINE (knob `custom/archive_confirm_over`, organization-overridable): * a table with at most this many live records is archived at once and announced with Undo; one * with more is asked about first, with the count. Absent from a store that predates it — a screen * then asks first, as it always did. */ confirm_over?: number; } /** * BRINGING A WHOLE TABLE BACK — ONE PASS OF IT (`custom.table_restore`, lane TABLE-ACTIONS). * * The mirror of {@link TableArchiveProgress}: the Table and its structure come back in the first * pass, then its records in the order they went, then what was built on it, all from the one * archive event. The CALLER LOOPS until `done` (`client.tableRestoreWhole` does it). */ interface TableRestoreProgress { table_id: Uuid; table_name: string; /** Records THIS pass brought back. */ restored: number; /** The Table, its Fields, rules and views THIS pass brought back (the first pass). */ structure_restored: number; /** Forms, views, portals, child Tables… built on the Table THIS pass brought back. */ built_on_restored: number; /** Rows the archive took that are still waiting. */ remaining: number; built_on_remaining: number; /** Rows refused on their own now (a value another row took since): left archived and named. */ left: number; left_ids?: Uuid[]; /** Each row left archived, with the store's own reason for it. */ left_reasons?: Record; /** Restoring events of this table still open (a re-archive mid-restore leaves two). */ events_open?: number; /** Whether the Table record itself is live. */ table_restored: boolean; /** Nothing the archive took is still waiting. The caller's loop ends here. */ done: boolean; chunk: number; archive_event: Uuid | null; message: string; } /** * WHAT A STORED COLUMN DIFFERS FROM THE SPEC THAT ASKED FOR IT IN (lane PLATFORM-APP-DATA). * * `custom.table_ensure` never retypes, relabels or drops a column a table already has — a retype is * a conversion a person decides. It used to ignore the difference without a word; now it names * each one, aspect by aspect, and still changes nothing. This shape is the contract a release-time * drift check will read, so it stays this small: * * - `type` the column's kind: its parity type when it has one, else its behavior (`text`, `range`, …) * - `format` how it is shown (`long`, `phone`, `currency`, …); `null` when it has none * - `label` the column's name * - `multi` / `required` booleans (absent = `false`) * - `unique` whether it holds a `unique` rule * - `spec` the spec for that column could not be read at all; `declared` is the store's sentence * * The declared side is the spec as the store WOULD store it, so `long_text` compares as the * `text` + `long` it is stored as — never a false difference. */ /** `extra`: a column the table holds that the spec no longer declares (kept, never removed). */ type FieldDriftAspect = "type" | "format" | "label" | "multi" | "required" | "unique" | "spec" | "extra"; interface FieldDrift { /** The column's key. */ field: string; aspect: FieldDriftAspect; /** What the column holds now. */ stored: string | boolean | null; /** What the spec asked for (for `spec`, the store's sentence about why it could not be read). */ declared: string | boolean | null; } /** * The store's `drift` answer, typed. `null` when the store did not send one — a `table_ensure` * body older than `lane12_c_an_ensured_table_says_what_differs_from_its_spec.sql` — which means * "not compared", never "no difference". An entry of an aspect this package does not know is kept * as `spec`, so a newer store is never silenced. */ declare function parseFieldDrift(raw: unknown): FieldDrift[] | null; /** * EVERYTHING THIS FILE NEEDS TO KNOW ABOUT A FIELD, AND NOTHING ELSE. * * A full `Field` satisfies it, and so does every narrower shape the store * hands to a screen — `CaptureField` on a phone with no network, the Field * documents `custom.form_public` and `custom.booking_public` publish to a * stranger. Asking for the whole `Field` would have meant the capture sheet * keeping its own `Number(raw)`, which is exactly the duplication this file * exists to end. */ interface CoercibleField { /** Named so the doc above is checkable: a full {@link Field} satisfies this. */ key: string; label?: string | null; name?: string | null; /** FLD-1. One of five behaviors; an unknown word is treated as text. */ type?: string | null; multi?: boolean | null; unit?: string | null; format?: string | null; config?: Record | null | undefined; relation_target?: string | null; } /** * The kind of value one Field holds, resolved from its DECLARATION only — the * behavior, the modifiers, the format, the relation target and the config, * because those are what the store stores. A screen that guessed from a value * would answer differently for an empty record. * * `plain_text`, `long_text`, `number` and `boolean` are behaviors that carry * no parity type of their own; every other word here is a parity type. */ declare const FIELD_KINDS: readonly ["attachment", "checkbox", "currency", "datetime", "email", "entity_reference", "formula", "json", "long_text", "lookup", "member", "multi_select", "number", "percent", "phone", "relation", "rollup", "select", "text", "url"]; /** * 🚨 THE UNION IS DERIVED FROM THE LIST ABOVE, and the list is what the * coverage test walks. Add a kind here and the test drives it; give it no arm * in `coerceTypedAnswer` and the test says so, instead of the new kind falling * quietly through `default:` and a value of the wrong shape reaching the store * — which is the whole defect this file closes. */ type FieldKind = (typeof FIELD_KINDS)[number]; /** The kernel Table ids REC-31 pins the two special relations to. */ interface KernelTargets { /** The kernel `File` Table — a relation pointing here is an attachment. */ file?: string | undefined; /** The kernel `Person` Table — a relation pointing here names a person. */ person?: string | undefined; } /** * Which kind of value this Field holds. * * This is the ONE classifier. `@ai-matrx/records-ui`'s `editorKindFor` — which * decides which editor to DRAW — delegates to it, so the editor a person types * into and the coercion applied to what they typed can never disagree about * the same column. They did disagree before this moved here; that is the whole * class of grid defect September was spent closing. */ declare function fieldKindFor(field: CoercibleField, kernel?: KernelTargets): FieldKind; /** One Field's options, indexed the way a typed word has to be looked up. */ interface ChoiceOptions { /** * Lower-cased label, option key and option id, each pointing at the OPTION * RECORD'S ID — which is what a list Field stores (FLD-5/FLD-6). */ byWord: Map; /** The labels, in order, so a refusal can say what is on offer. */ labels: string[]; } /** What one answer became, or the sentence saying why it did not. */ type Coerced = { value: unknown; words?: string; } | { refusal: string; unmatched?: string[]; unmatchedNames?: string[]; ambiguousNames?: string[]; }; /** One record a name matched. */ interface RelationNameMatch { id: string; /** What its name column holds. */ words: string; } /** A relation's target Table, indexed by the names a column holds. */ interface RelationNameIndex { /** `relationNameKey(name)` → the records of that name the reader may see. */ byName: ReadonlyMap; /** The target Table's name, for the sentence. */ tableName: string; /** The target Table's name column, so a screen can make a record a name matched nothing. */ titleField: string | null; } /** The answer of `custom.relation_names_match`. */ interface RelationNamesAnswer { table_id: string; table_name: string | null; title_field?: string | null; names: Array<{ name: string; matches: RelationNameMatch[]; }>; } /** * How two spellings of one name are told apart: case and runs of spacing do not * count. The store's `custom.relation_name_key` is the same rule. */ declare function relationNameKey(name: string): string; /** How an import splits a cell that holds several values: `;`, `,` or `|` — the store's own rule. */ declare function splitListCell(text: string): string[]; /** Index the store's answer the way the coercion reads it. */ declare function relationNameIndexOf(answer: RelationNamesAnswer): RelationNameIndex; /** Every name a relation cell carries, split the way the column reads it. */ declare function relationNamesIn(field: Pick, text: string): string[]; interface CoerceOptions { /** This Field's choices, when the caller has loaded them. */ options?: ChoiceOptions | undefined; /** The kernel File/Person Table ids, for classifying relations. */ kernel?: KernelTargets | undefined; /** * The Field's name as this caller writes it. Defaults to the Field's own * label. A screen passes the same words it printed above the box. */ label?: string | undefined; /** * A relation column's target, indexed by name (`relationNameIndexOf`). Without it a name in a * relation column is refused as before, and only ids pass. */ relationNames?: RelationNameIndex | undefined; /** The reader's locale, for the order of a numeric date (10/03/2026). Defaults to the runtime's. */ locale?: string | undefined; /** * The column SHOWS AS a percent (its "Shows as" format, which this package does not read), so a * typed `45%` is a percent here even on a number column. The caller scales it to the column's * own percent scale. */ showsAsPercent?: boolean | undefined; } /** One id, written the way the store writes one (REC-51's shape test). */ /** * SC-R / P12. Whether a relation's config makes it an ENTITY REFERENCE: target * mode `any` (REL-8) restricted by a non-empty `allowed_types`. */ declare function isEntityReferenceConfig(config: Record | null | undefined): boolean; /** The platform kinds an entity-reference Field may name, lower-cased, in its own order. */ declare function entityReferenceKindsOf(field: Pick): string[]; /** The Field's name in plain words — never its key on a screen. */ declare function coercionLabel(field: CoercibleField): string; declare function coerceTypedAnswer(field: CoercibleField, raw: string, opts?: CoerceOptions): Coerced; /** What a whole set of typed-in answers became. */ interface CoercedAnswers { /** Ready to send to the store. Only the keys that coerced cleanly. */ values: Record; /** Field key → the sentence saying why that answer was not written. */ refusals: Record; /** The field keys the caller sent that this table has no Field for. */ unknownKeys: string[]; } /** * Every typed-in answer on one screen, coerced together — the shape the two * public doors and the import wizard actually need. * * Keys the table has no Field for are reported rather than dropped: the store * refuses an unknown key by name and a caller that quietly deleted it would * hide a real mismatch between a page and its table. */ declare function coerceTypedAnswers(fields: readonly CoercibleField[], answers: Readonly>, opts?: { kernel?: KernelTargets | undefined; /** Choices per Field key, for the list columns. */ options?: ReadonlyMap | undefined; /** Field key → the words that screen printed above the box. */ labels?: Readonly> | undefined; /** Relation columns' targets, indexed by name, by field key (VISION-REACH G1). */ relationNames?: ReadonlyMap | undefined; }): CoercedAnswers; declare const BUTTON_DOES: readonly ["open_url", "run_action", "run_automation", "add_row"]; type ButtonDoes = (typeof BUTTON_DOES)[number]; /** What `config.button` holds. */ interface ButtonSettings { label: string; /** One of the table's color names (blue, green, …); absent, the button wears the neutral look. */ color?: string | undefined; /** Absent: nothing is set up yet, and a press says so. */ do?: ButtonDoes | undefined; url?: string | undefined; action_id?: Uuid | undefined; automation_id?: Uuid | undefined; /** W2-A `add_row`: the table the new row goes in; absent = this table. */ table_id?: Uuid | undefined; /** W2-A `add_row`: the new row's field key → this row's field key, or "@row" for this row's id (a link back). */ prefill?: Record | undefined; /** TEMPLATE-GAPS R3 `add_row`: the target table's row template the new row starts from (its values under prefill). */ template_id?: Uuid | undefined; } /** What `custom.button_press` answers. */ type ButtonPressed = { do: "open_url"; label: string; url: string; } /** W2-A: the row the press added (through custom.record_write), for the screen to open. */ | { do: "add_row"; label: string; table_id: Uuid; record_id: Uuid; template_id?: Uuid; } | { do: "run_action"; label: string; result: { ran?: number; records?: Array<{ record_id: Uuid; version: number; }>; } & Record; } | { do: "run_automation"; label: string; /** null when no automation this button starts met its conditions (status "skipped"). */ run_id: Uuid | null; automation: string | null; status: string | null; says: string | null; /** AUTOMATIONS-AIRTABLE: every automation whose trigger is this button, as each ran on the press. */ runs?: Array<{ run_id: Uuid; automation: string | null; status: string | null; says: string | null; }>; }; /** Whether a Field is a button column — `custom.field_kind_of`'s mirror for this one kind. */ declare function isButtonField(field: CoercibleField | null | undefined): boolean; /** A button column's settings, read off its declaration; null for any other column. */ declare function buttonOf(field: (CoercibleField & { label?: string | null; }) | null | undefined): ButtonSettings | null; /** The `{{field id}}` placeholders a link names, in order — so a settings screen can show them as names. */ declare function buttonUrlPlaceholders(url: string): string[]; /** * What a button's settings are missing before a press can work, in words; null when it is set up. * The store refuses the same cases (`custom._field_kind_shape_ok`, `custom.button_press`). */ declare function buttonNeeds(b: ButtonSettings): string | null; declare const NEWER_FIELD_KINDS: readonly ["rating", "duration", "created_by", "modified_by", "status", "address", "barcode", "rich_text", "count"]; type NewerFieldKind = (typeof NEWER_FIELD_KINDS)[number]; /** Which of the nine newer kinds a Field is, read off its declaration — `custom.field_kind_of`'s mirror. */ declare function newerKindOf(field: CoercibleField): NewerFieldKind | null; /** A rating's top star: its max Rule (1–10), else 5 — the store's own default. */ declare function ratingMaxOf(field: CoercibleField): number; /** Seconds as h:mm — and h:mm:ss only when there are seconds to show. 2700 → "0:45". */ declare function durationText(seconds: unknown): string | null; /** * A length of time as a person types it, in seconds. "45" and "45 min" are 45 minutes (the column * reads in h:mm, so a bare number is minutes, as in Airtable); "1:30" is an hour and a half; * "1:30:15" has seconds; "1h 30m", "2 hours", "90s" read as written. Null: not a length of time. */ declare function readTypedDuration(text: string): number | null; declare const ADDRESS_PARTS: readonly ["street", "city", "region", "postal_code", "country"]; type AddressPart = (typeof ADDRESS_PARTS)[number]; type AddressValue = Partial>; declare function isAddressValue(value: unknown): value is AddressValue; /** An address on one line, the way an envelope reads: "1420 Cedar Ridge Pkwy, Boulder, CO 80301, US". */ declare function addressValueText(value: unknown): string | null; /** * One typed line as an address in parts. "street, city, region postal, country" is read into its * parts when it has that shape; anything else is kept whole as the street, so nothing typed is lost. */ declare function addressFromText(text: string): AddressValue | null; /** A maps search for an address, opened in a new tab. */ declare function addressMapUrl(value: unknown): string | null; /** * `{id, name, actor}` as the store works it out (`custom.formula_value`). `actor` is the kind of * writer — a person (`user`), an agent (`agent`, with `id`/`name` the person it wrote for) or the * platform itself (`system`, with no id and no name). `name` is null for somebody outside the * organization. A value written before the store said `actor` is a person's. */ type PersonStamp = { id: string | null; name: string | null; actor?: "user" | "agent" | "system"; }; declare function isPersonStamp(value: unknown): value is PersonStamp; /** The words for who made or changed a record. */ declare const NOT_A_MEMBER_WORDS = "Not in this organization"; declare const SYSTEM_WRITER_WORDS = "System"; declare const AGENT_WRITER_WORDS = "Agent"; declare function personStampText(value: unknown): string | null; declare const STATUS_GROUPS: readonly ["todo", "in_progress", "done"]; type StatusGroup = (typeof STATUS_GROUPS)[number]; declare const STATUS_GROUP_WORDS: Record; /** Which group a status choice sits in; a choice the column names no group for is To do. */ declare function statusGroupOf(field: CoercibleField, choiceKey: string): StatusGroup; declare const BARCODE_SYMBOLOGIES: readonly ["code128", "code39", "ean13", "ean8", "upc_a", "upc_e", "itf", "qr", "data_matrix", "pdf417"]; /** Markdown read as plain words on one line — what a card title or a sentence shows. */ declare function richTextPlain(text: string): string; /** * A link destination as a browser would follow it: HTML entities and backslash escapes decoded, * spaces and control characters removed (`custom._entity_decoded`'s rules). Then only a web page, * an email address or a phone number is a link here; everything else is drawn as words. */ declare function safeLinkHref(raw: string): string | null; /** * The words one value of a newer kind reads as wherever only words fit — an export cell, a card, * a sentence. Null: not a newer kind, or nothing particular to say (the caller's own words apply). */ declare function newerKindWords(field: CoercibleField, value: unknown): string | null; /** * The words one value of a newer kind is EXPORTED or COPIED as: an address on one line, a length of * time as h:mm, who by name. A rating, a count and a barcode stay what they are, and rich text * stays its Markdown. Null: the value is written as it is stored. */ declare function newerKindExportWords(field: CoercibleField, value: unknown): string | null; /** FLD-3. A constraint attached to a Field. A Rule, never a behavior. */ interface FieldRule { /** * `unique` (FLD-3 / B1): no two live records of the Table hold the same value, compared * case- and outer-space-blind. The store enforces it under an advisory lock * (`custom._unique_rule_holds`); it is also what lets `recordUpsert` find "the" record by a key. * The mirror never predicts it — it needs a query. */ kind: "min" | "max" | "length" | "pattern" | "equals_field" | "differs_from_field" | "unique"; /** * The rule's own number or word: the least / the most for `min` / `max`, the * LONGEST for `length`, the pattern for `pattern`, the other column's key for * `equals_field` / `differs_from_field`. A `length` rule that only says how * SHORT a value may be carries `min` and no `value`. */ value?: string | number; /** * STORE-RULE-GAPS (the older grid's `patternHint`). On a `pattern` rule only: * how a person writes it, e.g. `"949-555-0142"`. The store refuses an example * its own pattern would refuse, and a refused value is told "Enter it like * 949-555-0142." (the hint, and `detail.example`). */ example?: string; /** * STORE-RULE-GAPS (the older grid's `minLength`). On a `length` rule only: the * fewest characters. A blank is `required`'s question, never "too short". */ min?: number; /** FLD-10. Empty means "wherever the Field applies". */ applies_to_types?: string[]; } /** * `custom.field` — the ONE definitions table (FLD-8), organization-scoped, so * two organizations add different fields to the same standard table. */ /** * WHICH OF THE OTHER RECORD'S COLUMNS A RELATION SHOWS (REL-DISP, 2026-09-21). * * A Table has ONE stored default reference column — its `title_field` — and until * this existed every relation pointing at that Table could display that column and * nothing else. A Jobs board could read "Maria Chen" but never "Maria Chen — * Rincon", and two columns could not be joined into one string at all. * * ABSENT MEANS THE TABLE'S OWN COLUMN. A field with no `display` resolves exactly * as it did before, so nothing changes for a column nobody has given a spec to. * * The store judges it once, in `custom._display_spec_for`: every column named must * exist on the target Table, and the refusal names the one that does not. It is * resolved by ONE body, `custom._words_for`, which `custom.record_words`, * `custom._card_words`, `custom.relation_words` and `custom.relation_words_many` * are all one-liners onto — so the thirteen store-side readers inherit it too. * * A display column that is itself a relation resolves ONE hop and never a second. */ interface RelationDisplay { /** The target's columns, in the order they are shown. */ columns: string[]; /** What goes between them. Defaults to a single space. */ separator: string; } interface Field { id: Uuid; organization_id: Uuid; /** Set when this Field extends a standard entity rather than a custom Table. */ entity_definition_id: Uuid | null; /** The token of the Table this Field belongs to. */ table_token: string | null; key: string; label: string; name: string | null; /** * When this Field was taken away (retired / archived), or null while it is live. Filled by the reads that * can answer a retired Field — `entityFields({ include_retired: true })`; absent from reads that never do. */ archived_at?: string | null; /** FLD-1. Exactly one of five. */ type: FieldBehavior; /** FLD-2. The shape of the value, never a second behavior. */ multi: boolean; /** FLD-2. The values carry their own dates — the world clock, not History. */ dated: boolean; /** FLD-3. Any number of attached validation Rules. */ rules: FieldRule[]; config: Record; required: boolean; default: unknown; sort: number | null; /** The Table this relation points at. */ relation_target: Uuid | null; relation_max: number | null; on_target_delete: OnDelete | null; /** REL-9. The reverse is visible from both ends and is NOT a second Field. */ inverse_key: string | null; /** REL-DISP. Which of the target's columns this one shows. Null = the Table's own. */ display: RelationDisplay | null; source: FieldSource; source_config: Record; /** FLD-9. A Formula declares whether it computes on read or on write. */ compute_on: ComputeOn | null; /** The unit, on the Field, because it changes the meaning. Never presentation. */ unit: string | null; format: string | null; /** AGT-7. A ceiling a merge field's delivery can never widen. */ sensitivity: FieldSensitivity | null; /** FLD-12. Whether an agent may see this Field's values: include · summarize · exclude · on_request. */ context_policy: ContextPolicy$1 | null; /** AGT-6. How often a `source = agent` Field is refilled. */ review_interval_days: number | null; /** * §D says this is on the wrong object and moves to the merge field. It is * still carried here because the live column is, and the client reads what * the store holds — never what the plan wishes it held. */ depends_on: Uuid[] | null; /** FLD-10. Which record types this Field applies to. Empty means all of them. */ applies_to_types: string[]; /** FLD-5 / FLD-6. A list field's choices are the records of THIS Table. */ options_table_id: Uuid | null; created_by: Uuid | null; updated_by: Uuid | null; created_at: Timestamp; updated_at: Timestamp; version: number; metadata: Record; visibility: string; } /** * FLD-11. What the person picked, and what the store says it is made of. The * list itself is generated from `custom.parity_field_types()`; this is its type. */ interface ParityFieldTypeDescriptor { parity_type: ParityFieldType; behavior: FieldBehavior; made_of: string; } /** AGT-8 / AGT-4. What an agent (or a person) proposes when a Field is missing. */ interface FieldProposal { table_id: Uuid; key: string; label: string; type: FieldBehavior; multi?: boolean; required?: boolean; config?: Record; relation_target?: Uuid; /** Why this Field should exist — what an approver reads before approving. */ because: string; } /** AGT-8. What a table proposal looks like, same shape of question. */ interface TableProposal { name: string; slug: string; title_field: string; fields: Array>; because: string; } /** * WHAT A PERSON SAYS WHEN THEY ADD A COLUMN — the argument of * `custom.field_declare`, and deliberately NOT a `Field`. * * A `Field` is what the store STORES: a behavior from a closed set of five, * modifiers beside it, a format, a unit, a relation target, a relation maximum, * an on-delete word, a compute_on, and the attached Rules that make a format * enforceable. A person adding a column knows none of that. They know they want * a date, or a person, or a list with these three choices in it. * * Every client that tried to bridge that gap itself got it wrong — the field * panel picked "Person" and the store read a Formula — so the bridge is the * STORE's, once, and this is the shape it takes. */ interface NewFieldDeclaration { /** What a person reads on the column. The only thing that is always required. */ label: string; /** One of the thirteen. Absent means one of the three plain behaviors below. */ parity_type?: ParityFieldType; /** Plain text, a long text or a plain number — the three that carry no parity type. */ plain?: "text" | "long_text" | "number"; /** * THE ONE WORD EVERY OTHER CALLER REACHES FOR. An agent, a script, an import * and this package's own table-declaring path all say `type`, and until * 2026-09-20 `custom._field_document_for` threw it away — a `number` became a * text column in silence. It now resolves all three vocabularies, so this is * named here rather than left as a shape only the store knows about. */ type?: FieldTypeWord; /** Derived from the label when absent, which is why the panel never asks for it. */ key?: string; /** T8 / CD-CORE-15. The record types this column applies to (its table's type field's choices). Absent: every record. */ applies_to_types?: string[]; required?: boolean; multi?: boolean; dated?: boolean; sort?: number; sensitivity?: FieldSensitivity; context_policy?: ContextPolicy$1; rules?: FieldRule[]; /** DEFECTS 7: `true` is the plain way to say `rules: [{ kind: "unique" }]`; the store adds the rule once. */ unique?: boolean; /** A choice list's choices, as words. The store keeps them as a Table (FLD-5 / FLD-6). */ options?: string[]; /** …or the Table they already come from, when a person picked an existing list. */ options_table_id?: Uuid; /** The currency symbol or code a currency field's numbers are in (FLD-N-1). */ unit?: string; /** A date field: a day, or a day and a time. */ kind?: "date" | "datetime"; /** A lookup or a rollup: the key of the relation Field on THIS table it travels along. */ via?: string; /** A lookup: the key of the value it reads on the far side. */ pick?: string; /** A rollup: what it works out, and of which far-side field (`count` needs none). */ agg?: "sum" | "count" | "min" | "max" | "avg" | "countall" | "counta" | "and" | "or" | "xor" | "arrayjoin" | "concatenate" | "arrayunique" | "arraycompact"; of?: string; /** * A rollup: WHICH linked records it adds up (CHAIR-MATH b, 2026-10-03). The same shape a saved * view's `filters` carries, written against the far table — a flat map of far-side column keys * (`{ status: "open" }`, choice columns by their words, windows as a view writes them) or a Rule * expression over far-side field IDs (`{ op: "eq", args: [{ field: "" }, { const: false }] }`). * The store validates it against the far table on declare and update; absent or `null` means * every linked record. Kept in `config.filter`. */ filter?: Record | null; /** A formula: the expression, in the same shape a Rule uses (REC-15). */ expr?: Record; /** * A formula IN THE LANGUAGE A PERSON TYPES — `{Visit fee} - {Deposit taken}` (GRID-PRIMITIVES * G3). The store parses it (`custom.formula_parse`), keeps the text in `config.formula_text` * and the expression it parses to in `config.expr`; send this OR `expr`, never both. */ formula_text?: string; /** * LANE SC-R — an `entity_reference` column's kinds: the platform entity tokens it may point at * (`note`, `site`, `agent` …), kept by the store in `config.allowed_types`. */ allowed_types?: string[]; compute_on?: ComputeOn; relation_max?: number; /** * REL / FLD-11. The Table this column points at, when it is neither a Person * (`member`) nor a File (`attachment`). The store has taken it since * 2026-09-20 and no client type named it, so a person with an Invoice table * and a Line table could not declare the link through this package at all. */ relation_target?: Uuid; /** REL-2. What happens to this record when the thing it points at goes. */ on_target_delete?: OnDelete; /** * REL-DISP. Which of the target's columns this one shows, and what joins them. * A bare column name and a plain list are both accepted by the door and * normalized; leaving it out keeps the target Table's own reference column. */ display?: RelationDisplay | string[] | string; /** * Presentation and behavior settings the store carries verbatim — a long * text's `multiline`, a list's existing options table. The door has always * read it (`p_spec -> 'config'`) and this interface never offered it, so a * package-owned table could not declare its own multi-line column. */ config?: Record; /** A text column that holds a signature (`custom.doc_sign` accepts no other). */ format?: string; /** * STORE-RULE-GAPS (the older grid's `allowOther`). A choice list only: a value * that is none of the choices is ADDED to the list as typed instead of * refused. Stored as `config.allow_other`; absent means off. */ allow_other?: boolean; /** LANE 10 P4 — a rating's top star, 1 to 10 (5 when absent); the store keeps it as a max Rule. */ max?: number; /** LANE 10 P4 — a status's groups: choice words → `todo`, `in_progress` or `done`. */ status_groups?: Record; /** LANE 10 P4 — a barcode's symbology, one of `BARCODE_SYMBOLOGIES`; absent takes any code. */ symbology?: string; } /** * Every word `custom._field_document_for` resolves for `type`: any parity type * in `PARITY_FIELD_TYPES`, any behavior those types are made of, or one of the * plain synonyms a person or an agent actually writes. No count is written down * here on purpose — the parity floor is regenerated from * `custom.parity_field_types()` and grew from thirteen to fourteen the day * `checkbox` landed, which is how the store's own refusals came to name a list * that no longer matched it. */ type FieldTypeWord = DeclarableFieldKind | FieldBehavior | "number" | "integer" | "decimal" | "float" | "long_text" | "string" | "autonumber" | "created_time" | "modified_time" | "entity_reference" | NewerFieldKind; /** * What `custom.field_update` accepts. * * THE SETTINGS **AND** THE BEHAVIOR. The door has had a behavior arm since * T12 — say `parity_type`, `plain` or `type` and every value of the column is * converted (or kept in `_retired` with its reason) by * `custom._field_type_converts_values`. This interface named only the settings, * so the one client that needed to move a field back onto the behavior it is * written against had no door and reached for `custom.record_update` instead, * which writes the document under the guards rather than through them. */ /** One existing choice of a list, re-worded in place (`FieldPatch.options`). */ interface FieldOptionEdit { /** The option record's id, as `fieldOptions` answers it. */ id: string; /** What the choice reads as from now on. */ words: string; } interface FieldPatch { label?: string; /** T8 / CD-CORE-15. The record types this column applies to; `[]` makes it apply to every record. */ applies_to_types?: string[]; required?: boolean; dated?: boolean; sort?: number; sensitivity?: FieldSensitivity; context_policy?: ContextPolicy$1; unit?: string; rules?: FieldRule[]; /** * The choices of a choice list, rewritten, IN ORDER (lane CHOICE-COLUMN-EDIT, 2026-09-27). * * Each entry is either `{ id, words }` — `id` is the option record's id as `fieldOptions` * answers it — which RE-WORDS that choice in place (its key never changes, so every cell * holding it now reads the new words), or plain words: the live choice with the same words * (any case), else a retired one brought back, else a new choice. Every choice takes the * position it has in this array. A live choice the array does not name is RETIRED (never * deleted): cells holding it keep it and read as its words. All in one transaction. */ options?: Array; /** * Words ADDED to a choice list's choices without touching the others: a live same-words * choice adds nothing, a retired one is brought back, the rest are appended. Refused by name * beside `type` / `parity_type` / `plain`. */ options_add?: string[]; /** One of the thirteen — a change of what this column HOLDS, not of a setting. */ parity_type?: ParityFieldType; /** …or one of the three plain behaviors, …*/ plain?: "text" | "long_text" | "number"; /** …or the one word every other caller reaches for (see `NewFieldDeclaration`). */ type?: FieldTypeWord; /** * FLD-2. The shape of the value — one, or several. * * This comment used to say that a patch moving `multi` ALONE changed nothing * and that the behavior word had to be sent with it. That was true, and it * was a description of a silent failure rather than a contract: the door * answered "saved" and the column still held one. `custom.field_update` has * had a real settings arm for it since 2026-09-20 (matrx-frontend * `migrations/campaign/fix7b_field_multi_arm.sql`), which also moves a * relation's `relation_max` beside it — `custom.validate_values` counts links * against that number, so moving `multi` without it would tick a box and * still refuse the second record. * * A CHOICE LIST IS THE ONE EXCEPTION, and it is refused by name rather than * ignored: for `select` / `multi_select`, "one answer or several" IS the * parity type, so send the type instead. */ multi?: boolean; /** REL / FLD-11: re-point the column. The old edges are withdrawn by the door. */ relation_target?: Uuid; on_target_delete?: OnDelete; /** * REL-DISP. Which of the target's columns this one shows. `null` REMOVES the * spec and the column goes back to whatever the table it points at is titled by; * the door refuses it by name on a column that points at nothing. */ display?: RelationDisplay | string[] | string | null; /** SEAT-SUITES: whether the store builds an index for this column, and a unique one. */ promoted?: boolean; unique?: boolean; /** * STORE-RULE-GAPS. A choice list's "other values allowed" setting — see * `NewFieldDeclaration.allow_other`. Refused by name on any other column; a * retype that stays a list keeps it. */ allow_other?: boolean; /** LANE 10 P4 — a status's groups, changed in place: choice words or keys → `todo` | `in_progress` | `done`. */ status_groups?: Record; /** LANE 10 P4 — a barcode's symbology; null takes any code again. */ symbology?: string | null; /** LANE 10 P4 round 3 — a rating's new top star, 1 to 10; scores above it are set aside in `_retired`. */ max?: number; /** NOTION-PROPS-3 — a button column's settings, whole (`config.button`); refused on any other column. */ button?: ButtonSettings; /** NOTION-PROPS-3 — a link to its own table says one record waits on another (a timeline draws it). */ dependency?: boolean; /** W2-A 4 — a Last changed time column watches only these field keys (`config.only_fields`); null = the whole record. */ only_fields?: string[] | null; /** NOTION-PROPS-3 — a one-record link to its own table names each record's parent: the table nests sub-items. */ sub_items?: boolean; /** CLOSE-LINK (CD-LINK-03) — a link's picker offers only this saved view's records (`config.limit_to_view`); null takes it off. */ limit_to_view?: string | null; /** CLOSE-LINK (CD-LINK-05) — a link follows the linked record (`live`, the default) or keeps a copy of it from when it was linked (`snapshot`, `config.binding`); turning snapshot on takes a copy for every link already there. */ binding?: "live" | "snapshot"; /** CLOSE-LINK (CD-LINK-08) — a link carries access: whoever can see a linked record can see this one (`config.carries`), at most at `carries_max`. */ carries?: boolean; /** CLOSE-LINK (CD-LINK-08) — the most a carrying link conveys: `viewer` (the default) or `editor`. */ carries_max?: "viewer" | "editor"; /** CLOSE-LINK (CD-LINK-09) — two records may point at each other along this link (`config.loops`). */ loops?: boolean; /** CLOSE-LINK (CD-LINK-04) — the other tables a link also points at (`config.target_tables`, its own table always first); null or [] = only its own table. */ target_tables?: readonly string[] | null; /** §D / T7: which fields a worked-out column reads. */ depends_on?: Uuid[]; /** * A rollup: WHICH linked records it adds up — the same shape as `NewFieldDeclaration.filter` * (a saved view's filter written against the far table). `null` removes it, and the rollup adds * up every linked record again. `custom.field_update` validates it against the far table. */ filter?: Record | null; /** * FLD-9. WHEN a worked-out column works its answer out: when somebody reads the record, * or when somebody saves it. * * This door accepted the word, answered success and threw it away until 2026-09-21 * (matrx-frontend `migrations/campaign/tails2_a_formula_says_when_it_works_itself_out.sql`) * — its spec builder used a fixed key list that did not carry it, so a person declaring a * write-stamped formula through this door silently got a read-time one. It is applied now, * in both arms, and the records already saved are brought with it. * * TWO THINGS IT REFUSES BY NAME rather than forcing quietly: a column that is not worked * out by the store has no moment to be worked out at, and a ROLL-UP adds up OTHER records, * so an answer stamped when this record was last saved would be wrong the moment one of * them changed — a roll-up is always `read`. */ compute_on?: ComputeOn; /** * FLD-11 / REC-15. RE-AIMING A WORKED-OUT COLUMN: the expression, in the same * shape a Rule uses and read by the same evaluator — `{"op":"concat","args": * [{"field":"note"}]}`. Every `{"field": …}` in it names a live Field of this * organization, or `custom._field_document_for` refuses the whole patch by * name and writes nothing. * * `custom.field_update` carries this in its BEHAVIOR arm — the arm a type * word opens — so send it WITH the word for what the column is * (`type: "formula"`, or `parity_type` / `plain`). The door's spec builder * reads `coalesce(p_patch -> 'expr', v_old -> 'config' -> 'expr')`, so a * re-type that does not carry one deliberately keeps the expression the * column already had; the settings arm has no `expr` key at all, so `expr` * alone is not a change this door makes. `STORE-TAILS-2` asked for the field * because the one client that needed to re-aim an existing formula had no * typed way to say it and reached for `custom.record_update`, which writes the * Field document under the guards rather than through them. */ expr?: Record; /** * RE-AIMING A FORMULA IN THE LANGUAGE A PERSON TYPES (GRID-PRIMITIVES G3). Same arm as * `expr` — send it with `type: "formula"`; the store parses it and keeps both the text and * the expression. Measured on the dev clone 2026-09-23: `{"type":"formula","formula_text": * "{Visit fee} * 2"}` re-aims the column and keeps its other settings. */ formula_text?: string; } /** * Whether a choice column takes values that are not one of its choices * (`config.allow_other`, STORE-RULE-GAPS). Off unless the column says so. */ declare function allowsOtherValues(field: Pick): boolean; /** * What `custom.field_duplicate` answers (DUPLICATE PROPERTY, Notion N5): the copy's id, key and name, and * how many records had a value copied into it. `values` is `not_a_value` for a link, formula, lookup or * roll-up column, whose copy holds no document values of its own. */ interface FieldDuplicated { field_id: string; key: string; label: string; values_copied: number; values: "copied" | "not_a_value"; } /** One option, as `_choices` names it and as `optionsOf` returns it. */ interface ChoiceOption { /** The stable key the cell actually holds. */ key: string; /** What a person reads. */ label: string; /** The option RECORD's id, for a caller that needs the row itself. */ id?: string; /** True when the option was retired: still readable, no longer pickable. */ retired?: boolean; /** Why it is no longer offered, in a sentence, when it is retired. */ reason?: string | null; } /** * The stable key of an option RECORD as `custom.field_options` returns it. * * It lives in `metadata.option_key`, not in the document: FLD-5 keeps a category to one title * field, and the key is the store's own bookkeeping rather than a column anybody declared. * The fallback is the same slug the store derives, so an option written by something that has * not caught up still answers. */ declare function optionKey(option: StoredRecord): string; /** What a person reads on an option record. */ declare function optionLabel(option: StoredRecord): string; /** * The store's own slug, mirrored so a client can predict a key without a round trip. * `custom.choice_slug` is the original; a title with nothing a-z0-9 in it gets a short hash of * itself there, and this returns the empty-ish fallback rather than guessing a hash — a caller * that needs the real key for such a title reads it off the option. */ declare function choiceSlug(word: string): string; /** * Does this stored (or typed) value name this option? The key, the label and the option's own * id all name the same choice, and a control has to recognize every one of them: what the read * door hands it is the LABEL, what the store holds is the KEY, and what a screen written before * this contract sends is the ID. */ declare function isTheChosen(option: StoredRecord, value: unknown): boolean; /** Every value of one cell, as strings, whether the Field is multi or not. */ declare function choiceValuesOf(value: unknown): string[]; /** * What the read door said about one column's choices: the key behind the label, and whether the * option was retired and why. Returns an empty array when the document carries no `_choices` * entry for that column, which is also what a document written before this contract looks like. */ declare function choicesOf(document: RecordDocument | undefined, fieldKeyOrId: string): ChoiceOption[]; /** True when this cell's value points at a choice that has since been retired. */ declare function holdsARetiredChoice(document: RecordDocument | undefined, fieldKeyOrId: string): boolean; /** True when a token looks like a uuid — which a choice value is no longer allowed to be. */ declare function looksLikeAnId(value: unknown): boolean; /** The Feature Knob `custom/choice_nudge`: ask (the default), always add, or never add. */ type ChoiceNudge = "ask" | "always_add" | "never_add"; declare const CHOICE_NUDGES: readonly ChoiceNudge[]; /** Any answer the knob door gives, as one of the three; anything unknown is the default, `ask`. */ declare function asChoiceNudge(value: unknown): ChoiceNudge; /** What `decideTypedChoice` answers. */ type TypedChoiceDecision = /** Nothing was typed. */ { decision: "empty"; } /** The words name a live choice (by its words or its key, any case): write `key`. */ | { decision: "chosen"; key: string; label: string; } /** Ask the person. `keepOffered` is true only when the column takes other values. */ | { decision: "ask"; words: string; keepOffered: boolean; } /** Add the words to the choices and the cell takes them — without asking (`always_add`). */ | { decision: "add"; words: string; } /** Keep the words as typed, an "other" value (`never_add` on a column that takes other values). */ | { decision: "keep_as_typed"; words: string; } /** The words are not one of the choices and nothing may add them (`never_add`, closed column). */ | { decision: "not_a_choice"; words: string; }; /** A choice as either door hands it: an option record (`fieldOptions`) or a `_choices` entry. */ type ChoiceLike = StoredRecord | ChoiceOption; /** * THE ONE DECISION for words typed into a choice cell. * * `options` are the column's choices; a retired one is not pickable, so words naming only a * retired choice are treated as new (adding them brings the retired choice back, which is what * the store does). `nudge` absent or unknown is `ask`. */ declare function decideTypedChoice(args: { words: string; options: readonly ChoiceLike[]; allowOther: boolean; nudge?: ChoiceNudge | string | null | undefined; }): TypedChoiceDecision; /** How many records hold one choice (`custom.field_choice_usage`), keyed by the option's id. */ interface ChoiceUsage { key: string; words: string; retired: boolean; /** Live records the caller may see whose cell holds the choice. */ records: number; } /** Where the records of a removed choice go. */ type ChoiceRehome = { then: "move"; to: string; } | { then: "keep"; } | { then: "clear"; }; /** One cell as it was before a rehoming save — what its undo writes back. */ interface ChoiceCellBack { record_id: string; value: unknown; } /** What `fieldUpdateRehomingChoices` answers. */ interface ChoicesRehomed { field_id: string; rehomed: Array<{ choice_id: string; words: string; then: ChoiceRehome["then"]; to: string | null; records: number; }>; cells_back: number; /** Send `{ patch: { options: undo.options }, cells_back: undo.cells_back }` to put it all back. */ undo: { options: Array<{ id: string; words: string; }>; cells_back: ChoiceCellBack[]; }; } /** * THE CHOICES A LIST NO LONGER NAMES THAT RECORDS STILL HOLD — the ones the editor must ask about. * `beforeIds` is the list as the store answered it, `afterIds` the list as the person has it now. */ declare function removedChoicesInUse(beforeIds: readonly string[], afterIds: readonly string[], usage: Readonly> | null | undefined): Array<{ id: string; words: string; records: number; }>; /** “1 record uses “X-ray”.” · “3 records use “X-ray”.” — the question's first line. */ declare function recordsUseSentence(records: number, words: string): string; /** What the answer will do, said before Save: “3 records move to “Exam”.” */ declare function rehomeSentence(records: number, words: string, rehome: ChoiceRehome, toWords?: string): string; /** One choice as the detail / selection documents hand it back. */ interface PickListItem { id: string; label: string; /** Never present on the selection read: that read is the one a non-owner may see. */ description?: string | null; help_text?: string | null; group_name?: string | null; icon_name?: string | null; } /** A pick list as `pick_list_get` / `pick_list_for_selection` / `pick_list_update` answer it. */ interface PickListDocument { id?: string; list_id?: string; list_name?: string; description?: string | null; organization_id?: string | null; /** The choices in order (the update door answers this flat shape). */ items?: PickListItem[]; /** The choices by group (the read doors answer this shape). */ items_grouped?: Record; [key: string]: unknown; } /** One choice to write when a list's choices are replaced. Either casing of each key is read by the door. */ interface PickListItemInput { label: string; description?: string; help_text?: string; group_name?: string; icon?: string; } /** One row of the pick-list index (`custom.pick_list_index`): what a picker needs to name a list. */ interface PickListIndexEntry { id: string; list_name?: string | null; description?: string | null; item_count?: number | null; organization_id?: string | null; } /** What `custom.pick_list_index` answers: the lists a person may open, and the archived ids. */ interface PickListIndexDocument { lists?: PickListIndexEntry[]; archived_ids?: string[]; [key: string]: unknown; } /** The store's behavior words a column can be changed to. */ type RetypeBehaviour = "text" | "range" | "boolean"; /** `custom.migrate_retype`'s answer for a Field. */ interface FieldRetyped { verb: "retype"; field_id: string; was: string | null; now: string; changed: boolean; migration_id?: string; /** Records that hold a value for this column after the change. */ records_still_holding_a_value?: number; /** Values of this column now kept aside in `_retired`, with their reason. */ values_in_retired_for_this_field?: number; at?: string; } /** * `custom.field_retype_preview`'s answer: what a change of a column's kind WILL do, counted by the store * running the change itself in a subtransaction it rolls back (lane F2, D11). It cannot disagree with the * change, because it is the change. */ interface FieldRetypePreview { /** Records holding a value before the change. */ held_before: number; /** Records still holding a value after it (converted, or already fitting). Null when `limited`. */ converts: number | null; /** Values the change keeps aside in `_retired`, with their reason. Null when `limited`. */ kept_aside: number | null; /** * The column holds too many values to run the change ahead of time without holding the table (ADV-1 F8), * or another editor held it. No counts then; `held_before` is still the number of values held. */ limited?: boolean; /** Why it is limited: "large" (too many values) or "busy" (another editor holds the table). */ why?: string; /** Up to five of the values kept aside, as words. */ examples: string[]; /** Choices the change makes from the column's words (a change to Choice or Multi-choice). */ choices_added: number; } /** * `custom.migrate_merge`'s answer (T5 / REC-21): the other record merged into the survivor. Its * values the survivor did not hold moved across; the ones that differed are kept as ranked * alternates with their source (or in `_retired` when the key is not a declared field); every * link and child pointing at it now points at the survivor; it is archived and its id resolves to * the survivor. `migration_id` is what `migrateUndo` takes. */ interface RecordsMerged { verb: "merge"; winner: string; loser: string; migration_id: string; values_taken: number; values_copied: number; alternates_added: number; values_retired: number; relations_retargeted: number; relations_detached_as_duplicates: number; resolves_to?: string | null; at?: string; } /** `custom.migrate_split`'s answer. The original keeps its id; the moved values live on `new_record`. */ interface RecordSplit { verb: "split"; kept_the_id: string; new_record: string; migration_id: string; moved: string[]; old_id_resolves_to?: string | null; at?: string; } /** `custom.migrate_extract_parent`'s answer. The named values were COPIED up into `parent`, and the record now sits under it. */ interface ParentExtracted { verb: "extract_parent"; record_id: string; parent: string; was_under: string | null; migration_id: string; at?: string; } /** * `custom.migrate_retype`'s answer for a RECORD (test 9 / REC-N-18): the record moved to another table of * the same organization and KEPT ITS ID, so every link to it still resolves. The values whose column the * new table lacks are `misfits`: taken off the record and kept in History on `migration_id`, with the * reason — neither coerced nor deleted. `migrateUndo(migration_id)` puts the record back on its table * with every value it held. */ interface RecordMoved { verb: "retype"; record_id: string; kept_the_id: boolean; from_table: string; to_table: string; migration_id: string; /** The values that did not fit, by key, exactly as they were. */ misfits: Record; misfits_are?: string; at?: string; } /** One row of `custom.migrations`: a recorded Migration on one target, and whether it was put back. */ /** `custom.history_retention`'s answer: the organization's floor and (when asked) one table's days. */ interface HistoryRetention { organization_id: string; table_id: string | null; floor_days: number; table_days: number | null; /** The store's own sentence. */ says: string; } interface MigrationEntry { id: string; verb: string; target_kind: string; target_id: string; note: string | null; applied_at: string; applied_by: string | null; undone_at: string | null; } /** `custom.migrate_undo`'s answer: the Migration it put back. */ interface MigrationUndone { undone: string; verb: string; kind: string; record_id: string | null; version_after?: number | null; also_restored?: number; ids_unaliased?: number; /** A split or an extracted parent: the record the Migration made, archived by the undo. */ removed?: string | null; at?: string; } /** * THE MIRROR OF `custom.field_value_convert`: does `value` survive the change to `to` (the * behavior word, and for `range` the kind — `number`, `date`, `datetime`)? An absence always * survives; a list survives only when every member does. */ declare function valueConverts(to: { type: string; kind?: string | null; }, value: unknown): boolean; /** What a retype will do to the values already written, counted before anything is changed. */ interface RetypePreview { /** Records holding a value that will be converted and stay in the column. */ converts: number; /** Records holding a value that will be kept aside (in `_retired`, with the reason). */ keptAside: number; /** Up to five of the values that will be kept aside, to show the person. */ examples: string[]; /** The count covers only the groups the store answered (a ceiling was reached). */ partial: boolean; } /** Count a column's distinct values (value → how many records hold it) against the change. */ declare function previewRetype(to: { type: string; kind?: string | null; }, groups: ReadonlyArray<{ value: unknown; count: number; }>, partial?: boolean): RetypePreview; /** The checks the mirror can judge on one value. */ type JudgedRule = { kind: string; value?: string | number | undefined; min?: number | undefined; }; /** The first check `value` fails, or null when every check keeps it. An absence always passes. */ declare function ruleThatRefuses(rules: ReadonlyArray, value: unknown): JudgedRule | null; /** A rating's checks with its top star as the `max` (the store writes the top star as that Rule). */ declare function rulesWithTopStar(rules: ReadonlyArray, topStar: number): Array; /** What new checks will do to the values already written, counted before anything is saved. */ declare function previewRuleChange(rules: ReadonlyArray, groups: ReadonlyArray<{ value: unknown; count: number; }>, partial?: boolean): RetypePreview; /** The seven table types. Only these two carry custom fields (REC-34, DD-011). */ type CustomFieldTableType = "entity" | "detail"; /** What `custom.entity_table` answers about a registry token. */ interface EntityTableFacts { token: string; schema_name: string; table_name: string; type: CustomFieldTableType; title_column: string | null; /** The name a person reads. Never the type word. */ label: string; /** * 57 of the 643 have no `organization_id`. They carry the column like every * other one, but a VALUE on them would belong to nobody — the guard finds an * organization's Fields through the row's own `organization_id` — so the * value doors refuse them BY NAME rather than writing something unowned. */ has_organization: boolean; has_deleted_at: boolean; } /** One custom field of a standard row, as the read door hands it back. */ interface EntityFieldValue { id: Uuid; key: string; label: string; type: Field["type"]; parity_type?: ParityFieldType; format?: string; unit?: string; multi?: boolean; required?: boolean; sort?: number; sensitivity?: Field["sensitivity"]; options_table_id?: Uuid; relation_target?: Uuid; /** The value itself, or undefined when this row has none. */ value?: unknown; /** VAL-1…VAL-8: who wrote it, when, on whose behalf, in which version. */ written?: { ver?: number; actor?: string; on_behalf_of?: string | null; at?: string; src?: unknown; absent?: unknown; alternates?: unknown; dated?: unknown; }; } /** * REC-53 IN ONE ANSWER: a standard row is its real columns, plus the base * contract, plus its organization's custom fields — three named blocks, never * one flat bag, so nothing can quietly shadow anything. */ interface EntityRecordRead { token: string; label: string; type: CustomFieldTableType; id: Uuid; organization_id: Uuid; /** The registry's `title_column` of this row, when it has one. */ title: string | null; /** The row's own columns, `custom_fields` removed. */ columns: Record; /** The custom values, by key. */ custom: Record; /** Their envelopes, by key. */ custom_written: Record; /** The definitions, in the organization's own sort order, each with its value. */ fields: EntityFieldValue[]; live: boolean; } /** AP-4: one custom row that links to a platform record, and which of its fields does the linking. */ interface EntityBackLinkItem { record: { token: "record"; id: Uuid; label: string | null; }; table_id: Uuid; table_label: string | null; field_id: Uuid; field_key: string; field_label: string | null; organization_id: Uuid; linked_at: string | null; } /** What `custom.entity_back_links` answers: the target, one page of linking rows, and where the next page starts. */ interface EntityBackLinks { target: { token: string; id: Uuid; label: string | null; }; items: EntityBackLinkItem[]; next_cursor: string | null; } /** What `custom.entity_row_write` answers: which row, whose, and whether anything changed. */ interface EntityRowWritten { id: Uuid; token: string; organization_id: Uuid; /** True when every value already matched: nothing was written and the version did not move. */ unchanged?: boolean; /** True when the call had no record id and the door added this row (a token whose create_via is "insert"). */ created?: boolean; } /** One row the filter matched. */ interface EntityRecordMatch { id: Uuid; title: string | null; value: unknown; } interface EntityRecordsFound { token: string; label: string; key: string; value: unknown; rows: EntityRecordMatch[]; count: number; } /** * What a person knows when they add a column. The SAME spec `fieldDeclare` * takes for a custom table — the store turns it into the document its guards * demand, so a standard table gets the whole type vocabulary rather than a * second, poorer one. */ type NewEntityFieldDeclaration = Record & { label: string; type?: string; options?: string[]; }; /** * SCR-12. May this person add a column to this standard table, and if not, the * sentence saying why — so the control is ABSENT with a reason rather than dead * when pressed. Filling in the fields that already exist is not admin work. */ /** * LANE 7 W2. One standard table's Fields across every organization a list spans, each with its * organization and — for a Choice — its options keyed by the option's stable key. An * organization the reader may not reach is NAMED under `unavailable` with the store's sentence. */ interface EntityFieldsAcross { fields: Array | null; }>; unavailable: Array<{ organization_id: Uuid; reason: string; }>; } interface EntityFieldRights { token: string; label: string; may_declare: boolean; reason: string | null; may_fill_in: boolean; } /** One stage of a board: the KEY the store keeps, and the LABEL a person reads. */ interface PipelineStage { /** The option's stable key — what a cell holds, and what a move is written with. */ key: string; /** What the column heading says. Renaming a stage rewrites no record. */ label: string; /** A retired choice can still be READ on a record that holds it; it cannot be picked anew. */ retired: boolean; } /** What each Rule of a pipeline is about. Closed, and the store is the authority. */ declare const PIPELINE_RULE_KINDS: readonly ["moves", "requires", "who", "limit", "entry"]; /** * A GATE is the general form under `requires`, `who` and `limit`, and the store spells it * `gate:1`, `gate:2` … so several gates can sit on one stage without one overwriting the * next. It is matched as a prefix rather than listed, because the number is open. */ type PipelineRuleKind = (typeof PIPELINE_RULE_KINDS)[number] | `gate:${number}`; /** * WHAT A GATE DOES WHEN IT SAYS NO. The closed list `custom.stage_rule_on_fail_kinds()` * answers — a screen offering a third answer would be offering something no Rule can carry. */ declare const STAGE_RULE_ON_FAIL: readonly ["refuse", "require_approval"]; type StageRuleOnFail = (typeof STAGE_RULE_ON_FAIL)[number]; /** * THE ORGANIZATION'S ONE KNOB (`custom/stage_rule_enforcement`). `refuse` is the default and * what a gate is for; `warn` lets the move through and hands the same sentence back. It never * softens `require_approval` — "ask somebody" and "carry on with a note" are different answers. */ declare const STAGE_RULE_ENFORCEMENT: readonly ["refuse", "warn"]; type StageRuleEnforcement = (typeof STAGE_RULE_ENFORCEMENT)[number]; /** * One transition Rule, as `custom.pipeline_read` hands it back — WITH the sentence it says * when it refuses, because a screen that knows a rule exists but not what it refuses in * cannot warn anybody before they drag. */ interface PipelineRule { id: Uuid; name: string; /** The exact words a person is shown when this Rule stops a move. */ message: string; kind: PipelineRuleKind | null; /** The stage this Rule is about; `null` on the one Rule about the moves themselves. */ stage: string | null; uses: string[]; /** What happens when a card ARRIVES in this stage — assign, notify, start a checklist. */ on_entry: Record | null; /** * What this Rule does when it STOPS a move. `refuse` is the default and what every * pipeline Rule did before gates existed; `require_approval` files the change in the * approvals queue with this Rule's sentence as the reason and leaves the record alone. */ on_fail?: StageRuleOnFail; /** * THE GATE AS IT WAS WRITTEN, which is the only thing that makes it EDITABLE. * * A gate is saved as one Rule whose expression is an `or` of four arms — not this * stage, OR not a move, OR the gate is not about this card, OR the demand holds. That * compiled form used to be the only copy, so a settings screen could read a gate's name * and its sentence and nothing else: it would open every existing rule with a blank * condition and overwrite it the first time somebody pressed Save. * * Absent on the four sugar rules (`moves`, `requires`, `who`, `limit`), which nobody * writes in a condition builder, and on any gate declared before the store started * keeping them. Absent means "this one was not written here" — never "it has no * condition", which is a different and dangerous thing to draw. */ when?: Record | null; /** @see {@link PipelineRule.when} — the condition that has to hold, as it was written. */ demands?: Record | null; version: number; } /** * WHAT A GATE WOULD DO TO THIS BOARD TODAY, from `custom.pipeline_gate_preview`. * * The one question somebody writing a rule that will refuse their colleagues' work * actually has, answered while they are still typing it — the gate is judged as an * argument, nothing is saved, and nothing is written. The store compiles it with the * SAME compiler `pipeline_declare` uses, so this count and the refusal at the door are * the same rule. */ interface PipelineGatePreview { is_pipeline: boolean; /** Present, and it says what would make a board exist, when `is_pipeline` is false. */ why?: string; /** The stage key the gate was tried against. */ stage?: string; /** Live cards of this board this person may see that are not already in that stage. */ considered: number; /** How many of them this gate would turn away. */ refused: number; /** * Up to three of them, BY NAME. A count with no names is a number nobody can check, and * checking it is the whole reason to show it before saving. */ examples: { record_id: Uuid; title: string; }[]; /** True when the board is larger than the preview will walk, so the count is a floor. */ truncated?: boolean; on_fail?: StageRuleOnFail; /** The word this board uses for one of its cards — "quote", "deal" — for the sentence. */ noun?: string; } /** The whole board's definition, from `custom.pipeline_read`. */ interface Pipeline { is_pipeline: boolean; /** Present, and it says what would make a board exist, when `is_pipeline` is false. */ why?: string; table_id?: Uuid; /** The Field KEY that holds the stage — the twin of a Table's `type_field`. */ stage_field?: string; field_id?: Uuid; /** What that column is called, e.g. "Stage". */ stage_label?: string; /** In the order they were declared, which is the order the board draws them. */ stages?: PipelineStage[]; rules?: PipelineRule[]; } /** One column of the board, with the store's own numbers over what this person may see. */ interface PipelineColumn { stage_key: string; stage_label: string; /** 1-based, the declared order. */ stage_position: number; cards: number; /** The total of the chosen measure, or null when no measure was asked for. */ total: number | null; /** How many cards this column takes at once, or null when it takes any number. */ wip_limit: number | null; /** True when the column already holds MORE than its limit — a state a board must show. */ over_limit: boolean; } /** One column this stage demands before a card may land in it. */ interface PipelineMissingField { field_id: Uuid; key: string; /** What the column is called, so a screen can ASK for it rather than only refuse. */ label: string; } /** * Whether a card may go to a column, answered BEFORE the finger lets go — by the same * Rules, through the same evaluator, on the document the move WOULD produce. * * A board grays a column, and snaps a card back, from this. It never decides for itself. */ interface PipelineVerdict { allowed: boolean; is_pipeline: boolean; /** * The THREE answers a board has to draw differently, and the reason `allowed` alone is * not enough: a card that is going for approval has not been refused, and a card that * moved under `warn` has not been waved through silently. */ outcome?: "allowed" | "refused" | "needs_approval" | "warned"; /** What this organization's one knob says right now. */ enforcement?: StageRuleEnforcement; /** Set on `needs_approval`: what pressing on will actually do, in plain words. */ what_happens?: string; /** Set on `warned`: the gates this organization asked to be told about, not stopped by. */ warnings?: StageRuleWarning[]; /** Approvals already filed against this card's own stage column that nobody has decided. */ pending?: StagePending[]; /** The stage key the move was asked about. */ to?: string; /** The store's own sentence — shown verbatim, never paraphrased by a screen. */ why: string; rule?: string; rule_id?: Uuid; rule_version?: number; kind?: PipelineRuleKind; /** What this Rule does when it stops a move. */ on_fail?: StageRuleOnFail; /** * When a stage demands columns that are empty, exactly which ones — so the screen can * prompt for them on entry instead of sending the person away to find them. */ missing?: PipelineMissingField[]; } /** What `custom.pipeline_declare` says it made or changed. */ interface PipelineDeclared { table_id: Uuid; stage_field: string; field_id: Uuid; stages: string[]; rules: Record; /** Plain sentences naming each thing this declaration wrote. */ said: string[]; } /** The declaration a person (or an agent) writes. Everything is optional but the stages. */ interface PipelineSpec { stage_field: { key: string; label?: string; options?: string[]; sort?: number; }; transitions?: { from: string; to: string; }[]; /** Stage name → the column keys that must be filled in to land there. */ requires?: Record; /** Stage name → the rung somebody needs on the record to move a card INTO it. */ who?: Record; /** Stage name → how many cards may sit there at once. The mover is not counted. */ limits?: Record; /** Stage name → what happens when a card arrives: assign, notify, start a checklist. */ on_entry?: Record>; /** * Stage name → the gates a card has to get past to land there. The general form under * `requires`, `who` and `limits`, and the only one that can say `require_approval`. */ gates?: Record; moves_message?: string; requires_messages?: Record; } /** * A gate the organization's own knob overruled. NOTHING FAILS SILENTLY: the move happened * and the sentence comes back WITH it, together with what to do about it. */ interface StageRuleWarning { rule_id: Uuid; rule: string; /** The gate's own sentence, shown verbatim. */ why: string; what_to_do: string; } /** An approval filed against this card's stage column that nobody has decided yet. */ interface StagePending { approval_id: Uuid; /** The stage key the card is waiting to go to. */ to: string; why: string | null; requested_at: string; state: string; } /** * The same wait, asked for a WHOLE BOARD in one question (`custom.pipeline_pending`), so a * board can badge every card that is waiting without a round trip per card — and therefore * actually does it, instead of drawing a filed card as if nobody had ever dragged it. */ interface StagePendingOnBoard extends StagePending { record_id: Uuid; } /** What `custom.pipeline_move` answers — an OBJECT on every path, never a bare number. */ interface PipelineMoveResult { applied: boolean; moved: boolean; outcome: "moved" | "moved_with_warnings" | "needs_approval"; to: string; version: number; /** Set on `moved_with_warnings`. */ warnings?: StageRuleWarning[]; /** Set on `needs_approval`: the gate's sentence, the wait that was filed, and who has it. */ why?: string; rule?: string; rule_id?: Uuid; approval_id?: Uuid; approvers?: { user_id: Uuid; name: string | null; why: string; }[]; what_happens?: string; } /** One card of a batch move (`custom.pipeline_move_many`). The version is REQUIRED: it is the * version the board loaded, and a card that changed since answers `changed_since_loaded`. */ interface PipelineMoveManyItem { record_id: Uuid; stage: string; expected_version: number; /** Columns the stage asks for, filled in on the way in. */ also?: Record; } /** What one card of a batch move came to. The sentence is always the store's own. */ type PipelineMoveVerdict = "moved" | "needs_approval" | "needs_fields" | "changed_since_loaded" | "no_right" | "refused"; interface PipelineMoveManyResult { index: number; record_id: Uuid; stage: string; verdict: PipelineMoveVerdict; sentence: string; /** Set on `needs_fields`: the empty columns the stage asks for. */ needs?: PipelineMissingField[]; /** Set on `moved` / `needs_approval`: the card's version now. */ version?: number; /** Set on `changed_since_loaded`: the version that won. */ current_version?: number; expected_version?: number; approval_id?: Uuid; approvers?: { user_id: Uuid; name: string | null; why: string; }[]; warnings?: StageRuleWarning[]; rule?: string; code?: string; } /** What `custom.pipeline_move_many` answers: the counts, then one verdict per card in order. */ interface PipelineMoveMany { asked: number; moved: number; needs_approval: number; not_moved: number; results: PipelineMoveManyResult[]; } /** * ONE GATE ON A STAGE, as the condition builder on the stage settings screen writes it. * `requires`, `who` and `limits` are sugar over this shape; this is the general form, and * it speaks the SAME condition language as filters and formulas — never a second one. */ interface PipelineGate { /** What the gate is called in the settings list. */ name?: string; /** The sentence a person reads when it stops them. Required: a refusal with no words is a dead end. */ message: string; /** WHEN this gate is about this record at all. Absent means always. */ when?: Record; /** What has to hold. One condition node of the one Rule language. */ demands: Record; /** Default `refuse`. */ on_fail?: StageRuleOnFail; } /** * THE ONE PLACE A SCREEN DECIDES WHETHER A CARD LOOKS DRAGGABLE — and it decides on the * PERSON, not on the rules. Whether a particular move is allowed is * `pipelineTransitionRefusal`, which is the store's answer; whether this person may move * anything at all is their level on the record, which the read door already told us. * * Absent rather than dead: a viewer's card carries no drag handle at all, instead of one * that looks live and snaps back every time. */ declare function mayDrag(level: string | null | undefined): boolean; /** * A rule expression as `custom.rule_eval` ACTUALLY evaluates it — read off the * door's own body, not invented here. A leaf is the node's name carrying its * payload (`{"const": 3}`, `{"field": ""}`); an operator is * `{"op": "eq", "args": [...]}`. * * `field` / `parent_field` name a Field BY ID (REC-17 — the door refuses * `field_name`, `field_key` and `field_label` by name), and `merge_field` is * the resolver's seam, storable today and refused `0A000` until W5-MERGE-B. * * `p_values` is keyed by the Field's KEY: the door resolves the id to a key * (`custom.rule_field_key`) and then reads `p_values -> key`. */ type RuleExpression = { const: unknown; } | { field: Uuid; } | { parent_field: Uuid; } | { merge_field: string; } | { op: RuleNodeKind; args: RuleExpression[]; }; /** REC-15. One Rule, four uses; a Rule may serve more than one. */ interface Rule { id: Uuid; organization_id: Uuid; name: string; kind: string | null; /** The Table this Rule is scoped to. */ scope_table_id: Uuid | null; uses: RuleUse[]; validates: boolean; computes: boolean; defines_membership: boolean; /** * REC-16. An applicability Rule reads the record's own Values and its * parent's, ONE level up, and no further. */ decides_applicability: boolean; applies_to_types: string[]; use_types: string[]; expr: RuleExpression; /** Which Field this Rule's answer is about (REC-17: by id). */ target_field_id: Uuid | null; /** What a person reads when this Rule refuses. */ message: string | null; sort: number | null; created_by: Uuid | null; updated_by: Uuid | null; created_at: Timestamp; updated_at: Timestamp; /** REC-19. Rules have versions, and History knows which one produced a Value. */ version: number; metadata: Record; visibility: string; } /** What the store answers when a Rule is run: the answer and the version that gave it. */ interface RuleAnswer { rule_id: Uuid; rule_name: string; rule_version: number; applies: boolean; answer: unknown; } /** One form as `custom.forms` reports it to its owner. */ interface FormSummary { form_id: string; table_id: string; title: string | null; slug: string; published_at: string | null; closed_at: string | null; submission_cap: number | null; /** Every answer that arrived, rejected ones excluded from `in_table` and `held`. */ responses: number; /** Answers that became records — the only number that means "it is in the table". */ in_table: number; /** Answers waiting for a person, because the form's accept Rule did not clear them. */ held: number; /** Answers the accept Rule or the decoy turned away. */ rejected: number; /** draft · open · closed · full — the store's own word, never derived on a screen. */ state: "draft" | "open" | "closed" | "full"; quarantine_rule_id: string | null; notify_rule_id: string | null; presentation: Record; } /** * THE ROUTE THROUGH A FORM, AS THE STORE WALKED IT (lane TYPEFORM-DUP) — `custom._form_route`, * reached by the owner's preview (`custom.form_preview_route`) and the stranger's page * (`custom.form_public_route`). One row per question in order (`asked` false only when a condition * hid it or a logic jump carried the person past it); the ending reached (null = the thank-you * screen); the score (null when no question carries points). */ interface FormRoute { asks: Array<{ field_key: string; asked: boolean; decided: boolean; said: string | null; }>; ending: string | null; score: number | null; } /** A form's results for its owner — `custom.form_results`. Every number is the store's. */ interface FormResults { form_id: string; /** Visits to the public link (one per page open, counted through the app's own route). */ views: number; /** Visits that answered at least one question. */ starts: number; /** Submissions that arrived (the decoy's excluded). */ completions: number; /** completions / starts, as a percentage with one decimal; null before anybody started. */ completion_rate: number | null; questions: Array<{ field_key: string; /** Visits that were shown this question. */ reached: number; /** Visits whose last question was this one and that never sent: the drop-off. */ left: number; /** Submissions that answered it. */ answered: number; /** The twelve most common answers (a list answer counts each of its parts). */ answers: Array<{ value: string; count: number; }>; }>; endings: Array<{ ending: string | null; count: number; }>; hidden: Array<{ key: string; value: string; count: number; }>; score: { count: number; average: number; min: number; max: number; } | null; } /** * ONE BOOKING PAGE, AS ITS OWNER SEES IT — `custom.bookings` (PRODUCTS row 14). * * A booking page is an `anon_form` whose `presentation -> 'booking'` carries the * availability and the id of a slots Table, so it is the SAME object a form is and * this is the same list `forms()` is, asked for the booking half. The numbers are * the store's own: a screen that counted appointments in the browser would drift * from the index that actually protects a slot. */ interface BookingSummary { form_id: string; /** The Table the appointments land in — a booking is an ordinary record in it. */ table_id: string; title: string | null; slug: string; published_at: string | null; closed_at: string | null; /** How long one appointment is. The offer is the store's, never the browser's. */ slot_minutes: number; /** The organization's own zone, which is what the visitor's times are drawn in. */ timezone: string; /** The ONE slots Table `custom.booking_declare` finds-or-makes for this page. */ slot_table_id: string; booked: number; cancelled: number; /** Booked and still ahead of now — the number that answers "what is coming". */ upcoming: number; /** Slots a visitor is holding right now, before they have given their details. */ held: number; /** The next appointment, or null when there is none. */ next_at: string | null; /** draft · open · closed — the store's own word, never derived on a screen. */ state: string; } /** * ONE WINDOW OF AN ORGANIZATION'S WEEK, in the shape `custom._booking_availability` * normalizes to and `custom._booking_slots` generates from. `weekday` is 0 for Sunday * and 6 for Saturday — the database's own numbering, so a picker and the store cannot * disagree about which day Monday is. A window may name ONE member, which is the "with * whom" of an appointment; naming somebody who is not a member is refused BY NAME. */ interface BookingWindow { weekday: number; /** "09:00" */ from: string; /** "17:00" — later in the day than `from`, or the store refuses it by name. */ to: string; member_user_id?: string | null; } /** * WHAT IS ON OFFER. Every field is the store's to default: a page declared with an * empty availability comes back with the organization's timezone, a 30-minute slot and * Monday-to-Friday nine-to-five, because a booking page that offered nothing would look * broken rather than unconfigured. A screen shows what came BACK, never what it sent. */ interface BookingAvailability { timezone: string; slot_minutes: number; /** Dead time kept after each appointment, so two never touch. */ buffer_minutes: number; /** How far ahead of now the earliest bookable slot is. */ lead_minutes: number; /** Most appointments in one day, across every window. */ max_per_day: number; /** How many days ahead the page offers. */ days: number; windows: BookingWindow[]; /** CD-PAGE-10: places at one time for each host (1 = one person per time; a class or group visit takes more). */ capacity?: number; /** CD-PAGE-10: none, auto (a new meet.jit.si room per booking) or link (the owner's own room in `video_url`). */ video?: "none" | "auto" | "link"; video_url?: string; /** CD-PAGE-10: the owner's private iCal address; its busy times are never offered. Owner-only — never in a public answer. */ busy_feed?: string; /** CD-PAGE-10: when the connected calendar was last read, and why the last read failed (the last good list is kept). */ busy_read_at?: string | null; busy_problem?: string | null; } /** * WHAT `custom.booking_declare` ANSWERS. `availability` is the NORMALIZED offer — * show that, not the draft — and `questions_filled_in` is how many questions the store * took over (`slot`, `status`, `booked_with`), which a visitor is never asked. * * It does NOT publish. `anonPublish` is still the one act that opens the link, exactly * as it is for a form, so there is one act and one word for opening a public surface. */ interface BookingDeclared { form_id: string; slot_table_id: string; availability: BookingAvailability; questions_asked: number; questions_filled_in: number; ms: number; } /** * THE VISITOR'S OWN LINK to a booking page. The page id IS the capability, exactly * as it is for a form; `custom.anon_submission.booking_ref` is the separate secret * that lets ONE visitor manage the appointment they made. */ declare function bookingPath(formId: string): string; /** * THE PUBLIC LINK, and the one place its shape is written down. * * The form's own id IS the capability — 122 bits of UUIDv4, exactly as * Typeform's form id in `/to/` is and as an unguessable meeting slug is * here. There is no second secret to keep, and revoking it is closing the form. */ declare function publicFormPath(formId: string): string; /** What the store thinks one column of a file is. */ interface ImportColumnPlan { /** The heading exactly as the file spells it. */ header: string; /** Set when this table already has the column; then `type` is that Field's. */ field_id: Uuid | null; /** The key this column would become, or the key it matched. */ field_key: string; label: string; /** * A parity type, or one of the three plain words (`text`, `long_text`, * `number`). It is exactly what `custom.field_declare` takes, so a plan can be * handed on with nothing in between to reinterpret it. */ type: ParityFieldType | "text" | "long_text" | "number" | "relation"; matched: boolean; /** One sentence, in words a person reads, saying why the store said that. */ why: string; /** Present on a money column. */ unit?: string; /** Present when the store read the column as a dropdown: its words. */ options?: string[]; /** Present when the column points at another Table. */ relation_target?: Uuid; /** A slashed date whose day/month order cannot be read off the file. */ ambiguous?: boolean; /** Another column of the same file would make the same key. */ collides_with?: string; samples?: unknown[]; } interface ImportPlan { table_id: Uuid; columns: ImportColumnPlan[]; matched: number; unmatched: number; fields: Array<{ field_id: Uuid; key: string; label: string; type: string | null; }>; } /** What a run does when it meets something. Both defaults cannot lose anything. */ interface ImportPolicy { /** `skip` leaves the record that is already there; `update` brings it up to date. */ on_duplicate?: "skip" | "update"; /** `propose` sends a new column to the ONE approvals inbox. `create` is an admin's. */ unmapped?: "propose" | "create" | "ignore"; /** How a slashed date is read. Chosen once for the run, never guessed per row. */ date_order?: "mdy" | "dmy"; } interface ImportOpened { import_id: Uuid; state: "open" | "written" | "finished"; /** * TRUE means these exact bytes already landed on this Table and NOTHING was * written again. The numbers are the FIRST run's. */ already: boolean; rows_seen: number; rows_written: number; rows_duplicate: number; source_name: string | null; opened_at?: Timestamp; /** * IMPORT-2. How many rows to send in the FIRST call. The store owns this * number rather than a screen, because nothing has been measured yet when a * run opens and a batch size written into a wizard is wrong on a busy * afternoon and stale the day the write path gets cheaper. Every call after * the first uses `ImportBatchResult.rows_per_call`, which is measured. */ rows_per_call?: number; message: string; } /** One row of the file, and what became of it. */ type ImportOutcome = { row: number; outcome: "landed"; record_id: Uuid; } | { row: number; outcome: "duplicate"; record_id: Uuid; updated: boolean; reason: string; } | { row: number; outcome: "refused"; reason: string; source: Record; }; interface ImportProposal { column: string; field_key: string; label: string; type: string; why: string; samples: unknown[]; state: "proposed" | "waiting" | "accepted" | "rejected" | "ignored" | "refused"; /** Set once the column is waiting in the approvals inbox. */ approval_id?: Uuid; /** Set once an admin added it outright. */ field_id?: Uuid; reason?: string; options?: string[]; unit?: string; relation_target?: Uuid; } interface ImportBatchResult { import_id: Uuid; rows_seen: number; rows_written: number; rows_duplicate: number; rows_refused: number; outcomes: ImportOutcome[]; proposals: ImportProposal[]; /** * IMPORT-2. The columns this call had to declare because the run never took * the `importDeclareColumns` step. Normally empty: declaring is its own step. */ columns_added?: ImportProposal[]; /** * IMPORT-2. FALSE means the batch could not be written as one statement — one * row of it was refused by a guard that refuses the whole statement — so every * row was written on its own instead and the refusals below name the rows that * could not be. The answers are identical either way; this says what it cost. */ one_statement?: boolean; /** How long THIS call's writing phase took, and what that was a row. */ write_ms?: number; ms_per_row?: number; /** * IMPORT-2. How many rows the NEXT call should carry, measured from this one: * the store aims at two seconds of writing, which leaves a database that gets * 50% busier between two calls still inside the three seconds a person should * wait. Send this many next. Ignoring it costs correctness nothing. */ rows_per_call?: number; } /** IMPORT-2. What `importDeclareColumns` made, as its own step of the wizard. */ interface ImportColumnsDeclared { table_id: Uuid; columns_added: ImportProposal[]; /** Header -> Field key, including the headers that already named a column. */ mapping: Record; message: string; } interface ImportFinished { import_id: Uuid; state: "finished"; rows_seen: number; rows_written: number; rows_duplicate: number; rows_refused: number; columns_offered: number; columns_added: number; columns_ignored: number; proposals: ImportProposal[]; message: string; } /** * The rows a person clicks through to. `capped` and `note` are the store saying * out loud which part of the total it can still show — a number with nothing * behind it is the thing this shape exists to prevent. */ interface ImportReport { import_id: Uuid; table_id: Uuid; state: "refused" | "duplicate"; rows: Array>; kept: number; total: number; capped: boolean; note: string | null; } interface ImportRun { import_id: Uuid; table_id: Uuid; format: "csv" | "xlsx"; source_name: string | null; file_hash: string | null; dedupe_key: string | null; policy: ImportPolicy; state: string; rows_seen: number; rows_written: number; rows_duplicate: number; rows_refused: number; columns_offered: number; opened_at: Timestamp; finished_at: Timestamp | null; created_by: Uuid | null; } /** DOOR-19. An address a Table owns, and what has arrived at it. */ interface InboundAddress { inbound_id: Uuid; table_id: Uuid | null; channel: string; address: string; source: string | null; enabled: boolean; last_received_at: Timestamp | null; created_at: Timestamp; received: number; } interface InboundDeclared { inbound_id: Uuid; table_id: Uuid; address: string; channel: string; enabled: boolean; /** * THE ONE THING THAT COULD FAIL SILENTLY, SAID OUT LOUD. The address is real * and stored the moment this comes back; whether mail REACHES it is a fact * about DNS that no door can make true. Show this sentence wherever the * address is shown. */ mail_route: string; message: string; } /** One portal as `custom.portals` reports it to its organization. */ interface PortalSummary { portal_id: Uuid; title: string; slug: string; /** The Table whose records ARE the clients. A principal is one of its rows. */ client_table_id: Uuid; /** That Table's name, so a list never has to read a second door to draw a row. */ client_table: string; is_active: boolean; /** How many Tables this portal exposes. */ tables: number; /** Everybody invited and not revoked — NOT everybody who can see anything. */ invited: number; /** Of those, how many have followed the link and hold an identity. */ signed_in: number; /** `magic_link` today, and the door refuses every other word by name. */ sign_in_method: string; opened_at: Timestamp | null; } /** * ONE (portal, Table) PAIR, as `custom.portal_tables` reports it. * * 🚨 WHY THIS EXISTS (TAILS-3, 2026-09-21). The Portals rail sits on a Table's * page beside Forms, Bookings and Dashboards — all table-scoped — while * `custom.portals` takes no table at all. On Rincon Plumbing Co's **Parts** * table the rail read "Portals 10" and listed ten cards titled "Your jobs and * invoices", which belong to **Jobs**; the empty state never rendered, so the * "Build it / Ask an agent" offer was unreachable on EVERY table of any * organization that already had one portal. * * This is the whole of what a table-scoped rail needs: is the table I am * standing on in any portal, and if not, which portals could take it. */ interface PortalTableRef { portal_id: Uuid; table_id: Uuid; /** That Table's name, so a rail never reads a second door to draw a row. */ name: string; } /** One Table a portal exposes, as `custom.portal_card` reports it. */ interface PortalTableExposure { table_id: Uuid; /** The Table's own name. */ name: string; /** * The key of the relation Field that says WHOSE a record is. This is the * whole of "only theirs": the association that Field writes is what carries * the record to the client, so a portal cannot exist without one. */ names_via: string; /** The field keys a client sees. Empty is impossible — the door fills it. */ visible_fields: string[]; /** The subset a client may change. Always a subset of `visible_fields`. */ editable_fields: string[]; comments: boolean; /** * The most a client is ever conveyed on this Table — `viewer`, `commenter` * or `editor` — worked out by the door from the two lists above, never by a * screen. */ conveys: string; } /** One person a portal was opened to, as `custom.portal_card` reports them. */ interface PortalPrincipal { principal_id: Uuid; email: string; /** The record of the client Table this person IS, for the portal's purposes. */ client_record_id: Uuid; /** That record's title — what an owner calls this client. */ client: string; /** They followed the link and hold an identity. Until then this is false. */ signed_in: boolean; /** Not revoked. An invitation that was never followed is still active. */ is_active: boolean; invited_at: Timestamp; revoked_at: Timestamp | null; /** * THE LINK THE OFFICE COPIES FOR THIS PERSON — `/invitations/portal/accept/`, the * path `custom.portal_invite` handed back when they were asked, read off the same * `iam.invitations` row and never re-templated. * * 🚨 `null` IS AN ANSWER, NOT AN ABSENCE, and a screen must say which. It is null when they * have already followed the link, when the office took it back (a revoke withdraws the * invitation in the same statement), when it has expired, or when they were let in through * the server's own magic-link route, which binds without an invitation at all. In every one * of those cases there is genuinely no link to copy — so draw a sentence, never a dead * control. (TAILS-5, 2026-09-21; the gap PORTAL-BIND left named.) */ accept_path: string | null; } /** Everything about ONE portal: what it shows, and who it was opened to. */ interface PortalCard { portal_id: Uuid; title: string; slug: string; is_active: boolean; sign_in_method: string; client_table_id: Uuid; tables: PortalTableExposure[]; principals: PortalPrincipal[]; /** * Whether this organization's outside lane is open * (`custom/external_principal_enabled`). Declaring a portal opens it; while * it is false every door refuses an outsider BY NAME, and a screen that drew * the people as reachable anyway would be lying about the one thing that * decides whether they can sign in at all. */ external_lane_open: boolean; /** S6 — the look and forms exactly as the owner stored them (`{}` when none). */ config: PortalConfig; /** S6 — the look as a client sees it: the portal's own values over the organization's brand. */ style: PortalStyle; /** S6 — every form on the portal, in its order, with its title, Table and state. */ forms: PortalFormRef[]; /** S6 — the accent names a portal may carry (the design system's `STYLE_COLORS`). */ accents: PortalAccent[]; /** * S6 — the pictures that could be this portal's logo: the organization's own PUBLIC pictures in * Files, newest first. A private file is never offered, because the store would refuse it. */ logo_candidates: PublicPicture[]; } /** The design system's color names (`STYLE_COLORS`), which is all an accent may be. */ declare const PORTAL_ACCENTS: readonly ["slate", "green", "amber", "red", "blue", "violet", "teal"]; type PortalAccent = (typeof PORTAL_ACCENTS)[number]; declare function isPortalAccent(word: unknown): word is PortalAccent; /** One link in a portal's footer. The store takes only `https://`, `mailto:` and `tel:`. */ interface PortalFooterLink { label: string; url: string; } /** A portal's look as the owner sets it. Every key is optional; absent means "the organization's". */ interface PortalStyleInput { display_name?: string | null; welcome?: string | null; logo_file_id?: Uuid | null; accent?: PortalAccent | null; footer_links?: PortalFooterLink[] | null; } /** One form on a portal, as the owner sets it. `order` is the position; `label` overrides the title. */ interface PortalFormInput { form_id: Uuid; label?: string | null; order?: number | null; } /** * What `portalDeclare({ config })` sends. A key given REPLACES that key; a key not given is KEPT; * `style: null` puts the organization's brand back and `forms: []` takes every form off. */ interface PortalConfigInput { style?: PortalStyleInput | null; forms?: PortalFormInput[] | null; } /** The look and forms as the store holds them (normalized by the store). */ interface PortalConfig { style?: PortalStyleInput; forms?: Array<{ form_id: Uuid; label?: string; order: number; }>; } /** The look a client is shown — resolved by the store, never computed by a screen. */ interface PortalStyle { display_name: string; welcome: string | null; logo_file_id: Uuid | null; /** The logo's PUBLIC address, or null. Readable by anybody the portal is shown to. */ logo_url: string | null; /** Null means the app's own color. */ accent: PortalAccent | null; footer_links: PortalFooterLink[]; /** MAKE-HOME W5 — a cover picture's PUBLIC address (a form's look carries one), or null. */ cover_file_id?: Uuid | null; cover_url?: string | null; /** Which of the values above came from the organization rather than the portal. */ from_organization: Array<"display_name" | "logo">; } /** * One of the organization's PUBLIC pictures (`custom._public_pictures`): the only pictures a * portal's logo or a form's logo and cover may be, because a stranger sees them before signing in. */ interface PublicPicture { file_id: Uuid; name: string; url: string | null; } /** * What a form's look editor needs (`custom.form_look_options`, MAKE-HOME W5b): the pictures the * store accepts, the colors, and the look a stranger would see for the draft presentation. */ interface FormLookOptions { pictures: PublicPicture[]; accents: PortalAccent[]; look: PortalStyle; } /** One form on a portal, with what the owner needs to see about it. */ interface PortalFormRef { form_id: Uuid; /** What the portal calls it (the owner's label, else the form's title). */ label: string; order: number; title: string; table_id: Uuid | null; table: string; /** `gone` is a form that was removed; the outsider's list only ever carries `open`. */ state: "open" | "closed" | "full" | "gone"; } /** A Table's stages as a portal client may be told them (`custom.portal_me` → tables[].stage). */ interface PortalStage { /** The stage Field's key on the record. */ field: string; label: string; /** In the order they were declared. A record stores the stage's `key`. */ stages: Array<{ key: string; label: string; retired: boolean; }>; } /** What `custom.portal_form` answers: one form on the caller's own portal. */ interface PortalFormSpec { form_id: Uuid; portal_id: Uuid; table_id: Uuid; title: string; label: string; presentation: Record; /** The form's exposed Fields as the store holds them — never the one naming the client. */ fields: Array & { id: Uuid; key: string; }>; required: string[]; state: "open" | "closed" | "full"; message: string | null; } /** What `custom.portal_form_submit` answers. `held` waits for the office; `message` says so. */ interface PortalFormAnswer { submission_id: Uuid | null; record_id: Uuid | null; state: "accepted" | "held" | "rejected" | "closed" | "full" | "too_many"; message: string | null; } /** What `custom.portal_invite` answers. `say` is the door's own sentence. */ interface PortalInvitation { invited: boolean; principal_id: Uuid; portal_id: Uuid; slug: string; email: string; client_record_id: Uuid; client: string; /** They already hold an identity. From a screen this is false: the door is passed no user. */ bound: boolean; /** * The door's own words, and the ONLY correct summary of what just happened — * it says outright that an invitation confers nothing until the link is * followed. Show it; never paraphrase it. */ say: string; } /** What `custom.portal_revoke` answers. `say` names the consequence, past tense. */ interface PortalRevocation { revoked: boolean; principal_id: Uuid; email: string; /** The door's own sentence: they can no longer sign in, and their records stop reaching them. */ say: string; } /** One row of "what this client sees", from `custom.portal_preview`. */ interface PortalPreviewRow { record_id: Uuid; title: string; } /** * THE PUBLIC ADDRESS OF A PORTAL, and the one place its shape is written down. * * Unlike a form's link, a portal's slug is NOT the capability: the page it * serves asks who you are and emails a one-time link, so the slug is a name and * nothing more. That is why it is readable and why copying it is safe. */ declare function portalPath(slug: string): string; /** * The platform archive filter's own three values, and no fourth. `custom.list_portals` * refuses anything else with `22023` rather than quietly treating it as one of them. */ declare const PORTAL_ARCHIVE_FILTERS: readonly ["active", "archived", "all"]; type PortalArchiveFilter = (typeof PORTAL_ARCHIVE_FILTERS)[number]; /** THE LAW'S DEFAULT IS TO HIDE. A list nobody narrowed is the live things. */ declare const DEFAULT_PORTAL_ARCHIVE_FILTER: PortalArchiveFilter; declare function isPortalArchiveFilter(word: unknown): word is PortalArchiveFilter; /** What `custom.portal_archive` and `custom.portal_restore` answer with. */ interface PortalArchiveAnswer { /** Where the portal stands NOW — true after an archive, false after a restore. */ archived: boolean; /** False when it was already in that state; the sentence says so rather than lying about an act. */ changed: boolean; portal_id: Uuid; archived_at?: Timestamp | null; /** The store's own sentence, in plain English. Show it verbatim; never a constraint name. */ sentence: string; } /** * THE CONSEQUENCE, SAID BEFORE THE CLICK — never a generic "are you sure?". * * What actually changes is two things: nobody can sign in to it any more, and it * leaves the organization's portal list. What does NOT change is everything * else, and saying so is the difference between an archive somebody dares to * press and one they avoid. */ declare function portalArchiveConsequence(title: string, signedIn: number, invited: number): string; /** * WHY THE TITLE HAS TO BE TYPED BACK, in the store's own reasoning. Ten portals * can carry one title, so the title is not what PICKS this one — the portal you * opened is. Typing it back is how you say you meant this one. */ declare function portalConfirmLine(title: string): string; /** True when what the person typed is what the door will accept. The door decides; this only spares them a round trip. */ declare function portalTitleTypedBack(typed: string, title: string): boolean; /** * WHAT AN EMPTY ARCHIVE LANE SAYS. An empty list is an answer: it says nothing * has been archived, so "none here" can never be read as "the archive is broken" * or as "this organization has no portals at all". */ declare function emptyPortalArchiveLine(): string; /** The four values of "Shown to", in the ladder's order. */ declare const SHOWN_TO_VALUES: readonly ["only_me", "my_team", "everyone", "everyone_on_ai_matrx"]; type ShownTo = (typeof SHOWN_TO_VALUES)[number]; /** THE WORDS (access ladder § Words, row "Shown to"). One label per value, used by every screen. */ declare const SHOWN_TO_LABEL: Record; declare function isShownTo(word: unknown): word is ShownTo; /** * Does a Table's Level give its records a "Shown to"? (Access ladder § Words: "Private and * Confidential records have no 'Shown to'".) Absent or unknown level = yes, as before. The ONE test * every screen asks before it draws the control, so a locked table never shows a control that does * not exist for it. */ declare function levelHasShownTo(level: unknown): boolean; /** What `custom.table_row_defaults` answers: the table's own choices, what applies, and what may change. */ interface TableRowDefaults { /** The table's own choice; null = the organization's default. */ shown_to: ShownTo | null; published_to_web: boolean | null; indexed: boolean | null; effective: { shown_to: ShownTo; published_to_web: boolean; indexed: boolean; }; allowed_shown_to: ShownTo[]; available: { shown_to: boolean; published_to_web: boolean; indexed: boolean; }; can_change: boolean; } /** What `custom.table_row_defaults_set` takes. A key left out is left alone; null = back to the default. */ interface TableRowDefaultsPatch { shown_to?: ShownTo | null; published_to_web?: boolean | null; indexed?: boolean | null; } /** One pass of `custom.table_row_defaults_apply`. `done: false` → call again with `next_after`. */ interface RowDefaultsApplied { table_id: Uuid; seen: number; changed: number; kept_by_hand: number; done: boolean; next_after: Uuid | null; /** The store's own sentence. Show it verbatim. */ sentence: string; } /** What `custom.record_row_controls` answers for one row. */ interface RecordRowControls { shown_to: { value: ShownTo | null; effective: ShownTo; type_default: ShownTo | null; table_default: ShownTo | null; allowed: ShownTo[]; is_child: boolean; can_change: boolean; legacy_only_me?: boolean; }; published_to_web: { available: boolean; value: boolean; table_default: boolean | null; can_change: boolean; }; indexed: { available: boolean; value: boolean | null; table_default: boolean | null; effective: boolean; can_change: boolean; }; } /** * WHO MAY CHANGE A ROW'S "Shown to" (NOT its cells: a cell needs Editor on the table), in one sentence — the store's rung (`platform.shown_to_state`: * the person who made it, or someone with full access to it). Said where the control would be. */ declare const SHOWN_TO_WHO_MAY_CHANGE = "Only who added this row, or an admin, can change who sees it."; /** The sentence beside the two web switches while the store does not carry them yet. */ declare const ROW_WEB_NOT_READY = "Not available for table rows yet."; /** What `custom.form_archive` and `custom.form_restore` answer with. */ interface FormArchiveAnswer { archived: boolean; changed: boolean; form_id: Uuid; kind: "form" | "booking"; title: string | null; archived_at?: Timestamp | null; /** The store's own sentence. Show it verbatim. */ sentence: string; } /** One row of `custom.forms_archived` — a form or a booking page that was put away. */ interface ArchivedForm { form_id: Uuid; table_id: Uuid; table_name: string | null; kind: "form" | "booking"; title: string | null; slug: string; archived_at: Timestamp; archived_by: Uuid | null; table_archived: boolean; can_restore: boolean; } /** One row of `custom.checklist_templates_archived`. */ interface ArchivedChecklistTemplate { template_id: Uuid; name: string | null; about_table_id: Uuid | null; about_table: string | null; steps: number; archived_at: Timestamp; archived_by: Uuid | null; table_archived: boolean; } /** What an archived form, booking page or checklist is called in a list. */ declare const BUILT_KIND_WORD: Record<"form" | "booking" | "checklist", string>; /** What `tableRowLabel` / `tableRowLabelSet` answer. */ interface TableRowLabel { /** The formula as it was typed, or null when the table names its records by its title column. */ formula: string | null; /** The single-column label the table falls back to (its `title_field` key). */ title_field: string | null; /** Which of the two names records now: the formula, or the title column. */ effective: "formula" | "column"; /** The type the formula answers (text, number, ...), when it still reads. */ result_type: string | null; /** False when the stored formula text no longer parses against the table's columns (a column was renamed or retired). */ valid: boolean; /** The parser's sentence when `valid` is false. */ error: string | null; /** Whether the caller may set or clear it (the table's maker, or someone with full access). */ can_change: boolean; } /** The longest formula the store keeps. */ declare const ROW_LABEL_FORMULA_MAX_LENGTH = 2000; /** True when a value handed to `tableRowLabelSet` clears the formula (null, empty, or only spaces). */ declare function clearsRowLabel(formula: string | null | undefined): boolean; /** The measures the store offers. Asked of `custom.agg_operations()` at run time too. */ type AggregateOperation = "count" | "sum" | "avg" | "min" | "max" /** GRID-PRIMITIVES G1: the summary bar's other four. Blank = no value, JSON null or "". */ | "median" | "filled" | "empty" | "unique" /** * Notion's calculation row (Spaces N6): the share of the rows asked with no value / a value, as a * percent 0..100 (NULL over no rows); and the RANGE, largest minus smallest (a date column: the days * between its earliest and latest moment). */ | "percent_empty" | "percent_filled" | "range"; /** The periods a date Field can be bucketed into (`custom.agg_buckets()`). */ type AggregateBucket = "day" | "week" | "month" | "quarter" | "year"; /** * A HALF-OPEN MOMENT WINDOW: `from` is inclusive, `to` is exclusive. Half-open * is the only shape that makes "September" and "October" meet exactly once — * an inclusive `to` either double-counts the boundary moment or drops it, * depending on the reader, and both of those are a chart telling a lie. */ interface AggregateWindow { from?: string | null; to?: string | null; } /** * ONE FILTER VALUE, as `custom.record_aggregate` and `custom.dashboard_run` * both read it: a SCALAR is an equality, and an OBJECT is a window. It is not * `unknown` on purpose — a filter value the store cannot read is a refusal a * caller should get from the compiler, not from the database. */ type AggregateFilter = string | number | boolean | null | AggregateWindow; /** * 🚨 THE STORE'S ONE FILTER SHAPE, AND THE ONLY NAME FOR IT. * * An object of Field key -> value. A scalar is an equality, `null` is UNSET * (the third state of a tick box), an object is a half-open time window. * * It is not the aggregate's private shape and never was. `platform.saved_view` * has carried exactly this as `definition -> 'filters'` across five live * surface keys since DOOR-18; `custom.view_declare` writes it; * `custom.agg_view_admits` reads it to decide whether a change belongs to a * saved view; `custom.record_aggregate` takes it as `p_filter` to COMPUTE a * dashboard number; and `custom.read_records_matching` takes it to OPEN the * rows behind that number. One `custom.record_filter_sql` in the database turns * it into SQL for the last two, so the number and the rows cannot disagree. * * Invent a second one and a chart can compute a total whose drill-through * lands somewhere else, which is the only way a drill-through can lie. */ type RecordFilter = Record; /** * S2-PRIME FILTER-GROUPS — A READ DOOR'S QUESTION, IN EITHER OF ITS TWO SHAPES. * * The flat `RecordFilter` above (field key → scalar / `null` / window, AND only) is what * dashboards, drill-throughs and the notifier carry. A `RuleExpression` — `{op, args}`, ALL / ANY / * NOT groups nested to any depth, fields by id — is what the condition builder, a view's own * filter and every membership Rule speak. `custom.record_filter_sql(org, table, filter)` turns * EITHER into the one WHERE clause the grid (`list`), the aggregate and the board all use, so the * three can never disagree about which records a view holds. */ type StoreFilter = RecordFilter | RuleExpression; /** * Is this filter a Rule expression? The store's own test (`custom.filter_is_rule`): an object * whose `op` is a word and which carries `args`. */ declare function isRuleFilter(filter: unknown): filter is RuleExpression; /** One measure. `count` counts rows and needs no Field; the rest read one. */ interface AggregateMeasure { op: AggregateOperation; /** The Field's key. Required for every operation except `count`. */ key?: string; } /** * One row of an aggregate: which group it is, what each measure came to, and * how many records it was worked out from. The measure keys are the store's * own (`count`, `sum_amount`, `avg_amount`, …), never renamed on the way out. */ /** * One group's key, as the column holds it (CHAIR-SHEET-STORE b): a number column's key is a number, a * yes/no column's true/false, a date its ISO text, a date period its first moment, everything else text. */ type AggregateGroupValue = string | number | boolean | null; interface AggregateRow { groups: Record; measures: Record; /** * AGG-WITHHELD — a measure over a column this reader may not read is `null` in `measures` (the * "no value" every number reader already handles) and its reason rides HERE by measure name: the * same notice a withheld cell carries (`reason`, `needs`, `or`) plus the store's own sentence in * `says`. The store never errors a read for a withheld column; it says so. A question that * GROUPS or FILTERS by such a column answers one row with every measure null and `row_count` 0. * Absent when nothing was withheld. */ withheld?: Record; row_count: number; /** * S3 — present only when the question carried a comparison. The same group * in the PRIOR window: a bucket is matched by its position in its own window * (week 1 of September beside week 1 of August), so `prior_groups` names the * prior bucket's own date. `null` when the prior window had no such group. */ prior_groups?: Record | null; /** The prior window's measures, keyed exactly like `measures`. */ prior_measures?: Record | null; prior_row_count?: number | null; /** Every measure now and before, the change, and the change as a percent of before. */ delta?: Record | null; /** The two windows this row was worked out over, and the calendar that cut them. */ compare?: AggregateCompareWindows | null; /** * S3 — a compared, bucketed row's POSITION in its window (0 = the first * bucket). A row the current window has not reached yet has a position and * no current bucket, so a chart names it "Week 6" rather than inventing a date. */ position?: number | null; } /** * S3 — WHAT A PERIOD IS COMPARED AGAINST (`custom.agg_compare_kinds()`). * `previous_period` is the period before, of the same length (August before * September; an explicit window shifted back by its own length); * `same_period_last_year`; `range` is a fixed `baseline`. */ type AggregateCompareKind = "previous_period" | "same_period_last_year" | "range"; /** * S3 — ONE COMPARISON, as `custom.record_aggregate(p_compare)` and a * dashboard block's `compare` both take it. The current window is either the * calendar `period` holding `at` (default: now, in the organization's time * zone) or an explicit `from`/`to`. A date alone ("2026-09-01") is that local * day in the organization's time zone. */ interface AggregateCompare { against?: AggregateCompareKind; /** The date Field the period runs along. Defaults to the bucket's key. */ key?: string; period?: AggregateBucket; at?: string; from?: string; to?: string; /** Compare the part of the period that has happened ("month to date"). */ to_date?: boolean; /** The fixed period `range` compares against. Half-open: `to` is excluded. */ baseline?: { from: string; to: string; }; } /** One measure now and before. `change_pct` is null when before was nothing or zero. */ interface AggregateDelta { current: number | null; prior: number | null; change: number | null; change_pct: number | null; } /** * S3 — THE TWO WINDOWS the store actually ran, as local ISO moments with the * organization's offset ("2026-09-01T00:00:00-07:00"), and the calendar that * cut them. A screen labels the comparison from THIS, never from its own clock. */ interface AggregateCompareWindows { key: string; against: AggregateCompareKind; period: AggregateBucket | null; to_date: boolean; time_zone: string; week_start: string; /** The bucket grain the windows were counted in, when the question had a bucket. */ grain: AggregateBucket | null; /** How many buckets the current window holds — what a target's pace is shared over. */ bucket_count: number | null; window: { from: string; to: string; }; prior_window: { from: string; to: string; }; /** On a row from `recordAggregate`: that row's bucket position (see `AggregateRow.position`). */ position?: number | null; } /** The measure key the store answers with, so a chart can find its own series. */ declare function measureKey(measure: AggregateMeasure): string; /** * THE QUESTION, AS A STABLE STRING — key-sorted JSON of a `RecordFilter`. * * A React parent that rebuilds `{ status: "Cancelled" }` on every render hands * a NEW object every time, and a hook that depends on the object re-reads the * whole page on every render forever. Depending on this instead means the page * is re-read exactly when the QUESTION changed, which is what a person means. * * Nested window objects are sorted too, so `{from, to}` and `{to, from}` are * one question. `undefined` and an empty filter are both `"{}"` — the caller * asked nothing, and there is only one way to ask nothing. */ declare function stableFilterKey(filter: StoreFilter | null | undefined): string; /** * AGG-WITHHELD — the store's answer, with the withheld state lifted out of `measures`. * `custom.record_aggregate` puts a withheld measure's notice under `measures._withheld` * (null beside it); no consumer should ever meet that key among the numbers, so the one door * that reads the answer moves it to `row.withheld` and zeroes a count the store left out. */ declare function liftWithheld(rows: AggregateRow[]): AggregateRow[]; /** * ROLLUP-FILTER (2026-10-18) — SEVERAL VALUES FOR ONE COLUMN, IN A FLAT FILTER. * * Beside a single value (`{status: "Paid"}`) and a window (`{paid_on: {relative: "this_month"}}`), a * column of a flat filter (a roll-up's `config.filter`, a saved view's filters) takes * - an any-of list `{status: ["Sent", "Overdue"]}` (the store's list branch, has_any) * - a not-in form `{status: {not: ["Draft", "Cancelled"]}}` (one word works too; list question is_not) * Each word is a choice's key or label, any case. This is the ONE reading of that grammar for the TypeScript * twins of `custom.record_filter_sql` (the memory world, the template checker); the store's own is the SQL. * A blank cell is none of the words, so a not-in form keeps it. */ type FilterWords = { mode: "any" | "none"; words: string[]; }; /** `{not: ...}` / a list as the words it asks about, or `null` when the value is neither (a scalar, a window, null). */ declare function filterWordsOf(want: unknown): FilterWords | null; /** * Does a cell (one value, a list, or nothing) satisfy an any-of / not-in question? `aliases` maps a word to the other * words that name the same choice (its key and label), so a filter written with the key reads a cell kept as the label. */ declare function cellMatchesWords(cell: unknown, q: FilterWords, aliases?: (word: string) => readonly string[]): boolean; /** Where a question is asked. */ type DrillSource = { kind: "table"; id: Uuid; } | { kind: "entity"; token: string; }; /** Who a question is asked for (the access lanes, applied to counting). */ type DrillLane = "mine" | "organization" | "platform"; type DrillGrain = "hour" | "day" | "week" | "month" | "quarter" | "year"; type DrillMeasureOp = "count" | "count_distinct" | "sum" | "avg" | "min" | "max" | "median" | "percentile" | "rate" | "filled" | "empty" | "ratio" | "sum_of" | "span"; /** * The operations a question may ask ad hoc (`{op, of}`); a ratio, a percentile and a run rate are * declared, never ad hoc (each needs more than a column: its parts, its p, its per). */ type DrillAdHocOp = Exclude; /** * A color a choice keeps on every chart and share bar (lane DRILL-PARITY-LAST): one of the package's * semantic chart tokens (light and dark), never a raw color — the old usage page's origin colors. */ type DrillChartToken = "--matrx-chart-1" | "--matrx-chart-2" | "--matrx-chart-3" | "--matrx-chart-4" | "--matrx-chart-5" | "--matrx-chart-6" | "--matrx-chart-7" | "--matrx-chart-8" | "--matrx-chart-9" | "--matrx-chart-10" | "--matrx-chart-other"; /** Every chart token a choice may name (the validator's list). */ declare const DRILL_CHART_TOKENS: readonly DrillChartToken[]; /** A value a Measure's own `where` narrows by: a value, null ("not set") or a list of them. */ type DrillMeasureWhereValue = string | number | boolean | null | Array; /** An axis a question can cut by. */ interface DrillDimension { key: string; label: string; /** The column (fact) or `join.column` it reads. */ from: string; kind: "choice" | "relation" | "boolean" | "text" | "time"; cardinality?: "low" | "medium" | "high"; /** A code's words; `color` keeps the value one chart token on every chart and share bar. */ choices?: Array<{ value: string; label: string; color?: DrillChartToken; }>; /** A relation's target: a registry token (standard) or a Table id (custom). */ relation?: { token?: string; table_id?: Uuid; person?: boolean; }; /** A time's grains, coarsest first. */ grains?: DrillGrain[]; /** The words the empty group reads ("No embedding (nothing new to embed)"); a screen's own default otherwise. */ empty_label?: string; /** * What the Dimension groups by, at most 140 characters (lane DRILL-FLIP-FIXES, the Spend cut tables' * explanations): a screen shows it as the column header's tooltip, never as text on the page. */ description?: string; /** * WHAT A LEVEL OF IT LOOKS LIKE (lane DRILL-LEVELS) — the same shape as the design-system's * `MatrxDrillLevel`; judged by platform.drill_definition_problems and handed to a screen by * drill_describe. Absent = the screen infers it. */ level?: DrillLevel; } /** * A DIMENSION'S LEVEL PROFILE (lane DRILL-LEVELS): what a drilled value of it offers and says. * breakouts — Dimension references (`at:day` for a time) offered as one-click "By …" chips, in order; * `:` names a SIBLING definition's Dimension (`ai_usage_executions:conversation`): * the screen switches the source there carrying the trail (lane DRILL-PRIMITIVE-2) * show — the Measures shown while grouping by it * attributes — Dimension keys each value holds ONE of (a conversation's agent, a model's provider): * columns while grouping by it, and the drilled value's header * records — the columns "See these records" shows at this level (a subset of `records.columns`) */ interface DrillLevel { breakouts?: string[]; show?: string[]; attributes?: string[]; records?: string[]; } /** The longest a Dimension's or a Measure's `description` may be (a tooltip's budget). */ declare const DRILL_DESCRIPTION_MAX = 140; /** A number a question can show. */ interface DrillMeasure { key: string; label: string; op: DrillMeasureOp; /** * The column it reads (absent for `count`, `ratio` and `sum_of`). A `max` / `min` of a time column * is a MOMENT ("Last active"): it declares `unit: "time"`, is never additive, and no threshold reads it. */ of?: string; /** * `ratio` only: (the sum of these Measures) / (the sum of `den`), recomputed for every group, Other * and the total from their parts (never averaged). Each part is a `sum` or `count` Measure of the * same definition (optionally narrowed by its own `where`), or another ratio — e.g. cost per request * = `{op: "ratio", num: ["cost"], den: "requests"}`; cache-hit rate = `{num: ["hits"], den: ["hits", * "calls"]}`; the enrichment multiplier = `{num: ["avg_enriched"], den: "avg_plain"}` (two ratios). */ num?: string[]; /** * `sum_of` only: these Measures added up, recomputed for every group, Other and the total from * their own rows — total tokens = `{op: "sum_of", parts: ["tokens_in", "tokens_cached", "tokens_out"]}`. * Each part is a `sum` or `count` that adds up, or another `sum_of`; at least two. */ parts?: string[]; /** `ratio` only: the Measure (or the list of Measures, added up) it is divided by; null where that is zero. */ den?: string | string[]; /** * `ratio` or `rate`: a multiplier, bound by the door — `1000` makes cost per character cost per * 1,000 characters; `10` makes a monthly projection "at ten times today's load". */ scale?: number; /** `percentile` only: the fraction, above 0 and below 1 (`0.9` = p90). Recomputed for Other and the total from their own rows. */ p?: number; /** * `rate` only: the run rate's period. A run rate is the window's sum of `of` ÷ the window's length * × one `per` ("day", or "month" = 30 days — the old KG projection's rule). A question showing one * must have a window with a start; a window reaching past now counts only the time that has passed. */ per?: "day" | "month"; /** * This Measure only, narrowed to the rows whose Dimensions hold these values (Dimension key → a * value, null or a list; never a time): "cost of successful enriched runs". Bound by the door. */ where?: Record; /** * How a screen reads the number: usd, count, tokens, ms, share, times, …; `time` = a moment (ISO); * `duration` = a length of time in milliseconds — what a `span` (`of` a time column: the latest * minus the earliest moment, never additive, recomputed for Other and the total) declares. */ unit?: string; /** Counted once per this column's value (a measure on the "one" side of a join). */ at_grain?: string; /** May it be summed across groups? */ additive?: boolean; /** * What the number counts, at most 140 characters (lane DRILL-FLIP-FIXES): a screen shows it as the * column header's tooltip — "Requests a person or an API caller made; automated runs count as Calls". */ description?: string; /** * (lane DRILL-ENGINE, 2026-10-18) How a summary-backed distinct count that is NOT exact over groups or hours is * answered exactly, definer definitions only. `per_hour`: registry token of a per-hour total (the time column, * `everyone`, this Measure's `of` column, each lane rule's column) read for an ungrouped question — exact to the * hour. `raw_of`: the records column counted distinct, the whole question read from the records relation when the * window is at most `raw_within_hours` long. Any other question showing it says "not exact". */ exact?: { per_hour?: string; raw_of?: string; raw_within_hours?: number; }; } /** A named drill path: the levels a click walks, e.g. ["created_at:year", "created_at:month"]. */ interface DrillPath { key: string; label: string; levels: string[]; } /** * A threshold on the groups of an answer (`having`). Judged on the current window, and applied * BEFORE the cut into Other: a group that misses any threshold is added into Other with the groups * past the limit, so the answer still adds up to its total; `distinct_groups` counts the groups that * met every threshold and the total row says how many did ("3 of 41 groups meet the rule …"). * Exactly one of `value` / `share_of_total` / `times_median`. */ interface DrillHaving { /** A Measure the question shows (a screen shows the number it filters on). */ measure: string; /** At least / more than; at most / less than (lane DRILL-FLIP-FIXES: "groups where cost ≤ 5"). */ op: ">=" | ">" | "<=" | "<"; /** The group's value against a number. */ value?: number; /** The group's value against this percent (0–100] of the window's total; additive Measures only. */ share_of_total?: number; /** The group's value against this multiple of the median group's value. */ times_median?: number; /** With `times_median`: the median of the groups above zero only. */ median_nonzero?: boolean; /** * The address of the drill setting that holds the line (organizations and people decide): * `drill.finding...` inside a finding. When present the setting's value * is the threshold and the number written beside it is its default. Resolved by the door through * platform.drill_knob; clients read the same value from platform.knob_snapshot. */ knob?: string; } /** A question — what a Saved view stores and the explorer's URL encodes. */ interface DrillQuestion { /** Dimension keys, outermost first; a time as `key:grain` ("created_at:week"). At most four. */ by?: string[]; /** One Dimension drawn as the columns of a pivot. */ across?: string; /** Measure keys, or an ad hoc `{op, of}` over a column the definition reads. */ show?: Array; /** * The store's own filter shape: a scalar is an equality, `null` is "not set", a list is any of * them, `{from, to}` is a half-open range; `key:grain` = one period by its label. */ where?: Record; /** * A custom Table only: the view's Rule expression, which must hold beside `where` * (custom.record_drill ANDs the two). A standard source refuses it. */ rule?: RuleExpression; window?: { key?: string; preset?: string; from?: string; to?: string; }; compare?: "previous_period" | "same_period_last_year" | { against: "previous_period" | "same_period_last_year" | "range"; period?: DrillGrain; from?: string; to?: string; baseline?: { from: string; to: string; }; to_date?: boolean; }; sort?: { key: string; direction?: "asc" | "desc"; }; /** Groups per level before Other; the knob's value when absent, never above the page ceiling. */ limit?: number; lane?: DrillLane; /** The drill path a screen's default click follows. */ path?: string; /** Thresholds on the groups, applied before the cut into Other (see DrillHaving). */ having?: DrillHaving[]; /** Records only: the page's start. */ offset?: number; /** Records only: which columns a record shows (a definer definition's records: of its declared columns). */ columns?: string[]; } /** A definition's built-in Saved view: read-only; "Save a copy" makes a person's own. */ interface DrillView { key: string; label: string; question: DrillQuestion; /** * AT A GLANCE (lane DRILL-FLIP-FIXES, the Spend Explorer's costliest requests): Dimensions each group * of the view's outer grouping has ONE value of — a request's person, agent, model — shown as text * columns beside its numbers, no click required. A screen reads them by asking the same door with * the group and these Dimensions (the group's values listed), so they obey the same lane and filters. * A group holding several values of one says so. */ attributes?: string[]; /** * How the view's chart draws (lane DRILL-FLIP-FIXES, the CX tab's input vs output tokens): `stack` * names two or more Measures that add up, drawn as one stacked bar per period (no split). */ chart?: { stack?: string[]; }; } /** * A finding ("dig here"): a question whose `having` thresholds are the rule. Its lines are settings * at `drill.finding...`, seeded from `knobs` by the drill sync; a * threshold that reads one writes the setting's default beside it. A finding with no group says so. */ interface DrillFinding { key: string; label: string; question: DrillQuestion; knobs: Record; } /** * The records behind a DEFINER definition's numbers: a registry relation carrying the fact's column * names (e.g. `bucket`), read by the door definer with the SAME filter compiler and the SAME lane * rule as the number, for a window (required), and never past the number's `as_of` (rows created * after it are not listed). The number and its records are the SAME counted rows, equal as of the * count (`as_of`); a value that changes afterwards reaches both at the next count. * * An INVOKER definition may declare records too (lane DRILL-GAPS): they are its own rows (`fact` is * the definition's own fact), read as the person through the table's row security, among the columns * the definition already reads — so a screen shows "the recent runs" without a host link. */ interface DrillRecords { /** The registry token of the records relation (e.g. "ai_usage_executions"). */ fact: string; /** The columns a record shows, in order. */ columns: string[]; /** The words a person reads for a column, where its name would mislead ("Request's top model"). */ labels?: Record; /** * What ONE record is, singular ("execution", "log line"): the noun "See these records" and their * count read in. REQUIRED when the records are another relation's rows (`fact` is not the * definition's own fact: an hourly summary's records are its executions, never "hours"); optional * otherwise, where the definition's own grain ("one row per deal") already names it. */ noun?: string; } /** The address of a finding's setting: `drill.finding...`. */ declare function drillFindingKnob(definition: string, finding: string, knob: string): string; interface DrillDefinition { key: string; label: string; source: DrillSource; /** One sentence: "one row per agent". */ grain: string; lanes: DrillLane[]; dimensions: DrillDimension[]; measures: DrillMeasure[]; paths: DrillPath[]; detail: { columns: string[]; open?: string; }; default: DrillQuestion; /** Keys that came from inference, so a screen can say so. */ inferred?: string[]; mode?: "invoker" | "definer"; /** Honest notes about what inference could not offer, in words. */ says?: string[]; /** Built-in Saved views, listed first and read-only. */ views?: DrillView[]; /** Findings ("dig here"), answered by the same door. */ findings?: DrillFinding[]; /** The records relation (what "See these records" reads): a definer definition's declared relation, or an invoker definition's own rows. */ records?: DrillRecords; /** * The drill setting (minutes) after which the definition's `as_of` is old enough for a screen to say * "the schedule is behind" — null when the definition is counted live. */ stale_after_knob: string | null; } /** One row of an answer. */ interface DrillAnswerRow { /** `group` a shown group · `other` every group past the cap · `total` the whole answer (or a pivot column's total). */ kind: "group" | "other" | "total"; /** Each asked Dimension -> its value (a period by its label). A pivot cell also carries the `across` key. */ groups: Record | null; measures: Record | null; row_count: number; prior_groups: Record | null; prior_measures: Record | null; prior_row_count: number | null; delta: Record | null; compare: Record | null; /** How many groups there were before the cap (current window). */ distinct_groups: number | null; /** Relation Dimensions' labels, read as the person through the target's own row security. */ labels: Record; /** The answer's honest sentences (the cut, a column past its cap, a name that could not be read). */ says: string | null; /** The moment a summary fact counted through (ISO); null when counted live from the table. */ as_of: string | null; } interface DrillAnswer { rows: DrillAnswerRow[]; /** Every sentence the rows carry, once. */ says: string[]; /** The total row (kind total, no group). */ total: DrillAnswerRow | null; /** The moment the answer counted through (the rows' `as_of`); null when counted live. */ as_of: string | null; } /** The records behind a number ("see these records"): the same filter, read as the person. */ interface DrillRowsPage { total: number; limit: number; offset: number; rows: Array>; next_offset?: number; columns?: string[]; says?: string; /** The moment these records are cut at — the number's `as_of`; null when read live. */ as_of: string | null; /** * A definer definition's records, first page only: every Measure that adds up (sum, count, ratio) * summed over the SAME filter — what these records add up to, which is the number they open. */ measures?: Record; } /** * A DECLARED drill definition (a `*.drill.ts` file): an override of one standard table (its key * IS that table's registry token) or a fact over several tables (a key of its own). The one sync * script (scripts/drill-sync.ts) compiles each into `platform.drill_def__()`; the store's * validator, platform.drill_definition_problems, judges it at sync, at census and on every ask. */ interface DrillDeclaration { key: string; label: string; grain: string; /** The fact's registry token. */ fact: string; /** invoker (default): the fact's own row security decides. definer: the lane rules below do. */ mode?: "invoker" | "definer"; lanes: DrillLane[]; /** invoker: which columns narrow the organization and mine lanes. */ lane_columns?: { organization?: string; mine?: string; }; /** definer ONLY, and required for every lane: a closed vocabulary, never SQL. */ lane_rules?: { mine?: { column: string; }; organization?: { column: string; rule: "member" | "admin"; }; platform?: { rule: "super_admin"; }; }; /** Star joins along a real foreign key, many-to-one only. `from` is a fact column or `join.column`. */ joins?: Array<{ as: string; token: string; from: string; }>; dimensions: DrillDimension[]; measures: DrillMeasure[]; paths?: DrillPath[]; detail?: { columns: string[]; open?: string; }; default?: DrillQuestion; /** An override may hide inferred keys. */ hide?: string[]; /** Built-in Saved views (every question judged against this definition by the validator). */ views?: DrillView[]; /** Findings: questions with thresholds whose lines are settings. */ findings?: DrillFinding[]; /** * definer: the relation its records are read from (the same filter and lane rule); invoker: its own * fact, read as the person (lane DRILL-GAPS). */ records?: DrillRecords; /** definer ONLY, and only over a fact that keeps a `_watermark`: the stale line's setting. */ stale_after_knob?: string; } /** Identity with a type: the one way a `*.drill.ts` file declares a definition. */ declare function declareDrillDefinition(declaration: T): T; /** Decode the door's rows into an answer: the total row found, every sentence once. */ declare function drillAnswerOf(rows: DrillAnswerRow[]): DrillAnswer; /** The door's name for each call (schema `platform`). */ declare const DRILL_SCHEMA = "platform"; declare const DRILL_DOORS: { readonly describe: "drill_describe"; readonly ask: "drill_ask"; readonly rows: "drill_rows"; }; /** `custom.decoration_colors()` — the palette, in the order an uncolored choice takes. */ type DecorationColor = "slate" | "green" | "amber" | "red" | "blue" | "violet" | "teal" | "orange" | "yellow" | "pink" | "brown" | "gray"; /** `custom.decoration_rule_ops()` — the tests a color rule may ask. */ type DecorationRuleOp = "is" | "is_not" | "contains" | "is_empty" | "not_empty" | "is_true" | "is_false" | "gt" | "gte" | "lt" | "lte"; type DecorationTarget = "row" | "cell"; interface DecorationRule { /** Given by the store when omitted; keep it to edit the rule in place. */ id?: string; /** The Field id the rule reads. */ field: Uuid; op: DecorationRuleOp; /** Compared as text for is / is_not / contains, as a number for gt / gte / lt / lte. */ value?: string | number; color: DecorationColor; target: DecorationTarget; } interface TableDecorations { version: 1; colors: DecorationColor[]; rule_ops: Array<{ op: DecorationRuleOp; takes_value: boolean; label: string; }>; color_by?: { field: Uuid; target: DecorationTarget; }; rules: DecorationRule[]; /** Hand highlights: record id → color. */ rows: Record; /** Hand highlights: Field id → color. */ columns: Record; /** Hand highlights: record id → Field id → color. */ cells: Record>; /** What stopped painting because its column is gone — said, never silently dropped. */ stale: Array<{ part: string; field?: Uuid; rule_id?: string; record_id?: Uuid; says: string; }>; } /** * ONE LEAF of a Table's colors — the older door's own path shape * (`public.udt_set_table_style`), so two people highlighting two rows never overwrite each other. */ type DecorationPath = ["color_by"] | ["rules"] | ["rows", Uuid] | ["columns", Uuid] | ["cells", Uuid, Uuid]; type GridLayoutMode = "auto" | "fit" | "scroll"; /** * Airtable's four heights are short (1 line), medium (2), tall (4), extra_tall (6). `compact` and `normal` * are the older words and still read: both are a one-line row. */ type GridRowHeight = "compact" | "short" | "normal" | "medium" | "tall" | "extra_tall"; /** A saved view's own grid choices, kept at `definition.grid` (custom.view_declare judges them). `definition.layout` is the view's KIND (grid / kanban / calendar / gallery), never these. */ interface ViewLayout { mode?: GridLayoutMode; row_height?: GridRowHeight; freeze_first_column?: boolean; wrap?: boolean; /** Field id → pixels, 60–1200. */ widths?: Record; } interface GridLayout { layout: Required> & { fit_max_columns: number; widths?: Record; }; /** Where each choice came from. */ source: Record; view_id: Uuid | null; /** A stored choice the grid cannot honor, named. */ refused: Array<{ from: "organization" | "view"; choice: string; value: unknown; says: string; }>; } type RowActionStep = { field: Uuid; set: "value"; value: unknown; } | { field: Uuid; set: "clear"; } /** Worked out by the store on each record: the older grid's formula text, or an expression. */ | { field: Uuid; set: "compute"; formula_text?: string; expr?: Record; }; interface RowAction { /** Given by the store when omitted. */ id?: Uuid; name: string; kind?: "update" | "agent"; color?: DecorationColor | null; icon?: string; /** Ask before running. */ confirm?: boolean; steps?: RowActionStep[]; /** `agent` only: what the record chat opens with. */ prompt?: string; /** On read: whether custom.action_run can run it. */ runnable?: boolean; } interface ActionRunResult { action_id: Uuid; action: string; table_id: Uuid; ran: number; records: Array<{ record_id: Uuid; version: number; }>; } /** One record (and, when it can be named, one field) that refused a row action. */ interface ActionRefusal { record_id: Uuid; record: string | null; field_id: Uuid | null; field: string | null; code?: string; says: string; } /** * Every refusal of an action run, read off the store's refusal. A run that any record refused * changed NOTHING; this is the list a screen shows so the person can fix those and run again. */ declare function actionRefusals(error: RecordsError): ActionRefusal[]; type FormulaParse = { ok: true; text: string; /** The store's expression shape — what `config.expr` holds. */ expr: Record; references: Array<{ name: string; field_id: Uuid; }>; result_type: "number" | "text" | "boolean" | "date" | "unknown"; } | { ok: false; text: string; error: string; position: number; }; /** NOTION-PROPS: `formulaPreview` — the parse, and what it works out to on one record. */ type FormulaPreview = FormulaParse & { /** The answer on `record_id`, as the formula column would show it; null when nothing was sampled. */ value?: unknown; record_id?: Uuid | null; /** It parses, and could not be worked out on that record (a division by zero, a bad date …). */ error?: string; }; type RecordEvent = "record.created" | "record.updated" | "record.archived" | "record.restored" | "record.purged"; interface TableWebhookDeclared { webhook_id: Uuid; table_id: Uuid; target_url: string; events: RecordEvent[]; /** Shown this once: X-Matrx-Signature is sha256=HMAC-SHA256(secret, body). */ secret: string; says: string; } interface TableWebhook { webhook_id: Uuid; target_url: string; description: string | null; events: RecordEvent[] | null; is_active: boolean; last_attempt_at: string | null; last_success_at: string | null; consecutive_failures: number; owner_id: Uuid; created_at: string; } /** One page of `custom.io_export`: exactly what the read door serves this person. */ interface IoExportPage { table_id: Uuid; token: string; columns: string[]; rows: Array>; /** A column the store withheld from this reader, with the store's reason. */ withheld: Record; page: { requested: number; returned: number; ceiling: number; next: number | null; }; choices: unknown; } /** * THE .XLSX OF AN EXPORT PAGE. Numbers stay numbers and booleans stay booleans in the sheet; a * column the store withheld is NAMED on a second sheet with the store's reason, so a person * never mistakes a withheld column for an empty one. `labels` maps a column key to its header * (the Field's label); a key with no label is its own header. */ declare function exportPageXlsx(page: IoExportPage, labels?: Record, sheetLabel?: string): Promise; /** * THE EVENT-SOURCE KEY of a record-store table: `record:
` — what its changes carry on the * activity spine, what a webhook's `resource_types` names and what a schedule's `event` trigger * listens for (`custom.record_source_key` in the store). The store's token is `record`; the older * key `custom_record:
` named the retired tier-2 table and is never written. */ declare function recordSourceKey(tableId: Uuid): string; /** * The table a stored event-source key names, or `null` when the key is not a record-store key. * Reads the older `custom_record:
` too, for rows saved before the key moved (the store * reads both for one release: `custom.record_source_table`). */ declare function recordSourceTable(key: string | null | undefined): Uuid | null; /** A record-store row event, as the activity spine carries it (and a schedule matches it). */ type RecordChangeAction = RecordEvent; /** * THE SCHEDULE TRIGGER for "when a row of this record-store table changes, run …" — the same * `event` trigger the older store's tables use, pointed at this store's events: * `entity_type` `record:
` ({@link recordSourceKey}), actions `record.*`, `changed_fields` * by column KEY. * `scheduler.sch_match_event` matches it against the event * `custom._record_events_to_activity` writes (GRID-PRIMITIVES G8), so one matcher serves both * stores. Omit `actions` to hear every change; omit `changedFields` to hear every column. */ declare function recordChangeTrigger(tableId: Uuid, options?: { actions?: RecordChangeAction[]; changedFields?: string[]; }): { type: "event"; entity_type: string; table_id: Uuid; actions?: RecordChangeAction[]; changed_fields?: string[]; }; /** * One entry of `custom.table_list_everywhere` — `public.get_user_tables`' own shape plus * `store`, so a picker swaps one call and keeps its code. `store` says which home opens it. */ interface TableListEntry { id: Uuid; table_name: string; description: string | null; version: number | null; user_id: Uuid | null; is_public: boolean | null; visibility: string | null; organization_id: Uuid; created_at: string; updated_at: string | null; last_activity_at: string | null; row_count: number; field_count: number; store: "older" | "records"; } /** * One row of `custom.data_home_tables` — every table the person reaches, with the store's own * answers for the organization's name, who made it, and whether the app keeps it. `system` is a * system organization's table (reached on the admin lane only). */ interface DataHomeTable { table_id: Uuid; table_name: string; organization_id: Uuid; organization_name: string; member: boolean; visibility: string | null; updated_at: string | null; mine: boolean; shared_with_me: boolean; platform_owned: boolean; kind: string | null; team?: boolean; system?: boolean; created_by?: Uuid | null; } /** * One row of `custom.admin_all_tables` — a table in ANY organization, for the admin section only * (the store's walls admit a platform admin to system organizations alone, so `DataHomeTable` cannot * list the rest). Answered only on the admin lane for a platform admin; any other caller is refused. */ interface AdminTable { table_id: Uuid; table_name: string; organization_id: Uuid; organization_name: string | null; updated_at: string | null; platform_owned: boolean; system: boolean; } /** Where a synced table comes from. `external_id` is the source's own id (a spreadsheet id). */ interface TableSyncSource { provider: string; external_id: string; tab_id?: string | null; synced_at?: string | null; } /** What `custom.table_sync` takes: the source, its columns, and every row it has NOW. */ interface TableSyncSpec { source: TableSyncSource; table_name: string; columns: string[]; rows: { ref: string; values: Record; }[]; } interface TableSyncResult { table_id: Uuid; created: boolean; fields_added: number; rows_inserted: number; rows_updated: number; rows_archived: number; source_system: string; } /** * A sheet tab's cells (header row first) → the spec `custom.table_sync` takes. Every row is * named by its sheet row number (`row-2` is the first row under the header) unless * `refColumn` names a column holding a stable id; a blank or repeated ref is refused here, so * the store never sees two rows claiming to be the same source row. Wholly blank rows are * skipped. Pure. */ declare function sheetSyncSpec(args: { source: TableSyncSource; tableName: string; cells: readonly (readonly (string | number | boolean | null | undefined)[])[]; refColumn?: string; }): TableSyncSpec; /** * What `custom.table_copy_sync` takes (lane SYNC-AIRTABLE): a table synced from another table's * view — read as the caller, so the copy holds only what that view shows them. Lands through * `custom.table_sync` in the caller's active organization (`home_id` defaults to its data home). */ interface TableCopySpec { source_organization_id: Uuid; source_table_id: Uuid; view_id?: Uuid | null; table_name?: string | null; home_id?: Uuid | null; /** `on_change` (default): the store's time tick refreshes the copy when the source changes. */ auto_refresh?: "on_change" | "off"; } /** Every `custom.table_sync` answer also says when the sync happened and what it could not do. */ interface TableSyncAnswer extends TableSyncResult { rows_restored?: number; rows_kept_archived?: number; rows_total?: number; warnings?: string[]; synced_at?: string; } /** How often a synced table refreshes on its own (`sync_source.auto_refresh`). */ type SyncAutoRefresh = "off" | "hourly" | "daily" | "on_change"; /** What `custom.table_sync_settings_set` changes on one synced table. */ interface TableSyncSettings { auto_refresh?: SyncAutoRefresh; /** Google Sheets through a connected account only: edits go back to the sheet. */ write_back?: boolean; } /** The `sync_source` a synced Table carries (what the store wrote, read back). */ interface TableSyncSourceDocument extends TableSyncSource { label?: string | null; url?: string | null; access?: "link" | null; header_row?: number | null; set_by?: Uuid | null; auto_refresh?: SyncAutoRefresh | null; write_back?: boolean | null; source_organization_id?: Uuid | null; due_at?: string | null; } /** One row of `custom.table_row_counts`: the rows of that Table this reader may see. */ interface TableRowCount { table_id: Uuid; visible_rows: number; } /** * One row of `custom.record_headers`: the row's own columns the document door does not answer. * `created_by` is the caller's own id on rows the caller made and null on every other; `mine` * says which. */ interface RecordHeader { id: Uuid; table_id: Uuid; created_at: string; updated_at: string; version: number; deleted_at: string | null; mine: boolean; created_by: Uuid | null; } /** * Fold `table_row_counts` onto a table list: `row_count` set on every Table the counts name. * A Table the counts do not name keeps what it had — the store answers no row for a Table this * reader may not know, and that is never turned into a zero. Pure. */ declare function withRowCounts(tables: readonly T[], counts: readonly TableRowCount[] | null | undefined): T[]; /** What `custom.view_record_order_set` answers. */ interface ViewOrderSet { view_id: Uuid; table_id: Uuid; order: "manual"; named: number; positioned: number; } /** * The order to send after a drag: `order` with `moved` taken out and put at `toIndex` (clamped). * The store keeps every row the call does not name in its old place after the named ones, so a * screen may send only the rows it shows. Pure. */ declare function moveInOrder(order: readonly Uuid[], moved: Uuid, toIndex: number): Uuid[]; /** * What `custom.table_share_outside_grant` answers. `person` says which path ran: * `outside_account` (granted at once and notified — never made a member), `member` (a plain * share), `no_account` (the invitation door's own answer, with its link and delivery). */ interface OutsideShareAnswer { granted: boolean; invited: boolean; joined: boolean; person: "outside_account" | "member" | "no_account"; email: string; table: string; level: string; level_label: string; say: string; user_id?: Uuid; permission_id?: Uuid; invitation_id?: Uuid | null; accept_path?: string | null; delivery_say?: string | null; } /** A value an action writes: a literal, or a reference the store resolves at run time. */ type AutomationValue = string | number | boolean | null | { from: Uuid; } | { now: true; } | { in_days: number; } | { me: true; } | { clear: true; } | unknown[] | Record; /** `{ [field id]: value }` — every key is a live Field of the table the step writes to. */ type AutomationValues = Record; /** A filter in the store's one rule shape; inside an `edit_rows.where`, `{ trigger: }` means that value on the triggering row. */ type AutomationFilter = Record; /** Days of the week as the store counts them: 1 Monday … 7 Sunday. */ type AutomationWeekday = 1 | 2 | 3 | 4 | 5 | 6 | 7; type AutomationTrigger = { on: "row_added"; } | { on: "property_edited"; field: Uuid; to?: unknown; } | { on: "form_answered"; } /** * AUTOMATIONS-AIRTABLE: Airtable's "When record updated" — any of `fields` edited (an empty list or none = any * property). */ | { on: "record_updated"; fields?: Uuid[]; } /** * AUTOMATIONS-AIRTABLE: Airtable's "When record matches conditions" (the spec's `condition`, any depth) or, with * `view_id`, "When record enters view" (that saved view's own filter, read at run time). Fires when a row COMES TO * match — added matching, or edited from not matching to matching — never again while it stays matching. */ | { on: "record_matches"; view_id?: Uuid; } /** AUTOMATIONS-AIRTABLE: a press of this button column (`custom.button_press`) on a row runs it on that row. */ | { on: "button_pressed"; field: Uuid; } /** * AUTOMATION-TIME: a date or date-time property reaching now, `offset_days` before (negative) or after * (positive), at `at` (HH:MM, default 09:00) in the person's own zone, else the organization's. Fires once per row * per date value; the date changing re-arms it. */ | { on: "date_arrives"; field: Uuid; offset_days?: number; at?: string; } /** * AUTOMATION-TIME: the table acts with no row, every day / week (`weekday`) / month (`day`, 1-31, a short month * runs on its last day) at `at`. `set`, a person property, `{from}` and `{trigger}` have no row to read and are * refused; `add_row` is the repeating row and `edit_rows` the scheduled bulk edit. */ | { on: "schedule"; every: "day" | "week" | "month"; at?: string; weekday?: AutomationWeekday; day?: number; } /** * AT-AUTO2: every N minutes (5, 10, 15, 30) or every N hours (1, 2, 3, 4, 6, 8, 12) at `minute` past. Saved switched * OFF; the person switches it on (no blind paid automations). */ | { on: "schedule"; every: "minutes"; minutes: 5 | 10 | 15 | 30; } | { on: "schedule"; every: "hour"; hours?: number; minute?: number; } /** * AT-AUTO2: an inbound webhook. The store makes the automation's `webhook_secret`; the URL is * `automationWebhookUrl(serverBase, automation)`. The JSON body is `{{trigger.body.…}}` to every step. */ | { on: "webhook"; } /** * W2-E: a new email in the OWNER's own connected Gmail matching `query` (Gmail search syntax; none = every new * email). Like every connected-app trigger it has no row, is saved switched OFF, and once switched on the server * checks the account on the automation's own personal schedule (`automationAppTriggerTerms`); each new item starts one * run with the item as `{{trigger.body.…}}` (`subject`, `from`, `to`, `snippet`, `date`, `link`, `id`). */ | { on: "gmail_received"; query?: string; } /** * W2-E: an event on the owner's primary Google Calendar starts (`minutes_before` its start, 0-1440) or is created. * `{{trigger.body.title}}`, `starts_at`, `ends_at`, `location`, `attendees`, `link`, `id`. */ | { on: "calendar_event"; when?: "starts" | "created"; minutes_before?: number; } /** * W2-E: a message posted in a Slack `channel` (optionally containing `contains`). The platform has no Slack sign-in * yet, so the automation says so (`app_says`) until one exists. */ | { on: "slack_message"; channel: string; contains?: string; } /** * AT-MSFT: a new email in the owner's Outlook inbox, read through their own Microsoft connection (`Mail.ReadBasic`: * envelopes only, never the body). `query` keeps it to `from:` / `subject:` terms and plain words (every term must * match; none = every new email). `{{trigger.body.subject}}`, `from`, `from_name`, `to`, `received_at`, `link`, `id`. */ | { on: "outlook_received"; query?: string; }; /** W2-E: the triggers that read the owner's connected account on a schedule (saved off; metered per check). */ declare const AUTOMATION_APP_TRIGGERS: readonly ["gmail_received", "calendar_event", "slack_message", "outlook_received"]; type AutomationAppTrigger = (typeof AUTOMATION_APP_TRIGGERS)[number]; declare function isAutomationAppTrigger(on: string): on is AutomationAppTrigger; /** W2-E: what one connected-app automation costs, read before switching it on (`GET /automations/app-triggers/terms`). */ interface AutomationAppTriggerTerms { every_minutes: number; points_per_check: number; checks_per_month: number; points_per_month: number; points_per_action: number; } /** * AT-AUTO2: a token a step's text or value may carry, resolved when the run reaches that step: * `{{trigger.}}`, `{{trigger.record_id}}`, `{{trigger.body.}}`, `{{stepN.}}` * (a find's `records` / `first` / `count` / `ids`, a script's `output.`, an added row's `record_id`), * `{{item.}}` / `{{index}}` inside a repeating group. A value that IS one token keeps its type (a list stays a list). */ type AutomationToken = `{{${string}}}`; /** AT-AUTO2: one comparison of a conditional group's path. `value` / `to` take tokens. */ interface AutomationComparison { value: unknown; is: "equals" | "not_equals" | "contains" | "not_contains" | "gt" | "gte" | "lt" | "lte" | "empty" | "not_empty" | "is_true"; to?: unknown; } type AutomationWhen = { all: AutomationComparison[]; } | { any: AutomationComparison[]; }; type AutomationAction = { do: "set"; values: AutomationValues; } | { do: "add_row"; table_id: Uuid; values: AutomationValues; } | { do: "edit_rows"; table_id: Uuid; where: AutomationFilter; values: AutomationValues; limit?: number; } | { do: "notify"; to: { person: Uuid; } | { field: Uuid; } | { author: true; }; text: string; subject?: string; link?: string; } | { do: "webhook"; url: string; } /** * AUTOMATIONS-AIRTABLE: an email through the platform's notification sender (event `custom.automation.email`) to an * address, a member, the address (or person) in a property of the row, or the automation's author. `subject` and * `body` take field tokens: `{Field name}` or `{{}}`. Nothing queued = the step fails and says why. */ | { do: "email"; to: { address: string; } | { person: Uuid; } | { field: Uuid; } | { author: true; }; subject: string; body: string; } /** AUTOMATIONS-AIRTABLE: a Slack incoming webhook (`https://hooks.slack.com/...`), message with field tokens. */ | { do: "slack"; url: string; text: string; } | { do: "agent"; prompt: string; } /** AT-AUTO2: records of a table matching a filter (tokens allowed in `const`s); later steps read `{{stepN.records}}`. */ | { do: "find"; table_id: Uuid; where?: AutomationFilter; limit?: number; } /** AT-AUTO2: change the named records (one id, a list, `{{stepN.records}}`, `{{item.id}}`). */ | { do: "update"; table_id: Uuid; record: string | string[]; values: AutomationValues; } /** AT-AUTO2: Airtable's "delete record" — we archive (restorable), never hard delete. */ | { do: "archive"; record: string | string[]; table_id?: Uuid; } /** * AT-AUTO2: JavaScript run by the server in the owner's own sandbox (never in the API process): `input` is * `inputs` resolved, `output.set(key, value)` answers `{{stepN.output.key}}`, console lines land in the run. * Metered to points. On a time trigger it is saved switched off. */ | { do: "script"; code: string; inputs?: Record; timeout_ms?: number; memory_mb?: number; } /** AT-AUTO2: if / else if / else — the first path whose `when` holds runs its steps; else `else`. */ | { do: "if"; branches: { label?: string; when: AutomationWhen; actions: AutomationAction[]; }[]; else?: AutomationAction[]; } /** * W2-E: open an issue in `repo` (owner/name) through the owner's own GitHub connection; `labels` comma-separated. * Answers `{{stepN.output.number}}` / `.url`. A retry answers the same issue. Metered per issue. */ | { do: "github_issue"; repo: string; title: string; body?: string; labels?: string; } /** * MS-WRITE: send one Outlook email as the owner (`Mail.Send`, approved once under Settings -> Integrations -> Microsoft). * `outlook_calendar_event` creates / changes / cancels an event on the owner's calendar (`Calendars.ReadWrite`; a retried * create is the same event); `teams_message` posts in the channel named by a Teams "Get link to channel" link * (`ChannelMessage.Send`) or in the chat named by a chat message's "Copy link" (`ChatMessage.Send`, AT-MSFT); work or * school accounts. Each is metered per action at `automation.app_action_points`. */ | { do: "outlook_mail"; to: string; subject: string; body: string; } | { do: "outlook_calendar_event"; action?: "create" | "update" | "cancel"; event_id?: string; title?: string; starts_at?: string; ends_at?: string; duration_minutes?: number; timezone?: string; attendees?: string; description?: string; notify?: boolean; } | { do: "teams_message"; channel_link: string; message: string; } /** * AT-SLACK: post one message in a Slack channel (name like `general` or an ID like `C0123ABC`) AS the owner, through * their own Slack sign-in (Settings -> Integrations -> Slack, user scope `chat:write`). Sent once; answers * `{{stepN.output.ts}}` / `.channel`. Metered per message at `automation.app_action_points`. The `slack` step * (an incoming-webhook URL) is separate and unchanged. */ | { do: "slack_post"; channel: string; message: string; } /** AT-AUTO2: repeat `actions` for each item of a list token (at most 200 items). */ | { do: "for_each"; list: string; actions: AutomationAction[]; }; interface AutomationSpec { name: string; trigger: AutomationTrigger; /** An optional filter on the triggering row. */ condition?: AutomationFilter | null; actions: AutomationAction[]; } /** `custom.automation_declare`: stored, or refused with one sentence per path (`trigger`, `actions.0.values.` …). */ type AutomationDeclared = { ok: true; automation_id: Uuid; table_id: Uuid; enabled: boolean; spec: AutomationSpec; /** * AUTOMATIONS-AIRTABLE: true when the trigger is a time and a step is an agent — AI on a schedule is saved * switched OFF and turned on only by `automationSetEnabled`; `says` is the store's sentence. */ ai_on_schedule?: boolean; says?: string; reused?: boolean; } | { ok: false; _errors: Record; }; type AutomationRunStatus = "ran" | "failed" | "stopped" | "waiting"; interface AutomationLastRun { run_id: Uuid; status: AutomationRunStatus; at: string; says: string | null; } interface AutomationItem { id: Uuid; /** AT-AUTO2: a webhook automation's secret, part of its URL. */ webhook_secret?: string | null; /** AT-AUTO2: the last payload its webhook received (its test run uses it). */ webhook_sample?: { body: unknown; at: string; } | null; /** W2-E: a connected-app trigger's last check, and why it could not read the account (null = it could). */ app_checked_at?: string | null; app_says?: string | null; /** W2-E: the last item a connected-app trigger handed to a run. */ app_sample?: { body: unknown; at: string; } | null; name: string; spec: AutomationSpec; enabled: boolean; archived_at?: string | null; /** AUTOMATIONS-AIRTABLE: why the store switched it off (a watched view was removed); cleared when switched on. */ disabled_reason?: string | null; created_by?: Uuid | null; created_at?: string; updated_at?: string; last_run: AutomationLastRun | null; } interface AutomationList { table_id: Uuid; automations: AutomationItem[]; } /** archive / restore / set_enabled. */ interface AutomationFlipped { ok: true; automation_id: Uuid; table_id: Uuid; enabled: boolean; archived_at: string | null; } interface AutomationStep { n: number; do: AutomationAction["do"]; /** AT-AUTO2: the repeat round (0-based) a step inside a repeating group ran in. */ index?: number; /** AT-AUTO2: a script's console lines. */ logs?: string[]; /** AT-AUTO2: a server step's answer, as text. */ output_text?: string; found?: number; status: "done" | "failed" | "waiting"; /** The store's own words. */ says: string; hint?: string | null; record_id?: Uuid; edited?: number; prompt?: string; } interface AutomationRun { run_id: Uuid; status: AutomationRunStatus; says: string | null; record_id: Uuid | null; trigger: { /** `test` for a test run (`of` is the automation's own trigger), `button_pressed` for a press. */ on: AutomationTrigger["on"] | "test"; /** AT-AUTO2: a webhook's payload. */ body?: unknown; of?: AutomationTrigger["on"]; /** A test run: whether the row met the condition (null = it could not be worked out). */ condition_met?: boolean | null; operation: string; via: string | null; changed_field_ids: Uuid[]; /** A time trigger's own facts: the moment it was due, and (date arrives) the date it read. */ fires_at?: string; date_value?: string; every?: "day" | "week" | "month"; } | null; steps: AutomationStep[]; started_at: string | null; finished_at: string | null; ran_by: Uuid | null; at: string; } interface AutomationRuns { automation_id: Uuid; runs: AutomationRun[]; /** Pass back as `cursor` for the next, older page; null at the end. */ next_cursor: string | null; } /** AUTOMATIONS-AIRTABLE: `custom.automation_test` — one run now on a picked row (none for a schedule), on or off. */ interface AutomationTested { ok: true; run_id: Uuid; automation_id: Uuid; record_id: Uuid | null; status: AutomationRunStatus; says: string | null; steps: AutomationStep[]; condition_met: boolean | null; } /** AT-AUTO2: `custom.automation_revisions` — every save of one automation, newest first. */ interface AutomationRevision { revision_id: Uuid; at: string; by: Uuid | null; note: "created" | "edited"; enabled: boolean; spec: AutomationSpec; } interface AutomationRevisions { automation_id: Uuid; table_id: Uuid; revisions: AutomationRevision[]; } /** AT-AUTO2: the public URL of a webhook automation (null until the store made its secret). */ declare function automationWebhookUrl(serverBase: string, item: Pick): string | null; /** The placement facts, as the Table document or `custom.table` carries them. */ interface TablePlacement { platform_owned?: boolean | null; kept_for?: string | null; offered_as_context?: boolean | null; foundation?: boolean | null; } /** * One row of `custom.table_facts` since SC-1 — the two lane facts it always answered * (`visibility`, `mine`) and the placement, with the sentence a person reads and where the * table is used. A store without the SC-1 door answers the first three columns only; every * placement column is then `undefined`, and the readers below treat the table as the * organization's own — exactly what that store's older screens did. */ interface TablePlacementFact extends TablePlacement { table_id: Uuid; visibility: string; mine: boolean; /** The heading a kept table is listed under: "The context system", "The choices behind your columns", … */ keeper_group?: string | null; /** One plain sentence: who keeps it and where it opens from. Null for the organization's own. */ keeper_says?: string | null; /** Where the table is used: `table` (another Table, or itself) or `scope` (a context scope). */ used_in_kind?: "table" | "scope" | null; used_in_id?: Uuid | null; /** The Table that page belongs to, when `used_in_kind` is `table`. */ used_in_table_id?: Uuid | null; } /** Whether a person's list of tables keeps this one out of sight until "Show everything". */ declare function keptOutOfSight(placement: TablePlacement | null | undefined): boolean; /** Whether the Table is part of the business's day-one data (lane 10 FD). Absent is no. */ declare function isFoundation(placement: TablePlacement | null | undefined): boolean; /** Whether the context picker may offer this Table. Absent is no. */ declare function offeredAsContext(placement: TablePlacement | null | undefined): boolean; /** * The placement facts folded onto a table list, by id. Pure — returns new objects and leaves * the list it was given alone. A table the facts do not name is returned unchanged. */ declare function withTablePlacement(tables: readonly T[], facts: readonly TablePlacementFact[] | null | undefined): Array>; /** * THE KEPT TABLES, GROUPED UNDER THEIR KEEPER, in the order each group first appears. A kept * table the store gave no heading goes under "Platform tables" — never dropped. */ declare function keptGroups>(tables: readonly T[]): Array<{ group: string; tables: T[]; }>; /** * WHERE A KEPT TABLE OPENS FROM (THE DOOR LAW): the host's own addresses for a table and for a * context scope, chosen by what the store said the table is used in. With nothing said, the * table's own page — a kept table is never a row with nowhere to go. */ declare function keptTableHref(fact: { table_id: Uuid; } & Partial, hrefs: { table: (tableId: Uuid) => string; scope: (scopeId: Uuid) => string; }): string; /** One of the person's other organizations, and whether the Table can go there. */ interface TableHomeDestination { id: Uuid; name: string; /** * The organization's web address (UI-FIX-19). A screen draws it beside a name another * destination also carries, so two organizations with one name can be told apart. `null` when * the store's answer predates it. */ slug: string | null; /** The person's role there: owner · admin · member. */ role: string; /** False when the store says the Table cannot go there; `why` says why, in its words. */ ok: boolean; why: string | null; } /** `custom.table_home`'s answer, read. */ interface TableHome { table: { id: Uuid; name: string; version: number; }; /** Where it lives, from the Table itself. */ organization: { id: Uuid; name: string; }; /** The Table's maker, or an owner/admin of its organization. */ mayMove: boolean; /** When `mayMove` is false: the sentence that says who can. */ whyNot: string | null; /** Sentences for what holds it where it is. Empty when nothing does. */ heldBy: string[]; /** Every other organization this person belongs to. */ destinations: TableHomeDestination[]; carries: { fields: number; records: number; inTrash: number; choiceLists: number; withIt: number; /** Tables that ride along because they live inside it or inside its rows. */ tablesInside: number; /** Links between its rows and rows that stay, which will reach back across the wall. */ linksAcross: number; }; } /** What `custom.table_move` answered when the move landed. */ interface TableMoved { to: { id: Uuid; name: string; }; from: { id: Uuid; name: string; }; tableName: string; } /** Read the store's answer strictly: an answer this cannot read is `null`, never a guess. */ declare function parseTableHome(raw: unknown): TableHome | null; /** Read `custom.table_move`'s answer; `null` when it is not a landed move. */ declare function parseTableMoved(raw: unknown): TableMoved | null; /** * What `custom.table_duplicate` answered when the copy landed (lane TABLE-ACTIONS). The copy is a * NEW Table in `organization`; `copied` counts what came with it and `notCopied` names, in the * store's own words, what a copy never carries (history, forms, portals, dashboards, rules, …). */ interface TableDuplicated { table: { id: Uuid; name: string; }; from: { id: Uuid; name: string; organizationId: Uuid; }; /** * Where the copy lives. `null` only for a copy carried on by its id (`tableDuplicateContinue` * after a reload): the carry-on door's answer names the copy, not its organization, and the * first answer that did is gone. `tableDuplicate` always fills it from its first answer. */ organization: { id: Uuid; name: string; } | null; copied: { fields: number; choiceLists: number; choices: number; views: number; records: number; withRecords: boolean; }; /** Archived columns of the source, which stay behind with it. */ archivedFieldsLeft: number; /** Archived (or quarantined) records left behind; `null` when records were not copied. */ archivedRecordsLeft: number | null; /** Records this person is not handed (the ladder, then "Shown to"); `null` when records were not copied. */ recordsNotYoursLeft: number | null; /** Columns this person may not read: copied as columns, values left empty — column name → values left behind. */ hiddenColumns: Record; /** Another person's "only me" views of the source, which stay theirs. */ privateViewsLeft: number; /** Where a reference to a row that was not copied was taken out ("view …", "column …", the table's look). */ rowReferencesDropped: string[]; /** Views whose source was "only me": copied as new views are made, still "Shown to: only me". */ viewsSharedAsNewViews: string[]; /** Views the house door for a new view refused, each with its sentence. */ viewsNotCopied: string[]; /** What moved in the source while it was copied (the copy keeps what was fixed when it started). */ changedDuringCopy: { columnsArchivedSince: string[]; rowsChangedAfterCopied: number; rowsArchivedSince: number | null; rowsAddedSince: number | null; }; notCopied: string[]; path: string; } /** One pass of a paged copy (`custom.table_duplicate` / `custom.table_duplicate_continue`). */ interface TableDuplicateProgress { tableId: Uuid; tableName: string; /** "busy": another pass of this copy is running (wait, then carry on). "failed": the source was * archived while it was copied — not handed over; discard it. "discarded": its half table was archived. */ status: "copying" | "done" | "busy" | "failed" | "discarded"; /** What the pass stopped on: "choices" | "fields" | "views" | "records" | "links" | "done". */ step: string; /** The store's sentence for busy / failed / discarded. */ sentence: string | null; /** This pass: how long before its first unit, how many units, how long in all (ms). */ pass: { setupMs: number; units: number; ms: number; } | null; choiceLists: { done: number; total: number; }; fields: { done: number; total: number; }; views: { done: number; total: number; }; /** `null` when records are not being copied. */ records: { done: number; total: number; } | null; } /** Read one pass's answer strictly; `null` when the shape is not a copy's progress. */ declare function parseTableDuplicateProgress(raw: unknown): TableDuplicateProgress | null; /** One of the caller's unfinished copies (`custom.table_copies_in_progress`). */ interface TableCopyInProgress { tableId: Uuid; tableName: string; organization: { id: Uuid; name: string; }; from: { id: Uuid; name: string; }; /** "copying" (carry it on) or "failed" (the source was archived meanwhile — discard it). */ status: "copying" | "failed"; sentence: string | null; startedAt: string | null; records: { done: number; total: number; } | null; } declare function parseTableCopiesInProgress(raw: unknown): TableCopyInProgress[]; /** Read `custom.table_duplicate`'s answer strictly; `null` when it is not a landed copy. */ declare function parseTableDuplicated(raw: unknown): TableDuplicated | null; /** The consequence of a move, said before it happens (destructive-and-expensive-actions law). */ declare function moveConsequence(home: TableHome, to: Pick): string; /** The seven shapes a block can take, exactly as `custom.dashboard_kinds()` answers. */ type DashboardBlockKind = "number" | "bar" | "column" | "line" | "donut" | "table" | "stuck"; /** * ONE SAVED BLOCK — the spec, not the answer. `table_id` left out means the * dashboard's own subject Table, and `state_key` / `days` belong to `stuck` * alone (the door refuses a `stuck` block that names no field to watch). */ interface DashboardBlock { /** * The block's own id, kept across every save, resize and move (v6 lane 11): the layout and the * per-block refusal tile key on it. The client mints a uuid for a block that has none. */ id?: string; title?: string; kind: DashboardBlockKind; /** Absent = the dashboard's subject Table. */ table_id?: Uuid | null; /** Field keys whose values become the groups. */ group_by?: string[]; /** `count` needs no key; every other operation reads one Field. */ measures?: AggregateMeasure[]; /** A date Field truncated to a period. */ bucket?: { key: string; by: AggregateBucket; } | null; /** A scalar is an equality; an object is a half-open moment window. */ filter?: Record | null; /** Rows this block reads. The door clamps it to 1…500 and defaults to 50. */ limit?: number; /** Columns of the twelve this block occupies. The door clamps it to 2…12 and defaults to 6. */ span?: number; /** `stuck` only: the field whose value is watched for a change. */ state_key?: string; /** `stuck` only: how long a record may sit on the same value. Defaults to 14. */ days?: number; /** * S3 — the comparison this block makes (this month against last month). * The door fills `key` from the bucket when it is left out, and refuses a * comparison along a Field the Table does not have, by name. */ compare?: AggregateCompare | null; /** S3 — the number this block is aiming for. */ target?: DashboardTarget | null; } /** * S3 — A BLOCK'S TARGET. `measure` is one of the block's own measure keys * (default: the first). `per: "period"` is a target for the whole window (a * monthly target — a bucketed chart draws its even share per bucket as the * pace); `per: "bucket"` is a target for every bar or point. * * A target is a FIXED NUMBER (`value`) or A GOAL COLUMN (`field`, a Field key of * the block's Table): the store adds that column up (`op`, default `sum`) over * exactly the records the block's own number read — same filter, same window, * same reader — so "invoiced against quoted" is about the same jobs. Exactly * one of the two; a goal column is always `per: "period"`. */ type DashboardTarget = DashboardTargetBase & ({ value: number; field?: never; op?: never; } | { field: string; op?: DashboardTargetOp; value?: never; }); /** How a goal column is added up across the block's records. */ type DashboardTargetOp = "sum" | "avg" | "min" | "max"; /** What every target carries, whichever kind it is. */ interface DashboardTargetBase { label?: string; measure?: string; per?: "period" | "bucket"; } /** One dashboard as `custom.dashboards` reports it to its organization. */ interface DashboardSummary { dashboard_id: Uuid; /** The subject Table: the one a block that names no table of its own reads. */ table_id: Uuid | null; name: string; blocks: DashboardBlock[]; presentation: Record; block_count: number; version: number; created_at: Timestamp; updated_at: Timestamp; } /** * AT-INTERFACE — ONE INTERFACE as `custom.interface_read` hands it to this viewer. An Interface is a dashboard * record whose `presentation.kind` is `"interface"`; builders (Editor, Full) also get `presentation.draft` and * `presentation.versions`, everybody else only `presentation.published`. `member` = the viewer is in the * interface's organization (elements read through the viewer's own doors); otherwise every element reads * through `custom.interface_rows`. Null from the door = not there, archived, or not shared with her. */ interface InterfaceRead { id: Uuid; organization_id: Uuid; table_id: Uuid | null; name: string; version: number; updated_at: Timestamp; level: "admin" | "editor" | "edit_content" | "commenter" | "viewer"; member: boolean; presentation: Record; blocks: DashboardBlock[]; } /** One column an interface element exposes (`custom.interface_rows`). */ interface InterfaceRowsField { key: string; label: string; type: string; multi: boolean; system: string | null; relation_target: Uuid | null; format: Record | null; sort: number | null; } /** The rows ONE interface element exposes; a number element answers `count` alone. */ interface InterfaceRows { table?: string | null; title_field?: string | null; fields?: InterfaceRowsField[]; rows?: Array<{ id: Uuid; created_at: Timestamp; updated_at: Timestamp; document: Record; }>; count: number; truncated?: boolean; /** Words of the records a cell points at, by id. */ refs?: Record; /** Choice words by field key, then by normalized value. */ labels?: Record>; } /** * One row of a `stuck` block: a record that has sat on the same value of * `state` for `days_unchanged` days. `measured_from` names WHERE that age was * measured from, because a record whose history does not reach back that far is * aged from what the store actually knows and says so. */ interface StuckRow { record_id: Uuid; title: string | null; state: string | null; last_changed_at: Timestamp | null; days_unchanged: number; measured_from: string; } /** * ONE BLOCK'S ANSWER. The door echoes the block back NORMALIZED — the defaults * it applied, the merged filter it actually ran — and adds `rows` and `ms`; * a block it could not run carries `refused` and `sqlstate` INSTEAD of rows, * and a block it could not even normalize carries only its title and kind. */ interface DashboardBlockResult { /** The saved block's own id, when the store echoes it. */ id?: string; title: string; kind: DashboardBlockKind | (string & {}); table_id?: Uuid; group_by?: string[]; measures?: AggregateMeasure[]; bucket?: { key: string; by: AggregateBucket; } | null; /** The block's own filter with the canvas bar merged under it — the block's own key wins. */ filter?: Record; limit?: number; span?: number; state_key?: string; days?: number; /** An aggregate block's groups and measures, or a `stuck` block's records. Absent when refused. */ rows?: AggregateRow[] | StuckRow[]; /** How long this one block took, in milliseconds. Absent when refused. */ ms?: number; /** The store's own sentence, when this block could not be run. */ refused?: string; /** The SQLSTATE that refusal carried. */ sqlstate?: string; /** * S3 — the windows this block was actually compared over; `null` when it was * not compared. (The comparison it was ASKED to make is the saved block's.) */ compare?: AggregateCompareWindows | null; /** S3 — why a canvas comparison was not applied to this block (it has no date). */ compare_refused?: string; /** * S3 — the block's first (or target) measure added up across its rows, now * and before, when the measure adds up (count, sum, filled, empty) or the * block has one row. Worked out by the store from the rows it answered, so * a tile, a chart and a ring cannot disagree. */ totals?: DashboardTotals; /** S3 — the target, with how far the current total has come and its pace per bucket. */ target?: DashboardTargetResult; } /** S3 — one block's total, now and before. */ interface DashboardTotals { measure: string; current: number | null; prior: number | null; change: number | null; change_pct: number | null; } /** S3 — a target as the run answers it. */ interface DashboardTargetResult { /** * The number aimed at: the fixed value, or the goal column added up over this * block's records. `null` when a goal column had nothing to add up, or was refused. */ value: number | null; /** A goal column's key, when the target is read from one. */ field?: string; /** How that column was added up. */ op?: DashboardTargetOp; /** * The store's own sentence when THIS reader may not read the goal column — the * block still answers its number; only the target is withheld. */ refused?: string; label: string; measure: string; per: "period" | "bucket"; /** The current total the target is measured against. */ current: number | null; /** current ÷ value, 4 decimals. */ progress: number | null; /** The line a bucketed chart draws: the target's even share of one bucket, or the target itself per bucket. */ pace: number | null; } /** What `custom.dashboard_run` answers: the canvas, and every block's own result. */ interface DashboardRunResult { dashboard_id: Uuid; name: string | null; subject_table_id: Uuid | null; presentation: Record; /** The one filter bar this run was asked with. */ filter: Record; /** S3 — the date grain the canvas re-cut every bucketed block to, or null. */ grain?: AggregateBucket | null; /** S3 — the canvas comparison this run was asked with, or null. */ compare?: AggregateCompare | null; /** S3 — the organization's calendar every date on this canvas was cut with. */ calendar?: { time_zone: string; week_start: string; }; blocks: DashboardBlockResult[]; } /** Where one agent-written value came from. Interned once per save (VAL-1). */ interface EnrichSource { kind?: string; field_id?: Uuid; model?: string; model_version?: string | null; instruction?: string; /** What was actually read, with addresses. Never invented by the model. */ read?: Array<{ url?: string; title?: string; at?: string; }>; note?: string; confidence?: number; at?: string; } /** One candidate the model did not commit to, with its rank and its own source. */ interface EnrichAlternate { value: unknown; rank: number; source?: EnrichSource | null; } /** One cell, as `custom.enrich_cells` answers it. The badge is drawn from exactly this. */ interface EnrichCell { record_id: Uuid; field_key: string; /** Whether a model owns this column at all. False means: draw no badge. */ agent_owned: boolean; value: unknown; value_version: number | null; /** `user`, `agent` or `system` — VAL-8's closed vocabulary. */ actor: string | null; /** The person an agent acted for. Always set when `actor` is `agent`. */ on_behalf_of: string | null; written_at: string | null; source: EnrichSource | null; /** One of: "never asked", "none", "refused", "conflicting" (VAL-2). */ absent_reason: string | null; alternates: EnrichAlternate[] | null; /** A person holds this cell against the model until they hand it back. */ pinned: boolean; /** Past its freshness date. The value is still there — stale marks it, never erases it. */ stale: boolean; due_at: string | null; } /** The enrichment itself, as it is stored on the Field. */ interface Enrichment { instruction: string; inputs: string[]; web_search?: boolean; connected_source?: string | null; model: string; confidence_floor: number; write_policy: "auto" | "ask"; cost_cap_cents?: number; review_interval_days?: number | null; /** A person's opt-in: values past their date are filled in again without anybody pressing Fill. */ auto_refill?: boolean; /** Who turned refilling on; the refill runs as them. */ auto_refill_by?: string | null; enabled: boolean; enabled_by?: string | null; enabled_at?: string | null; declared_by?: string | null; declared_at?: string | null; } /** One agent-owned column, with its freshness census and its money. */ interface EnrichmentSummary { field_id: Uuid; table_id: Uuid; field_key: string; label: string; enrichment: Enrichment; enabled: boolean; review_interval_days: number | null; rows_total: number; rows_filled: number; rows_stale: number; rows_pinned: number; rows_absent: number; runs: number; cost_cents: number; cost_per_row_cents: number | null; last_run_at: string | null; last_run: Record | null; } /** One record that needs this column filled in, with what the instruction may read. */ interface EnrichDueRow { record_id: Uuid; title: string; inputs: Record; current_value: unknown; written_at: string | null; /** "never filled in", or "past its freshness date — written N days ago…". */ reason: string; /** Set when the ask was larger than the organization's batch ceiling. */ trimmed_to: number | null; } /** What one run did, and what it cost. */ interface EnrichRun { run_id: Uuid; field_id: Uuid | null; field_key: string | null; model: string | null; trigger_word: string | null; rows_seen: number; rows_written: number; rows_absent: number; rows_below_floor: number; rows_pinned: number; rows_refused: number; cost_cents: number; cost_per_row_cents: number | null; ran_at: string; } /** What `custom.enrich_declare` answers. `says` is a sentence for a person. */ interface EnrichDeclared { field_id: Uuid; table_id: Uuid; field_key: string; label: string; enrichment: Enrichment; says: string; } /** One question, as the sheet words it. */ interface CaptureQuestion { field: string; ask: string; help?: string | null; required: boolean; } /** One Field, as the phone needs it to draw a control and validate offline. */ interface CaptureField { id: Uuid; key: string; label?: string | null; type?: string | null; unit?: string | null; format?: string | null; multi?: boolean | null; required: boolean; /** `attachment` is what makes the phone open a camera instead of a text box. */ parity_type?: string | null; [k: string]: unknown; } /** * Everything the phone loads ONCE and then runs with no network. * * `state` is one of `open`, `not open yet`, `closed`, `read only`. `may_capture` is the * honest label for the screen and never the access decision — `custom.capture_submit` * asks `custom.has_visibility` for `editor` itself, before it admits the sheet exists. */ interface CaptureSheetFace { sheet_id: Uuid; organization_id: Uuid; table_id: Uuid; title: string; presentation: { intro?: string | null; flow?: string | null; thank_you?: { title?: string; body?: string; } | null; questions?: CaptureQuestion[]; [k: string]: unknown; }; fields: CaptureField[]; state: string; may_capture: boolean; message: string | null; } /** A sheet in the foreman's list, with what has come in through it. */ interface CaptureSheetSummary { sheet_id: Uuid; table_id: Uuid; title: string; slug: string; state: string; opened_at: string | null; captures: number; replays: number; last_capture_at: string | null; presentation: Record; } /** A file reference the app has already put in the platform's one byte store. */ interface CaptureFileRef { field: string; name: string; mime_type?: string | null; size_bytes?: number | null; duration_ms?: number | null; /** The `files.files` id. The File record made from this points at it. */ file_id?: string | null; url?: string | null; } /** What one capture became. `replay: true` means it had already arrived. */ interface CaptureOutcome { record_id: Uuid | null; state: string; message: string | null; replay: boolean; file_ids: Uuid[] | null; } /** VAL-8's whole vocabulary. There is no fourth word. */ type HistoryActorKind = "user" | "agent" | "system"; /** * WHO WROTE A VERSION. * * `kind` is the store's own word for the author. `name` is a person as a person * reads them — never a uuid; SCR-N-5 forbids printing one at a customer. * `on_behalf_of` is present only for an agent, and for an agent it is ALWAYS * present: an agent carries the exact authority of the person operating it * (AGT-N-4), so a screen that showed the machine without the person would be * hiding who is answerable. */ interface HistoryActor { kind: HistoryActorKind; user_id: Uuid | null; name: string | null; on_behalf_of: { user_id: Uuid; name: string | null; } | null; /** * The person who said yes, when an agent's change waited for approval and was * applied (`custom.work_approval_decide`, VISION-REACH W4 b). Absent on every * other version: a direct write has no approver. */ approved_by?: { user_id: Uuid; name: string | null; } | null; } /** * ONE FIELD THAT MOVED, with what it said before and what it says after. * * `label` is the Field's own label, so a timeline reads "Price" and not * `day_rate`. `rule` is FLD-9's computed provenance AT THAT VERSION — which * Rule, and which VERSION of the Rule, produced a derived value. `source` is * VAL-1's provenance, resolved from the pointer the document interns it under, * so a screen never prints `s3` at anybody. */ interface HistoryChange { key: string; field_id: Uuid | null; label: string; before: unknown; after: unknown; rule: { rule_id: Uuid; rule_version: number; computed_at: Timestamp; } | null; source: Record | null; /** VAL-2: why a value is absent — never asked, none, refused, conflicting. */ absent_reason: string | null; /** VAL-3: the other candidates the store kept, in rank order. */ alternates: unknown[] | null; /** * CLOSE-LINK (CD-LINK-07/12): the value in words when no column can say it — a move's record it sat under * (`before_words`) and now sits under (`after_words`), named by the store with the access question asked first. * Absent or null: say the value through its column. */ before_words?: string | null; after_words?: string | null; } /** One version of one record, as `custom.record_history` answers it, newest first. */ interface RecordHistoryEntry { version: number; occurred_at: Timestamp; /** The machine word: `edit`, `merge`, `undo of merge`, `insert`… */ operation: string; /** The same thing in the word a person used: "edited", "merge", "created". */ operation_label: string; actor: HistoryActor; changes: HistoryChange[]; /** Set when a compound verb wrote this version (HIS-8). */ migration_id: Uuid | null; /** * HIS-8: this version was written by a compound operation whose Migration log * row is still there, so the WHOLE operation can be undone through * `custom.migrate_undo`. An ordinary edit is never "undoable" in that sense — * it is RESTORABLE, which is a different verb and a different button. */ undoable: boolean; } /** * ONE CHANGE TO ONE COLUMN, ANYWHERE IN A TABLE — the half of the question no * revision panel answers. Airtable and Notion both make you open each record * and look. Only records this person may see contribute, decided as a predicate * in the same statement rather than a filter afterwards. */ interface FieldHistoryEntry { record_id: Uuid; /** The Table's own title field, so a row names a record and not a uuid. */ record_title: string; version: number; occurred_at: Timestamp; operation_label: string; actor: HistoryActor; before: unknown; after: unknown; } /** * ONE MOMENT OF A WORKED-OUT COLUMN'S HISTORY (`custom.formula_history`, CD-FORMULA-08; VISION Rule 8: "History knows * which one produced a Value"). A formula, rollup or lookup keeps no value of its own, so its history is worked out: at * each moment its answer could have changed — the record was written, or the formula itself was changed — the answer * from the record's values and the formula AS THEY WERE, and which version of the formula produced it. A formula's * version counts changes to what it works out; renaming the column is not a new version. Newest first. */ interface FormulaHistoryEntry { occurred_at: Timestamp; /** What moved: "record created", "record edited" or "formula changed". */ cause: string; /** The record's own version at that moment. */ record_version: number; /** 1 for the formula as first written, +1 each time what it works out changed. */ formula_version: number; /** The formula's words as that version had them (empty for a rollup or lookup). */ formula_text: string; /** The answer then. */ value: unknown; /** The store's own sentence when that version could not be worked out then; `null` otherwise. */ refused: string | null; /** Who wrote the record (or changed the formula) at that moment. */ actor: HistoryActor; } /** * WHAT A RESTORE WOULD DO, BEFORE IT DOES IT. * * `before` on each change is what the record says NOW and `after` is what it * would say. A key the target version did not have comes back with `after` of * `null` — the screen says "cleared", because that is what the write does to * it. Computed by the same body that computes the write, so the sentence and * the act cannot drift. */ interface RestorePreview { record_id: Uuid; from_version: number; to_version: number; saved_at: Timestamp; /** Present when the preview is for one column rather than the whole record. */ field_key: string | null; changes: HistoryChange[]; count: number; } /** What a restore actually did. A NEW version, always. */ interface RestoreResult { record_id: Uuid; restored_from_version: number; /** The version the restore WROTE. */ version: number; changed: HistoryChange[]; count: number; /** Always `false`, and said out loud because it is what people fear. */ history_rewritten: boolean; /** Present on a single-value restore. */ field_key?: string; } /** One comment, with the people on it named. */ interface RecordComment { id: Uuid; body: string; anchor: Record; /** * The column this comment is about, when it is about one. Notion anchors a * comment to a block; here the block is a Field, so "this price looks wrong" * sits on the price instead of at the bottom of the record. */ field_key: string | null; parent_comment_id: Uuid | null; created_by: Uuid; created_by_name: string; created_at: Timestamp; resolved_at: Timestamp | null; resolved_by: Uuid | null; resolved_by_name: string | null; mentions: Array<{ user_id: Uuid; name: string; }>; /** Mine, so a screen offers Resolve on my own and Reply on everybody's. */ mine: boolean; } /** * A RECORD'S WHOLE THREAD, AND WHAT THIS PERSON MAY DO IN IT. * * The two booleans come from the STORE, in the same call that answers the * thread, because a composer drawn for somebody the write door will refuse is * the defect lane UI-HONEST spent a night removing. `commenter` is the second * rung: a viewer reads the conversation and cannot join it, which is exactly * what the two rungs mean. */ interface CommentThreadRead { record_id: Uuid; comments: RecordComment[]; may_comment: boolean; may_resolve: boolean; } /** * Who follows ONE record (`custom.record_followers`) — the follower list the record shows, and whether THIS person is * on it. A person who cannot open the record gets an empty list, never a refusal that confirms it exists. */ interface RecordFollowers { following: boolean; followers: Array<{ user_id: Uuid; name: string; mine: boolean; }>; } /** What `custom.record_follow_set` answers: the caller's own state and how many follow now. */ interface RecordFollowSet { following: boolean; followers: number; } /** What `custom.comment_write` answers. */ interface CommentWritten { comment_id: Uuid; mentioned: Uuid[]; /** * How many people were actually TOLD. "I mentioned three people" and "three * people were told" are different facts and a screen that conflates them is * lying quietly. */ notified: number; } /** One token found in a body, in the order it appears. */ interface DocToken { ordinal: number; /** Exactly as it is written in the body. */ raw: string; field_id: Uuid | null; } /** A token this Table cannot answer, with the store's own reason. */ interface DocUnresolvedToken { raw: string; field_id: Uuid | null; /** The store's sentence. Shown verbatim — a template is not published over it. */ why: string; } /** What the store says about a signature when it is asked whether it still holds. */ interface DocSignatureCheck { intact: boolean; /** The store's own sentence when it is not. */ reason?: string; signed_at?: Timestamp; } /** `custom.doc_template` — a body with tokens, and the Table it renders. */ interface DocTemplateRow { id: Uuid; renders_table_id: Uuid; name: string; body: string; /** REC-68 / VAL-10: a seal is over a document VERSION, so the version is first-class. */ template_version: number; token_count: number; updated_at: Timestamp; } /** * `custom.doc_render` — a rendered document, FROZEN. The bytes and their * SHA-256 are what a signature seals, which is why a render is never edited: * a further agreement is a further version with its own seal. */ interface DocRenderRow { id: Uuid; template_id: Uuid; record_id: Uuid; table_id: Uuid; template_version: number; body: string; content_hash: string; rendered_at: Timestamp; } /** `custom.doc_signature` — one seal, immutable once made. */ interface DocSignatureRow { id: Uuid; render_id: Uuid; record_id: Uuid; field_key: string; signer_name: string; signer_user_id: Uuid | null; signed_at: Timestamp; document_hash: string; document_version: number; } /** * HOW OFTEN. `instant` fires the moment a record ENTERS the view; the other three * are summaries, assembled by the store at that cadence and sent as ONE message * naming what entered, left and changed since the last one. * * `immediate` and `digest` — the two words this store wrote before 2026-09-20 — * are still accepted everywhere and normalized by `custom.agg_cadence_normalize` * to `instant` and `daily`, so a Rule written then and a Rule written by the * picker now mean the same thing to the same runner. */ type SubscriptionCadence = "instant" | "hourly" | "daily" | "weekly"; /** * THE HOURS NOT TO BE TOLD IN. A send inside them is not dropped — the store moves * it to the moment they end through the notification system's own `next_attempt_at`, * so there is still one sender and one retry policy and nothing disappears because * of the clock. */ interface QuietHours { /** "22:00". Left out (with `end`), the block names no night — only the clock. */ start?: string; /** "07:00" — earlier than `start` means the block crosses midnight, which is the ordinary case. */ end?: string; /** * An IANA zone name, e.g. "America/Chicago". Left out, UTC. THIS IS ALSO THE CLOCK THE * SCHEDULE IS READ IN: `custom.agg_digest_due_at` reads "monday 08:00" in this zone, so a * block carrying only `tz` means "no quiet hours, and 08:00 is my 08:00". */ tz?: string; } /** True when the block names a night (both ends), not only the clock the schedule is read in. */ declare function hasQuietHours(quiet: QuietHours | null | undefined): quiet is QuietHours & { start: string; end: string; }; /** The zone of the person at the keyboard, or null where the runtime cannot say. */ declare function callersTimeZone(): string | null; /** * A SUBSCRIPTION IS READ IN ITS OWNER'S CLOCK (lane HANDOVER, 2026-09-28). * * The store reads a schedule's "08:00" in `quiet_hours.tz` and falls back to UTC. Every caller * that set no quiet hours sent no zone, so Cedar Ridge Physical Therapy's "every Monday at 8" * went at 1 AM in California. `subscriptionDeclare` passes every spec through this: a spec that * names a zone is kept as it is; one that names none gets the caller's own. */ declare function withCallersClock(spec: T, zone?: string | null): T; /** One subscription, exactly as `custom.agg_subscriptions` reports it. */ interface Subscription { rule_id: Uuid; saved_view_id: Uuid | null; cadence: string; /** The digest's schedule. Null for `immediate`. */ schedule: string | null; channel: string; /** Null means this subscription fires at nobody, and the store says so. */ recipient_user_id: Uuid | null; event_key: string; name: string; } /** * ONE SUBSCRIPTION AS ITS OWNER SEES IT — `custom.subscriptions`. * * `custom.agg_subscriptions` is the NOTIFIER's reader: it answers the whole * organization's firing subscriptions so the delivery path can run, and it is * not callable by a client. This is the other side of the same rows — narrowed * to Tables the caller can already open, so the list never reveals a Table — * and it carries the two things a screen needs and the notifier does not: is it * switched off, and may I switch it off. */ interface MySubscription extends Subscription { table_id: Uuid | null; /** Off. `custom.agg_subscriptions` already excludes a muted one, so this is the truth. */ muted: boolean; /** It is addressed to me. */ mine: boolean; /** I may switch it off: mine, or I hold admin on the Table it watches. */ i_may_mute: boolean; /** The hours it will not tell me in. Null means any time. */ quiet_hours: QuietHours | null; /** When this last told me anything at all. Null means it never has. */ last_sent_at: string | null; /** * When the next summary is due — computed by the SAME store functions the runner * uses, so this and the moment it actually fires cannot drift. Null for `instant`, * which has no due time, and null for a muted one, because saying "next Monday" * beside a switch that is off is a screen that lies. */ next_digest_at: string | null; } /** * THE SUMMARY THIS SUBSCRIPTION WOULD SEND RIGHT NOW — `custom.subscription_preview`. * * It assembles and returns: nothing is delivered, nothing is recorded and the * watermark does not move, so "show me one now" never costs somebody a text and * never robs the real Monday summary of a week of news. */ interface DigestPreview { rule_id: Uuid; name: string; cadence: string; schedule: string | null; quiet_hours: QuietHours | null; channel: string; recipient_user_id: Uuid | null; muted: boolean; table_id: Uuid | null; saved_view_id: Uuid | null; window_start: string; window_end: string; entered: Array<{ record_id: Uuid; name: string; }>; left: Array<{ record_id: Uuid; name: string; }>; changed: Array<{ record_id: Uuid; name: string; }>; counts: { entered: number; left: number; changed: number; in_view: number | null; }; /** The grid, filtered by the very view this subscription is over. */ link: string | null; subject: string; body: string; /** * NOTHING FAILS SILENTLY. A subscription that cannot produce a summary — nobody to * tell, no view, a view somebody deleted — says which piece is missing, in the * sentence a person reads, instead of returning an empty summary that looks calm. */ incomplete: string | null; } /** * ONE SAVED VIEW — `custom.views`. A subscription is written OVER one of these, so * a person with no saved view has nothing to be told about; `viewDeclare` is how a * screen gives them one without leaving the screen they are on. * * `filters` is written in the ONE shape `custom.agg_view_admits` reads, so a view * saved here needs no translation before the notifier can admit records to it. */ /** * A ROW TEMPLATE (ROW-TEMPLATES, 2026-10-04) — Notion's database templates: a named preset of a * Table's values ("New Instagram post": Status=Idea, Platform=[Instagram], Page content = a * Hook/Script/Hashtags skeleton) that "New from template" starts a row from. Kept beside the * Table's views in `platform.saved_view` (surface `custom/records/template`); `values` by Field key. */ interface RowTemplateRow { template_id: Uuid; name: string; table_id: Uuid; values: Record; created_at: string; updated_at: string; } interface SavedViewRow { view_id: Uuid; name: string; table_id: Uuid | null; filters: RecordFilter; /** * THE WHOLE VIEW (S0 ONE-SAVED-VIEW, 2026-09-23): `platform.saved_view` is the ONE saved-view * store, so this is what the view bar, the board, the calendar and the gallery draw from — * `layout` (the kind), `group_field`, `measure`, `date_field`, `start_field`, `end_field`, * `image_field`, `sorts`, `rule_id`, * `is_default`, `presentation`, G7's `grid`, G13's `order`, the mover's `moved_from`. */ definition: SavedViewDefinition; created_at: string; } /** Every kind of view the store keeps (`custom.view_keys()` row `layout`). */ type SavedViewLayout = "grid" | "kanban" | "calendar" | "gallery" | "sheet" | "timeline"; /** `presentation.style.colorBy`: a choice or yes/no Field whose colors paint the cards, the calendar and the timeline. */ interface SavedViewColorBy { field: string; target?: string; } /** * THE KEYS OF ONE SAVED VIEW, as `custom.view_keys()` declares them. Fields are named by key * (the store accepts an id and stores the key). Every key the store judges is listed here; the * index signature keeps the rest (`grid`, `order`, `moved_from`, the presentation details) open. */ interface SavedViewDefinition { layout?: SavedViewLayout; /** The board's columns (kanban) or the timeline's rows: any Field. */ group_field?: string | null; swimlane_field?: string | null; measure?: string | null; /** Calendar: the date Field that places a record. */ date_field?: string | null; /** Timeline: the date Field where a record's bar starts. */ start_field?: string | null; /** Calendar and timeline: the date Field where a record ends. Absent, a record is one day. */ end_field?: string | null; /** Gallery: the Field drawn as the card's cover. */ image_field?: string | null; presentation?: { style?: { colorBy?: SavedViewColorBy | null; [key: string]: unknown; } | null; /** Gallery and grids: the Fields hidden from this view, by key. */ hiddenFields?: string[] | null; [key: string]: unknown; } | null; [key: string]: unknown; } /** * What `custom.view_declare` is asked for. With `view_id` the door MERGES: `name` changes only * when sent, `filters` only when the key is sent, each `definition` key replaces that one key and * a key sent as `null` is removed — so a screen sends only what it changed. */ interface SavedViewSpecIn { name?: string; filters?: RecordFilter | null; definition?: SavedViewDefinition | Record | null; view_id?: Uuid | null; } /** What `custom.subscription_declare` is asked for. The store refuses the rest BY NAME. */ interface SubscriptionSpec { name: string; saved_view_id: Uuid; cadence: SubscriptionCadence; /** "monday 08:00", "09:30". Meaningless for `instant`. */ schedule?: string | null; channel?: "in_app" | "email" | "sms"; quiet_hours?: QuietHours | null; /** Left out, the person setting it up — "tell ME". */ recipient_user_id?: Uuid | null; event_key?: string; /** Re-state an existing subscription rather than making a second one. */ rule_id?: Uuid | null; } /** The `subscription` block a Rule record carries. Written through `record_write`. */ interface SubscriptionBlock { saved_view_id: Uuid; cadence: SubscriptionCadence; schedule?: string | null; channel?: string; recipient_user_id?: Uuid | null; event_key?: string; } /** * One of the five states, as `custom.work_states()` lists them — with what it * may become next and whether it is the end. A screen that hardcoded these * would be a second source of truth for the one question the store answers. */ interface WorkState { sort: number; name: string; terminal: boolean; next: string[]; } /** One node of a template graph: a record-to-be, in a named Table, under a ref. */ interface WorkTemplateNode { /** The name the graph refers to this node by, and the key an override is filed under. */ ref: string; /** The Table the record lands in. */ table: Uuid; /** The document it starts life with. An override merges on top at instantiation. */ data?: Record; } /** One edge. `owned` is what `custom.relation_own` makes; W1-REL owns the rest. */ interface WorkTemplateRelation { from: string; to: string; kind?: string; } /** * THE WHOLE TEMPLATE, DECLARATIVELY. REC-70: the graph is created in ONE act * and judged before any of it is written, so an agent writes a twelve-step * checklist in a single call and a half-made checklist is not a state the store * can be in. */ interface WorkGraph { nodes: WorkTemplateNode[]; relations?: WorkTemplateRelation[]; } /** What `custom.work_template_instantiate` answers: what it made, and how much. */ interface WorkInstantiation { template_id: Uuid; /** The log row. Until W3-HIST lands, this row IS the log of the act, and says so. */ instantiation_id: Uuid; records_created: number; relations_created: number; relation_kind: string; /** ref → the record it became, which is how a step finds its own record. */ refs: Record; records: Uuid[]; relations: Uuid[]; ms?: number; } /** One row of `custom.work_whose_turn`: a record, whose turn it is, and where it is up to. */ interface WorkTurn { record_id: Uuid; title: string | null; assignee_id: Uuid | null; turn: string | null; due_on: Timestamp | null; state: string | null; status: string | null; terminal: boolean | null; } /** A Field assignment is made of, as the store itself describes it. */ interface WorkAssignmentField { key: string; label: string; spec: Record; } /** * One hold on one slot. `expired` is the STORE's answer, not a clock comparison * a screen ran: a hold whose time is up is named as lapsed rather than quietly * disappearing, so a person can see why the slot came back. */ interface WorkSlotHold { hold_id: Uuid; slot_key: string; holder: string; expires_at: Timestamp | null; expired: boolean; } /** * What an embed token is good for, from `custom.anon_token_verify`. A token * carries ONE decision: `read` or `write`, never both. */ interface AnonTokenBinding { token_id: Uuid; organization_id: Uuid; form_id: Uuid | null; saved_view_id: Uuid | null; record_id: Uuid | null; mode: "read" | "write"; } /** The three things that land in the one inbox. Closed, one word each. */ type WorkInboxKind = "assignment" | "approval" | "proposal"; /** Who filed it: a colleague, or an agent acting for one. */ type WorkOrigin = "person" | "agent"; /** Where a due date stands, in the store's own words. */ type WorkDueState = "overdue" | "due_today" | "scheduled" | "undated" | "finished"; /** One row of `custom.work_inbox` — the SAME shape whichever of the three it is. */ interface WorkInboxItem { item_id: Uuid; kind: WorkInboxKind; origin: WorkOrigin; title: string; subject_id: Uuid | null; subject_kind: string; summary: string | null; state: string; due_on: Timestamp | null; due_state: WorkDueState | null; /** False for a decided row a person asked to see. A screen shows it, inert. */ actionable: boolean; requested_by: Uuid | null; requested_by_name: string | null; at: Timestamp; /** * The table it is about (lane S5-PRIME): the table itself for a new column, new records or a * template; the record's table for a change to a record; null for a new table (it waits on a * home). An assignment carries its record's table. What an inbox groups by. */ table_id?: Uuid | null; table_name?: string | null; /** * A CLOSED ITEM SAYS WHO AND WHEN (lane S5-PRIME). Null while it is waiting. For `withdrawn` * — nobody decided it; the thing it would change was archived — `decided_by` is whoever * archived it (null when the store's own backlog sweep closed it). */ decided_by?: Uuid | null; decided_by_name?: string | null; decided_at?: Timestamp | null; /** The store's own sentence: what was applied, what was left alone, or why it was withdrawn. */ outcome?: string | null; /** * THIS PERSON'S OWN STATE (lane S5-PRIME-2). Set only in the view that shows it: `snoozed_until` * in the snoozed view, `cleared_at` in the done view. Nobody else's snooze or clear is ever read. */ snoozed_until?: Timestamp | null; cleared_at?: Timestamp | null; /** How many of this person's items are snoozed / cleared right now — the same on every row. */ snoozed_count?: number; cleared_count?: number; /** * HOW LONG A DECISION ON THIS ROW IS HELD WITH UNDO before it is made (VERIFIER-20), in seconds: * the organization's `custom/decision_undo_seconds` (default 5) for a pending approval or * proposal; 0 when something already waits on the answer; null for work and closed rows. */ undo_seconds?: number | null; /** Why a decision here cannot be held (it is made at once) — the store's sentence, or null. */ undo_refusal?: string | null; } /** * Which of a person's three inbox views `custom.work_inbox` answers (lane S5-PRIME-2): what is * waiting now, what they snoozed (soonest back first), what they cleared (latest first). */ type WorkInboxView = "inbox" | "snoozed" | "done"; /** What `custom.inbox_snooze` / `inbox_unsnooze` / `inbox_clear` / `inbox_unclear` answer. */ interface InboxStateChange { item_id: Uuid; /** Where the item stands for this person now. */ state: "snoozed" | "cleared" | "waiting"; /** False when an un-snooze / un-clear found nothing to undo (it says so in `sentence`). */ changed?: boolean; snoozed_until?: Timestamp; cleared_at?: Timestamp; /** The store's own sentence, for the person. */ sentence: string; } /** * One organization's line of `custom.inbox_counts` — what waits on this person there, counted by * the same predicate the inbox lists with. The shell badge's number. */ interface InboxCounts { organization_id: Uuid; organization_name: string | null; waiting: number; snoozed: number; cleared: number; overdue: number; oldest_waiting_at: Timestamp | null; } /** * The states an approval moves through. `withdrawn` (lane S5-PRIME) is closed by the store, not * decided by a person: the record or table it would change was archived. */ type WorkApprovalState = "pending" | "approved" | "declined" | "withdrawn"; /** Which of the three lists `custom.work_list` answers. */ type WorkListFlavour = "mine" | "assigned" | "unassigned"; /** One row of `custom.work_list`: a record, whose it is, and where it is up to. */ interface WorkListItem { record_id: Uuid; table_id: Uuid; table_name: string | null; title: string | null; assignee_id: Uuid | null; assignee_name: string | null; assignee_user_id: Uuid | null; due_on: Timestamp | null; due_state: WorkDueState; status: string | null; terminal: boolean; assigned_by: Uuid | null; updated_at: Timestamp; } /** * One state a record may be moved to, with the model's own answer about whether * it may — and, when it may not, the sentence saying why. A screen offers what * is allowed and explains what is not; it never renders a dead control. */ interface WorkRecordState { state_id: Uuid; name: string; sort: number; terminal: boolean; is_current: boolean; allowed: boolean; refusal: string | null; } /** The change a pending approval carries. Two kinds, because two can be applied. */ type WorkChange = { kind: "record_patch"; patch: Record; } | { kind: "field_add"; field: Record; }; /** Somebody who may decide a particular request, and the reason they may. */ interface WorkApprover { user_id: Uuid; name: string; why: string; } /** What `custom.work_approval_request` answers: it is filed, and who it waits on. */ interface WorkApprovalFiled { approval_id: Uuid; state: "pending"; subject_id: Uuid; subject_kind: string; origin: WorkOrigin; approvers: WorkApprover[]; message: string; } /** What a decision answers — including whether the change was actually made. */ interface WorkApprovalDecision { approval_id: Uuid; state: "approved" | "declined"; subject_id: Uuid; /** The whole point: approving APPLIES the change, in the same transaction. */ applied: boolean; field_id: Uuid | null; version: number | null; message: string; } /** One inbox decision of a batch (`custom.work_decide_many`). */ interface WorkDecideManyItem { /** The inbox item — a `work_approval` record's id (`WorkInboxItem.item_id`). */ item: Uuid; decision: "approve" | "decline"; note?: string | null; } /** * `archived` (lane S5-PRIME): the thing it would change is archived, so it cannot be decided; the * sentence names it. A withdrawn approval answers `already_decided` with "That was withdrawn on …". */ type WorkDecideVerdict = "approved" | "declined" | "already_decided" | "no_right" | "archived" | "refused"; interface WorkDecideManyResult { index: number; item: Uuid; decision: "approve" | "decline"; verdict: WorkDecideVerdict; /** The store's own sentence: what was applied, or why it was not. */ sentence: string; subject_id?: Uuid; version?: number | null; record_ids?: Uuid[]; code?: string; } /** What `custom.work_decide_many` answers: the counts, then one verdict per item in order. */ interface WorkDecideMany { asked: number; approved: number; declined: number; not_decided: number; results: WorkDecideManyResult[]; } /** What `custom.work_assign` answers: the value, the access, and who holds it now. */ interface WorkAssignment { record_id: Uuid; assigned: boolean; assignee: Uuid | null; assignee_user_id: Uuid | null; assignee_name: string | null; was: Uuid | null; due_date: Timestamp | null; version: number | null; /** The share sentence, or why nothing was taken away when un-assigning. */ access: string; message: string; } /** What a step asks for before it counts as done. Every one of these is CHECKED. */ type ChecklistRequirementKind = /** A person says it is done. */ "none" /** A sentence of evidence, under `note`. */ | "note" /** A named value filled in on the step itself. */ | "answer" /** A named Field on the record the run is about must hold a value. */ | "record_field" /** The step IS a form (SCR-19): finishing it needs a response record. */ | "form" /** The step IS a document from a doc template (REC-68): finishing it needs a render. */ | "document"; interface ChecklistRequirement { kind: ChecklistRequirementKind; /** For `answer` and `record_field`: which value. */ key?: string; /** What a person is asked for, in their words. */ label?: string; /** For `form`: the published form this step is. */ form_id?: Uuid; /** For `document`: the doc template this step renders. */ template_id?: Uuid; } /** One step of a checklist, as it is WRITTEN — not as it is run. */ interface ChecklistStepSpec { /** The name the checklist refers to this step by; lower-case, unique. */ ref: string; /** What a person reads in their work. */ title: string; /** Which role owns it. A role the checklist never declares is refused at save. */ role?: string; /** How many days after the run starts it is due. */ due_days?: number; /** Steps it waits for. A step waits only for steps listed above it. */ depends_on?: string[]; requires?: ChecklistRequirement; } /** A role, and the person who stands in it by default. */ interface ChecklistRoleSpec { role: string; label?: string; user_id?: Uuid | null; } /** What starts a run. */ type ChecklistTriggerKind = "manual" | "record_created" | "status_reached"; interface ChecklistTrigger { kind: ChecklistTriggerKind; /** The Table being watched, for the two kinds that watch one. */ table_id?: Uuid; /** The state, for `status_reached`. */ status?: string; } /** THE COMPLETE DECLARATIVE CHECKLIST — one object, one call, a whole process. */ interface ChecklistSpec { name: string; /** The Table a run is ABOUT: People, Hires, Jobs, Matters. */ about_table_id: Uuid; roles?: ChecklistRoleSpec[]; trigger?: ChecklistTrigger; steps: ChecklistStepSpec[]; } /** What `custom.checklist_declare` answers. */ interface ChecklistDeclared { template_id: Uuid; name: string; about_table_id: Uuid; steps_table_id: Uuid; steps: number; roles: number; trigger: ChecklistTrigger; created: boolean; message: string; ms: number; } /** One row of `custom.checklist_templates`. */ interface ChecklistTemplateSummary { template_id: Uuid; name: string; about_table_id: Uuid | null; about_table: string | null; steps: number; roles: number; trigger_kind: ChecklistTriggerKind; trigger_status: string | null; open_runs: number; total_runs: number; updated_at: Timestamp; } /** `custom.checklist_template_shape` — the spec, plus what the editor needs. */ type ChecklistTemplateShape = ChecklistSpec & { template_id: Uuid; steps_table_id: Uuid | null; may_change: boolean; }; /** What `custom.checklist_start` answers. */ interface ChecklistRunStarted { run_id: Uuid; template_id: Uuid; template: string; about_record_id: Uuid | null; about: string | null; steps_table_id: Uuid; steps_created: number; assigned: number; unassigned: number; origin: string; steps: Array<{ ref: string; step_id: Uuid; title: string; role: string | null; }>; /** Roles nobody is named for, so the screen can say so rather than show blanks. */ waiting_on_a_name: string[]; message: string; ms: number; } /** One step of a RUN, as `custom.checklist_run` answers it. */ interface ChecklistRunStep { step_id: Uuid; step_order: number; ref: string; title: string; role: string | null; assignee_name: string | null; assignee_user_id: Uuid | null; due_on: Timestamp | null; due_state: WorkDueState; status: string | null; finished: boolean; requires: ChecklistRequirementKind; /** * The key the answer is filed under, as the checklist named it. A screen files * evidence under THIS, never under a name it invented — the store looks for * exactly this key and nothing else. */ requires_key: string | null; requires_label: string | null; /** The form or the document template this step is, when it is one. */ requires_id: Uuid | null; evidence: Record; /** The titles of the steps it is still waiting for. */ blocked_by: string[]; may_complete: boolean; /** Why it cannot be finished right now, in the words a person would use. */ refusal: string | null; } /** One row of `custom.checklist_runs`. */ interface ChecklistRunSummary { run_id: Uuid; name: string; template_id: Uuid | null; template: string | null; about_record_id: Uuid | null; about: string | null; about_table_id: Uuid | null; started_at: Timestamp | null; started_by: Uuid | null; origin: string; step_count: number; done: number; overdue: number; next_step: string | null; next_due: Timestamp | null; closed_at: Timestamp | null; } /** What `custom.checklist_step_complete` answers. */ interface ChecklistStepCompleted { step_id: Uuid; run_id?: Uuid; completed: boolean; evidence?: Record; steps_left?: number; run_closed?: boolean; message: string; } /** * VIS-31. A signed-in OUTSIDER, with the reason in plain English. * * "No organization" cannot mean "no row in the membership table": signup mints * every account a PERSONAL organization, so under that reading nobody would * ever be external. It means no membership of a NON-personal organization, and * `iam.is_external_principal` says that once so no surface can invent a second * answer. */ interface ExternalPrincipalCard { user_id: Uuid | null; /** The answer itself. */ external: boolean; signed_in: boolean; /** * WHY, in the platform's own words — the sentence a portal shows instead of * an empty screen. `iam` writes it, not us, so the portal and the API and the * admin screen all say the same thing about the same person. */ explanation: string; /** How many NON-personal organizations they belong to. Zero is what external means. */ organization_memberships: number; [key: string]: unknown; } /** VIS-32. A record or a view bound to a public address, with a declared render mode. */ interface PublishBinding { id: Uuid; slug: string; resource_type: string; resource_id: Uuid; organization_id: Uuid; render_mode: string; is_active: boolean; created_at?: Timestamp; [key: string]: unknown; } /** * What a SIGNED-OUT visitor resolves. An invented address, a revoked one and an * unpublished one all resolve to NOTHING — the same 404 — because an address * that answered differently for a revoked binding would be an existence oracle. * * `notice` is D-15's admission, carried on every read: nothing was scanned * before this was listed, and nothing here pretends otherwise. */ interface ResolvedPublishBinding { slug: string; resource_type: string; resource_id: Uuid; organization_id: Uuid; render_mode: string; namespace: string | null; notice: string; } /** What a public address holds, as `iam.resolve_publish_binding_kind` names it. */ type PublishBindingKind = "table" | "record" | "dashboard" | "page" | "view"; /** * `iam.resolve_publish_binding_kind` — the same resolution, plus WHAT the address holds. Tables, * records and dashboards all carry the entity token `record`, so the token alone cannot say which; * this door can. `table_id` is the table a list or a record belongs to (a view's subject, a * dashboard's subject table); `title` is its name. Anon may call it. */ interface ResolvedPublishBindingKind extends ResolvedPublishBinding { kind: PublishBindingKind | string; table_id: Uuid | null; title: string | null; } /** * What a context field holds, as a person thinks of it — derived from the Field's behavior, `multi`, * `format`, display format and `config.kind` (`contextFieldKind`). The value is always `value`; the * kind says how to read and edit it. */ type ContextFieldKind = "string" | "markdown" | "email" | "url" | "phone" | "color" | "number" | "percent" | "currency" | "boolean" | "date" | "datetime" | "time" | "object" | "array" | "reference" | "document"; /** The store's context policy on a Field: whether an agent receives it every turn, on request, or never. */ type ContextPolicy = "include" | "on_request" | "exclude"; /** The store's sensitivity words on a Field. */ type ContextSensitivity = "public" | "internal" | "confidential" | "restricted"; /** A scope type: a Table kept for context. */ interface ScopeType { id: Uuid; organization_id: Uuid; label_singular: string; label_plural: string; icon: string; color: string; /** The Table's slug in the store's grammar (`practice_areas`). */ slug: string | null; description: string; sort_order: number; max_assignments_per_entity: number | null; default_variable_keys: string[]; /** Who made the type: with the organization's owners and admins, they shape it (`canShapeScopeType`). */ created_by: Uuid | null; created_at: string; updated_at: string; } /** A scope type with its live scopes, as the tree doors answer it. */ interface ScopeTypeWithScopes extends ScopeType { scopes: Scope[]; } /** A scope: a Record of its type's Table. */ interface Scope { id: Uuid; scope_type_id: Uuid; organization_id: Uuid; name: string; description: string; slug: string | null; sort_order: number; parent_scope_id: Uuid | null; /** Free settings keys of the scope (each a Field of its Table the scope door derived). */ settings: Record; created_by: Uuid | null; created_at: string; updated_at: string; } /** A scope with its type's presentation (`custom.context_scopes`). */ interface ScopeWithType extends Scope { scope_type: ScopeTypeLabel | null; } /** The presentation of a scope type: what a chip or a breadcrumb shows. */ interface ScopeTypeLabel { id: Uuid; /** The type's slug in the store's grammar (`practice_areas`), when it has one. */ slug: string | null; label_singular: string; label_plural: string; icon: string | null; color: string | null; } /** A scope type that was archived, with how many scopes went with it. */ interface ArchivedScopeType { id: Uuid; organization_id: Uuid; label_singular: string; label_plural: string; icon: string; color: string; archived_at: string; created_by: Uuid | null; archived_scope_count: number; } /** A scope that was archived (a Record in the archive of its type's Table). */ interface ArchivedScope { id: Uuid; name: string | null; slug: string | null; archived_at: string | null; } /** A context field: a Field (column) of a scope type's Table. */ interface ContextField { id: Uuid; scope_type_id: Uuid; organization_id: Uuid; key: string; label: string; description: string; kind: ContextFieldKind; /** The Field's own words, for a caller that needs them (`type` is the store's behavior word). */ type: string; multi: boolean; format: string | null; config: Record; relation_target: Uuid | null; /** Its place among the type's context fields, from 0. */ sort: number; context_policy: ContextPolicy; sensitivity: ContextSensitivity; source: string; status: string; status_note: string | null; category: string | null; tags: string[]; max_items: number; custom_component: unknown; reference_source: unknown; allowed_scope_type_ids: Uuid[] | null; allowed_reference_types: string[] | null; review_interval_days: number | null; depends_on: string[]; /** The store's clock on this Field. */ version: number; created_by: Uuid | null; created_at: string; updated_at: string; } /** One thing a reference cell points at. */ interface ContextReference { /** The record id (for a file: the File record's id). */ id: Uuid; /** What it is: `scope`, `file`, `table`, or another entity token. */ type: string; /** Its name, where the door named it to this caller. */ label?: string; /** For a file: the `files.files` id a viewer opens. */ file_id?: Uuid; } /** The cell holds only the first words of a text kept as a file, and the whole could not be read. */ interface IncompleteValue { /** The cell's own first words. */ head: string; /** The whole text's length in characters, when known. */ chars: number | null; /** The file holding the whole text, when it has one yet. */ file_id: Uuid | null; /** Why the whole text is not here, in one sentence. */ why: string; } /** A context value: one cell of a scope's Record. */ interface ContextValue { scope_id: Uuid; field_id: Uuid; key: string; kind: ContextFieldKind; /** * THE CELL, as the store holds it (a text, a number, a boolean, an ISO date, a list, an object). * A reference or document cell is its `references` (ids here). A text kept as a file is its whole * text when the read could open the file (`completeWholeValues`), else the first words and `incomplete`. */ value: unknown; /** A reference / document cell, decoded: what it points at, with names the caller may see. */ references: ContextReference[]; /** The version a PERSON made (system rewrites never move it). */ version: number; set_at: string | null; source_type: string | null; authored_by: Uuid | null; /** The pointer to the file holding a text too big for one cell, when the cell holds only its start. */ whole_value: StoreWholeValue | null; /** Present only when `value` is not the whole text — never save it back as the value. */ incomplete: IncompleteValue | null; } /** The file fields of a whole-value pointer, as `custom.context_values` answers them. */ interface StoreWholeValue { kind: string; file_id?: Uuid | null; file_record?: Uuid | null; bytes?: number | null; chars?: number | null; sha256?: string | null; shown_chars?: number | null; mime?: string | null; pending?: boolean | null; in_value?: boolean | null; } /** The scope types of some organizations, without their scopes, and how many each holds. */ interface ScopeTypeSkeleton { types: ScopeType[]; /** type id → how many scopes the caller sees in it; null when asked without counts. */ counts: Record | null; } /** One page of one type's scopes. */ interface ScopePage { scopes: Scope[]; total: number; next_offset: number | null; } /** What a System Context item is: a curated fact, an ambient fact of the moment, or a dataset. */ type SystemContextItemClass = "curated" | "ambient" | "dataset" | (string & {}); /** * A System Context item (`custom.context_system_items`), as a `ContextField` of the * `SYSTEM_CONTEXT_TYPE_ID` pseudo-type, plus its class. */ interface SystemContextField extends ContextField { item_class: SystemContextItemClass | null; } /** One column of a table template. */ interface TableTemplateField { field_name: string; display_name: string; data_type: string; field_order: number; is_required: boolean; } /** * A table template (a `custom.template` of kind `table`) a scope's dataset field may lock its * table's columns to: the organization's own or a platform one, as `custom.table_templates` answers it. */ interface TableTemplate { id: Uuid; organization_id: Uuid | null; name: string; description: string; version: number; is_platform: boolean; fields: TableTemplateField[]; } /** One scope template of the gallery, as `custom.context_templates` answers it. */ interface ScopeTemplate { [key: string]: unknown; } /** A new scope type, or the parts of one to change (`undefined` = leave as it is). */ interface ScopeTypeSpec { label_singular?: string; label_plural?: string; icon?: string; color?: string; description?: string; sort_order?: number; max_assignments_per_entity?: number | null; default_variable_keys?: string[]; /** Any spelling; the package writes it in the store's grammar. Absent on create = from the label. */ slug?: string; } /** A new scope, or the parts of one to change. */ interface ScopeSpec { name?: string; description?: string; settings?: Record; parent_scope_id?: Uuid | null; slug?: string; sort_order?: number; } /** A new context field, or the parts of one to change (`null` clears). */ interface ContextFieldSpec { key?: string; label?: string; kind?: ContextFieldKind; description?: string; category?: string | null; context_policy?: ContextPolicy; sensitivity?: ContextSensitivity; tags?: string[]; sort?: number; status?: string; status_note?: string | null; custom_component?: unknown; review_interval_days?: number | null; allowed_reference_types?: string[] | null; max_items?: number | null; allowed_scope_type_ids?: Uuid[] | null; reference_source?: unknown; } /** One cell to write. `value` is the cell as `ContextValue.value` reads it; a reference cell takes `references`. */ interface ContextValueWrite { scope_id: Uuid; field_id: Uuid; kind: ContextFieldKind; value?: unknown; /** A reference / document cell: the things it points at (replaces the cell). */ references?: ContextReference[]; /** Who wrote it: `manual` from a person's own edit (the store's default is `ai_enriched`). */ source_type?: string; change_summary?: string; } /** What a written cell answers. */ interface ContextValueWritten { scope_id: Uuid; field_id: Uuid; version: number; source_type: string; } /** Reads a file's whole text as the person (the host's one file reader). */ type ReadContextFileText = (fileId: Uuid) => Promise; interface ScopeDoors { /** Every live scope type of these organizations, each with its live scopes. */ tree(organizationIds: readonly Uuid[]): Promise>; /** The scope types of these organizations without their scopes (the first paint), with or without counts. */ types(organizationIds: readonly Uuid[], options?: { withCounts?: boolean; }): Promise>; /** One page of one type's scopes, in the tree's order. */ typeScopesPage(scopeTypeId: Uuid, offset?: number, limit?: number): Promise>; /** The scopes whose name holds `query` (case-insensitive), across these organizations. */ search(organizationIds: readonly Uuid[], query: string, limit?: number): Promise>; /** Scopes by id, each with its type's label, in whichever organization each lives. */ scopes(ids: readonly Uuid[]): Promise>; /** * The context fields (columns) of these scope types, each type's fields in their order (`sort`, * then label) as the door answers them. */ fields(scopeTypeIds: readonly Uuid[]): Promise>; /** * One context field by its id, read in whichever of these organizations holds it (a Field is a * record of the field kernel; its scope type is the Table it is defined on). Refused `not_found` * when no organization answers it. */ field(fieldId: Uuid, organizationIds: readonly Uuid[]): Promise>; /** * The cells of these scopes. A text kept as a file is read whole through `readFileText`; without * one (or when the file cannot be read) the cell keeps its first words and says so (`incomplete`). */ values(scopeIds: readonly Uuid[], options?: { readFileText?: ReadContextFileText | null; }): Promise>; /** The archived scope types of one organization. */ archivedTypes(organizationId: Uuid): Promise>; /** Of these scope ids, the ones that are ARCHIVED scopes of this type. */ archivedScopesOfType(organizationId: Uuid, scopeTypeId: Uuid, wanted: ReadonlySet): Promise>; /** The System Context items (not scopes: the platform's own ambient context). */ systemItems(): Promise>; /** The table templates an organization's scope dataset fields may use (its own and the platform's). */ tableTemplates(organizationId: Uuid): Promise>; /** The scope templates of the gallery. */ templates(): Promise>; /** A new scope type in `organizationId`. */ createType(organizationId: Uuid, spec: ScopeTypeSpec): Promise>; /** Change a scope type (only the keys given). */ updateType(typeId: Uuid, spec: ScopeTypeSpec): Promise>; /** Archive a scope type; its scopes and fields come back with a restore. */ archiveType(typeId: Uuid): Promise>; restoreType(typeId: Uuid): Promise>; /** A new scope of `typeId` in `organizationId`. */ createScope(organizationId: Uuid, typeId: Uuid, spec: ScopeSpec): Promise>; updateScope(scopeId: Uuid, spec: ScopeSpec): Promise>; archiveScope(scopeId: Uuid): Promise>; restoreScope(scopeId: Uuid): Promise>; /** A new context field (column) on a scope type. Answers the field as the read door does. */ createField(scopeTypeId: Uuid, spec: ContextFieldSpec): Promise>; /** Change a context field (`null` clears a key). Answers the field as the read door does. */ updateField(fieldId: Uuid, scopeTypeId: Uuid, spec: ContextFieldSpec): Promise>; archiveField(fieldId: Uuid): Promise>; restoreField(fieldId: Uuid): Promise>; /** Write one cell. */ writeValue(write: ContextValueWrite): Promise>; /** * G11. The record-store Table a context scope's template-bound item provisions — one per item and * scope (`custom.scope_table_provision`). A scope provisioned before the move answers with its moved * Table (same id); the Home defaults to the organization's own. `organization_id` null lets the door * read the scope's own organization. */ tableProvision(args: { organization_id: Uuid | null; item_id: Uuid; scope_id: Uuid; home_id?: Uuid | null; }): Promise>; } interface PickListDoors { /** * PICK-LISTS: every pick list a person may open in ONE organization (`custom.pick_list_index`): id, name and * choice count, nothing else. Read only when a picker opens (the load law), never with the screen. */ pickListIndex(args: { organization_id: Uuid; }): Promise>; /** * PICK-LISTS: a pick list with its choices, grouped (`custom.pick_list_get`; viewer access on the list). * The list is read by its own id; its organization is the list's own, never the client's. */ pickListGet(args: { list_id: Uuid; }): Promise>; /** PICK-LISTS: a pick list for a selection control (`custom.pick_list_for_selection`): labels, help, groups, icons, NEVER the secret description. */ pickListForSelection(args: { list_id: Uuid; }): Promise>; /** * PICK-LISTS: rename / describe a pick list and, with `items`, REPLACE its choices * (`custom.pick_list_update`; editor access). The replaced choices are archived, soft and restorable. */ pickListUpdate(args: { list_id: Uuid; list_name?: string | null; description?: string | null; items?: readonly PickListItemInput[] | null; }): Promise>; } /** One value the agent was given, with the triple that makes it citable. */ interface RecordScopeField { key: string; label: string; type: string; value: unknown; /** DYN: a merge field resolves to a TRIPLE, not a string. */ cite: { record_id: Uuid; field_id: Uuid; value_version: number; written_at: string | null; }; } /** A Field the agent was NOT given, and which of the two reasons it is. */ interface RecordScopeWithheld { key: string; label: string; because: "masked" | "policy"; reason: string; needs?: string; /** The whole sentence, already written — a screen prints it rather than composing one. */ says: string; } interface RecordScopeRelation { via: string; target_id: Uuid; foreign: boolean; masked: boolean; your_level: PermissionLevel | null; card: Record | null; why: string | null; } interface RecordScopeHistoryEntry { version: number; at: string; what: string; who: string | null; changes: Array>; } interface RecordScopeComment { id: Uuid; body: string; created_at: string; created_by_name: string; field_key: string | null; } interface RecordScopeContext { record: { id: Uuid; title: string; table_id: Uuid; table_name: string | null; scope_type: string; plural: string; version: number; updated_at: string; your_level: PermissionLevel; }; fields: RecordScopeField[]; withheld: RecordScopeWithheld[]; relations: RecordScopeRelation[]; history: RecordScopeHistoryEntry[]; comments: RecordScopeComment[]; may_comment: boolean; siblings: { shown: Array<{ id: Uuid; title: string; }>; more_than_shown: boolean; says: string; }; /** Questions derived from THIS record's shape — never a fixed list. */ suggested: string[]; /** One sentence naming what is not in the conversation. Printed verbatim. */ says: string; assembled_at: string; } /** What a conversation is about. `readable` false means the person lost access to it. */ interface ConversationScope { bound: boolean; readable?: boolean; record_id?: Uuid; table_id?: Uuid; scope_type?: string; title?: string; bound_at?: string; bound_by?: Uuid; because?: string; } interface ConversationScopeContext { scope: ConversationScope; context: RecordScopeContext | null; } /** `About: Acme Industrial` — the chip a bound chat wears. */ declare function scopeChip(scope: ConversationScope): string; declare const TABLE_KIND_PREFIX = "table:"; type Json = Record; /** `custom.table_kind_facts(p_table_id)` verbatim (N1). */ interface TableKindFacts { organization_id: string; table_id: string; name: string | null; title_field: string | null; agent_writable: boolean; purpose: string | null; version: number | null; type_field: string | null; stamp: string | null; /** Every live Field document (typed ones included), plus `id` and `version`, in `sort` order. */ fields: Array>; /** `{: [{key, label, id, retired, position}]}`, retired included, live first. */ choices: Record>; /** `custom.table_column_source` (`fields` / `free_form` / `code`) once the door carries it; absent, the mapping's default. */ column_source?: string | null; /** `custom.record_platform_keys()` once the door carries it; absent, the mapping's keys. */ platform_keys?: string[] | null; } /** The content-ir `KindSchema` shape, structurally (this package does not depend on content-ir). */ interface TableRenderSchema { kind: string; fields: Record>; } type TableSchemaMode = "stored" | "authored"; type KindSpec = { shape: "string" | "number" | "boolean" | "datetime" | "choice" | "relation" | "entity_reference" | "address" | "computed"; value?: Json; authored?: boolean; unit?: boolean; hint?: string; rating?: boolean; }; type Mapping = { kernels: { file: string; person: string; }; system_kinds: string[]; by_behaviour: Record; choice_enum_limit: number; rating_max: number; address_parts: string[]; address_part_max: number; column_source_default: string; platform_keys: Record; stored_patterns: { record_id: string; datetime: string; }; kinds: Record; render: Record; }; /** The one mapping (records' own file; the Python copy is generated from it). */ declare function tableKindMapping(): Readonly; declare function isTableKind(slug: unknown): slug is `table:${string}`; declare function tableKindSlug(tableId: string): `table:${string}`; declare function tableIdOf(slug: string): string; /** Twin of `custom.field_kind_of`: the field kind a stored Field document declares. */ declare function fieldKindOf(d: Record): string | null; /** The Fields-only JSON Schema of a record of this Table (no control keys). */ declare function tableJsonSchema(facts: TableKindFacts, mode: TableSchemaMode): Json; /** * The Fields-only content-ir `KindSchema` the web draws a record of this Table with: every Field * nullable and optional, choices open to every word the store accepts (keys, labels, ids, * retired included). Wrap it with `withControlKeyFields` from @ai-matrx/content-ir — table kinds * never pass through `kindSchemaFromJsonSchema`. */ declare function tableRenderSchema(facts: TableKindFacts): TableRenderSchema; /** * DOOR-8. As-of on EITHER clock, and they are different questions: * · `record` — the record clock: what this record looked like at version time. * · `world` — the world clock: which values were true of the world then * (the Field's `dated` modifier). */ interface AsOf { clock: "record" | "world"; at: Timestamp; } /** A predicate over a PROMOTED field (REC-5: promotion light -> heavy). */ interface PromotedPredicate { field_key: string; /** The value as text, exactly as `custom.promoted_read` takes it. */ equals: string; } interface RecordQuery { table_id: Uuid; /** DOOR-6. Any combination, any subset. An empty list means "no relation constraint". */ relations?: RelationCoordinate[]; /** Predicates the store can answer from an index. */ promoted?: PromotedPredicate[]; /** DOOR-8. */ asOf?: AsOf; /** DOOR-9. Ask across EVERY Home of this Table in one answer. */ acrossHomes?: boolean; /** REC-23. Soft-deleted rows are out unless you say otherwise. */ includeDeleted?: boolean; /** FLD-10. */ recordType?: string; orderBy?: { column: "created_at" | "updated_at"; ascending?: boolean; }; limit?: number; offset?: number; } /** One organization the client could not use, with the sentence that says why. */ interface OrganizationUnavailable { organization_id: Uuid; reason: string; } /** `organizationsOpen`: the organizations whose store answers, and those that do not (with why). */ interface OrganizationsOpenAnswer { open: Uuid[]; unavailable: OrganizationUnavailable[]; } /** `metadataSearch`: every match, each carrying the organization it came from. */ interface MetadataSearchAnswer { matches: Array & { organization_id: Uuid | null; }>; /** Organizations asked in order (the ones that answered). */ organizations_covered: Uuid[]; unavailable: OrganizationUnavailable[]; } /** AT-SHARE-B. What `custom.field_notify_on_assign` answers: whether the column tells people, and the automations doing it. */ interface FieldNotifyOnAssign { field_id: Uuid; notify_on_assign: boolean; changed: boolean; automation_ids: string[]; says?: string; } /** What `custom.base_move` answered when the whole base landed. */ interface BaseMoved { name: string; toOrganizationId: Uuid; /** How many tables went with the Home. */ tables: number; } interface RecordsClient extends PickListDoors { /** The config this client was built with, so a screen can show who it is acting as. */ readonly config: RecordsConfig; /** * THE SCOPE DOORS (`custom.context_*`): scope types are Tables kept for context, scopes Records, * context fields Fields, values cells. Built from this client's own door path. `@ai-matrx/records/scopes`. */ readonly scopes: ScopeDoors; recordWrite(args: { table_id: Uuid; data: RecordDocument; }): Promise>; /** * WRITE THE RECORD THIS KEY NAMES, OR UPDATE IT WHEN IT IS ALREADY THERE — one call, race-safe * (`custom.record_upsert`). `key` is the column key (or keys) that say which record this is, * and every one must carry a `unique` rule: the store refuses any other column by its name. * Two concurrent calls with the same key leave ONE record. An update goes through * `record_update` (with `expectedVersion`, its stale-write refusal); a new record through * `record_write`. Answers the record's id either way. */ recordUpsert(args: { table_id: Uuid; key: string | string[]; data: RecordDocument; expectedVersion?: number; }): Promise>; /** * Write MANY new records of one Table in one call. * * `custom.record_write_many` asks the switch, the organization and the Table * ONCE for the whole batch and inserts the rows in one statement — which is * why a paste of 120 lines is one round trip per chunk instead of 120. It * CREATES only: there is no bulk update door, because an update carries a * per-row optimistic version and a batch would have to either drop that or * fail the whole batch for one stale row. * * It returns the new ids IN THE ORDER THE ROWS WERE HANDED IN, so a caller * can tie each id back to the line of the spreadsheet it came from. Hand in * `ids` to choose them yourself; hand in none and the door mints them. */ recordWriteMany(args: { table_id: Uuid; rows: RecordDocument[]; ids?: Uuid[]; }): Promise>; /** * DOOR-SPEED. MANY CHANGES TO ONE TABLE IN ONE TRANSACTION, through * `custom.record_change_many`: inserts, updates (each with an optional `expected_version`) * and archives. Every update lands in ONE statement, so the store's change notice, history and * activity fire once for the batch while every row trigger still judges every row. ONE REFUSED * CHANGE REFUSES THE BATCH and nothing is saved; the store's own sentence comes back with the * change's position in the hint. The answer is one result per change, in order. */ recordChangeMany(args: { table_id: Uuid; changes: readonly RecordChange[]; }): Promise>; /** * A PARENT, THE EDGES IT STANDS ON AND THE ROWS THAT BELONG TO IT — ALL OR NOTHING. * * `recordWrite` and `recordWriteMany` are each ONE statement. A screen or a * server path whose unit of work is a GRAPH — an AI artifact and the lines * it produced, an order and its items, a research note and its citations — * could therefore not save it as one thing: a loop is N transactions, and a * failure on row nineteen leaves a parent standing without the lines it * promised. * * `custom.record_write_graph` is one statement, so it is one transaction. It * is NOT a second write path: it calls `custom.record_write_many` for the * rows, `public.assoc_add` for an edge that points OUT of the store (the * message a record was produced by), and `platform.relation_set` for the * parent's own declared relation to its children. Same store switch, same * editor rung on the Table, same value envelope, same undeclared-key guard, * same history rows, same realtime notice. * * ONE REFUSAL REFUSES THE WHOLE GRAPH, BY NAME — the answer says which member * failed and carries the store's own sentence about it, and nothing is * written. * * Every child MUST name a `role`: it is the key of a declared RELATION field * on the parent's Table, and an edge out of a record that names no field is * refused by the store (REL-10 / T7) because without it nothing can read the * relation's delete rule, its cardinality or its organization wall. The order * children are handed in IS the order of the relation. */ recordWriteGraph(args: { table_id: Uuid; parent: RecordDocument; /** Each child: its document, the parent FIELD it fills, and optionally its own Table. */ children?: Array<{ data: RecordDocument; role: string; table_id?: Uuid; position?: number; }>; /** Edges to things OUTSIDE the store. `direction` defaults to `"in"` — that thing produced this record. */ edges?: Array<{ entity: string; id: Uuid; direction?: "in" | "out"; label?: string; role?: string; position?: number; metadata?: Record; }>; }): Promise>; recordUpdate(args: { record_id: Uuid; patch: Record; /** Leave it out and the last writer wins; supply it and a loser is TOLD. */ expectedVersion?: number; }): Promise>; /** * A CELL THAT TAKES WORDS WHICH ARE NOT YET A CHOICE — the words become a choice of that * column everywhere and the cell takes it, in ONE transaction (lane CHOICE-COLUMN-EDIT, * `custom.record_update_adding_choices`). `add` is `{ "": ["words", ...] }`; the * cell's value in `patch` is the words, and the store turns them into the new choice's key. * Adding a choice changes the table's columns, so it needs that right; a refusal names it. * Answers the new version, like `recordUpdate`, and announces the record changed. */ recordUpdateAddingChoices(args: { record_id: Uuid; patch: Record; add: Record; expectedVersion?: number; }): Promise>; /** * The Feature Knob `custom/choice_nudge` for the signed-in person in this client's * organization: what a choice cell does with typed words that are not a choice * (`decideTypedChoice` in `choice.ts` is the one place that acts on it). */ choiceNudge(): Promise>; /** * REC-23. Soft, and reversible within `retention`. * * 🚨 NOT FOR A TABLE. A Table is a record, so this door accepts one — and * then recurses through every record the Table contains inside a single * transaction, which is unbounded by construction and dies on `57014` at a * size the product's own import reaches in half a minute. Use * `tableArchive` below, which does the same work in resumable passes. */ recordDelete(args: { record_id: Uuid; }): Promise>; /** * MOVE A RECORD (a Table included) INTO ANOTHER HOME — `custom.record_reparent`, the one door that changes where a * record is contained. `parent_id` is the Home's record id (null takes it out). Admin on the record, viewer on the Home. */ recordReparent(args: { record_id: Uuid; parent_id: Uuid | null; }): Promise>; recordRestore(args: { record_id: Uuid; }): Promise>; /** * CLOSE-LINK (CD-LINK-10) — WHERE A TABLE LIVES: every Home it lives in (`custom.table_homes_named`), each named for * this reader, the Home it was declared in first (`declared`). A Home this reader may not open is named as withheld. */ tableHomes(args: { table_id: Uuid; }): Promise>>; /** * CLOSE-LINK (CD-LINK-10) — "ALSO LIVES IN…": the Table also lives in `home_record_id` (`custom.home_add`, admin on the * Table). A person shared on that Home alone then knows the Table and sees the records inside that Home, never another's. */ homeAdd(args: { table_id: Uuid; home_record_id: Uuid; }): Promise>; /** * ARCHIVING A WHOLE TABLE — ONE PASS OF IT (VERIFIER-11 F3). * * One call archives at most `chunk` of the table's live records through * `custom.record_delete` (so every guard, history capture and outbox row * still happens; nothing is hard-deleted) and comes back with the numbers a * screen draws progress from. The CALLER LOOPS until `done` — that loop is * the fix, because the one thing a single statement cannot be made to do is * finish. * * `chunk: 0` changes nothing and only reports, so a screen can say "1,430 * records will be archived" BEFORE a person commits to it. `includeTable: * false` empties the table and leaves it standing. * * RESUMABLE, WITHOUT A JOB ROW: what remains is read off the records * themselves every call. A pass that fails, a closed tab or a deploy mid-run * leaves a half-archived table and a next call that continues from exactly * there. A caller must therefore never report "nothing happened" after a * failed pass — `archived_total` says what really landed. */ tableArchive(args: { table_id: Uuid; /** * How many records this pass takes on. The door clamps it; it answers with what it * took. Default 50 — measured: ~35ms a record against an 8s statement timeout, so * 200 dies on `57014` and is the original defect one level up. */ chunk?: number; /** Archive the Table record itself once nothing live is left in it. Default true. */ includeTable?: boolean; }): Promise>; /** * ONE PASS OF ARCHIVING, ON PURPOSE, A TABLE THE APP'S CODE DEPENDS ON * (`custom.table_archive_deliberately`, lane 12 P5). Such a table (`code_depends: true`) refuses * `tableArchive`, `recordDelete`, a slug / kept_for rename, `tableMove` and removal of the mark. * This door takes the table's slug TYPED by the person and a reason, refuses an agent, and then * archives through `custom.table_archive` (same progress answer; the caller loops until `done`). * Use `archiveTypedTableDeliberately` (`@ai-matrx/records/typed-table`), which loops. */ tableArchiveDeliberately(args: { table_id: Uuid; typed_slug: string; reason: string; }): Promise>; /** * BRINGING A WHOLE TABLE BACK — ONE PASS OF IT (`custom.table_restore`, lane TABLE-ACTIONS). * * 🚨 NOT `recordRestore` FOR A TABLE: that door brings the Table, its structure, every record * and everything built on it back in one statement and dies on `57014` (the clone's "Referral * Intake Queue 2026-Q4 (copy 7)"). This pass brings back the Table and its structure first, then * at most `chunk` records, then what was built on it — all from the one archive event — and * answers `done` when nothing the archive took is still waiting. Use {@link tableRestoreWhole}. */ tableRestore(args: { table_id: Uuid; chunk?: number; }): Promise>; /** * THE WHOLE RESTORE OF A TABLE — the loop every caller needs: `tableRestore` until `done`, * halving the pass on a statement timeout (a pass that timed out changed nothing). `onPass` * hears every pass's numbers. Answers the last pass, or the refusal that stopped it (what the * passes before it brought back stays back; the next call carries on from there). */ tableRestoreWhole(args: { table_id: Uuid; onPass?: (progress: TableRestoreProgress) => void; }): Promise>; /** * DUPLICATE A TABLE — `custom.table_duplicate` (lane TABLE-ACTIONS). * * Makes a NEW Table from one the caller may open: its settings and look, every live column (new * ids), every choice list as a new list (same words, colors, keys and order), every saved view * (filters, sorts, layouts, every id inside them pointing at the copy), and with `withRecords` * every live record (a link to another row of the same table follows to the copy's row; a link * to another table stays). `name` defaults to " (copy)", "(copy 2)", …; * `organizationId` defaults to the source's organization and must be one the caller belongs to. * The source is never written. The copy is made in passes of a few seconds (any size; the * store answers "copying" until "done"), and this call loops them. Refused before anything is * made, the refusal carries the store's one sentence (not given / archived / not a member there * / a column linking across organizations). */ tableDuplicate(args: { tableId: Uuid; withRecords?: boolean; name?: string | null; organizationId?: Uuid | null; /** Called after every pass with what is copied so far (a progress bar is made of it). */ onProgress?: (progress: TableDuplicateProgress) => void; }): Promise>; /** * FINISH A BASE COPY — `custom.base_copy_finish` (lane AT-BASE). After every table of a base was copied by `tableDuplicate`, * points the copies at each other: `pairs` is {source table id: its copy's id}. Re-points each link column's target and each * link cell whose row was copied too; links to a table outside the base stay. Only tables this person copied are touched. */ baseCopyFinish(args: { organizationId: Uuid; pairs: Record; }): Promise>; /** * CARRY A COPY'S EXTRAS — `custom.copy_table_extras` (lane COPY-EXTRAS). `pairs` is {source table id: its copy's id}. Every automation of a * source is declared on its copy SWITCHED OFF and every page too, each column and view id pointed at the copy's own. The step's own * refusals (one sentence each) come back in `extras_refused`; the base-move job in aidream calls the same function. */ copyTableExtras(args: { organizationId: Uuid; pairs: Record; }): Promise>; /** * CARRY ON A COPY — `custom.table_duplicate_continue` (lane TABLE-ACTIONS). The copy is made in * passes of a few seconds each; `tableDuplicate` loops them, and this resumes one that a closed * tab or a lost connection left unfinished (the copy is kept out of every table list until it * is done). Only the person who started it; it answers the finished copy, or refuses. */ tableDuplicateContinue(args: { copyId: Uuid; onProgress?: (progress: TableDuplicateProgress) => void; }): Promise>; /** * THE CALLER'S UNFINISHED COPIES — `custom.table_copies_in_progress` (lane TABLE-ACTIONS). Each * is still being made (carry it on with `tableDuplicateContinue`) or stopped because its source * was archived meanwhile (discard it: `tableArchive` on the copy). Nobody else can see them. */ tableCopiesInProgress(): Promise>; recordRead(args: { record_id: Uuid; withComputed?: boolean; /** Also answer `version` (read in the same round, so the read takes as long as the slower of the two). */ withVersion?: boolean; organization_id?: Uuid | null; }): Promise>; /** * DOOR-1. A page of one Table's records THROUGH `custom.read_records`: the * store decides which rows this reader may see and which fields of them, and * a field it masked comes back present-and-null with its reason in `hidden`. * `total` is null because the door counts nothing it has not read — a count * of rows a person may not see is a leak with a number on it. */ list(args: { table_id: Uuid; /** * THE STORE'S ONE FILTER SHAPE (`RecordFilter`). Left out, this is the * whole page. Supplied, the store narrows INSIDE its own query — never the * browser, which can only ever filter the rows it was already allowed to * see and would silently drop the rest of the answer. * * It is the same object a saved view stores as `filters` and the same one * `recordAggregate` counts with, so the rows a drill-through opens are the * rows the number on the dashboard counted. */ filter?: StoreFilter; limit?: number; offset?: number; }): Promise>; /** * DOOR-SPEED. ONE PAGE THE STORE SORTED, SEARCHED, FILTERED AND COUNTED, through * `custom.read_records_page` — the same wall, ladder, field mask and filter as `list`, with the * order (`sort`, or a hand-ordered view's positions via `view_id`), a text `search` over the * columns this reader may see (and the words of choice options), and the `total` of the * matching visible set. It is what a grid pages with: nothing reads the whole table to draw one * page. A sort on a column this reader cannot see (gone, or masked) is SKIPPED and named in * `sort_ignored` — the page still loads; one worked out on every read is refused by name. */ listPage(args: { table_id: Uuid; filter?: StoreFilter; search?: string | null; sort?: readonly RecordPageSort[]; view_id?: Uuid | null; limit?: number; offset?: number; }): Promise>; /** * AP3-KEYSET-DOOR. THE SAME PAGE AS `listPage`, PAGED BY A CURSOR, through * `custom.read_records_keyset`: the same wall, ladder, field mask, filter, search and sort (no * hand-ordered view), the same rows in the same order — but the next page starts after the last * row's sort values and id, so a write landing mid-read never skips or repeats a row. Pass back * `cursor` as `after` (it is opaque; `null` on the last page). A cursor handed to a different * sort, filter or search is refused by name ("start from the first page"), never reinterpreted. * * Every row carries the `version` and `organization_id` it was read at, in the same statement as * its values. With `ids`, it re-reads exactly those rows among the ones the reader may see (in the * page's order; `after` ignored, `cursor` and `total` null) — get-by-id, the re-read after a write, * and the changed ids of a realtime notice. */ listKeyset(args: { table_id: Uuid; filter?: StoreFilter; search?: string | null; sort?: readonly RecordPageSort[]; after?: string | null; ids?: readonly Uuid[]; limit?: number; }): Promise>; /** * DOOR-1 FOR AN ID SET. Exactly these records of this Table, through * `custom.read_records_by_ids` — the same ladder, the same level, the same * field masking and the same page ceiling as `list`, addressed by id instead * of by page. An id the reader may not see simply does not come back, which * is the same answer `list` gives by omission. * * It exists because a realtime notice has always named the exact ids that * moved and no door could take them: three cells changing re-read a fifty-row * page in every watching browser. */ listByIds(args: { table_id: Uuid; ids: readonly Uuid[]; }): Promise>; /** * DOOR-1 FOR THE ROWS THAT LEFT: a page of one Table's ARCHIVED records, * through `custom.read_records_archived` — the same ladder, the same level, * the same field masking and the same page ceiling as `list`, with the sign * of the `deleted_at` test flipped, plus who archived each one and when. * * 🚨 IT EXISTS BECAUSE ARCHIVING WAS A ONE-WAY DOOR (VERIFIER-10 F4). The * store has always had `record_restore`, and it has always done exactly the * right thing; what it did not have was any door that could LIST the records * it would act on, because every read door answers live rows only. So an * archived record was unreachable from every screen in the platform. * * `lane` is the archived-items law's two lanes — "mine" (what I archived) and * "org" (what anybody in this organization archived), which is the default. */ listArchived(args: { table_id: Uuid; lane?: ArchiveLane; limit?: number; offset?: number; }): Promise>; query(query: RecordQuery): Promise>; /** * Every Table the person can see across ALL their organizations * (`config.organizationIds`); `organization_id` is the page's optional filter * (absent = all). Each Table carries its own `organization_id`. */ tableList(args?: { organization_id?: Uuid | null; }): Promise>; /** * ONE Table's declaration by id — `null` when this reader may not see it or it is not a Table. * The same kernel record `tableList` lists, read through `read_records_by_ids` for exactly * that id, so a screen that opens one table never lists every table to find it (a list capped * at 500 answered "no table" past the 500th). */ tableRead(args: { table_id: Uuid; organization_id?: Uuid | null; }): Promise>; /** * ONE Table of THIS organization found by its slug — or, with no slug, by its name — in ONE * request (`custom.table_find`). `null` when there is none or this reader may not see it: the * store reads the candidates through the same read door `tableRead` uses, so a table she may * not see answers exactly like one nobody made. Where several share a slug, the oldest she may * see answers, every time (the same pick `ensureTable` makes). Never list every table to find one. * * `keptFor` (an app's table): the slug AND what the table is kept for must match — a person's own * table of the same slug is a different table and never answers. With `keptFor` and no live * match, an ARCHIVED match is answered as `{ id, organization_id, archived_at }` (no document), so * a caller says "archived — restore it", never "missing". */ tableFind(args: ({ slug: string; name?: never; } | { name: string; slug?: never; }) & { keptFor?: string; }): Promise>; /** * `tableFind` BY SLUG FOR MANY ORGANIZATIONS IN ONE REQUEST (`custom.table_find_many`). Each * organization meets the same walls `tableFind` does and is answered through `custom.table_find` * itself. `tables` holds one live Table per organization that has one this reader may see (an * organization with none is absent); `refused` holds each organization the store refused, with * its own refusal, and never stops the others. Never loop `tableFind` over organizations. */ tableFindMany(args: { organizationIds: Uuid[]; slug: string; keptFor?: string; }): Promise; }>>; /** * IS THIS TABLE IN THE ARCHIVE? (lane HUB-FIX, 2026-09-23.) The archived row for one * Table of this organization, or `null` when the archive does not hold it — which * is an ANSWER, never "it may have been deleted". A table page that cannot find a * Table asks this before saying anything: an archived Table's own address used to * read "…or it may have been deleted" when it was archived and one click from back. */ tableArchived(args: { table_id: Uuid; }): Promise>; /** * WHO CAN SEE EACH TABLE, AND WHETHER THE CALLER MADE IT — `custom.table_facts` * (lane HUB-FIX). `visibility` and `created_by` are record COLUMNS the Table document * never carried, so a screen that sorts Tables into lanes asks this and folds the * answer onto `tableList()`'s Tables with `withTableFacts`. * * 🚨 IT IS ITS OWN CALL, NOT PART OF `tableList()` (0.57.3). 0.57.2 folded it into * every table list, so every screen that merely LISTS tables (the field editor's * relation target, the import wizard, settings) paid a second round trip it never * used — and every test double that answers a table list had to answer it too * (records-ui 0.84.5's gate: 47 tests in 15 files red). Only the lane-sorting * screens ask. * * The door-presence pattern: when the store's catalog does not carry the door the * answer is `null` — nothing asked, nothing invented. */ tableFacts(args?: { organization_id?: Uuid | null; }): Promise>; /** * WHICH STORE CURRENTLY WRITES each table — `custom.where_tables_live`. * * This is a batch cutover decision, not a Table's home address: during COPY * mode an older table and its record-store copy share an id, and only this * door knows which one the organization is still using. It is intentionally * unbound from this client's organization because the door derives the answer * from each supplied table and the caller's authority. */ tablesLiveWhere(args: { table_ids: Uuid[]; }): Promise>; /** * WHICH ORGANIZATION A TABLE LIVES IN, BY NAME, AND WHERE IT MAY GO — `custom.table_home` * (SC-1' / SC-1-TAILS). Read FROM THE TABLE, never from the organization the client is bound * to, so it answers for a table shared from outside too. `null` = not given to this person, * or not there (the store says the same for both, on purpose). A store without the door * refuses `door_absent` — never a guessed organization. */ tableHome(args: { table_id: Uuid; }): Promise>; /** * MOVE A TABLE into another organization the caller belongs to — `custom.table_move`. It * carries every Table inside it or its rows and writes the change events; refused, NOTHING * moved and the refusal carries the store's one sentence. `expected_version` is the Table's * version the caller decided on (a concurrent change refuses with "look again"). */ tableMove(args: { table_id: Uuid; to_organization_id: Uuid; expected_version?: number | null; }): Promise>; /** * MOVE A WHOLE BASE into another workspace (organization) the caller belongs to — `custom.base_move` (AT-NOTIFY-MOVE). * Admin on the base's Home. Every table of the Home goes through the one table door (with its pages and automations), the * Home and its base row follow, and the tables stay under that Home over there. All or nothing: a refusal moved nothing and * carries the store's sentence (which table it stopped at, or that the caller is not in that workspace). */ baseMove(args: { home_id: Uuid; to_organization_id: Uuid; }): Promise>; /** * The Fields that apply. NOTION-PROPS: a two-way link's reverse Field (`isReverseField`) is left out * unless `withReverse` — every screen draws it as the table's reverse column (`reverseColumns`, with * `read_only: false`), which reads and writes its links; listed as a Field too it would draw twice. */ fields(args: { table_id: Uuid; recordType?: string; withReverse?: boolean; }): Promise>; /** * FLD-5 / FLD-6: a list field stores the id of an option RECORD, because * every pick-list is already a Table. These are that Table's records — the * store resolves which Table from the Field's own config, so no caller has to * know it. */ fieldOptions(args: { field_id: Uuid; }): Promise>; /** * How many records hold each choice of one choice column, keyed by the option's id * (`custom.field_choice_usage`; counts only records the caller may see). What a column editor * says before a choice that records still hold is removed: "3 records use “X-ray”." */ fieldChoiceUsage(args: { field_id: Uuid; }): Promise>>; /** * A column's choices saved AND the records of each removed choice moved to another choice, * kept as other values, or cleared — ONE transaction (`custom.field_update_rehoming_choices`). * `rehome` is keyed by the removed option's id. The answer carries `undo`; sending * `{ patch: { options: undo.options }, cells_back: undo.cells_back }` back through this same * call puts the list and every cell back, again in one transaction. */ fieldUpdateRehomingChoices(args: { field_id: Uuid; patch: FieldPatch; rehome?: Record | undefined; cells_back?: readonly ChoiceCellBack[] | undefined; }): Promise>; tableCapacity(args: { table_id: Uuid; }): Promise>; /** * REC-1: a Table has to live somewhere, so a Home comes first — and a Home is * an ordinary record in the person kernel. `homeId` is therefore required and * `personKernelId()` is how a caller gets a Table to write one into. */ tableDeclare(args: { spec: Record; homeId: Uuid; }): Promise>; /** * FIND THIS TABLE BY ITS SLUG, OR MAKE IT — ONE call, ONE transaction (`custom.table_ensure`). * The store holds a lock on (organization, slug) across the find and the make, so two tabs * saving their first record at once get the SAME table; a second call adds any column the spec * names that the table lacks and never retypes or drops one. `spec.fields` are full * `custom.field_declare` specs. Prefer `ensureTable(client, NewTableSpec)`, which builds them. * * `drift` names every column the table already has whose stored shape differs from the spec * (type, format, label, multi, required, unique) — reported, never applied. `[]` when nothing * differs; `null` only from a store too old to compare (see `FieldDrift`). */ tableEnsure(args: { spec: Record; }): Promise>; /** * ADD A FIELD TO A TABLE. One call, and the store does the three things no * client can do for itself: it turns a parity type into the behavior, * modifiers, format, unit, relation target and Rules its own guards demand; * it tells the TABLE about the field (REC-1 / FLD-8 — a definition for a * field the table never declared is refused, which is the sentence every * "Add field" used to end on); and it stores the definition as a FIELD * rather than as a plain record, so the delete rules and the * formula-dependency check can see it. * * A choice list carries its `options` as words. The store keeps them the only * way FLD-5 / FLD-6 allows — as the records of a Table it declares for them — * so nobody is made to build a table before they can have a dropdown. */ fieldDeclare(args: { table_id: Uuid; spec: NewFieldDeclaration; }): Promise>; /** Several columns of one Table in ONE call and one transaction (`custom.field_declare_many`): all or none. */ fieldDeclareMany(args: { table_id: Uuid; specs: NewFieldDeclaration[]; }): Promise>; /** * A NEW TABLE IN ONE CALL (`custom.table_create`): its Home, the Table under it and its columns, in * one transaction, so a refusal anywhere leaves nothing behind. Prefer `declareTable(client, spec)`. */ tableCreate(args: { spec: Record; fields: NewFieldDeclaration[]; }): Promise>; /** One field's own settings. What it HOLDS is a conversion and is refused here by name. */ fieldUpdate(args: { field_id: Uuid; patch: FieldPatch; }): Promise>; /** * WHAT A CHANGE OF KIND WILL DO, before it is made (`custom.field_retype_preview`): the store runs the * same `field_update` patch inside a subtransaction, counts what converts, what is kept aside and the * choices it makes, and rolls every row back. Nothing is written. */ fieldRetypePreview(args: { field_id: Uuid; patch: FieldPatch; }): Promise>; /** * CHANGE WHAT A COLUMN HOLDS, through `custom.migrate_retype` (FLD-4 / T12). `to` is the store's * behavior word — `text`, `range` (numbers and dates), `boolean`, `list`, `relation`. Every value * that converts is converted; every value that does not is kept in that record's `_retired` * with the reason, never coerced and never deleted. The answer counts both. */ migrateRetype(args: { field_id: Uuid; to: string; note?: string; }): Promise>; /** * MERGE ONE RECORD INTO ANOTHER, through `custom.migrate_merge` (T5 / REC-21). The loser's values * the winner did not hold move across, the ones that differ are kept as ranked alternates, every * link to the loser now points at the winner, and the loser is archived with its id resolving to * the winner. Editor on BOTH records is decided first. The answer's `migration_id` is what * `migrateUndo` takes. */ migrateMerge(args: { winner_id: Uuid; loser_id: Uuid; note?: string | null; }): Promise>; /** Put a recorded Migration back (`custom.migrate_undo`): a retype or a merge, by its id. */ migrateUndo(args: { migration_id: Uuid; }): Promise>; /** * SPLIT ONE RECORD IN TWO, through `custom.migrate_split` (Rule 11 / REC-22). The named values * MOVE to a new record of the same Table; the original keeps its id, so every link to it still * resolves. Editor on the record is decided first. `migrateUndo(migration_id)` puts it back. */ migrateSplit(args: { record_id: Uuid; moved_keys: string[]; note?: string | null; }): Promise>; /** * EXTRACT A PARENT, through `custom.migrate_extract_parent` (Rule 11 / test 5). The named values * are COPIED up into a new record of `parent_table_id`, and this record is put under it. Its old * parent, if any, becomes the new parent's parent. `migrateUndo(migration_id)` puts it back. */ migrateExtractParent(args: { record_id: Uuid; parent_table_id: Uuid; moved_keys: string[]; note?: string | null; }): Promise>; /** * MOVE A RECORD TO ANOTHER TABLE, through `custom.migrate_retype`'s record arm (test 9 / REC-N-18). The * record keeps its id — every link to it still resolves — and its values whose column `to_table_id` lacks * are taken off and kept in History with the reason (`misfits`). Full (admin) on the record is decided * first; the table must be in the same organization. `migrateUndo(migration_id)` puts it back whole. */ migrateMoveRecord(args: { record_id: Uuid; to_table_id: Uuid; note?: string | null; }): Promise>; /** The Migration log for one record or Table (`custom.migrations`), newest first. */ migrations(args: { target_id?: Uuid | null; limit?: number; }): Promise>; /** * HOW LONG HISTORY IS KEPT (Rule 10 / test 14), through `custom.history_retention`. `floor_days` is the * organization's floor (knob `extensibility.user_tables.history_retention_floor_days`: 30 by default, an * organization may raise it, never lower it); `table_days` is the table's own, never below the floor. */ historyRetention(args?: { table_id?: Uuid | null; }): Promise>; /** Set a table's value-history retention (`custom.history_retention_set`); below the floor is refused in the store's words. */ historyRetentionSet(args: { table_id: Uuid; days: number; }): Promise>; /** Raise this organization's retention floor (`custom.history_retention_floor_raise`); a lower number is refused. */ historyRetentionFloorRaise(args: { days: number; }): Promise>; /** * ONE RECORD ON EITHER CLOCK, through `custom.query_record_as_of` (Rule 10 / test 6). * `recorded_at` answers what the store SAID at that moment; `world_on` answers what was TRUE of * the world on that date, read from `dated` values. Both may be given. `null` data means the * record is not visible to this person (or did not exist then) — an absence, not an empty record. */ recordAsOf(args: { record_id: Uuid; recorded_at?: string | null; world_on?: string | null; }): Promise | null>>; /** * REL-DISP. THE WORDS ONE RELATION CELL SHOWS, resolved by the store through * that column's own display spec — one column or several, joined by its * separator. Never resolve a relation label any other way: the store's * `custom._words_for` is the one body that decides what a record is called, it * asks the read-access ladder BEFORE it reads the name, and a record this reader * may not open comes back as the withheld sentence rather than its name or id. * A value that is not an id is handed straight back — it is already words. */ relationWords(args: { field_id: Uuid; value: string; }): Promise>; /** * The same answer for a WHOLE PAGE of cells in one round trip. Prefer this * wherever a grid, board, list or picker resolves more than one chip: the * per-id lane is what made a page of relation cells a page of requests. */ relationWordsMany(args: RelationWordsManyArgs): Promise> & { archived?: readonly string[]; icons?: Record; }>; /** * VISION-REACH G1. Which records of `table_id` each name names — its name column, case and * spacing ignored, only records this reader may see. Hand the answer to `relationNameIndexOf` * and pass that to the coercion as `relationNames`. Up to 5,000 names a call; more are sent in * groups by this method. */ relationNamesMatch(args: { table_id: Uuid; names: string[]; }): Promise>; /** * VIEWS-AND-FIELDS BL (REL-9). The REVERSE COLUMNS of a Table: one per relation column of another * table (or this one) that links here, read-only, virtual — never a Field of this Table, so * `applicableFields` does not list them. A linking table this reader may not know is left out. */ reverseColumns(args: { table_id: Uuid; }): Promise>; /** * A page of records' links through ONE reverse column, in one round trip per 200 records: * `{ [record id]: { total, links: [{ id, words }] } }`, only linking records this reader may see. * `limit` (1–50) and `offset` page one record's links — a record with thousands of links costs * one count and one page. A record with no links answers `{ total: 0, links: [] }`. */ reverseLinksMany(args: ReverseLinksManyArgs): Promise>>; /** * The same, through SEVERAL reverse columns in ONE call (`custom.reverse_links_many_fields`): * `{ [source field id]: { [record id]: { total, links } } }`. A store without the door answers * `door_absent` — ask `reverseLinksMany` per column then. */ reverseLinksFields(args: ReverseLinksFieldsArgs): Promise>>>; /** * NOTION-PROPS. A TWO-WAY LINK: makes (or returns) the reverse Field of relation `field_id` on its * target table (`custom.relation_reverse_field`), so the link is a column there that edits the same * links. Its key is the reverse column's key; `label` defaults to the linking table's name. */ relationReverseField(args: { field_id: Uuid; label?: string; }): Promise>; /** * NOTION-PROPS. Adds and removes links from the reverse side of a two-way link * (`custom.relation_reverse_set`): each id becomes a write of THAT record's forward Field. * Answers how many records changed. */ relationReverseSet(args: { record_id: Uuid; field_id: Uuid; add?: readonly Uuid[]; remove?: readonly Uuid[]; }): Promise>; /** Take a field off a table. Refuses the title field, the last field, and one another field reads through. */ fieldRetire(args: { field_id: Uuid; }): Promise>; /** * Bring a removed column back (`custom.field_restore`): the set that was retired with it, the * Table's declaration of those columns, and the links they made. The values never left. */ fieldRestore(args: { field_id: Uuid; }): Promise>; /** * DUPLICATE PROPERTY (Notion N5) — `custom.field_duplicate`: a new column right after this one, named * " (1)", the same kind (choices with their colors, unit, link, formula, rules, sensitivity), and * every record's value copied into it in one statement. A link column copies its definition only (its * values are links); a formula, lookup or roll-up works its answer out itself. Needs the table's * add-a-column rung, the same as `fieldDeclare`. */ fieldDuplicate(args: { field_id: Uuid; }): Promise>; /** * CHAIR-ROLLUP-HONEST. Is a column this lookup or roll-up reads archived — the link it reads * through, a back-link's linking column, or the far column it totals (`custom.field_source_archived`)? * `null` while every source is live. Bring it back with `fieldRestore({ field_id })`. */ fieldSourceArchived(args: { field_id: Uuid; }): Promise>; /** * A TABLE AS A KIND (KINDS-GLUE wave 3, N1): `custom.table_kind_facts` verbatim — the Table's * live Fields, choices and stamp, as the asking person. The door finds the Table's organization * itself, so this works for a Table in any organization the person may open; anything else is * refused (`42501`, the store's sentence). */ tableKindFacts(args: { table_id: Uuid; }): Promise>; /** * A TABLE'S ACCESS LEVEL (CONFIDENTIAL-BY-ORG-ADMIN): `custom.table_level_facts` verbatim - its level, * readers, who approves a change (`set_by`) and whether THIS person may (`can_set`). Draw the control only * when `can_set` is true; anyone who may know the table may ask. */ tableLevelFacts(args: { table_id: Uuid; }): Promise>; /** * MAKE A CUSTOM TABLE CONFIDENTIAL, or change whom it names (`custom.set_table_confidential`). Succeeds * only for an owner/admin of the table's own organization on an ordinary custom table; the approver, seat, * reason and date are recorded. `readers` is the list of `{field, level}` rules (a person field of the * table); `reason` is required. */ setTableConfidential(args: { table_id: Uuid; readers: TableReaderRule[]; reason: string; }): Promise>; /** THE WAY BACK: the same caller rule, the table is Organization again (`custom.set_table_organization`). */ setTableOrganization(args: { table_id: Uuid; reason: string; }): Promise>; /** * THE COLUMNS THIS TABLE HAD AND NO LONGER HAS (grids review 3): its retired Field records, * newest first, through the same archived door the Table archive uses — addressed at the Field * kernel (every Field is a record in it) and paged until the door answers short. */ fieldsRetired(args: { table_id: Uuid; }): Promise>; /** What the registry says about a token, and whether it can hold a value at all. */ entityTable(args: { token: string; }): Promise>; /** * The fields THIS organization added to that standard table. `include_retired: true` also answers the * ones taken away (`entityFieldRetire`), live first, each with `archived_at` set — the archived view a * screen offers, with `fieldRestore({ field_id })` to bring one back. Live fields carry `archived_at: null`. */ entityFields(args: { token: string; include_retired?: boolean; }): Promise>; /** The fields EVERY named organization added to that standard table, with their choices, in one read. */ entityFieldsAcross(args: { token: string; organization_ids: Uuid[]; }): Promise>; /** Add a column to a standard table. An organization admin's right - it changes the table for everybody. */ entityFieldDeclare(args: { token: string; spec: NewEntityFieldDeclaration; }): Promise>; /** One field's own settings. A TYPE change is refused here by name, as it is on a custom table. */ entityFieldUpdate(args: { field_id: Uuid; patch: Record; }): Promise>; /** Take a custom field off a standard table. The values already written stay in each row. */ entityFieldRetire(args: { field_id: Uuid; }): Promise>; /** May this person add a column here - and if not, the store's own sentence saying why. */ entityFieldRights(args: { token: string; }): Promise>; /** REC-53 in one answer: the row's real columns AND its custom values AND the definitions. */ entityRecordRead(args: { token: string; record_id: Uuid; }): Promise>; /** * AP-4: the custom rows that link to one platform record, by which field and in which table. * Keyed by the ROW's organization (`organization_id`), never the client's active one. Paged: * pass the previous answer's `next_cursor` as `cursor`. */ entityBackLinks(args: { token: string; record_id: Uuid; organization_id: Uuid; limit?: number; cursor?: string | null; }): Promise>; /** * THE one write door for a standard row (`custom.entity_row_write`, as the person): custom values * as a patch (a key left out is left alone, a key set to null is cleared with its envelope), * archive / restore, and real columns only where the store lists them. The row's own organization * governs; `expected_version` refuses a stale write; a change that changes nothing writes nothing. */ entityRowWrite(args: { token: string; /** * null ADDS a row (chairblk3_a): only for a token whose API facts say `create_via: "insert"` * (`drill_describe(...).api.create_via` — task and project), as one insert AS THE PERSON in * `organization_id` (default: this client's organization); the answer carries `created: true` * and the new `id`. Every other token refuses in its own words. */ record_id: Uuid | null; /** A change by id: only to say which organization the row must belong to. A new row: where it goes. */ organization_id?: Uuid | null; custom?: Record; columns?: Record; expected_version?: number | null; archive?: boolean | null; }): Promise>; /** Rows of that standard table with this custom value. Refuses a field nobody declared. */ entityRecordsFind(args: { token: string; key: string; value?: unknown; limit?: number; offset?: number; }): Promise>; /** The kernel Tables a caller writes a Home, a Field or a Rule into. */ personKernelId(): Promise>; fieldKernelId(): Promise>; ruleKernelId(): Promise>; /** Every record the Rule says is a member. A saved view's list is this, not a filter a screen ran. */ /** PRODUCTS row 7 — the whole board: its stage column, its stages in the declared * order, and every Rule WITH the sentence it says when it refuses. */ pipelineRead(args: { table_id: Uuid; }): Promise>; /** The store's own count and total per column, over what this person may see. */ pipelineBoard(args: { table_id: Uuid; measure?: string | null; /** * S2-PRIME — the view's question, either shape (`StoreFilter`). Given, the headings count and * total exactly the cards the same filter puts on the board (`custom.pipeline_board`'s * four-argument door); left out, the whole table this person may see, as before. */ filter?: StoreFilter | null; }): Promise>; /** Whether this card may go to that column — asked BEFORE the finger lets go. */ pipelineTransitionRefusal(args: { record_id: Uuid; to: string; }): Promise>; /** * Move a record to a stage. An ORDINARY record write, judged by the same Rules. * * It answers an OBJECT on every path. A gate whose `on_fail` is `require_approval` * comes back `applied: false` with the wait it filed — the record has NOT moved, and a * screen that treated the call's success as the move's success would show the card in * the wrong column while somebody is still deciding. */ pipelineMove(args: { record_id: Uuid; to: string; also?: Record; expected_version?: number | null; }): Promise>; /** * MOVE MANY CARDS IN ONE CALL (lane S4, `custom.pipeline_move_many`). Each card is judged by * `pipeline_move` exactly as one is, in its own savepoint: a refused card writes nothing and the * others still land. `expected_version` is required per card — a card that changed since the * board loaded answers `changed_since_loaded` and is never overwritten. A refusal of the WHOLE * call (a stranger, an empty batch, more than the `custom/batch_items_max` knob) is the error. */ pipelineMoveMany(args: { moves: PipelineMoveManyItem[]; }): Promise>; /** Declare (or re-state) a pipeline: the stage column and its transition Rules. */ pipelineDeclare(args: { table_id: Uuid; spec: PipelineSpec; }): Promise>; /** Which column of this table holds its stage, or null when it is not a board. */ tableStageField(args: { table_id: Uuid; }): Promise>; /** The closed list of what a gate does when it says no — the store is the authority. */ stageRuleOnFailKinds(): Promise>; /** Whether this organization's gates refuse or warn. One opinion, asked once. */ stageRuleEnforcement(): Promise>; /** What is waiting on this card: approvals filed against its own stage column. */ recordStagePending(args: { record_id: Uuid; }): Promise>; /** The same question for a whole board, in ONE call — what a Kanban badges cards from. */ pipelinePending(args: { table_id: Uuid; }): Promise>; /** * WHAT THIS GATE WOULD DO TO THIS BOARD TODAY — for a gate that has not been saved. * * The settings screen calls it on every edit of the condition, which is why it takes * the gate rather than a rule id: no saved-rule door can answer about a rule that does * not exist yet. The store compiles it with the same compiler `pipelineDeclare` uses, * so the number here and the refusal at the door are the same rule — a preview with its * own compiler would be wrong exactly at the edge of the condition, which is the only * place anybody looks. * * A gate that does not say what it demands is REFUSED, not answered zero: "no cards * would be stopped" beside a half-written rule is the sentence that gets it saved. */ pipelineGatePreview(args: { table_id: Uuid; stage: string; gate: PipelineGate | Record; }): Promise>; /** * SERVER LANE ONLY. `custom.rule_members` walks the whole scope table through the evaluator and * returns STORED rows — no read-access ladder, no masking — so no browser role holds EXECUTE on it * and it answers 42501 from a signed-in seat. A screen reads a Rule's members through * `ruleMembersVisible`. */ ruleMembers(args: { rule_id: Uuid; }): Promise>; /** * S2-PRIME — THE MEMBERS OF A MEMBERSHIP RULE THIS PERSON MAY SEE, a page at a time * (`custom.rule_members_visible`): the list door asked the Rule's own test, so the rows are the * read door's — the same ladder, masked documents, the same page ceiling. */ ruleMembersVisible(args: { rule_id: Uuid; limit?: number; offset?: number; }): Promise>; /** Is this one record a member, and WHY — the store's own answer. */ ruleMembership(args: { rule_id: Uuid; record_id: Uuid; }): Promise>; /** Run a stored Rule against a document. */ ruleRun(args: { rule_id: Uuid; values: Record; context?: Record; }): Promise>; /** Evaluate a Rule expression that has not been stored — the conditional logic a form runner asks about. */ ruleEval(args: { expr: unknown; values: Record; context?: Record; }): Promise>; /** * Write ONE Rule as a real Rule. `recordWrite` into the Rule kernel makes a * valid Rule document that carries `data_class = 'record'`, and every reader * that looks for a Rule looks for the class — `custom.agg_subscriptions` * selects `where data_class = 'rule'` — so a subscription written that way * fires at nobody. This is the door that closes it. */ /** This organization's forms, with how many answers arrived and how many are in the table. */ forms(args?: { table_id?: Uuid | null; }): Promise>; /** * THIS ORGANIZATION'S BOOKING PAGES (PRODUCTS row 14), with the numbers that make * the list worth opening: how many are booked, canceled, still ahead, and how many * slots somebody is holding right now. A booking page is an `anon_form`, so it is * opened and closed with `anonPublish` exactly as a form is. */ bookings(args?: { table_id?: Uuid | null; }): Promise>; /** * CREATE OR RE-STATE ONE BOOKING PAGE over one Table. `admin` on the Table, * because a booking page decides what a stranger may write into it and which * hours of the organization's week are on offer. * * `slot`, `status` and `booked_with` are the store's to fill in: a question * naming any of the three is refused BY NAME, so a page cannot be built that * lets a visitor choose their own status. It does NOT publish — `anonPublish` * is the one act that opens a public surface, for a booking page exactly as * for a form. * * Until 2026-09-21 this door had no client method, so the ONLY way to a * booking page was to ask an agent for one. The agent path is the faster one, * never the only one. */ bookingDeclare(args: { table_id: Uuid; title: string; questions: unknown[]; availability?: Partial | null; presentation?: Record | null; submission_cap?: number | null; quarantine_rule_id?: Uuid | null; notify_rule_id?: Uuid | null; form_id?: Uuid | null; slug?: string | null; home_id?: Uuid | null; }): Promise>; /** Create or re-state one form. A question naming no Field of that Table is refused BY NAME. */ formDeclare(args: { table_id: Uuid; title: string; questions: unknown[]; presentation?: Record | null; submission_cap?: number | null; quarantine_rule_id?: Uuid | null; notify_rule_id?: Uuid | null; form_id?: Uuid | null; slug?: string | null; }): Promise>; /** * WHICH OF A FORM'S QUESTIONS ARE ASKED, given the answers so far — for the OWNER's preview of * a draft (`custom.form_preview_asks`). One row per question in order; `asked` is false only * when the store's own Rule said so. Undecided and unworkable conditions are asked, the second * with the store's sentence in `said`. */ formPreviewAsks(args: { table_id: Uuid; questions: unknown[]; values: Record; }): Promise>>; /** * WHAT A FORM'S LOOK MAY BE, AND WHAT IT WOULD LOOK LIKE (`custom.form_look_options`): the * organization's public pictures (the same list a portal's look offers), the colors, and the * look a stranger would see for the draft `presentation` — the builder's preview draws that. */ formLookOptions(args?: { presentation?: Record | null; }): Promise>; /** * THE ROUTE THROUGH A DRAFT FORM (`custom.form_preview_route`, lane TYPEFORM-DUP): which questions * are asked given the answers so far (showIf AND logic jumps), the ending reached and the score — * the store's walk, the one the stranger's page and `custom.form_submit` read too. */ formPreviewRoute(args: { table_id: Uuid; questions: unknown[]; endings?: unknown[] | null; values: Record; }): Promise>; /** A form's results (`custom.form_results`): views, starts, completions, drop-off, answers. */ formResults(args: { form_id: Uuid; }): Promise>; /** TYPEFORM-2: the organization's form knobs (`custom.form_knobs`): owner header, choice auto-advance. */ formKnobs(): Promise>; /** * CD-PAGE-08: a public form's password (`custom.form_set_password`). A string of 4 to 128 characters sets it, * `""` clears it, `null` changes nothing; every call answers whether the form has one now. */ formSetPassword(args: { form_id: Uuid; password: string | null; }): Promise>; /** * What the store makes of a file's columns, before anything is written. * `columns` is `[{header, samples}]` — the first page of the file is plenty. */ importPlan(args: { table_id: Uuid; columns: Array<{ header: string; samples: unknown[]; }>; }): Promise>; /** * Open a run. `file_hash` is the run's IDENTITY: the same bytes into the same * table a second time answer the FIRST run with `already: true` and write * nothing, so a re-import doubles nothing. `force` re-opens deliberately. */ importBegin(args: { table_id: Uuid; format?: "csv" | "xlsx"; source_name?: string | null; source_columns?: unknown[]; file_hash?: string | null; policy?: ImportPolicy; /** A Field key. A row whose value for it is already here is a duplicate. */ dedupe_key?: string | null; file_bytes?: number | null; force?: boolean; }): Promise>; /** * IMPORT-2. ADD THE COLUMNS THIS FILE HAS AND THIS TABLE HAS NOT — a step of * its own, BEFORE the run is opened, so the screen can show "8 columns added" * and the person can then name one of them as the file's duplicate key * (`importBegin` refuses a key naming a column that does not exist yet). * Answers the mapping the file should be sent with. Admin on the Table. */ importDeclareColumns(args: { table_id: Uuid; rows: Array>; /** Header -> Field key the person already mapped by hand; never declared. */ mapping?: Record; }): Promise>; /** * One BATCH of rows. The batch is PLANNED and then written as ONE statement * through the batched write door, so 250 round trips became one; a batch a * guard refuses falls back to one write a row, and the answer says which it * was. Send `ImportOpened.rows_per_call` the first time and * `ImportBatchResult.rows_per_call` — measured — every time after that. */ importRows(args: { import_id: Uuid; rows: Array>; /** Header -> Field key. A header that already spells a key needs no entry. */ mapping?: Record; }): Promise>; /** * Close the run and decide the columns the file had and the table did not: * `propose` (the ONE approvals inbox, and the only choice a non-admin has), * `create` (an admin adds them outright) or `ignore`. */ importFinish(args: { import_id: Uuid; unmapped?: "propose" | "create" | "ignore"; }): Promise>; /** The refused rows, or the ones already here, WITH the source row on each. */ importReport(args: { import_id: Uuid; state?: "refused" | "duplicate"; limit?: number; offset?: number; }): Promise>; /** This organization's import runs, newest first. How you find yesterday's. */ imports(args?: { table_id?: Uuid | null; limit?: number; }): Promise>; /** * Forget the RECEIPT for a file so the same bytes can be imported again * deliberately. Never touches the records that import wrote. */ importForget(args: { import_id: Uuid; }): Promise>; /** * Give a table its own address. The answer carries `mail_route`: the one * sentence saying what has to exist in DNS before anything arrives. Show it * wherever the address is shown — an address that silently swallows mail is * the failure this whole door is against. */ inboundDeclare(args: { table_id: Uuid; label?: string | null; }): Promise>; inboundAddresses(args?: { table_id?: Uuid | null; }): Promise>; inboundSet(args: { inbound_id: Uuid; enabled: boolean; }): Promise>; /** Every portal over this organization the caller may know about, with its numbers. */ portals(): Promise>; /** * The SAME list, archive-aware. `custom.portals` keeps its signature and hides * archived portals, because the archived-items law's default is to hide; * this is the one door that also answers the other lane, so a rail gets the * law's one-click reveal without inventing a second control or a second door. * A fourth word is refused `22023` — there is no fourth answer on any surface. */ listPortals(args?: { archived?: PortalArchiveFilter; }): Promise>; /** * PUT ONE PORTAL AWAY. Nothing is deleted and there is no purge: every Table * it exposes and every person invited to it is kept exactly as it is, and * `portalRestore` hands it all back. `confirm_title` is the portal's own title * typed back — ten portals can carry one title, so the title is not what picks * this one and the door refuses `23514` when it does not match. */ portalArchive(args: { portal_id: Uuid; confirm_title: string; reason?: string | null; }): Promise>; /** The way back. Everyone invited signs in exactly as before, and it shows the same Tables. */ portalRestore(args: { portal_id: Uuid; confirm_title: string; }): Promise>; /** * PUT ONE FORM OR BOOKING PAGE AWAY (`custom.form_archive`, admin on its table). Its address stops * answering; everything it collected is kept. `formRestore` brings it back. */ formArchive(args: { form_id: Uuid; }): Promise>; formRestore(args: { form_id: Uuid; }): Promise>; /** The archived forms and booking pages, newest first; `table_id` narrows to one table. */ formsArchived(args?: { table_id?: Uuid | null; limit?: number; }): Promise>; /** * The archived checklist templates. A template is a record: `recordDelete` archives it and * `recordRestore` brings it back. */ checklistTemplatesArchived(args?: { about_table_id?: Uuid | null; limit?: number; }): Promise>; /** * How a table names its records: the row-label FORMULA it keeps (`{First} & " " & {Last}`), the title * column it falls back to, which is in force, and whether the caller may change it. Writes nothing. */ tableRowLabel(args: { table_id: Uuid; }): Promise>; /** * Set the table's row-label formula, or clear it (null / blank). The store parses it against the table's * own columns and refuses an unknown column in a sentence, writing nothing. Answers the new state. */ tableRowLabelSet(args: { table_id: Uuid; formula: string | null; }): Promise>; /** What a table's NEW rows start with (Shown to, and the web half once it lands). */ tableRowDefaults(args: { table_id: Uuid; }): Promise>; /** Set them (the table's maker or an admin of it). A key left out is left alone; null = the default. */ tableRowDefaultsSet(args: { table_id: Uuid; defaults: TableRowDefaultsPatch; }): Promise>; /** * ONE PASS of "apply to existing rows": rows nobody set by hand follow the table's defaults. * `done: false` → call again with `after: next_after`. `rowDefaultsApplyAll` walks every pass. */ tableRowDefaultsApply(args: { table_id: Uuid; after?: Uuid | null; }): Promise>; /** Every pass of `tableRowDefaultsApply`, summed; the last pass's sentence when it took one pass. */ rowDefaultsApplyAll(args: { table_id: Uuid; maxPasses?: number; }): Promise>; /** One row's Shown to (and web half), with who may change it. */ recordRowControls(args: { record_id: Uuid; }): Promise>; recordRowControlsSet(args: { record_id: Uuid; controls: { shown_to?: string | null; published_to_web?: boolean; indexed?: boolean | null; }; }): Promise>; /** * Which Tables each portal of this organization exposes. * * The one question a TABLE-scoped Portals rail has to ask: "is the table I * am standing on in any portal?" Same wall and same read-access gate as * `portals`, so a pair here is always a portal `portals` also returned. */ portalTables(): Promise>; /** ONE portal in full: what it shows, and who it was opened to. */ portalCard(args: { portal_id: Uuid; }): Promise>; /** * Create or RE-STATE one portal. Re-stating REPLACES what it exposes — a * Table left out of `tables` stops being exposed in the same act — and leaves * the people alone: who is invited is not part of what the portal shows. */ portalDeclare(args: { title: string; client_table_id: Uuid; tables: Array<{ table_id: Uuid; names_via: string; visible_fields?: string[]; editable_fields?: string[]; comments?: boolean; }>; portal_id?: Uuid | null; slug?: string | null; sign_in_method?: string | null; /** * S6 — the portal's own look and its forms. A key given REPLACES that key; a key not given * is KEPT (leave `config` out and both stay exactly as they are). The store judges it and * refuses by name: a logo that is not a public picture of this organization's Files, an * accent that is not a design-system color name, a form whose Table the portal does not show. */ config?: PortalConfigInput | null; }): Promise>; /** * S6 — THE CLIENT'S SIDE: one form of HER portal (`custom.portal_form`). Refused unless the * caller is a live principal of that live portal and the form is on its list; the Field that * names the client is never one of the questions — the portal fills it. */ portalForm(args: { portal_id: Uuid; form_id: Uuid; }): Promise>; /** * S6 — send one form of her portal (`custom.portal_form_submit`). The store fills the Field * that names the client with her own record, and the answer reaches her own list at once * (`accepted`) or waits for the office (`held`, with the store's sentence). `client_key` * makes a retry the same submission. */ portalFormSubmit(args: { portal_id: Uuid; form_id: Uuid; answers: Record; client_key?: string | null; }): Promise>; /** * Invite one person, as one record of the portal's client Table. * * `user_id` is deliberately NOT a parameter here. From a screen it is always * null: an invitation confers NOTHING until the person follows their sign-in * link and the platform gives them an identity, and the door's own `say` * sentence states exactly that. A screen that passed an id would be granting * access on somebody else's behalf. */ portalInvite(args: { portal_id: Uuid; client_record_id: Uuid; email: string; }): Promise>; /** Take one person's way in away. The answer's `say` names the consequence. */ portalRevoke(args: { portal_id: Uuid; principal_id: Uuid; }): Promise>; /** * VIEW AS THIS CLIENT. The door asks `custom.visible_set` for HER user id — * the same call `custom.read_records` makes when she opens the page — so this * cannot disagree with what she sees. It REFUSES with `02000` and a sentence * when she has not signed in yet; show the sentence, never an empty list. */ portalPreview(args: { portal_id: Uuid; principal_id: Uuid; table_id: Uuid; }): Promise>; /** This organization's dashboards, optionally only those whose subject is one Table. */ dashboards(args?: { table_id?: Uuid | null; }): Promise>; /** * AT-INTERFACE — one Interface as this viewer may see it (no organization needed: a share of the * interface record is the way in). `null` = not there, archived, or not shared with her. */ interfaceRead(args: { interface_id: Uuid; }): Promise>; /** The rows one PUBLISHED element of an Interface exposes (a builder may name a draft one). */ interfaceRows(args: { interface_id: Uuid; element_id: string; record_id?: Uuid | null; limit?: number; offset?: number; }): Promise>; /** * AT-FIX-G1b — one PUBLISHED chart of an Interface as its reader may see it, in the shape one block of * `dashboardRun` answers (the same chart draws from it). The groups and measures are worked out by the store * over the rows her interface access shows and only through the columns the interface door exposes; a chart * that reads any other column answers `refused` (naming none). `null` = not there, archived, or not shared with her. */ interfaceChart(args: { interface_id: Uuid; chart_id: string; }): Promise>; /** * Create or re-state one dashboard. Every block is judged on the way IN — * a block naming a field this Table does not have is refused BY NAME, with * the table's own field list in the hint — so a canvas cannot be saved broken. */ dashboardDeclare(args: { table_id: Uuid; name: string; blocks?: DashboardBlock[]; presentation?: Record | null; dashboard_id?: Uuid | null; }): Promise>; /** * Run every block and answer the numbers. `filter` is the ONE filter bar * across the canvas: it is merged UNDER each block's own filter, so a block * deliberately scoped to one stage stays scoped while the bar moves the rest. * A block that refuses carries the store's sentence and the others still answer. */ dashboardRun(args: { dashboard_id: Uuid; filter?: RecordFilter; /** * S3 — compare every block that does not carry its own comparison (the * block's own wins, as its own filter does). A block with no date to * compare along answers alone and says so in `compare_refused`. */ compare?: AggregateCompare | null; /** S3 — re-cut every bucketed block to one date grain (the canvas's picker). */ grain?: AggregateBucket | null; }): Promise>; /** The seventh block kind on its own: records that have sat on the same value too long. */ dashboardStuck(args: { table_id: Uuid; state_key: string; days?: number; filter?: RecordFilter; limit?: number; }): Promise>; /** * Declare or re-state a crew capture sheet over a Table. Admin on the Table. * Closed to the crew until `capturePublish`, like every publishing act here. */ captureSheetDeclare(args: { table_id: Uuid; title: string; questions: Array>; presentation?: Record | null; sheet_id?: Uuid | null; notify_rule_id?: Uuid | null; }): Promise>; /** Open the sheet to the crew, or close it. Admin on the Table. */ capturePublish(args: { sheet_id: Uuid; open?: boolean; }): Promise>; /** The crew sheets of this organization, with what has come in through each. */ captureSheets(args?: { table_id?: Uuid | null; }): Promise>; /** * Everything a phone needs to run one sheet OFFLINE — the questions, the Fields * with their ids and parity types, and an honest `may_capture` with a sentence. * Load it once on a signal; it is the last network call before the walk. */ captureOpen(args: { sheet_id: Uuid; }): Promise>; /** * One capture: the answers, the file references, the device, the moment the phone * took it and the place. Idempotent on `client_key`, which the PHONE mints when * the capture is taken, offline, before its first attempt — send the same key on * every retry and the answer comes back `replay: true` with the first record's id. */ captureSubmit(args: { sheet_id: Uuid; client_key: string; answers: Record; files?: CaptureFileRef[]; device?: string | null; captured_at?: string | null; location?: Record | null; }): Promise>; /** Every agent-owned column, with how many cells are filled, stale or pinned, and what it has cost. */ enrichments(args?: { table_id?: Uuid | null; }): Promise>; /** * Define, change or TURN ON an Enrichment on one Field. Admin on the Table. * `{enabled: true}` on its own turns an existing one on without resetting it — * and turning it on is what authorises every value it writes afterwards. */ enrichDeclare(args: { field_id: Uuid; spec: Record; }): Promise>; /** * The rows that need this column filled in, each with what the instruction may * read. A cell somebody pinned is never returned. This is what a PREVIEW shows * before anybody enables anything. */ enrichDue(args: { field_id: Uuid; limit?: number; include_fresh?: boolean; }): Promise>; /** * THE BADGE DATA FOR A WHOLE PAGE, in one call. Who wrote each value, when, out * of what source, its candidates, whether a person pinned it and whether it is * past its freshness date. Asked per cell this would be one round trip per badge. */ enrichCells(args: { table_id: Uuid; field_keys?: string[] | null; record_ids?: Uuid[] | null; }): Promise>; /** Hold one cell against the model that fills its column, or hand it back. */ enrichPin(args: { record_id: Uuid; field_key: string; pinned?: boolean; }): Promise>; /** What this column has cost, run by run. */ enrichRuns(args?: { field_id?: Uuid | null; limit?: number; }): Promise>; /** Take a dashboard away. The records it counted are untouched — a canvas owns nothing. */ dashboardDelete(args: { dashboard_id: Uuid; }): Promise>; /** * Group, bucket, filter and measure INSIDE `custom.record_aggregate`. The * aggregate node sits above the read-access join, so what a chart draws is * exactly what this person may see — the rest is never fetched, let alone * summed and then hidden. */ recordAggregate(args: { table_id: Uuid; /** * OPTIONAL FILTER (active-org law): with `config.organizationIds` set, the table is looked * up across all the person's organizations and the aggregate runs in the one that OWNS it * (each row then carries that `organization_id`); this narrows the lookup to one. Absent and * no `organizationIds` ⇒ this client's own organization, exactly as before. */ organization_id?: Uuid | null; /** Field keys whose values become the groups. */ groupBy?: string[]; /** `count` needs no key; every other operation reads one Field. */ measures?: AggregateMeasure[]; /** A date Field truncated to a period — a group whose expression is a date_trunc. */ bucket?: { key: string; by: AggregateBucket; } | null; /** * A scalar is an equality and an object is a half-open moment window, and * either way it lands in the SAME WHERE as read access. */ filter?: StoreFilter; limit?: number; /** * S3 — answer the same question over a prior window too (previous period, * same period last year, or a fixed baseline). Each row then carries * `prior_measures`, `delta` and the two `compare` windows. Buckets are cut * in the organization's calendar (knobs `custom/time_zone`, `custom/week_start`). */ compare?: AggregateCompare | null; /** * The grid's search, narrowing the answer to the rows `listPage`'s search would show (the * same predicate, `custom.record_search_sql`). Blank or absent: nothing changes. */ search?: string | null; /** The reader's time zone for the search's date matches (absent = the organization's calendar). */ time_zone?: string | null; /** * A CHART counts each part of a many-value column under its own group (a row tagged A and B counts once under A and once * under B; a multi-link counts per linked record id); a grid group-by (absent / false) keeps the exact combination. */ splitMulti?: boolean; }): Promise>; /** Historical aggregate computed by the store at its recorded-time read door. */ recordAggregateAsOf(args: { table_id: Uuid; recorded_at: string; measure?: string; field_key?: string | null; group_by?: string | null; match?: Record; }): Promise>>; /** The measures the store itself offers. Asked, never hardcoded in a picker. */ aggOperations(): Promise>; /** The periods the store itself buckets by. */ aggBuckets(): Promise>; /** * The organization's calendar (knobs `custom/time_zone`, `custom/week_start`), cut by the SAME door the * relative date filters and the chart buckets use. A calendar or timeline reads its first day of the week * from here, never from a constant of its own (lane NOTION-SMALL-4). */ aggCalendar(): Promise>; /** * A source's drill definition — its Dimensions, Measures, drill paths and first screen. * `{kind: "table", id}` is a custom Table; `{kind: "entity", token}` a standard table by its * registry token or a declared definition by its key. */ drillDescribe(args: { source: DrillSource; }): Promise>; /** * Ask a source a question: grouped, bucketed (day…year in the organization's calendar), * compared, pivoted. A standard table is counted AS THE PERSON (its own row security decides * every row); groups past the cap fold into one Other row and the total row says so. */ drillAsk(args: { source: DrillSource; question?: DrillQuestion; }): Promise>; /** The records behind a number, through the same filter, read as the person. */ drillRows(args: { source: DrillSource; where?: DrillQuestion["where"]; window?: DrillQuestion["window"]; sort?: DrillQuestion["sort"]; lane?: DrillQuestion["lane"]; columns?: string[]; limit?: number; offset?: number; /** The viewer's search term, asked of the door (`platform._drill_compile` reads `question.search`). */ search?: string; }): Promise>; /** * Every subscription in this organization, optionally narrowed to one saved * view or one cadence. There is no subscription table: each one is a Rule * record carrying a `subscription` block, so a subscription is readable, * historied and agent-writable like anything else. */ aggSubscriptions(args?: { saved_view_id?: Uuid | null; cadence?: string | null; }): Promise>; /** The cadences the store itself offers. Asked, never hardcoded in a picker. */ aggSubscriptionCadences(): Promise>; /** * The same cadences, through the door a PERSON may call. * `aggSubscriptionCadences` is the notifier's own and holds no client grant, * so a screen that asked for it was refused and fell back to a list typed * into the picker — which drifts from what the digest runner honors. This * one delegates to the same array, so there is exactly one list. */ subscriptionCadences(): Promise>; /** * WHAT THIS PERSON IS BEING TOLD ABOUT, and what they may switch off. * * Mine, plus anyone's over a Table I hold admin on — narrowed to Tables I can * already open, so the list never reveals one. `aggSubscriptions` above is the * NOTIFIER's reader and no client can call it; this is the owner's. */ subscriptions(args?: { table_id?: Uuid | null; }): Promise>; /** * Switch one on or off. Muting is honored in ONE place — the reader every * consumer goes through — so a screen can never say a subscription is off * while it keeps firing. */ subscriptionMute(args: { rule_id: Uuid; muted: boolean; }): Promise>; /** * WRITE ONE. The store refuses a cadence no runner acts on, a channel this * platform does not send on and quiet hours nobody can parse — by name — then * declares the Rule through `rule_declare`, because a Rule written as a record * carries `data_class = 'record'` and every reader that goes looking for a Rule * steps straight past it (REC-72). */ subscriptionDeclare(args: { table_id: Uuid; spec: SubscriptionSpec; }): Promise>; /** * SHOW ME ONE NOW. The summary this subscription would send at this moment, with * what entered, left and changed NAMED. It assembles only: nothing is delivered, * nothing is recorded and the watermark does not move. */ subscriptionPreview(args: { rule_id: Uuid; }): Promise>; /** * THE SAVED VIEWS OF A TABLE — what a subscription may be written over. Narrowed * in SQL as the definer to Tables this caller can already open, so the list can * never reveal a Table. */ views(args?: { table_id?: Uuid | null; }): Promise>; /** * SAVE ONE VIEW. VIEWER on the Table, not editor: writing down a question about a * Table is not changing it, and requiring editor would mean the people who read a * Table could not subscribe to anything in it. */ viewDeclare(args: { table_id: Uuid; spec: SavedViewSpecIn; }): Promise>; /** A Table's row templates ("New from template"). VIEWER on the Table. */ rowTemplates(args: { table_id: Uuid; }): Promise>; /** * SAVE ONE ROW TEMPLATE — `{name, values}` by Field key; the same name again changes it, and * `{template_id, archived: true}` archives it. EDITOR on the Table: it is how everyone's new rows start. */ rowTemplateDeclare(args: { table_id: Uuid; spec: { name?: string; values?: Record; template_id?: Uuid; archived?: boolean; }; }): Promise>; /** * DESIGNATE HOW A TABLE OPENS — "Make this the default". EDITOR on the Table: the named view * becomes the table's only default and, when `layout` is given, that is the layout everyone opens * it in. A layout press never designates (`viewDeclare` refuses the default view's layout and * is_default by name — VIEW-SWITCH-NOT-DESIGNATION, VERIFIER-21). */ viewDesignate(args: { table_id: Uuid; view_id: Uuid; layout?: string | null; }): Promise>; /** * ARCHIVE ONE SAVED VIEW (lane TABLE-ACTIONS, T3.5). The soft delete of the `platform.saved_view` * row behind it — `platform.saved_view_archive('custom/records', id)`, which asks its own ladder * (the view's creator, or admin on the view) and clears a default it held. The records are * untouched. `null` when the view was already gone. `viewRestore` (or Trash) brings it back. */ viewArchive(args: { view_id: Uuid; }): Promise | null>>; /** PUT AN ARCHIVED VIEW BACK — the platform's one restore door, `platform.entity_undelete('platform_saved_view', id)`. */ viewRestore(args: { view_id: Uuid; }): Promise>; /** * THE CALLER'S OWN LOOK AT EACH SAVED VIEW OF A TABLE — `{ "": { look, updated_at } }`. * A look is the view settings one person chose while looking (a board's grouping, a calendar's * date field, a sort, a filter, hidden columns, widths, the layout), kept for her alone until an * editor saves it onto the view with `viewDeclare` ("Save to view"). Viewer on the Table. */ viewLookRead(args: { table_id: Uuid; }): Promise; updated_at: string; }>>>; /** * KEEP THE CALLER'S OWN LOOK AT ONE VIEW — the whole look, as definition keys (`group_field`, * `date_field`, `sorts`, `where`, `presentation`, `layout`, …; a key set to null hides the view's * own). `look: null` is "Reset to view". The shared view row is never written. Answers the look * as kept (null after a reset). */ viewLookSet(args: { table_id: Uuid; view_id: Uuid; look: Record | null; }): Promise | null>>; docTemplateSave(args: { table_id: Uuid; name: string; body: string; template_id?: Uuid | null; }): Promise>; /** The body with every token resolved against one record. Read-only, no render row. */ docRenderBody(args: { template_id: Uuid; record_id: Uuid; }): Promise>; /** Write the render — frozen bytes a signature can be checked against. */ docRenderDocument(args: { template_id: Uuid; record_id: Uuid; }): Promise>; /** Every token in a body, in order, with the Field id each one points at. */ docTokens(args: { body: string; }): Promise>; /** The tokens this Table cannot answer, each with the store's own reason. */ docUnresolvedTokens(args: { table_id: Uuid; body: string; }): Promise>; docSign(args: { render_id: Uuid; field_key: string; signer_name: string; signer_user_id?: Uuid | null; }): Promise>; /** * One signature: the seal AND whether what was signed is still what is there. * The store answers both, in one call, never the screen. Viewer on the record. */ docSignatureRead(args: { signature_id: Uuid; }): Promise>; /** Every template that renders one Table. Viewer on the Table. */ docTemplates(args: { table_id: Uuid; }): Promise>; /** * Retire one template. EDITOR on the Table it renders, because a template is * that Table's wording. Documents already rendered keep their frozen bytes * and their seals, so this can never invalidate a signature. */ docTemplateDelete(args: { template_id: Uuid; }): Promise>; /** Bring back a removed template (the undo of docTemplateDelete, same rung). */ docTemplateRestore(args: { template_id: Uuid; }): Promise>; /** * Remove one saved document (soft). EDITOR on its record. Its bytes, hash and * any signature stay exactly as they were; docRenderRestore brings it back. */ docRenderDelete(args: { render_id: Uuid; }): Promise>; /** The undo of docRenderDelete, same rung. */ docRenderRestore(args: { render_id: Uuid; }): Promise>; /** Every frozen render of one record, newest first. Viewer on the record. */ docRenders(args: { record_id: Uuid; }): Promise>; /** Every signature on one record. Viewer on the record. */ docSignatures(args: { record_id: Uuid; }): Promise>; /** * DOOR-11. One record's revisions, newest first. The read door answers * documents and deliberately not versions, so a screen that wants to save * optimistically reads the version of the record it LOADED from here — for * the one record being edited, never for a list. */ revisions(args: { record_id: Uuid; }): Promise>; /** * PRODUCTS row 4. One record's version list, newest first: who (a person, or * an agent AND the person it acted for), when, the operation in the word * somebody used, and every field that moved with its before, its after, the * Rule version that produced a derived value and its source pointer. Viewer * on the record — reading how something got to be the way it is is reading. */ recordHistory(args: { record_id: Uuid; limit?: number; offset?: number; }): Promise>; /** * AGT-N-9 — EVERYTHING A CHAT OPENED ON THIS RECORD MAY KNOW, IN ONE ROUND TRIP. * * The Fields with their `(record, field, value version)` triples, the relations one hop * out, the history, the comments and the Table's other records — assembled INSIDE the * database, every piece through the read door, under this person's own field-level * security. A Field the store masks comes back in `withheld` with the store's own * sentence and no value; a Field the organization keeps out of conversations comes back * there too, saying which of the two it is. */ recordScopeContext(args: { record_id: Uuid; relations?: number; history?: number; siblings?: number; }): Promise>; /** What is this conversation about? */ conversationScope(args: { conversation_id: Uuid; }): Promise>; /** Point a conversation at one record. Refused unless this person may open it. */ conversationScopeBind(args: { conversation_id: Uuid; record_id: Uuid; }): Promise>; /** This conversation is no longer about a particular record. */ conversationScopeUnbind(args: { conversation_id: Uuid; }): Promise>; /** The binding AND the context of a bound conversation, in one round trip. */ conversationScopeContext(args: { conversation_id: Uuid; relations?: number; history?: number; siblings?: number; }): Promise>; /** * "Who changed the price on ANY record?" One column's history across a whole * Table, narrowed to the records this person may see by a predicate in the * same statement. A column that names no Field is refused BY NAME, never * answered empty. */ fieldHistory(args: { table_id: Uuid; field_key: string; limit?: number; offset?: number; record_id?: Uuid; }): Promise>; /** * A FORMULA, ROLLUP OR LOOKUP COLUMN'S HISTORY ON ONE RECORD (CD-FORMULA-08). Its answer at every moment it changed, * worked out from the values and the formula as they were, with the formula version that produced it. A column * people type into is refused by name (its history is `fieldHistory`). */ formulaHistory(args: { record_id: Uuid; field_key: string; limit?: number; }): Promise>; /** * WHAT A RESTORE WOULD CHANGE, BEFORE IT DOES. Editor on the record: this is * the first half of an act, and somebody who may not perform it is not shown * its preview. Pass `field_key` for one column. */ restorePreview(args: { record_id: Uuid; version: number; field_key?: string; }): Promise>; /** Put the whole record back to a version, as a NEW version. Editor. */ restoreVersion(args: { record_id: Uuid; version: number; }): Promise>; /** Put ONE column back to what it said at a version, as a NEW version (HIS-N-2). Editor. */ valueRestore(args: { record_id: Uuid; field_key: string; version: number; }): Promise>; /** * SCR-18. The record's comment thread with everybody named, plus what THIS * person may do in it — decided by the store, in the same call, so a screen * never draws a composer the write door will refuse. */ commentThread(args: { record_id: Uuid; include_resolved?: boolean; }): Promise>; /** * How many OPEN comments each named row has (up to 500 rows; rows with none are absent), read * through the same reader as the thread — one call for a whole card of rows. */ commentCounts(args: { record_ids: readonly Uuid[]; }): Promise>>; /** * Write a comment at the `commenter` rung, optionally naming people. A * mention is a reference and not a regex over the body: the ids come from the * picker and the store refuses one who is not in the organization, or who * cannot open the record — because that notification would be a dead end. */ commentWrite(args: { record_id: Uuid; body: string; field_key?: string; parent_comment_id?: Uuid; mentions?: Uuid[]; }): Promise>; /** Resolve (or re-open) a thread. `commenter` — resolution is not a delete. */ commentResolve(args: { comment_id: Uuid; resolved?: boolean; }): Promise>; /** * Follow ONE record (AT-FIX-G2; Airtable's "follow a record"). While followed, a change or a comment by SOMEBODY ELSE * puts a notice in this person's bell, written in the same transaction as the change; the notice opens the record. * `follow: false` stops it. Anybody who may read the record may follow it; the row is always the caller's own. */ recordFollowSet(args: { record_id: Uuid; follow?: boolean; }): Promise>; /** Who follows this record, and whether this person does. Empty for somebody who cannot open the record. */ recordFollowers(args: { record_id: Uuid; }): Promise>; /** * Every value of one record WITH its envelope — its own version, who wrote * it, who they were acting for and when. The timeline IS the record (REC-19); * there is no second history table. */ recordValuesVersioned(args: { record_id: Uuid; organization_id?: Uuid | null; }): Promise>; /** * Metadata search across EVERY organization the person belongs to (`config.organizationIds`; * `organization_id` narrows to one): the Tables and Fields whose name, key, label or description * holds `text` (case-insensitive; structure, never rows). Each match is `{id, kind: "table" | * "field", name, description, organization_id}` (a Field adds `key`, `table_id`, `field_type`). * An organization whose read door refuses is listed in `unavailable` WITH its reason and * never hides the rest. Only when NO organization answers is the whole search a failure (the * first refusal). */ metadataSearch(args: { text: string; organization_id?: Uuid | null; }): Promise>; /** * WHICH of the person's organizations can this client use right now? Asks every organization * in scope (`organization_id` narrows to one) whether its record store is open, so a host can * say "organization X is unavailable: " instead of silently dropping it. Organization * order is the person's own, never completion order. */ organizationsOpen(args?: { organization_id?: Uuid | null; }): Promise>; /** * The organization that OWNS a table or record — the one a write to it must run in. A * `table_id` is looked up across all the person's organizations; a `record_id` is opened in its * own. `null` = found in none of them. Never a permission: the store's doors still decide. */ ownerOrganization(args: { table_id?: Uuid | null; record_id?: Uuid | null; organization_id?: Uuid | null; }): Promise>; /** * Mint an embed token. `mode` is `read` OR `write` and never both — the store * refuses a token carrying two decisions. The secret comes back ONCE, because * only its digest is stored: a database read cannot produce a working token. * `allowedOrigins` is required and matched EXACTLY, so `example.com.evil.test` * fails a check that a suffix match would pass. */ anonTokenIssue(args: { mode: "read" | "write"; allowedOrigins: string[]; formId?: Uuid | null; savedViewId?: Uuid | null; recordId?: Uuid | null; expiresAt?: Timestamp | null; }): Promise>; /** What a secret is good for, from an origin. The store's sentence when it is not. */ anonTokenVerify(args: { secret: string; origin: string; requiredMode?: "read" | "write" | null; }): Promise>; anonTokenRevoke(args: { token_id: Uuid; }): Promise>; /** * A STRANGER'S WRITE. The token supplies the organization, so this call names * none — and what it produces is a QUARANTINED SUBMISSION, not a record: * `custom.record` is never touched here. `clientKey` makes a replay free and * idempotent, which is what lets a flaky phone retry safely. */ anonWrite(args: { secret: string; origin: string; payload: Record; clientKey?: string | null; rawPayload?: Record; }): Promise>; /** * SCR-30, and it is the SIGNED-IN offline path, not the stranger's. The client * mints `clientKey` BEFORE the first attempt, offline, and the store's own * replay ledger dedupes on it — so a reconnect that fires the same capture * thirty times writes one record and returns the same id every time. */ anonCapture(args: { table_id: Uuid; clientKey: string; payload: Record; device?: string | null; capturedAt?: Timestamp | null; }): Promise>; /** Open or close a form to strangers. An admin act on the Table, never an editor one. */ anonPublish(args: { form_id: Uuid; published?: boolean; }): Promise>; /** * What is wrong with a checklist somebody is writing, in the words they would * use. `null` means it is fine. Pure — it reads no row and writes nothing — * so an editor may ask it on every keystroke and the refusal arrives BEFORE * the save rather than after it. */ checklistRefusal(args: { spec: ChecklistSpec; }): Promise>; /** * Store a checklist, whole: ordered steps, who each belongs to by role, how * many days in each is due, what each waits for, what each asks for, and what * starts a run. Pass `template_id` to change the checklist that already * exists rather than making a second one. */ checklistDeclare(args: { spec: ChecklistSpec; template_id?: Uuid | null; }): Promise>; checklistTemplates(args?: { about_table_id?: Uuid | null; limit?: number; }): Promise>; checklistTemplateShape(args: { template_id: Uuid; }): Promise>; /** * Run a checklist for one record: one work item per step in the ONE work * layer, assigned by role to real people, dated from the offsets, * dependencies carried across. `roles` names who stands in each role for THIS * run, over whatever the checklist says by default. */ checklistStart(args: { template_id: Uuid; about_record_id?: Uuid | null; roles?: Record; startingAt?: Timestamp | null; }): Promise>; checklistRun(args: { run_id: Uuid; }): Promise>; checklistRuns(args?: { about_table_id?: Uuid | null; about_record_id?: Uuid | null; includeClosed?: boolean; limit?: number; }): Promise>; /** * Tick a step off with whatever it asked for. Refused by name while a step it * waits for is open, or while what it asks for is missing — and the same * refusal meets `workSetState`, because the rule lives in the store and not * in this door. */ checklistStepComplete(args: { step_id: Uuid; evidence?: Record; }): Promise>; /** Why this step cannot be finished right now. `null` means it can. */ checklistStepRefusal(args: { step_id: Uuid; }): Promise>; /** The five states and what each one may become. Asked, never hardcoded in a picker. */ workStates(): Promise>; /** Why this graph would be refused — asked BEFORE it is written. `null` means it is fine. */ workTemplateRefusal(args: { graph: WorkGraph; }): Promise>; workTemplateDeclare(args: { name: string; graph: WorkGraph; }): Promise>; /** * REC-70: the WHOLE graph is created in one act, judged before any of it is * written, so a half-made checklist is not a state this store can be in. */ workTemplateInstantiate(args: { template_id: Uuid; overrides?: Record>; }): Promise>; workTemplateShape(args: { template_id: Uuid; }): Promise>; workInstantiationShape(args: { instantiation_id: Uuid; }): Promise>; /** Whose turn each record is, with its state and whether that state is terminal. */ workWhoseTurn(args: { table_id: Uuid; includeFinished?: boolean; }): Promise>; /** Does this Table carry assignment at all? A screen asks before it offers one. */ workHasAssignment(args: { table_id: Uuid; }): Promise>; /** The Fields assignment is made of, so nothing here invents a column name. */ workAssignmentFields(args?: { options_table_id?: Uuid | null; }): Promise>; /** Add assignment to a Table. */ workTakeAssignment(args: { table_id: Uuid; }): Promise>; /** Why this move would be refused. `null` means it is allowed. */ workTransitionRefusal(args: { from_state_id: Uuid; to_state_id: Uuid; }): Promise>; /** Declare the Table slots are held in. Idempotent — a second call finds the first. */ workSlotsDeclare(args: { name: string; slug: string; homeId?: Uuid | null; }): Promise>; /** * SCR-29. Take a slot for a while. THE STORE decides, under a unique index — * two people racing for the same slot do not both get it, whatever either * screen believed a moment earlier. */ workSlotHold(args: { table_id: Uuid; slotKey: string; holder: string; ttl?: string; }): Promise>; workSlotRelease(args: { hold_id: Uuid; }): Promise>; /** Every hold on this Table, with whether it has already lapsed. */ workSlotHolds(args: { table_id: Uuid; }): Promise>; workSlotExpire(args: { table_id: Uuid; }): Promise>; /** * THE ONE INBOX. Assignments, approvals and the agent's proposals, in one * ordered list with ONE row shape — PRODUCTS.md row 6. A second queue for the * agent's suggestions is the thing this replaces. */ workInbox(args?: { limit?: number; offset?: number; includeDecided?: boolean; /** Lane S5-PRIME-2: "inbox" (default), "snoozed" or "done" — this person's own views. */ view?: WorkInboxView; }): Promise>; /** * SNOOZE ONE ITEM OF MY INBOX UNTIL A TIME (lane S5-PRIME-2, `custom.inbox_snooze`). Only my * inbox changes; the approval or record is never written. A time already past, a snooze past a * year, and a decided item are refused by name. */ inboxSnooze(args: { item_id: Uuid; until: Timestamp; }): Promise>; /** Take my snooze off: it is back in my inbox now. */ inboxUnsnooze(args: { item_id: Uuid; }): Promise>; /** * CLEAR (mark done) ONE ITEM OF MY INBOX. A decision still owed is refused ("This one needs a * decision"). It comes back if somebody else changes it. */ inboxClear(args: { item_id: Uuid; }): Promise>; /** Put a cleared item back in my inbox. */ inboxUnclear(args: { item_id: Uuid; }): Promise>; /** * WHAT WAITS ON ME, COUNTED (`custom.inbox_counts`) — the same predicate the inbox lists with. * `everyOrganization` counts every organization I belong to (the shell badge: what waits on a * person is theirs, not the selected organization's). */ inboxCounts(args?: { everyOrganization?: boolean; }): Promise>; /** "My work", "work I assigned", "waiting on somebody being chosen". */ workList(args?: { flavour?: WorkListFlavour; includeFinished?: boolean; limit?: number; offset?: number; }): Promise>; /** * Give one record to one person: the Assignee value AND editor access, in one * transaction. Passing no `user_id` un-assigns and says plainly that nobody's * access was taken away. */ workAssign(args: { record_id: Uuid; user_id?: Uuid | null; dueDate?: string | null; clearDue?: boolean; }): Promise>; /** The states this record may be moved to, and the sentence for each it may not. */ workRecordStates(args: { record_id: Uuid; }): Promise>; /** Move it. The store refuses a move the model forbids, in its own words. */ workSetState(args: { record_id: Uuid; state_id: Uuid | null; }): Promise>; /** The person-kernel record standing for a signed-in person here. */ workPerson(args: { user_id: Uuid; create?: boolean; }): Promise>; /** The templates this person may run, so a picker has ids to offer. */ workTemplates(args?: { limit?: number; }): Promise>>; /** Who may decide a change about this subject, and why each of them may. */ workApprovalApprovers(args: { subject_id: Uuid | null; approver_id?: Uuid | null; }): Promise>; /** Ask for a change instead of making it. Viewer on the subject is enough to ASK. */ workApprovalRequest(args: { subject_id: Uuid; change: WorkChange; note?: string | null; approver_id?: Uuid | null; origin?: "person" | "agent"; conversation_id?: Uuid | null; }): Promise>; /** Whether THIS person may decide THIS one — so a screen never draws a dead button. */ workApprovalMayDecide(args: { approval_id: Uuid; }): Promise>; /** Approve or decline. Approving APPLIES the change, as the person approving. */ workApprovalDecide(args: { approval_id: Uuid; approve: boolean; note?: string | null; }): Promise>; /** * DECIDE MANY INBOX ITEMS IN ONE CALL (lane S4, `custom.work_decide_many`). Each is judged by * `work_approval_decide` exactly as one is, in its own savepoint: a refused decision leaves that * item waiting and the others still stand. Verdicts: approved, declined, already_decided, * no_right, refused — each with the store's own sentence. */ workDecideMany(args: { decisions: WorkDecideManyItem[]; }): Promise>; /** One waiting change in full, for the person deciding it or the one who asked. */ workApprovalRead(args: { approval_id: Uuid; }): Promise>>; /** VIS-31. Is this account a signed-in outsider — no NON-personal organization? */ isExternalPrincipal(args?: { user_id?: Uuid | null; }): Promise>; /** The same answer WITH the plain-English reason a screen shows. */ externalPrincipalCard(args?: { user_id?: Uuid | null; }): Promise>; /** Exactly the resource ids Visibility gave that outsider. Never an organization's list. */ externalPrincipalReach(args: { resourceType: string; user_id?: Uuid | null; }): Promise>>; /** VIS-32. Bind a record or a view to a public address with a declared render mode. */ publishBindingCreate(args: { slug: string; resourceType: string; resource_id: Uuid; renderMode?: string; }): Promise>; publishBindingRevoke(args: { slug: string; }): Promise>; /** What a SIGNED-OUT visitor resolves. Empty for an invented, revoked or unpublished address. */ resolvePublishBinding(args: { slug: string; }): Promise>; /** The same resolution plus what the address holds (table | record | dashboard | page | view). */ resolvePublishBindingKind(args: { slug: string; }): Promise>; /** D-15. The ONE sentence admitting nothing was scanned, so four surfaces cannot drift. */ worldPublishGapNotice(): Promise>; /** Put a resource in the world lane. Refuses by name while the lane is closed. */ publishToWorld(args: { resourceType: string; resource_id: Uuid; discoverable?: boolean; }): Promise>; /** * Declare a Rule. It is NOT `recordWrite` into the rule kernel, and that is * the whole point: `custom.record_write` inserts `data_class = 'record'`, so a * document written that way is not a Rule and the store's own rule doors * (`custom.rule_members`, `custom.agg_subscriptions`) never see it. Writing * one through the record door and calling it a Rule would be a silent * failure — a screen that looked like it had subscribed you to something. */ ruleDeclare(args: { spec: Record; rule_id?: Uuid | null; }): Promise>; fieldPropose(proposal: FieldProposal): Promise>; tablePropose(proposal: TableProposal): Promise>; promoteTable(args: { table_id: Uuid; }): Promise>; promoteField(args: { table_id: Uuid; field_id: Uuid; }): Promise>; /** * @deprecated The record store is never off (owner ruling, 2026-10-03: everything is on by * default). This answers `true` whenever the door answers; a refusal means the store could not * be reached, never that it is off. Do not gate a screen on it. */ storeIsOpen(): Promise>; /** * WHAT THIS PERSON MAY DO TO THESE THINGS — asked once, for a whole page. * * There is no principal argument, on purpose: the door resolves the caller * from the session, so a person can ask about their OWN access and about * nobody else's. A subject they hold nothing on answers `level: null`, which * is an answer; the row is never omitted, because a screen that could not * tell "no access" from "not asked yet" would draw one of them as the other. */ myLevels(args: { ids: Uuid[]; subject?: "record"; }): Promise>; /** G1. Write ONE leaf of a Table's colors, or clear it with `null`. Editor on the Table. */ tableDecorate(args: { table_id: Uuid; path: DecorationPath; value: unknown; }): Promise>; /** G1. A Table's colors as a screen paints them, with what went stale named. */ tableDecorations(args: { table_id: Uuid; }): Promise>; /** G1. The layout a grid opens with: platform → organization knob → the view's own. */ gridLayout(args: { table_id: Uuid; view_id?: Uuid | null; }): Promise>; /** G3. The older grid's formula text → the store's expression. Never refuses a typo: answers ok:false. */ formulaParse(args: { table_id: Uuid; text: string; }): Promise>; /** * NOTION-PROPS. The formula being typed, parsed AND worked out for one record of the table * (`custom.formula_preview`): the parse, plus `value` — what a saved formula column would show on * that record — or `error` when it parses and cannot be worked out there. Writes nothing. */ formulaPreview(args: { table_id: Uuid; record_id: Uuid | null; text: string; }): Promise>; /** G2. Declare a Table's row actions — the whole list. Editor on the Table. */ actionDeclare(args: { table_id: Uuid; actions: RowAction[]; }): Promise>; /** G2. A Table's row actions, each saying whether it can run here. */ rowActions(args: { table_id: Uuid; }): Promise>; /** * G2. Run one action on a selection, in ONE transaction. A refusal changed NOTHING; read * every record and field that refused with `actionRefusals(result.error)`. */ actionRun(args: { action_id: Uuid; record_ids: Uuid[]; }): Promise>; /** * AUTOMATION-DOOR. Declare (or, with `automation_id`, replace) one automation on a Table — editor on the Table. * A spec the store refuses comes back as `data.ok === false` with `_errors`, one sentence per path. */ automationDeclare(args: { table_id: Uuid; spec: AutomationSpec; automation_id?: Uuid | null; }): Promise>; /** AUTOMATION-DOOR. A Table's automations with their last run; archived ones only when asked. */ automations(args: { table_id: Uuid; include_archived?: boolean; }): Promise>; /** AUTOMATION-DOOR. Archive one (it switches off and keeps its history). Editor on the Table. */ automationArchive(args: { automation_id: Uuid; }): Promise>; /** AUTOMATION-DOOR. Bring an archived one back (it stays off until `automationSetEnabled`). */ automationRestore(args: { automation_id: Uuid; }): Promise>; /** AUTOMATION-DOOR. Switch one on or off. */ automationSetEnabled(args: { automation_id: Uuid; enabled: boolean; }): Promise>; /** AUTOMATION-DOOR. Run history, newest first: status, the store's own sentence, every step. */ automationRuns(args: { automation_id: Uuid; limit?: number; cursor?: string | null; }): Promise>; /** * AUTOMATIONS-AIRTABLE. Test an automation now (Airtable's "Run test"): its steps run once on `record_id` (none for * a schedule), switched on or not, and the run lands in its history as `trigger.on = "test"`. Editor on the Table. */ automationTest(args: { automation_id: Uuid; record_id?: Uuid | null; }): Promise>; /** AT-AUTO2. Every saved version of an automation, newest first. */ automationRevisions(args: { automation_id: Uuid; }): Promise>; /** AT-AUTO2. Restore one version: one more save through automation_declare (admin on the table). */ automationRevisionRestore(args: { automation_id: Uuid; revision_id: Uuid; }): Promise>; /** G4. Send every change to this Table's records to an https webhook. Admin. The secret is shown once. */ tableWebhookDeclare(args: { table_id: Uuid; target_url: string; events?: RecordEvent[] | null; description?: string | null; }): Promise>; /** G4. The webhooks a Table sends to, with their delivery health — never the secret. */ tableWebhooks(args: { table_id: Uuid; }): Promise>; /** G4. Switch one off. It is never deleted. */ tableWebhookArchive(args: { webhook_id: Uuid; }): Promise>; /** G5. Number the records an autonumber column found already there, in creation order. */ autonumberBackfill(args: { field_id: Uuid; }): Promise>; /** * AT-SHARE-B. A Person column's "Notify people when they're added" switch (`custom.field_notify_on_assign`). * `on: null` only READS whether it is on; `true` declares the column's two notify automations (edited, new * record), `false` archives them. Turning it on or off asks to change the table's structure. */ fieldNotifyOnAssign(args: { field_id: Uuid; on: boolean | null; }): Promise>; /** * NOTION-PROPS-3. PRESS A BUTTON COLUMN ON ONE ROW (`custom.button_press`): a link comes back filled from * the row for the screen to open; a row action or an automation runs in the store and its result comes * back. A button with nothing set up is refused by name (22023). */ buttonPress(args: { record_id: Uuid; field_id: Uuid; }): Promise>; /** * NOTION-PROPS-3. The knob `data/timeline_dependency_shift` for the signed-in person in this organization: * whether moving a record on a timeline moves the records waiting on it (default true). */ timelineDependencyShift(): Promise>; /** * FB5 (ADV-5 F4/F10): the record store's screen limits for the signed-in person in this organization, each a * knob (`custom.records_limits`): the AI column fill's try size, one fill's row cap and the Fill box's start, and * a table copy's stall bound. Asked once per client; a store without the door answers the knobs' defaults. */ recordsLimits(): Promise; /** G5. One page of the export door — exactly the rows and columns the read door serves this person. */ ioExport(args: { table_id: Uuid; columns?: string[] | null; limit?: number; }): Promise>; /** G5. That page as an .xlsx; a withheld column is named on its own sheet. */ /** * G9. Every table a picker may offer here, from BOTH stores, each saying which store opens it. * A table the app keeps out of default lists (`custom.table_kept_out_of_lists`: an agent's * outputs) is left out unless `include_platform_tables` is true — the "Show platform tables" switch. */ tableListEverywhere(args?: { include_platform_tables?: boolean; }): Promise>; /** * Every table the person reaches (`custom.data_home_tables`), as the data home lists them. * `organization_id` names one organization; `null` asks for every organization the person * reaches — never the client's bound organization by default. A table the app keeps out of * default lists (an agent's outputs) is answered only with `include_platform_tables: true`. */ dataHomeTables(args: { organization_id: Uuid | null; include_platform_tables?: boolean; }): Promise>; /** * Every table of EVERY organization (`custom.admin_all_tables`) — the admin section's list. The * store's walls admit a platform admin to system organizations only, so this is a separate door that * answers only on the admin lane for a platform admin; anyone else gets a refusal, not an empty list. */ adminAllTables(): Promise>; /** * G10. Refresh a synced source (a sheet tab) into ONE Table under `home_id`: new rows added, * changed rows updated, rows the source dropped archived — never destroyed; columns the * person added in Matrx survive. Build the spec with `sheetSyncSpec`. */ tableSync(args: { home_id: Uuid; spec: TableSyncSpec; }): Promise>; /** Lane SYNC-AIRTABLE: a table synced from another table's view, in the active organization. */ tableCopySync(spec: TableCopySpec): Promise>; /** Lane SYNC-AIRTABLE: auto-refresh / write-back of one synced table (editor of it). */ tableSyncSettingsSet(args: { table_id: Uuid; settings: TableSyncSettings; }): Promise>; /** * G11. The record-store Table a context scope's template-bound item provisions — one per item * and scope. A scope provisioned before the move answers with its moved Table (same id); the * Home defaults to the organization's own. */ scopeTableProvision(args: { item_id: Uuid; scope_id: Uuid; home_id?: Uuid | null; }): Promise>; /** G12. The rows of each Table this reader may see, in one call (fold with `withRowCounts`). A Table she may not know gets no row. */ tableRowCounts(args: { table_ids: Uuid[]; }): Promise>; /** G12. Each live record's own header (created, updated, version) that the read door does not answer. */ recordHeaders(args: { ids: Uuid[]; }): Promise>; /** * G14. Share a Table with a person by email or account id: an existing account outside the * organization is granted at once and notified (never made a member); an address with no * account is invited. The organization's outside-sharing setting decides first. */ tableShareOutsideGrant(args: { table_id: Uuid; person: string; level?: "viewer" | "commenter" | "editor" | "admin"; }): Promise>; /** G13. Keep a hand-set order on a saved view: the named rows first, in this order (build it with `moveInOrder`). */ viewRecordOrderSet(args: { view_id: Uuid; record_ids: Uuid[]; }): Promise>; /** * G13 + ORDER-FILTER. A page of a hand-ordered view: placed rows by position, then the rest by * created time. `filter` is the list door's question (`StoreFilter`: a flat map or a nested * Rule — the view's own `where`, or a number clicked on a dashboard); given, the store reads * exactly the rows that match, in their places, and `limit`/`offset` page THAT order. Each row * answers the position stored for it; rows the filter hides keep theirs. */ readInViewOrder(args: { view_id: Uuid; filter?: StoreFilter | null | undefined; limit?: number; offset?: number; }): Promise>>; exportXlsx(args: { table_id: Uuid; columns?: string[] | null; limit?: number; labels?: Record; sheetLabel?: string; }): Promise>; } /** One Table's two lane facts, as `custom.table_facts` answers them. */ interface TableFact { table_id: Uuid; /** * The old lane word (personal · internal · public), now worked out by the store from `shown_to` * and `published_to_web` (access ladder). Read those two; this stays for older stores. */ visibility: string; /** Whether the person signed in MADE this Table. Never who did. */ mine: boolean; /** Access ladder "Shown to": only_me · my_team · everyone · everyone_on_ai_matrx; null = the default. */ shown_to?: string | null; /** Access ladder "Published to the web": the only way anyone outside the organization opens it. */ published_to_web?: boolean; } /** * WHERE A TABLE IS CURRENTLY READ AND WRITTEN during the older-table cutover. * `tableHome` is an address read from one Table record; this applies the * organization's migration switch to a batch of ids, including same-id copies. */ interface TableLiveLocation { table_id: Uuid; lives_in: "record" | "older"; why: string | null; } /** The record store's screen limits (`recordsLimits`), each a knob in `platform.feature_knob`. */ interface RecordsLimits { /** A fill of at most this many rows runs at once; a bigger one meets the confirm step (knob custom/ai_fill_try_max). */ aiFillTryMax: number; /** The most rows one fill covers (knob custom/ai_fill_rows_max). */ aiFillRowsMax: number; /** The number the "Fill N rows" box starts at (knob custom/ai_fill_default_rows). */ aiFillDefaultRows: number; /** Passes a table copy may make without moving before it stops (knob custom/copy_stall_passes). */ copyStallPasses: number; /** * The highest sensitivity an AI fill may read (knob custom/enrichment_sensitivity_ceiling): public, internal, * restricted or confidential. custom.enrich_due drops anything above it; screens default an AI column's inputs by it. */ enrichmentSensitivityCeiling: string; } /** * One client's memory of its own operations. `mint()` names a write and remembers it; `isOwn(opId)` * answers whether a notice is that write's echo. * * OWN-WRITE DETECTION IS PER CLIENT INSTANCE. Two setups in ONE process (a server holding two * identities, a worker beside a UI) must hear each other: a realm-wide ledger made A's write "ours" to * B as well, and B dropped it as an echo (2026-10-08, the README proof). `createRecords` gives every * setup its own ledger and hands it to its client, its entity port and its live-changes port. */ interface OpLedger { mint(): Uuid; isOwn(opId: string | null | undefined): boolean; /** Test seam: forget everything. */ clear(): void; /** Test seam: how many operations are currently remembered. */ readonly size: number; } /** A ledger of one client's own: hand the SAME one to the client that writes and the port that listens. */ declare function createOpLedger(): OpLedger; /** * THE REALM'S DEFAULT LEDGER, IN A GLOBAL SLOT — for hosts that mount one client per realm (a browser * tab) and never name a ledger. Every section of the built package (root, core, react, realtime, data, * typed-table) carries its own copy of this module, and the ESM and CJS builds are two more graphs; a * module-level Map split it so `records/core` minted in one and `records/realtime` checked another — own * writes came back as strangers' changes (2026-10-08). Guarded on the packed tarball by * scripts/check-shared-state.mjs. */ declare const defaultOpLedger: OpLedger; /** * Mint the id for one client operation and remember it as ours (the realm's default ledger). * * ONE CALL IS ONE OPERATION. A fifty-row paste through `recordWriteMany` is ONE op id, because * the store announces one statement once — and it REFUSES a batch carrying two different ones * by name, for exactly that reason. */ declare function mintOpId(): Uuid; /** * Is this notice the echo of a write this realm's default ledger made? * * `undefined`/`null` is NOT ours and never has been: a notice with no `op_id` came from a * server-side write, an agent tool, another client, or a store older than this mechanism — * all of which are changes this browser has not seen and must read. */ declare function isOwnOp(opId: string | null | undefined): boolean; /** Test seam: forget everything. Never called by product code. */ declare function forgetAllOps(): void; /** Test seam: how many operations are currently remembered. */ declare function rememberedOpCount(): number; /** * The data seam: a structural subset of `SupabaseClient`. The package never * opens a database connection of its own and never holds a key — the HOST * supplies a client that already carries the operating person's session, which * is what makes DOOR-5 and AGT-N-4 true (the store sees the person, not us). */ interface RecordsDataSource { /** * Call a door. The name is always a door the live catalog has; `/core` * refuses `door_absent` before it ever reaches here for one that does not. */ rpc(fn: string, args: Record, /** * THE SCHEMA THE DOOR LIVES IN, always supplied: `custom` for the store's * own doors, `iam` for the trust doors (the external principal and the * publish binding, which are the PLATFORM's). A host binding supabase-js * routes this to `client.schema(options.schema).rpc(fn, args)`; a host that * ignores it calls its own default PostgREST profile — `public` — and is * refused by name, which is the failure we want rather than a silent answer * from the wrong system. (Before 2026-09-18 this was described as "only ever * `iam`" and the store's doors went unqualified; the extension's first real * turn proved that asks `public.store_is_open` and finds nothing.) */ options?: { schema?: string; }): PromiseLike<{ data: unknown; error: PgError | null; }>; /** * OPTIONAL. True for the real supabase adapters: the client may open a table page with ONE * `custom.table_page_bundle` call instead of a dozen shape doors one after another (PAGE-BUNDLE). * Leave it off for a test or replay source that does not model the bundle door. */ opensInOneCall?: boolean; /** Reads of `custom.*` go through the schema-qualified builder, never a bare `from`. */ schema(name: string): { from(table: string): RecordsTableQuery; }; } /** The read surface the list and query paths use. A real supabase-js client satisfies it. */ interface RecordsTableQuery { select(columns: string, options?: { count?: "exact" | "planned" | "estimated"; head?: boolean; }): RecordsFilter; } interface RecordsFilter extends PromiseLike { eq(column: string, value: unknown): RecordsFilter; neq(column: string, value: unknown): RecordsFilter; in(column: string, values: readonly unknown[]): RecordsFilter; is(column: string, value: null | boolean): RecordsFilter; gte(column: string, value: unknown): RecordsFilter; lte(column: string, value: unknown): RecordsFilter; order(column: string, options?: { ascending?: boolean; }): RecordsFilter; range(from: number, to: number): RecordsFilter; limit(count: number): RecordsFilter; } interface RecordsResponse { data: unknown; error: PgError | null; count?: number | null; } /** * WHO IS ACTING. AGT-N-4: an agent carries the exact authority of the person * operating it — there is no agent identity and there are no service roles. So * the actor word and the person are two separate facts, and `on_behalf_of` is * meaningful only when the actor is `agent`. */ interface RecordsActor { actor: Actor; /** The signed-in person. The store reads this from the session, not from us; this is for the client's own mirror. */ user_id?: Uuid; /** Only an agent acts on behalf of a person (the store refuses it otherwise). */ on_behalf_of?: Uuid; } /** * OPTIONAL. A live-updates seam. The default degradation is stated rather than * silent: with no port bound, `useRecords` reports `live: false` and the screen * can say "not live" instead of quietly going stale. * * A host binds this with `@ai-matrx/data/react`'s channel hygiene — the package * deliberately does NOT depend on it, so the headless core stays free of a * realtime client and a host that has one keeps using the one it already has. */ interface RecordsRealtimePort { /** * Watch one organization's records of one table. Returns an unsubscribe. * * THE HOST NUDGES THROUGH THIS SINK AND REACHES AROUND NOTHING. Until 0.43.0 the callback * was `(recordId: Uuid) => void` and a host that also wanted to say "the SHAPE moved" * imported `tableShapeChanged` from `@ai-matrx/records/react` and called it directly — * which worked, and which meant the port contract did not describe half of what a port * actually does. A column appearing is not a row changing, and the package owns the * difference. * * NOTHING THAT ARRIVES HERE IS DATA. A nudge has not passed the read door, so the hook * re-reads — by id set when the nudge names ids, whole-page when it cannot. */ subscribeRecords(args: { organization_id: Uuid; table_id: Uuid; }, sink: RecordsChangeSink): () => void; } /** What a realtime port may tell the package. Two calls, because a column is not a row. */ interface RecordsChangeSink { /** * THESE RECORDS MOVED. `null` means "I cannot tell you which" — a reconnect, a tab wake, or * a change above the store's own id cap — and is the one case that costs a whole-page read. * An EMPTY array is not the same thing and is not a nudge at all. */ records(ids: readonly Uuid[] | null): void; /** * THIS TABLE'S SHAPE MOVED — a column added, retired or changed. Re-reading the rows would * redraw the same table without the new column in it, which is a screen that is out of date * while looking healthy. */ shape(): void; } /** * OPTIONAL. Where a refusal that nobody asked about goes — the loud funnel. * Default degradation: `console.error` with the store's own words, never * silence. */ type RecordsErrorSink = (error: { code: string; message: string; hint?: string; where: string; }) => void; /** * OPTIONAL. The merge-field resolver's server half (`W5-MERGE-B`). While it is * not bound, `useMergeField` answers `pending` WITH THE REASON — never a blank, * never a literal placeholder left in the text (DYN-14). */ interface RecordsResolverPort { resolve(args: { organization_id: Uuid; merge_field_keys: string[]; /** The live selection the `state` source reads (DYNAMIC-VALUES §C). */ state?: Record; }): Promise; } /** The one config a host binds. */ interface RecordsConfig { /** REQUIRED. */ dataSource: RecordsDataSource; /** REQUIRED. */ actor: RecordsActor; /** * REQUIRED. REC-29: organizations are hard walls, and the store is keyed * `(organization_id, id)`. There is no "current organization" this package * discovers for itself — the host says which one, every time. * * `null` is the ALL-ORGANIZATIONS mode (access belongs to the person, not the selected * organization): a host whose page lists across every organization the person belongs to * mounts with none. Doors that answer for the person (`custom.data_home*`) take it; a door that * needs one is sent NULL and refuses in its own words, never a guessed organization. */ organizationId: Uuid | null; /** * EVERY organization the person belongs to (active-org-is-never-a-list-filter.md). * `organizationId` above is where NEW things are written and which org a write * runs in; it never decides what a READ shows. With this set, `tableList` / * `tableFacts` span all of these organizations (or one, when the page passes * its `organization_id` filter), and `tableRead` / `recordRead` / * `recordValuesVersioned` open a record in ITS OWN organization. Absent ⇒ the * client reads only `organizationId`, exactly as before. */ organizationIds?: readonly Uuid[]; realtime?: RecordsRealtimePort; /** * This client's own-write memory (`createOpLedger()`). Hand the SAME ledger to the live-changes port * that listens for this client. Absent ⇒ the realm's default ledger (one client per browser tab). */ opLedger?: OpLedger; onError?: RecordsErrorSink; resolver?: RecordsResolverPort; /** * The schema the record store lives in. Exists so a rehearsal branch and * production can differ without a fork; it is `custom` everywhere today. */ schema?: string; /** * Doors the generated catalog (`STORE_DOORS`) does not list YET but this store is known to have — * the nightly clone after a rehearsal, a test store. A screen reading an owed door asks * `doorReady(config, name)` first, so production (which lacks the door until the chair applies it) * is never asked and logs nothing. Leave it out in a shipped host: the regenerated catalog is * the switch. */ knownDoors?: readonly string[]; } /** * RUN AN AGENT ON THIS ROW — a PORT (step 10, 2026-10-08). A table's agent button ("Draft follow-up") hands * the row to an agent with the action's own prompt. The store ships no agent: the host binds the run (the * agent run itself belongs to `@ai-matrx/agents`; the website starts it through the `data.row_action` * mandate). Everything the run needs rides the target, read as THIS reader sees it — no second read. */ interface RowAgentTarget { tableId: Uuid; recordId: Uuid; title: string; action: string; prompt: string; /** The table's name, as the reader sees it. */ tableName: string; /** The table's columns. */ fields: readonly Field[]; /** The row, masked for this reader. */ document: RecordDocument; /** This reader's level on the row. */ level: PermissionLevel | null; } /** The host's agent runner — `createRecords({ rowAgent })`; records-ui's grid calls it for `kind: "agent"` actions. */ interface RowAgentPort { run(target: RowAgentTarget): void | Promise; } /** * REL-6. Whether Visibility flows along this relation and the MAXIMUM access * level it carries. Default off on `referenced`, on for `owned`. */ interface RelationCarries { carries: boolean; /** The ceiling — a relation never carries more access than this. */ max_access: string | null; } /** The seven properties, each its own question. */ interface RelationProperties { /** REL-1. Stored once on the contained table, read from the field's side. */ flavor: RelationFlavor; /** REL-2. Separate from flavour. */ on_delete: OnDelete; /** REL-3. A snapshot is a frozen copy in the relation's payload — never a pointer into History. */ binding: RelationBinding; /** REL-4. */ ordered: boolean; /** REL-5. */ loops: "allowed" | "refused"; /** REL-6. */ carries: RelationCarries; /** REL-7. */ cardinality: RelationCardinality; } /** * REL-8 / REL-N-1. A target is a REFERENCE, written that way from the first * line of code, because it may name a row outside our database. One Table, * several, or any — polymorphic without restriction. External targets are * read-only in v1. */ type RelationTarget = { kind: "ours"; entity_token: string; row_id: Uuid; } | { kind: "external"; connection_token: string; external_table: string; external_key: string; } | { kind: "any"; }; /** One edge, as the store holds it in `platform.associations`. */ interface Relation { id: Uuid; organization_id: Uuid; /** REL-10. The field key, which is what `role` holds. */ role: string; source: RelationTarget; target: RelationTarget; properties: RelationProperties; /** REL-4. Meaningful only when `ordered`. */ position: number | null; /** REL-3. The frozen copy, when `binding` is `snapshot`. */ payload: Record | null; /** REL-14. Hydrated from the target's title field AT READ — never stored. */ label: string | null; created_at: Timestamp; updated_at: Timestamp; /** REL-13 / REL-16. Associations are versioned, so relation history exists. */ version: number; } /** * DOOR-6. A query coordinate: "related to THIS, along THAT role, in that * direction". Any combination, and any subset of them. */ interface RelationCoordinate { /** The record at the other end. */ record_id: Uuid; /** The field key the edge carries as its role. Omit to mean any role. */ role?: string; /** Which way to walk. `out` is this record's own relation fields. */ direction?: "out" | "in" | "either"; } /** * The arguments of the ONE relation-words resolver: the FIELD, because that is where its display * spec is declared and judged (`custom._display_of_field` reads it server-side; the caller never * carries it), and the ids of a page of cells. */ /** A linked record's icon, and its table's icon for a record that has none (`relationWordsMany`). */ interface RelationIcons { icon: string | null; tableIcon: string | null; } interface RelationWordsManyArgs { field_id: Uuid; record_ids: Uuid[]; } /** One reference as the store keeps it. */ interface EntityRef { /** The `platform.entity_types` token: `note`, `web_site`, `agent` … */ token: string; id: Uuid; } /** One reference as a read door answers it. */ interface EntityRefWithWords extends EntityRef { /** * The thing's own title — or the store's withheld sentence when the reader * may not open it; `null` when the kind names no title. */ label: string | null; } /** One kind of platform thing a record may point at (`custom.entity_reference_kinds`). */ interface EntityReferenceKind { token: string; /** What a person reads: "Note", "Site", "Agent". */ label: string; /** The picker's grouping: the admin-assigned reference category, else the schema. */ category: string; } /** * The references a cell holds, whichever shape it arrived in — one object, a * list, or what a read door rendered (with labels). Anything that is not a * reference is left out, never guessed at. */ declare function entityRefsOf(value: unknown): EntityRefWithWords[]; /** * What to WRITE for an entity-reference cell: `{token, id}` only, each thing * once, first mention first — the label a read door added is dropped, because * the store reads it and never keeps it (REL-14). A single-valued column gets * the one object (or `null`), a multi-valued one the list. */ declare function entityRefsToWrite(value: unknown, multi: boolean): EntityRef | EntityRef[] | null; /** * The kinds of platform thing a record may point at — what the field editor's * kind picker lists. `custom.entity_reference_kinds()`. */ declare function entityReferenceKinds(source: RecordsDataSource): Promise>; /** * THE SEARCH DOOR (lane REFERENCE-CARRY). The platform things of these kinds whose words hold * `search`, that THIS person may point a record at — each one a thing the store's own write check * (`custom._entity_reference_target_ok`) would accept, so a picked reference is never refused on * save. `custom.entity_reference_search`. An empty search lists the first things by name. */ declare function entityReferenceSearch(source: RecordsDataSource, organizationId: Uuid | null, tokens: readonly string[], search: string, limit?: number): Promise>; /** * THE WORDS HELPER. The words of each `{token, id}` for a picker or a chip * before anything is saved — each label read by the store for THIS person and * withheld when they may not open the thing. `custom.entity_reference_words`. * A saved cell needs no call: every read door already answers its labels. */ declare function entityReferenceWords(source: RecordsDataSource, organizationId: Uuid | null, refs: readonly EntityRef[]): Promise>; /** One reverse column of a Table, as `custom.reverse_columns` answers it. */ interface ReverseColumn { /** Stable key: the linking Field's `inverse_key`, else `linked_`. Never a Field key of B. */ key: string; /** What the column is called on B: the linking table's name (plus the column's when ambiguous). */ label: string; /** The relation Field on the linking table. */ source_field_id: Uuid; source_field_key: string; source_field_label: string; /** The linking table. */ source_table_id: Uuid; source_table_name: string; /** Always `many`: any number of records may link to one. */ cardinality: "many"; /** * True for a virtual back-link (written only from the linking table's side). False for a TWO-WAY * LINK (NOTION-PROPS): the reverse end is a real Field on this table — `key` is its key, `label` * its label — and `relationReverseSet` writes its links from here. */ read_only: boolean; } /** * NOTION-PROPS. A two-way link's reverse Field: a relation whose `config.reverse_of` names the * forward relation it mirrors. It holds no value of its own — its links are the forward Field's. */ declare function isReverseField(field: { type?: unknown; config?: unknown; } | null | undefined): boolean; /** One linking record, as a chip shows it. */ interface ReverseLink { id: Uuid; /** The linking record's name, read by the store for this reader. */ words: string; } /** The links of one record through one reverse column: how many the reader may see, and one page. */ interface ReverseLinks { total: number; links: ReverseLink[]; } interface ReverseLinksManyArgs { /** The Table whose records are being shown (B). */ table_id: Uuid; /** `ReverseColumn.source_field_id`. */ source_field_id: Uuid; /** A page of B's record ids — up to 200 a call; more are sent in groups by the client. */ record_ids: readonly Uuid[]; /** Links per record, 1–50 (the store holds it there). Default 10. */ limit?: number; /** Skip this many links of each record — the next page of one hub record. Default 0. */ offset?: number; } /** `reverseLinksFields`: the links of a page through several reverse columns, in one call. */ interface ReverseLinksFieldsArgs { table_id: Uuid; /** Each `ReverseColumn.source_field_id` — at most 20. */ source_field_ids: readonly Uuid[]; record_ids: readonly Uuid[]; limit?: number; offset?: number; } /** The store's per-call ceiling on records for `custom.reverse_links_many`. */ declare const REVERSE_LINKS_RECORDS_PER_CALL = 200; /** The store's ceiling on links a record per call. */ declare const REVERSE_LINKS_PAGE_MAX = 50; /** The store's typed "source archived" answer for a lookup or roll-up. */ interface SourceArchived { __unavailable: "source_archived"; /** `link`: the relation it reads through is archived; `column`: the far column it reads is. */ reads: "link" | "column"; /** The archived Field. Absent when the reader may not know its Table. */ field_id?: Uuid; /** Its label. Absent when the reader may not know its Table. */ label?: string; table_id?: Uuid; /** Its Table's name. Absent when the reader may not know that Table. */ table?: string; } /** The typed "source archived" answer, when `value` is one; null for any other value. */ declare function sourceArchivedOf(value: unknown): SourceArchived | null; interface RecordsProviderProps { config: RecordsConfig; children: ReactNode; } declare function RecordsProvider({ config, children }: RecordsProviderProps): react.FunctionComponentElement>; /** * The client, or a loud failure. A hook that quietly did nothing because nobody * mounted the provider is the silent failure this throws instead of. */ declare function useRecordsClient(): RecordsClient; /** * The client IF one is mounted, and `null` if none is — for the ONE case where * that is not a mistake: a screen served to somebody who has no account. * * A public form page (DOOR-17) renders for a stranger. There is no session to * build a client from, no organization the caller may name and no read of the * table it writes into; the server resolved the form through * `custom.form_public` and hands the screen its questions and a submit port. * `useRecordsClient` is right to throw for every other caller — a hook that * quietly did nothing is the silent failure it exists to prevent — so this is a * SECOND, NAMED hook rather than a softening of the first. A component using it * must work with `null`, and the ones in `@ai-matrx/records-ui` say out loud * which half of themselves is unavailable when it is. */ declare function useOptionalRecordsClient(): RecordsClient | null; /** For a screen that wants to show who it is acting as (AGT-N-4). */ declare function useRecordsActor(): RecordsActor; export { AUTOMATION_APP_TRIGGERS as $, ABSENCE_REASONS as L, ACTOR_VOCABULARY as Q, ADDRESS_PARTS as V, AGENT_WRITER_WORDS as X, ARCHIVE_LANES as Y, ARCHIVE_LANE_LABEL as Z, ARCHIVE_LANE_MEANS as _, BARCODE_SYMBOLOGIES as aL, BUILT_KIND_WORD as aM, BUTTON_DOES as aN, CHOICE_NUDGES as aV, COMPUTE_ON as aW, CONTEXT_POLICIES as aX, DRILL_CHART_TOKENS as bA, DRILL_DESCRIPTION_MAX as bB, DRILL_DOORS as bC, DRILL_SCHEMA as bD, DECLARABLE_FIELD_KINDS as bw, DEFAULT_ARCHIVE_LANE as bx, DEFAULT_PORTAL_ARCHIVE_FILTER as by, DELIVERIES as bz, FIELD_KINDS as cB, FIELD_SENSITIVITIES as cC, FIELD_SOURCES as cD, FORMULA_NODE_RESULTS as cE, FRESHNESS as cF, ENTITY_TOKENS as cl, NEWER_FIELD_KINDS as dD, NOT_A_MEMBER_WORDS as dE, ON_DELETE as dG, OVERRIDE_POLICIES as dH, PARITY_FIELD_TYPES as dL, PER_VALUE_ACCESS_WORDS as dM, PIPELINE_RULE_KINDS as dN, PORTAL_ACCENTS as dO, PORTAL_ARCHIVE_FILTERS as dP, KERNEL_TABLES as dt, MERGE_FIELD_MODIFIERS as dw, MERGE_FIELD_SEMANTIC_TYPES as dx, MERGE_FIELD_SOURCES as dy, RELATION_BINDINGS as eG, RELATION_CARDINALITIES as eH, RELATION_FLAVORS as eI, RETIRED_ACTOR_WORDS as eJ, REVERSE_LINKS_PAGE_MAX as eK, REVERSE_LINKS_RECORDS_PER_CALL as eL, ROW_LABEL_FORMULA_MAX_LENGTH as eM, ROW_WEB_NOT_READY as eN, RULE_NODE_KINDS as eO, RULE_USES as eP, STAGE_RULE_ON_FAIL as f$, SHOWN_TO_LABEL as fX, SHOWN_TO_VALUES as fY, SHOWN_TO_WHO_MAY_CHANGE as fZ, STAGE_RULE_ENFORCEMENT as f_, RecordsProvider as fi, STATUS_GROUPS as g0, STATUS_GROUP_WORDS as g1, STORAGE_MODES as g2, STORE_DOORS as g3, STORE_KNOBS as g4, STORE_PERMISSION_LEVELS as g5, STORE_REFUSAL_CODES as g6, SYSTEM_WRITER_WORDS as g7, TABLE_DISPLAYS as gw, TABLE_KIND_PREFIX as gx, TABLE_ORIGINS as gy, TABLE_TYPES as gz, clearsRowLabel as h$, VALUE_ALTERNATE_KEYS as h8, VALUE_ENVELOPE_KEYS as h9, actionRefusals as hH, addressFromText as hI, addressMapUrl as hJ, addressValueText as hK, allowsOtherValues as hL, archivedByLine as hM, archivedWhen as hN, asChoiceNudge as hO, asPermissionLevel as hP, atLeast as hQ, automationWebhookUrl as hR, bookingPath as hS, buttonNeeds as hT, buttonOf as hU, buttonUrlPlaceholders as hV, callersTimeZone as hW, cellMatchesWords as hX, choiceSlug as hY, choiceValuesOf as hZ, choicesOf as h_, optionLabel as i$, coerceTypedAnswer as i0, coerceTypedAnswers as i1, coercionLabel as i2, createOpLedger as i3, decideTypedChoice as i4, declareDrillDefinition as i5, defaultOpLedger as i6, drillAnswerOf as i7, drillFindingKnob as i8, durationText as i9, isOwnOp as iA, isPersonStamp as iB, isPortalAccent as iC, isPortalArchiveFilter as iD, isRecordsErr as iE, isReverseField as iF, isRuleFilter as iG, isShownTo as iH, isTableKind as iI, isTheChosen as iJ, keptGroups as iK, keptOutOfSight as iL, keptTableHref as iM, levelHasShownTo as iN, liftWithheld as iO, looksLikeAnId as iP, mayDrag as iQ, measureKey as iR, mintOpId as iS, moveConsequence as iT, moveInOrder as iU, newerKindExportWords as iV, newerKindOf as iW, newerKindWords as iX, offeredAsContext as iY, ok as iZ, optionKey as i_, emptyArchiveLine as ia, emptyPortalArchiveLine as ib, entityReferenceKinds as ic, entityReferenceKindsOf as id, entityReferenceSearch as ie, entityReferenceWords as ig, entityRefsOf as ih, entityRefsToWrite as ii, err as ij, exportPageXlsx as ik, fieldKindFor as il, fieldKindOf as im, filterWordsOf as io, forgetAllOps as ip, hasQuietHours as iq, highestLevel as ir, holdsARetiredChoice as is, isAddressValue as it, isArchiveLane as iu, isAutomationAppTrigger as iv, isButtonField as iw, isEntityReferenceConfig as ix, isFoundation as iy, isLockedStub as iz, parseFieldDrift as j0, parseTableCopiesInProgress as j1, parseTableDuplicateProgress as j2, parseTableDuplicated as j3, parseTableHome as j4, parseTableMoved as j5, personStampText as j6, portalArchiveConsequence as j7, portalConfirmLine as j8, portalPath as j9, stableFilterKey as jA, statusGroupOf as jB, tableIdOf as jC, tableJsonSchema as jD, tableKindMapping as jE, tableKindSlug as jF, tableRenderSchema as jG, unwrapRecords as jH, useOptionalRecordsClient as jI, useRecordsActor as jJ, useRecordsClient as jK, valueConverts as jL, withCallersClock as jM, withRowCounts as jN, withTablePlacement as jO, portalTitleTypedBack as ja, previewRetype as jb, previewRuleChange as jc, publicFormPath as jd, ratingMaxOf as je, readTypedDuration as jf, recordChangeTrigger as jg, recordSourceKey as jh, recordSourceTable as ji, recordsUseSentence as jj, rehomeSentence as jk, relationNameIndexOf as jl, relationNameKey as jm, relationNamesIn as jn, rememberedOpCount as jo, removedChoicesInUse as jp, richTextPlain as jq, ruleThatRefuses as jr, rulesWithTopStar as js, safeLinkHref as jt, sameDocument as ju, scopeChip as jv, sheetSyncSpec as jw, sourceArchivedOf as jx, splitListCell as jy, splitLockedRows as jz }; export type { AggregateRow as A, RecordsConfig as B, CoercibleField as C, Delivery as D, EntityBackLinkItem as E, FieldTypeWord as F, EntityReferenceKind as G, EntityRefWithWords as H, EntityRef as I, FieldDrift as J, KernelTargets as K, MergeFieldSource as M, NewFieldDeclaration as N, OverridePolicy as O, PermissionLevel as P, RecordsResult as R, StoreFilter as S, TableDuplicateProgress as T, Uuid as U, WriteConflict as W, TableDuplicated as a, CaptureSheetSummary as a$, AbsenceReason as a0, ActionRefusal as a1, ActionRunResult as a2, Actor as a3, AddressPart as a4, AddressValue as a5, AdminTable as a6, AggregateBucket as a7, AggregateCompare as a8, AggregateCompareKind as a9, AutomationRunStatus as aA, AutomationRuns as aB, AutomationSpec as aC, AutomationStep as aD, AutomationTested as aE, AutomationToken as aF, AutomationTrigger as aG, AutomationValue as aH, AutomationValues as aI, AutomationWeekday as aJ, AutomationWhen as aK, BookingAvailability as aO, BookingDeclared as aP, BookingSummary as aQ, BookingWindow as aR, ButtonDoes as aS, ButtonPressed as aT, ButtonSettings as aU, CaptureField as aY, CaptureQuestion as aZ, CaptureSheetFace as a_, AggregateCompareWindows as aa, AggregateDelta as ab, AggregateFilter as ac, AggregateGroupValue as ad, AggregateMeasure as ae, AggregateOperation as af, AggregateWindow as ag, AnonTokenBinding as ah, ArchiveLane as ai, ArchivedChecklistTemplate as aj, ArchivedDoorRow as ak, ArchivedForm as al, ArchivedRow as am, AutomationAction as an, AutomationAppTrigger as ao, AutomationAppTriggerTerms as ap, AutomationComparison as aq, AutomationDeclared as ar, AutomationFilter as as, AutomationFlipped as at, AutomationItem as au, AutomationLastRun as av, AutomationList as aw, AutomationRevision as ax, AutomationRevisions as ay, AutomationRun as az, CaptureFileRef as b, DocUnresolvedToken as b$, ChecklistDeclared as b0, ChecklistRequirement as b1, ChecklistRequirementKind as b2, ChecklistRoleSpec as b3, ChecklistRunStarted as b4, ChecklistRunStep as b5, ChecklistRunSummary as b6, ChecklistSpec as b7, ChecklistStepCompleted as b8, ChecklistStepSpec as b9, DashboardBlock as bE, DashboardBlockKind as bF, DashboardBlockResult as bG, DashboardRunResult as bH, DashboardSummary as bI, DashboardTarget as bJ, DashboardTargetBase as bK, DashboardTargetOp as bL, DashboardTargetResult as bM, DashboardTotals as bN, DataHomeTable as bO, DeclarableFieldKind as bP, DecorationColor as bQ, DecorationPath as bR, DecorationRule as bS, DecorationRuleOp as bT, DecorationTarget as bU, DigestPreview as bV, DocRenderRow as bW, DocSignatureCheck as bX, DocSignatureRow as bY, DocTemplateRow as bZ, DocToken as b_, ChecklistTemplateShape as ba, ChecklistTemplateSummary as bb, ChecklistTrigger as bc, ChecklistTriggerKind as bd, ChoiceCellBack as be, ChoiceLike as bf, ChoiceNudge as bg, ChoiceOption as bh, ChoiceOptions as bi, ChoiceRehome as bj, ChoiceUsage as bk, ChoicesRehomed as bl, CoerceOptions as bm, Coerced as bn, CoercedAnswers as bo, CommentThreadRead as bp, CommentWritten as bq, ComputeOn as br, ContextPolicy$1 as bs, ConversationScope as bt, ConversationScopeContext as bu, CustomFieldTableType as bv, CaptureOutcome as c, FormulaPreview as c$, DrillAdHocOp as c0, DrillAnswer as c1, DrillAnswerRow as c2, DrillChartToken as c3, DrillDeclaration as c4, DrillDefinition as c5, DrillDimension as c6, DrillFinding as c7, DrillGrain as c8, DrillHaving as c9, ExternalPrincipalCard as cA, FieldBehavior as cG, FieldDriftAspect as cH, FieldDuplicated as cI, FieldHistoryEntry as cJ, FieldKind as cK, FieldOptionEdit as cL, FieldProposal as cM, FieldRetypePreview as cN, FieldRetyped as cO, FieldRule as cP, FieldSensitivity as cQ, FieldSource as cR, FilterWords as cS, ForbiddenEnvelopeWord as cT, FormArchiveAnswer as cU, FormLookOptions as cV, FormResults as cW, FormRoute as cX, FormSummary as cY, FormulaHistoryEntry as cZ, FormulaParse as c_, DrillLane as ca, DrillLevel as cb, DrillMeasure as cc, DrillMeasureOp as cd, DrillMeasureWhereValue as ce, DrillPath as cf, DrillQuestion as cg, DrillRecords as ch, DrillRowsPage as ci, DrillSource as cj, DrillView as ck, EnrichAlternate as cm, EnrichCell as cn, EnrichDeclared as co, EnrichDueRow as cp, EnrichRun as cq, EnrichSource as cr, Enrichment as cs, EnrichmentSummary as ct, EntityFieldValue as cu, EntityFieldsAcross as cv, EntityRecordMatch as cw, EntityRecordsFound as cx, EntityRowWritten as cy, EntityToken as cz, MergeFieldSemanticType as d, Pipeline as d$, GridLayout as d0, GridLayoutMode as d1, GridRowHeight as d2, HiddenFieldNotice as d3, HistoryActor as d4, HistoryActorKind as d5, HistoryChange as d6, HistoryRetention as d7, Home as d8, ImportBatchResult as d9, MigrationUndone as dA, MyLevel as dB, MySubscription as dC, NewerFieldKind as dF, OnDelete as dI, OpLedger as dJ, OutsideShareAnswer as dK, ParentExtracted as dQ, ParityFieldType as dR, ParityFieldTypeDescriptor as dS, PerValueAccessWord as dT, PersonStamp as dU, PgError as dV, PickListDocument as dW, PickListIndexDocument as dX, PickListIndexEntry as dY, PickListItem as dZ, PickListItemInput as d_, ImportColumnPlan as da, ImportColumnsDeclared as db, ImportFinished as dc, ImportOpened as dd, ImportOutcome as de, ImportPlan as df, ImportPolicy as dg, ImportProposal as dh, ImportReport as di, ImportRun as dj, InboundAddress as dk, InboundDeclared as dl, InboxCounts as dm, InboxStateChange as dn, InterfaceRead as dp, InterfaceRows as dq, InterfaceRowsField as dr, IoExportPage as ds, KernelTableName as du, KeysetRow as dv, MigrationEntry as dz, MergeFieldModifier as e, RecordHistoryEntry as e$, PipelineColumn as e0, PipelineDeclared as e1, PipelineGate as e2, PipelineGatePreview as e3, PipelineMissingField as e4, PipelineMoveMany as e5, PipelineMoveManyItem as e6, PipelineMoveManyResult as e7, PipelineMoveResult as e8, PipelineMoveVerdict as e9, PredictedRefusal as eA, ProvenancePointer as eB, PublicPicture as eC, PublishBinding as eD, PublishBindingKind as eE, QuietHours as eF, ReadValue as eQ, RecordChange as eR, RecordChangeAction as eS, RecordChangeResult as eT, RecordComment as eU, RecordEvent as eV, RecordFilter as eW, RecordFollowSet as eX, RecordFollowers as eY, RecordGraphWritten as eZ, RecordHeader as e_, PipelineRule as ea, PipelineRuleKind as eb, PipelineSpec as ec, PipelineStage as ed, PipelineVerdict as ee, PortalAccent as ef, PortalArchiveAnswer as eg, PortalArchiveFilter as eh, PortalCard as ei, PortalConfig as ej, PortalConfigInput as ek, PortalFooterLink as el, PortalFormAnswer as em, PortalFormInput as en, PortalFormRef as eo, PortalFormSpec as ep, PortalInvitation as eq, PortalPreviewRow as er, PortalPrincipal as es, PortalRevocation as et, PortalStage as eu, PortalStyle as ev, PortalStyleInput as ew, PortalSummary as ex, PortalTableExposure as ey, PortalTableRef as ez, Timestamp as f, RecordKeysetPage as f0, RecordMoved as f1, RecordPage as f2, RecordRevision as f3, RecordRowControls as f4, RecordScopeComment as f5, RecordScopeContext as f6, RecordScopeField as f7, RecordScopeHistoryEntry as f8, RecordScopeRelation as f9, RelationProperties as fA, RelationTarget as fB, RelationWordsManyArgs as fC, ResolvedPublishBinding as fD, ResolvedPublishBindingKind as fE, RestorePreview as fF, RestoreResult as fG, RetiredActorWord as fH, RetypeBehaviour as fI, RetypePreview as fJ, ReverseLink as fK, ReverseLinksFieldsArgs as fL, ReverseLinksManyArgs as fM, RowActionStep as fN, RowAgentPort as fO, RowAgentTarget as fP, RowDefaultsApplied as fQ, RowTemplateRow as fR, Rule as fS, RuleAnswer as fT, RuleExpression as fU, RuleNodeKind as fV, RuleUse as fW, RecordScopeWithheld as fa, RecordSplit as fb, RecordsActor as fc, RecordsChangeSink as fd, RecordsErrorCode as fe, RecordsErrorSink as ff, RecordsFilter as fg, RecordsMerged as fh, RecordsProviderProps as fj, RecordsRealtimePort as fk, RecordsResolverPort as fl, RecordsResponse as fm, RecordsTableQuery as fn, RegisteredTable as fo, Relation as fp, RelationBinding as fq, RelationCardinality as fr, RelationCarries as fs, RelationCoordinate as ft, RelationDisplay as fu, RelationFlavor as fv, RelationIcons as fw, RelationNameIndex as fx, RelationNameMatch as fy, RelationNamesAnswer as fz, Freshness as g, TableSyncResult as g$, SavedViewColorBy as g8, SavedViewDefinition as g9, TableCapacity as gA, TableCopyInProgress as gB, TableCopySpec as gC, TableDecorations as gD, TableDisplay as gE, TableHome as gF, TableHomeDestination as gG, TableKindFacts as gH, TableLevel as gI, TableLevelApproval as gJ, TableLevelFacts as gK, TableLevelSet as gL, TableListEntry as gM, TableMoved as gN, TableOrigin as gO, TablePlacement as gP, TablePlacementFact as gQ, TableProposal as gR, TableReaderRule as gS, TableRenderSchema as gT, TableRestoreProgress as gU, TableRowCount as gV, TableRowDefaults as gW, TableRowDefaultsPatch as gX, TableRowLabel as gY, TableSchemaMode as gZ, TableSyncAnswer as g_, SavedViewLayout as ga, SavedViewRow as gb, SavedViewSpecIn as gc, ShownTo as gd, SourceArchived as ge, StagePending as gf, StagePendingOnBoard as gg, StageRuleEnforcement as gh, StageRuleOnFail as gi, StageRuleWarning as gj, StaleWriteDetail as gk, StatusGroup as gl, StorageMode as gm, StoreDoorName as gn, StoreRefusalCode as go, StoredRecord as gp, StuckRow as gq, Subscription as gr, SubscriptionBlock as gs, SubscriptionCadence as gt, SubscriptionSpec as gu, SyncAutoRefresh as gv, RecordsDataSource as h, TableSyncSettings as h0, TableSyncSource as h1, TableSyncSourceDocument as h2, TableSyncSpec as h3, TableType as h4, TableWebhook as h5, TableWebhookDeclared as h6, TypedChoiceDecision as h7, WorkOrigin as hA, WorkRecordState as hB, WorkSlotHold as hC, WorkState as hD, WorkTemplateNode as hE, WorkTemplateRelation as hF, WorkTurn as hG, ValueAlternate as ha, ValueAlternateKey as hb, ValueEnvelope as hc, ValueEnvelopeKey as hd, ValueSource as he, ViewLayout as hf, ViewOrderSet as hg, WorkApprovalDecision as hh, WorkApprovalFiled as hi, WorkApprovalState as hj, WorkApprover as hk, WorkAssignment as hl, WorkAssignmentField as hm, WorkChange as hn, WorkDecideMany as ho, WorkDecideManyItem as hp, WorkDecideManyResult as hq, WorkDecideVerdict as hr, WorkDueState as hs, WorkGraph as ht, WorkInboxItem as hu, WorkInboxKind as hv, WorkInboxView as hw, WorkInstantiation as hx, WorkListFlavour as hy, WorkListItem as hz, RecordDocument as i, RecordsClient as j, ReadRow as k, EntityBackLinks as l, RecordsError as m, NewEntityFieldDeclaration as n, EntityRecordRead as o, FieldPatch as p, RecordPageSort as q, TableArchiveProgress as r, EntityFieldRights as s, Field as t, EntityTableFacts as u, RecordRead as v, ReverseColumn as w, ReverseLinks as x, RowAction as y, Table as z };