@ai-matrx/records 0.4.1 → 0.6.2
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 +106 -0
- package/dist/core/index.cjs +140 -38
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +32 -2
- package/dist/core/index.d.ts +32 -2
- package/dist/core/index.js +140 -38
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +85 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +335 -40
- package/dist/index.d.ts +335 -40
- package/dist/index.js +85 -38
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +175 -38
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +393 -40
- package/dist/react/index.d.ts +393 -40
- package/dist/react/index.js +175 -38
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,111 @@
|
|
|
1
1
|
# Changelog — @ai-matrx/records
|
|
2
2
|
|
|
3
|
+
## 0.6.2
|
|
4
|
+
|
|
5
|
+
The generated store contract, regenerated at 279 doors. 0.6.1's gate was red on
|
|
6
|
+
nothing but the count: the door catalogue is asserted EQUAL to the live store's,
|
|
7
|
+
and other lanes landed a door in the ten minutes between the regeneration and
|
|
8
|
+
the publish. No source change and no consumer action.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## 0.6.1
|
|
12
|
+
|
|
13
|
+
0.6.0's release gate caught four things the live store had changed since the
|
|
14
|
+
contract was generated, and this is all four.
|
|
15
|
+
|
|
16
|
+
- **`54001` is a refusal class this package now knows.** `custom.record_delete`
|
|
17
|
+
stops a cascade that nests past sixty-four levels of containment — a loop
|
|
18
|
+
somebody built rather than a hierarchy — and it is a `store_limit`.
|
|
19
|
+
- **The generated contract is regenerated at 278 doors.**
|
|
20
|
+
- **The signed-out reach assertion excludes trigger functions**, for the reason
|
|
21
|
+
`platform.reopen_declared_doors` excludes them: they have no direct call
|
|
22
|
+
surface, so a grant on one says nothing about who can reach the store. Two
|
|
23
|
+
store triggers another lane landed turned it red while nothing about the
|
|
24
|
+
store's reach had changed.
|
|
25
|
+
- **The read door decides the organization WALL before the switch.** It opens
|
|
26
|
+
with `custom.assert_may_know_table`, so a person outside an organization is
|
|
27
|
+
told they are not a member and is never told whether the store is on for it.
|
|
28
|
+
The adapter suite accepts both of the store's own sentences and no third one.
|
|
29
|
+
|
|
30
|
+
### Consumer action
|
|
31
|
+
|
|
32
|
+
None.
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
## 0.6.0
|
|
36
|
+
|
|
37
|
+
**A column can be added.** The store grew the three doors a Field always needed
|
|
38
|
+
and this package carries them.
|
|
39
|
+
|
|
40
|
+
- **`fieldDeclare`, `fieldUpdate`, `fieldRetire`** on the client, and
|
|
41
|
+
`useFieldMutation()` in `/react`. Until now a Field was written with
|
|
42
|
+
`recordWrite` into the field kernel, and that could never work: the one write
|
|
43
|
+
door writes `data_class = 'record'` and cannot ALSO add the key to the Table
|
|
44
|
+
record's `fields` array, which the store's field guard requires before it
|
|
45
|
+
accepts any definition at all. Every screen that tried ended on *"the table
|
|
46
|
+
does not declare a field called … — declare it there first"*.
|
|
47
|
+
- **`NewFieldDeclaration`** — what a PERSON says when they add a column: a
|
|
48
|
+
parity type, a name, and for a choice list the choices themselves. The store
|
|
49
|
+
turns that into the behaviour, modifiers, format, unit, relation target,
|
|
50
|
+
relation maximum, compute_on and attached Rules its own guards demand, so a
|
|
51
|
+
client states an intention and never re-derives thirteen types of its own.
|
|
52
|
+
- **`FieldPatch`** — a field's own settings. What a field HOLDS is a conversion
|
|
53
|
+
and the door refuses it here by name.
|
|
54
|
+
- The generated store contract is refreshed to the live 260-door registry.
|
|
55
|
+
|
|
56
|
+
### Consumer action
|
|
57
|
+
|
|
58
|
+
Nothing breaks. A host that writes Fields with `recordWrite` should move to
|
|
59
|
+
`useFieldMutation().declare` — the old path is the defect, not a deprecation.
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
## 0.5.2
|
|
63
|
+
|
|
64
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
65
|
+
`git diff npm/records/v0.5.1..npm/records/v0.5.2 -- apps/shared/records`).
|
|
66
|
+
No source changes intended and no consumer action required.
|
|
67
|
+
|
|
68
|
+
## 0.5.1
|
|
69
|
+
|
|
70
|
+
Refreshes the generated store contract to the live 240-door registry caught by
|
|
71
|
+
the blocking release guard after 0.5.0 was tagged.
|
|
72
|
+
|
|
73
|
+
### Consumer action
|
|
74
|
+
|
|
75
|
+
None. The two new door entries are additive generated contract data.
|
|
76
|
+
|
|
77
|
+
## 0.5.0
|
|
78
|
+
|
|
79
|
+
**Two refusal classes the store really raises, which this package answered with
|
|
80
|
+
"something this package does not recognise".** Both were found by walking the
|
|
81
|
+
real product on 2026-09-19, and in both the screen showed the store's own
|
|
82
|
+
sentence — honest, but the class was nameable and this package had not named it.
|
|
83
|
+
|
|
84
|
+
- **`57014` — the store cancelled the statement at its own timeout.** Seen on an
|
|
85
|
+
organization whose Table kernel is large enough for `custom.read_records` to
|
|
86
|
+
run out of time. It is now `timed_out`, which is, with `stale_read`, one of
|
|
87
|
+
only two refusals in the vocabulary worth REPEATING: nothing was refused on
|
|
88
|
+
its merits and nothing was written, so a screen can offer "try again" honestly
|
|
89
|
+
instead of showing a failure a person cannot act on.
|
|
90
|
+
- **`22P02` — a value that does not fit the type the store holds for it.** Seen
|
|
91
|
+
as `invalid input syntax for type uuid: "open"`, writing the text `open` into
|
|
92
|
+
an organization's copy of a package Table whose `status` Field was uuid-shaped.
|
|
93
|
+
It is `invalid_argument`, which is what it is: the CALL is wrong for the shape
|
|
94
|
+
the store holds, and the store's own message names the value and the type.
|
|
95
|
+
|
|
96
|
+
Both are proved against the LIVE store in `src/__tests__/real-doors.test.ts`:
|
|
97
|
+
the SQLSTATEs are raised by the real database inside the suite's own
|
|
98
|
+
rolled-back transaction and read back out of psql's verbose report, and the only
|
|
99
|
+
thing asserted about this package is what it makes of them. Each case is RED
|
|
100
|
+
without its map entry (`expected 'internal' to be 'timed_out'`).
|
|
101
|
+
|
|
102
|
+
### Consumer action
|
|
103
|
+
|
|
104
|
+
`RecordsErrorCode` gains one member, `timed_out`. A host that switches
|
|
105
|
+
exhaustively over the union must add an arm for it; every other host needs
|
|
106
|
+
nothing beyond taking `latest`. A host that was special-casing `internal` to
|
|
107
|
+
recognise a timeout by its message text should branch on `timed_out` instead.
|
|
108
|
+
|
|
3
109
|
## 0.4.1
|
|
4
110
|
|
|
5
111
|
Carries the live Supabase adapter proof through the shared npm publishing lane
|
package/dist/core/index.cjs
CHANGED
|
@@ -230,7 +230,7 @@ var STORE_DOORS = [
|
|
|
230
230
|
{ name: "agg_buckets", args: "", returns: "text[]", security: "invoker" },
|
|
231
231
|
{ name: "agg_deliver", 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", returns: "uuid", security: "invoker" },
|
|
232
232
|
{ name: "agg_digest_run", args: "p_organization_id uuid, p_rule_id uuid DEFAULT NULL::uuid, p_since timestamp with time zone DEFAULT NULL::timestamp with time zone", returns: "integer", security: "invoker" },
|
|
233
|
-
{ name: "agg_explain", 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", returns: "jsonb", security: "
|
|
233
|
+
{ name: "agg_explain", 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", returns: "jsonb", security: "definer" },
|
|
234
234
|
{ name: "agg_operations", args: "", returns: "text[]", security: "invoker" },
|
|
235
235
|
{ name: "agg_sql", 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: "text", security: "invoker" },
|
|
236
236
|
{ name: "agg_subscription_cadences", args: "", returns: "text[]", security: "invoker" },
|
|
@@ -249,7 +249,10 @@ var STORE_DOORS = [
|
|
|
249
249
|
{ name: "anon_write", args: "p_secret text, p_origin text, p_payload jsonb, p_client_key text DEFAULT NULL::text, p_raw_payload jsonb DEFAULT '{}'::jsonb", returns: "uuid", security: "definer" },
|
|
250
250
|
{ name: "applicable_fields", args: "p_organization_id uuid, p_table_id uuid, p_record_type text DEFAULT NULL::text", returns: "SETOF custom.record", security: "definer" },
|
|
251
251
|
{ name: "assert_client_may_change", 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", returns: "void", security: "invoker" },
|
|
252
|
+
{ name: "assert_client_may_open", 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", returns: "void", security: "invoker" },
|
|
252
253
|
{ name: "assert_client_may_reach", args: "p_organization_id uuid, p_door text", returns: "void", security: "invoker" },
|
|
254
|
+
{ name: "assert_may_know_table", args: "p_organization_id uuid, p_table_id uuid, p_door text", returns: "void", security: "invoker" },
|
|
255
|
+
{ name: "assert_organization_admin", args: "p_organization_id uuid, p_door text, p_what text", returns: "void", security: "invoker" },
|
|
253
256
|
{ name: "assert_organization_wall", args: "p_kind text, p_organization_id uuid, p_row jsonb", returns: "void", security: "invoker" },
|
|
254
257
|
{ name: "assert_store_door", args: "p_organization_id uuid, p_door text", returns: "void", security: "invoker" },
|
|
255
258
|
{ name: "bump_epoch", args: "p_entity_type text, p_entity_id uuid, p_organization_id uuid DEFAULT NULL::uuid", returns: "bigint", security: "definer" },
|
|
@@ -261,7 +264,10 @@ var STORE_DOORS = [
|
|
|
261
264
|
{ name: "containment_depth_ceiling", args: "p_organization_id uuid DEFAULT NULL::uuid", returns: "integer", security: "invoker" },
|
|
262
265
|
{ name: "containment_edges", args: "p_organization_id uuid", returns: "TABLE(parent_id uuid, child_id uuid, via text)", security: "invoker" },
|
|
263
266
|
{ name: "containment_parent", args: "p_data jsonb", returns: "uuid", security: "invoker" },
|
|
267
|
+
{ name: "cross_organization_links_open", args: "p_source_organization_id uuid, p_target_organization_id uuid", returns: "boolean", security: "invoker" },
|
|
264
268
|
{ name: "custom_fields_tables", args: "", returns: "TABLE(token text, schema_name text, table_name text)", security: "invoker" },
|
|
269
|
+
{ name: "delete_cascade_closure", args: "p_organization_id uuid, p_record_id uuid", returns: "uuid[]", security: "invoker" },
|
|
270
|
+
{ name: "delete_rule", args: "p_organization_id uuid, p_record_id uuid, p_apply boolean DEFAULT true", returns: "jsonb", security: "definer" },
|
|
265
271
|
{ name: "dependency_cycle", args: "p_organization_id uuid, p_row custom.record", returns: "text[]", security: "invoker" },
|
|
266
272
|
{ name: "dependency_label", args: "p_organization_id uuid, p_node text", returns: "text", security: "invoker" },
|
|
267
273
|
{ name: "derive_visibility", args: "p_container_type text, p_container_id uuid", returns: "TABLE(item_type text, item_id uuid, depth integer, max_level permission_level)", security: "definer" },
|
|
@@ -282,6 +288,8 @@ var STORE_DOORS = [
|
|
|
282
288
|
{ name: "doc_unresolved_tokens", args: "p_organization_id uuid, p_table_id uuid, p_body text", returns: "TABLE(raw text, field_id uuid, why text)", security: "invoker" },
|
|
283
289
|
{ name: "doors_not_deciding_the_caller", args: "", returns: "TABLE(function_name text, identity_args text)", security: "invoker" },
|
|
284
290
|
{ name: "doors_not_deciding_the_record", args: "", returns: "TABLE(function_name text, identity_args text, why text)", security: "invoker" },
|
|
291
|
+
{ name: "doors_not_on_one_ladder", args: "", returns: "TABLE(function_name text, identity_args text, why text)", security: "invoker" },
|
|
292
|
+
{ name: "effective_level", args: "p_user_id uuid, p_organization_id uuid, p_id uuid, p_type text DEFAULT 'record'::text", returns: "permission_level", security: "definer" },
|
|
285
293
|
{ name: "export_records", args: "p_organization_id uuid, p_table_id uuid, p_limit integer DEFAULT 1000", returns: "TABLE(id uuid, document jsonb)", security: "invoker" },
|
|
286
294
|
{ name: "external_foreign_table_findings", args: "", returns: "SETOF text", security: "definer" },
|
|
287
295
|
{ name: "external_history_event", args: "p_organization_id uuid, p_link_id uuid, p_operation text", returns: "bigint", security: "definer" },
|
|
@@ -291,16 +299,25 @@ var STORE_DOORS = [
|
|
|
291
299
|
{ name: "external_tier_contract", args: "", returns: "jsonb", security: "definer" },
|
|
292
300
|
{ name: "external_write_through", args: "p_organization_id uuid, p_record_id uuid, p_patch jsonb", returns: "void", security: "definer" },
|
|
293
301
|
{ name: "external_writes_set", args: "p_organization_id uuid, p_source_id uuid, p_enabled boolean", returns: "boolean", security: "definer" },
|
|
302
|
+
{ name: "field_behaviour", args: "p_field_data jsonb", returns: "text", security: "invoker" },
|
|
303
|
+
{ name: "field_declare", args: "p_organization_id uuid, p_table_id uuid, p_spec jsonb", returns: "uuid", security: "definer" },
|
|
294
304
|
{ name: "field_dependants", args: "p_organization_id uuid, p_field_id uuid", returns: "TABLE(kind text, dependant_id uuid, label text, how text)", security: "invoker" },
|
|
295
305
|
{ name: "field_kernel_id", args: "", returns: "uuid", security: "invoker" },
|
|
296
|
-
{ name: "field_options", args: "p_organization_id uuid, p_field_id uuid", returns: "SETOF custom.record", security: "
|
|
306
|
+
{ name: "field_options", args: "p_organization_id uuid, p_field_id uuid", returns: "SETOF custom.record", security: "definer" },
|
|
307
|
+
{ name: "field_retire", args: "p_organization_id uuid, p_field_id uuid", returns: "boolean", security: "definer" },
|
|
297
308
|
{ name: "field_rules", args: "p_field_data jsonb", returns: "TABLE(kind text, spec jsonb)", security: "invoker" },
|
|
309
|
+
{ name: "field_update", args: "p_organization_id uuid, p_field_id uuid, p_patch jsonb", returns: "uuid", security: "definer" },
|
|
310
|
+
{ name: "field_value_convert", args: "p_to jsonb, p_value jsonb", returns: "jsonb", security: "invoker" },
|
|
298
311
|
{ name: "file_kernel_id", args: "", returns: "uuid", security: "invoker" },
|
|
299
312
|
{ name: "formula_value", args: "p_organization_id uuid, p_record_id uuid, p_field_data jsonb, p_values jsonb DEFAULT NULL::jsonb", returns: "jsonb", security: "invoker" },
|
|
300
313
|
{ name: "has_visibility", args: "p_user_id uuid, p_type text, p_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level", returns: "boolean", security: "definer" },
|
|
301
314
|
{ name: "has_visibility_at", 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", returns: "boolean", security: "definer" },
|
|
302
315
|
{ name: "hidden_field_notice", args: "p_field custom.record, p_action text DEFAULT 'read'::text", returns: "jsonb", security: "invoker" },
|
|
303
|
-
{ name: "
|
|
316
|
+
{ name: "history_prune", args: "p_organization_id uuid, p_scope text DEFAULT 'values'::text, p_table_id uuid DEFAULT NULL::uuid, p_dry_run boolean DEFAULT true", returns: "jsonb", security: "definer" },
|
|
317
|
+
{ name: "history_retention", args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid", returns: "jsonb", security: "definer" },
|
|
318
|
+
{ name: "history_retention_floor_raise", args: "p_organization_id uuid, p_days integer", returns: "integer", security: "definer" },
|
|
319
|
+
{ name: "history_retention_set", args: "p_organization_id uuid, p_table_id uuid, p_days integer", returns: "integer", security: "definer" },
|
|
320
|
+
{ name: "home_add", args: "p_organization_id uuid, p_table_id uuid, p_home_record_id uuid", returns: "uuid", security: "definer" },
|
|
304
321
|
{ name: "home_relations", args: "", returns: "TABLE(table_id uuid, home_record_id uuid, organization_id uuid, relation_id uuid)", security: "invoker" },
|
|
305
322
|
{ name: "index_payload", args: "p_organization_id uuid, p_table_id uuid, p_limit integer DEFAULT 1000", returns: "TABLE(id uuid, searchable text)", security: "invoker" },
|
|
306
323
|
{ name: "intern_provenance", args: "p_data jsonb", returns: "jsonb", security: "invoker" },
|
|
@@ -312,7 +329,7 @@ var STORE_DOORS = [
|
|
|
312
329
|
{ name: "io_csv_escape", args: "p_value text, p_delimiter text DEFAULT ','::text", returns: "text", security: "invoker" },
|
|
313
330
|
{ name: "io_csv_parse", args: "p_text text, p_delimiter text DEFAULT NULL::text", returns: "TABLE(row_number integer, cells text[])", security: "invoker" },
|
|
314
331
|
{ 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" },
|
|
315
|
-
{ 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
|
|
332
|
+
{ 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" },
|
|
316
333
|
{ 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" },
|
|
317
334
|
{ name: "io_import_rows", args: "p_organization_id uuid, p_import_id uuid, p_rows jsonb, p_mapping jsonb DEFAULT '{}'::jsonb", returns: "jsonb", security: "definer" },
|
|
318
335
|
{ name: "io_infer_type", args: "p_samples jsonb", returns: "text", security: "invoker" },
|
|
@@ -323,23 +340,26 @@ var STORE_DOORS = [
|
|
|
323
340
|
{ name: "io_proposal_reject", args: "p_organization_id uuid, p_import_id uuid, p_column text", returns: "boolean", security: "definer" },
|
|
324
341
|
{ name: "io_record_changed", args: "", returns: "trigger", security: "definer" },
|
|
325
342
|
{ name: "io_restore", args: "p_organization_id uuid, p_record_id uuid, p_version integer", returns: "integer", security: "definer" },
|
|
326
|
-
{ name: "io_revisions", args: "p_organization_id uuid, p_record_id uuid", returns: "TABLE(version integer, changed_at timestamp with time zone, changed_by uuid, summary text)", security: "definer" },
|
|
343
|
+
{ name: "io_revisions", args: "p_organization_id uuid, p_record_id uuid", returns: "TABLE(version integer, changed_at timestamp with time zone, changed_by uuid, summary text, operation text, changed_fields jsonb)", security: "definer" },
|
|
327
344
|
{ name: "lookup_value", args: "p_organization_id uuid, p_record_id uuid, p_field_data jsonb", returns: "jsonb", security: "invoker" },
|
|
328
345
|
{ 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" },
|
|
329
346
|
{ 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" },
|
|
330
347
|
{ name: "merge_field_kernel_id", args: "", returns: "uuid", security: "invoker" },
|
|
331
|
-
{ name: "migrate_delete", args: "p_organization_id uuid, p_record_id uuid, p_note text DEFAULT NULL::text", returns: "jsonb", security: "
|
|
332
|
-
{ name: "migrate_demote", args: "p_organization_id uuid, p_table_id uuid, p_note text DEFAULT NULL::text", returns: "jsonb", security: "
|
|
333
|
-
{ name: "migrate_extract_parent", args: "p_organization_id uuid, p_id uuid, p_parent_table_id uuid, p_moved_keys text[], p_note text DEFAULT NULL::text", returns: "jsonb", security: "
|
|
334
|
-
{ name: "migrate_merge", args: "p_organization_id uuid, p_winner_id uuid, p_loser_id uuid, p_note text DEFAULT NULL::text", returns: "jsonb", security: "
|
|
335
|
-
{ name: "migrate_promote", args: "p_organization_id uuid, p_table_id uuid, p_note text DEFAULT NULL::text", returns: "jsonb", security: "
|
|
336
|
-
{ name: "migrate_purge", args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid, p_dry_run boolean DEFAULT true", returns: "jsonb", security: "
|
|
337
|
-
{ name: "migrate_rename", args: "p_organization_id uuid, p_id uuid, p_to text, p_note text DEFAULT NULL::text", returns: "jsonb", security: "
|
|
338
|
-
{ name: "migrate_reparent", args: "p_organization_id uuid, p_id uuid, p_parent_id uuid, p_note text DEFAULT NULL::text", returns: "jsonb", security: "
|
|
348
|
+
{ name: "migrate_delete", args: "p_organization_id uuid, p_record_id uuid, p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
349
|
+
{ name: "migrate_demote", args: "p_organization_id uuid, p_table_id uuid, p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
350
|
+
{ name: "migrate_extract_parent", args: "p_organization_id uuid, p_id uuid, p_parent_table_id uuid, p_moved_keys text[], p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
351
|
+
{ name: "migrate_merge", args: "p_organization_id uuid, p_winner_id uuid, p_loser_id uuid, p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
352
|
+
{ name: "migrate_promote", args: "p_organization_id uuid, p_table_id uuid, p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
353
|
+
{ name: "migrate_purge", args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid, p_dry_run boolean DEFAULT true", returns: "jsonb", security: "definer" },
|
|
354
|
+
{ name: "migrate_rename", args: "p_organization_id uuid, p_id uuid, p_to text, p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
355
|
+
{ name: "migrate_reparent", args: "p_organization_id uuid, p_id uuid, p_parent_id uuid, p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
339
356
|
{ name: "migrate_retype", args: "p_organization_id uuid, p_id uuid, p_to text, p_note text DEFAULT NULL::text", returns: "jsonb", security: "invoker" },
|
|
340
|
-
{ name: "migrate_split", args: "p_organization_id uuid, p_record_id uuid, p_moved_keys text[], p_note text DEFAULT NULL::text", returns: "jsonb", security: "
|
|
357
|
+
{ name: "migrate_split", args: "p_organization_id uuid, p_record_id uuid, p_moved_keys text[], p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
358
|
+
{ name: "migrate_undo", args: "p_organization_id uuid, p_log_id uuid", returns: "jsonb", security: "definer" },
|
|
341
359
|
{ name: "organization_kernel_id", args: "", returns: "uuid", security: "invoker" },
|
|
342
360
|
{ name: "organization_references", args: "p_kind text, p_organization_id uuid, p_row jsonb", returns: "TABLE(site text, what text, ref_id uuid, openable boolean)", security: "invoker" },
|
|
361
|
+
{ name: "owning_table", args: "p_organization_id uuid, p_record_id uuid", returns: "uuid", security: "invoker" },
|
|
362
|
+
{ name: "owning_table_gone", args: "p_organization_id uuid, p_record_id uuid", returns: "boolean", security: "invoker" },
|
|
343
363
|
{ name: "parity_field_types", args: "", returns: "TABLE(parity_type text, behavior text, made_of text)", security: "invoker" },
|
|
344
364
|
{ name: "parity_type", args: "p_field_data jsonb", returns: "text", security: "invoker" },
|
|
345
365
|
{ name: "parity_values", args: "p_organization_id uuid, p_record_id uuid", 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)", security: "invoker" },
|
|
@@ -359,38 +379,47 @@ var STORE_DOORS = [
|
|
|
359
379
|
{ name: "promoted_value_path", args: "p_field_data jsonb", returns: "text", security: "invoker" },
|
|
360
380
|
{ name: "promotion_inline_ceiling", args: "", returns: "integer", security: "invoker" },
|
|
361
381
|
{ name: "query_access_ids", args: "p_organization_id uuid, p_required text DEFAULT 'viewer'::text", returns: "uuid[]", security: "invoker" },
|
|
362
|
-
{ name: "query_across_homes", 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", returns: "TABLE(record_id uuid, home_record_id uuid, data jsonb, created_at timestamp with time zone)", security: "
|
|
363
|
-
{ name: "query_by_coordinates", 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", returns: "TABLE(record_id uuid, table_id uuid, data jsonb, coordinates_matched integer)", security: "
|
|
364
|
-
{ name: "query_can_see", args: "p_organization_id uuid, p_record_id uuid, p_required text DEFAULT 'viewer'::text", returns: "boolean", security: "
|
|
382
|
+
{ name: "query_across_homes", 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", returns: "TABLE(record_id uuid, home_record_id uuid, data jsonb, created_at timestamp with time zone)", security: "definer" },
|
|
383
|
+
{ name: "query_by_coordinates", 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", returns: "TABLE(record_id uuid, table_id uuid, data jsonb, coordinates_matched integer)", security: "definer" },
|
|
384
|
+
{ name: "query_can_see", args: "p_organization_id uuid, p_record_id uuid, p_required text DEFAULT 'viewer'::text", returns: "boolean", security: "definer" },
|
|
365
385
|
{ name: "query_hot_paths", args: "", returns: "TABLE(name text, statement text)", security: "invoker" },
|
|
366
386
|
{ name: "query_hot_paths_prepared", args: "", returns: "TABLE(name text, prepared boolean, generic_plans bigint)", security: "invoker" },
|
|
367
387
|
{ name: "query_is_store_owner", args: "", returns: "boolean", security: "invoker" },
|
|
368
388
|
{ name: "query_prepare_hot", args: "", returns: "integer", security: "invoker" },
|
|
369
389
|
{ name: "query_principal", args: "", returns: "uuid", security: "invoker" },
|
|
370
|
-
{ name: "query_record_as_of", 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", returns: "jsonb", security: "
|
|
371
|
-
{ name: "query_relation_edges", args: "p_organization_id uuid, p_flavor text DEFAULT NULL::text, p_role text DEFAULT NULL::text", returns: "TABLE(parent_id uuid, child_id uuid, role text, flavor text)", security: "
|
|
372
|
-
{ name: "query_rollup", 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", returns: "TABLE(record_id uuid, depth integer)", security: "
|
|
373
|
-
{ name: "query_rollup_sum", 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", returns: "numeric", security: "
|
|
374
|
-
{ name: "query_table_as_of", 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", returns: "TABLE(record_id uuid, data jsonb)", security: "
|
|
375
|
-
{ name: "query_table_homes", args: "p_organization_id uuid, p_table_id uuid", returns: "SETOF uuid", security: "
|
|
376
|
-
{ name: "
|
|
390
|
+
{ name: "query_record_as_of", 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", returns: "jsonb", security: "definer" },
|
|
391
|
+
{ name: "query_relation_edges", args: "p_organization_id uuid, p_flavor text DEFAULT NULL::text, p_role text DEFAULT NULL::text", returns: "TABLE(parent_id uuid, child_id uuid, role text, flavor text)", security: "definer" },
|
|
392
|
+
{ name: "query_rollup", 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", returns: "TABLE(record_id uuid, depth integer)", security: "definer" },
|
|
393
|
+
{ name: "query_rollup_sum", 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", returns: "numeric", security: "definer" },
|
|
394
|
+
{ name: "query_table_as_of", 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", returns: "TABLE(record_id uuid, data jsonb)", security: "definer" },
|
|
395
|
+
{ name: "query_table_homes", args: "p_organization_id uuid, p_table_id uuid", returns: "SETOF uuid", security: "definer" },
|
|
396
|
+
{ name: "query_visibility_parity", args: "p_organization_id uuid", 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)", security: "definer" },
|
|
397
|
+
{ name: "query_visible_ids", args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid, p_required text DEFAULT 'viewer'::text", returns: "SETOF uuid", security: "definer" },
|
|
377
398
|
{ name: "reachable_from", args: "p_organization_id uuid, p_roots uuid[]", returns: "TABLE(record_id uuid, depth integer, via text)", security: "invoker" },
|
|
378
399
|
{ name: "read_paths_outside_the_door", args: "", returns: "TABLE(object_name text, why text)", security: "invoker" },
|
|
379
400
|
{ name: "read_record", args: "p_organization_id uuid, p_record_id uuid, p_by_id boolean DEFAULT false", returns: "jsonb", security: "definer" },
|
|
380
401
|
{ 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" },
|
|
381
|
-
{ 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: "
|
|
402
|
+
{ 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" },
|
|
382
403
|
{ 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" },
|
|
404
|
+
{ name: "record_card", args: "p_viewer uuid, p_organization_id uuid, p_record_id uuid", returns: "jsonb", security: "definer" },
|
|
405
|
+
{ 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" },
|
|
383
406
|
{ name: "record_delete", args: "p_organization_id uuid, p_record_id uuid", returns: "timestamp with time zone", security: "definer" },
|
|
384
|
-
{ name: "
|
|
407
|
+
{ 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" },
|
|
408
|
+
{ name: "record_reparent", args: "p_organization_id uuid, p_record_id uuid, p_parent_id uuid", returns: "void", security: "definer" },
|
|
409
|
+
{ name: "record_resolve", args: "p_organization_id uuid, p_id uuid", returns: "jsonb", security: "definer" },
|
|
385
410
|
{ name: "record_restore", args: "p_organization_id uuid, p_record_id uuid", returns: "void", security: "definer" },
|
|
411
|
+
{ name: "record_state_as_of", args: "p_record_id uuid, p_at timestamp with time zone", returns: "TABLE(state jsonb, replayed boolean)", security: "definer" },
|
|
386
412
|
{ name: "record_update", args: "p_organization_id uuid, p_record_id uuid, p_patch jsonb, p_expected_version integer DEFAULT NULL::integer", returns: "integer", security: "definer" },
|
|
387
413
|
{ name: "record_values", args: "p_organization_id uuid, p_record_id uuid", returns: "jsonb", security: "invoker" },
|
|
388
|
-
{ name: "record_values_versioned", args: "p_organization_id uuid, p_record_id uuid", 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)", security: "
|
|
414
|
+
{ name: "record_values_versioned", args: "p_organization_id uuid, p_record_id uuid", 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)", security: "definer" },
|
|
389
415
|
{ name: "record_write", args: "p_organization_id uuid, p_table_id uuid, p_data jsonb", returns: "uuid", security: "definer" },
|
|
390
|
-
{ name: "
|
|
416
|
+
{ name: "relation_carry", args: "p_organization_id uuid, p_container_id uuid, p_item_id uuid", returns: "uuid", security: "definer" },
|
|
417
|
+
{ name: "relation_own", args: "p_organization_id uuid, p_owner_id uuid, p_target_id uuid", returns: "uuid", security: "definer" },
|
|
418
|
+
{ name: "relation_target_card", args: "p_organization_id uuid, p_record_id uuid, p_via_key text DEFAULT NULL::text", returns: "TABLE(target_id uuid, target_organization_id uuid, is_foreign boolean, masked boolean, reader_level permission_level, card jsonb, why text)", security: "definer" },
|
|
391
419
|
{ name: "relation_target_external", args: "p_connection_token text, p_external_table text, p_external_key text", returns: "jsonb", security: "definer" },
|
|
392
420
|
{ name: "relation_target_ours", args: "p_entity_token text, p_row_id uuid", returns: "jsonb", security: "definer" },
|
|
393
|
-
{ name: "relation_targets", args: "p_organization_id uuid, p_record_id uuid, p_via_key text", returns: "SETOF uuid", security: "
|
|
421
|
+
{ name: "relation_targets", args: "p_organization_id uuid, p_record_id uuid, p_via_key text", returns: "SETOF uuid", security: "definer" },
|
|
422
|
+
{ name: "relation_uncarry", args: "p_organization_id uuid, p_container_id uuid, p_item_id uuid", returns: "integer", security: "definer" },
|
|
394
423
|
{ name: "reopen_declared_doors", args: "", returns: "TABLE(reopened text)", security: "definer" },
|
|
395
424
|
{ name: "required_epoch", args: "p_container_type text, p_container_id uuid, p_item_type text, p_item_id uuid", returns: "bigint", security: "definer" },
|
|
396
425
|
{ name: "resolve_first_match", args: "p_organization_id uuid, p_record_id uuid", returns: "jsonb", security: "invoker" },
|
|
@@ -411,6 +440,14 @@ var STORE_DOORS = [
|
|
|
411
440
|
{ name: "rule_truth", args: "p_answer jsonb", returns: "boolean", security: "invoker" },
|
|
412
441
|
{ name: "rule_uses", args: "", returns: "text[]", security: "invoker" },
|
|
413
442
|
{ name: "rule_version", args: "p_organization_id uuid, p_rule_id uuid", returns: "integer", security: "invoker" },
|
|
443
|
+
{ name: "share_access", args: "p_organization_id uuid, p_subject_id uuid", 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)", security: "definer" },
|
|
444
|
+
{ name: "share_grant", 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", returns: "jsonb", security: "definer" },
|
|
445
|
+
{ name: "share_lane_set", args: "p_organization_id uuid, p_subject_id uuid, p_choice text, p_level permission_level DEFAULT NULL::permission_level", returns: "jsonb", security: "definer" },
|
|
446
|
+
{ name: "share_lanes", args: "", returns: "TABLE(choice text, lane text, discoverable boolean, label text, means text)", security: "definer" },
|
|
447
|
+
{ name: "share_levels", args: "", returns: "TABLE(level permission_level, ordinal integer, label text, means text)", security: "definer" },
|
|
448
|
+
{ name: "share_people", args: "p_organization_id uuid, p_subject_id uuid DEFAULT NULL::uuid, p_query text DEFAULT NULL::text, p_limit integer DEFAULT 25", returns: "TABLE(user_id uuid, email text, display_name text, membership text, already_at permission_level, already_why text)", security: "definer" },
|
|
449
|
+
{ name: "share_revoke", args: "p_organization_id uuid, p_subject_id uuid, p_principal_kind text, p_principal_id uuid", returns: "jsonb", security: "definer" },
|
|
450
|
+
{ name: "share_subject_name", args: "p_organization_id uuid, p_type text, p_id uuid", returns: "text", security: "definer" },
|
|
414
451
|
{ name: "size_refusal", args: "p_organization_id uuid, p_data jsonb", returns: "text", security: "invoker" },
|
|
415
452
|
{ name: "source_next_pointer", args: "p_sources jsonb", returns: "text", security: "invoker" },
|
|
416
453
|
{ name: "source_pointer", args: "p_sources jsonb, p_source jsonb", returns: "text", security: "invoker" },
|
|
@@ -418,14 +455,17 @@ var STORE_DOORS = [
|
|
|
418
455
|
{ name: "storage_modes", args: "", returns: "text[]", security: "invoker" },
|
|
419
456
|
{ name: "store_is_open", args: "p_organization_id uuid DEFAULT NULL::uuid", returns: "boolean", security: "invoker" },
|
|
420
457
|
{ name: "table_capacity", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "definer" },
|
|
458
|
+
{ name: "table_contents", args: "p_organization_id uuid, p_table_id uuid", returns: "TABLE(record_id uuid, kind text, goes_at integer)", security: "invoker" },
|
|
421
459
|
{ name: "table_declare", args: "p_organization_id uuid, p_spec jsonb", returns: "uuid", security: "definer" },
|
|
460
|
+
{ name: "table_is_live", args: "p_organization_id uuid, p_table_id uuid", returns: "boolean", security: "invoker" },
|
|
422
461
|
{ name: "table_kernel_id", args: "", returns: "uuid", security: "invoker" },
|
|
423
462
|
{ name: "table_record_ceiling", args: "", returns: "integer", security: "invoker" },
|
|
424
463
|
{ name: "table_record_ceiling", args: "p_organization_id uuid", returns: "integer", security: "invoker" },
|
|
425
464
|
{ name: "table_rules", args: "p_organization_id uuid, p_table_id uuid, p_use text, p_record_type text DEFAULT NULL::text", returns: "SETOF custom.record", security: "invoker" },
|
|
426
465
|
{ name: "table_storage", args: "p_organization_id uuid, p_table_id uuid", returns: "text", security: "invoker" },
|
|
427
466
|
{ name: "table_type_field", args: "p_organization_id uuid, p_table_id uuid", returns: "text", security: "invoker" },
|
|
428
|
-
{ name: "tables_at_home", args: "p_organization_id uuid, p_home_ids uuid[]", returns: "TABLE(table_id uuid, home_record_id uuid, kind text)", security: "
|
|
467
|
+
{ name: "tables_at_home", args: "p_organization_id uuid, p_home_ids uuid[]", returns: "TABLE(table_id uuid, home_record_id uuid, kind text)", security: "definer" },
|
|
468
|
+
{ name: "tables_described_without_asking", args: "", returns: "TABLE(function_name text, identity_args text, why text)", security: "invoker" },
|
|
429
469
|
{ name: "trg_associations_bump_visibility", args: "", returns: "trigger", security: "definer" },
|
|
430
470
|
{ name: "validate_custom_fields", args: "p_token text, p_organization_id uuid, p_values jsonb", returns: "void", security: "invoker" },
|
|
431
471
|
{ name: "validate_value_envelope", args: "p_organization_id uuid, p_fields custom.record[], p_data jsonb", returns: "void", security: "invoker" },
|
|
@@ -437,6 +477,7 @@ var STORE_DOORS = [
|
|
|
437
477
|
{ name: "value_read", args: "p_organization_id uuid, p_record_id uuid, p_key text", 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)", security: "invoker" },
|
|
438
478
|
{ name: "value_versions", args: "p_old jsonb, p_new jsonb", returns: "jsonb", security: "invoker" },
|
|
439
479
|
{ name: "visibility_ancestors", args: "p_item_type text, p_item_id uuid", returns: "TABLE(container_type text, container_id uuid, depth integer, max_level permission_level)", security: "definer" },
|
|
480
|
+
{ name: "visibility_as_of", args: "p_organization_id uuid, p_record_id uuid, p_at timestamp with time zone", 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)", security: "definer" },
|
|
440
481
|
{ name: "visibility_cache_rebuild", args: "", returns: "integer", security: "definer" },
|
|
441
482
|
{ name: "visibility_parity", args: "", 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)", security: "definer" },
|
|
442
483
|
{ name: "visibility_warm", args: "p_container_type text, p_container_id uuid", returns: "integer", security: "definer" },
|
|
@@ -475,6 +516,7 @@ var STORE_KNOBS = [
|
|
|
475
516
|
{ key: "consumer_saved_ai_outputs_enabled", value: "false", type: "boolean" },
|
|
476
517
|
{ key: "consumer_scopes_enabled", value: "false", type: "boolean" },
|
|
477
518
|
{ key: "containment_depth_ceiling", value: "16", type: "integer" },
|
|
519
|
+
{ key: "cross_organization_links", value: "false", type: "boolean" },
|
|
478
520
|
{ key: "document_max_bytes", value: "1048576", type: "integer" },
|
|
479
521
|
{ key: "emergency_door_guard", value: "false", type: "boolean" },
|
|
480
522
|
{ key: "emergency_door_sweep_enabled", value: "false", type: "boolean" },
|
|
@@ -484,6 +526,8 @@ var STORE_KNOBS = [
|
|
|
484
526
|
{ key: "field_index_guard", value: "false", type: "boolean" },
|
|
485
527
|
{ key: "field_sensitivity_levels", value: '{"edit": {"public": "editor", "internal": "editor", "restricted": "admin", "confidential": "admin"}, "read": {"public": "viewer", "internal": "viewer", "restricted": "admin", "confidential": "editor"}}', type: "json" },
|
|
486
528
|
{ key: "member_default_level", value: '"viewer"', type: "string" },
|
|
529
|
+
{ key: "member_default_visibility", value: '"all_records"', type: "enum" },
|
|
530
|
+
{ key: "records_tool_default", value: "true", type: "boolean" },
|
|
487
531
|
{ key: "row_versions_guard", value: "false", type: "boolean" },
|
|
488
532
|
{ key: "sandbox_expanded_frame_height_px", value: "20000", type: "integer" },
|
|
489
533
|
{ key: "sandbox_frame_height_px", value: "4000", type: "integer" },
|
|
@@ -496,17 +540,18 @@ var STORE_KNOBS = [
|
|
|
496
540
|
{ key: "world_publish_enabled", value: "false", type: "boolean" }
|
|
497
541
|
];
|
|
498
542
|
var STORE_REFUSAL_CODES = [
|
|
499
|
-
{ code: "02000", raised_by: "doc_render_body,doc_render_document,doc_sign,doc_signature_intact,doc_template_save,external_history_event,external_rows,external_stub_upsert,external_writes_set,migrate_delete,migrate_extract_parent,migrate_merge,migrate_rename,migrate_reparent,migrate_retype,migrate_split,read_record,record_delete,record_restore,record_update" },
|
|
543
|
+
{ code: "02000", raised_by: "doc_render_body,doc_render_document,doc_sign,doc_signature_intact,doc_template_save,external_history_event,external_rows,external_stub_upsert,external_writes_set,migrate_delete,migrate_extract_parent,migrate_merge,migrate_rename,migrate_reparent,migrate_retype,migrate_split,migrate_undo,read_record,record_delete,record_restore,record_update,relation_uncarry,share_access,share_grant,share_lane_set,share_people,share_revoke,visibility_as_of" },
|
|
500
544
|
{ code: "0A000", raised_by: "external_rows,external_source_declare,external_write_through,promote_field,promoted_index_expr,promoted_query_sql,promoted_read,rule_eval,work_slots_declare" },
|
|
501
|
-
{ code: "22004", raised_by: "_value_envelope,actor_word,agg_assert_key,agg_sql,anon_capture,anon_token_issue,anon_write,assert_client_may_reach,doc_render_write,doc_sign,doc_signature_write,doc_template_save,external_history_event,external_rows,external_source_declare,external_stub_upsert,external_write_through,external_writes_set,home_add,io_comment_write,io_import_open,io_outbox_drain,io_restore,migrate_purge,migrate_split,query_across_homes,query_by_coordinates,query_rollup,record_delete,record_reparent,record_restore,record_update,record_write,relation_own,table_declare,work_template_declare" },
|
|
545
|
+
{ code: "22004", raised_by: "_value_envelope,actor_word,agg_assert_key,agg_sql,anon_capture,anon_token_issue,anon_write,assert_client_may_reach,doc_render_write,doc_sign,doc_signature_write,doc_template_save,external_history_event,external_rows,external_source_declare,external_stub_upsert,external_write_through,external_writes_set,home_add,io_comment_write,io_import_open,io_outbox_drain,io_restore,migrate_purge,migrate_split,migrate_undo,query_across_homes,query_by_coordinates,query_rollup,record_delete,record_reparent,record_resolve,record_restore,record_update,record_write,relation_carry,relation_own,share_grant,table_declare,work_template_declare" },
|
|
502
546
|
{ code: "22012", raised_by: "rule_eval" },
|
|
503
|
-
{ code: "22023", raised_by: "_value_envelope,_work_shape_guard,actor_word,agg_assert_key,agg_sql,anon_token_issue,containment_parent,doc_render_body,doc_render_write,doc_signature_write,external_history_event,external_source_declare,external_stub_upsert,external_write_through,io_import_open,io_proposal_accept,migrate_merge,query_by_coordinates,query_rollup,record_update,rule_eval,rule_members,table_rules,work_slot_hold" },
|
|
504
|
-
{ code: "23503", raised_by: "_containment_guard,_record_rule_uses,anon_publish,anon_rate_take,anon_token_issue,anon_write,assert_organization_wall,doc_sign,doc_template_save,home_add,io_comment_write,io_import_rows,io_proposal_accept,
|
|
505
|
-
{ code: "23505", raised_by: "doc_sign,doc_signature_write,home_add,io_proposal_accept,work_slot_hold" },
|
|
506
|
-
{ code: "23514", raised_by: "_containment_guard,_dated_values_guard,_derived_fields,_field_shape_guard,_field_type_parity_guard,_merge_field_shape_guard,_merge_field_temporal_guard,_promoted_field_cap_guard,_record_rule_uses,_rule_shape_guard,_rule_topology_guard,_table_shape_guard,_value_envelope,_work_shape_guard,doc_sign,doc_signature_write,doc_template_save,home_add,validate_value_envelope,validate_values,work_slots_declare,work_take_assignment,work_template_instantiate" },
|
|
547
|
+
{ code: "22023", raised_by: "_value_envelope,_work_shape_guard,actor_word,agg_assert_key,agg_sql,anon_token_issue,containment_parent,doc_render_body,doc_render_write,doc_signature_write,external_history_event,external_source_declare,external_stub_upsert,external_write_through,io_import_open,io_proposal_accept,migrate_merge,query_by_coordinates,query_rollup,record_update,relation_carry,rule_eval,rule_members,share_grant,share_lane_set,table_rules,visibility_as_of,work_slot_hold" },
|
|
548
|
+
{ code: "23503", raised_by: "_containment_guard,_record_rule_uses,anon_publish,anon_rate_take,anon_token_issue,anon_write,assert_organization_wall,delete_rule,doc_sign,doc_template_save,home_add,io_comment_write,io_import_rows,io_proposal_accept,migrate_demote,migrate_promote,promote_field,promote_table,record_applicability,record_reparent,relation_carry,relation_own,resolve_first_match,rule_applies,rule_eval,rule_members,rule_run,work_take_assignment,work_template_instantiate" },
|
|
549
|
+
{ code: "23505", raised_by: "doc_sign,doc_signature_write,field_declare,home_add,io_proposal_accept,relation_carry,relation_own,share_grant,work_slot_hold" },
|
|
550
|
+
{ code: "23514", raised_by: "_containment_guard,_dated_values_guard,_derived_fields,_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,_rule_shape_guard,_rule_topology_guard,_store_relation_edge_names_its_field,_table_shape_guard,_value_envelope,_work_shape_guard,doc_sign,doc_signature_write,doc_template_save,field_declare,field_retire,field_update,home_add,migrate_merge,relation_carry,relation_own,validate_value_envelope,validate_values,work_slots_declare,work_take_assignment,work_template_instantiate" },
|
|
507
551
|
{ code: "40001", raised_by: "has_visibility_at" },
|
|
508
|
-
{ 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_reach,assert_store_door,external_write_through,io_comment_resolve,io_comment_write,io_restore,migrate_purge,promote_table,read_record,read_records" },
|
|
509
|
-
{ code: "53400", raised_by: "anon_rate_take,promote_field" },
|
|
552
|
+
{ 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_organization_admin,assert_store_door,external_write_through,io_comment_resolve,io_comment_write,io_restore,migrate_purge,promote_table,query_visibility_parity,read_record,read_records,share_grant,visibility_as_of" },
|
|
553
|
+
{ code: "53400", raised_by: "anon_rate_take,delete_cascade_closure,promote_field" },
|
|
554
|
+
{ code: "54001", raised_by: "record_delete" },
|
|
510
555
|
{ code: "PT409", raised_by: "record_update" }
|
|
511
556
|
];
|
|
512
557
|
var ENTITY_TOKENS = [
|
|
@@ -717,6 +762,7 @@ var ENTITY_TOKENS = [
|
|
|
717
762
|
"content_ir_kind_example",
|
|
718
763
|
"content_ir_kind_instance",
|
|
719
764
|
"content_ir_kind_surface",
|
|
765
|
+
"content_lane",
|
|
720
766
|
"context_access_log",
|
|
721
767
|
"context_item",
|
|
722
768
|
"context_item_suggestion",
|
|
@@ -1151,6 +1197,7 @@ var ENTITY_TOKENS = [
|
|
|
1151
1197
|
"part_config_sub",
|
|
1152
1198
|
"party",
|
|
1153
1199
|
"party_contact_point",
|
|
1200
|
+
"passkey_credential",
|
|
1154
1201
|
"path_drift_repair_2026_09",
|
|
1155
1202
|
"pc_article",
|
|
1156
1203
|
"pc_episode",
|
|
@@ -1598,6 +1645,20 @@ var DOORS = {
|
|
|
1598
1645
|
fieldOptions: "field_options",
|
|
1599
1646
|
parityValues: "parity_values",
|
|
1600
1647
|
tableDeclare: "table_declare",
|
|
1648
|
+
// ADDING A COLUMN — the first thing anybody does with a table, and until
|
|
1649
|
+
// 2026-09-19 there was no door for it. A Field is a record (REC-25), so a
|
|
1650
|
+
// screen wrote one with `record_write`; that door writes ONE row with
|
|
1651
|
+
// `data_class = 'record'` and cannot also add the key to the Table record's
|
|
1652
|
+
// `fields` array, which the field guard requires before it accepts any
|
|
1653
|
+
// definition at all. So every "Add field" ended on "the table does not
|
|
1654
|
+
// declare a field called … — declare it there first". These three doors take
|
|
1655
|
+
// what a person knows — a field type, a name, and for a choice list the
|
|
1656
|
+
// choices themselves — and the STORE turns that into the document its own
|
|
1657
|
+
// guards demand, so every client inherits one answer instead of each one
|
|
1658
|
+
// re-deriving thirteen and getting them wrong.
|
|
1659
|
+
fieldDeclare: "field_declare",
|
|
1660
|
+
fieldUpdate: "field_update",
|
|
1661
|
+
fieldRetire: "field_retire",
|
|
1601
1662
|
tableCapacity: "table_capacity",
|
|
1602
1663
|
tableStorage: "table_storage",
|
|
1603
1664
|
promoteTable: "promote_table",
|
|
@@ -1713,17 +1774,37 @@ var BY_SQLSTATE = {
|
|
|
1713
1774
|
"23514": "refused_by_rule",
|
|
1714
1775
|
"22004": "invalid_argument",
|
|
1715
1776
|
"22023": "invalid_argument",
|
|
1777
|
+
// 22P02 — a value does not fit the type the store holds for it. The class is
|
|
1778
|
+
// real and was hit live: an organization whose copy of a package table grew
|
|
1779
|
+
// `status` as a uuid-valued Field was sent the text "open", and the store
|
|
1780
|
+
// answered `invalid input syntax for type uuid: "open"`. It is the CALL that
|
|
1781
|
+
// is wrong for the shape the store holds, which is what `invalid_argument`
|
|
1782
|
+
// already means — the store's own sentence names the value and the type.
|
|
1783
|
+
"22P02": "invalid_argument",
|
|
1716
1784
|
"02000": "not_found",
|
|
1717
1785
|
"23503": "missing_reference",
|
|
1718
1786
|
"23505": "already_exists",
|
|
1719
1787
|
"0A000": "not_supported",
|
|
1720
1788
|
"53400": "store_limit",
|
|
1721
1789
|
"22012": "store_limit",
|
|
1790
|
+
// 54001 — `custom.record_delete` stops a cascade that nests past sixty-four
|
|
1791
|
+
// levels of containment, because that is a loop somebody built rather than a
|
|
1792
|
+
// hierarchy, and saying so beats recursing until the server runs out of
|
|
1793
|
+
// stack. It is a LIMIT of the store, and the store's own sentence names what
|
|
1794
|
+
// to do about it, so it reads as one.
|
|
1795
|
+
"54001": "store_limit",
|
|
1722
1796
|
// VIS: `custom.has_visibility_at` refuses to answer from a snapshot older
|
|
1723
1797
|
// than a write this reader has already seen, rather than returning something
|
|
1724
1798
|
// they just lost access to. It is retryable on a fresher connection, which is
|
|
1725
1799
|
// a different instruction from every other refusal here.
|
|
1726
1800
|
"40001": "stale_read",
|
|
1801
|
+
// 57014 — the store cancelled the statement at its own timeout. Like
|
|
1802
|
+
// `stale_read` and unlike every other refusal here, the call was never
|
|
1803
|
+
// refused on its merits: the same call on a smaller page, or once the
|
|
1804
|
+
// organization's kernel is not being rewritten, can succeed. It gets its own
|
|
1805
|
+
// code so a screen can offer "try again" honestly instead of showing a
|
|
1806
|
+
// failure sentence the caller cannot act on.
|
|
1807
|
+
"57014": "timed_out",
|
|
1727
1808
|
// PostgREST's own two: the store is not being SERVED, which is a different
|
|
1728
1809
|
// thing from the store refusing. `custom` absent from `pgrst.db_schemas`, or
|
|
1729
1810
|
// the grants not copied, land here.
|
|
@@ -2087,6 +2168,27 @@ function createRecordsClient(config) {
|
|
|
2087
2168
|
"tableCapacity"
|
|
2088
2169
|
);
|
|
2089
2170
|
},
|
|
2171
|
+
async fieldDeclare({ table_id, spec }) {
|
|
2172
|
+
return callDoor(
|
|
2173
|
+
DOORS.fieldDeclare,
|
|
2174
|
+
{ p_organization_id: org, p_table_id: table_id, p_spec: spec },
|
|
2175
|
+
"fieldDeclare"
|
|
2176
|
+
);
|
|
2177
|
+
},
|
|
2178
|
+
async fieldUpdate({ field_id, patch }) {
|
|
2179
|
+
return callDoor(
|
|
2180
|
+
DOORS.fieldUpdate,
|
|
2181
|
+
{ p_organization_id: org, p_field_id: field_id, p_patch: patch },
|
|
2182
|
+
"fieldUpdate"
|
|
2183
|
+
);
|
|
2184
|
+
},
|
|
2185
|
+
async fieldRetire({ field_id }) {
|
|
2186
|
+
return callDoor(
|
|
2187
|
+
DOORS.fieldRetire,
|
|
2188
|
+
{ p_organization_id: org, p_field_id: field_id },
|
|
2189
|
+
"fieldRetire"
|
|
2190
|
+
);
|
|
2191
|
+
},
|
|
2090
2192
|
async tableDeclare({ spec, homeId }) {
|
|
2091
2193
|
return callDoor(
|
|
2092
2194
|
DOORS.tableDeclare,
|