@ai-matrx/records 0.16.0 → 0.17.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 +41 -0
- package/dist/core/index.cjs +84 -26
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +24 -3
- package/dist/core/index.d.ts +24 -3
- package/dist/core/index.js +84 -26
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +23 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +94 -6
- package/dist/index.d.ts +94 -6
- package/dist/index.js +23 -5
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +84 -26
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +113 -9
- package/dist/react/index.d.ts +113 -9
- package/dist/react/index.js +84 -26
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,46 @@
|
|
|
1
1
|
# Changelog — @ai-matrx/records
|
|
2
2
|
|
|
3
|
+
## 0.17.0
|
|
4
|
+
|
|
5
|
+
**A list is a door, never a grant on the thing behind it.**
|
|
6
|
+
|
|
7
|
+
`docTemplates`, `docRenders` and `docSignatures` read `custom.doc_template` (a
|
|
8
|
+
view), `custom.doc_render` and `custom.doc_signature` (tables) with a direct
|
|
9
|
+
PostgREST `.from()`. **None of those three holds a client SELECT**, and none ever
|
|
10
|
+
should — so every plural act of document generation returned 403, and the
|
|
11
|
+
try-everything page photographed *"permission denied for view doc_template"* on
|
|
12
|
+
2026-09-20. A person could save a template they could never list and render a
|
|
13
|
+
document they could never find again.
|
|
14
|
+
|
|
15
|
+
All three now call doors that narrow inside the definer, after the ladder has
|
|
16
|
+
spoken: `custom.doc_templates` and `custom.doc_renders` / `custom.doc_signatures`
|
|
17
|
+
(viewer on the Table, viewer on the record). Two acts that had no door at all
|
|
18
|
+
arrive with them:
|
|
19
|
+
|
|
20
|
+
- **`docTemplateDelete({ template_id })`** — retire one template. Editor on the
|
|
21
|
+
Table it renders, because a template is that Table's wording. Soft only:
|
|
22
|
+
documents already rendered keep their frozen bytes and their seals, so
|
|
23
|
+
retiring a template can never invalidate a signature (VAL-10).
|
|
24
|
+
- **`subscriptionCadences()`** — the cadences a subscription may be written
|
|
25
|
+
with, through the door a PERSON may call. `aggSubscriptionCadences` is the
|
|
26
|
+
notifier's own and holds no client grant, so every screen that asked for it
|
|
27
|
+
was refused and fell back to a word typed into the screen; this one delegates
|
|
28
|
+
to the same array, so a picker can never offer a cadence the digest runner
|
|
29
|
+
does not honour.
|
|
30
|
+
|
|
31
|
+
`DocTemplateRow` drops `organization_id`, which the door does not answer and no
|
|
32
|
+
caller read — the client already holds the organization. The door names its key
|
|
33
|
+
`template_id` / `render_id` / `signature_id`; the package keeps `id`, mapped once
|
|
34
|
+
here rather than renamed in four screens.
|
|
35
|
+
|
|
36
|
+
`store.generated.ts` regenerated from the live store: **387 → 401 doors**.
|
|
37
|
+
|
|
38
|
+
**Consumer action:** none for `docTemplates` / `docRenders` / `docSignatures` —
|
|
39
|
+
same names, same row shapes, they simply stop being refused. The five doors they
|
|
40
|
+
need are live on the main database (`doorstwo_the_document_and_cadence_doors.sql`
|
|
41
|
+
+ its grant file, applied 2026-09-20 13:43Z), so this version requires no
|
|
42
|
+
migration of its own.
|
|
43
|
+
|
|
3
44
|
## 0.16.0
|
|
4
45
|
|
|
5
46
|
**A column is declared, and a client type can finally say so.**
|
package/dist/core/index.cjs
CHANGED
|
@@ -374,6 +374,9 @@ var STORE_DOORS = [
|
|
|
374
374
|
{ name: "choice_synonyms_in", args: "p_map jsonb, p_token text", returns: "text[]", security: "invoker" },
|
|
375
375
|
{ name: "choice_words", args: "p_field jsonb", returns: "text", security: "invoker" },
|
|
376
376
|
{ name: "client_write_grants", args: "", returns: "TABLE(role_name text, object_name text, privilege text)", security: "invoker" },
|
|
377
|
+
{ name: "comment_mention_deliver", args: "p_organization_id uuid, p_record_id uuid, p_table_id uuid, p_comment_id uuid, p_recipient uuid, p_author_name text, p_record_title text, p_body text", returns: "uuid", security: "definer" },
|
|
378
|
+
{ name: "comment_thread", args: "p_organization_id uuid, p_record_id uuid, p_include_resolved boolean DEFAULT false", returns: "jsonb", security: "definer" },
|
|
379
|
+
{ name: "comment_write", args: "p_organization_id uuid, p_record_id uuid, p_body text, p_anchor jsonb DEFAULT '{}'::jsonb, p_parent_comment_id uuid DEFAULT NULL::uuid, p_mentions uuid[] DEFAULT NULL::uuid[]", returns: "jsonb", security: "definer" },
|
|
377
380
|
{ name: "computed_provenance", args: "p_organization_id uuid, p_record_id uuid", returns: "TABLE(field_key text, field_id uuid, value jsonb, rule_id uuid, rule_version integer, computed_at timestamp with time zone)", security: "invoker" },
|
|
378
381
|
{ name: "containment_chain", args: "p_organization_id uuid, p_record_id uuid", returns: "TABLE(ancestor_id uuid, depth integer)", security: "invoker" },
|
|
379
382
|
{ name: "containment_depth_ceiling", args: "p_organization_id uuid DEFAULT NULL::uuid", returns: "integer", security: "invoker" },
|
|
@@ -406,13 +409,17 @@ var STORE_DOORS = [
|
|
|
406
409
|
{ name: "doc_render_document", args: "p_organization_id uuid, p_template_id uuid, p_record_id uuid", returns: "uuid", security: "definer" },
|
|
407
410
|
{ name: "doc_render_read", args: "p_organization_id uuid, p_render_id uuid", returns: "jsonb", security: "definer" },
|
|
408
411
|
{ name: "doc_render_write", args: "p_organization_id uuid, p_template_id uuid, p_record_id uuid, p_table_id uuid, p_template_version integer, p_body text, p_content_hash text", returns: "uuid", security: "definer" },
|
|
412
|
+
{ name: "doc_renders", args: "p_organization_id uuid, p_record_id uuid", returns: "TABLE(render_id uuid, template_id uuid, record_id uuid, table_id uuid, template_version integer, body text, content_hash text, rendered_at timestamp with time zone)", security: "definer" },
|
|
409
413
|
{ name: "doc_sign", args: "p_organization_id uuid, p_render_id uuid, p_field_key text, p_signer_name text, p_signer_user_id uuid DEFAULT NULL::uuid", returns: "uuid", security: "definer" },
|
|
410
414
|
{ name: "doc_signature_field_ok", args: "p_field_data jsonb", returns: "boolean", security: "invoker" },
|
|
411
415
|
{ name: "doc_signature_intact", args: "p_organization_id uuid, p_signature_id uuid", returns: "jsonb", security: "invoker" },
|
|
412
416
|
{ name: "doc_signature_read", args: "p_organization_id uuid, p_signature_id uuid", returns: "jsonb", security: "definer" },
|
|
413
417
|
{ name: "doc_signature_write", args: "p_organization_id uuid, p_render_id uuid, p_record_id uuid, p_field_key text, p_signer_name text, p_signer_user_id uuid, p_document_hash text, p_document_version integer", returns: "uuid", security: "definer" },
|
|
418
|
+
{ name: "doc_signatures", args: "p_organization_id uuid, p_record_id uuid", returns: "TABLE(signature_id uuid, render_id uuid, record_id uuid, field_key text, signer_name text, signer_user_id uuid, signed_at timestamp with time zone, document_hash text, document_version integer)", security: "definer" },
|
|
419
|
+
{ name: "doc_template_delete", args: "p_organization_id uuid, p_template_id uuid", returns: "boolean", security: "definer" },
|
|
414
420
|
{ name: "doc_template_read", args: "p_organization_id uuid, p_template_id uuid", returns: "jsonb", security: "definer" },
|
|
415
421
|
{ name: "doc_template_save", args: "p_organization_id uuid, p_table_id uuid, p_name text, p_body text, p_template_id uuid DEFAULT NULL::uuid", returns: "uuid", security: "definer" },
|
|
422
|
+
{ name: "doc_templates", args: "p_organization_id uuid, p_table_id uuid", returns: "TABLE(template_id uuid, renders_table_id uuid, name text, body text, template_version integer, token_count bigint, updated_at timestamp with time zone)", security: "definer" },
|
|
416
423
|
{ name: "doc_token_pattern", args: "", returns: "text", security: "invoker" },
|
|
417
424
|
{ name: "doc_tokens", args: "p_body text", returns: "TABLE(ordinal integer, raw text, field_id uuid)", security: "invoker" },
|
|
418
425
|
{ 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" },
|
|
@@ -441,6 +448,7 @@ var STORE_DOORS = [
|
|
|
441
448
|
{ name: "field_behaviour", args: "p_field_data jsonb", returns: "text", security: "invoker" },
|
|
442
449
|
{ name: "field_declare", args: "p_organization_id uuid, p_table_id uuid, p_spec jsonb", returns: "uuid", security: "definer" },
|
|
443
450
|
{ 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" },
|
|
451
|
+
{ 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" },
|
|
444
452
|
{ name: "field_kernel_id", args: "", returns: "uuid", security: "invoker" },
|
|
445
453
|
{ name: "field_options", args: "p_organization_id uuid, p_field_id uuid", returns: "SETOF custom.record", security: "definer" },
|
|
446
454
|
{ name: "field_retire", args: "p_organization_id uuid, p_field_id uuid", returns: "boolean", security: "definer" },
|
|
@@ -459,7 +467,11 @@ var STORE_DOORS = [
|
|
|
459
467
|
{ 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" },
|
|
460
468
|
{ 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" },
|
|
461
469
|
{ name: "hidden_field_notice", args: "p_field custom.record, p_action text DEFAULT 'read'::text", returns: "jsonb", security: "invoker" },
|
|
470
|
+
{ name: "history_actor", args: "p_tier text, p_document jsonb, p_actor_id uuid, p_people jsonb", returns: "jsonb", security: "invoker" },
|
|
471
|
+
{ name: "history_changes", args: "p_organization_id uuid, p_table_id uuid, p_old jsonb, p_new jsonb", returns: "jsonb", security: "invoker" },
|
|
472
|
+
{ name: "history_people", args: "p_organization_id uuid, p_ids uuid[]", returns: "jsonb", security: "definer" },
|
|
462
473
|
{ 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" },
|
|
474
|
+
{ name: "history_restore_body", args: "p_current jsonb, p_target jsonb, p_field_key text DEFAULT NULL::text", returns: "jsonb", security: "invoker" },
|
|
463
475
|
{ name: "history_retention", args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid", returns: "jsonb", security: "definer" },
|
|
464
476
|
{ name: "history_retention_floor_raise", args: "p_organization_id uuid, p_days integer", returns: "integer", security: "definer" },
|
|
465
477
|
{ name: "history_retention_set", args: "p_organization_id uuid, p_table_id uuid, p_days integer", returns: "integer", security: "definer" },
|
|
@@ -580,10 +592,13 @@ var STORE_DOORS = [
|
|
|
580
592
|
{ name: "record_card", args: "p_viewer uuid, p_organization_id uuid, p_record_id uuid", returns: "jsonb", security: "definer" },
|
|
581
593
|
{ 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" },
|
|
582
594
|
{ name: "record_delete", args: "p_organization_id uuid, p_record_id uuid", returns: "timestamp with time zone", security: "definer" },
|
|
595
|
+
{ 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" },
|
|
583
596
|
{ 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" },
|
|
584
597
|
{ name: "record_reparent", args: "p_organization_id uuid, p_record_id uuid, p_parent_id uuid", returns: "void", security: "definer" },
|
|
585
598
|
{ name: "record_resolve", args: "p_organization_id uuid, p_id uuid", returns: "jsonb", security: "definer" },
|
|
586
599
|
{ name: "record_restore", args: "p_organization_id uuid, p_record_id uuid", returns: "void", security: "definer" },
|
|
600
|
+
{ name: "record_restore_preview", args: "p_organization_id uuid, p_record_id uuid, p_version integer, p_field_key text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
601
|
+
{ name: "record_restore_version", args: "p_organization_id uuid, p_record_id uuid, p_version integer", returns: "jsonb", security: "definer" },
|
|
587
602
|
{ name: "record_state_as_of", args: "p_record_id uuid, p_at timestamp with time zone", returns: "TABLE(state jsonb, replayed boolean)", security: "definer" },
|
|
588
603
|
{ name: "record_table", args: "p_organization_id uuid, p_record_id uuid", returns: "uuid", security: "definer" },
|
|
589
604
|
{ 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" },
|
|
@@ -636,6 +651,7 @@ var STORE_DOORS = [
|
|
|
636
651
|
{ name: "stamp_value_envelopes", args: "p_data jsonb, p_actor text, p_on_behalf_of text, p_at timestamp with time zone", returns: "jsonb", security: "invoker" },
|
|
637
652
|
{ name: "storage_modes", args: "", returns: "text[]", security: "invoker" },
|
|
638
653
|
{ name: "store_is_open", args: "p_organization_id uuid DEFAULT NULL::uuid", returns: "boolean", security: "invoker" },
|
|
654
|
+
{ name: "subscription_cadences", args: "p_organization_id uuid", returns: "text[]", security: "definer" },
|
|
639
655
|
{ name: "subscription_mute", args: "p_organization_id uuid, p_rule_id uuid, p_muted boolean DEFAULT true", returns: "boolean", security: "definer" },
|
|
640
656
|
{ 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, channel text, recipient_user_id uuid, event_key text, muted boolean, mine boolean, i_may_mute boolean)", security: "definer" },
|
|
641
657
|
{ name: "table_capacity", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "definer" },
|
|
@@ -661,6 +677,7 @@ var STORE_DOORS = [
|
|
|
661
677
|
{ name: "value_envelope_ok", args: "p_data jsonb", returns: "boolean", security: "invoker" },
|
|
662
678
|
{ name: "value_envelope_refusal", args: "p_data jsonb", returns: "text", security: "invoker" },
|
|
663
679
|
{ 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: "definer" },
|
|
680
|
+
{ name: "value_restore", args: "p_organization_id uuid, p_record_id uuid, p_field_key text, p_version integer", returns: "jsonb", security: "definer" },
|
|
664
681
|
{ name: "value_versions", args: "p_old jsonb, p_new jsonb", returns: "jsonb", security: "invoker" },
|
|
665
682
|
{ 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" },
|
|
666
683
|
{ 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" },
|
|
@@ -711,6 +728,7 @@ var STORE_KNOBS = [
|
|
|
711
728
|
{ key: "code_paths_enabled", value: "false", type: "boolean" },
|
|
712
729
|
{ key: "consumer_chat_seeding_enabled", value: "false", type: "boolean" },
|
|
713
730
|
{ key: "consumer_checkout_enabled", value: "false", type: "boolean" },
|
|
731
|
+
{ key: "consumer_context_enabled", value: "false", type: "boolean" },
|
|
714
732
|
{ key: "consumer_education_enabled", value: "false", type: "boolean" },
|
|
715
733
|
{ key: "consumer_extension_enabled", value: "false", type: "boolean" },
|
|
716
734
|
{ key: "consumer_grid_enabled", value: "false", type: "boolean" },
|
|
@@ -742,17 +760,17 @@ var STORE_KNOBS = [
|
|
|
742
760
|
{ key: "world_publish_enabled", value: "false", type: "boolean" }
|
|
743
761
|
];
|
|
744
762
|
var STORE_REFUSAL_CODES = [
|
|
745
|
-
{ code: "02000", raised_by: "dashboard_delete,dashboard_run,doc_render_body,doc_render_document,doc_render_read,doc_sign,doc_signature_intact,doc_signature_read,doc_template_read,doc_template_save,entity_field_retire,entity_field_update,entity_record_read,entity_value_write,external_history_event,external_rows,external_stub_upsert,external_writes_set,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_table,record_update,relation_uncarry,share_access,share_grant,share_lane_set,share_people,share_revoke,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_assign,work_record_states,work_set_state" },
|
|
763
|
+
{ code: "02000", raised_by: "dashboard_delete,dashboard_run,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,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,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_assign,work_record_states,work_set_state" },
|
|
746
764
|
{ 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_assign" },
|
|
747
|
-
{ 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,dashboard_block_normalize,dashboard_declare,dashboard_window_sql,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,form_declare,form_submit,home_add,io_comment_write,io_import_open,io_outbox_drain,io_restore,migrate_choice_keys,migrate_purge,migrate_reclass,migrate_split,migrate_undo,organization_clear,organization_contents,portal_declare,portal_invite,portal_principal_bind,query_across_homes,query_by_coordinates,query_rollup,record_delete,record_reparent,record_resolve,record_restore,record_update,record_write,relation_carry,relation_own,rule_declare,share_grant,table_declare,work_approval_decide,work_approval_request,work_template_declare" },
|
|
765
|
+
{ 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,dashboard_block_normalize,dashboard_declare,dashboard_window_sql,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,field_history,form_declare,form_submit,home_add,io_comment_write,io_import_open,io_outbox_drain,io_restore,migrate_choice_keys,migrate_purge,migrate_reclass,migrate_split,migrate_undo,organization_clear,organization_contents,portal_declare,portal_invite,portal_principal_bind,query_across_homes,query_by_coordinates,query_rollup,record_delete,record_reparent,record_resolve,record_restore,record_update,record_write,relation_carry,relation_own,rule_declare,share_grant,table_declare,value_restore,work_approval_decide,work_approval_request,work_template_declare" },
|
|
748
766
|
{ code: "22007", raised_by: "dashboard_window_sql" },
|
|
749
767
|
{ code: "22012", raised_by: "rule_eval" },
|
|
750
|
-
{ code: "22023", raised_by: "_entity_custom_fields_guard,_value_envelope,_work_shape_guard,actor_word,agg_assert_key,agg_sql,anon_token_issue,containment_parent,dashboard_block_normalize,dashboard_window_sql,doc_render_body,doc_render_write,doc_signature_write,entity_value_write,external_history_event,external_source_declare,external_stub_upsert,external_write_through,io_import_open,io_proposal_accept,migrate_merge,migrate_reclass,my_levels,organization_clear,portal_declare,query_by_coordinates,query_rollup,record_update,relation_carry,rule_eval,rule_members,share_grant,share_lane_set,table_rules,visibility_as_of,work_approval_request,work_list,work_slot_hold" },
|
|
751
|
-
{ code: "23503", raised_by: "_containment_guard,_field_document_for,_record_rule_uses,anon_publish,anon_rate_take,anon_token_issue,anon_write,assert_organization_wall,dashboard_declare,delete_rule,doc_sign,doc_template_save,form_declare,form_submit,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_declare,rule_eval,rule_members,rule_run,subscription_mute,work_set_state,work_take_assignment,work_template_instantiate" },
|
|
768
|
+
{ code: "22023", raised_by: "_entity_custom_fields_guard,_value_envelope,_work_shape_guard,actor_word,agg_assert_key,agg_sql,anon_token_issue,containment_parent,dashboard_block_normalize,dashboard_window_sql,doc_render_body,doc_render_write,doc_signature_write,entity_value_write,external_history_event,external_source_declare,external_stub_upsert,external_write_through,field_history,io_import_open,io_proposal_accept,migrate_merge,migrate_reclass,my_levels,organization_clear,portal_declare,query_by_coordinates,query_rollup,record_update,relation_carry,rule_eval,rule_members,share_grant,share_lane_set,table_rules,visibility_as_of,work_approval_request,work_list,work_slot_hold" },
|
|
769
|
+
{ code: "23503", raised_by: "_containment_guard,_field_document_for,_record_rule_uses,anon_publish,anon_rate_take,anon_token_issue,anon_write,assert_organization_wall,comment_write,dashboard_declare,delete_rule,doc_sign,doc_template_save,form_declare,form_submit,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_declare,rule_eval,rule_members,rule_run,subscription_mute,work_set_state,work_take_assignment,work_template_instantiate" },
|
|
752
770
|
{ code: "23505", raised_by: "_unique_rule_holds,doc_sign,doc_signature_write,entity_field_declare,field_declare,home_add,io_proposal_accept,relation_carry,relation_own,share_grant,work_approval_decide,work_slot_hold" },
|
|
753
771
|
{ code: "23514", raised_by: "_containment_guard,_dated_values_guard,_derived_fields,_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_shape_guard,_value_envelope,_work_shape_guard,_workdoors_approval_guard,assert_entity_is_organization_scoped,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,migrate_merge,relation_carry,relation_own,validate_value_envelope,validate_values,work_set_state,work_slots_declare,work_take_assignment,work_template_instantiate" },
|
|
754
772
|
{ code: "40001", raised_by: "has_visibility_at" },
|
|
755
|
-
{ 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,entity_field_declare,entity_field_retire,entity_field_update,entity_value_write,external_write_through,form_declare,form_submit,io_comment_resolve,io_comment_write,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,share_grant,subscription_mute,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_person" },
|
|
773
|
+
{ 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,comment_write,entity_field_declare,entity_field_retire,entity_field_update,entity_value_write,external_write_through,form_declare,form_submit,io_comment_resolve,io_comment_write,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,record_table,share_grant,subscription_mute,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_person" },
|
|
756
774
|
{ code: "42703", raised_by: "entity_table,portal_declare" },
|
|
757
775
|
{ code: "53400", raised_by: "anon_rate_take,delete_cascade_closure,promote_field" },
|
|
758
776
|
{ code: "54001", raised_by: "record_delete" },
|
|
@@ -1971,6 +1989,10 @@ var DOORS = {
|
|
|
1971
1989
|
// these rows, so "tell me when a patient arrives" can also be un-told.
|
|
1972
1990
|
subscriptions: "subscriptions",
|
|
1973
1991
|
subscriptionMute: "subscription_mute",
|
|
1992
|
+
// The cadence CATALOGUE a person's screen may ask for. `agg_subscription_cadences`
|
|
1993
|
+
// above is the notifier's own and holds no client grant; this door delegates to
|
|
1994
|
+
// it, so a picker and the digest runner can never offer different words.
|
|
1995
|
+
subscriptionCadences: "subscription_cadences",
|
|
1974
1996
|
// The doc doors: a template is saved, a render is written once and frozen,
|
|
1975
1997
|
// and a signature is checked against the exact bytes that were signed.
|
|
1976
1998
|
docTemplateSave: "doc_template_save",
|
|
@@ -1980,6 +2002,15 @@ var DOORS = {
|
|
|
1980
2002
|
docUnresolvedTokens: "doc_unresolved_tokens",
|
|
1981
2003
|
docSign: "doc_sign",
|
|
1982
2004
|
docSignatureIntact: "doc_signature_intact",
|
|
2005
|
+
// THE PLURAL ACTS. Until 2026-09-20 this package read `custom.doc_template`,
|
|
2006
|
+
// `custom.doc_render` and `custom.doc_signature` with a direct PostgREST
|
|
2007
|
+
// `.from()`, and all three hold NO client SELECT — so every list in product #5
|
|
2008
|
+
// opened on "permission denied for view doc_template". A list is a DOOR, never
|
|
2009
|
+
// a grant on the thing behind it (DOORS-TWO).
|
|
2010
|
+
docTemplates: "doc_templates",
|
|
2011
|
+
docTemplateDelete: "doc_template_delete",
|
|
2012
|
+
docRenders: "doc_renders",
|
|
2013
|
+
docSignatures: "doc_signatures",
|
|
1983
2014
|
// THE ANONYMOUS LANE (W4-ANON). It landed, and it landed as SEVEN doors
|
|
1984
2015
|
// rather than the one this package had guessed at: a token is issued and
|
|
1985
2016
|
// verified separately from the write it authorises, a form is published
|
|
@@ -2797,6 +2828,13 @@ function createRecordsClient(config) {
|
|
|
2797
2828
|
async aggSubscriptionCadences() {
|
|
2798
2829
|
return callDoor(DOORS.aggSubscriptionCadences, {}, "aggSubscriptionCadences");
|
|
2799
2830
|
},
|
|
2831
|
+
async subscriptionCadences() {
|
|
2832
|
+
return callDoor(
|
|
2833
|
+
DOORS.subscriptionCadences,
|
|
2834
|
+
{ p_organization_id: org },
|
|
2835
|
+
"subscriptionCadences"
|
|
2836
|
+
);
|
|
2837
|
+
},
|
|
2800
2838
|
async subscriptions(args) {
|
|
2801
2839
|
return callDoor(
|
|
2802
2840
|
DOORS.subscriptions,
|
|
@@ -2861,32 +2899,52 @@ function createRecordsClient(config) {
|
|
|
2861
2899
|
"docSign"
|
|
2862
2900
|
);
|
|
2863
2901
|
},
|
|
2902
|
+
// A LIST IS A DOOR, NEVER A GRANT ON THE THING BEHIND IT. These three used to
|
|
2903
|
+
// read `custom.doc_template`, `custom.doc_render` and `custom.doc_signature`
|
|
2904
|
+
// with a direct PostgREST `.from()`, and none of the three holds a client
|
|
2905
|
+
// SELECT — so a person could save a template they could never list and
|
|
2906
|
+
// render a document they could never find again, and every document screen
|
|
2907
|
+
// opened on "permission denied for view doc_template". The doors below
|
|
2908
|
+
// narrow inside the definer, after the ladder has spoken (DOORS-TWO).
|
|
2864
2909
|
async docTemplates({ table_id }) {
|
|
2865
|
-
const
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
return ok(
|
|
2910
|
+
const answered = await callDoor(
|
|
2911
|
+
DOORS.docTemplates,
|
|
2912
|
+
{ p_organization_id: org, p_table_id: table_id },
|
|
2913
|
+
"docTemplates"
|
|
2914
|
+
);
|
|
2915
|
+
if (!answered.ok) return answered;
|
|
2916
|
+
return ok(
|
|
2917
|
+
answered.data.map((row) => ({ ...row, id: row["template_id"] }))
|
|
2918
|
+
);
|
|
2919
|
+
},
|
|
2920
|
+
async docTemplateDelete({ template_id }) {
|
|
2921
|
+
return callDoor(
|
|
2922
|
+
DOORS.docTemplateDelete,
|
|
2923
|
+
{ p_organization_id: org, p_template_id: template_id },
|
|
2924
|
+
"docTemplateDelete"
|
|
2925
|
+
);
|
|
2872
2926
|
},
|
|
2873
2927
|
async docRenders({ record_id }) {
|
|
2874
|
-
const
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
return ok(
|
|
2928
|
+
const answered = await callDoor(
|
|
2929
|
+
DOORS.docRenders,
|
|
2930
|
+
{ p_organization_id: org, p_record_id: record_id },
|
|
2931
|
+
"docRenders"
|
|
2932
|
+
);
|
|
2933
|
+
if (!answered.ok) return answered;
|
|
2934
|
+
return ok(
|
|
2935
|
+
answered.data.map((row) => ({ ...row, id: row["render_id"] }))
|
|
2936
|
+
);
|
|
2881
2937
|
},
|
|
2882
2938
|
async docSignatures({ record_id }) {
|
|
2883
|
-
const
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
return ok(
|
|
2939
|
+
const answered = await callDoor(
|
|
2940
|
+
DOORS.docSignatures,
|
|
2941
|
+
{ p_organization_id: org, p_record_id: record_id },
|
|
2942
|
+
"docSignatures"
|
|
2943
|
+
);
|
|
2944
|
+
if (!answered.ok) return answered;
|
|
2945
|
+
return ok(
|
|
2946
|
+
answered.data.map((row) => ({ ...row, id: row["signature_id"] }))
|
|
2947
|
+
);
|
|
2890
2948
|
},
|
|
2891
2949
|
async recordValuesVersioned({ record_id }) {
|
|
2892
2950
|
return readValues(record_id);
|