@ai-matrx/records 0.7.2 → 0.11.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.
@@ -134,6 +134,8 @@ var STORE_DOORS = [
134
134
  { name: "assert_client_may_change", args: "p_organization_id uuid, p_subject_id uuid, p_door text, p_required permission_level DEFAULT 'editor'::permission_level, p_subject_word text DEFAULT 'record'::text", returns: "void", security: "invoker" },
135
135
  { name: "assert_client_may_open", args: "p_organization_id uuid, p_subject_id uuid, p_door text, p_required permission_level DEFAULT 'viewer'::permission_level, p_subject_word text DEFAULT 'record'::text", returns: "void", security: "invoker" },
136
136
  { name: "assert_client_may_reach", args: "p_organization_id uuid, p_door text", returns: "void", security: "invoker" },
137
+ { name: "assert_entity_door", args: "p_organization_id uuid, p_door text", returns: "void", security: "definer" },
138
+ { name: "assert_entity_is_organization_scoped", args: "p_token text, p_label text, p_scoped boolean", returns: "void", security: "invoker" },
137
139
  { name: "assert_may_know_table", args: "p_organization_id uuid, p_table_id uuid, p_door text", returns: "void", security: "invoker" },
138
140
  { name: "assert_organization_admin", args: "p_organization_id uuid, p_door text, p_what text", returns: "void", security: "invoker" },
139
141
  { name: "assert_organization_wall", args: "p_kind text, p_organization_id uuid, p_row jsonb", returns: "void", security: "invoker" },
@@ -163,11 +165,14 @@ var STORE_DOORS = [
163
165
  { name: "doc_format_value", args: "p_field_data jsonb, p_value jsonb", returns: "text", security: "invoker" },
164
166
  { name: "doc_render_body", args: "p_organization_id uuid, p_template_id uuid, p_record_id uuid", returns: "text", security: "invoker" },
165
167
  { name: "doc_render_document", args: "p_organization_id uuid, p_template_id uuid, p_record_id uuid", returns: "uuid", security: "definer" },
168
+ { name: "doc_render_read", args: "p_organization_id uuid, p_render_id uuid", returns: "jsonb", security: "definer" },
166
169
  { name: "doc_render_write", args: "p_organization_id uuid, p_template_id uuid, p_record_id uuid, p_table_id uuid, p_template_version integer, p_body text, p_content_hash text", returns: "uuid", security: "definer" },
167
170
  { name: "doc_sign", args: "p_organization_id uuid, p_render_id uuid, p_field_key text, p_signer_name text, p_signer_user_id uuid DEFAULT NULL::uuid", returns: "uuid", security: "definer" },
168
171
  { name: "doc_signature_field_ok", args: "p_field_data jsonb", returns: "boolean", security: "invoker" },
169
172
  { name: "doc_signature_intact", args: "p_organization_id uuid, p_signature_id uuid", returns: "jsonb", security: "invoker" },
173
+ { name: "doc_signature_read", args: "p_organization_id uuid, p_signature_id uuid", returns: "jsonb", security: "definer" },
170
174
  { name: "doc_signature_write", args: "p_organization_id uuid, p_render_id uuid, p_record_id uuid, p_field_key text, p_signer_name text, p_signer_user_id uuid, p_document_hash text, p_document_version integer", returns: "uuid", security: "definer" },
175
+ { name: "doc_template_read", args: "p_organization_id uuid, p_template_id uuid", returns: "jsonb", security: "definer" },
171
176
  { name: "doc_template_save", args: "p_organization_id uuid, p_table_id uuid, p_name text, p_body text, p_template_id uuid DEFAULT NULL::uuid", returns: "uuid", security: "definer" },
172
177
  { name: "doc_token_pattern", args: "", returns: "text", security: "invoker" },
173
178
  { name: "doc_tokens", args: "p_body text", returns: "TABLE(ordinal integer, raw text, field_id uuid)", security: "invoker" },
@@ -176,6 +181,15 @@ var STORE_DOORS = [
176
181
  { name: "doors_not_deciding_the_record", args: "", returns: "TABLE(function_name text, identity_args text, why text)", security: "invoker" },
177
182
  { name: "doors_not_on_one_ladder", args: "", returns: "TABLE(function_name text, identity_args text, why text)", security: "invoker" },
178
183
  { name: "effective_level", args: "p_user_id uuid, p_organization_id uuid, p_id uuid, p_type text DEFAULT 'record'::text", returns: "permission_level", security: "definer" },
184
+ { name: "entity_field_declare", args: "p_organization_id uuid, p_token text, p_spec jsonb", returns: "uuid", security: "definer" },
185
+ { name: "entity_field_retire", args: "p_organization_id uuid, p_field_id uuid", returns: "uuid", security: "definer" },
186
+ { name: "entity_field_rights", args: "p_organization_id uuid, p_token text", returns: "jsonb", security: "definer" },
187
+ { name: "entity_field_update", args: "p_organization_id uuid, p_field_id uuid, p_patch jsonb", returns: "uuid", security: "definer" },
188
+ { name: "entity_fields", args: "p_organization_id uuid, p_token text", returns: "SETOF custom.record", security: "definer" },
189
+ { name: "entity_record_read", args: "p_organization_id uuid, p_token text, p_record_id uuid", returns: "jsonb", security: "invoker" },
190
+ { name: "entity_records_find", args: "p_organization_id uuid, p_token text, p_key text, p_value jsonb DEFAULT NULL::jsonb, p_limit integer DEFAULT 50, p_offset integer DEFAULT 0", returns: "jsonb", security: "invoker" },
191
+ { name: "entity_table", args: "p_token text", returns: "TABLE(token text, schema_name text, table_name text, type text, title_column text, label text, has_organization boolean, has_deleted_at boolean)", security: "invoker" },
192
+ { name: "entity_value_write", args: "p_organization_id uuid, p_token text, p_record_id uuid, p_patch jsonb", returns: "jsonb", security: "invoker" },
179
193
  { name: "export_records", args: "p_organization_id uuid, p_table_id uuid, p_limit integer DEFAULT 1000", returns: "TABLE(id uuid, document jsonb)", security: "invoker" },
180
194
  { name: "external_foreign_table_findings", args: "", returns: "SETOF text", security: "definer" },
181
195
  { name: "external_history_event", args: "p_organization_id uuid, p_link_id uuid, p_operation text", returns: "bigint", security: "definer" },
@@ -195,6 +209,12 @@ var STORE_DOORS = [
195
209
  { name: "field_update", args: "p_organization_id uuid, p_field_id uuid, p_patch jsonb", returns: "uuid", security: "definer" },
196
210
  { name: "field_value_convert", args: "p_to jsonb, p_value jsonb", returns: "jsonb", security: "invoker" },
197
211
  { name: "file_kernel_id", args: "", returns: "uuid", security: "invoker" },
212
+ { name: "form_declare", args: "p_organization_id uuid, p_table_id uuid, p_title text, p_questions jsonb, p_presentation jsonb DEFAULT '{}'::jsonb, p_submission_cap integer DEFAULT NULL::integer, p_quarantine_rule_id uuid DEFAULT NULL::uuid, p_notify_rule_id uuid DEFAULT NULL::uuid, p_form_id uuid DEFAULT NULL::uuid, p_slug text DEFAULT NULL::text", returns: "uuid", security: "definer" },
213
+ { name: "form_notify", args: "p_organization_id uuid, p_form_id uuid, p_record_id uuid, p_submission_id uuid", returns: "uuid", security: "invoker" },
214
+ { name: "form_public", args: "p_form_id uuid", returns: "TABLE(form_id uuid, organization_id uuid, table_id uuid, title text, presentation jsonb, fields jsonb, honeypot_key text, state text, message text)", security: "definer" },
215
+ { name: "form_slug", args: "p_organization_id uuid, p_title text, p_form_id uuid DEFAULT NULL::uuid", returns: "text", security: "invoker" },
216
+ { name: "form_submit", args: "p_form_id uuid, p_origin text, p_payload jsonb, p_bucket text, p_honeypot text DEFAULT NULL::text, p_client_key text DEFAULT NULL::text", returns: "TABLE(submission_id uuid, record_id uuid, state text, message text)", security: "definer" },
217
+ { name: "forms", args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid", returns: "TABLE(form_id uuid, table_id uuid, title text, slug text, published_at timestamp with time zone, closed_at timestamp with time zone, submission_cap integer, responses bigint, in_table bigint, held bigint, rejected bigint, state text, quarantine_rule_id uuid, notify_rule_id uuid, presentation jsonb)", security: "definer" },
198
218
  { 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" },
199
219
  { name: "guard_refusals_are_complete", args: "", returns: "TABLE(guard text, said text)", security: "invoker" },
200
220
  { 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" },
@@ -247,6 +267,8 @@ var STORE_DOORS = [
247
267
  { 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" },
248
268
  { name: "my_level", args: "p_organization_id uuid, p_id uuid, p_type text DEFAULT 'record'::text", returns: "permission_level", security: "definer" },
249
269
  { 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" },
270
+ { name: "organization_clear", args: "p_organization_id uuid, p_confirm text, p_and_destroy boolean DEFAULT false", returns: "jsonb", security: "definer" },
271
+ { name: "organization_contents", args: "p_organization_id uuid", returns: "jsonb", security: "definer" },
250
272
  { name: "organization_kernel_id", args: "", returns: "uuid", security: "invoker" },
251
273
  { 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" },
252
274
  { name: "owning_table", args: "p_organization_id uuid, p_record_id uuid", returns: "uuid", security: "invoker" },
@@ -311,6 +333,7 @@ var STORE_DOORS = [
311
333
  { name: "record_values_versioned", args: "p_organization_id uuid, p_record_id uuid", returns: "TABLE(field_key text, field_id uuid, value jsonb, value_version integer, source jsonb, absent_reason text, actor text, on_behalf_of text, written_at timestamp with time zone, alternates jsonb)", security: "definer" },
312
334
  { name: "record_write", args: "p_organization_id uuid, p_table_id uuid, p_data jsonb", returns: "uuid", security: "definer" },
313
335
  { name: "relation_carry", args: "p_organization_id uuid, p_container_id uuid, p_item_id uuid", returns: "uuid", security: "definer" },
336
+ { name: "relation_edges_withdraw", args: "p_organization_id uuid, p_field_ids uuid[], p_why text", returns: "integer", security: "definer" },
314
337
  { name: "relation_own", args: "p_organization_id uuid, p_owner_id uuid, p_target_id uuid", returns: "uuid", security: "definer" },
315
338
  { name: "relation_target_card", args: "p_organization_id uuid, p_record_id uuid, p_via_key text DEFAULT NULL::text", returns: "TABLE(target_id uuid, target_organization_id uuid, is_foreign boolean, masked boolean, reader_level permission_level, card jsonb, why text)", security: "definer" },
316
339
  { name: "relation_target_external", args: "p_connection_token text, p_external_table text, p_external_key text", returns: "jsonb", security: "definer" },
@@ -325,6 +348,7 @@ var STORE_DOORS = [
325
348
  { name: "rollup_value", args: "p_organization_id uuid, p_record_id uuid, p_field_data jsonb", returns: "jsonb", security: "invoker" },
326
349
  { name: "rule_applies", args: "p_organization_id uuid, p_rule_id uuid, p_record_id uuid", returns: "jsonb", security: "invoker" },
327
350
  { name: "rule_context", args: "p_organization_id uuid, p_record_id uuid", returns: "jsonb", security: "invoker" },
351
+ { name: "rule_declare", args: "p_organization_id uuid, p_spec jsonb, p_rule_id uuid DEFAULT NULL::uuid", returns: "uuid", security: "definer" },
328
352
  { name: "rule_dependency_edges", args: "p_organization_id uuid, p_row custom.record DEFAULT NULL::custom.record", returns: "TABLE(needs text, needed text)", security: "invoker" },
329
353
  { name: "rule_eval", args: "p_organization_id uuid, p_expr jsonb, p_values jsonb, p_context jsonb DEFAULT '{}'::jsonb", returns: "jsonb", security: "invoker" },
330
354
  { name: "rule_field_key", args: "p_organization_id uuid, p_field_id uuid", returns: "text", security: "invoker" },
@@ -385,24 +409,36 @@ var STORE_DOORS = [
385
409
  { name: "visible_record_ids", args: "p_user_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level", returns: "TABLE(id uuid)", security: "definer" },
386
410
  { 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" },
387
411
  { name: "widget_kernel_id", args: "", returns: "uuid", security: "invoker" },
412
+ { name: "work_approval_approvers", args: "p_organization_id uuid, p_subject_id uuid, p_approver_id uuid DEFAULT NULL::uuid", returns: "TABLE(user_id uuid, name text, why text)", security: "definer" },
413
+ { name: "work_approval_decide", args: "p_organization_id uuid, p_approval_id uuid, p_approve boolean, p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
414
+ { name: "work_approval_may_decide", args: "p_organization_id uuid, p_approval_id uuid", returns: "boolean", security: "definer" },
415
+ { name: "work_approval_read", args: "p_organization_id uuid, p_approval_id uuid", returns: "jsonb", security: "definer" },
416
+ { name: "work_approval_request", args: "p_organization_id uuid, p_subject_id uuid, p_change jsonb, p_note text DEFAULT NULL::text, p_approver_id uuid DEFAULT NULL::uuid, p_origin text DEFAULT 'person'::text, p_conversation_id uuid DEFAULT NULL::uuid", returns: "jsonb", security: "definer" },
417
+ { name: "work_assign", args: "p_organization_id uuid, p_record_id uuid, p_assignee_user_id uuid, p_due_date timestamp with time zone DEFAULT NULL::timestamp with time zone, p_clear_due boolean DEFAULT false", returns: "jsonb", security: "definer" },
388
418
  { name: "work_assignment_fields", args: "p_options_table_id uuid DEFAULT NULL::uuid", returns: "TABLE(key text, label text, spec jsonb)", security: "invoker" },
389
- { name: "work_has_assignment", args: "p_organization_id uuid, p_table_id uuid", returns: "boolean", security: "invoker" },
390
- { name: "work_instantiation_shape", args: "p_organization_id uuid, p_instantiation_id uuid", returns: "jsonb", security: "invoker" },
419
+ { name: "work_has_assignment", args: "p_organization_id uuid, p_table_id uuid", returns: "boolean", security: "definer" },
420
+ { name: "work_inbox", args: "p_organization_id uuid, p_limit integer DEFAULT 50, p_offset integer DEFAULT 0, p_include_decided boolean DEFAULT false", returns: "TABLE(item_id uuid, kind text, origin text, title text, subject_id uuid, subject_kind text, summary text, state text, due_on timestamp with time zone, due_state text, actionable boolean, requested_by uuid, requested_by_name text, at timestamp with time zone)", security: "definer" },
421
+ { name: "work_instantiation_shape", args: "p_organization_id uuid, p_instantiation_id uuid", returns: "jsonb", security: "definer" },
422
+ { name: "work_list", args: "p_organization_id uuid, p_flavour text DEFAULT 'mine'::text, p_include_finished boolean DEFAULT false, p_limit integer DEFAULT 100, p_offset integer DEFAULT 0", returns: "TABLE(record_id uuid, table_id uuid, table_name text, title text, assignee_id uuid, assignee_name text, assignee_user_id uuid, due_on timestamp with time zone, due_state text, status text, terminal boolean, assigned_by uuid, updated_at timestamp with time zone)", security: "definer" },
423
+ { name: "work_person", args: "p_organization_id uuid, p_user_id uuid, p_create boolean DEFAULT true", returns: "uuid", security: "definer" },
424
+ { name: "work_record_states", args: "p_organization_id uuid, p_record_id uuid", returns: "TABLE(state_id uuid, name text, sort integer, terminal boolean, is_current boolean, allowed boolean, refusal text)", security: "definer" },
391
425
  { name: "work_relation_kinds", args: "", returns: "TABLE(kind text, available boolean, why text)", security: "invoker" },
392
- { name: "work_slot_expire", args: "p_organization_id uuid, p_table_id uuid", returns: "integer", security: "invoker" },
393
- { name: "work_slot_hold", args: "p_organization_id uuid, p_table_id uuid, p_slot_key text, p_holder text, p_ttl interval DEFAULT '00:15:00'::interval", returns: "jsonb", security: "invoker" },
394
- { name: "work_slot_holds", args: "p_organization_id uuid, p_table_id uuid", returns: "TABLE(hold_id uuid, slot_key text, holder text, expires_at timestamp with time zone, expired boolean)", security: "invoker" },
426
+ { name: "work_set_state", args: "p_organization_id uuid, p_record_id uuid, p_state_id uuid", returns: "jsonb", security: "definer" },
427
+ { name: "work_slot_expire", args: "p_organization_id uuid, p_table_id uuid", returns: "integer", security: "definer" },
428
+ { name: "work_slot_hold", args: "p_organization_id uuid, p_table_id uuid, p_slot_key text, p_holder text, p_ttl interval DEFAULT '00:15:00'::interval", returns: "jsonb", security: "definer" },
429
+ { name: "work_slot_holds", args: "p_organization_id uuid, p_table_id uuid", returns: "TABLE(hold_id uuid, slot_key text, holder text, expires_at timestamp with time zone, expired boolean)", security: "definer" },
395
430
  { name: "work_slot_index_name", args: "p_table_id uuid", returns: "text", security: "invoker" },
396
- { name: "work_slot_release", args: "p_organization_id uuid, p_hold_id uuid", returns: "boolean", security: "invoker" },
397
- { name: "work_slots_declare", args: "p_organization_id uuid, p_name text, p_slug text, p_home_id uuid DEFAULT NULL::uuid", returns: "jsonb", security: "invoker" },
431
+ { name: "work_slot_release", args: "p_organization_id uuid, p_hold_id uuid", returns: "boolean", security: "definer" },
432
+ { name: "work_slots_declare", args: "p_organization_id uuid, p_name text, p_slug text, p_home_id uuid DEFAULT NULL::uuid", returns: "jsonb", security: "definer" },
398
433
  { name: "work_states", args: "", returns: "TABLE(sort integer, name text, terminal boolean, next text[])", security: "invoker" },
399
- { name: "work_take_assignment", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "invoker" },
400
- { name: "work_template_declare", args: "p_organization_id uuid, p_name text, p_graph jsonb", returns: "uuid", security: "invoker" },
401
- { name: "work_template_instantiate", args: "p_organization_id uuid, p_template_id uuid, p_overrides jsonb DEFAULT '{}'::jsonb", returns: "jsonb", security: "invoker" },
434
+ { name: "work_take_assignment", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "definer" },
435
+ { name: "work_template_declare", args: "p_organization_id uuid, p_name text, p_graph jsonb", returns: "uuid", security: "definer" },
436
+ { name: "work_template_instantiate", args: "p_organization_id uuid, p_template_id uuid, p_overrides jsonb DEFAULT '{}'::jsonb", returns: "jsonb", security: "definer" },
402
437
  { name: "work_template_refusal", args: "p_graph jsonb", returns: "text", security: "invoker" },
403
- { name: "work_template_shape", args: "p_organization_id uuid, p_template_id uuid", returns: "jsonb", security: "invoker" },
404
- { name: "work_transition_refusal", args: "p_organization_id uuid, p_from_state_id uuid, p_to_state_id uuid", returns: "text", security: "invoker" },
405
- { 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" }
438
+ { name: "work_template_shape", args: "p_organization_id uuid, p_template_id uuid", returns: "jsonb", security: "definer" },
439
+ { name: "work_templates", args: "p_organization_id uuid, p_limit integer DEFAULT 100", returns: "TABLE(template_id uuid, name text, nodes integer, relations integer, created_at timestamp with time zone)", security: "definer" },
440
+ { name: "work_transition_refusal", args: "p_organization_id uuid, p_from_state_id uuid, p_to_state_id uuid", returns: "text", security: "definer" },
441
+ { 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: "definer" }
406
442
  ];
407
443
  var STORE_KNOBS = [
408
444
  { key: "accessible_entity_ids_guard", value: "true", type: "boolean" },
@@ -442,16 +478,17 @@ var STORE_KNOBS = [
442
478
  { key: "world_publish_enabled", value: "false", type: "boolean" }
443
479
  ];
444
480
  var STORE_REFUSAL_CODES = [
445
- { code: "02000", raised_by: "doc_render_body,doc_render_document,doc_sign,doc_signature_intact,doc_template_save,external_history_event,external_rows,external_stub_upsert,external_writes_set,migrate_delete,migrate_extract_parent,migrate_merge,migrate_rename,migrate_reparent,migrate_retype,migrate_split,migrate_undo,read_record,record_delete,record_restore,record_update,relation_uncarry,share_access,share_grant,share_lane_set,share_people,share_revoke,visibility_as_of" },
446
- { 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" },
447
- { 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" },
481
+ { code: "02000", 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" },
482
+ { code: "0A000", raised_by: "external_rows,external_source_declare,external_write_through,promote_field,promoted_index_expr,promoted_query_sql,promoted_read,rule_eval,work_assign,work_slots_declare" },
483
+ { code: "22004", raised_by: "_entity_custom_fields_guard,_value_envelope,actor_word,agg_assert_key,agg_sql,anon_capture,anon_token_issue,anon_write,assert_client_may_reach,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" },
448
484
  { code: "22012", raised_by: "rule_eval" },
449
- { 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" },
450
- { 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" },
451
- { 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" },
452
- { 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" },
485
+ { code: "22023", raised_by: "_entity_custom_fields_guard,_value_envelope,_work_shape_guard,actor_word,agg_assert_key,agg_sql,anon_token_issue,containment_parent,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" },
486
+ { code: "23503", raised_by: "_containment_guard,_field_document_for,_record_rule_uses,anon_publish,anon_rate_take,anon_token_issue,anon_write,assert_organization_wall,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" },
487
+ { code: "23505", raised_by: "_unique_rule_holds,doc_sign,doc_signature_write,entity_field_declare,field_declare,home_add,io_proposal_accept,relation_carry,relation_own,share_grant,work_approval_decide,work_slot_hold" },
488
+ { code: "23514", 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" },
453
489
  { code: "40001", raised_by: "has_visibility_at" },
454
- { 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" },
490
+ { code: "42501", raised_by: "_doc_render_immutable,_doc_signature_immutable,_field_definition_write,_field_write_door,_rule_definition_write,_store_door,anon_capture,anon_inbound_land,anon_publish,anon_token_issue,anon_token_verify,anon_write,assert_client_may_change,assert_client_may_open,assert_client_may_reach,assert_may_know_table,assert_organization_admin,assert_store_door,entity_field_declare,entity_field_retire,entity_field_update,entity_value_write,external_write_through,form_declare,form_submit,io_comment_resolve,io_comment_write,io_restore,migrate_purge,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" },
491
+ { code: "42703", raised_by: "entity_table" },
455
492
  { code: "53400", raised_by: "anon_rate_take,delete_cascade_closure,promote_field" },
456
493
  { code: "54001", raised_by: "record_delete" },
457
494
  { code: "PT409", raised_by: "record_update" }
@@ -1561,6 +1598,24 @@ var DOORS = {
1561
1598
  fieldDeclare: "field_declare",
1562
1599
  fieldUpdate: "field_update",
1563
1600
  fieldRetire: "field_retire",
1601
+ // CUSTOM FIELDS ON A STANDARD BUSINESS TABLE. Every door above is keyed by a
1602
+ // custom Table's uuid, and a standard table has no Table record - so until
1603
+ // 2026-09-20 `custom.applicable_fields(org, 'party', null)` answered `22P02
1604
+ // invalid input syntax for uuid` and there was no other way in. These are
1605
+ // keyed by the REGISTRY TOKEN instead, and they are one set for all 643
1606
+ // tables the registry types Entity or Detail. The three value doors are
1607
+ // SECURITY INVOKER in the database on purpose: the standard table's own
1608
+ // row-level security is what decides who may read and write its rows, and a
1609
+ // definer wrapper would replace it with a second access system.
1610
+ entityTable: "entity_table",
1611
+ entityFields: "entity_fields",
1612
+ entityFieldDeclare: "entity_field_declare",
1613
+ entityFieldUpdate: "entity_field_update",
1614
+ entityFieldRetire: "entity_field_retire",
1615
+ entityFieldRights: "entity_field_rights",
1616
+ entityRecordRead: "entity_record_read",
1617
+ entityValueWrite: "entity_value_write",
1618
+ entityRecordsFind: "entity_records_find",
1564
1619
  tableCapacity: "table_capacity",
1565
1620
  tableStorage: "table_storage",
1566
1621
  promoteTable: "promote_table",
@@ -1598,6 +1653,17 @@ var DOORS = {
1598
1653
  ruleMembership: "rule_membership",
1599
1654
  ruleRun: "rule_run",
1600
1655
  ruleEval: "rule_eval",
1656
+ // REC-15: the door that makes a Rule a RULE. `custom.record_write` into the
1657
+ // Rule kernel produces a valid Rule document carrying `data_class = 'record'`,
1658
+ // and every reader that goes LOOKING for a Rule looks for the class — so a
1659
+ // subscription written that way was invisible to DOOR-18 and nothing fired.
1660
+ // PRODUCTS row 1 — a form is a view on a real Table. `forms` lists an
1661
+ // organization's own, `formDeclare` writes one, and `anonPublish` is the one
1662
+ // act that opens it to people with no account. The PUBLIC pair
1663
+ // (`custom.form_public`, `custom.form_submit`) is deliberately absent: those
1664
+ // are server-lane doors and a browser never calls them.
1665
+ forms: "forms",
1666
+ formDeclare: "form_declare",
1601
1667
  // The eighth verb (AGT-N-8): a grouped, bucketed, filtered count/sum/avg/
1602
1668
  // min/max computed INSIDE the read door's own query, so a chart shows exactly
1603
1669
  // the rows this person may see and never fetches the ones they may not.
@@ -1656,6 +1722,23 @@ var DOORS = {
1656
1722
  workSlotRelease: "work_slot_release",
1657
1723
  workSlotHolds: "work_slot_holds",
1658
1724
  workSlotExpire: "work_slot_expire",
1725
+ // THE WORK LAYER'S OWN DOORS (lane WORK-DOORS, 2026-09-20). Until this lane
1726
+ // all nineteen `custom.work_*` functions were SECURITY INVOKER with no client
1727
+ // grant: REC-69, REC-70 and REC-71 were live in the store and unreachable
1728
+ // from a browser. These are the verbs a person actually uses.
1729
+ workPerson: "work_person",
1730
+ workAssign: "work_assign",
1731
+ workRecordStates: "work_record_states",
1732
+ workSetState: "work_set_state",
1733
+ workList: "work_list",
1734
+ workTemplates: "work_templates",
1735
+ /** THE ONE QUEUE: assignments, approvals and the agent's proposals together. */
1736
+ workInbox: "work_inbox",
1737
+ workApprovalApprovers: "work_approval_approvers",
1738
+ workApprovalRequest: "work_approval_request",
1739
+ workApprovalMayDecide: "work_approval_may_decide",
1740
+ workApprovalDecide: "work_approval_decide",
1741
+ workApprovalRead: "work_approval_read",
1659
1742
  // Declared here BECAUSE they do not exist yet: naming them is what makes the
1660
1743
  // absence visible to `pnpm check:store-registry` and to the suite.
1661
1744
  metadataSearch: "metadata_search",
@@ -1679,6 +1762,14 @@ var BY_SQLSTATE = {
1679
1762
  // is wrong for the shape the store holds, which is what `invalid_argument`
1680
1763
  // already means — the store's own sentence names the value and the type.
1681
1764
  "22P02": "invalid_argument",
1765
+ // 42703 — a column that is not there. The store raises it from
1766
+ // `custom.entity_table`, which is asked for a column by NAME, so the class is
1767
+ // exactly "the call named something the shape does not have": the same thing
1768
+ // `invalid_argument` already means, and the store's own sentence names the
1769
+ // column. Added 2026-09-20 (lane FORMS) because the package's live-door suite
1770
+ // caught it raised by a door this package did not know about — which is the
1771
+ // suite working, and is why the map is a census rather than a guess.
1772
+ "42703": "invalid_argument",
1682
1773
  "02000": "not_found",
1683
1774
  "23503": "missing_reference",
1684
1775
  "23505": "already_exists",
@@ -2073,6 +2164,88 @@ function createRecordsClient(config) {
2073
2164
  "fieldDeclare"
2074
2165
  );
2075
2166
  },
2167
+ async entityTable({ token }) {
2168
+ const answer = await callDoor(
2169
+ DOORS.entityTable,
2170
+ { p_token: token },
2171
+ "entityTable"
2172
+ );
2173
+ if (!answer.ok) return err(answer.error);
2174
+ const row = Array.isArray(answer.data) ? answer.data[0] : answer.data;
2175
+ if (!row) {
2176
+ return err({
2177
+ code: "not_found",
2178
+ message: `The registry answered nothing for the table "${token}".`,
2179
+ hint: "REC-33: a standard table is named by its registry token. Nothing was read."
2180
+ });
2181
+ }
2182
+ return ok(row);
2183
+ },
2184
+ async entityFields({ token }) {
2185
+ const rows = await callDoor(
2186
+ DOORS.entityFields,
2187
+ { p_organization_id: org, p_token: token },
2188
+ "entityFields"
2189
+ );
2190
+ if (!rows.ok) return err(rows.error);
2191
+ return ok((rows.data ?? []).map((row) => ({ id: row.id, ...row.data })));
2192
+ },
2193
+ async entityFieldDeclare({ token, spec }) {
2194
+ return callDoor(
2195
+ DOORS.entityFieldDeclare,
2196
+ { p_organization_id: org, p_token: token, p_spec: spec },
2197
+ "entityFieldDeclare"
2198
+ );
2199
+ },
2200
+ async entityFieldUpdate({ field_id, patch }) {
2201
+ return callDoor(
2202
+ DOORS.entityFieldUpdate,
2203
+ { p_organization_id: org, p_field_id: field_id, p_patch: patch },
2204
+ "entityFieldUpdate"
2205
+ );
2206
+ },
2207
+ async entityFieldRetire({ field_id }) {
2208
+ return callDoor(
2209
+ DOORS.entityFieldRetire,
2210
+ { p_organization_id: org, p_field_id: field_id },
2211
+ "entityFieldRetire"
2212
+ );
2213
+ },
2214
+ async entityFieldRights({ token }) {
2215
+ return callDoor(
2216
+ DOORS.entityFieldRights,
2217
+ { p_organization_id: org, p_token: token },
2218
+ "entityFieldRights"
2219
+ );
2220
+ },
2221
+ async entityRecordRead({ token, record_id }) {
2222
+ return callDoor(
2223
+ DOORS.entityRecordRead,
2224
+ { p_organization_id: org, p_token: token, p_record_id: record_id },
2225
+ "entityRecordRead"
2226
+ );
2227
+ },
2228
+ async entityValueWrite({ token, record_id, patch }) {
2229
+ return callDoor(
2230
+ DOORS.entityValueWrite,
2231
+ { p_organization_id: org, p_token: token, p_record_id: record_id, p_patch: patch },
2232
+ "entityValueWrite"
2233
+ );
2234
+ },
2235
+ async entityRecordsFind({ token, key, value, limit, offset }) {
2236
+ return callDoor(
2237
+ DOORS.entityRecordsFind,
2238
+ {
2239
+ p_organization_id: org,
2240
+ p_token: token,
2241
+ p_key: key,
2242
+ p_value: value === void 0 ? null : value,
2243
+ ...limit === void 0 ? {} : { p_limit: limit },
2244
+ ...offset === void 0 ? {} : { p_offset: offset }
2245
+ },
2246
+ "entityRecordsFind"
2247
+ );
2248
+ },
2076
2249
  async fieldUpdate({ field_id, patch }) {
2077
2250
  return callDoor(
2078
2251
  DOORS.fieldUpdate,
@@ -2117,6 +2290,31 @@ function createRecordsClient(config) {
2117
2290
  "ruleMembership"
2118
2291
  );
2119
2292
  },
2293
+ async forms(args) {
2294
+ return callDoor(
2295
+ DOORS.forms,
2296
+ { p_organization_id: org, p_table_id: args?.table_id ?? null },
2297
+ "forms"
2298
+ );
2299
+ },
2300
+ async formDeclare(args) {
2301
+ return callDoor(
2302
+ DOORS.formDeclare,
2303
+ {
2304
+ p_organization_id: org,
2305
+ p_table_id: args.table_id,
2306
+ p_title: args.title,
2307
+ p_questions: args.questions,
2308
+ p_presentation: args.presentation ?? {},
2309
+ p_submission_cap: args.submission_cap ?? null,
2310
+ p_quarantine_rule_id: args.quarantine_rule_id ?? null,
2311
+ p_notify_rule_id: args.notify_rule_id ?? null,
2312
+ p_form_id: args.form_id ?? null,
2313
+ p_slug: args.slug ?? null
2314
+ },
2315
+ "formDeclare"
2316
+ );
2317
+ },
2120
2318
  async ruleRun({ rule_id, values, context }) {
2121
2319
  return callDoor(
2122
2320
  DOORS.ruleRun,
@@ -2465,6 +2663,128 @@ function createRecordsClient(config) {
2465
2663
  "workSlotExpire"
2466
2664
  );
2467
2665
  },
2666
+ // ── the work layer a person actually uses ────────────────────────────
2667
+ async workInbox(args) {
2668
+ return callDoor(
2669
+ DOORS.workInbox,
2670
+ {
2671
+ p_organization_id: org,
2672
+ p_limit: args?.limit ?? 50,
2673
+ p_offset: args?.offset ?? 0,
2674
+ p_include_decided: args?.includeDecided ?? false
2675
+ },
2676
+ "workInbox"
2677
+ );
2678
+ },
2679
+ async workList(args) {
2680
+ return callDoor(
2681
+ DOORS.workList,
2682
+ {
2683
+ p_organization_id: org,
2684
+ p_flavour: args?.flavour ?? "mine",
2685
+ p_include_finished: args?.includeFinished ?? false,
2686
+ p_limit: args?.limit ?? 100,
2687
+ p_offset: args?.offset ?? 0
2688
+ },
2689
+ "workList"
2690
+ );
2691
+ },
2692
+ async workAssign({ record_id, user_id = null, dueDate = null, clearDue = false }) {
2693
+ return callDoor(
2694
+ DOORS.workAssign,
2695
+ {
2696
+ p_organization_id: org,
2697
+ p_record_id: record_id,
2698
+ p_assignee_user_id: user_id,
2699
+ p_due_date: dueDate,
2700
+ p_clear_due: clearDue
2701
+ },
2702
+ "workAssign"
2703
+ );
2704
+ },
2705
+ async workRecordStates({ record_id }) {
2706
+ return callDoor(
2707
+ DOORS.workRecordStates,
2708
+ { p_organization_id: org, p_record_id: record_id },
2709
+ "workRecordStates"
2710
+ );
2711
+ },
2712
+ async workSetState({ record_id, state_id }) {
2713
+ return callDoor(
2714
+ DOORS.workSetState,
2715
+ { p_organization_id: org, p_record_id: record_id, p_state_id: state_id },
2716
+ "workSetState"
2717
+ );
2718
+ },
2719
+ async workPerson({ user_id, create = true }) {
2720
+ return callDoor(
2721
+ DOORS.workPerson,
2722
+ { p_organization_id: org, p_user_id: user_id, p_create: create },
2723
+ "workPerson"
2724
+ );
2725
+ },
2726
+ async workTemplates(args) {
2727
+ return callDoor(
2728
+ DOORS.workTemplates,
2729
+ { p_organization_id: org, p_limit: args?.limit ?? 100 },
2730
+ "workTemplates"
2731
+ );
2732
+ },
2733
+ async workApprovalApprovers({ subject_id, approver_id = null }) {
2734
+ return callDoor(
2735
+ DOORS.workApprovalApprovers,
2736
+ { p_organization_id: org, p_subject_id: subject_id, p_approver_id: approver_id },
2737
+ "workApprovalApprovers"
2738
+ );
2739
+ },
2740
+ async workApprovalRequest({
2741
+ subject_id,
2742
+ change,
2743
+ note = null,
2744
+ approver_id = null,
2745
+ origin = "person",
2746
+ conversation_id = null
2747
+ }) {
2748
+ return callDoor(
2749
+ DOORS.workApprovalRequest,
2750
+ {
2751
+ p_organization_id: org,
2752
+ p_subject_id: subject_id,
2753
+ p_change: change,
2754
+ p_note: note,
2755
+ p_approver_id: approver_id,
2756
+ p_origin: origin,
2757
+ p_conversation_id: conversation_id
2758
+ },
2759
+ "workApprovalRequest"
2760
+ );
2761
+ },
2762
+ async workApprovalMayDecide({ approval_id }) {
2763
+ return callDoor(
2764
+ DOORS.workApprovalMayDecide,
2765
+ { p_organization_id: org, p_approval_id: approval_id },
2766
+ "workApprovalMayDecide"
2767
+ );
2768
+ },
2769
+ async workApprovalDecide({ approval_id, approve, note = null }) {
2770
+ return callDoor(
2771
+ DOORS.workApprovalDecide,
2772
+ {
2773
+ p_organization_id: org,
2774
+ p_approval_id: approval_id,
2775
+ p_approve: approve,
2776
+ p_note: note
2777
+ },
2778
+ "workApprovalDecide"
2779
+ );
2780
+ },
2781
+ async workApprovalRead({ approval_id }) {
2782
+ return callDoor(
2783
+ DOORS.workApprovalRead,
2784
+ { p_organization_id: org, p_approval_id: approval_id },
2785
+ "workApprovalRead"
2786
+ );
2787
+ },
2468
2788
  // ── the trust doors ──────────────────────────────────────────────────
2469
2789
  async isExternalPrincipal(args) {
2470
2790
  return trustDoor(
@@ -2525,10 +2845,12 @@ function createRecordsClient(config) {
2525
2845
  "publishToWorld"
2526
2846
  );
2527
2847
  },
2528
- async ruleDeclare() {
2529
- const refusal = doorAbsent(DOORS.ruleDeclare);
2530
- scream({ code: refusal.code, message: refusal.message, ...refusal.hint ? { hint: refusal.hint } : {}, where: "ruleDeclare" });
2531
- return err(refusal);
2848
+ async ruleDeclare({ spec, rule_id }) {
2849
+ return callDoor(
2850
+ DOORS.ruleDeclare,
2851
+ { p_organization_id: org, p_spec: spec, p_rule_id: rule_id ?? null },
2852
+ "ruleDeclare"
2853
+ );
2532
2854
  },
2533
2855
  async metadataSearch() {
2534
2856
  const refusal = doorAbsent(DOORS.metadataSearch);
@@ -2618,6 +2940,9 @@ function useRecordsClient() {
2618
2940
  }
2619
2941
  return client;
2620
2942
  }
2943
+ function useOptionalRecordsClient() {
2944
+ return useContext(RecordsContext);
2945
+ }
2621
2946
  function useRecordsActor() {
2622
2947
  return useRecordsClient().config.actor;
2623
2948
  }
@@ -2786,6 +3111,72 @@ function useRecordMutation() {
2786
3111
  [client, run, saving, error, conflict]
2787
3112
  );
2788
3113
  }
3114
+ function useEntityFields(token) {
3115
+ return useAsync(
3116
+ (client) => token ? client.entityFields({ token }) : Promise.resolve({ ok: true, data: [] }),
3117
+ [token]
3118
+ );
3119
+ }
3120
+ function useEntityRecord(token, recordId) {
3121
+ return useAsync(
3122
+ (client) => token && recordId ? client.entityRecordRead({ token, record_id: recordId }) : Promise.resolve({ ok: true, data: null }),
3123
+ [token, recordId]
3124
+ );
3125
+ }
3126
+ function useEntityTable(token) {
3127
+ return useAsync(
3128
+ (client) => token ? client.entityTable({ token }) : Promise.resolve({ ok: true, data: null }),
3129
+ [token]
3130
+ );
3131
+ }
3132
+ function useEntityFieldRights(token) {
3133
+ return useAsync(
3134
+ (client) => token ? client.entityFieldRights({ token }) : Promise.resolve({ ok: true, data: null }),
3135
+ [token]
3136
+ );
3137
+ }
3138
+ function useEntityFieldMutation() {
3139
+ const client = useRecordsClient();
3140
+ const [saving, setSaving] = useState(false);
3141
+ const [error, setError] = useState(null);
3142
+ const run = useCallback(
3143
+ async (call, whenRefused) => {
3144
+ setSaving(true);
3145
+ setError(null);
3146
+ try {
3147
+ const result = await call();
3148
+ if (result.ok) return result.data;
3149
+ setError(result.error);
3150
+ return whenRefused;
3151
+ } finally {
3152
+ setSaving(false);
3153
+ }
3154
+ },
3155
+ []
3156
+ );
3157
+ return useMemo2(
3158
+ () => ({
3159
+ declare: (args) => run(() => client.entityFieldDeclare({ token: args.token, spec: args.spec }), null),
3160
+ update: (args) => run(
3161
+ () => client.entityFieldUpdate({ field_id: args.field_id, patch: args.patch }),
3162
+ null
3163
+ ),
3164
+ retire: (args) => run(() => client.entityFieldRetire({ field_id: args.field_id }), null),
3165
+ write: (args) => run(
3166
+ () => client.entityValueWrite({
3167
+ token: args.token,
3168
+ record_id: args.record_id,
3169
+ patch: args.patch
3170
+ }),
3171
+ null
3172
+ ),
3173
+ saving,
3174
+ error,
3175
+ clearError: () => setError(null)
3176
+ }),
3177
+ [client, run, saving, error]
3178
+ );
3179
+ }
2789
3180
  function useFieldMutation() {
2790
3181
  const client = useRecordsClient();
2791
3182
  const [saving, setSaving] = useState(false);
@@ -2914,6 +3305,11 @@ var OVERRIDE_POLICIES = [
2914
3305
  var FRESHNESS = ["live", "cached", "snapshot"];
2915
3306
  var TABLE_DISPLAYS = ["list", "grid", "board", "calendar", "timeline"];
2916
3307
 
3308
+ // src/rule.ts
3309
+ function publicFormPath(formId) {
3310
+ return `/f/${formId}`;
3311
+ }
3312
+
2917
3313
  // src/aggregate.ts
2918
3314
  function measureKey(measure) {
2919
3315
  return measure.op === "count" ? "count" : `${measure.op}_${measure.key ?? ""}`;
@@ -2960,11 +3356,18 @@ export {
2960
3356
  isRecordsErr,
2961
3357
  measureKey,
2962
3358
  ok,
3359
+ publicFormPath,
3360
+ useEntityFieldMutation,
3361
+ useEntityFieldRights,
3362
+ useEntityFields,
3363
+ useEntityRecord,
3364
+ useEntityTable,
2963
3365
  useFieldMutation,
2964
3366
  useFields,
2965
3367
  useMergeField,
2966
3368
  useMyLevel,
2967
3369
  useMyLevels,
3370
+ useOptionalRecordsClient,
2968
3371
  useRecord,
2969
3372
  useRecordMutation,
2970
3373
  useRecords,