@ai-matrx/records 0.6.2 → 0.7.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 +68 -0
- package/dist/core/index.cjs +81 -12
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +17 -3
- package/dist/core/index.d.ts +17 -3
- package/dist/core/index.js +81 -12
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +65 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +144 -13
- package/dist/index.d.ts +144 -13
- package/dist/index.js +65 -12
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +108 -12
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +172 -13
- package/dist/react/index.d.ts +172 -13
- package/dist/react/index.js +108 -12
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -179,11 +179,21 @@ declare const STORE_DOORS: readonly [{
|
|
|
179
179
|
readonly args: "p_declared text";
|
|
180
180
|
readonly returns: "text";
|
|
181
181
|
readonly security: "invoker";
|
|
182
|
+
}, {
|
|
183
|
+
readonly name: "agent_change_approval";
|
|
184
|
+
readonly args: "p_organization uuid, p_conversation uuid DEFAULT NULL::uuid, p_table uuid DEFAULT NULL::uuid";
|
|
185
|
+
readonly returns: "jsonb";
|
|
186
|
+
readonly security: "definer";
|
|
182
187
|
}, {
|
|
183
188
|
readonly name: "agent_context";
|
|
184
189
|
readonly args: "p_organization_id uuid, p_table_id uuid, p_limit integer DEFAULT 50";
|
|
185
190
|
readonly returns: "jsonb";
|
|
186
191
|
readonly security: "invoker";
|
|
192
|
+
}, {
|
|
193
|
+
readonly name: "agent_table_claim";
|
|
194
|
+
readonly args: "p_organization uuid, p_table uuid, p_conversation uuid DEFAULT NULL::uuid";
|
|
195
|
+
readonly returns: "void";
|
|
196
|
+
readonly security: "definer";
|
|
187
197
|
}, {
|
|
188
198
|
readonly name: "agg_assert_key";
|
|
189
199
|
readonly args: "p_key text";
|
|
@@ -269,6 +279,11 @@ declare const STORE_DOORS: readonly [{
|
|
|
269
279
|
readonly args: "p_organization_id uuid, p_form_id uuid, p_bucket text, p_token_id uuid DEFAULT NULL::uuid";
|
|
270
280
|
readonly returns: "integer";
|
|
271
281
|
readonly security: "definer";
|
|
282
|
+
}, {
|
|
283
|
+
readonly name: "anon_submissions";
|
|
284
|
+
readonly args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid, p_state text DEFAULT NULL::text, p_limit integer DEFAULT 100, p_offset integer DEFAULT 0";
|
|
285
|
+
readonly returns: "TABLE(id uuid, form_id uuid, inbound_id uuid, table_id uuid, source text, state text, payload jsonb, raw_payload jsonb, client_key text, record_id uuid, remote_origin text, rejection_reason text, created_at timestamp with time zone, cleared_at timestamp with time zone)";
|
|
286
|
+
readonly security: "definer";
|
|
272
287
|
}, {
|
|
273
288
|
readonly name: "anon_token_issue";
|
|
274
289
|
readonly args: "p_organization_id uuid, p_mode text, p_allowed_origins jsonb, p_form_id uuid DEFAULT NULL::uuid, p_saved_view_id uuid DEFAULT NULL::uuid, p_record_id uuid DEFAULT NULL::uuid, p_expires_at timestamp with time zone DEFAULT NULL::timestamp with time zone";
|
|
@@ -344,6 +359,16 @@ declare const STORE_DOORS: readonly [{
|
|
|
344
359
|
readonly args: "";
|
|
345
360
|
readonly returns: "name";
|
|
346
361
|
readonly security: "invoker";
|
|
362
|
+
}, {
|
|
363
|
+
readonly name: "carrying_edges_in";
|
|
364
|
+
readonly args: "p_organization_id uuid";
|
|
365
|
+
readonly returns: "TABLE(container_type text, container_id uuid, item_type text, item_id uuid, conveys_max permission_level)";
|
|
366
|
+
readonly security: "definer";
|
|
367
|
+
}, {
|
|
368
|
+
readonly name: "carrying_edges_of";
|
|
369
|
+
readonly args: "p_item_type text, p_item_id uuid";
|
|
370
|
+
readonly returns: "TABLE(container_type text, container_id uuid, conveys_max permission_level)";
|
|
371
|
+
readonly security: "definer";
|
|
347
372
|
}, {
|
|
348
373
|
readonly name: "client_write_grants";
|
|
349
374
|
readonly args: "";
|
|
@@ -389,6 +414,11 @@ declare const STORE_DOORS: readonly [{
|
|
|
389
414
|
readonly args: "p_organization_id uuid, p_record_id uuid";
|
|
390
415
|
readonly returns: "uuid[]";
|
|
391
416
|
readonly security: "invoker";
|
|
417
|
+
}, {
|
|
418
|
+
readonly name: "delete_preview";
|
|
419
|
+
readonly args: "p_organization_id uuid, p_record_id uuid";
|
|
420
|
+
readonly returns: "jsonb";
|
|
421
|
+
readonly security: "definer";
|
|
392
422
|
}, {
|
|
393
423
|
readonly name: "delete_rule";
|
|
394
424
|
readonly args: "p_organization_id uuid, p_record_id uuid, p_apply boolean DEFAULT true";
|
|
@@ -563,7 +593,7 @@ declare const STORE_DOORS: readonly [{
|
|
|
563
593
|
readonly name: "field_dependants";
|
|
564
594
|
readonly args: "p_organization_id uuid, p_field_id uuid";
|
|
565
595
|
readonly returns: "TABLE(kind text, dependant_id uuid, label text, how text)";
|
|
566
|
-
readonly security: "
|
|
596
|
+
readonly security: "definer";
|
|
567
597
|
}, {
|
|
568
598
|
readonly name: "field_kernel_id";
|
|
569
599
|
readonly args: "";
|
|
@@ -604,6 +634,11 @@ declare const STORE_DOORS: readonly [{
|
|
|
604
634
|
readonly args: "p_organization_id uuid, p_record_id uuid, p_field_data jsonb, p_values jsonb DEFAULT NULL::jsonb";
|
|
605
635
|
readonly returns: "jsonb";
|
|
606
636
|
readonly security: "invoker";
|
|
637
|
+
}, {
|
|
638
|
+
readonly name: "guard_refusals_are_complete";
|
|
639
|
+
readonly args: "";
|
|
640
|
+
readonly returns: "TABLE(guard text, said text)";
|
|
641
|
+
readonly security: "invoker";
|
|
607
642
|
}, {
|
|
608
643
|
readonly name: "has_visibility";
|
|
609
644
|
readonly args: "p_user_id uuid, p_type text, p_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level";
|
|
@@ -759,6 +794,11 @@ declare const STORE_DOORS: readonly [{
|
|
|
759
794
|
readonly args: "p_organization_id uuid, p_record_id uuid";
|
|
760
795
|
readonly returns: "TABLE(version integer, changed_at timestamp with time zone, changed_by uuid, summary text, operation text, changed_fields jsonb)";
|
|
761
796
|
readonly security: "definer";
|
|
797
|
+
}, {
|
|
798
|
+
readonly name: "is_a_retirement";
|
|
799
|
+
readonly args: "p_old_deleted timestamp with time zone, p_new_deleted timestamp with time zone, p_old_data jsonb, p_new_data jsonb, p_old_table uuid, p_new_table uuid, p_old_org uuid, p_new_org uuid, p_old_class text, p_new_class text";
|
|
800
|
+
readonly returns: "boolean";
|
|
801
|
+
readonly security: "invoker";
|
|
762
802
|
}, {
|
|
763
803
|
readonly name: "lookup_value";
|
|
764
804
|
readonly args: "p_organization_id uuid, p_record_id uuid, p_field_data jsonb";
|
|
@@ -823,7 +863,7 @@ declare const STORE_DOORS: readonly [{
|
|
|
823
863
|
readonly name: "migrate_retype";
|
|
824
864
|
readonly args: "p_organization_id uuid, p_id uuid, p_to text, p_note text DEFAULT NULL::text";
|
|
825
865
|
readonly returns: "jsonb";
|
|
826
|
-
readonly security: "
|
|
866
|
+
readonly security: "definer";
|
|
827
867
|
}, {
|
|
828
868
|
readonly name: "migrate_split";
|
|
829
869
|
readonly args: "p_organization_id uuid, p_record_id uuid, p_moved_keys text[], p_note text DEFAULT NULL::text";
|
|
@@ -834,6 +874,21 @@ declare const STORE_DOORS: readonly [{
|
|
|
834
874
|
readonly args: "p_organization_id uuid, p_log_id uuid";
|
|
835
875
|
readonly returns: "jsonb";
|
|
836
876
|
readonly security: "definer";
|
|
877
|
+
}, {
|
|
878
|
+
readonly name: "migrations";
|
|
879
|
+
readonly args: "p_organization_id uuid, p_target_id uuid DEFAULT NULL::uuid, p_limit integer DEFAULT 100";
|
|
880
|
+
readonly returns: "TABLE(id uuid, verb text, target_kind text, target_id uuid, note text, applied_at timestamp with time zone, applied_by uuid, undone_at timestamp with time zone)";
|
|
881
|
+
readonly security: "definer";
|
|
882
|
+
}, {
|
|
883
|
+
readonly name: "my_level";
|
|
884
|
+
readonly args: "p_organization_id uuid, p_id uuid, p_type text DEFAULT 'record'::text";
|
|
885
|
+
readonly returns: "permission_level";
|
|
886
|
+
readonly security: "definer";
|
|
887
|
+
}, {
|
|
888
|
+
readonly name: "my_levels";
|
|
889
|
+
readonly args: "p_organization_id uuid, p_ids jsonb, p_type text DEFAULT 'record'::text";
|
|
890
|
+
readonly returns: "TABLE(id uuid, level permission_level)";
|
|
891
|
+
readonly security: "definer";
|
|
837
892
|
}, {
|
|
838
893
|
readonly name: "organization_kernel_id";
|
|
839
894
|
readonly args: "";
|
|
@@ -1034,6 +1089,31 @@ declare const STORE_DOORS: readonly [{
|
|
|
1034
1089
|
readonly args: "p_organization_id uuid, p_roots uuid[]";
|
|
1035
1090
|
readonly returns: "TABLE(record_id uuid, depth integer, via text)";
|
|
1036
1091
|
readonly security: "invoker";
|
|
1092
|
+
}, {
|
|
1093
|
+
readonly name: "reaches_directly";
|
|
1094
|
+
readonly args: "p_user_id uuid, p_type text, p_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level";
|
|
1095
|
+
readonly returns: "boolean";
|
|
1096
|
+
readonly security: "definer";
|
|
1097
|
+
}, {
|
|
1098
|
+
readonly name: "read_door_carried_ids";
|
|
1099
|
+
readonly args: "p_user uuid, p_organization_id uuid, p_table_id uuid, p_required permission_level, OUT o_ids uuid[], OUT o_containers integer";
|
|
1100
|
+
readonly returns: "record";
|
|
1101
|
+
readonly security: "definer";
|
|
1102
|
+
}, {
|
|
1103
|
+
readonly name: "read_door_granted_ids";
|
|
1104
|
+
readonly args: "p_organization_id uuid, p_table_id uuid";
|
|
1105
|
+
readonly returns: "uuid[]";
|
|
1106
|
+
readonly security: "definer";
|
|
1107
|
+
}, {
|
|
1108
|
+
readonly name: "read_door_ladder_ceiling";
|
|
1109
|
+
readonly args: "";
|
|
1110
|
+
readonly returns: "integer";
|
|
1111
|
+
readonly security: "invoker";
|
|
1112
|
+
}, {
|
|
1113
|
+
readonly name: "read_door_parity";
|
|
1114
|
+
readonly args: "p_organization_id uuid, p_table_id uuid, p_user uuid, p_required permission_level, p_sample integer";
|
|
1115
|
+
readonly returns: "TABLE(record_id uuid, set_based boolean, per_row boolean, verdict text)";
|
|
1116
|
+
readonly security: "definer";
|
|
1037
1117
|
}, {
|
|
1038
1118
|
readonly name: "read_paths_outside_the_door";
|
|
1039
1119
|
readonly args: "";
|
|
@@ -1059,6 +1139,11 @@ declare const STORE_DOORS: readonly [{
|
|
|
1059
1139
|
readonly args: "p_organization_id uuid, p_record_id uuid";
|
|
1060
1140
|
readonly returns: "TABLE(rule_id uuid, rule_name text, rule_version integer, applies boolean, answer jsonb)";
|
|
1061
1141
|
readonly security: "invoker";
|
|
1142
|
+
}, {
|
|
1143
|
+
readonly name: "record_as_of";
|
|
1144
|
+
readonly args: "p_organization_id uuid, p_record_id uuid, p_at timestamp with time zone";
|
|
1145
|
+
readonly returns: "TABLE(state jsonb, replayed boolean)";
|
|
1146
|
+
readonly security: "definer";
|
|
1062
1147
|
}, {
|
|
1063
1148
|
readonly name: "record_card";
|
|
1064
1149
|
readonly args: "p_viewer uuid, p_organization_id uuid, p_record_id uuid";
|
|
@@ -1254,6 +1339,11 @@ declare const STORE_DOORS: readonly [{
|
|
|
1254
1339
|
readonly args: "p_organization_id uuid, p_rule_id uuid";
|
|
1255
1340
|
readonly returns: "integer";
|
|
1256
1341
|
readonly security: "invoker";
|
|
1342
|
+
}, {
|
|
1343
|
+
readonly name: "said";
|
|
1344
|
+
readonly args: "p_value text, p_when_there_is_none text";
|
|
1345
|
+
readonly returns: "text";
|
|
1346
|
+
readonly security: "invoker";
|
|
1257
1347
|
}, {
|
|
1258
1348
|
readonly name: "share_access";
|
|
1259
1349
|
readonly args: "p_organization_id uuid, p_subject_id uuid";
|
|
@@ -1294,6 +1384,11 @@ declare const STORE_DOORS: readonly [{
|
|
|
1294
1384
|
readonly args: "p_organization_id uuid, p_type text, p_id uuid";
|
|
1295
1385
|
readonly returns: "text";
|
|
1296
1386
|
readonly security: "definer";
|
|
1387
|
+
}, {
|
|
1388
|
+
readonly name: "shared_only_disagreements";
|
|
1389
|
+
readonly args: "p_pretend text DEFAULT NULL::text";
|
|
1390
|
+
readonly returns: "TABLE(organization_id uuid, organization_name text, member_id uuid, record_id uuid, table_id uuid, ladder boolean, read_door boolean, rls_mirror boolean, why text)";
|
|
1391
|
+
readonly security: "invoker";
|
|
1297
1392
|
}, {
|
|
1298
1393
|
readonly name: "size_refusal";
|
|
1299
1394
|
readonly args: "p_organization_id uuid, p_data jsonb";
|
|
@@ -1339,6 +1434,11 @@ declare const STORE_DOORS: readonly [{
|
|
|
1339
1434
|
readonly args: "p_organization_id uuid, p_spec jsonb";
|
|
1340
1435
|
readonly returns: "uuid";
|
|
1341
1436
|
readonly security: "definer";
|
|
1437
|
+
}, {
|
|
1438
|
+
readonly name: "table_has_a_visible_record";
|
|
1439
|
+
readonly args: "p_user uuid, p_organization_id uuid, p_table_id uuid";
|
|
1440
|
+
readonly returns: "boolean";
|
|
1441
|
+
readonly security: "definer";
|
|
1342
1442
|
}, {
|
|
1343
1443
|
readonly name: "table_is_live";
|
|
1344
1444
|
readonly args: "p_organization_id uuid, p_table_id uuid";
|
|
@@ -1373,7 +1473,7 @@ declare const STORE_DOORS: readonly [{
|
|
|
1373
1473
|
readonly name: "table_type_field";
|
|
1374
1474
|
readonly args: "p_organization_id uuid, p_table_id uuid";
|
|
1375
1475
|
readonly returns: "text";
|
|
1376
|
-
readonly security: "
|
|
1476
|
+
readonly security: "definer";
|
|
1377
1477
|
}, {
|
|
1378
1478
|
readonly name: "tables_at_home";
|
|
1379
1479
|
readonly args: "p_organization_id uuid, p_home_ids uuid[]";
|
|
@@ -1428,7 +1528,7 @@ declare const STORE_DOORS: readonly [{
|
|
|
1428
1528
|
readonly name: "value_read";
|
|
1429
1529
|
readonly args: "p_organization_id uuid, p_record_id uuid, p_key text";
|
|
1430
1530
|
readonly returns: "TABLE(field_key text, field_id uuid, value jsonb, value_version integer, source jsonb, absent_reason text, actor text, on_behalf_of text, written_at timestamp with time zone, alternates jsonb)";
|
|
1431
|
-
readonly security: "
|
|
1531
|
+
readonly security: "definer";
|
|
1432
1532
|
}, {
|
|
1433
1533
|
readonly name: "value_versions";
|
|
1434
1534
|
readonly args: "p_old jsonb, p_new jsonb";
|
|
@@ -1459,11 +1559,21 @@ declare const STORE_DOORS: readonly [{
|
|
|
1459
1559
|
readonly args: "p_container_type text, p_container_id uuid";
|
|
1460
1560
|
readonly returns: "integer";
|
|
1461
1561
|
readonly security: "definer";
|
|
1562
|
+
}, {
|
|
1563
|
+
readonly name: "visible_predicate_sql";
|
|
1564
|
+
readonly args: "p_user uuid, p_organization_id uuid, p_table_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level, p_alias text DEFAULT 'r'::text";
|
|
1565
|
+
readonly returns: "text";
|
|
1566
|
+
readonly security: "definer";
|
|
1462
1567
|
}, {
|
|
1463
1568
|
readonly name: "visible_record_ids";
|
|
1464
1569
|
readonly args: "p_user_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level";
|
|
1465
1570
|
readonly returns: "TABLE(id uuid)";
|
|
1466
1571
|
readonly security: "definer";
|
|
1572
|
+
}, {
|
|
1573
|
+
readonly name: "visible_set";
|
|
1574
|
+
readonly args: "p_user uuid, p_organization_id uuid, p_table_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level, OUT o_all_visible boolean, OUT o_true_visibility platform.visibility[], OUT o_granted_all uuid[], OUT o_granted_visible uuid[], OUT o_carried_visible uuid[], OUT o_ladder_calls integer, OUT o_fallback boolean, OUT o_note text";
|
|
1575
|
+
readonly returns: "record";
|
|
1576
|
+
readonly security: "definer";
|
|
1467
1577
|
}, {
|
|
1468
1578
|
readonly name: "widget_kernel_id";
|
|
1469
1579
|
readonly args: "";
|
|
@@ -1563,15 +1673,15 @@ declare const STORE_DOORS: readonly [{
|
|
|
1563
1673
|
/** The campaign's own knobs, with the value the store resolves them to today. */
|
|
1564
1674
|
declare const STORE_KNOBS: readonly [{
|
|
1565
1675
|
readonly key: "accessible_entity_ids_guard";
|
|
1566
|
-
readonly value: "
|
|
1676
|
+
readonly value: "true";
|
|
1567
1677
|
readonly type: "boolean";
|
|
1568
1678
|
}, {
|
|
1569
1679
|
readonly key: "agent_schema_changes";
|
|
1570
|
-
readonly value: "\"
|
|
1680
|
+
readonly value: "\"ask\"";
|
|
1571
1681
|
readonly type: "string";
|
|
1572
1682
|
}, {
|
|
1573
1683
|
readonly key: "associations_guard";
|
|
1574
|
-
readonly value: "
|
|
1684
|
+
readonly value: "true";
|
|
1575
1685
|
readonly type: "boolean";
|
|
1576
1686
|
}, {
|
|
1577
1687
|
readonly key: "code_paths_enabled";
|
|
@@ -1652,7 +1762,7 @@ declare const STORE_KNOBS: readonly [{
|
|
|
1652
1762
|
}, {
|
|
1653
1763
|
readonly key: "member_default_level";
|
|
1654
1764
|
readonly value: "\"viewer\"";
|
|
1655
|
-
readonly type: "
|
|
1765
|
+
readonly type: "enum";
|
|
1656
1766
|
}, {
|
|
1657
1767
|
readonly key: "member_default_visibility";
|
|
1658
1768
|
readonly value: "\"all_records\"";
|
|
@@ -1722,22 +1832,22 @@ declare const STORE_REFUSAL_CODES: readonly [{
|
|
|
1722
1832
|
readonly raised_by: "rule_eval";
|
|
1723
1833
|
}, {
|
|
1724
1834
|
readonly code: "22023";
|
|
1725
|
-
readonly 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";
|
|
1835
|
+
readonly 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,my_levels,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";
|
|
1726
1836
|
}, {
|
|
1727
1837
|
readonly code: "23503";
|
|
1728
1838
|
readonly 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";
|
|
1729
1839
|
}, {
|
|
1730
1840
|
readonly code: "23505";
|
|
1731
|
-
readonly raised_by: "doc_sign,doc_signature_write,field_declare,home_add,io_proposal_accept,relation_carry,relation_own,share_grant,work_slot_hold";
|
|
1841
|
+
readonly raised_by: "_unique_rule_holds,doc_sign,doc_signature_write,field_declare,home_add,io_proposal_accept,relation_carry,relation_own,share_grant,work_slot_hold";
|
|
1732
1842
|
}, {
|
|
1733
1843
|
readonly code: "23514";
|
|
1734
|
-
readonly 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";
|
|
1844
|
+
readonly 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,_resolve_choice_words,_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";
|
|
1735
1845
|
}, {
|
|
1736
1846
|
readonly code: "40001";
|
|
1737
1847
|
readonly raised_by: "has_visibility_at";
|
|
1738
1848
|
}, {
|
|
1739
1849
|
readonly code: "42501";
|
|
1740
|
-
readonly 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";
|
|
1850
|
+
readonly 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,external_write_through,io_comment_resolve,io_comment_write,io_restore,migrate_purge,my_levels,promote_table,query_visibility_parity,read_record,read_records,share_grant,visibility_as_of";
|
|
1741
1851
|
}, {
|
|
1742
1852
|
readonly code: "53400";
|
|
1743
1853
|
readonly raised_by: "anon_rate_take,delete_cascade_closure,promote_field";
|
|
@@ -2038,6 +2148,27 @@ interface RecordRead {
|
|
|
2038
2148
|
}>;
|
|
2039
2149
|
}
|
|
2040
2150
|
|
|
2151
|
+
/** `public.permission_level`, in the store's own order. */
|
|
2152
|
+
type PermissionLevel = "viewer" | "commenter" | "editor" | "admin";
|
|
2153
|
+
/** The order the store writes them in, lowest first. */
|
|
2154
|
+
declare const PERMISSION_LEVELS: readonly PermissionLevel[];
|
|
2155
|
+
/** Whether `held` is the same rung as `needed` or a higher one. Nothing held is never enough. */
|
|
2156
|
+
declare function atLeast(held: PermissionLevel | null | undefined, needed: PermissionLevel): boolean;
|
|
2157
|
+
/** A level word the store sent, or null when it sent something this package does not know. */
|
|
2158
|
+
declare function asPermissionLevel(word: unknown): PermissionLevel | null;
|
|
2159
|
+
/** The higher of two levels — what a person holds when two ways in both let them through. */
|
|
2160
|
+
declare function highestLevel(left: PermissionLevel | null | undefined, right: PermissionLevel | null | undefined): PermissionLevel | null;
|
|
2161
|
+
/**
|
|
2162
|
+
* What one subject's level is, as `custom.my_levels` answers it. `null` is an
|
|
2163
|
+
* ANSWER — "you hold nothing on this" — and never a missing row: a screen that
|
|
2164
|
+
* could not tell "no access" from "not asked yet" would draw one of them as the
|
|
2165
|
+
* other.
|
|
2166
|
+
*/
|
|
2167
|
+
interface MyLevel {
|
|
2168
|
+
id: string;
|
|
2169
|
+
level: PermissionLevel | null;
|
|
2170
|
+
}
|
|
2171
|
+
|
|
2041
2172
|
/**
|
|
2042
2173
|
* REC-1. A Table declares its fields, exactly one Home, and the properties
|
|
2043
2174
|
* `display`, `ordered`, `heavy` | `light`, `retention` and `detail`.
|
|
@@ -3081,4 +3212,4 @@ interface RecordsConfig {
|
|
|
3081
3212
|
schema?: string;
|
|
3082
3213
|
}
|
|
3083
3214
|
|
|
3084
|
-
export { ABSENCE_REASONS, ACTOR_VOCABULARY, type AbsenceReason, type Actor, type AggregateBucket, type AggregateMeasure, type AggregateOperation, type AggregateRow, type AnonTokenBinding, COMPUTE_ON, CONTEXT_POLICIES, type ComputeOn, type ContextPolicy, DELIVERIES, type Delivery, type DocRenderRow, type DocSignatureCheck, type DocSignatureRow, type DocTemplateRow, type DocToken, type DocUnresolvedToken, ENTITY_TOKENS, type EntityToken, type ExternalPrincipalCard, FIELD_SENSITIVITIES, FIELD_SOURCES, FRESHNESS, type Field, type FieldBehavior, type FieldPatch, type FieldProposal, type FieldRule, type FieldSensitivity, type FieldSource, type ForbiddenEnvelopeWord, type Freshness, type HiddenFieldNotice, type Home, KERNEL_TABLES, type KernelTableName, MERGE_FIELD_MODIFIERS, MERGE_FIELD_SEMANTIC_TYPES, MERGE_FIELD_SOURCES, type MergeField, type MergeFieldModifier, type MergeFieldProvenance, type MergeFieldResolution, type MergeFieldSemanticType, type MergeFieldSource, type MergeFieldTransform, type MissingBehavior, type NewFieldDeclaration, ON_DELETE, OVERRIDE_POLICIES, type OnDelete, type OverridePolicy, PARITY_FIELD_TYPES, PER_VALUE_ACCESS_WORDS, type ParityFieldType, type ParityFieldTypeDescriptor, type PerValueAccessWord, type PgError, type PredictedRefusal, type ProvenancePointer, type PublishBinding, RELATION_BINDINGS, RELATION_CARDINALITIES, RELATION_FLAVORS, RETIRED_ACTOR_WORDS, RULE_NODE_KINDS, RULE_USES, type ReadRow, type ReadValue, type RecordDocument, type RecordRead, type RecordRevision, type RecordsActor, type RecordsConfig, type RecordsDataSource, type RecordsError, type RecordsErrorCode, type RecordsErrorSink, type RecordsFilter, type RecordsRealtimePort, type RecordsResolverPort, type RecordsResponse, type RecordsResult, type RecordsTableQuery, type RegisteredTable, type Relation, type RelationBinding, type RelationCardinality, type RelationCarries, type RelationCoordinate, type RelationFlavor, type RelationProperties, type RelationTarget, type ResolutionTriple, type ResolvedPublishBinding, type RetiredActorWord, type Rule, type RuleAnswer, type RuleExpression, type RuleNodeKind, type RuleUse, STORAGE_MODES, STORE_DOORS, STORE_KNOBS, STORE_REFUSAL_CODES, type StaleWriteDetail, type StorageMode, type StoreDoorName, type StoreRefusalCode, type StoredRecord, type Subscription, type SubscriptionBlock, type SubscriptionCadence, TABLE_DISPLAYS, TABLE_ORIGINS, TABLE_TYPES, type Table, type TableCapacity, type TableDisplay, type TableOrigin, type TableProposal, type TableType, type Timestamp, type Uuid, VALUE_ALTERNATE_KEYS, VALUE_ENVELOPE_KEYS, type ValueAlternate, type ValueAlternateKey, type ValueEnvelope, type ValueEnvelopeKey, type ValueSource, type WorkAssignmentField, type WorkGraph, type WorkInstantiation, type WorkSlotHold, type WorkState, type WorkTemplateNode, type WorkTemplateRelation, type WorkTurn, type WriteConflict, err, isRecordsErr, measureKey, ok };
|
|
3215
|
+
export { ABSENCE_REASONS, ACTOR_VOCABULARY, type AbsenceReason, type Actor, type AggregateBucket, type AggregateMeasure, type AggregateOperation, type AggregateRow, type AnonTokenBinding, COMPUTE_ON, CONTEXT_POLICIES, type ComputeOn, type ContextPolicy, DELIVERIES, type Delivery, type DocRenderRow, type DocSignatureCheck, type DocSignatureRow, type DocTemplateRow, type DocToken, type DocUnresolvedToken, ENTITY_TOKENS, type EntityToken, type ExternalPrincipalCard, FIELD_SENSITIVITIES, FIELD_SOURCES, FRESHNESS, type Field, type FieldBehavior, type FieldPatch, type FieldProposal, type FieldRule, type FieldSensitivity, type FieldSource, type ForbiddenEnvelopeWord, type Freshness, type HiddenFieldNotice, type Home, KERNEL_TABLES, type KernelTableName, MERGE_FIELD_MODIFIERS, MERGE_FIELD_SEMANTIC_TYPES, MERGE_FIELD_SOURCES, type MergeField, type MergeFieldModifier, type MergeFieldProvenance, type MergeFieldResolution, type MergeFieldSemanticType, type MergeFieldSource, type MergeFieldTransform, type MissingBehavior, type MyLevel, type NewFieldDeclaration, ON_DELETE, OVERRIDE_POLICIES, type OnDelete, type OverridePolicy, PARITY_FIELD_TYPES, PERMISSION_LEVELS, PER_VALUE_ACCESS_WORDS, type ParityFieldType, type ParityFieldTypeDescriptor, type PerValueAccessWord, type PermissionLevel, type PgError, type PredictedRefusal, type ProvenancePointer, type PublishBinding, RELATION_BINDINGS, RELATION_CARDINALITIES, RELATION_FLAVORS, RETIRED_ACTOR_WORDS, RULE_NODE_KINDS, RULE_USES, type ReadRow, type ReadValue, type RecordDocument, type RecordRead, type RecordRevision, type RecordsActor, type RecordsConfig, type RecordsDataSource, type RecordsError, type RecordsErrorCode, type RecordsErrorSink, type RecordsFilter, type RecordsRealtimePort, type RecordsResolverPort, type RecordsResponse, type RecordsResult, type RecordsTableQuery, type RegisteredTable, type Relation, type RelationBinding, type RelationCardinality, type RelationCarries, type RelationCoordinate, type RelationFlavor, type RelationProperties, type RelationTarget, type ResolutionTriple, type ResolvedPublishBinding, type RetiredActorWord, type Rule, type RuleAnswer, type RuleExpression, type RuleNodeKind, type RuleUse, STORAGE_MODES, STORE_DOORS, STORE_KNOBS, STORE_REFUSAL_CODES, type StaleWriteDetail, type StorageMode, type StoreDoorName, type StoreRefusalCode, type StoredRecord, type Subscription, type SubscriptionBlock, type SubscriptionCadence, TABLE_DISPLAYS, TABLE_ORIGINS, TABLE_TYPES, type Table, type TableCapacity, type TableDisplay, type TableOrigin, type TableProposal, type TableType, type Timestamp, type Uuid, VALUE_ALTERNATE_KEYS, VALUE_ENVELOPE_KEYS, type ValueAlternate, type ValueAlternateKey, type ValueEnvelope, type ValueEnvelopeKey, type ValueSource, type WorkAssignmentField, type WorkGraph, type WorkInstantiation, type WorkSlotHold, type WorkState, type WorkTemplateNode, type WorkTemplateRelation, type WorkTurn, type WriteConflict, asPermissionLevel, atLeast, err, highestLevel, isRecordsErr, measureKey, ok };
|
package/dist/index.js
CHANGED
|
@@ -54,6 +54,33 @@ var OVERRIDE_POLICIES = [
|
|
|
54
54
|
var FRESHNESS = ["live", "cached", "snapshot"];
|
|
55
55
|
var TABLE_DISPLAYS = ["list", "grid", "board", "calendar", "timeline"];
|
|
56
56
|
|
|
57
|
+
// src/level.ts
|
|
58
|
+
var PERMISSION_LEVELS = [
|
|
59
|
+
"viewer",
|
|
60
|
+
"commenter",
|
|
61
|
+
"editor",
|
|
62
|
+
"admin"
|
|
63
|
+
];
|
|
64
|
+
var ORDINAL = {
|
|
65
|
+
viewer: 1,
|
|
66
|
+
commenter: 2,
|
|
67
|
+
editor: 3,
|
|
68
|
+
admin: 4
|
|
69
|
+
};
|
|
70
|
+
function atLeast(held, needed) {
|
|
71
|
+
if (!held) return false;
|
|
72
|
+
const have = ORDINAL[held];
|
|
73
|
+
return have !== void 0 && have >= ORDINAL[needed];
|
|
74
|
+
}
|
|
75
|
+
function asPermissionLevel(word) {
|
|
76
|
+
return typeof word === "string" && word in ORDINAL ? word : null;
|
|
77
|
+
}
|
|
78
|
+
function highestLevel(left, right) {
|
|
79
|
+
if (!left) return right ?? null;
|
|
80
|
+
if (!right) return left;
|
|
81
|
+
return ORDINAL[left] >= ORDINAL[right] ? left : right;
|
|
82
|
+
}
|
|
83
|
+
|
|
57
84
|
// src/aggregate.ts
|
|
58
85
|
function measureKey(measure) {
|
|
59
86
|
return measure.op === "count" ? "count" : `${measure.op}_${measure.key ?? ""}`;
|
|
@@ -128,7 +155,9 @@ var STORE_DOORS = [
|
|
|
128
155
|
{ name: "absence_reasons", args: "", returns: "text[]", security: "invoker" },
|
|
129
156
|
{ name: "actor_vocabulary", args: "", returns: "text[]", security: "invoker" },
|
|
130
157
|
{ name: "actor_word", args: "p_declared text", returns: "text", security: "invoker" },
|
|
158
|
+
{ name: "agent_change_approval", args: "p_organization uuid, p_conversation uuid DEFAULT NULL::uuid, p_table uuid DEFAULT NULL::uuid", returns: "jsonb", security: "definer" },
|
|
131
159
|
{ name: "agent_context", args: "p_organization_id uuid, p_table_id uuid, p_limit integer DEFAULT 50", returns: "jsonb", security: "invoker" },
|
|
160
|
+
{ name: "agent_table_claim", args: "p_organization uuid, p_table uuid, p_conversation uuid DEFAULT NULL::uuid", returns: "void", security: "definer" },
|
|
132
161
|
{ name: "agg_assert_key", args: "p_key text", returns: "text", security: "invoker" },
|
|
133
162
|
{ name: "agg_buckets", args: "", returns: "text[]", security: "invoker" },
|
|
134
163
|
{ 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" },
|
|
@@ -146,6 +175,7 @@ var STORE_DOORS = [
|
|
|
146
175
|
{ name: "anon_inbound_land", args: "p_address text, p_secret text, p_payload jsonb, p_raw_payload jsonb DEFAULT '{}'::jsonb, p_client_key text DEFAULT NULL::text", returns: "uuid", security: "definer" },
|
|
147
176
|
{ name: "anon_publish", args: "p_organization_id uuid, p_form_id uuid, p_published boolean DEFAULT true", returns: "timestamp with time zone", security: "definer" },
|
|
148
177
|
{ name: "anon_rate_take", args: "p_organization_id uuid, p_form_id uuid, p_bucket text, p_token_id uuid DEFAULT NULL::uuid", returns: "integer", security: "definer" },
|
|
178
|
+
{ name: "anon_submissions", args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid, p_state text DEFAULT NULL::text, p_limit integer DEFAULT 100, p_offset integer DEFAULT 0", returns: "TABLE(id uuid, form_id uuid, inbound_id uuid, table_id uuid, source text, state text, payload jsonb, raw_payload jsonb, client_key text, record_id uuid, remote_origin text, rejection_reason text, created_at timestamp with time zone, cleared_at timestamp with time zone)", security: "definer" },
|
|
149
179
|
{ name: "anon_token_issue", args: "p_organization_id uuid, p_mode text, p_allowed_origins jsonb, p_form_id uuid DEFAULT NULL::uuid, p_saved_view_id uuid DEFAULT NULL::uuid, p_record_id uuid DEFAULT NULL::uuid, p_expires_at timestamp with time zone DEFAULT NULL::timestamp with time zone", returns: "TABLE(token_id uuid, secret text)", security: "definer" },
|
|
150
180
|
{ name: "anon_token_revoke", args: "p_organization_id uuid, p_token_id uuid", returns: "boolean", security: "definer" },
|
|
151
181
|
{ name: "anon_token_verify", args: "p_secret text, p_origin text, p_required_mode text", returns: "TABLE(token_id uuid, organization_id uuid, form_id uuid, saved_view_id uuid, record_id uuid, mode text)", security: "definer" },
|
|
@@ -161,6 +191,8 @@ var STORE_DOORS = [
|
|
|
161
191
|
{ name: "bump_epoch", args: "p_entity_type text, p_entity_id uuid, p_organization_id uuid DEFAULT NULL::uuid", returns: "bigint", security: "definer" },
|
|
162
192
|
{ name: "cache_lookup", args: "p_container_type text, p_container_id uuid, p_item_type text, p_item_id uuid", returns: "permission_level", security: "definer" },
|
|
163
193
|
{ name: "caller_role", args: "", returns: "name", security: "invoker" },
|
|
194
|
+
{ name: "carrying_edges_in", args: "p_organization_id uuid", returns: "TABLE(container_type text, container_id uuid, item_type text, item_id uuid, conveys_max permission_level)", security: "definer" },
|
|
195
|
+
{ name: "carrying_edges_of", args: "p_item_type text, p_item_id uuid", returns: "TABLE(container_type text, container_id uuid, conveys_max permission_level)", security: "definer" },
|
|
164
196
|
{ name: "client_write_grants", args: "", returns: "TABLE(role_name text, object_name text, privilege text)", security: "invoker" },
|
|
165
197
|
{ 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" },
|
|
166
198
|
{ name: "containment_chain", args: "p_organization_id uuid, p_record_id uuid", returns: "TABLE(ancestor_id uuid, depth integer)", security: "invoker" },
|
|
@@ -170,6 +202,7 @@ var STORE_DOORS = [
|
|
|
170
202
|
{ name: "cross_organization_links_open", args: "p_source_organization_id uuid, p_target_organization_id uuid", returns: "boolean", security: "invoker" },
|
|
171
203
|
{ name: "custom_fields_tables", args: "", returns: "TABLE(token text, schema_name text, table_name text)", security: "invoker" },
|
|
172
204
|
{ name: "delete_cascade_closure", args: "p_organization_id uuid, p_record_id uuid", returns: "uuid[]", security: "invoker" },
|
|
205
|
+
{ name: "delete_preview", args: "p_organization_id uuid, p_record_id uuid", returns: "jsonb", security: "definer" },
|
|
173
206
|
{ name: "delete_rule", args: "p_organization_id uuid, p_record_id uuid, p_apply boolean DEFAULT true", returns: "jsonb", security: "definer" },
|
|
174
207
|
{ name: "dependency_cycle", args: "p_organization_id uuid, p_row custom.record", returns: "text[]", security: "invoker" },
|
|
175
208
|
{ name: "dependency_label", args: "p_organization_id uuid, p_node text", returns: "text", security: "invoker" },
|
|
@@ -204,7 +237,7 @@ var STORE_DOORS = [
|
|
|
204
237
|
{ name: "external_writes_set", args: "p_organization_id uuid, p_source_id uuid, p_enabled boolean", returns: "boolean", security: "definer" },
|
|
205
238
|
{ name: "field_behaviour", args: "p_field_data jsonb", returns: "text", security: "invoker" },
|
|
206
239
|
{ name: "field_declare", args: "p_organization_id uuid, p_table_id uuid, p_spec jsonb", returns: "uuid", security: "definer" },
|
|
207
|
-
{ name: "field_dependants", args: "p_organization_id uuid, p_field_id uuid", returns: "TABLE(kind text, dependant_id uuid, label text, how text)", security: "
|
|
240
|
+
{ 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" },
|
|
208
241
|
{ name: "field_kernel_id", args: "", returns: "uuid", security: "invoker" },
|
|
209
242
|
{ name: "field_options", args: "p_organization_id uuid, p_field_id uuid", returns: "SETOF custom.record", security: "definer" },
|
|
210
243
|
{ name: "field_retire", args: "p_organization_id uuid, p_field_id uuid", returns: "boolean", security: "definer" },
|
|
@@ -213,6 +246,7 @@ var STORE_DOORS = [
|
|
|
213
246
|
{ name: "field_value_convert", args: "p_to jsonb, p_value jsonb", returns: "jsonb", security: "invoker" },
|
|
214
247
|
{ name: "file_kernel_id", args: "", returns: "uuid", security: "invoker" },
|
|
215
248
|
{ 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" },
|
|
249
|
+
{ name: "guard_refusals_are_complete", args: "", returns: "TABLE(guard text, said text)", security: "invoker" },
|
|
216
250
|
{ 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" },
|
|
217
251
|
{ 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" },
|
|
218
252
|
{ name: "hidden_field_notice", args: "p_field custom.record, p_action text DEFAULT 'read'::text", returns: "jsonb", security: "invoker" },
|
|
@@ -244,6 +278,7 @@ var STORE_DOORS = [
|
|
|
244
278
|
{ name: "io_record_changed", args: "", returns: "trigger", security: "definer" },
|
|
245
279
|
{ name: "io_restore", args: "p_organization_id uuid, p_record_id uuid, p_version integer", returns: "integer", security: "definer" },
|
|
246
280
|
{ 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" },
|
|
281
|
+
{ name: "is_a_retirement", args: "p_old_deleted timestamp with time zone, p_new_deleted timestamp with time zone, p_old_data jsonb, p_new_data jsonb, p_old_table uuid, p_new_table uuid, p_old_org uuid, p_new_org uuid, p_old_class text, p_new_class text", returns: "boolean", security: "invoker" },
|
|
247
282
|
{ name: "lookup_value", args: "p_organization_id uuid, p_record_id uuid, p_field_data jsonb", returns: "jsonb", security: "invoker" },
|
|
248
283
|
{ 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" },
|
|
249
284
|
{ 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" },
|
|
@@ -256,9 +291,12 @@ var STORE_DOORS = [
|
|
|
256
291
|
{ 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" },
|
|
257
292
|
{ name: "migrate_rename", args: "p_organization_id uuid, p_id uuid, p_to text, p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
258
293
|
{ 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" },
|
|
259
|
-
{ name: "migrate_retype", args: "p_organization_id uuid, p_id uuid, p_to text, p_note text DEFAULT NULL::text", returns: "jsonb", security: "
|
|
294
|
+
{ name: "migrate_retype", args: "p_organization_id uuid, p_id uuid, p_to text, p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
260
295
|
{ 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" },
|
|
261
296
|
{ name: "migrate_undo", args: "p_organization_id uuid, p_log_id uuid", returns: "jsonb", security: "definer" },
|
|
297
|
+
{ name: "migrations", args: "p_organization_id uuid, p_target_id uuid DEFAULT NULL::uuid, p_limit integer DEFAULT 100", returns: "TABLE(id uuid, verb text, target_kind text, target_id uuid, note text, applied_at timestamp with time zone, applied_by uuid, undone_at timestamp with time zone)", security: "definer" },
|
|
298
|
+
{ name: "my_level", args: "p_organization_id uuid, p_id uuid, p_type text DEFAULT 'record'::text", returns: "permission_level", security: "definer" },
|
|
299
|
+
{ name: "my_levels", args: "p_organization_id uuid, p_ids jsonb, p_type text DEFAULT 'record'::text", returns: "TABLE(id uuid, level permission_level)", security: "definer" },
|
|
262
300
|
{ name: "organization_kernel_id", args: "", returns: "uuid", security: "invoker" },
|
|
263
301
|
{ 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" },
|
|
264
302
|
{ name: "owning_table", args: "p_organization_id uuid, p_record_id uuid", returns: "uuid", security: "invoker" },
|
|
@@ -299,11 +337,17 @@ var STORE_DOORS = [
|
|
|
299
337
|
{ 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" },
|
|
300
338
|
{ 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" },
|
|
301
339
|
{ name: "reachable_from", args: "p_organization_id uuid, p_roots uuid[]", returns: "TABLE(record_id uuid, depth integer, via text)", security: "invoker" },
|
|
340
|
+
{ name: "reaches_directly", args: "p_user_id uuid, p_type text, p_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level", returns: "boolean", security: "definer" },
|
|
341
|
+
{ name: "read_door_carried_ids", args: "p_user uuid, p_organization_id uuid, p_table_id uuid, p_required permission_level, OUT o_ids uuid[], OUT o_containers integer", returns: "record", security: "definer" },
|
|
342
|
+
{ name: "read_door_granted_ids", args: "p_organization_id uuid, p_table_id uuid", returns: "uuid[]", security: "definer" },
|
|
343
|
+
{ name: "read_door_ladder_ceiling", args: "", returns: "integer", security: "invoker" },
|
|
344
|
+
{ name: "read_door_parity", args: "p_organization_id uuid, p_table_id uuid, p_user uuid, p_required permission_level, p_sample integer", returns: "TABLE(record_id uuid, set_based boolean, per_row boolean, verdict text)", security: "definer" },
|
|
302
345
|
{ name: "read_paths_outside_the_door", args: "", returns: "TABLE(object_name text, why text)", security: "invoker" },
|
|
303
346
|
{ name: "read_record", args: "p_organization_id uuid, p_record_id uuid, p_by_id boolean DEFAULT false", returns: "jsonb", security: "definer" },
|
|
304
347
|
{ 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" },
|
|
305
348
|
{ 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" },
|
|
306
349
|
{ 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" },
|
|
350
|
+
{ 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" },
|
|
307
351
|
{ name: "record_card", args: "p_viewer uuid, p_organization_id uuid, p_record_id uuid", returns: "jsonb", security: "definer" },
|
|
308
352
|
{ 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" },
|
|
309
353
|
{ name: "record_delete", args: "p_organization_id uuid, p_record_id uuid", returns: "timestamp with time zone", security: "definer" },
|
|
@@ -343,6 +387,7 @@ var STORE_DOORS = [
|
|
|
343
387
|
{ name: "rule_truth", args: "p_answer jsonb", returns: "boolean", security: "invoker" },
|
|
344
388
|
{ name: "rule_uses", args: "", returns: "text[]", security: "invoker" },
|
|
345
389
|
{ name: "rule_version", args: "p_organization_id uuid, p_rule_id uuid", returns: "integer", security: "invoker" },
|
|
390
|
+
{ name: "said", args: "p_value text, p_when_there_is_none text", returns: "text", security: "invoker" },
|
|
346
391
|
{ 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" },
|
|
347
392
|
{ 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" },
|
|
348
393
|
{ 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" },
|
|
@@ -351,6 +396,7 @@ var STORE_DOORS = [
|
|
|
351
396
|
{ 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" },
|
|
352
397
|
{ name: "share_revoke", args: "p_organization_id uuid, p_subject_id uuid, p_principal_kind text, p_principal_id uuid", returns: "jsonb", security: "definer" },
|
|
353
398
|
{ name: "share_subject_name", args: "p_organization_id uuid, p_type text, p_id uuid", returns: "text", security: "definer" },
|
|
399
|
+
{ name: "shared_only_disagreements", args: "p_pretend text DEFAULT NULL::text", returns: "TABLE(organization_id uuid, organization_name text, member_id uuid, record_id uuid, table_id uuid, ladder boolean, read_door boolean, rls_mirror boolean, why text)", security: "invoker" },
|
|
354
400
|
{ name: "size_refusal", args: "p_organization_id uuid, p_data jsonb", returns: "text", security: "invoker" },
|
|
355
401
|
{ name: "source_next_pointer", args: "p_sources jsonb", returns: "text", security: "invoker" },
|
|
356
402
|
{ name: "source_pointer", args: "p_sources jsonb, p_source jsonb", returns: "text", security: "invoker" },
|
|
@@ -360,13 +406,14 @@ var STORE_DOORS = [
|
|
|
360
406
|
{ name: "table_capacity", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "definer" },
|
|
361
407
|
{ name: "table_contents", args: "p_organization_id uuid, p_table_id uuid", returns: "TABLE(record_id uuid, kind text, goes_at integer)", security: "invoker" },
|
|
362
408
|
{ name: "table_declare", args: "p_organization_id uuid, p_spec jsonb", returns: "uuid", security: "definer" },
|
|
409
|
+
{ name: "table_has_a_visible_record", args: "p_user uuid, p_organization_id uuid, p_table_id uuid", returns: "boolean", security: "definer" },
|
|
363
410
|
{ name: "table_is_live", args: "p_organization_id uuid, p_table_id uuid", returns: "boolean", security: "invoker" },
|
|
364
411
|
{ name: "table_kernel_id", args: "", returns: "uuid", security: "invoker" },
|
|
365
412
|
{ name: "table_record_ceiling", args: "", returns: "integer", security: "invoker" },
|
|
366
413
|
{ name: "table_record_ceiling", args: "p_organization_id uuid", returns: "integer", security: "invoker" },
|
|
367
414
|
{ 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" },
|
|
368
415
|
{ name: "table_storage", args: "p_organization_id uuid, p_table_id uuid", returns: "text", security: "invoker" },
|
|
369
|
-
{ name: "table_type_field", args: "p_organization_id uuid, p_table_id uuid", returns: "text", security: "
|
|
416
|
+
{ name: "table_type_field", args: "p_organization_id uuid, p_table_id uuid", returns: "text", security: "definer" },
|
|
370
417
|
{ 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" },
|
|
371
418
|
{ name: "tables_described_without_asking", args: "", returns: "TABLE(function_name text, identity_args text, why text)", security: "invoker" },
|
|
372
419
|
{ name: "trg_associations_bump_visibility", args: "", returns: "trigger", security: "definer" },
|
|
@@ -377,14 +424,16 @@ var STORE_DOORS = [
|
|
|
377
424
|
{ name: "value_envelope_keys", args: "", returns: "text[]", security: "invoker" },
|
|
378
425
|
{ name: "value_envelope_ok", args: "p_data jsonb", returns: "boolean", security: "invoker" },
|
|
379
426
|
{ name: "value_envelope_refusal", args: "p_data jsonb", returns: "text", security: "invoker" },
|
|
380
|
-
{ 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: "
|
|
427
|
+
{ 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" },
|
|
381
428
|
{ name: "value_versions", args: "p_old jsonb, p_new jsonb", returns: "jsonb", security: "invoker" },
|
|
382
429
|
{ 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" },
|
|
383
430
|
{ 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" },
|
|
384
431
|
{ name: "visibility_cache_rebuild", args: "", returns: "integer", security: "definer" },
|
|
385
432
|
{ 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" },
|
|
386
433
|
{ name: "visibility_warm", args: "p_container_type text, p_container_id uuid", returns: "integer", security: "definer" },
|
|
434
|
+
{ name: "visible_predicate_sql", args: "p_user uuid, p_organization_id uuid, p_table_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level, p_alias text DEFAULT 'r'::text", returns: "text", security: "definer" },
|
|
387
435
|
{ name: "visible_record_ids", args: "p_user_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level", returns: "TABLE(id uuid)", security: "definer" },
|
|
436
|
+
{ name: "visible_set", args: "p_user uuid, p_organization_id uuid, p_table_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level, OUT o_all_visible boolean, OUT o_true_visibility platform.visibility[], OUT o_granted_all uuid[], OUT o_granted_visible uuid[], OUT o_carried_visible uuid[], OUT o_ladder_calls integer, OUT o_fallback boolean, OUT o_note text", returns: "record", security: "definer" },
|
|
388
437
|
{ name: "widget_kernel_id", args: "", returns: "uuid", security: "invoker" },
|
|
389
438
|
{ name: "work_assignment_fields", args: "p_options_table_id uuid DEFAULT NULL::uuid", returns: "TABLE(key text, label text, spec jsonb)", security: "invoker" },
|
|
390
439
|
{ name: "work_has_assignment", args: "p_organization_id uuid, p_table_id uuid", returns: "boolean", security: "invoker" },
|
|
@@ -406,9 +455,9 @@ var STORE_DOORS = [
|
|
|
406
455
|
{ name: "work_whose_turn", args: "p_organization_id uuid, p_table_id uuid, p_include_finished boolean DEFAULT false", returns: "TABLE(record_id uuid, title text, assignee_id uuid, turn text, due_on timestamp with time zone, state text, status text, terminal boolean)", security: "invoker" }
|
|
407
456
|
];
|
|
408
457
|
var STORE_KNOBS = [
|
|
409
|
-
{ key: "accessible_entity_ids_guard", value: "
|
|
410
|
-
{ key: "agent_schema_changes", value: '"
|
|
411
|
-
{ key: "associations_guard", value: "
|
|
458
|
+
{ key: "accessible_entity_ids_guard", value: "true", type: "boolean" },
|
|
459
|
+
{ key: "agent_schema_changes", value: '"ask"', type: "string" },
|
|
460
|
+
{ key: "associations_guard", value: "true", type: "boolean" },
|
|
412
461
|
{ key: "code_paths_enabled", value: "false", type: "boolean" },
|
|
413
462
|
{ key: "consumer_chat_seeding_enabled", value: "false", type: "boolean" },
|
|
414
463
|
{ key: "consumer_checkout_enabled", value: "false", type: "boolean" },
|
|
@@ -428,7 +477,7 @@ var STORE_KNOBS = [
|
|
|
428
477
|
{ key: "external_principal_enabled", value: "false", type: "boolean" },
|
|
429
478
|
{ key: "field_index_guard", value: "false", type: "boolean" },
|
|
430
479
|
{ 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" },
|
|
431
|
-
{ key: "member_default_level", value: '"viewer"', type: "
|
|
480
|
+
{ key: "member_default_level", value: '"viewer"', type: "enum" },
|
|
432
481
|
{ key: "member_default_visibility", value: '"all_records"', type: "enum" },
|
|
433
482
|
{ key: "records_tool_default", value: "true", type: "boolean" },
|
|
434
483
|
{ key: "row_versions_guard", value: "false", type: "boolean" },
|
|
@@ -447,12 +496,12 @@ var STORE_REFUSAL_CODES = [
|
|
|
447
496
|
{ 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" },
|
|
448
497
|
{ 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" },
|
|
449
498
|
{ code: "22012", raised_by: "rule_eval" },
|
|
450
|
-
{ 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" },
|
|
499
|
+
{ 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,my_levels,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" },
|
|
451
500
|
{ 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" },
|
|
452
|
-
{ 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" },
|
|
453
|
-
{ 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" },
|
|
501
|
+
{ code: "23505", raised_by: "_unique_rule_holds,doc_sign,doc_signature_write,field_declare,home_add,io_proposal_accept,relation_carry,relation_own,share_grant,work_slot_hold" },
|
|
502
|
+
{ 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,_resolve_choice_words,_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" },
|
|
454
503
|
{ code: "40001", raised_by: "has_visibility_at" },
|
|
455
|
-
{ 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" },
|
|
504
|
+
{ 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,external_write_through,io_comment_resolve,io_comment_write,io_restore,migrate_purge,my_levels,promote_table,query_visibility_parity,read_record,read_records,share_grant,visibility_as_of" },
|
|
456
505
|
{ code: "53400", raised_by: "anon_rate_take,delete_cascade_closure,promote_field" },
|
|
457
506
|
{ code: "54001", raised_by: "record_delete" },
|
|
458
507
|
{ code: "PT409", raised_by: "record_update" }
|
|
@@ -1496,6 +1545,7 @@ export {
|
|
|
1496
1545
|
ON_DELETE,
|
|
1497
1546
|
OVERRIDE_POLICIES,
|
|
1498
1547
|
PARITY_FIELD_TYPES,
|
|
1548
|
+
PERMISSION_LEVELS,
|
|
1499
1549
|
PER_VALUE_ACCESS_WORDS,
|
|
1500
1550
|
RELATION_BINDINGS,
|
|
1501
1551
|
RELATION_CARDINALITIES,
|
|
@@ -1512,7 +1562,10 @@ export {
|
|
|
1512
1562
|
TABLE_TYPES,
|
|
1513
1563
|
VALUE_ALTERNATE_KEYS,
|
|
1514
1564
|
VALUE_ENVELOPE_KEYS,
|
|
1565
|
+
asPermissionLevel,
|
|
1566
|
+
atLeast,
|
|
1515
1567
|
err,
|
|
1568
|
+
highestLevel,
|
|
1516
1569
|
isRecordsErr,
|
|
1517
1570
|
measureKey,
|
|
1518
1571
|
ok
|