@ai-matrx/records 0.11.0 → 0.16.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 +113 -0
- package/dist/core/index.cjs +285 -13
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +133 -5
- package/dist/core/index.d.ts +133 -5
- package/dist/core/index.js +285 -13
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +116 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +630 -10
- package/dist/index.d.ts +630 -10
- package/dist/index.js +116 -8
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +282 -10
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +747 -12
- package/dist/react/index.d.ts +747 -12
- package/dist/react/index.js +282 -10
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -379,6 +379,76 @@ declare const STORE_DOORS: readonly [{
|
|
|
379
379
|
readonly args: "p_item_type text, p_item_id uuid";
|
|
380
380
|
readonly returns: "TABLE(container_type text, container_id uuid, conveys_max permission_level)";
|
|
381
381
|
readonly security: "definer";
|
|
382
|
+
}, {
|
|
383
|
+
readonly name: "choice_census";
|
|
384
|
+
readonly args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid";
|
|
385
|
+
readonly returns: "jsonb";
|
|
386
|
+
readonly security: "definer";
|
|
387
|
+
}, {
|
|
388
|
+
readonly name: "choice_field_map";
|
|
389
|
+
readonly args: "p_organization_id uuid, p_table_id uuid";
|
|
390
|
+
readonly returns: "jsonb";
|
|
391
|
+
readonly security: "invoker";
|
|
392
|
+
}, {
|
|
393
|
+
readonly name: "choice_filter_normalize";
|
|
394
|
+
readonly args: "p_map jsonb, p_filter jsonb";
|
|
395
|
+
readonly returns: "jsonb";
|
|
396
|
+
readonly security: "invoker";
|
|
397
|
+
}, {
|
|
398
|
+
readonly name: "choice_key_for";
|
|
399
|
+
readonly args: "p_organization_id uuid, p_options_table_id uuid, p_title text, p_exclude uuid DEFAULT NULL::uuid";
|
|
400
|
+
readonly returns: "text";
|
|
401
|
+
readonly security: "invoker";
|
|
402
|
+
}, {
|
|
403
|
+
readonly name: "choice_key_of";
|
|
404
|
+
readonly args: "p_field jsonb, p_token text";
|
|
405
|
+
readonly returns: "text";
|
|
406
|
+
readonly security: "invoker";
|
|
407
|
+
}, {
|
|
408
|
+
readonly name: "choice_options";
|
|
409
|
+
readonly args: "p_organization_id uuid, p_options_table_id uuid";
|
|
410
|
+
readonly returns: "jsonb";
|
|
411
|
+
readonly security: "invoker";
|
|
412
|
+
}, {
|
|
413
|
+
readonly name: "choice_render";
|
|
414
|
+
readonly args: "p_organization_id uuid, p_table_id uuid, p_doc jsonb";
|
|
415
|
+
readonly returns: "jsonb";
|
|
416
|
+
readonly security: "invoker";
|
|
417
|
+
}, {
|
|
418
|
+
readonly name: "choice_render_groups";
|
|
419
|
+
readonly args: "p_map jsonb, p_groups jsonb";
|
|
420
|
+
readonly returns: "jsonb";
|
|
421
|
+
readonly security: "invoker";
|
|
422
|
+
}, {
|
|
423
|
+
readonly name: "choice_render_note";
|
|
424
|
+
readonly args: "p_field jsonb, p_value jsonb";
|
|
425
|
+
readonly returns: "jsonb";
|
|
426
|
+
readonly security: "invoker";
|
|
427
|
+
}, {
|
|
428
|
+
readonly name: "choice_render_value";
|
|
429
|
+
readonly args: "p_field jsonb, p_value jsonb";
|
|
430
|
+
readonly returns: "jsonb";
|
|
431
|
+
readonly security: "invoker";
|
|
432
|
+
}, {
|
|
433
|
+
readonly name: "choice_slug";
|
|
434
|
+
readonly args: "p_word text";
|
|
435
|
+
readonly returns: "text";
|
|
436
|
+
readonly security: "invoker";
|
|
437
|
+
}, {
|
|
438
|
+
readonly name: "choice_synonyms";
|
|
439
|
+
readonly args: "p_organization_id uuid, p_table_id uuid, p_token text";
|
|
440
|
+
readonly returns: "text[]";
|
|
441
|
+
readonly security: "invoker";
|
|
442
|
+
}, {
|
|
443
|
+
readonly name: "choice_synonyms_in";
|
|
444
|
+
readonly args: "p_map jsonb, p_token text";
|
|
445
|
+
readonly returns: "text[]";
|
|
446
|
+
readonly security: "invoker";
|
|
447
|
+
}, {
|
|
448
|
+
readonly name: "choice_words";
|
|
449
|
+
readonly args: "p_field jsonb";
|
|
450
|
+
readonly returns: "text";
|
|
451
|
+
readonly security: "invoker";
|
|
382
452
|
}, {
|
|
383
453
|
readonly name: "client_write_grants";
|
|
384
454
|
readonly args: "";
|
|
@@ -419,6 +489,61 @@ declare const STORE_DOORS: readonly [{
|
|
|
419
489
|
readonly args: "";
|
|
420
490
|
readonly returns: "TABLE(token text, schema_name text, table_name text)";
|
|
421
491
|
readonly security: "invoker";
|
|
492
|
+
}, {
|
|
493
|
+
readonly name: "dashboard_block_normalize";
|
|
494
|
+
readonly args: "p_organization_id uuid, p_subject_table_id uuid, p_block jsonb";
|
|
495
|
+
readonly returns: "jsonb";
|
|
496
|
+
readonly security: "definer";
|
|
497
|
+
}, {
|
|
498
|
+
readonly name: "dashboard_class";
|
|
499
|
+
readonly args: "";
|
|
500
|
+
readonly returns: "text";
|
|
501
|
+
readonly security: "invoker";
|
|
502
|
+
}, {
|
|
503
|
+
readonly name: "dashboard_declare";
|
|
504
|
+
readonly args: "p_organization_id uuid, p_table_id uuid, p_name text, p_blocks jsonb DEFAULT '[]'::jsonb, p_presentation jsonb DEFAULT '{}'::jsonb, p_dashboard_id uuid DEFAULT NULL::uuid";
|
|
505
|
+
readonly returns: "uuid";
|
|
506
|
+
readonly security: "definer";
|
|
507
|
+
}, {
|
|
508
|
+
readonly name: "dashboard_delete";
|
|
509
|
+
readonly args: "p_organization_id uuid, p_dashboard_id uuid";
|
|
510
|
+
readonly returns: "boolean";
|
|
511
|
+
readonly security: "definer";
|
|
512
|
+
}, {
|
|
513
|
+
readonly name: "dashboard_field_keys";
|
|
514
|
+
readonly args: "p_organization_id uuid, p_table_id uuid";
|
|
515
|
+
readonly returns: "text[]";
|
|
516
|
+
readonly security: "definer";
|
|
517
|
+
}, {
|
|
518
|
+
readonly name: "dashboard_kinds";
|
|
519
|
+
readonly args: "";
|
|
520
|
+
readonly returns: "text[]";
|
|
521
|
+
readonly security: "invoker";
|
|
522
|
+
}, {
|
|
523
|
+
readonly name: "dashboard_moment_sql";
|
|
524
|
+
readonly args: "p_key text";
|
|
525
|
+
readonly returns: "text";
|
|
526
|
+
readonly security: "invoker";
|
|
527
|
+
}, {
|
|
528
|
+
readonly name: "dashboard_run";
|
|
529
|
+
readonly args: "p_organization_id uuid, p_dashboard_id uuid, p_filter jsonb DEFAULT '{}'::jsonb";
|
|
530
|
+
readonly returns: "jsonb";
|
|
531
|
+
readonly security: "definer";
|
|
532
|
+
}, {
|
|
533
|
+
readonly name: "dashboard_stuck";
|
|
534
|
+
readonly args: "p_organization_id uuid, p_table_id uuid, p_state_key text, p_days integer DEFAULT 14, p_filter jsonb DEFAULT '{}'::jsonb, p_limit integer DEFAULT 50, p_required text DEFAULT 'viewer'::text";
|
|
535
|
+
readonly returns: "TABLE(record_id uuid, title text, state text, last_changed_at timestamp with time zone, days_unchanged numeric, measured_from text)";
|
|
536
|
+
readonly security: "definer";
|
|
537
|
+
}, {
|
|
538
|
+
readonly name: "dashboard_window_sql";
|
|
539
|
+
readonly args: "p_key text, p_window jsonb";
|
|
540
|
+
readonly returns: "text";
|
|
541
|
+
readonly security: "invoker";
|
|
542
|
+
}, {
|
|
543
|
+
readonly name: "dashboards";
|
|
544
|
+
readonly args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid";
|
|
545
|
+
readonly returns: "TABLE(dashboard_id uuid, table_id uuid, name text, blocks jsonb, presentation jsonb, block_count integer, version integer, created_at timestamp with time zone, updated_at timestamp with time zone)";
|
|
546
|
+
readonly security: "definer";
|
|
422
547
|
}, {
|
|
423
548
|
readonly name: "delete_cascade_closure";
|
|
424
549
|
readonly args: "p_organization_id uuid, p_record_id uuid";
|
|
@@ -899,6 +1024,16 @@ declare const STORE_DOORS: readonly [{
|
|
|
899
1024
|
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";
|
|
900
1025
|
readonly returns: "boolean";
|
|
901
1026
|
readonly security: "invoker";
|
|
1027
|
+
}, {
|
|
1028
|
+
readonly name: "list_door_disagreements";
|
|
1029
|
+
readonly args: "p_pretend text DEFAULT NULL::text, p_only_organization uuid DEFAULT NULL::uuid, p_sample integer DEFAULT 200";
|
|
1030
|
+
readonly returns: "TABLE(organization_id uuid, organization_name text, member_id uuid, table_id uuid, record_id uuid, door text, why text)";
|
|
1031
|
+
readonly security: "invoker";
|
|
1032
|
+
}, {
|
|
1033
|
+
readonly name: "list_door_disagreements";
|
|
1034
|
+
readonly args: "p_pretend text, p_only_organization uuid, p_sample integer, p_exhaustive boolean";
|
|
1035
|
+
readonly returns: "TABLE(organization_id uuid, organization_name text, member_id uuid, table_id uuid, record_id uuid, door text, why text)";
|
|
1036
|
+
readonly security: "invoker";
|
|
902
1037
|
}, {
|
|
903
1038
|
readonly name: "lookup_value";
|
|
904
1039
|
readonly args: "p_organization_id uuid, p_record_id uuid, p_field_data jsonb";
|
|
@@ -919,6 +1054,11 @@ declare const STORE_DOORS: readonly [{
|
|
|
919
1054
|
readonly args: "";
|
|
920
1055
|
readonly returns: "uuid";
|
|
921
1056
|
readonly security: "invoker";
|
|
1057
|
+
}, {
|
|
1058
|
+
readonly name: "migrate_choice_keys";
|
|
1059
|
+
readonly args: "p_organization_id uuid, p_table_id uuid, p_dry_run boolean DEFAULT false";
|
|
1060
|
+
readonly returns: "jsonb";
|
|
1061
|
+
readonly security: "definer";
|
|
922
1062
|
}, {
|
|
923
1063
|
readonly name: "migrate_delete";
|
|
924
1064
|
readonly args: "p_organization_id uuid, p_record_id uuid, p_note text DEFAULT NULL::text";
|
|
@@ -949,6 +1089,11 @@ declare const STORE_DOORS: readonly [{
|
|
|
949
1089
|
readonly args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid, p_dry_run boolean DEFAULT true";
|
|
950
1090
|
readonly returns: "jsonb";
|
|
951
1091
|
readonly security: "definer";
|
|
1092
|
+
}, {
|
|
1093
|
+
readonly name: "migrate_reclass";
|
|
1094
|
+
readonly args: "p_organization_id uuid, p_id uuid, p_to text DEFAULT 'field'::text, p_note text DEFAULT NULL::text";
|
|
1095
|
+
readonly returns: "jsonb";
|
|
1096
|
+
readonly security: "definer";
|
|
952
1097
|
}, {
|
|
953
1098
|
readonly name: "migrate_rename";
|
|
954
1099
|
readonly args: "p_organization_id uuid, p_id uuid, p_to text, p_note text DEFAULT NULL::text";
|
|
@@ -1044,6 +1189,76 @@ declare const STORE_DOORS: readonly [{
|
|
|
1044
1189
|
readonly args: "";
|
|
1045
1190
|
readonly returns: "uuid";
|
|
1046
1191
|
readonly security: "invoker";
|
|
1192
|
+
}, {
|
|
1193
|
+
readonly name: "portal_admits";
|
|
1194
|
+
readonly args: "p_organization_id uuid, p_user_id uuid DEFAULT NULL::uuid";
|
|
1195
|
+
readonly returns: "boolean";
|
|
1196
|
+
readonly security: "definer";
|
|
1197
|
+
}, {
|
|
1198
|
+
readonly name: "portal_card";
|
|
1199
|
+
readonly args: "p_organization_id uuid, p_portal_id uuid";
|
|
1200
|
+
readonly returns: "jsonb";
|
|
1201
|
+
readonly security: "definer";
|
|
1202
|
+
}, {
|
|
1203
|
+
readonly name: "portal_declare";
|
|
1204
|
+
readonly args: "p_organization_id uuid, p_title text, p_client_table_id uuid, p_tables jsonb, p_portal_id uuid DEFAULT NULL::uuid, p_slug text DEFAULT NULL::text, p_sign_in_method text DEFAULT 'magic_link'::text";
|
|
1205
|
+
readonly returns: "uuid";
|
|
1206
|
+
readonly security: "definer";
|
|
1207
|
+
}, {
|
|
1208
|
+
readonly name: "portal_field_map";
|
|
1209
|
+
readonly args: "p_organization_id uuid, p_table_id uuid";
|
|
1210
|
+
readonly returns: "TABLE(field_id uuid, field_key text, field_type text, points_at uuid)";
|
|
1211
|
+
readonly security: "definer";
|
|
1212
|
+
}, {
|
|
1213
|
+
readonly name: "portal_invitation";
|
|
1214
|
+
readonly args: "p_slug text, p_email text";
|
|
1215
|
+
readonly returns: "jsonb";
|
|
1216
|
+
readonly security: "definer";
|
|
1217
|
+
}, {
|
|
1218
|
+
readonly name: "portal_invite";
|
|
1219
|
+
readonly args: "p_organization_id uuid, p_portal_id uuid, p_client_record_id uuid, p_email text, p_user_id uuid DEFAULT NULL::uuid";
|
|
1220
|
+
readonly returns: "jsonb";
|
|
1221
|
+
readonly security: "definer";
|
|
1222
|
+
}, {
|
|
1223
|
+
readonly name: "portal_me";
|
|
1224
|
+
readonly args: "";
|
|
1225
|
+
readonly returns: "jsonb";
|
|
1226
|
+
readonly security: "definer";
|
|
1227
|
+
}, {
|
|
1228
|
+
readonly name: "portal_preview";
|
|
1229
|
+
readonly args: "p_organization_id uuid, p_portal_id uuid, p_principal_id uuid, p_table_id uuid";
|
|
1230
|
+
readonly returns: "TABLE(record_id uuid, title text)";
|
|
1231
|
+
readonly security: "definer";
|
|
1232
|
+
}, {
|
|
1233
|
+
readonly name: "portal_principal_bind";
|
|
1234
|
+
readonly args: "p_organization_id uuid, p_principal_id uuid, p_user_id uuid";
|
|
1235
|
+
readonly returns: "jsonb";
|
|
1236
|
+
readonly security: "definer";
|
|
1237
|
+
}, {
|
|
1238
|
+
readonly name: "portal_public";
|
|
1239
|
+
readonly args: "p_slug text";
|
|
1240
|
+
readonly returns: "jsonb";
|
|
1241
|
+
readonly security: "definer";
|
|
1242
|
+
}, {
|
|
1243
|
+
readonly name: "portal_record_title";
|
|
1244
|
+
readonly args: "p_organization_id uuid, p_record_id uuid";
|
|
1245
|
+
readonly returns: "text";
|
|
1246
|
+
readonly security: "definer";
|
|
1247
|
+
}, {
|
|
1248
|
+
readonly name: "portal_revoke";
|
|
1249
|
+
readonly args: "p_organization_id uuid, p_portal_id uuid, p_principal_id uuid";
|
|
1250
|
+
readonly returns: "jsonb";
|
|
1251
|
+
readonly security: "definer";
|
|
1252
|
+
}, {
|
|
1253
|
+
readonly name: "portal_slug";
|
|
1254
|
+
readonly args: "p_organization_id uuid, p_title text, p_portal_id uuid DEFAULT NULL::uuid";
|
|
1255
|
+
readonly returns: "text";
|
|
1256
|
+
readonly security: "definer";
|
|
1257
|
+
}, {
|
|
1258
|
+
readonly name: "portals";
|
|
1259
|
+
readonly args: "p_organization_id uuid";
|
|
1260
|
+
readonly returns: "TABLE(portal_id uuid, title text, slug text, client_table_id uuid, client_table text, is_active boolean, tables integer, invited integer, signed_in integer, sign_in_method text, opened_at timestamp with time zone)";
|
|
1261
|
+
readonly security: "definer";
|
|
1047
1262
|
}, {
|
|
1048
1263
|
readonly name: "presentation_kernel_id";
|
|
1049
1264
|
readonly args: "";
|
|
@@ -1294,6 +1509,11 @@ declare const STORE_DOORS: readonly [{
|
|
|
1294
1509
|
readonly args: "p_record_id uuid, p_at timestamp with time zone";
|
|
1295
1510
|
readonly returns: "TABLE(state jsonb, replayed boolean)";
|
|
1296
1511
|
readonly security: "definer";
|
|
1512
|
+
}, {
|
|
1513
|
+
readonly name: "record_table";
|
|
1514
|
+
readonly args: "p_organization_id uuid, p_record_id uuid";
|
|
1515
|
+
readonly returns: "uuid";
|
|
1516
|
+
readonly security: "definer";
|
|
1297
1517
|
}, {
|
|
1298
1518
|
readonly name: "record_update";
|
|
1299
1519
|
readonly args: "p_organization_id uuid, p_record_id uuid, p_patch jsonb, p_expected_version integer DEFAULT NULL::integer";
|
|
@@ -1314,6 +1534,11 @@ declare const STORE_DOORS: readonly [{
|
|
|
1314
1534
|
readonly args: "p_organization_id uuid, p_table_id uuid, p_data jsonb";
|
|
1315
1535
|
readonly returns: "uuid";
|
|
1316
1536
|
readonly security: "definer";
|
|
1537
|
+
}, {
|
|
1538
|
+
readonly name: "refusals_claiming_a_level_never_asked";
|
|
1539
|
+
readonly args: "";
|
|
1540
|
+
readonly returns: "TABLE(function_name text, identity_args text, why text)";
|
|
1541
|
+
readonly security: "invoker";
|
|
1317
1542
|
}, {
|
|
1318
1543
|
readonly name: "relation_carry";
|
|
1319
1544
|
readonly args: "p_organization_id uuid, p_container_id uuid, p_item_id uuid";
|
|
@@ -1539,11 +1764,26 @@ declare const STORE_DOORS: readonly [{
|
|
|
1539
1764
|
readonly args: "p_organization_id uuid DEFAULT NULL::uuid";
|
|
1540
1765
|
readonly returns: "boolean";
|
|
1541
1766
|
readonly security: "invoker";
|
|
1767
|
+
}, {
|
|
1768
|
+
readonly name: "subscription_mute";
|
|
1769
|
+
readonly args: "p_organization_id uuid, p_rule_id uuid, p_muted boolean DEFAULT true";
|
|
1770
|
+
readonly returns: "boolean";
|
|
1771
|
+
readonly security: "definer";
|
|
1772
|
+
}, {
|
|
1773
|
+
readonly name: "subscriptions";
|
|
1774
|
+
readonly args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid";
|
|
1775
|
+
readonly 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)";
|
|
1776
|
+
readonly security: "definer";
|
|
1542
1777
|
}, {
|
|
1543
1778
|
readonly name: "table_capacity";
|
|
1544
1779
|
readonly args: "p_organization_id uuid, p_table_id uuid";
|
|
1545
1780
|
readonly returns: "jsonb";
|
|
1546
1781
|
readonly security: "definer";
|
|
1782
|
+
}, {
|
|
1783
|
+
readonly name: "table_carries_its_rows";
|
|
1784
|
+
readonly args: "p_user_id uuid, p_table_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level";
|
|
1785
|
+
readonly returns: "boolean";
|
|
1786
|
+
readonly security: "definer";
|
|
1547
1787
|
}, {
|
|
1548
1788
|
readonly name: "table_contents";
|
|
1549
1789
|
readonly args: "p_organization_id uuid, p_table_id uuid";
|
|
@@ -1709,6 +1949,11 @@ declare const STORE_DOORS: readonly [{
|
|
|
1709
1949
|
readonly args: "p_organization_id uuid, p_approval_id uuid, p_approve boolean, p_note text DEFAULT NULL::text";
|
|
1710
1950
|
readonly returns: "jsonb";
|
|
1711
1951
|
readonly security: "definer";
|
|
1952
|
+
}, {
|
|
1953
|
+
readonly name: "work_approval_kinds";
|
|
1954
|
+
readonly args: "";
|
|
1955
|
+
readonly returns: "text[]";
|
|
1956
|
+
readonly security: "invoker";
|
|
1712
1957
|
}, {
|
|
1713
1958
|
readonly name: "work_approval_may_decide";
|
|
1714
1959
|
readonly args: "p_organization_id uuid, p_approval_id uuid";
|
|
@@ -1804,6 +2049,11 @@ declare const STORE_DOORS: readonly [{
|
|
|
1804
2049
|
readonly args: "p_organization_id uuid, p_name text, p_slug text, p_home_id uuid DEFAULT NULL::uuid";
|
|
1805
2050
|
readonly returns: "jsonb";
|
|
1806
2051
|
readonly security: "definer";
|
|
2052
|
+
}, {
|
|
2053
|
+
readonly name: "work_state_id";
|
|
2054
|
+
readonly args: "p_organization_id uuid, p_table_id uuid, p_value text";
|
|
2055
|
+
readonly returns: "uuid";
|
|
2056
|
+
readonly security: "invoker";
|
|
1807
2057
|
}, {
|
|
1808
2058
|
readonly name: "work_states";
|
|
1809
2059
|
readonly args: "";
|
|
@@ -2000,37 +2250,40 @@ declare const STORE_KNOBS: readonly [{
|
|
|
2000
2250
|
*/
|
|
2001
2251
|
declare const STORE_REFUSAL_CODES: readonly [{
|
|
2002
2252
|
readonly code: "02000";
|
|
2003
|
-
readonly raised_by: "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_rename,migrate_reparent,migrate_retype,migrate_split,migrate_undo,organization_clear,read_record,record_delete,record_restore,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";
|
|
2253
|
+
readonly 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";
|
|
2004
2254
|
}, {
|
|
2005
2255
|
readonly code: "0A000";
|
|
2006
|
-
readonly raised_by: "external_rows,external_source_declare,external_write_through,promote_field,promoted_index_expr,promoted_query_sql,promoted_read,rule_eval,work_assign
|
|
2256
|
+
readonly raised_by: "external_rows,external_source_declare,external_write_through,promote_field,promoted_index_expr,promoted_query_sql,promoted_read,rule_eval,work_assign";
|
|
2007
2257
|
}, {
|
|
2008
2258
|
readonly code: "22004";
|
|
2009
|
-
readonly 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,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_purge,migrate_split,migrate_undo,organization_clear,organization_contents,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";
|
|
2259
|
+
readonly 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";
|
|
2260
|
+
}, {
|
|
2261
|
+
readonly code: "22007";
|
|
2262
|
+
readonly raised_by: "dashboard_window_sql";
|
|
2010
2263
|
}, {
|
|
2011
2264
|
readonly code: "22012";
|
|
2012
2265
|
readonly raised_by: "rule_eval";
|
|
2013
2266
|
}, {
|
|
2014
2267
|
readonly code: "22023";
|
|
2015
|
-
readonly raised_by: "_entity_custom_fields_guard,_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,entity_value_write,external_history_event,external_source_declare,external_stub_upsert,external_write_through,io_import_open,io_proposal_accept,migrate_merge,my_levels,organization_clear,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";
|
|
2268
|
+
readonly 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";
|
|
2016
2269
|
}, {
|
|
2017
2270
|
readonly code: "23503";
|
|
2018
|
-
readonly raised_by: "_containment_guard,_field_document_for,_record_rule_uses,anon_publish,anon_rate_take,anon_token_issue,anon_write,assert_organization_wall,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,work_set_state,work_take_assignment,work_template_instantiate";
|
|
2271
|
+
readonly 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";
|
|
2019
2272
|
}, {
|
|
2020
2273
|
readonly code: "23505";
|
|
2021
2274
|
readonly 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";
|
|
2022
2275
|
}, {
|
|
2023
2276
|
readonly code: "23514";
|
|
2024
|
-
readonly raised_by: "_containment_guard,_dated_values_guard,_derived_fields,_entity_custom_fields_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";
|
|
2277
|
+
readonly 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";
|
|
2025
2278
|
}, {
|
|
2026
2279
|
readonly code: "40001";
|
|
2027
2280
|
readonly raised_by: "has_visibility_at";
|
|
2028
2281
|
}, {
|
|
2029
2282
|
readonly code: "42501";
|
|
2030
|
-
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,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,my_levels,organization_clear,promote_table,query_visibility_parity,read_record,read_records,share_grant,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_person";
|
|
2283
|
+
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,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";
|
|
2031
2284
|
}, {
|
|
2032
2285
|
readonly code: "42703";
|
|
2033
|
-
readonly raised_by: "entity_table";
|
|
2286
|
+
readonly raised_by: "entity_table,portal_declare";
|
|
2034
2287
|
}, {
|
|
2035
2288
|
readonly code: "53400";
|
|
2036
2289
|
readonly raised_by: "anon_rate_take,delete_cascade_closure,promote_field";
|
|
@@ -2553,6 +2806,14 @@ interface NewFieldDeclaration {
|
|
|
2553
2806
|
parity_type?: ParityFieldType;
|
|
2554
2807
|
/** Plain text, a long text or a plain number — the three that carry no parity type. */
|
|
2555
2808
|
plain?: "text" | "long_text" | "number";
|
|
2809
|
+
/**
|
|
2810
|
+
* THE ONE WORD EVERY OTHER CALLER REACHES FOR. An agent, a script, an import
|
|
2811
|
+
* and this package's own table-declaring path all say `type`, and until
|
|
2812
|
+
* 2026-09-20 `custom._field_document_for` threw it away — a `number` became a
|
|
2813
|
+
* text column in silence. It now resolves all three vocabularies, so this is
|
|
2814
|
+
* named here rather than left as a shape only the store knows about.
|
|
2815
|
+
*/
|
|
2816
|
+
type?: FieldTypeWord;
|
|
2556
2817
|
/** Derived from the label when absent, which is why the panel never asks for it. */
|
|
2557
2818
|
key?: string;
|
|
2558
2819
|
required?: boolean;
|
|
@@ -2581,8 +2842,42 @@ interface NewFieldDeclaration {
|
|
|
2581
2842
|
expr?: Record<string, unknown>;
|
|
2582
2843
|
compute_on?: ComputeOn;
|
|
2583
2844
|
relation_max?: number;
|
|
2845
|
+
/**
|
|
2846
|
+
* REL / FLD-11. The Table this column points at, when it is neither a Person
|
|
2847
|
+
* (`member`) nor a File (`attachment`). The store has taken it since
|
|
2848
|
+
* 2026-09-20 and no client type named it, so a person with an Invoice table
|
|
2849
|
+
* and a Line table could not declare the link through this package at all.
|
|
2850
|
+
*/
|
|
2851
|
+
relation_target?: Uuid;
|
|
2852
|
+
/** REL-2. What happens to this record when the thing it points at goes. */
|
|
2853
|
+
on_target_delete?: OnDelete;
|
|
2854
|
+
/**
|
|
2855
|
+
* Presentation and behaviour settings the store carries verbatim — a long
|
|
2856
|
+
* text's `multiline`, a list's existing options table. The door has always
|
|
2857
|
+
* read it (`p_spec -> 'config'`) and this interface never offered it, so a
|
|
2858
|
+
* package-owned table could not declare its own multi-line column.
|
|
2859
|
+
*/
|
|
2860
|
+
config?: Record<string, unknown>;
|
|
2861
|
+
/** A text column that holds a signature (`custom.doc_sign` accepts no other). */
|
|
2862
|
+
format?: string;
|
|
2584
2863
|
}
|
|
2585
|
-
/**
|
|
2864
|
+
/**
|
|
2865
|
+
* Every word `custom._field_document_for` resolves for `type`: one of the
|
|
2866
|
+
* thirteen, one of the five behaviours, or one of the plain synonyms a person
|
|
2867
|
+
* or an agent actually writes.
|
|
2868
|
+
*/
|
|
2869
|
+
type FieldTypeWord = ParityFieldType | FieldBehavior | "number" | "integer" | "decimal" | "float" | "long_text" | "string";
|
|
2870
|
+
/**
|
|
2871
|
+
* What `custom.field_update` accepts.
|
|
2872
|
+
*
|
|
2873
|
+
* THE SETTINGS **AND** THE BEHAVIOUR. The door has had a behaviour arm since
|
|
2874
|
+
* T12 — say `parity_type`, `plain` or `type` and every value of the column is
|
|
2875
|
+
* converted (or kept in `_retired` with its reason) by
|
|
2876
|
+
* `custom._field_type_converts_values`. This interface named only the settings,
|
|
2877
|
+
* so the one client that needed to move a field back onto the behaviour it is
|
|
2878
|
+
* written against had no door and reached for `custom.record_update` instead,
|
|
2879
|
+
* which writes the document under the guards rather than through them.
|
|
2880
|
+
*/
|
|
2586
2881
|
interface FieldPatch {
|
|
2587
2882
|
label?: string;
|
|
2588
2883
|
required?: boolean;
|
|
@@ -2594,8 +2889,79 @@ interface FieldPatch {
|
|
|
2594
2889
|
rules?: FieldRule[];
|
|
2595
2890
|
/** The choices of a choice list, rewritten. A choice still wanted keeps its id. */
|
|
2596
2891
|
options?: string[];
|
|
2892
|
+
/** One of the thirteen — a change of what this column HOLDS, not of a setting. */
|
|
2893
|
+
parity_type?: ParityFieldType;
|
|
2894
|
+
/** …or one of the three plain behaviours, …*/
|
|
2895
|
+
plain?: "text" | "long_text" | "number";
|
|
2896
|
+
/** …or the one word every other caller reaches for (see `NewFieldDeclaration`). */
|
|
2897
|
+
type?: FieldTypeWord;
|
|
2898
|
+
/**
|
|
2899
|
+
* FLD-2. The shape of the value. The door reads it ONLY inside its behaviour
|
|
2900
|
+
* arm, so a patch that moves `multi` alone changes nothing — send the
|
|
2901
|
+
* behaviour word with it.
|
|
2902
|
+
*/
|
|
2903
|
+
multi?: boolean;
|
|
2904
|
+
/** REL / FLD-11: re-point the column. The old edges are withdrawn by the door. */
|
|
2905
|
+
relation_target?: Uuid;
|
|
2906
|
+
on_target_delete?: OnDelete;
|
|
2907
|
+
/** SEAT-SUITES: whether the store builds an index for this column, and a unique one. */
|
|
2908
|
+
promoted?: boolean;
|
|
2909
|
+
unique?: boolean;
|
|
2910
|
+
/** §D / T7: which fields a worked-out column reads. */
|
|
2911
|
+
depends_on?: Uuid[];
|
|
2597
2912
|
}
|
|
2598
2913
|
|
|
2914
|
+
/** One option, as `_choices` names it and as `optionsOf` returns it. */
|
|
2915
|
+
interface ChoiceOption {
|
|
2916
|
+
/** The stable key the cell actually holds. */
|
|
2917
|
+
key: string;
|
|
2918
|
+
/** What a person reads. */
|
|
2919
|
+
label: string;
|
|
2920
|
+
/** The option RECORD's id, for a caller that needs the row itself. */
|
|
2921
|
+
id?: string;
|
|
2922
|
+
/** True when the option was retired: still readable, no longer pickable. */
|
|
2923
|
+
retired?: boolean;
|
|
2924
|
+
/** Why it is no longer offered, in a sentence, when it is retired. */
|
|
2925
|
+
reason?: string | null;
|
|
2926
|
+
}
|
|
2927
|
+
/**
|
|
2928
|
+
* The stable key of an option RECORD as `custom.field_options` returns it.
|
|
2929
|
+
*
|
|
2930
|
+
* It lives in `metadata.option_key`, not in the document: FLD-5 keeps a category to one title
|
|
2931
|
+
* field, and the key is the store's own bookkeeping rather than a column anybody declared.
|
|
2932
|
+
* The fallback is the same slug the store derives, so an option written by something that has
|
|
2933
|
+
* not caught up still answers.
|
|
2934
|
+
*/
|
|
2935
|
+
declare function optionKey(option: StoredRecord): string;
|
|
2936
|
+
/** What a person reads on an option record. */
|
|
2937
|
+
declare function optionLabel(option: StoredRecord): string;
|
|
2938
|
+
/**
|
|
2939
|
+
* The store's own slug, mirrored so a client can predict a key without a round trip.
|
|
2940
|
+
* `custom.choice_slug` is the original; a title with nothing a-z0-9 in it gets a short hash of
|
|
2941
|
+
* itself there, and this returns the empty-ish fallback rather than guessing a hash — a caller
|
|
2942
|
+
* that needs the real key for such a title reads it off the option.
|
|
2943
|
+
*/
|
|
2944
|
+
declare function choiceSlug(word: string): string;
|
|
2945
|
+
/**
|
|
2946
|
+
* Does this stored (or typed) value name this option? The key, the label and the option's own
|
|
2947
|
+
* id all name the same choice, and a control has to recognise every one of them: what the read
|
|
2948
|
+
* door hands it is the LABEL, what the store holds is the KEY, and what a screen written before
|
|
2949
|
+
* this contract sends is the ID.
|
|
2950
|
+
*/
|
|
2951
|
+
declare function isTheChosen(option: StoredRecord, value: unknown): boolean;
|
|
2952
|
+
/** Every value of one cell, as strings, whether the Field is multi or not. */
|
|
2953
|
+
declare function choiceValuesOf(value: unknown): string[];
|
|
2954
|
+
/**
|
|
2955
|
+
* What the read door said about one column's choices: the key behind the label, and whether the
|
|
2956
|
+
* option was retired and why. Returns an empty array when the document carries no `_choices`
|
|
2957
|
+
* entry for that column, which is also what a document written before this contract looks like.
|
|
2958
|
+
*/
|
|
2959
|
+
declare function choicesOf(document: RecordDocument | undefined, fieldKeyOrId: string): ChoiceOption[];
|
|
2960
|
+
/** True when this cell's value points at a choice that has since been retired. */
|
|
2961
|
+
declare function holdsARetiredChoice(document: RecordDocument | undefined, fieldKeyOrId: string): boolean;
|
|
2962
|
+
/** True when a token looks like a uuid — which a choice value is no longer allowed to be. */
|
|
2963
|
+
declare function looksLikeAnId(value: unknown): boolean;
|
|
2964
|
+
|
|
2599
2965
|
/** The seven table types. Only these two carry custom fields (REC-34, DD-011). */
|
|
2600
2966
|
type CustomFieldTableType = "entity" | "detail";
|
|
2601
2967
|
/** What `custom.entity_table` answers about a registry token. */
|
|
@@ -2805,10 +3171,144 @@ interface FormSummary {
|
|
|
2805
3171
|
*/
|
|
2806
3172
|
declare function publicFormPath(formId: string): string;
|
|
2807
3173
|
|
|
3174
|
+
/** One portal as `custom.portals` reports it to its organization. */
|
|
3175
|
+
interface PortalSummary {
|
|
3176
|
+
portal_id: Uuid;
|
|
3177
|
+
title: string;
|
|
3178
|
+
slug: string;
|
|
3179
|
+
/** The Table whose records ARE the clients. A principal is one of its rows. */
|
|
3180
|
+
client_table_id: Uuid;
|
|
3181
|
+
/** That Table's name, so a list never has to read a second door to draw a row. */
|
|
3182
|
+
client_table: string;
|
|
3183
|
+
is_active: boolean;
|
|
3184
|
+
/** How many Tables this portal exposes. */
|
|
3185
|
+
tables: number;
|
|
3186
|
+
/** Everybody invited and not revoked — NOT everybody who can see anything. */
|
|
3187
|
+
invited: number;
|
|
3188
|
+
/** Of those, how many have followed the link and hold an identity. */
|
|
3189
|
+
signed_in: number;
|
|
3190
|
+
/** `magic_link` today, and the door refuses every other word by name. */
|
|
3191
|
+
sign_in_method: string;
|
|
3192
|
+
opened_at: Timestamp | null;
|
|
3193
|
+
}
|
|
3194
|
+
/** One Table a portal exposes, as `custom.portal_card` reports it. */
|
|
3195
|
+
interface PortalTableExposure {
|
|
3196
|
+
table_id: Uuid;
|
|
3197
|
+
/** The Table's own name. */
|
|
3198
|
+
name: string;
|
|
3199
|
+
/**
|
|
3200
|
+
* The key of the relation Field that says WHOSE a record is. This is the
|
|
3201
|
+
* whole of "only theirs": the association that Field writes is what carries
|
|
3202
|
+
* the record to the client, so a portal cannot exist without one.
|
|
3203
|
+
*/
|
|
3204
|
+
names_via: string;
|
|
3205
|
+
/** The field keys a client sees. Empty is impossible — the door fills it. */
|
|
3206
|
+
visible_fields: string[];
|
|
3207
|
+
/** The subset a client may change. Always a subset of `visible_fields`. */
|
|
3208
|
+
editable_fields: string[];
|
|
3209
|
+
comments: boolean;
|
|
3210
|
+
/**
|
|
3211
|
+
* The most a client is ever conveyed on this Table — `viewer`, `commenter`
|
|
3212
|
+
* or `editor` — worked out by the door from the two lists above, never by a
|
|
3213
|
+
* screen.
|
|
3214
|
+
*/
|
|
3215
|
+
conveys: string;
|
|
3216
|
+
}
|
|
3217
|
+
/** One person a portal was opened to, as `custom.portal_card` reports them. */
|
|
3218
|
+
interface PortalPrincipal {
|
|
3219
|
+
principal_id: Uuid;
|
|
3220
|
+
email: string;
|
|
3221
|
+
/** The record of the client Table this person IS, for the portal's purposes. */
|
|
3222
|
+
client_record_id: Uuid;
|
|
3223
|
+
/** That record's title — what an owner calls this client. */
|
|
3224
|
+
client: string;
|
|
3225
|
+
/** They followed the link and hold an identity. Until then this is false. */
|
|
3226
|
+
signed_in: boolean;
|
|
3227
|
+
/** Not revoked. An invitation that was never followed is still active. */
|
|
3228
|
+
is_active: boolean;
|
|
3229
|
+
invited_at: Timestamp;
|
|
3230
|
+
revoked_at: Timestamp | null;
|
|
3231
|
+
}
|
|
3232
|
+
/** Everything about ONE portal: what it shows, and who it was opened to. */
|
|
3233
|
+
interface PortalCard {
|
|
3234
|
+
portal_id: Uuid;
|
|
3235
|
+
title: string;
|
|
3236
|
+
slug: string;
|
|
3237
|
+
is_active: boolean;
|
|
3238
|
+
sign_in_method: string;
|
|
3239
|
+
client_table_id: Uuid;
|
|
3240
|
+
tables: PortalTableExposure[];
|
|
3241
|
+
principals: PortalPrincipal[];
|
|
3242
|
+
/**
|
|
3243
|
+
* Whether this organization's outside lane is open
|
|
3244
|
+
* (`custom/external_principal_enabled`). Declaring a portal opens it; while
|
|
3245
|
+
* it is false every door refuses an outsider BY NAME, and a screen that drew
|
|
3246
|
+
* the people as reachable anyway would be lying about the one thing that
|
|
3247
|
+
* decides whether they can sign in at all.
|
|
3248
|
+
*/
|
|
3249
|
+
external_lane_open: boolean;
|
|
3250
|
+
}
|
|
3251
|
+
/** What `custom.portal_invite` answers. `say` is the door's own sentence. */
|
|
3252
|
+
interface PortalInvitation {
|
|
3253
|
+
invited: boolean;
|
|
3254
|
+
principal_id: Uuid;
|
|
3255
|
+
portal_id: Uuid;
|
|
3256
|
+
slug: string;
|
|
3257
|
+
email: string;
|
|
3258
|
+
client_record_id: Uuid;
|
|
3259
|
+
client: string;
|
|
3260
|
+
/** They already hold an identity. From a screen this is false: the door is passed no user. */
|
|
3261
|
+
bound: boolean;
|
|
3262
|
+
/**
|
|
3263
|
+
* The door's own words, and the ONLY correct summary of what just happened —
|
|
3264
|
+
* it says outright that an invitation confers nothing until the link is
|
|
3265
|
+
* followed. Show it; never paraphrase it.
|
|
3266
|
+
*/
|
|
3267
|
+
say: string;
|
|
3268
|
+
}
|
|
3269
|
+
/** What `custom.portal_revoke` answers. `say` names the consequence, past tense. */
|
|
3270
|
+
interface PortalRevocation {
|
|
3271
|
+
revoked: boolean;
|
|
3272
|
+
principal_id: Uuid;
|
|
3273
|
+
email: string;
|
|
3274
|
+
/** The door's own sentence: they can no longer sign in, and their records stop reaching them. */
|
|
3275
|
+
say: string;
|
|
3276
|
+
}
|
|
3277
|
+
/** One row of "what this client sees", from `custom.portal_preview`. */
|
|
3278
|
+
interface PortalPreviewRow {
|
|
3279
|
+
record_id: Uuid;
|
|
3280
|
+
title: string;
|
|
3281
|
+
}
|
|
3282
|
+
/**
|
|
3283
|
+
* THE PUBLIC ADDRESS OF A PORTAL, and the one place its shape is written down.
|
|
3284
|
+
*
|
|
3285
|
+
* Unlike a form's link, a portal's slug is NOT the capability: the page it
|
|
3286
|
+
* serves asks who you are and emails a one-time link, so the slug is a name and
|
|
3287
|
+
* nothing more. That is why it is readable and why copying it is safe.
|
|
3288
|
+
*/
|
|
3289
|
+
declare function portalPath(slug: string): string;
|
|
3290
|
+
|
|
2808
3291
|
/** The measures the store offers. Asked of `custom.agg_operations()` at run time too. */
|
|
2809
3292
|
type AggregateOperation = "count" | "sum" | "avg" | "min" | "max";
|
|
2810
3293
|
/** The periods a date Field can be bucketed into (`custom.agg_buckets()`). */
|
|
2811
3294
|
type AggregateBucket = "day" | "week" | "month" | "quarter" | "year";
|
|
3295
|
+
/**
|
|
3296
|
+
* A HALF-OPEN MOMENT WINDOW: `from` is inclusive, `to` is exclusive. Half-open
|
|
3297
|
+
* is the only shape that makes "September" and "October" meet exactly once —
|
|
3298
|
+
* an inclusive `to` either double-counts the boundary moment or drops it,
|
|
3299
|
+
* depending on the reader, and both of those are a chart telling a lie.
|
|
3300
|
+
*/
|
|
3301
|
+
interface AggregateWindow {
|
|
3302
|
+
from?: string | null;
|
|
3303
|
+
to?: string | null;
|
|
3304
|
+
}
|
|
3305
|
+
/**
|
|
3306
|
+
* ONE FILTER VALUE, as `custom.record_aggregate` and `custom.dashboard_run`
|
|
3307
|
+
* both read it: a SCALAR is an equality, and an OBJECT is a window. It is not
|
|
3308
|
+
* `unknown` on purpose — a filter value the store cannot read is a refusal a
|
|
3309
|
+
* caller should get from the compiler, not from the database.
|
|
3310
|
+
*/
|
|
3311
|
+
type AggregateFilter = string | number | boolean | null | AggregateWindow;
|
|
2812
3312
|
/** One measure. `count` counts rows and needs no Field; the rest read one. */
|
|
2813
3313
|
interface AggregateMeasure {
|
|
2814
3314
|
op: AggregateOperation;
|
|
@@ -2828,6 +3328,107 @@ interface AggregateRow {
|
|
|
2828
3328
|
/** The measure key the store answers with, so a chart can find its own series. */
|
|
2829
3329
|
declare function measureKey(measure: AggregateMeasure): string;
|
|
2830
3330
|
|
|
3331
|
+
/** The seven shapes a block can take, exactly as `custom.dashboard_kinds()` answers. */
|
|
3332
|
+
type DashboardBlockKind = "number" | "bar" | "column" | "line" | "donut" | "table" | "stuck";
|
|
3333
|
+
/**
|
|
3334
|
+
* ONE SAVED BLOCK — the spec, not the answer. `table_id` left out means the
|
|
3335
|
+
* dashboard's own subject Table, and `state_key` / `days` belong to `stuck`
|
|
3336
|
+
* alone (the door refuses a `stuck` block that names no field to watch).
|
|
3337
|
+
*/
|
|
3338
|
+
interface DashboardBlock {
|
|
3339
|
+
title?: string;
|
|
3340
|
+
kind: DashboardBlockKind;
|
|
3341
|
+
/** Absent = the dashboard's subject Table. */
|
|
3342
|
+
table_id?: Uuid | null;
|
|
3343
|
+
/** Field keys whose values become the groups. */
|
|
3344
|
+
group_by?: string[];
|
|
3345
|
+
/** `count` needs no key; every other operation reads one Field. */
|
|
3346
|
+
measures?: AggregateMeasure[];
|
|
3347
|
+
/** A date Field truncated to a period. */
|
|
3348
|
+
bucket?: {
|
|
3349
|
+
key: string;
|
|
3350
|
+
by: AggregateBucket;
|
|
3351
|
+
} | null;
|
|
3352
|
+
/** A scalar is an equality; an object is a half-open moment window. */
|
|
3353
|
+
filter?: Record<string, AggregateFilter> | null;
|
|
3354
|
+
/** Rows this block reads. The door clamps it to 1…500 and defaults to 50. */
|
|
3355
|
+
limit?: number;
|
|
3356
|
+
/** Columns of the twelve this block occupies. The door clamps it to 2…12 and defaults to 6. */
|
|
3357
|
+
span?: number;
|
|
3358
|
+
/** `stuck` only: the field whose value is watched for a change. */
|
|
3359
|
+
state_key?: string;
|
|
3360
|
+
/** `stuck` only: how long a record may sit on the same value. Defaults to 14. */
|
|
3361
|
+
days?: number;
|
|
3362
|
+
}
|
|
3363
|
+
/** One dashboard as `custom.dashboards` reports it to its organization. */
|
|
3364
|
+
interface DashboardSummary {
|
|
3365
|
+
dashboard_id: Uuid;
|
|
3366
|
+
/** The subject Table: the one a block that names no table of its own reads. */
|
|
3367
|
+
table_id: Uuid | null;
|
|
3368
|
+
name: string;
|
|
3369
|
+
blocks: DashboardBlock[];
|
|
3370
|
+
presentation: Record<string, unknown>;
|
|
3371
|
+
block_count: number;
|
|
3372
|
+
version: number;
|
|
3373
|
+
created_at: Timestamp;
|
|
3374
|
+
updated_at: Timestamp;
|
|
3375
|
+
}
|
|
3376
|
+
/**
|
|
3377
|
+
* One row of a `stuck` block: a record that has sat on the same value of
|
|
3378
|
+
* `state` for `days_unchanged` days. `measured_from` names WHERE that age was
|
|
3379
|
+
* measured from, because a record whose history does not reach back that far is
|
|
3380
|
+
* aged from what the store actually knows and says so.
|
|
3381
|
+
*/
|
|
3382
|
+
interface StuckRow {
|
|
3383
|
+
record_id: Uuid;
|
|
3384
|
+
title: string | null;
|
|
3385
|
+
state: string | null;
|
|
3386
|
+
last_changed_at: Timestamp | null;
|
|
3387
|
+
days_unchanged: number;
|
|
3388
|
+
measured_from: string;
|
|
3389
|
+
}
|
|
3390
|
+
/**
|
|
3391
|
+
* ONE BLOCK'S ANSWER. The door echoes the block back NORMALIZED — the defaults
|
|
3392
|
+
* it applied, the merged filter it actually ran — and adds `rows` and `ms`;
|
|
3393
|
+
* a block it could not run carries `refused` and `sqlstate` INSTEAD of rows,
|
|
3394
|
+
* and a block it could not even normalize carries only its title and kind.
|
|
3395
|
+
*/
|
|
3396
|
+
interface DashboardBlockResult {
|
|
3397
|
+
title: string;
|
|
3398
|
+
kind: DashboardBlockKind | (string & {});
|
|
3399
|
+
table_id?: Uuid;
|
|
3400
|
+
group_by?: string[];
|
|
3401
|
+
measures?: AggregateMeasure[];
|
|
3402
|
+
bucket?: {
|
|
3403
|
+
key: string;
|
|
3404
|
+
by: AggregateBucket;
|
|
3405
|
+
} | null;
|
|
3406
|
+
/** The block's own filter with the canvas bar merged under it — the block's own key wins. */
|
|
3407
|
+
filter?: Record<string, AggregateFilter>;
|
|
3408
|
+
limit?: number;
|
|
3409
|
+
span?: number;
|
|
3410
|
+
state_key?: string;
|
|
3411
|
+
days?: number;
|
|
3412
|
+
/** An aggregate block's groups and measures, or a `stuck` block's records. Absent when refused. */
|
|
3413
|
+
rows?: AggregateRow[] | StuckRow[];
|
|
3414
|
+
/** How long this one block took, in milliseconds. Absent when refused. */
|
|
3415
|
+
ms?: number;
|
|
3416
|
+
/** The store's own sentence, when this block could not be run. */
|
|
3417
|
+
refused?: string;
|
|
3418
|
+
/** The SQLSTATE that refusal carried. */
|
|
3419
|
+
sqlstate?: string;
|
|
3420
|
+
}
|
|
3421
|
+
/** What `custom.dashboard_run` answers: the canvas, and every block's own result. */
|
|
3422
|
+
interface DashboardRunResult {
|
|
3423
|
+
dashboard_id: Uuid;
|
|
3424
|
+
name: string | null;
|
|
3425
|
+
subject_table_id: Uuid | null;
|
|
3426
|
+
presentation: Record<string, unknown>;
|
|
3427
|
+
/** The one filter bar this run was asked with. */
|
|
3428
|
+
filter: Record<string, AggregateFilter>;
|
|
3429
|
+
blocks: DashboardBlockResult[];
|
|
3430
|
+
}
|
|
3431
|
+
|
|
2831
3432
|
/** One token found in a body, in the order it appears. */
|
|
2832
3433
|
interface DocToken {
|
|
2833
3434
|
ordinal: number;
|
|
@@ -2904,6 +3505,25 @@ interface Subscription {
|
|
|
2904
3505
|
event_key: string;
|
|
2905
3506
|
name: string;
|
|
2906
3507
|
}
|
|
3508
|
+
/**
|
|
3509
|
+
* ONE SUBSCRIPTION AS ITS OWNER SEES IT — `custom.subscriptions`.
|
|
3510
|
+
*
|
|
3511
|
+
* `custom.agg_subscriptions` is the NOTIFIER's reader: it answers the whole
|
|
3512
|
+
* organization's firing subscriptions so the delivery path can run, and it is
|
|
3513
|
+
* not callable by a client. This is the other side of the same rows — narrowed
|
|
3514
|
+
* to Tables the caller can already open, so the list never reveals a Table —
|
|
3515
|
+
* and it carries the two things a screen needs and the notifier does not: is it
|
|
3516
|
+
* switched off, and may I switch it off.
|
|
3517
|
+
*/
|
|
3518
|
+
interface MySubscription extends Subscription {
|
|
3519
|
+
table_id: Uuid | null;
|
|
3520
|
+
/** Off. `custom.agg_subscriptions` already excludes a muted one, so this is the truth. */
|
|
3521
|
+
muted: boolean;
|
|
3522
|
+
/** It is addressed to me. */
|
|
3523
|
+
mine: boolean;
|
|
3524
|
+
/** I may switch it off: mine, or I hold admin on the Table it watches. */
|
|
3525
|
+
i_may_mute: boolean;
|
|
3526
|
+
}
|
|
2907
3527
|
/** The `subscription` block a Rule record carries. Written through `record_write`. */
|
|
2908
3528
|
interface SubscriptionBlock {
|
|
2909
3529
|
saved_view_id: Uuid;
|
|
@@ -3641,4 +4261,4 @@ interface RecordsConfig {
|
|
|
3641
4261
|
schema?: string;
|
|
3642
4262
|
}
|
|
3643
4263
|
|
|
3644
|
-
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, type CustomFieldTableType, DELIVERIES, type Delivery, type DocRenderRow, type DocSignatureCheck, type DocSignatureRow, type DocTemplateRow, type DocToken, type DocUnresolvedToken, ENTITY_TOKENS, type EntityFieldRights, type EntityFieldValue, type EntityRecordMatch, type EntityRecordRead, type EntityRecordsFound, type EntityTableFacts, 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 FormSummary, 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 NewEntityFieldDeclaration, 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 WorkApprovalDecision, type WorkApprovalFiled, type WorkApprover, type WorkAssignment, type WorkAssignmentField, type WorkChange, type WorkDueState, type WorkGraph, type WorkInboxItem, type WorkInboxKind, type WorkInstantiation, type WorkListFlavour, type WorkListItem, type WorkOrigin, type WorkRecordState, type WorkSlotHold, type WorkState, type WorkTemplateNode, type WorkTemplateRelation, type WorkTurn, type WriteConflict, asPermissionLevel, atLeast, err, highestLevel, isRecordsErr, measureKey, ok, publicFormPath };
|
|
4264
|
+
export { ABSENCE_REASONS, ACTOR_VOCABULARY, type AbsenceReason, type Actor, type AggregateBucket, type AggregateFilter, type AggregateMeasure, type AggregateOperation, type AggregateRow, type AggregateWindow, type AnonTokenBinding, COMPUTE_ON, CONTEXT_POLICIES, type ChoiceOption, type ComputeOn, type ContextPolicy, type CustomFieldTableType, DELIVERIES, type DashboardBlock, type DashboardBlockKind, type DashboardBlockResult, type DashboardRunResult, type DashboardSummary, type Delivery, type DocRenderRow, type DocSignatureCheck, type DocSignatureRow, type DocTemplateRow, type DocToken, type DocUnresolvedToken, ENTITY_TOKENS, type EntityFieldRights, type EntityFieldValue, type EntityRecordMatch, type EntityRecordRead, type EntityRecordsFound, type EntityTableFacts, type EntityToken, type ExternalPrincipalCard, FIELD_SENSITIVITIES, FIELD_SOURCES, FRESHNESS, type Field, type FieldBehavior, type FieldPatch, type FieldProposal, type FieldRule, type FieldSensitivity, type FieldSource, type FieldTypeWord, type ForbiddenEnvelopeWord, type FormSummary, 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 MySubscription, type NewEntityFieldDeclaration, 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 PortalCard, type PortalInvitation, type PortalPreviewRow, type PortalPrincipal, type PortalRevocation, type PortalSummary, type PortalTableExposure, 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 StuckRow, 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 WorkApprovalDecision, type WorkApprovalFiled, type WorkApprover, type WorkAssignment, type WorkAssignmentField, type WorkChange, type WorkDueState, type WorkGraph, type WorkInboxItem, type WorkInboxKind, type WorkInstantiation, type WorkListFlavour, type WorkListItem, type WorkOrigin, type WorkRecordState, type WorkSlotHold, type WorkState, type WorkTemplateNode, type WorkTemplateRelation, type WorkTurn, type WriteConflict, asPermissionLevel, atLeast, choiceSlug, choiceValuesOf, choicesOf, err, highestLevel, holdsARetiredChoice, isRecordsErr, isTheChosen, looksLikeAnId, measureKey, ok, optionKey, optionLabel, portalPath, publicFormPath };
|