@ai-matrx/records 0.49.0 → 0.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +47 -0
- package/dist/core/index.cjs +215 -11
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +85 -11
- package/dist/core/index.d.ts +85 -11
- package/dist/core/index.js +215 -11
- package/dist/core/index.js.map +1 -1
- package/dist/{field-z68hD9VX.d.cts → field-xRstzLKK.d.cts} +173 -10
- package/dist/{field-z68hD9VX.d.ts → field-xRstzLKK.d.ts} +173 -10
- package/dist/index.cjs +114 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +152 -3
- package/dist/index.d.ts +152 -3
- package/dist/index.js +114 -7
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +215 -11
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +396 -15
- package/dist/react/index.d.ts +396 -15
- package/dist/react/index.js +215 -11
- package/dist/react/index.js.map +1 -1
- package/dist/use-cases/index.cjs.map +1 -1
- package/dist/use-cases/index.d.cts +1 -1
- package/dist/use-cases/index.d.ts +1 -1
- package/dist/use-cases/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
# Changelog — @ai-matrx/records
|
|
2
2
|
|
|
3
|
+
## 0.51.0
|
|
4
|
+
|
|
5
|
+
**The seal is asked through its own door.** (lane FIX-10B, from VERIFIER-10 finding F6.)
|
|
6
|
+
|
|
7
|
+
* This package published `docSignatureIntact` and did NOT publish `docSignatureRead`, so the
|
|
8
|
+
one screen that shows a signature asked the half that cannot answer. `custom.doc_signature_intact`
|
|
9
|
+
is the INTERNAL half of that pair: SECURITY INVOKER over a doors-only table, so from a browser
|
|
10
|
+
every seal check answered **`42501 permission denied for table doc_signature`** — measured live
|
|
11
|
+
from the admin seat on 2026-09-22, on a signature this lane had just written successfully.
|
|
12
|
+
* `custom.doc_signature_read` is the door built for a client: SECURITY DEFINER, asking
|
|
13
|
+
`assert_client_may_reach` and `assert_client_may_open` on the RECORD by name, and it returns the
|
|
14
|
+
seal AND the verdict in one answer — it calls `doc_signature_intact` itself and merges the
|
|
15
|
+
result, because a seal a person can read and a verdict they cannot is how a changed agreement
|
|
16
|
+
keeps wearing somebody's signature.
|
|
17
|
+
* **`docSignatureIntact` is gone and `docSignatureRead` replaces it.** No deprecated twin: a door
|
|
18
|
+
that cannot answer is not a fallback. One call per signature instead of two.
|
|
19
|
+
* **Consumer action:** replace `client.docSignatureIntact({ signature_id })` with
|
|
20
|
+
`client.docSignatureRead({ signature_id })`. The answer is a superset — the same
|
|
21
|
+
`intact` / `verdict` / `document_unchanged` / `value_unchanged` keys, plus the seal itself
|
|
22
|
+
(`signer_name`, `signed_at`, `document_hash`, `document_version`, `record_id`, `field_key`).
|
|
23
|
+
|
|
24
|
+
## 0.50.0
|
|
25
|
+
|
|
26
|
+
**The store publishes every kind a column can be, and `signature` is one of them.** (lane FIX-10B-F6, from VERIFIER-10 finding F6.)
|
|
27
|
+
|
|
28
|
+
* Under a rendered document on a plumbing company's Crews table the screen said, in its own
|
|
29
|
+
words: *"To ask somebody to sign one of these, Crews needs a signature column — a text
|
|
30
|
+
column whose format is signature. Declare one in section 1 and the button appears here."*
|
|
31
|
+
There is no such control in section 1, and there never was: the only list of column kinds
|
|
32
|
+
any screen could read was `custom.parity_field_types()`, FLD-11's fourteen-row parity
|
|
33
|
+
FLOOR. Every kind that is not on that floor — plain text, long text, number, a
|
|
34
|
+
person-aimed relation and a signature — lived as an inline literal inside
|
|
35
|
+
`custom._field_document_for`. So `custom.doc_sign`, granted to `authenticated` and
|
|
36
|
+
accepting exactly one field shape, could not be reached from the product at all.
|
|
37
|
+
* **`DECLARABLE_FIELD_KINDS` and `DeclarableFieldKind` — the ONE registry**, generated from
|
|
38
|
+
the store's new `custom.field_kinds()` by `pnpm records:generate`. It SELECTS from the
|
|
39
|
+
parity floor rather than restating it, so a fifteenth parity type appears in both the day
|
|
40
|
+
it appears in one. `ParityFieldType` is unchanged and still means what it always meant:
|
|
41
|
+
which of the fourteen a field IS, which is a different question from what a person may
|
|
42
|
+
pick.
|
|
43
|
+
* **`FieldTypeWord` now spans that registry**, so `{ type: "signature" }` is a declaration a
|
|
44
|
+
typed caller can send. `custom._field_document_for` answers to the word (and to `sign`,
|
|
45
|
+
`e_signature`, `esignature`), and its "there is no kind of column called X" refusal now
|
|
46
|
+
names every kind instead of the parity floor alone.
|
|
47
|
+
* Consumer action: none required. `@ai-matrx/records-ui` 0.73.0 puts the kind on the
|
|
48
|
+
Add-field menu.
|
|
49
|
+
|
|
3
50
|
## 0.49.0
|
|
4
51
|
|
|
5
52
|
**A number on a dashboard can be walked into.** (lane DRILL.)
|
package/dist/core/index.cjs
CHANGED
|
@@ -32,10 +32,16 @@ var core_exports = {};
|
|
|
32
32
|
__export(core_exports, {
|
|
33
33
|
ABSENCE_REASONS: () => ABSENCE_REASONS,
|
|
34
34
|
ACTOR_VOCABULARY: () => ACTOR_VOCABULARY,
|
|
35
|
+
ARCHIVE_LANES: () => ARCHIVE_LANES,
|
|
36
|
+
ARCHIVE_LANE_LABEL: () => ARCHIVE_LANE_LABEL,
|
|
37
|
+
ARCHIVE_LANE_MEANS: () => ARCHIVE_LANE_MEANS,
|
|
35
38
|
COMPUTE_ON: () => COMPUTE_ON,
|
|
36
39
|
CONTEXT_POLICIES: () => CONTEXT_POLICIES,
|
|
40
|
+
DECLARABLE_FIELD_KINDS: () => DECLARABLE_FIELD_KINDS,
|
|
41
|
+
DEFAULT_ARCHIVE_LANE: () => DEFAULT_ARCHIVE_LANE,
|
|
37
42
|
DEFAULT_DOCUMENT_MAX_BYTES: () => DEFAULT_DOCUMENT_MAX_BYTES,
|
|
38
43
|
DEFAULT_PAGE_SIZE: () => DEFAULT_PAGE_SIZE,
|
|
44
|
+
DEFAULT_PORTAL_ARCHIVE_FILTER: () => DEFAULT_PORTAL_ARCHIVE_FILTER,
|
|
39
45
|
DEFAULT_VALUE_MAX_BYTES: () => DEFAULT_VALUE_MAX_BYTES,
|
|
40
46
|
DELIVERIES: () => DELIVERIES,
|
|
41
47
|
DOORS: () => DOORS,
|
|
@@ -55,6 +61,7 @@ __export(core_exports, {
|
|
|
55
61
|
PERMISSION_LEVELS: () => PERMISSION_LEVELS,
|
|
56
62
|
PER_VALUE_ACCESS_WORDS: () => PER_VALUE_ACCESS_WORDS,
|
|
57
63
|
PIPELINE_RULE_KINDS: () => PIPELINE_RULE_KINDS,
|
|
64
|
+
PORTAL_ARCHIVE_FILTERS: () => PORTAL_ARCHIVE_FILTERS,
|
|
58
65
|
REFUSALS_WORTH_REPEATING: () => REFUSALS_WORTH_REPEATING,
|
|
59
66
|
RELATION_BINDINGS: () => RELATION_BINDINGS,
|
|
60
67
|
RELATION_CARDINALITIES: () => RELATION_CARDINALITIES,
|
|
@@ -73,6 +80,8 @@ __export(core_exports, {
|
|
|
73
80
|
TABLE_TYPES: () => TABLE_TYPES,
|
|
74
81
|
VALUE_ALTERNATE_KEYS: () => VALUE_ALTERNATE_KEYS,
|
|
75
82
|
VALUE_ENVELOPE_KEYS: () => VALUE_ENVELOPE_KEYS,
|
|
83
|
+
archivedByLine: () => archivedByLine,
|
|
84
|
+
archivedWhen: () => archivedWhen,
|
|
76
85
|
asPermissionLevel: () => asPermissionLevel,
|
|
77
86
|
asWriteConflict: () => asWriteConflict,
|
|
78
87
|
atLeast: () => atLeast,
|
|
@@ -88,6 +97,8 @@ __export(core_exports, {
|
|
|
88
97
|
doorAbsent: () => doorAbsent,
|
|
89
98
|
doorCensus: () => doorCensus,
|
|
90
99
|
doorExists: () => doorExists,
|
|
100
|
+
emptyArchiveLine: () => emptyArchiveLine,
|
|
101
|
+
emptyPortalArchiveLine: () => emptyPortalArchiveLine,
|
|
91
102
|
err: () => err,
|
|
92
103
|
exportCsv: () => exportCsv,
|
|
93
104
|
exportXlsx: () => exportXlsx,
|
|
@@ -99,8 +110,10 @@ __export(core_exports, {
|
|
|
99
110
|
importXlsx: () => importXlsx,
|
|
100
111
|
indexedDbStore: () => indexedDbStore,
|
|
101
112
|
intersectIds: () => intersectIds,
|
|
113
|
+
isArchiveLane: () => isArchiveLane,
|
|
102
114
|
isDecided: () => isDecided,
|
|
103
115
|
isOwnOp: () => isOwnOp,
|
|
116
|
+
isPortalArchiveFilter: () => isPortalArchiveFilter,
|
|
104
117
|
isRecordsErr: () => isRecordsErr,
|
|
105
118
|
isTheChosen: () => isTheChosen,
|
|
106
119
|
looksLikeAnId: () => looksLikeAnId,
|
|
@@ -116,13 +129,17 @@ __export(core_exports, {
|
|
|
116
129
|
optionLabel: () => optionLabel,
|
|
117
130
|
parseCsv: () => parseCsv,
|
|
118
131
|
planQuery: () => planQuery,
|
|
132
|
+
portalArchiveConsequence: () => portalArchiveConsequence,
|
|
133
|
+
portalConfirmLine: () => portalConfirmLine,
|
|
119
134
|
portalPath: () => portalPath,
|
|
135
|
+
portalTitleTypedBack: () => portalTitleTypedBack,
|
|
120
136
|
predictEnvelopeRefusal: () => predictEnvelopeRefusal,
|
|
121
137
|
predictSizeRefusal: () => predictSizeRefusal,
|
|
122
138
|
predictValueRefusals: () => predictValueRefusals,
|
|
123
139
|
predictWriteRefusals: () => predictWriteRefusals,
|
|
124
140
|
publicFormPath: () => publicFormPath,
|
|
125
141
|
rememberedOpCount: () => rememberedOpCount,
|
|
142
|
+
sameDocument: () => sameDocument,
|
|
126
143
|
scopeChip: () => scopeChip,
|
|
127
144
|
stableFilterKey: () => stableFilterKey,
|
|
128
145
|
staleWriteDetail: () => staleWriteDetail,
|
|
@@ -187,6 +204,46 @@ var OVERRIDE_POLICIES = [
|
|
|
187
204
|
var FRESHNESS = ["live", "cached", "snapshot"];
|
|
188
205
|
var TABLE_DISPLAYS = ["list", "grid", "board", "calendar", "timeline"];
|
|
189
206
|
|
|
207
|
+
// src/archive.ts
|
|
208
|
+
var ARCHIVE_LANES = ["mine", "org"];
|
|
209
|
+
var DEFAULT_ARCHIVE_LANE = "org";
|
|
210
|
+
var ARCHIVE_LANE_LABEL = {
|
|
211
|
+
mine: "Archived by me",
|
|
212
|
+
org: "Archived by anyone"
|
|
213
|
+
};
|
|
214
|
+
var ARCHIVE_LANE_MEANS = {
|
|
215
|
+
mine: "The records you archived yourself.",
|
|
216
|
+
org: "Everything anybody in this organization archived, including you."
|
|
217
|
+
};
|
|
218
|
+
function isArchiveLane(word) {
|
|
219
|
+
return typeof word === "string" && ARCHIVE_LANES.includes(word);
|
|
220
|
+
}
|
|
221
|
+
function archivedWhen(at, locale = "en-GB") {
|
|
222
|
+
const when = new Date(at);
|
|
223
|
+
if (Number.isNaN(when.getTime())) return "a moment nobody recorded";
|
|
224
|
+
return new Intl.DateTimeFormat(locale, {
|
|
225
|
+
day: "numeric",
|
|
226
|
+
month: "long",
|
|
227
|
+
year: "numeric",
|
|
228
|
+
hour: "2-digit",
|
|
229
|
+
minute: "2-digit"
|
|
230
|
+
}).format(when);
|
|
231
|
+
}
|
|
232
|
+
function archivedByLine(row, locale = "en-GB") {
|
|
233
|
+
const when = archivedWhen(row.archivedAt, locale);
|
|
234
|
+
const who = (row.archivedByName ?? "").trim();
|
|
235
|
+
if (who === "") {
|
|
236
|
+
return `Archived on ${when}. The store does not know who archived it \u2014 whoever did is no longer in this organization, or it happened before this table kept that.`;
|
|
237
|
+
}
|
|
238
|
+
return `Archived by ${who} on ${when}.`;
|
|
239
|
+
}
|
|
240
|
+
function emptyArchiveLine(lane) {
|
|
241
|
+
return lane === "mine" ? "You have not archived anything in this table. Switch to \u201CArchived by anyone\u201D to see what the rest of the organization has." : "Nothing in this table has been archived. Records you remove from the grid arrive here, and nothing is ever destroyed.";
|
|
242
|
+
}
|
|
243
|
+
function sameDocument(a, b) {
|
|
244
|
+
return JSON.stringify(a) === JSON.stringify(b);
|
|
245
|
+
}
|
|
246
|
+
|
|
190
247
|
// src/level.ts
|
|
191
248
|
var PERMISSION_LEVELS = [
|
|
192
249
|
"viewer",
|
|
@@ -480,6 +537,24 @@ function publicFormPath(formId) {
|
|
|
480
537
|
function portalPath(slug) {
|
|
481
538
|
return `/portal/c/${slug}`;
|
|
482
539
|
}
|
|
540
|
+
var PORTAL_ARCHIVE_FILTERS = ["active", "archived", "all"];
|
|
541
|
+
var DEFAULT_PORTAL_ARCHIVE_FILTER = "active";
|
|
542
|
+
function isPortalArchiveFilter(word) {
|
|
543
|
+
return typeof word === "string" && PORTAL_ARCHIVE_FILTERS.includes(word);
|
|
544
|
+
}
|
|
545
|
+
function portalArchiveConsequence(title, signedIn, invited) {
|
|
546
|
+
const people = invited === 0 ? "Nobody is invited to it" : signedIn === 0 ? `The ${invited} ${invited === 1 ? "person" : "people"} invited to it will not be able to sign in` : `The ${signedIn} ${signedIn === 1 ? "person" : "people"} signed in to it, and the ${invited - signedIn} still invited, will not be able to sign in`;
|
|
547
|
+
return `\u201C${title}\u201D will leave your portal list. ${people}, and their invitation links will say this portal was archived and can be restored. Nothing is deleted \u2014 every Table it shows and everyone invited to it is kept exactly as it is, and you can restore it at any time.`;
|
|
548
|
+
}
|
|
549
|
+
function portalConfirmLine(title) {
|
|
550
|
+
return `Type the portal\u2019s title \u2014 ${title} \u2014 to confirm you mean this one.`;
|
|
551
|
+
}
|
|
552
|
+
function portalTitleTypedBack(typed, title) {
|
|
553
|
+
return typed.trim() === (title ?? "").trim();
|
|
554
|
+
}
|
|
555
|
+
function emptyPortalArchiveLine() {
|
|
556
|
+
return "No portal of this organization has been archived. A portal you put away waits here until somebody restores it, and nothing is ever destroyed.";
|
|
557
|
+
}
|
|
483
558
|
|
|
484
559
|
// src/aggregate.ts
|
|
485
560
|
function measureKey(measure) {
|
|
@@ -850,6 +925,27 @@ var PARITY_FIELD_TYPES = [
|
|
|
850
925
|
{ parity_type: "select", behavior: "list", made_of: "one choice from a Table shown as a list (FLD-5/FLD-6)" },
|
|
851
926
|
{ parity_type: "url", behavior: "text", made_of: "text whose format is url, with the pattern Rule that makes the format enforceable" }
|
|
852
927
|
];
|
|
928
|
+
var DECLARABLE_FIELD_KINDS = [
|
|
929
|
+
{ kind: "attachment", behavior: "relation", parity: true, made_of: "REC-31: a File record reached through a relation, target the kernel `File` Table" },
|
|
930
|
+
{ kind: "checkbox", behavior: "boolean", parity: true, made_of: "a ticked or unticked answer, stored as a REAL boolean \u2014 and a record that never answered holds neither, so filters and group-by see three states, not two" },
|
|
931
|
+
{ kind: "currency", behavior: "range", parity: true, made_of: "FLD-N-1: a number whose UNIT is the currency and whose format is currency \u2014 on the Field, never in presentation" },
|
|
932
|
+
{ kind: "datetime", behavior: "range", parity: true, made_of: "a range of kind date or datetime \u2014 the dated modifier says the VALUES are dated, which is a different question" },
|
|
933
|
+
{ kind: "email", behavior: "text", parity: true, made_of: "text whose format is email" },
|
|
934
|
+
{ kind: "formula", behavior: "formula", parity: true, made_of: "FLD-9: a declared computation, on read or on write, evaluated by custom.rule_eval" },
|
|
935
|
+
{ kind: "long_text", behavior: "text", parity: false, made_of: "behaviour text with format long and config.multiline, for several lines rather than one" },
|
|
936
|
+
{ kind: "lookup", behavior: "formula", parity: true, made_of: "a Value read THROUGH a relation \u2014 config.via names the relation field, config.pick the Value on the far side" },
|
|
937
|
+
{ kind: "member", behavior: "relation", parity: true, made_of: "a person: a relation whose target is the kernel `Person` Table" },
|
|
938
|
+
{ kind: "multi_select", behavior: "list", parity: true, made_of: "many choices from the same Table \u2014 the multi modifier, never a second behaviour" },
|
|
939
|
+
{ kind: "number", behavior: "range", parity: false, made_of: "a plain number: behaviour range with no date kind and neither the currency nor the percent format" },
|
|
940
|
+
{ kind: "percent", behavior: "range", parity: true, made_of: "a number whose unit is % and whose format is percent" },
|
|
941
|
+
{ kind: "phone", behavior: "text", parity: true, made_of: "text whose format is phone" },
|
|
942
|
+
{ kind: "relation", behavior: "relation", parity: false, made_of: "REL / FLD-11: a relation a person aims themselves \u2014 relation_target names a Table of this organization, and it is a BEHAVIOUR, never a parity type of its own" },
|
|
943
|
+
{ kind: "rollup", behavior: "formula", parity: true, made_of: "an aggregate ALONG a relation \u2014 config.via, config.of, config.agg; far-side ids are taken DISTINCT, so nothing is counted twice" },
|
|
944
|
+
{ kind: "select", behavior: "list", parity: true, made_of: "one choice from a Table shown as a list (FLD-5/FLD-6)" },
|
|
945
|
+
{ kind: "signature", behavior: "text", parity: false, made_of: "VAL-10: behaviour text whose format is signature \u2014 the one shape custom.doc_sign accepts, sealed by custom.doc_signature_write and checked by custom.doc_signature_intact" },
|
|
946
|
+
{ kind: "text", behavior: "text", parity: false, made_of: "plain text: behaviour text with no format \u2014 it carries no parity type, which is exactly what custom.parity_type answers for it" },
|
|
947
|
+
{ kind: "url", behavior: "text", parity: true, made_of: "text whose format is url, with the pattern Rule that makes the format enforceable" }
|
|
948
|
+
];
|
|
853
949
|
var RULE_NODE_KINDS = [
|
|
854
950
|
{ node: "actor_at_least", evaluated_by: "PIPELINES" },
|
|
855
951
|
{ node: "add", evaluated_by: "W1-RULE" },
|
|
@@ -1085,6 +1181,7 @@ var STORE_DOORS = [
|
|
|
1085
1181
|
{ name: "field_dependants", args: "p_organization_id uuid, p_field_id uuid", returns: "TABLE(kind text, dependant_id uuid, label text, how text)", security: "definer" },
|
|
1086
1182
|
{ name: "field_history", 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", 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)", security: "definer" },
|
|
1087
1183
|
{ name: "field_kernel_id", args: "", returns: "uuid", security: "invoker" },
|
|
1184
|
+
{ name: "field_kinds", args: "", returns: "TABLE(kind text, behavior text, parity boolean, made_of text)", security: "invoker" },
|
|
1088
1185
|
{ name: "field_options", args: "p_organization_id uuid, p_field_id uuid", returns: "SETOF custom.record", security: "definer" },
|
|
1089
1186
|
{ name: "field_retire", args: "p_organization_id uuid, p_field_id uuid", returns: "boolean", security: "definer" },
|
|
1090
1187
|
{ name: "field_rules", args: "p_field_data jsonb", returns: "TABLE(kind text, spec jsonb)", security: "invoker" },
|
|
@@ -1133,6 +1230,7 @@ var STORE_DOORS = [
|
|
|
1133
1230
|
{ name: "io_export", 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", returns: "jsonb", security: "definer" },
|
|
1134
1231
|
{ name: "io_export_csv", 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", returns: "text", security: "definer" },
|
|
1135
1232
|
{ name: "io_import_begin", 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", returns: "jsonb", security: "definer" },
|
|
1233
|
+
{ name: "io_import_declare_columns", args: "p_organization_id uuid, p_table_id uuid, p_rows jsonb, p_mapping jsonb DEFAULT '{}'::jsonb", returns: "jsonb", security: "definer" },
|
|
1136
1234
|
{ name: "io_import_finish", args: "p_organization_id uuid, p_import_id uuid, p_unmapped text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
1137
1235
|
{ name: "io_import_forget", args: "p_organization_id uuid, p_import_id uuid", returns: "boolean", security: "definer" },
|
|
1138
1236
|
{ name: "io_import_open", 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", returns: "uuid", security: "definer" },
|
|
@@ -1166,6 +1264,7 @@ var STORE_DOORS = [
|
|
|
1166
1264
|
{ name: "levels_raised_by_a_less_specific_rung", args: "", 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)", security: "definer" },
|
|
1167
1265
|
{ name: "list_door_disagreements", args: "p_pretend text DEFAULT NULL::text, p_only_organization uuid DEFAULT NULL::uuid, p_sample integer DEFAULT 200", returns: "TABLE(organization_id uuid, organization_name text, member_id uuid, table_id uuid, record_id uuid, door text, why text)", security: "invoker" },
|
|
1168
1266
|
{ name: "list_door_disagreements", args: "p_pretend text, p_only_organization uuid, p_sample integer, p_exhaustive boolean", returns: "TABLE(organization_id uuid, organization_name text, member_id uuid, table_id uuid, record_id uuid, door text, why text)", security: "invoker" },
|
|
1267
|
+
{ name: "list_portals", args: "p_organization_id uuid, p_archived text DEFAULT 'active'::text", 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)", security: "definer" },
|
|
1169
1268
|
{ name: "lookup_value", args: "p_organization_id uuid, p_record_id uuid, p_field_data jsonb", returns: "jsonb", security: "invoker" },
|
|
1170
1269
|
{ name: "mask_document", args: "p_document jsonb, p_visible_keys text[], p_notices jsonb, p_by_id boolean DEFAULT false, p_key_ids jsonb DEFAULT '{}'::jsonb", returns: "jsonb", security: "invoker" },
|
|
1171
1270
|
{ name: "mask_document", 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[]", returns: "jsonb", security: "invoker" },
|
|
@@ -1215,16 +1314,19 @@ var STORE_DOORS = [
|
|
|
1215
1314
|
{ name: "pipeline_read", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "definer" },
|
|
1216
1315
|
{ name: "pipeline_transition_refusal", args: "p_organization_id uuid, p_record_id uuid, p_to text", returns: "jsonb", security: "definer" },
|
|
1217
1316
|
{ name: "portal_admits", args: "p_organization_id uuid, p_user_id uuid DEFAULT NULL::uuid", returns: "boolean", security: "definer" },
|
|
1317
|
+
{ name: "portal_archive", args: "p_organization_id uuid, p_portal_id uuid, p_confirm_title text, p_reason text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
1218
1318
|
{ name: "portal_card", args: "p_organization_id uuid, p_portal_id uuid", returns: "jsonb", security: "definer" },
|
|
1219
1319
|
{ name: "portal_declare", 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", returns: "uuid", security: "definer" },
|
|
1220
1320
|
{ name: "portal_field_map", args: "p_organization_id uuid, p_table_id uuid", returns: "TABLE(field_id uuid, field_key text, field_type text, points_at uuid)", security: "definer" },
|
|
1221
1321
|
{ name: "portal_invitation", args: "p_slug text, p_email text", returns: "jsonb", security: "definer" },
|
|
1222
1322
|
{ name: "portal_invite", args: "p_organization_id uuid, p_portal_id uuid, p_client_record_id uuid, p_email text, p_user_id uuid DEFAULT NULL::uuid", returns: "jsonb", security: "definer" },
|
|
1323
|
+
{ name: "portal_invite_accept", args: "p_token text", returns: "jsonb", security: "definer" },
|
|
1223
1324
|
{ name: "portal_me", args: "", returns: "jsonb", security: "definer" },
|
|
1224
1325
|
{ name: "portal_preview", args: "p_organization_id uuid, p_portal_id uuid, p_principal_id uuid, p_table_id uuid", returns: "TABLE(record_id uuid, title text)", security: "definer" },
|
|
1225
1326
|
{ name: "portal_principal_bind", args: "p_organization_id uuid, p_principal_id uuid, p_user_id uuid", returns: "jsonb", security: "definer" },
|
|
1226
1327
|
{ name: "portal_public", args: "p_slug text", returns: "jsonb", security: "definer" },
|
|
1227
1328
|
{ name: "portal_record_title", args: "p_organization_id uuid, p_record_id uuid", returns: "text", security: "definer" },
|
|
1329
|
+
{ name: "portal_restore", args: "p_organization_id uuid, p_portal_id uuid, p_confirm_title text", returns: "jsonb", security: "definer" },
|
|
1228
1330
|
{ name: "portal_revoke", args: "p_organization_id uuid, p_portal_id uuid, p_principal_id uuid", returns: "jsonb", security: "definer" },
|
|
1229
1331
|
{ name: "portal_slug", args: "p_organization_id uuid, p_title text, p_portal_id uuid DEFAULT NULL::uuid", returns: "text", security: "definer" },
|
|
1230
1332
|
{ name: "portal_tables", args: "p_organization_id uuid", returns: "TABLE(portal_id uuid, table_id uuid, name text)", security: "definer" },
|
|
@@ -1272,15 +1374,18 @@ var STORE_DOORS = [
|
|
|
1272
1374
|
{ name: "read_paths_outside_the_door", args: "", returns: "TABLE(object_name text, why text)", security: "invoker" },
|
|
1273
1375
|
{ name: "read_record", args: "p_organization_id uuid, p_record_id uuid, p_by_id boolean DEFAULT false", returns: "jsonb", security: "definer" },
|
|
1274
1376
|
{ name: "read_records", 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", returns: "TABLE(id uuid, document jsonb, level permission_level)", security: "definer" },
|
|
1377
|
+
{ name: "read_records_archived", 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", returns: "TABLE(id uuid, document jsonb, level permission_level, archived_at timestamp with time zone, archived_by uuid, archived_by_name text)", security: "definer" },
|
|
1275
1378
|
{ name: "read_records_by_ids", args: "p_organization_id uuid, p_table_id uuid, p_record_ids uuid[], p_by_id boolean DEFAULT false", returns: "TABLE(id uuid, document jsonb, level permission_level)", security: "definer" },
|
|
1276
1379
|
{ name: "read_records_matching", 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", returns: "TABLE(id uuid, document jsonb, level permission_level)", security: "definer" },
|
|
1277
1380
|
{ name: "realtime_topic_admits", args: "p_topic text", returns: "boolean", security: "definer" },
|
|
1278
1381
|
{ name: "record_aggregate", 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", returns: "TABLE(groups jsonb, measures jsonb, row_count bigint)", security: "definer" },
|
|
1279
1382
|
{ name: "record_applicability", args: "p_organization_id uuid, p_record_id uuid", returns: "TABLE(rule_id uuid, rule_name text, rule_version integer, applies boolean, answer jsonb)", security: "invoker" },
|
|
1383
|
+
{ name: "record_archiver", args: "p_organization_id uuid, p_record_id uuid", returns: "uuid", security: "definer" },
|
|
1280
1384
|
{ name: "record_as_of", args: "p_organization_id uuid, p_record_id uuid, p_at timestamp with time zone", returns: "TABLE(state jsonb, replayed boolean)", security: "definer" },
|
|
1281
1385
|
{ name: "record_card", args: "p_viewer uuid, p_organization_id uuid, p_record_id uuid", returns: "jsonb", security: "definer" },
|
|
1282
1386
|
{ name: "record_carrying_edges", args: "p_id uuid, p_data_class text, p_data jsonb, p_deleted_at timestamp with time zone", returns: "TABLE(container_id uuid, item_id uuid, edge_role text)", security: "invoker" },
|
|
1283
1387
|
{ name: "record_delete", args: "p_organization_id uuid, p_record_id uuid", returns: "timestamp with time zone", security: "definer" },
|
|
1388
|
+
{ name: "record_filter_sql", args: "p_filter jsonb", returns: "text", security: "invoker" },
|
|
1284
1389
|
{ name: "record_history", args: "p_organization_id uuid, p_record_id uuid, p_limit integer DEFAULT 200, p_offset integer DEFAULT 0", returns: "TABLE(version integer, occurred_at timestamp with time zone, operation text, operation_label text, actor jsonb, changes jsonb, migration_id uuid, undoable boolean)", security: "definer" },
|
|
1285
1390
|
{ name: "record_platform_keys", args: "", returns: "text[]", security: "invoker" },
|
|
1286
1391
|
{ name: "record_relation_edges", 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", returns: "TABLE(target_id uuid, edge_role text, field_id uuid, ord integer)", security: "invoker" },
|
|
@@ -1369,6 +1474,7 @@ var STORE_DOORS = [
|
|
|
1369
1474
|
{ name: "subscription_mute", args: "p_organization_id uuid, p_rule_id uuid, p_muted boolean DEFAULT true", returns: "boolean", security: "definer" },
|
|
1370
1475
|
{ name: "subscription_preview", args: "p_organization_id uuid, p_rule_id uuid", returns: "jsonb", security: "definer" },
|
|
1371
1476
|
{ name: "subscriptions", args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid", 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)", security: "definer" },
|
|
1477
|
+
{ name: "table_archive", args: "p_organization_id uuid, p_table_id uuid, p_chunk integer DEFAULT 50, p_include_table boolean DEFAULT true", returns: "jsonb", security: "definer" },
|
|
1372
1478
|
{ name: "table_capacity", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "definer" },
|
|
1373
1479
|
{ name: "table_carries_its_rows", args: "p_user_id uuid, p_table_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level", returns: "boolean", security: "definer" },
|
|
1374
1480
|
{ name: "table_column_source", args: "p_organization_id uuid, p_table_id uuid", returns: "text", security: "invoker" },
|
|
@@ -1501,18 +1607,18 @@ var STORE_KNOBS = [
|
|
|
1501
1607
|
{ key: "world_publish_enabled", value: "false", type: "boolean" }
|
|
1502
1608
|
];
|
|
1503
1609
|
var STORE_REFUSAL_CODES = [
|
|
1504
|
-
{ code: "02000", raised_by: "_checklist_instantiate,_table_share_invite_payload,checklist_declare,checklist_run,checklist_step_complete,checklist_step_refusal,checklist_template_shape,conversation_scope_bind,dashboard_delete,dashboard_run,doc_letterhead,doc_render_body,doc_render_document,doc_render_read,doc_sign,doc_signature_intact,doc_signature_read,doc_template_delete,doc_template_read,doc_template_save,enrich_pin,entity_field_retire,entity_field_update,entity_record_read,entity_value_write,external_history_event,external_rows,external_stub_upsert,external_writes_set,io_restore,migrate_delete,migrate_extract_parent,migrate_merge,migrate_reclass,migrate_rename,migrate_reparent,migrate_retype,migrate_split,migrate_undo,organization_clear,portal_card,portal_declare,portal_invite,portal_preview,portal_principal_bind,portal_revoke,read_record,record_delete,record_restore,record_restore_preview,record_table,record_update,relation_uncarry,share_access,share_grant,share_lane_set,share_people,share_revoke,sign_request_cancel,sign_request_create,sign_request_remind,sign_request_unchanged,table_share_outside_accept,table_share_outside_invite,table_share_outside_resend,table_share_outside_revoke,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_assign,work_record_states,work_set_state" },
|
|
1610
|
+
{ code: "02000", raised_by: "_checklist_instantiate,_portal_invite_payload,_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_run,doc_letterhead,doc_render_body,doc_render_document,doc_render_read,doc_sign,doc_signature_intact,doc_signature_read,doc_template_delete,doc_template_read,doc_template_save,enrich_pin,entity_field_retire,entity_field_update,entity_record_read,entity_value_write,external_history_event,external_rows,external_stub_upsert,external_writes_set,io_restore,migrate_delete,migrate_extract_parent,migrate_merge,migrate_reclass,migrate_rename,migrate_reparent,migrate_retype,migrate_split,migrate_undo,organization_clear,portal_archive,portal_card,portal_declare,portal_invite,portal_invite_accept,portal_preview,portal_principal_bind,portal_restore,portal_revoke,read_record,record_delete,record_restore,record_restore_preview,record_table,record_update,relation_uncarry,share_access,share_grant,share_lane_set,share_people,share_revoke,sign_request_cancel,sign_request_create,sign_request_remind,sign_request_unchanged,table_archive,table_share_outside_accept,table_share_outside_invite,table_share_outside_resend,table_share_outside_revoke,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_assign,work_record_states,work_set_state" },
|
|
1505
1611
|
{ code: "0A000", raised_by: "checklist_step_complete,external_rows,external_source_declare,external_write_through,promote_field,promoted_index_expr,promoted_query_sql,promoted_read,rule_eval,work_assign" },
|
|
1506
1612
|
{ code: "22003", raised_by: "context_resolve" },
|
|
1507
|
-
{ code: "22004", raised_by: "_entity_custom_fields_guard,_value_envelope,actor_word,agg_assert_key,agg_sql,anon_capture,anon_token_issue,anon_write,assert_client_may_reach,booking_declare,capture_submit,checklist_declare,context_resolve,dashboard_block_normalize,dashboard_declare,dashboard_window_sql,doc_render_write,doc_sign,doc_signature_write,doc_template_save,enrich_land,enrich_normalize,external_history_event,external_rows,external_source_declare,external_stub_upsert,external_write_through,external_writes_set,field_history,form_declare,form_submit,home_add,io_comment_write,io_import_begin,io_infer_column,io_outbox_drain,io_restore,migrate_choice_keys,migrate_purge,migrate_reclass,migrate_split,migrate_undo,organization_clear,organization_contents,pipeline_declare,pipeline_gate_preview,portal_declare,portal_invite,portal_principal_bind,provenance_retention_days,provenance_write,query_across_homes,query_by_coordinates,query_rollup,record_delete,record_reparent,record_resolve,record_restore,record_update,record_write,record_write_many,relation_carry,relation_own,rule_declare,share_grant,sign_request_create,sign_request_sign,subscription_declare,table_declare,table_share_outside_invite,value_restore,view_declare,work_approval_decide,work_approval_request,work_template_declare" },
|
|
1613
|
+
{ code: "22004", raised_by: "_entity_custom_fields_guard,_share_write_person,_value_envelope,actor_word,agg_assert_key,agg_sql,anon_capture,anon_token_issue,anon_write,assert_client_may_reach,booking_declare,capture_submit,checklist_declare,context_resolve,dashboard_block_normalize,dashboard_declare,dashboard_window_sql,doc_render_write,doc_sign,doc_signature_write,doc_template_save,enrich_land,enrich_normalize,external_history_event,external_rows,external_source_declare,external_stub_upsert,external_write_through,external_writes_set,field_history,form_declare,form_submit,home_add,io_comment_write,io_import_begin,io_infer_column,io_outbox_drain,io_restore,migrate_choice_keys,migrate_purge,migrate_reclass,migrate_split,migrate_undo,organization_clear,organization_contents,pipeline_declare,pipeline_gate_preview,portal_declare,portal_invite,portal_principal_bind,provenance_retention_days,provenance_write,query_across_homes,query_by_coordinates,query_rollup,record_delete,record_reparent,record_resolve,record_restore,record_update,record_write,record_write_many,relation_carry,relation_own,rule_declare,share_grant,sign_request_create,sign_request_sign,subscription_declare,table_archive,table_declare,table_share_outside_invite,value_restore,view_declare,work_approval_decide,work_approval_request,work_template_declare" },
|
|
1508
1614
|
{ code: "22007", raised_by: "dashboard_window_sql" },
|
|
1509
1615
|
{ code: "22012", raised_by: "rule_eval" },
|
|
1510
|
-
{ code: "22023", raised_by: "_booking_availability,_entity_custom_fields_guard,_take_op_id,_value_envelope,_work_shape_guard,actor_word,agg_assert_key,agg_sql,anon_token_issue,booking_declare,containment_parent,dashboard_block_normalize,dashboard_window_sql,doc_render_body,doc_render_write,doc_signature_write,enrich_declare,enrich_land,enrich_normalize,enrich_pin,entity_value_write,external_history_event,external_source_declare,external_stub_upsert,external_write_through,field_history,field_update,io_export,io_import_begin,io_import_finish,io_import_plan,io_import_report,io_proposal_accept,migrate_merge,migrate_reclass,my_levels,organization_clear,page_size,pin_agent_cells,pipeline_move,portal_declare,provenance_write,query_by_coordinates,query_rollup,record_update,record_write_many,relation_carry,rule_eval,rule_members,share_grant,share_lane_set,sign_request_create,sign_request_sign,subscription_declare,table_rules,visibility_as_of,work_approval_request,work_list,work_slot_hold" },
|
|
1511
|
-
{ code: "23503", raised_by: "_booking_availability,_checklist_instantiate,_containment_guard,_display_spec_for,_field_document_for,_pipeline_stage_key,_record_rule_uses,agg_digest_assemble,anon_publish,anon_rate_take,anon_token_issue,anon_write,assert_organization_wall,booking_cancel,booking_confirm,booking_declare,booking_hold,booking_reschedule,capture_publish,checklist_declare,checklist_steps_table,comment_write,dashboard_declare,delete_rule,doc_sign,doc_template_save,enrich_declare,enrich_due,enrich_land,form_declare,form_submit,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,pipeline_board,pipeline_declare,pipeline_move,pipeline_read,pipeline_transition_refusal,promote_field,promote_table,record_applicability,record_reparent,relation_carry,relation_own,resolve_first_match,rule_applies,rule_declare,rule_eval,rule_members,rule_run,sign_request_create,subscription_mute,subscription_preview,view_declare,work_set_state,work_take_assignment,work_template_instantiate" },
|
|
1512
|
-
{ code: "23505", raised_by: "_unique_rule_holds,doc_sign,doc_signature_write,entity_field_declare,field_declare,home_add,inbound_declare,io_proposal_accept,relation_carry,relation_own,
|
|
1513
|
-
{ code: "23514", raised_by: "_checklist_instantiate,_checklist_step_guard,_containment_guard,_dated_values_guard,_derived_fields,_display_spec_for,_entity_custom_fields_guard,_field_class_guard,_field_document_for,_field_shape_guard,_field_type_parity_guard,_merge_field_shape_guard,_merge_field_temporal_guard,_promoted_field_cap_guard,_record_rule_uses,_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,assert_columns_are_defined,assert_entity_is_organization_scoped,booking_declare,capture_publish,capture_sheet_declare,checklist_declare,checklist_step_complete,doc_sign,doc_signature_write,doc_template_save,entity_field_declare,entity_field_retire,entity_field_update,entity_records_find,entity_table,field_declare,field_retire,field_update,home_add,io_import_rows,migrate_merge,relation_carry,relation_own,sign_request_create,sign_request_sign,table_declare,validate_value_envelope,validate_values,work_set_state,work_slots_declare,work_take_assignment,work_template_instantiate" },
|
|
1616
|
+
{ code: "22023", raised_by: "_booking_availability,_entity_custom_fields_guard,_take_op_id,_value_envelope,_work_shape_guard,actor_word,agg_assert_key,agg_sql,anon_token_issue,booking_declare,containment_parent,dashboard_block_normalize,dashboard_window_sql,doc_render_body,doc_render_write,doc_signature_write,enrich_declare,enrich_land,enrich_normalize,enrich_pin,entity_value_write,external_history_event,external_source_declare,external_stub_upsert,external_write_through,field_history,field_update,io_export,io_import_begin,io_import_finish,io_import_plan,io_import_report,io_proposal_accept,list_portals,migrate_merge,migrate_reclass,my_levels,organization_clear,page_size,pin_agent_cells,pipeline_move,portal_declare,provenance_write,query_by_coordinates,query_rollup,read_records_archived,record_update,record_write_many,relation_carry,rule_eval,rule_members,share_grant,share_lane_set,sign_request_create,sign_request_sign,subscription_declare,table_rules,visibility_as_of,work_approval_request,work_list,work_slot_hold" },
|
|
1617
|
+
{ code: "23503", raised_by: "_booking_availability,_checklist_instantiate,_containment_guard,_display_spec_for,_field_document_for,_field_type_parity_guard,_pipeline_stage_key,_record_rule_uses,agg_digest_assemble,anon_publish,anon_rate_take,anon_token_issue,anon_write,assert_organization_wall,booking_cancel,booking_confirm,booking_declare,booking_hold,booking_reschedule,capture_publish,checklist_declare,checklist_steps_table,comment_write,dashboard_declare,delete_rule,doc_sign,doc_template_save,enrich_declare,enrich_due,enrich_land,form_declare,form_submit,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,pipeline_board,pipeline_declare,pipeline_move,pipeline_read,pipeline_transition_refusal,promote_field,promote_table,record_applicability,record_reparent,relation_carry,relation_own,resolve_first_match,rule_applies,rule_declare,rule_eval,rule_members,rule_run,sign_request_create,subscription_mute,subscription_preview,view_declare,work_set_state,work_take_assignment,work_template_instantiate" },
|
|
1618
|
+
{ code: "23505", raised_by: "_share_write_person,_unique_rule_holds,doc_sign,doc_signature_write,entity_field_declare,field_declare,home_add,inbound_declare,io_proposal_accept,relation_carry,relation_own,sign_request_cancel,sign_request_create,table_share_outside_resend,work_approval_decide,work_slot_hold" },
|
|
1619
|
+
{ code: "23514", raised_by: "_checklist_instantiate,_checklist_step_guard,_containment_guard,_dated_values_guard,_derived_fields,_display_spec_for,_entity_custom_fields_guard,_field_class_guard,_field_document_for,_field_shape_guard,_field_type_parity_guard,_merge_field_shape_guard,_merge_field_temporal_guard,_promoted_field_cap_guard,_record_rule_uses,_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,assert_columns_are_defined,assert_entity_is_organization_scoped,booking_declare,capture_publish,capture_sheet_declare,checklist_declare,checklist_step_complete,doc_sign,doc_signature_write,doc_template_save,entity_field_declare,entity_field_retire,entity_field_update,entity_records_find,entity_table,field_declare,field_retire,field_update,home_add,io_comment_write,io_import_rows,migrate_merge,portal_archive,portal_restore,relation_carry,relation_own,sign_request_create,sign_request_sign,table_declare,validate_value_envelope,validate_values,work_set_state,work_slots_declare,work_take_assignment,work_template_instantiate" },
|
|
1514
1620
|
{ code: "40001", raised_by: "has_visibility_at" },
|
|
1515
|
-
{ code: "42501", raised_by: "_doc_render_immutable,_doc_signature_immutable,_field_definition_write,_field_write_door,_rule_definition_write,_store_door,anon_capture,anon_inbound_land,anon_publish,anon_token_issue,anon_token_verify,anon_write,assert_client_may_change,assert_client_may_open,assert_client_may_reach,assert_may_know_table,assert_organization_admin,assert_store_door,booking_confirm,booking_declare,booking_hold,capture_submit,checklist_run,comment_write,conversation_scope_bind,conversation_scope_unbind,enrich_declare,enrich_due,enrich_land,enrich_normalize,entity_field_declare,entity_field_retire,entity_field_update,entity_value_write,external_write_through,form_declare,form_submit,inbound_mail_land,io_comment_resolve,io_comment_write,io_import_begin,io_import_finish,io_restore,migrate_purge,migrate_reclass,my_levels,organization_clear,portal_declare,portal_invitation,portal_invite,portal_principal_bind,promote_table,query_visibility_parity,read_record,read_records,read_records_by_ids,record_table,share_grant,subscription_mute,subscription_preview,table_share_outside_accept,table_share_outside_invite,table_share_outside_resend,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_person" },
|
|
1621
|
+
{ code: "42501", raised_by: "_doc_render_immutable,_doc_signature_immutable,_field_definition_write,_field_write_door,_rule_definition_write,_store_door,agent_table_claim,anon_capture,anon_inbound_land,anon_publish,anon_token_issue,anon_token_verify,anon_write,assert_client_may_change,assert_client_may_open,assert_client_may_reach,assert_may_know_table,assert_organization_admin,assert_store_door,booking_confirm,booking_declare,booking_hold,capture_submit,checklist_run,comment_write,conversation_scope_bind,conversation_scope_unbind,doc_sign,enrich_declare,enrich_due,enrich_land,enrich_normalize,entity_field_declare,entity_field_retire,entity_field_update,entity_value_write,external_write_through,form_declare,form_submit,inbound_mail_land,io_comment_resolve,io_comment_write,io_import_begin,io_import_finish,io_restore,migrate_purge,migrate_reclass,my_levels,organization_clear,portal_declare,portal_invitation,portal_invite,portal_invite_accept,portal_principal_bind,promote_table,query_visibility_parity,read_record,read_records,read_records_archived,read_records_by_ids,read_records_matching,record_table,share_grant,subscription_mute,subscription_preview,table_share_outside_accept,table_share_outside_invite,table_share_outside_resend,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_person" },
|
|
1516
1622
|
{ code: "42703", raised_by: "entity_table,portal_declare" },
|
|
1517
1623
|
{ code: "53400", raised_by: "anon_rate_take,delete_cascade_closure,enrich_due,enrich_land,promote_field" },
|
|
1518
1624
|
{ code: "54001", raised_by: "record_delete" },
|
|
@@ -2408,6 +2514,7 @@ var ENTITY_TOKENS = [
|
|
|
2408
2514
|
"template_scope_types",
|
|
2409
2515
|
"templates",
|
|
2410
2516
|
"test_handset_inbox",
|
|
2517
|
+
"test_handset_verification",
|
|
2411
2518
|
"thread",
|
|
2412
2519
|
"tool",
|
|
2413
2520
|
"tool_binding",
|
|
@@ -2617,6 +2724,14 @@ var DOORS = {
|
|
|
2617
2724
|
// `custom.record_filter_sql`, the one body `custom.agg_sql` also calls, so the
|
|
2618
2725
|
// rows it opens are the rows the number counted.
|
|
2619
2726
|
readRecordsMatching: "read_records_matching",
|
|
2727
|
+
// THE SAME READ DOOR, ADDRESSED BY ABSENCE. Every door above answers LIVE rows
|
|
2728
|
+
// only — each of them hard-codes `and r.deleted_at is null` — so until this one
|
|
2729
|
+
// existed no screen could list an archived record however it was written, and
|
|
2730
|
+
// `record_restore` below had nothing that could reach it (VERIFIER-10 F4).
|
|
2731
|
+
// `custom.read_records_archived` is that body with the sign of one comparison
|
|
2732
|
+
// flipped, plus the two facts only an archive needs: who archived it and when.
|
|
2733
|
+
// A separate NAME for the same reason as its two siblings above.
|
|
2734
|
+
readRecordsArchived: "read_records_archived",
|
|
2620
2735
|
// DOOR-8, the two clocks. `p_recorded_at` is what the store SAID then;
|
|
2621
2736
|
// `p_world_on` is what was TRUE of the world on that date, read out of dated
|
|
2622
2737
|
// values. A client that answered either one itself would be guessing.
|
|
@@ -2763,6 +2878,7 @@ var DOORS = {
|
|
|
2763
2878
|
// ways to start an import from one client is how they drift.
|
|
2764
2879
|
importPlan: "io_import_plan",
|
|
2765
2880
|
importBegin: "io_import_begin",
|
|
2881
|
+
importDeclareColumns: "io_import_declare_columns",
|
|
2766
2882
|
importRows: "io_import_rows",
|
|
2767
2883
|
importFinish: "io_import_finish",
|
|
2768
2884
|
importReport: "io_import_report",
|
|
@@ -2799,6 +2915,17 @@ var DOORS = {
|
|
|
2799
2915
|
portalInvite: "portal_invite",
|
|
2800
2916
|
portalRevoke: "portal_revoke",
|
|
2801
2917
|
portalPreview: "portal_preview",
|
|
2918
|
+
// ORG-CLEANUP, 2026-09-22 — A PORTAL IS ARCHIVED, NEVER DELETED.
|
|
2919
|
+
// `portals` keeps its signature and HIDES archived portals (the law's default
|
|
2920
|
+
// is to hide); `list_portals(org, 'active'|'archived'|'all')` is the
|
|
2921
|
+
// archive-aware reader, taking the platform archive filter's own three values
|
|
2922
|
+
// so one door serves both lanes and no screen has to invent a second control.
|
|
2923
|
+
// `portal_archive` / `portal_restore` are the way out and the way back; both
|
|
2924
|
+
// take the portal's own title typed back, because ten portals can carry one
|
|
2925
|
+
// title and the title alone is not what picks this one.
|
|
2926
|
+
listPortals: "list_portals",
|
|
2927
|
+
portalArchive: "portal_archive",
|
|
2928
|
+
portalRestore: "portal_restore",
|
|
2802
2929
|
// SCR-16 — the canvas. A dashboard is a record in the presentation kernel
|
|
2803
2930
|
// whose blocks are saved SPECS for the eighth verb; `dashboardRun` walks them
|
|
2804
2931
|
// under the CALLER'S principal, so nothing here is precomputed and nothing is
|
|
@@ -2911,7 +3038,14 @@ var DOORS = {
|
|
|
2911
3038
|
docTokens: "doc_tokens",
|
|
2912
3039
|
docUnresolvedTokens: "doc_unresolved_tokens",
|
|
2913
3040
|
docSign: "doc_sign",
|
|
2914
|
-
|
|
3041
|
+
// THE SEAL IS ASKED THROUGH ITS OWN DOOR. `custom.doc_signature_intact` is the INTERNAL
|
|
3042
|
+
// half of this pair — SECURITY INVOKER over a doors-only table, so a browser that calls it
|
|
3043
|
+
// gets `42501 permission denied for table doc_signature`, which is what every SignBlock
|
|
3044
|
+
// seal check got until 2026-09-22 (FIX-10B). `custom.doc_signature_read` is the definer
|
|
3045
|
+
// door built for a client: it asks may_reach and may_open on the RECORD by name and
|
|
3046
|
+
// returns the seal AND the verdict in one answer, because a seal a person can read and a
|
|
3047
|
+
// verdict they cannot is how a changed agreement keeps wearing somebody's signature.
|
|
3048
|
+
docSignatureRead: "doc_signature_read",
|
|
2915
3049
|
// THE PLURAL ACTS. Until 2026-09-20 this package read `custom.doc_template`,
|
|
2916
3050
|
// `custom.doc_render` and `custom.doc_signature` with a direct PostgREST
|
|
2917
3051
|
// `.from()`, and all three hold NO client SELECT — so every list in product #5
|
|
@@ -3316,6 +3450,34 @@ function createRecordsClient(config) {
|
|
|
3316
3450
|
})
|
|
3317
3451
|
);
|
|
3318
3452
|
},
|
|
3453
|
+
async listArchived({ table_id, lane = DEFAULT_ARCHIVE_LANE, limit = 50, offset = 0 }) {
|
|
3454
|
+
const door = await callDoor(
|
|
3455
|
+
DOORS.readRecordsArchived,
|
|
3456
|
+
{
|
|
3457
|
+
p_organization_id: org,
|
|
3458
|
+
p_table_id: table_id,
|
|
3459
|
+
p_lane: lane,
|
|
3460
|
+
p_limit: limit,
|
|
3461
|
+
p_offset: offset
|
|
3462
|
+
},
|
|
3463
|
+
"listArchived"
|
|
3464
|
+
);
|
|
3465
|
+
if (!door.ok) return err(door.error);
|
|
3466
|
+
const rows = (door.data ?? []).map((row) => {
|
|
3467
|
+
const { document, hidden } = unfold(row.document);
|
|
3468
|
+
return {
|
|
3469
|
+
id: row.id,
|
|
3470
|
+
document,
|
|
3471
|
+
level: row.level,
|
|
3472
|
+
hidden,
|
|
3473
|
+
archivedAt: row.archived_at,
|
|
3474
|
+
archivedBy: row.archived_by ?? null,
|
|
3475
|
+
archivedByName: row.archived_by_name ?? null
|
|
3476
|
+
};
|
|
3477
|
+
});
|
|
3478
|
+
const total = rows.length < limit ? offset + rows.length : null;
|
|
3479
|
+
return ok({ rows, total });
|
|
3480
|
+
},
|
|
3319
3481
|
async list({ table_id, filter, limit = 50, offset = 0 }) {
|
|
3320
3482
|
const door = await callDoor(
|
|
3321
3483
|
DOORS.readRecordsMatching,
|
|
@@ -3805,6 +3967,18 @@ function createRecordsClient(config) {
|
|
|
3805
3967
|
"importBegin"
|
|
3806
3968
|
);
|
|
3807
3969
|
},
|
|
3970
|
+
async importDeclareColumns(args) {
|
|
3971
|
+
return callDoor(
|
|
3972
|
+
DOORS.importDeclareColumns,
|
|
3973
|
+
{
|
|
3974
|
+
p_organization_id: org,
|
|
3975
|
+
p_table_id: args.table_id,
|
|
3976
|
+
p_rows: args.rows,
|
|
3977
|
+
p_mapping: args.mapping ?? {}
|
|
3978
|
+
},
|
|
3979
|
+
"importDeclareColumns"
|
|
3980
|
+
);
|
|
3981
|
+
},
|
|
3808
3982
|
async importRows(args) {
|
|
3809
3983
|
return callDoor(
|
|
3810
3984
|
DOORS.importRows,
|
|
@@ -3875,6 +4049,36 @@ function createRecordsClient(config) {
|
|
|
3875
4049
|
async portals() {
|
|
3876
4050
|
return callDoor(DOORS.portals, { p_organization_id: org }, "portals");
|
|
3877
4051
|
},
|
|
4052
|
+
async listPortals(args) {
|
|
4053
|
+
return callDoor(
|
|
4054
|
+
DOORS.listPortals,
|
|
4055
|
+
{ p_organization_id: org, p_archived: args?.archived ?? "active" },
|
|
4056
|
+
"listPortals"
|
|
4057
|
+
);
|
|
4058
|
+
},
|
|
4059
|
+
async portalArchive(args) {
|
|
4060
|
+
return callDoor(
|
|
4061
|
+
DOORS.portalArchive,
|
|
4062
|
+
{
|
|
4063
|
+
p_organization_id: org,
|
|
4064
|
+
p_portal_id: args.portal_id,
|
|
4065
|
+
p_confirm_title: args.confirm_title,
|
|
4066
|
+
p_reason: args.reason ?? null
|
|
4067
|
+
},
|
|
4068
|
+
"portalArchive"
|
|
4069
|
+
);
|
|
4070
|
+
},
|
|
4071
|
+
async portalRestore(args) {
|
|
4072
|
+
return callDoor(
|
|
4073
|
+
DOORS.portalRestore,
|
|
4074
|
+
{
|
|
4075
|
+
p_organization_id: org,
|
|
4076
|
+
p_portal_id: args.portal_id,
|
|
4077
|
+
p_confirm_title: args.confirm_title
|
|
4078
|
+
},
|
|
4079
|
+
"portalRestore"
|
|
4080
|
+
);
|
|
4081
|
+
},
|
|
3878
4082
|
async portalTables() {
|
|
3879
4083
|
return callDoor(DOORS.portalTables, { p_organization_id: org }, "portalTables");
|
|
3880
4084
|
},
|
|
@@ -4463,11 +4667,11 @@ function createRecordsClient(config) {
|
|
|
4463
4667
|
"commentResolve"
|
|
4464
4668
|
);
|
|
4465
4669
|
},
|
|
4466
|
-
async
|
|
4670
|
+
async docSignatureRead({ signature_id }) {
|
|
4467
4671
|
return callDoor(
|
|
4468
|
-
DOORS.
|
|
4672
|
+
DOORS.docSignatureRead,
|
|
4469
4673
|
{ p_organization_id: org, p_signature_id: signature_id },
|
|
4470
|
-
"
|
|
4674
|
+
"docSignatureRead"
|
|
4471
4675
|
);
|
|
4472
4676
|
},
|
|
4473
4677
|
// ── the anonymous lane ───────────────────────────────────────────────
|