@ai-matrx/records 0.16.0 → 0.20.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 +156 -0
- package/dist/core/index.cjs +483 -31
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +249 -6
- package/dist/core/index.d.ts +249 -6
- package/dist/core/index.js +483 -31
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +117 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +950 -12
- package/dist/index.d.ts +950 -12
- package/dist/index.js +117 -11
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +483 -31
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +1167 -15
- package/dist/react/index.d.ts +1167 -15
- package/dist/react/index.js +483 -31
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
package/dist/core/index.cjs
CHANGED
|
@@ -103,6 +103,7 @@ __export(core_exports, {
|
|
|
103
103
|
predictValueRefusals: () => predictValueRefusals,
|
|
104
104
|
predictWriteRefusals: () => predictWriteRefusals,
|
|
105
105
|
publicFormPath: () => publicFormPath,
|
|
106
|
+
scopeChip: () => scopeChip,
|
|
106
107
|
staleWriteDetail: () => staleWriteDetail,
|
|
107
108
|
supabaseDataSource: () => supabaseDataSource,
|
|
108
109
|
toAoa: () => toAoa
|
|
@@ -261,7 +262,7 @@ var err = (error) => ({ ok: false, error });
|
|
|
261
262
|
var ACTOR_VOCABULARY = ["user", "agent", "system"];
|
|
262
263
|
var RETIRED_ACTOR_WORDS = { "ai": "agent", "code": "system", "human": "user" };
|
|
263
264
|
var ABSENCE_REASONS = ["never asked", "none", "refused", "conflicting"];
|
|
264
|
-
var VALUE_ENVELOPE_KEYS = ["ver", "src", "actor", "on_behalf_of", "at", "absent", "alternates", "dated"];
|
|
265
|
+
var VALUE_ENVELOPE_KEYS = ["ver", "src", "actor", "on_behalf_of", "at", "absent", "alternates", "dated", "pinned"];
|
|
265
266
|
var VALUE_ALTERNATE_KEYS = ["value", "src", "rank"];
|
|
266
267
|
var STORAGE_MODES = ["light", "heavy"];
|
|
267
268
|
var RULE_USES = ["validate", "compute", "membership", "applicability"];
|
|
@@ -357,8 +358,19 @@ var STORE_DOORS = [
|
|
|
357
358
|
{ name: "bump_epoch", args: "p_entity_type text, p_entity_id uuid, p_organization_id uuid DEFAULT NULL::uuid", returns: "bigint", security: "definer" },
|
|
358
359
|
{ name: "cache_lookup", args: "p_container_type text, p_container_id uuid, p_item_type text, p_item_id uuid", returns: "permission_level", security: "definer" },
|
|
359
360
|
{ name: "caller_role", args: "", returns: "name", security: "invoker" },
|
|
361
|
+
{ name: "carry_unchanged_value_stamps", args: "p_old jsonb, p_new jsonb", returns: "jsonb", security: "invoker" },
|
|
360
362
|
{ name: "carrying_edges_in", args: "p_organization_id uuid", returns: "TABLE(container_type text, container_id uuid, item_type text, item_id uuid, conveys_max permission_level)", security: "definer" },
|
|
361
363
|
{ name: "carrying_edges_of", args: "p_item_type text, p_item_id uuid", returns: "TABLE(container_type text, container_id uuid, conveys_max permission_level)", security: "definer" },
|
|
364
|
+
{ name: "checklist_declare", args: "p_organization_id uuid, p_spec jsonb, p_template_id uuid DEFAULT NULL::uuid", returns: "jsonb", security: "definer" },
|
|
365
|
+
{ name: "checklist_refusal", args: "p_spec jsonb", returns: "text", security: "invoker" },
|
|
366
|
+
{ name: "checklist_run", args: "p_organization_id uuid, p_run_id uuid", returns: "TABLE(step_id uuid, step_order integer, ref text, title text, role text, assignee_name text, assignee_user_id uuid, due_on timestamp with time zone, due_state text, status text, finished boolean, requires text, requires_key text, requires_label text, requires_id uuid, evidence jsonb, blocked_by text[], may_complete boolean, refusal text)", security: "definer" },
|
|
367
|
+
{ name: "checklist_runs", args: "p_organization_id uuid, p_about_table_id uuid DEFAULT NULL::uuid, p_about_record_id uuid DEFAULT NULL::uuid, p_include_closed boolean DEFAULT true, p_limit integer DEFAULT 100", returns: "TABLE(run_id uuid, name text, template_id uuid, template text, about_record_id uuid, about text, about_table_id uuid, started_at timestamp with time zone, started_by uuid, origin text, step_count integer, done integer, overdue integer, next_step text, next_due timestamp with time zone, closed_at timestamp with time zone)", security: "definer" },
|
|
368
|
+
{ name: "checklist_start", args: "p_organization_id uuid, p_template_id uuid, p_about_record_id uuid DEFAULT NULL::uuid, p_roles jsonb DEFAULT '{}'::jsonb, p_starting_at timestamp with time zone DEFAULT NULL::timestamp with time zone", returns: "jsonb", security: "definer" },
|
|
369
|
+
{ name: "checklist_step_complete", args: "p_organization_id uuid, p_step_id uuid, p_evidence jsonb DEFAULT '{}'::jsonb", returns: "jsonb", security: "definer" },
|
|
370
|
+
{ name: "checklist_step_refusal", args: "p_organization_id uuid, p_step_id uuid", returns: "text", security: "definer" },
|
|
371
|
+
{ name: "checklist_steps_table", args: "p_organization_id uuid", returns: "uuid", security: "definer" },
|
|
372
|
+
{ name: "checklist_template_shape", args: "p_organization_id uuid, p_template_id uuid", returns: "jsonb", security: "definer" },
|
|
373
|
+
{ name: "checklist_templates", args: "p_organization_id uuid, p_about_table_id uuid DEFAULT NULL::uuid, p_limit integer DEFAULT 100", returns: "TABLE(template_id uuid, name text, about_table_id uuid, about_table text, steps integer, roles integer, trigger_kind text, trigger_status text, open_runs integer, total_runs integer, updated_at timestamp with time zone)", security: "definer" },
|
|
362
374
|
{ name: "choice_census", args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid", returns: "jsonb", security: "definer" },
|
|
363
375
|
{ name: "choice_field_map", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "invoker" },
|
|
364
376
|
{ name: "choice_filter_normalize", args: "p_map jsonb, p_filter jsonb", returns: "jsonb", security: "invoker" },
|
|
@@ -374,11 +386,19 @@ var STORE_DOORS = [
|
|
|
374
386
|
{ name: "choice_synonyms_in", args: "p_map jsonb, p_token text", returns: "text[]", security: "invoker" },
|
|
375
387
|
{ name: "choice_words", args: "p_field jsonb", returns: "text", security: "invoker" },
|
|
376
388
|
{ name: "client_write_grants", args: "", returns: "TABLE(role_name text, object_name text, privilege text)", security: "invoker" },
|
|
389
|
+
{ name: "comment_mention_deliver", args: "p_organization_id uuid, p_record_id uuid, p_table_id uuid, p_comment_id uuid, p_recipient uuid, p_author_name text, p_record_title text, p_body text", returns: "uuid", security: "definer" },
|
|
390
|
+
{ name: "comment_thread", args: "p_organization_id uuid, p_record_id uuid, p_include_resolved boolean DEFAULT false", returns: "jsonb", security: "definer" },
|
|
391
|
+
{ name: "comment_write", args: "p_organization_id uuid, p_record_id uuid, p_body text, p_anchor jsonb DEFAULT '{}'::jsonb, p_parent_comment_id uuid DEFAULT NULL::uuid, p_mentions uuid[] DEFAULT NULL::uuid[]", returns: "jsonb", security: "definer" },
|
|
377
392
|
{ name: "computed_provenance", args: "p_organization_id uuid, p_record_id uuid", returns: "TABLE(field_key text, field_id uuid, value jsonb, rule_id uuid, rule_version integer, computed_at timestamp with time zone)", security: "invoker" },
|
|
378
393
|
{ name: "containment_chain", args: "p_organization_id uuid, p_record_id uuid", returns: "TABLE(ancestor_id uuid, depth integer)", security: "invoker" },
|
|
379
394
|
{ name: "containment_depth_ceiling", args: "p_organization_id uuid DEFAULT NULL::uuid", returns: "integer", security: "invoker" },
|
|
380
395
|
{ name: "containment_edges", args: "p_organization_id uuid", returns: "TABLE(parent_id uuid, child_id uuid, via text)", security: "invoker" },
|
|
381
396
|
{ name: "containment_parent", args: "p_data jsonb", returns: "uuid", security: "invoker" },
|
|
397
|
+
{ name: "context_resolve", args: "p_organization_id uuid, p_bindings jsonb, p_scope_slug text DEFAULT 'scopes'::text", returns: "jsonb", security: "definer" },
|
|
398
|
+
{ name: "conversation_scope", args: "p_organization_id uuid, p_conversation_id uuid", returns: "jsonb", security: "definer" },
|
|
399
|
+
{ name: "conversation_scope_bind", args: "p_organization_id uuid, p_conversation_id uuid, p_record_id uuid", returns: "jsonb", security: "definer" },
|
|
400
|
+
{ name: "conversation_scope_context", args: "p_organization_id uuid, p_conversation_id uuid, p_relations integer DEFAULT 12, p_history integer DEFAULT 15, p_siblings integer DEFAULT 8", returns: "jsonb", security: "definer" },
|
|
401
|
+
{ name: "conversation_scope_unbind", args: "p_organization_id uuid, p_conversation_id uuid", returns: "jsonb", security: "definer" },
|
|
382
402
|
{ name: "cross_organization_links_open", args: "p_source_organization_id uuid, p_target_organization_id uuid", returns: "boolean", security: "invoker" },
|
|
383
403
|
{ name: "custom_fields_tables", args: "", returns: "TABLE(token text, schema_name text, table_name text)", security: "invoker" },
|
|
384
404
|
{ name: "dashboard_block_normalize", args: "p_organization_id uuid, p_subject_table_id uuid, p_block jsonb", returns: "jsonb", security: "definer" },
|
|
@@ -402,24 +422,43 @@ var STORE_DOORS = [
|
|
|
402
422
|
{ name: "derived_values", args: "p_organization_id uuid, p_record_id uuid", returns: "jsonb", security: "invoker" },
|
|
403
423
|
{ name: "doc_content_hash", args: "p_body text", returns: "text", security: "invoker" },
|
|
404
424
|
{ name: "doc_format_value", args: "p_field_data jsonb, p_value jsonb", returns: "text", security: "invoker" },
|
|
425
|
+
{ name: "doc_letterhead", args: "p_organization_id uuid", returns: "jsonb", security: "definer" },
|
|
426
|
+
{ name: "doc_name_token_pattern", args: "", returns: "text", security: "invoker" },
|
|
427
|
+
{ name: "doc_name_tokens", args: "p_body text", returns: "TABLE(ordinal integer, raw text)", security: "invoker" },
|
|
405
428
|
{ name: "doc_render_body", args: "p_organization_id uuid, p_template_id uuid, p_record_id uuid", returns: "text", security: "invoker" },
|
|
406
429
|
{ name: "doc_render_document", args: "p_organization_id uuid, p_template_id uuid, p_record_id uuid", returns: "uuid", security: "definer" },
|
|
407
430
|
{ name: "doc_render_read", args: "p_organization_id uuid, p_render_id uuid", returns: "jsonb", security: "definer" },
|
|
408
431
|
{ 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" },
|
|
432
|
+
{ name: "doc_renders", args: "p_organization_id uuid, p_record_id uuid", returns: "TABLE(render_id uuid, template_id uuid, record_id uuid, table_id uuid, template_version integer, body text, content_hash text, rendered_at timestamp with time zone)", security: "definer" },
|
|
409
433
|
{ name: "doc_sign", args: "p_organization_id uuid, p_render_id uuid, p_field_key text, p_signer_name text, p_signer_user_id uuid DEFAULT NULL::uuid", returns: "uuid", security: "definer" },
|
|
410
434
|
{ name: "doc_signature_field_ok", args: "p_field_data jsonb", returns: "boolean", security: "invoker" },
|
|
411
435
|
{ name: "doc_signature_intact", args: "p_organization_id uuid, p_signature_id uuid", returns: "jsonb", security: "invoker" },
|
|
412
436
|
{ name: "doc_signature_read", args: "p_organization_id uuid, p_signature_id uuid", returns: "jsonb", security: "definer" },
|
|
413
437
|
{ 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" },
|
|
438
|
+
{ name: "doc_signatures", args: "p_organization_id uuid, p_record_id uuid", returns: "TABLE(signature_id uuid, render_id uuid, record_id uuid, field_key text, signer_name text, signer_user_id uuid, signed_at timestamp with time zone, document_hash text, document_version integer)", security: "definer" },
|
|
439
|
+
{ name: "doc_template_delete", args: "p_organization_id uuid, p_template_id uuid", returns: "boolean", security: "definer" },
|
|
414
440
|
{ name: "doc_template_read", args: "p_organization_id uuid, p_template_id uuid", returns: "jsonb", security: "definer" },
|
|
415
441
|
{ 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" },
|
|
442
|
+
{ name: "doc_templates", args: "p_organization_id uuid, p_table_id uuid", returns: "TABLE(template_id uuid, renders_table_id uuid, name text, body text, template_version integer, token_count bigint, updated_at timestamp with time zone)", security: "definer" },
|
|
416
443
|
{ name: "doc_token_pattern", args: "", returns: "text", security: "invoker" },
|
|
417
444
|
{ name: "doc_tokens", args: "p_body text", returns: "TABLE(ordinal integer, raw text, field_id uuid)", security: "invoker" },
|
|
418
445
|
{ name: "doc_unresolved_tokens", args: "p_organization_id uuid, p_table_id uuid, p_body text", returns: "TABLE(raw text, field_id uuid, why text)", security: "invoker" },
|
|
419
446
|
{ name: "doors_not_deciding_the_caller", args: "", returns: "TABLE(function_name text, identity_args text)", security: "invoker" },
|
|
420
447
|
{ name: "doors_not_deciding_the_record", args: "", returns: "TABLE(function_name text, identity_args text, why text)", security: "invoker" },
|
|
448
|
+
{ name: "doors_not_masking_fields", args: "", returns: "TABLE(function_name text, identity_args text, why text)", security: "invoker" },
|
|
421
449
|
{ name: "doors_not_on_one_ladder", args: "", returns: "TABLE(function_name text, identity_args text, why text)", security: "invoker" },
|
|
422
450
|
{ 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" },
|
|
451
|
+
{ name: "enrich_cells", args: "p_organization_id uuid, p_table_id uuid, p_field_keys text[] DEFAULT NULL::text[], p_record_ids uuid[] DEFAULT NULL::uuid[]", returns: "TABLE(record_id uuid, field_key text, agent_owned boolean, value jsonb, value_version integer, actor text, on_behalf_of text, written_at timestamp with time zone, source jsonb, absent_reason text, alternates jsonb, pinned boolean, stale boolean, due_at timestamp with time zone)", security: "definer" },
|
|
452
|
+
{ name: "enrich_declare", args: "p_organization_id uuid, p_field_id uuid, p_spec jsonb", returns: "jsonb", security: "definer" },
|
|
453
|
+
{ name: "enrich_due", args: "p_organization_id uuid, p_field_id uuid, p_limit integer DEFAULT 50, p_include_fresh boolean DEFAULT false", returns: "TABLE(record_id uuid, title text, inputs jsonb, current_value jsonb, written_at timestamp with time zone, reason text, trimmed_to integer)", security: "definer" },
|
|
454
|
+
{ name: "enrich_land", args: "p_organization_id uuid, p_field_id uuid, p_results jsonb, p_run jsonb DEFAULT '{}'::jsonb", returns: "jsonb", security: "definer" },
|
|
455
|
+
{ name: "enrich_normalize", args: "p_organization_id uuid, p_table_id uuid, p_field_key text, p_spec jsonb", returns: "jsonb", security: "definer" },
|
|
456
|
+
{ name: "enrich_pin", args: "p_organization_id uuid, p_record_id uuid, p_field_key text, p_pinned boolean DEFAULT true", returns: "jsonb", security: "definer" },
|
|
457
|
+
{ name: "enrich_run_class", args: "", returns: "text", security: "invoker" },
|
|
458
|
+
{ name: "enrich_runs", args: "p_organization_id uuid, p_field_id uuid DEFAULT NULL::uuid, p_limit integer DEFAULT 50", returns: "TABLE(run_id uuid, field_id uuid, field_key text, model text, trigger_word text, rows_seen integer, rows_written integer, rows_absent integer, rows_below_floor integer, rows_pinned integer, rows_refused integer, cost_cents numeric, cost_per_row_cents numeric, ran_at timestamp with time zone)", security: "definer" },
|
|
459
|
+
{ name: "enrich_sensitivity_rank", args: "p_word text", returns: "integer", security: "invoker" },
|
|
460
|
+
{ name: "enrich_triggers", args: "", returns: "text[]", security: "invoker" },
|
|
461
|
+
{ name: "enrichments", args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid", returns: "TABLE(field_id uuid, table_id uuid, field_key text, label text, enrichment jsonb, enabled boolean, review_interval_days integer, rows_total integer, rows_filled integer, rows_stale integer, rows_pinned integer, rows_absent integer, runs integer, cost_cents numeric, cost_per_row_cents numeric, last_run_at timestamp with time zone, last_run jsonb)", security: "definer" },
|
|
423
462
|
{ name: "entity_field_declare", args: "p_organization_id uuid, p_token text, p_spec jsonb", returns: "uuid", security: "definer" },
|
|
424
463
|
{ name: "entity_field_retire", args: "p_organization_id uuid, p_field_id uuid", returns: "uuid", security: "definer" },
|
|
425
464
|
{ name: "entity_field_rights", args: "p_organization_id uuid, p_token text", returns: "jsonb", security: "definer" },
|
|
@@ -441,6 +480,7 @@ var STORE_DOORS = [
|
|
|
441
480
|
{ name: "field_behaviour", args: "p_field_data jsonb", returns: "text", security: "invoker" },
|
|
442
481
|
{ name: "field_declare", args: "p_organization_id uuid, p_table_id uuid, p_spec jsonb", returns: "uuid", security: "definer" },
|
|
443
482
|
{ name: "field_dependants", args: "p_organization_id uuid, p_field_id uuid", returns: "TABLE(kind text, dependant_id uuid, label text, how text)", security: "definer" },
|
|
483
|
+
{ name: "field_history", args: "p_organization_id uuid, p_table_id uuid, p_field_key text, p_limit integer DEFAULT 100, p_offset integer DEFAULT 0, p_record_id uuid DEFAULT NULL::uuid", returns: "TABLE(record_id uuid, record_title text, version integer, occurred_at timestamp with time zone, operation_label text, actor jsonb, before jsonb, after jsonb)", security: "definer" },
|
|
444
484
|
{ name: "field_kernel_id", args: "", returns: "uuid", security: "invoker" },
|
|
445
485
|
{ name: "field_options", args: "p_organization_id uuid, p_field_id uuid", returns: "SETOF custom.record", security: "definer" },
|
|
446
486
|
{ name: "field_retire", args: "p_organization_id uuid, p_field_id uuid", returns: "boolean", security: "definer" },
|
|
@@ -459,14 +499,26 @@ var STORE_DOORS = [
|
|
|
459
499
|
{ name: "has_visibility", args: "p_user_id uuid, p_type text, p_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level", returns: "boolean", security: "definer" },
|
|
460
500
|
{ name: "has_visibility_at", args: "p_user_id uuid, p_type text, p_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level, p_organization_id uuid DEFAULT NULL::uuid, p_min_version bigint DEFAULT NULL::bigint", returns: "boolean", security: "definer" },
|
|
461
501
|
{ name: "hidden_field_notice", args: "p_field custom.record, p_action text DEFAULT 'read'::text", returns: "jsonb", security: "invoker" },
|
|
502
|
+
{ name: "history_actor", args: "p_tier text, p_document jsonb, p_actor_id uuid, p_people jsonb", returns: "jsonb", security: "invoker" },
|
|
503
|
+
{ name: "history_changes", args: "p_organization_id uuid, p_table_id uuid, p_old jsonb, p_new jsonb", returns: "jsonb", security: "invoker" },
|
|
504
|
+
{ name: "history_people", args: "p_organization_id uuid, p_ids uuid[]", returns: "jsonb", security: "definer" },
|
|
462
505
|
{ name: "history_prune", args: "p_organization_id uuid, p_scope text DEFAULT 'values'::text, p_table_id uuid DEFAULT NULL::uuid, p_dry_run boolean DEFAULT true", returns: "jsonb", security: "definer" },
|
|
506
|
+
{ name: "history_restore_body", args: "p_current jsonb, p_target jsonb, p_field_key text DEFAULT NULL::text", returns: "jsonb", security: "invoker" },
|
|
507
|
+
{ name: "history_restore_body", args: "p_current jsonb, p_target jsonb, p_field_key text, p_author jsonb", returns: "jsonb", security: "invoker" },
|
|
463
508
|
{ name: "history_retention", args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid", returns: "jsonb", security: "definer" },
|
|
464
509
|
{ name: "history_retention_floor_raise", args: "p_organization_id uuid, p_days integer", returns: "integer", security: "definer" },
|
|
465
510
|
{ name: "history_retention_set", args: "p_organization_id uuid, p_table_id uuid, p_days integer", returns: "integer", security: "definer" },
|
|
466
511
|
{ name: "home_add", args: "p_organization_id uuid, p_table_id uuid, p_home_record_id uuid", returns: "uuid", security: "definer" },
|
|
467
512
|
{ name: "home_relations", args: "", returns: "TABLE(table_id uuid, home_record_id uuid, organization_id uuid, relation_id uuid)", security: "invoker" },
|
|
513
|
+
{ name: "inbound_addresses", args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid", returns: "jsonb", security: "definer" },
|
|
514
|
+
{ name: "inbound_declare", args: "p_organization_id uuid, p_table_id uuid, p_label text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
515
|
+
{ name: "inbound_domain", args: "p_organization_id uuid", returns: "text", security: "invoker" },
|
|
516
|
+
{ name: "inbound_mail_land", args: "p_address text, p_mail jsonb, p_secret text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
517
|
+
{ name: "inbound_mail_map", args: "p_organization_id uuid, p_table_id uuid, p_mail jsonb", returns: "jsonb", security: "invoker" },
|
|
518
|
+
{ name: "inbound_set", args: "p_organization_id uuid, p_inbound_id uuid, p_enabled boolean", returns: "jsonb", security: "definer" },
|
|
468
519
|
{ name: "index_payload", args: "p_organization_id uuid, p_table_id uuid, p_limit integer DEFAULT 1000", returns: "TABLE(id uuid, searchable text)", security: "invoker" },
|
|
469
520
|
{ name: "intern_provenance", args: "p_data jsonb", returns: "jsonb", security: "invoker" },
|
|
521
|
+
{ name: "io_cell", args: "p_organization_id uuid, p_field jsonb, p_word text, p_date_order text DEFAULT 'mdy'::text", returns: "jsonb", security: "invoker" },
|
|
470
522
|
{ name: "io_changed_field_ids", args: "p_organization_id uuid, p_table_id uuid, p_old jsonb, p_new jsonb", returns: "jsonb", security: "invoker" },
|
|
471
523
|
{ name: "io_changed_keys", args: "p_old jsonb, p_new jsonb", returns: "text[]", security: "invoker" },
|
|
472
524
|
{ name: "io_comment_resolve", args: "p_organization_id uuid, p_comment_id uuid, p_resolved boolean DEFAULT true", returns: "boolean", security: "definer" },
|
|
@@ -476,23 +528,38 @@ var STORE_DOORS = [
|
|
|
476
528
|
{ name: "io_csv_parse", args: "p_text text, p_delimiter text DEFAULT NULL::text", returns: "TABLE(row_number integer, cells text[])", security: "invoker" },
|
|
477
529
|
{ name: "io_export", args: "p_organization_id uuid, p_table_id uuid, p_columns text[] DEFAULT NULL::text[], p_limit integer DEFAULT 10000, p_required text DEFAULT 'viewer'::text", returns: "jsonb", security: "definer" },
|
|
478
530
|
{ name: "io_export_csv", args: "p_organization_id uuid, p_table_id uuid, p_columns text[] DEFAULT NULL::text[], p_limit integer DEFAULT 10000, p_delimiter text DEFAULT chr(44), p_required text DEFAULT 'viewer'::text", returns: "text", security: "definer" },
|
|
531
|
+
{ name: "io_import_begin", args: "p_organization_id uuid, p_table_id uuid, p_format text DEFAULT 'csv'::text, p_source_name text DEFAULT NULL::text, p_source_columns jsonb DEFAULT '[]'::jsonb, p_file_hash text DEFAULT NULL::text, p_policy jsonb DEFAULT '{}'::jsonb, p_dedupe_key text DEFAULT NULL::text, p_file_bytes bigint DEFAULT NULL::bigint, p_force boolean DEFAULT false", returns: "jsonb", security: "definer" },
|
|
532
|
+
{ name: "io_import_finish", args: "p_organization_id uuid, p_import_id uuid, p_unmapped text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
533
|
+
{ name: "io_import_forget", args: "p_organization_id uuid, p_import_id uuid", returns: "boolean", security: "definer" },
|
|
479
534
|
{ name: "io_import_open", args: "p_organization_id uuid, p_table_id uuid, p_format text DEFAULT 'csv'::text, p_source_name text DEFAULT NULL::text, p_source_columns jsonb DEFAULT '[]'::jsonb", returns: "uuid", security: "definer" },
|
|
535
|
+
{ name: "io_import_plan", args: "p_organization_id uuid, p_table_id uuid, p_columns jsonb DEFAULT '[]'::jsonb", returns: "jsonb", security: "definer" },
|
|
536
|
+
{ name: "io_import_report", args: "p_organization_id uuid, p_import_id uuid, p_state text DEFAULT NULL::text, p_limit integer DEFAULT 100, p_offset integer DEFAULT 0", returns: "jsonb", security: "definer" },
|
|
480
537
|
{ name: "io_import_rows", args: "p_organization_id uuid, p_import_id uuid, p_rows jsonb, p_mapping jsonb DEFAULT '{}'::jsonb", returns: "jsonb", security: "definer" },
|
|
538
|
+
{ name: "io_imports", args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid, p_limit integer DEFAULT 25", returns: "jsonb", security: "definer" },
|
|
539
|
+
{ name: "io_infer_column", args: "p_organization_id uuid, p_table_id uuid, p_header text, p_samples jsonb DEFAULT '[]'::jsonb", returns: "jsonb", security: "definer" },
|
|
481
540
|
{ name: "io_infer_type", args: "p_samples jsonb", returns: "text", security: "invoker" },
|
|
541
|
+
{ name: "io_money_unit", args: "p_word text", returns: "text", security: "invoker" },
|
|
482
542
|
{ name: "io_outbox_announce", args: "", returns: "trigger", security: "definer" },
|
|
483
543
|
{ name: "io_outbox_drain", args: "p_organization_id uuid, p_consumer text, p_limit integer DEFAULT 100, p_event_key text DEFAULT 'records.changed'::text", returns: "TABLE(outbox_id uuid, record_id uuid, table_id uuid, operation text, changed_field_ids jsonb, actor jsonb, occurred_at timestamp with time zone)", security: "definer" },
|
|
484
544
|
{ name: "io_outbox_release", args: "p_organization_id uuid, p_consumer text, p_older_than interval DEFAULT '00:15:00'::interval", returns: "integer", security: "definer" },
|
|
485
545
|
{ name: "io_proposal_accept", args: "p_organization_id uuid, p_import_id uuid, p_column text, p_type text DEFAULT NULL::text, p_label text DEFAULT NULL::text", returns: "uuid", security: "definer" },
|
|
486
546
|
{ name: "io_proposal_reject", args: "p_organization_id uuid, p_import_id uuid, p_column text", returns: "boolean", security: "definer" },
|
|
547
|
+
{ name: "io_proposal_spec", args: "p_proposal jsonb", returns: "jsonb", security: "invoker" },
|
|
487
548
|
{ name: "io_record_changed", args: "", returns: "trigger", security: "definer" },
|
|
549
|
+
{ name: "io_relation_candidate", args: "p_organization_id uuid, p_table_id uuid, p_words text[]", returns: "uuid", security: "invoker" },
|
|
488
550
|
{ name: "io_restore", args: "p_organization_id uuid, p_record_id uuid, p_version integer", returns: "integer", security: "definer" },
|
|
551
|
+
{ name: "io_restore", args: "p_organization_id uuid, p_record_id uuid, p_version integer, p_author jsonb", returns: "integer", security: "definer" },
|
|
489
552
|
{ name: "io_revisions", args: "p_organization_id uuid, p_record_id uuid", returns: "TABLE(version integer, changed_at timestamp with time zone, changed_by uuid, summary text, operation text, changed_fields jsonb)", security: "definer" },
|
|
553
|
+
{ name: "io_sample_words", args: "p_samples jsonb", returns: "TABLE(word text)", security: "invoker" },
|
|
554
|
+
{ name: "io_value_shape", args: "p_envelope jsonb", returns: "jsonb", security: "invoker" },
|
|
490
555
|
{ name: "is_a_retirement", args: "p_old_deleted timestamp with time zone, p_new_deleted timestamp with time zone, p_old_data jsonb, p_new_data jsonb, p_old_table uuid, p_new_table uuid, p_old_org uuid, p_new_org uuid, p_old_class text, p_new_class text", returns: "boolean", security: "invoker" },
|
|
556
|
+
{ name: "ladder_replanners", args: "p_roots text[] DEFAULT ARRAY['custom.has_visibility'::text, 'custom.effective_level'::text, 'custom.reaches_directly'::text, 'custom.visible_set'::text]", returns: "TABLE(fn text, lang text, why text, remedy text)", security: "definer" },
|
|
491
557
|
{ name: "list_door_disagreements", args: "p_pretend text DEFAULT NULL::text, p_only_organization uuid DEFAULT NULL::uuid, p_sample integer DEFAULT 200", returns: "TABLE(organization_id uuid, organization_name text, member_id uuid, table_id uuid, record_id uuid, door text, why text)", security: "invoker" },
|
|
492
558
|
{ name: "list_door_disagreements", args: "p_pretend text, p_only_organization uuid, p_sample integer, p_exhaustive boolean", returns: "TABLE(organization_id uuid, organization_name text, member_id uuid, table_id uuid, record_id uuid, door text, why text)", security: "invoker" },
|
|
493
559
|
{ name: "lookup_value", args: "p_organization_id uuid, p_record_id uuid, p_field_data jsonb", returns: "jsonb", security: "invoker" },
|
|
494
560
|
{ name: "mask_document", args: "p_document jsonb, p_visible_keys text[], p_notices jsonb, p_by_id boolean DEFAULT false, p_key_ids jsonb DEFAULT '{}'::jsonb", returns: "jsonb", security: "invoker" },
|
|
495
561
|
{ name: "mask_document", args: "p_document jsonb, p_visible_keys text[], p_notices jsonb, p_by_id boolean DEFAULT false, p_key_ids jsonb DEFAULT '{}'::jsonb, p_declared_keys text[] DEFAULT NULL::text[]", returns: "jsonb", security: "invoker" },
|
|
562
|
+
{ name: "mask_says_withheld", args: "p_mask jsonb, p_key text", returns: "boolean", security: "invoker" },
|
|
496
563
|
{ name: "merge_field_kernel_id", args: "", returns: "uuid", security: "invoker" },
|
|
497
564
|
{ name: "migrate_choice_keys", args: "p_organization_id uuid, p_table_id uuid, p_dry_run boolean DEFAULT false", returns: "jsonb", security: "definer" },
|
|
498
565
|
{ name: "migrate_delete", args: "p_organization_id uuid, p_record_id uuid, p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
@@ -508,6 +575,7 @@ var STORE_DOORS = [
|
|
|
508
575
|
{ name: "migrate_split", args: "p_organization_id uuid, p_record_id uuid, p_moved_keys text[], p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
509
576
|
{ name: "migrate_undo", args: "p_organization_id uuid, p_log_id uuid", returns: "jsonb", security: "definer" },
|
|
510
577
|
{ 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" },
|
|
578
|
+
{ name: "mirror_asks_the_whole_database", args: "", returns: "TABLE(schema_name text, table_name text, policy_name text, why text)", security: "invoker" },
|
|
511
579
|
{ name: "my_level", args: "p_organization_id uuid, p_id uuid, p_type text DEFAULT 'record'::text", returns: "permission_level", security: "definer" },
|
|
512
580
|
{ 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" },
|
|
513
581
|
{ name: "organization_clear", args: "p_organization_id uuid, p_confirm text, p_and_destroy boolean DEFAULT false", returns: "jsonb", security: "definer" },
|
|
@@ -521,6 +589,7 @@ var STORE_DOORS = [
|
|
|
521
589
|
{ name: "parity_values", args: "p_organization_id uuid, p_record_id uuid", returns: "TABLE(field_key text, field_id uuid, parity_type text, behavior text, unit text, format text, value jsonb, value_version integer, actor text, written_at timestamp with time zone)", security: "invoker" },
|
|
522
590
|
{ name: "per_value_access_words", args: "", returns: "text[]", security: "invoker" },
|
|
523
591
|
{ name: "person_kernel_id", args: "", returns: "uuid", security: "invoker" },
|
|
592
|
+
{ name: "pin_agent_cells", args: "p_new jsonb, p_old jsonb, p_agent_keys text[]", returns: "jsonb", security: "invoker" },
|
|
524
593
|
{ name: "portal_admits", args: "p_organization_id uuid, p_user_id uuid DEFAULT NULL::uuid", returns: "boolean", security: "definer" },
|
|
525
594
|
{ name: "portal_card", args: "p_organization_id uuid, p_portal_id uuid", returns: "jsonb", security: "definer" },
|
|
526
595
|
{ name: "portal_declare", 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", returns: "uuid", security: "definer" },
|
|
@@ -571,6 +640,7 @@ var STORE_DOORS = [
|
|
|
571
640
|
{ name: "read_door_granted_ids", args: "p_organization_id uuid, p_table_id uuid", returns: "uuid[]", security: "definer" },
|
|
572
641
|
{ name: "read_door_ladder_ceiling", args: "", returns: "integer", security: "invoker" },
|
|
573
642
|
{ name: "read_door_parity", args: "p_organization_id uuid, p_table_id uuid, p_user uuid, p_required permission_level, p_sample integer", returns: "TABLE(record_id uuid, set_based boolean, per_row boolean, verdict text)", security: "definer" },
|
|
643
|
+
{ name: "read_mask", args: "p_organization_id uuid, p_record_id uuid, p_action text DEFAULT 'read'::text", returns: "jsonb", security: "definer" },
|
|
574
644
|
{ name: "read_paths_outside_the_door", args: "", returns: "TABLE(object_name text, why text)", security: "invoker" },
|
|
575
645
|
{ name: "read_record", args: "p_organization_id uuid, p_record_id uuid, p_by_id boolean DEFAULT false", returns: "jsonb", security: "definer" },
|
|
576
646
|
{ name: "read_records", args: "p_organization_id uuid, p_table_id uuid, p_by_id boolean DEFAULT false, p_limit integer DEFAULT 200, p_offset integer DEFAULT 0", returns: "TABLE(id uuid, document jsonb, level permission_level)", security: "definer" },
|
|
@@ -580,10 +650,15 @@ var STORE_DOORS = [
|
|
|
580
650
|
{ name: "record_card", args: "p_viewer uuid, p_organization_id uuid, p_record_id uuid", returns: "jsonb", security: "definer" },
|
|
581
651
|
{ name: "record_carrying_edges", args: "p_id uuid, p_data_class text, p_data jsonb, p_deleted_at timestamp with time zone", returns: "TABLE(container_id uuid, item_id uuid, edge_role text)", security: "invoker" },
|
|
582
652
|
{ name: "record_delete", args: "p_organization_id uuid, p_record_id uuid", returns: "timestamp with time zone", security: "definer" },
|
|
653
|
+
{ name: "record_history", args: "p_organization_id uuid, p_record_id uuid, p_limit integer DEFAULT 200, p_offset integer DEFAULT 0", returns: "TABLE(version integer, occurred_at timestamp with time zone, operation text, operation_label text, actor jsonb, changes jsonb, migration_id uuid, undoable boolean)", security: "definer" },
|
|
583
654
|
{ name: "record_relation_edges", args: "p_organization_id uuid, p_id uuid, p_table_id uuid, p_data_class text, p_data jsonb, p_deleted_at timestamp with time zone", returns: "TABLE(target_id uuid, edge_role text, field_id uuid, ord integer)", security: "invoker" },
|
|
584
655
|
{ name: "record_reparent", args: "p_organization_id uuid, p_record_id uuid, p_parent_id uuid", returns: "void", security: "definer" },
|
|
585
656
|
{ name: "record_resolve", args: "p_organization_id uuid, p_id uuid", returns: "jsonb", security: "definer" },
|
|
586
657
|
{ name: "record_restore", args: "p_organization_id uuid, p_record_id uuid", returns: "void", security: "definer" },
|
|
658
|
+
{ name: "record_restore_preview", args: "p_organization_id uuid, p_record_id uuid, p_version integer, p_field_key text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
659
|
+
{ name: "record_restore_version", args: "p_organization_id uuid, p_record_id uuid, p_version integer", returns: "jsonb", security: "definer" },
|
|
660
|
+
{ name: "record_restore_version", args: "p_organization_id uuid, p_record_id uuid, p_version integer, p_author jsonb", returns: "jsonb", security: "definer" },
|
|
661
|
+
{ name: "record_scope_context", args: "p_organization_id uuid, p_record_id uuid, p_relations integer DEFAULT 12, p_history integer DEFAULT 15, p_siblings integer DEFAULT 8", returns: "jsonb", security: "definer" },
|
|
587
662
|
{ name: "record_state_as_of", args: "p_record_id uuid, p_at timestamp with time zone", returns: "TABLE(state jsonb, replayed boolean)", security: "definer" },
|
|
588
663
|
{ name: "record_table", args: "p_organization_id uuid, p_record_id uuid", returns: "uuid", security: "definer" },
|
|
589
664
|
{ name: "record_update", args: "p_organization_id uuid, p_record_id uuid, p_patch jsonb, p_expected_version integer DEFAULT NULL::integer", returns: "integer", security: "definer" },
|
|
@@ -630,12 +705,25 @@ var STORE_DOORS = [
|
|
|
630
705
|
{ name: "share_revoke", args: "p_organization_id uuid, p_subject_id uuid, p_principal_kind text, p_principal_id uuid", returns: "jsonb", security: "definer" },
|
|
631
706
|
{ name: "share_subject_name", args: "p_organization_id uuid, p_type text, p_id uuid", returns: "text", security: "definer" },
|
|
632
707
|
{ name: "shared_only_disagreements", args: "p_pretend text DEFAULT NULL::text", returns: "TABLE(organization_id uuid, organization_name text, member_id uuid, record_id uuid, table_id uuid, ladder boolean, read_door boolean, rls_mirror boolean, why text)", security: "invoker" },
|
|
708
|
+
{ name: "sign_request_cancel", args: "p_organization_id uuid, p_request_id uuid, p_reason text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
709
|
+
{ name: "sign_request_create", args: "p_organization_id uuid, p_render_id uuid, p_field_key text, p_signer_email text, p_signer_name text, p_expires_in interval DEFAULT '14 days'::interval", returns: "jsonb", security: "definer" },
|
|
710
|
+
{ name: "sign_request_decline", args: "p_token text, p_reason text DEFAULT NULL::text, p_ip text DEFAULT NULL::text, p_user_agent text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
711
|
+
{ name: "sign_request_public", args: "p_token text, p_origin text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
712
|
+
{ name: "sign_request_remind", args: "p_organization_id uuid, p_request_id uuid", returns: "jsonb", security: "definer" },
|
|
713
|
+
{ name: "sign_request_sentence", args: "p_data jsonb", returns: "text", security: "invoker" },
|
|
714
|
+
{ name: "sign_request_sign", args: "p_token text, p_signed_name text, p_mark text, p_image text DEFAULT NULL::text, p_ip text DEFAULT NULL::text, p_user_agent text DEFAULT NULL::text, p_origin text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
715
|
+
{ name: "sign_request_state", args: "p_data jsonb", returns: "text", security: "invoker" },
|
|
716
|
+
{ name: "sign_request_unchanged", args: "p_organization_id uuid, p_request_id uuid", returns: "boolean", security: "definer" },
|
|
717
|
+
{ name: "sign_requests", args: "p_organization_id uuid, p_record_id uuid", returns: "TABLE(request_id uuid, render_id uuid, record_id uuid, field_key text, document_title text, signer_name text, signer_email text, signer_has_account boolean, state text, sentence text, document_version integer, document_hash text, sent_at timestamp with time zone, expires_at timestamp with time zone, viewed_at timestamp with time zone, signed_at timestamp with time zone, declined_at timestamp with time zone, invalidated_at timestamp with time zone, signature_id uuid, signature_mark text, reminder_count integer)", security: "definer" },
|
|
718
|
+
{ name: "sign_token_decode", args: "p_token text", returns: "bytea", security: "invoker" },
|
|
719
|
+
{ name: "sign_token_encode", args: "p_bytes bytea", returns: "text", security: "invoker" },
|
|
633
720
|
{ name: "size_refusal", args: "p_organization_id uuid, p_data jsonb", returns: "text", security: "invoker" },
|
|
634
721
|
{ name: "source_next_pointer", args: "p_sources jsonb", returns: "text", security: "invoker" },
|
|
635
722
|
{ name: "source_pointer", args: "p_sources jsonb, p_source jsonb", returns: "text", security: "invoker" },
|
|
636
723
|
{ name: "stamp_value_envelopes", args: "p_data jsonb, p_actor text, p_on_behalf_of text, p_at timestamp with time zone", returns: "jsonb", security: "invoker" },
|
|
637
724
|
{ name: "storage_modes", args: "", returns: "text[]", security: "invoker" },
|
|
638
725
|
{ name: "store_is_open", args: "p_organization_id uuid DEFAULT NULL::uuid", returns: "boolean", security: "invoker" },
|
|
726
|
+
{ name: "subscription_cadences", args: "p_organization_id uuid", returns: "text[]", security: "definer" },
|
|
639
727
|
{ name: "subscription_mute", args: "p_organization_id uuid, p_rule_id uuid, p_muted boolean DEFAULT true", returns: "boolean", security: "definer" },
|
|
640
728
|
{ name: "subscriptions", args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid", returns: "TABLE(rule_id uuid, name text, table_id uuid, saved_view_id uuid, cadence text, schedule text, channel text, recipient_user_id uuid, event_key text, muted boolean, mine boolean, i_may_mute boolean)", security: "definer" },
|
|
641
729
|
{ name: "table_capacity", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "definer" },
|
|
@@ -661,6 +749,8 @@ var STORE_DOORS = [
|
|
|
661
749
|
{ name: "value_envelope_ok", args: "p_data jsonb", returns: "boolean", security: "invoker" },
|
|
662
750
|
{ name: "value_envelope_refusal", args: "p_data jsonb", returns: "text", security: "invoker" },
|
|
663
751
|
{ name: "value_read", args: "p_organization_id uuid, p_record_id uuid, p_key text", returns: "TABLE(field_key text, field_id uuid, value jsonb, value_version integer, source jsonb, absent_reason text, actor text, on_behalf_of text, written_at timestamp with time zone, alternates jsonb)", security: "definer" },
|
|
752
|
+
{ name: "value_restore", args: "p_organization_id uuid, p_record_id uuid, p_field_key text, p_version integer", returns: "jsonb", security: "definer" },
|
|
753
|
+
{ name: "value_restore", args: "p_organization_id uuid, p_record_id uuid, p_field_key text, p_version integer, p_author jsonb", returns: "jsonb", security: "definer" },
|
|
664
754
|
{ name: "value_versions", args: "p_old jsonb, p_new jsonb", returns: "jsonb", security: "invoker" },
|
|
665
755
|
{ name: "visibility_ancestors", args: "p_item_type text, p_item_id uuid", returns: "TABLE(container_type text, container_id uuid, depth integer, max_level permission_level)", security: "definer" },
|
|
666
756
|
{ name: "visibility_as_of", args: "p_organization_id uuid, p_record_id uuid, p_at timestamp with time zone", returns: "TABLE(principal_kind text, principal_id uuid, level permission_level, through_kind text, through_id uuid, reason text, replayed boolean, held_from timestamp with time zone, held_to timestamp with time zone)", security: "definer" },
|
|
@@ -671,6 +761,8 @@ var STORE_DOORS = [
|
|
|
671
761
|
{ name: "visible_record_ids", args: "p_user_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level", returns: "TABLE(id uuid)", security: "definer" },
|
|
672
762
|
{ 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" },
|
|
673
763
|
{ name: "widget_kernel_id", args: "", returns: "uuid", security: "invoker" },
|
|
764
|
+
{ name: "withheld_marker", args: "p_mask jsonb, p_key text", returns: "jsonb", security: "invoker" },
|
|
765
|
+
{ name: "withheld_sentence", args: "p_mask jsonb, p_key text", returns: "text", security: "invoker" },
|
|
674
766
|
{ 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" },
|
|
675
767
|
{ 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" },
|
|
676
768
|
{ name: "work_approval_kinds", args: "", returns: "text[]", security: "invoker" },
|
|
@@ -711,6 +803,7 @@ var STORE_KNOBS = [
|
|
|
711
803
|
{ key: "code_paths_enabled", value: "false", type: "boolean" },
|
|
712
804
|
{ key: "consumer_chat_seeding_enabled", value: "false", type: "boolean" },
|
|
713
805
|
{ key: "consumer_checkout_enabled", value: "false", type: "boolean" },
|
|
806
|
+
{ key: "consumer_context_enabled", value: "false", type: "boolean" },
|
|
714
807
|
{ key: "consumer_education_enabled", value: "false", type: "boolean" },
|
|
715
808
|
{ key: "consumer_extension_enabled", value: "false", type: "boolean" },
|
|
716
809
|
{ key: "consumer_grid_enabled", value: "false", type: "boolean" },
|
|
@@ -719,14 +812,21 @@ var STORE_KNOBS = [
|
|
|
719
812
|
{ key: "consumer_scopes_enabled", value: "false", type: "boolean" },
|
|
720
813
|
{ key: "containment_depth_ceiling", value: "16", type: "integer" },
|
|
721
814
|
{ key: "cross_organization_links", value: "false", type: "boolean" },
|
|
815
|
+
{ key: "document_letterhead", value: "{}", type: "json" },
|
|
722
816
|
{ key: "document_max_bytes", value: "1048576", type: "integer" },
|
|
723
817
|
{ key: "emergency_door_guard", value: "false", type: "boolean" },
|
|
724
818
|
{ key: "emergency_door_sweep_enabled", value: "false", type: "boolean" },
|
|
819
|
+
{ key: "enrichment_batch_ceiling", value: "200", type: "integer" },
|
|
820
|
+
{ key: "enrichment_confidence_floor", value: "0.6", type: "number" },
|
|
821
|
+
{ key: "enrichment_cost_cap_cents", value: "2000", type: "integer" },
|
|
822
|
+
{ key: "enrichment_model", value: '"claude-fable-5-latest"', type: "string" },
|
|
823
|
+
{ key: "enrichment_sensitivity_ceiling", value: '"internal"', type: "string" },
|
|
725
824
|
{ key: "entity_custom_fields_guard", value: "false", type: "boolean" },
|
|
726
825
|
{ key: "entity_types_guard", value: "false", type: "boolean" },
|
|
727
826
|
{ key: "external_principal_enabled", value: "false", type: "boolean" },
|
|
728
827
|
{ key: "field_index_guard", value: "false", type: "boolean" },
|
|
729
828
|
{ key: "field_sensitivity_levels", value: '{"edit": {"public": "editor", "internal": "editor", "restricted": "admin", "confidential": "admin"}, "read": {"public": "viewer", "internal": "viewer", "restricted": "admin", "confidential": "editor"}}', type: "json" },
|
|
829
|
+
{ key: "inbound_domain", value: '"inbound.matrxserver.com"', type: "string" },
|
|
730
830
|
{ key: "member_default_level", value: '"viewer"', type: "enum" },
|
|
731
831
|
{ key: "member_default_visibility", value: '"all_records"', type: "enum" },
|
|
732
832
|
{ key: "records_tool_default", value: "true", type: "boolean" },
|
|
@@ -742,19 +842,20 @@ var STORE_KNOBS = [
|
|
|
742
842
|
{ key: "world_publish_enabled", value: "false", type: "boolean" }
|
|
743
843
|
];
|
|
744
844
|
var STORE_REFUSAL_CODES = [
|
|
745
|
-
{ code: "02000", raised_by: "dashboard_delete,dashboard_run,doc_render_body,doc_render_document,doc_render_read,doc_sign,doc_signature_intact,doc_signature_read,doc_template_read,doc_template_save,entity_field_retire,entity_field_update,entity_record_read,entity_value_write,external_history_event,external_rows,external_stub_upsert,external_writes_set,migrate_delete,migrate_extract_parent,migrate_merge,migrate_reclass,migrate_rename,migrate_reparent,migrate_retype,migrate_split,migrate_undo,organization_clear,portal_card,portal_declare,portal_invite,portal_preview,portal_principal_bind,portal_revoke,read_record,record_delete,record_restore,record_table,record_update,relation_uncarry,share_access,share_grant,share_lane_set,share_people,share_revoke,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_assign,work_record_states,work_set_state" },
|
|
746
|
-
{ code: "0A000", raised_by: "external_rows,external_source_declare,external_write_through,promote_field,promoted_index_expr,promoted_query_sql,promoted_read,rule_eval,work_assign" },
|
|
747
|
-
{ code: "
|
|
845
|
+
{ code: "02000", raised_by: "_checklist_instantiate,checklist_declare,checklist_run,checklist_step_complete,checklist_step_refusal,checklist_template_shape,conversation_scope_bind,dashboard_delete,dashboard_run,doc_letterhead,doc_render_body,doc_render_document,doc_render_read,doc_sign,doc_signature_intact,doc_signature_read,doc_template_delete,doc_template_read,doc_template_save,enrich_pin,entity_field_retire,entity_field_update,entity_record_read,entity_value_write,external_history_event,external_rows,external_stub_upsert,external_writes_set,io_restore,migrate_delete,migrate_extract_parent,migrate_merge,migrate_reclass,migrate_rename,migrate_reparent,migrate_retype,migrate_split,migrate_undo,organization_clear,portal_card,portal_declare,portal_invite,portal_preview,portal_principal_bind,portal_revoke,read_record,record_delete,record_restore,record_restore_preview,record_table,record_update,relation_uncarry,share_access,share_grant,share_lane_set,share_people,share_revoke,sign_request_cancel,sign_request_create,sign_request_remind,sign_request_unchanged,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_assign,work_record_states,work_set_state" },
|
|
846
|
+
{ code: "0A000", raised_by: "checklist_step_complete,external_rows,external_source_declare,external_write_through,promote_field,promoted_index_expr,promoted_query_sql,promoted_read,rule_eval,work_assign" },
|
|
847
|
+
{ code: "22003", raised_by: "context_resolve" },
|
|
848
|
+
{ 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,checklist_declare,context_resolve,dashboard_block_normalize,dashboard_declare,dashboard_window_sql,doc_render_write,doc_sign,doc_signature_write,doc_template_save,enrich_land,enrich_normalize,external_history_event,external_rows,external_source_declare,external_stub_upsert,external_write_through,external_writes_set,field_history,form_declare,form_submit,home_add,io_comment_write,io_import_begin,io_infer_column,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,sign_request_create,sign_request_sign,table_declare,value_restore,work_approval_decide,work_approval_request,work_template_declare" },
|
|
748
849
|
{ code: "22007", raised_by: "dashboard_window_sql" },
|
|
749
850
|
{ code: "22012", raised_by: "rule_eval" },
|
|
750
|
-
{ code: "22023", raised_by: "_entity_custom_fields_guard,_value_envelope,_work_shape_guard,actor_word,agg_assert_key,agg_sql,anon_token_issue,containment_parent,dashboard_block_normalize,dashboard_window_sql,doc_render_body,doc_render_write,doc_signature_write,entity_value_write,external_history_event,external_source_declare,external_stub_upsert,external_write_through,
|
|
751
|
-
{ code: "23503", raised_by: "_containment_guard,_field_document_for,_record_rule_uses,anon_publish,anon_rate_take,anon_token_issue,anon_write,assert_organization_wall,dashboard_declare,delete_rule,doc_sign,doc_template_save,form_declare,form_submit,home_add,io_comment_write,io_import_rows,io_proposal_accept,migrate_demote,migrate_promote,promote_field,promote_table,record_applicability,record_reparent,relation_carry,relation_own,resolve_first_match,rule_applies,rule_declare,rule_eval,rule_members,rule_run,subscription_mute,work_set_state,work_take_assignment,work_template_instantiate" },
|
|
752
|
-
{ code: "23505", raised_by: "_unique_rule_holds,doc_sign,doc_signature_write,entity_field_declare,field_declare,home_add,io_proposal_accept,relation_carry,relation_own,share_grant,work_approval_decide,work_slot_hold" },
|
|
753
|
-
{ code: "23514", raised_by: "_containment_guard,_dated_values_guard,_derived_fields,_entity_custom_fields_guard,_field_class_guard,_field_document_for,_field_shape_guard,_field_type_parity_guard,_merge_field_shape_guard,_merge_field_temporal_guard,_promoted_field_cap_guard,_record_rule_uses,_resolve_choice_words,_rule_shape_guard,_rule_topology_guard,_store_relation_edge_names_its_field,_table_shape_guard,_value_envelope,_work_shape_guard,_workdoors_approval_guard,assert_entity_is_organization_scoped,doc_sign,doc_signature_write,doc_template_save,entity_field_declare,entity_field_retire,entity_field_update,entity_records_find,entity_table,field_declare,field_retire,field_update,home_add,migrate_merge,relation_carry,relation_own,validate_value_envelope,validate_values,work_set_state,work_slots_declare,work_take_assignment,work_template_instantiate" },
|
|
851
|
+
{ code: "22023", raised_by: "_entity_custom_fields_guard,_value_envelope,_work_shape_guard,actor_word,agg_assert_key,agg_sql,anon_token_issue,containment_parent,dashboard_block_normalize,dashboard_window_sql,doc_render_body,doc_render_write,doc_signature_write,enrich_declare,enrich_land,enrich_normalize,enrich_pin,entity_value_write,external_history_event,external_source_declare,external_stub_upsert,external_write_through,field_history,io_import_begin,io_import_finish,io_import_plan,io_import_report,io_proposal_accept,migrate_merge,migrate_reclass,my_levels,organization_clear,pin_agent_cells,portal_declare,query_by_coordinates,query_rollup,record_update,relation_carry,rule_eval,rule_members,share_grant,share_lane_set,sign_request_create,sign_request_sign,table_rules,visibility_as_of,work_approval_request,work_list,work_slot_hold" },
|
|
852
|
+
{ code: "23503", raised_by: "_checklist_instantiate,_containment_guard,_field_document_for,_record_rule_uses,anon_publish,anon_rate_take,anon_token_issue,anon_write,assert_organization_wall,checklist_declare,checklist_steps_table,comment_write,dashboard_declare,delete_rule,doc_sign,doc_template_save,enrich_declare,enrich_due,enrich_land,form_declare,form_submit,home_add,inbound_declare,inbound_mail_land,inbound_set,io_comment_write,io_import_begin,io_import_finish,io_import_report,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,sign_request_create,subscription_mute,work_set_state,work_take_assignment,work_template_instantiate" },
|
|
853
|
+
{ code: "23505", raised_by: "_unique_rule_holds,doc_sign,doc_signature_write,entity_field_declare,field_declare,home_add,inbound_declare,io_proposal_accept,relation_carry,relation_own,share_grant,sign_request_cancel,sign_request_create,work_approval_decide,work_slot_hold" },
|
|
854
|
+
{ code: "23514", raised_by: "_checklist_instantiate,_checklist_step_guard,_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,checklist_declare,checklist_step_complete,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,io_import_rows,migrate_merge,relation_carry,relation_own,sign_request_create,sign_request_sign,validate_value_envelope,validate_values,work_set_state,work_slots_declare,work_take_assignment,work_template_instantiate" },
|
|
754
855
|
{ code: "40001", raised_by: "has_visibility_at" },
|
|
755
|
-
{ code: "42501", raised_by: "_doc_render_immutable,_doc_signature_immutable,_field_definition_write,_field_write_door,_rule_definition_write,_store_door,anon_capture,anon_inbound_land,anon_publish,anon_token_issue,anon_token_verify,anon_write,assert_client_may_change,assert_client_may_open,assert_client_may_reach,assert_may_know_table,assert_organization_admin,assert_store_door,entity_field_declare,entity_field_retire,entity_field_update,entity_value_write,external_write_through,form_declare,form_submit,io_comment_resolve,io_comment_write,io_restore,migrate_purge,migrate_reclass,my_levels,organization_clear,portal_declare,portal_invitation,portal_invite,portal_principal_bind,promote_table,query_visibility_parity,read_record,read_records,share_grant,subscription_mute,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_person" },
|
|
856
|
+
{ 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,checklist_run,comment_write,conversation_scope_bind,conversation_scope_unbind,enrich_declare,enrich_due,enrich_land,enrich_normalize,entity_field_declare,entity_field_retire,entity_field_update,entity_value_write,external_write_through,form_declare,form_submit,inbound_mail_land,io_comment_resolve,io_comment_write,io_import_begin,io_import_finish,io_restore,migrate_purge,migrate_reclass,my_levels,organization_clear,portal_declare,portal_invitation,portal_invite,portal_principal_bind,promote_table,query_visibility_parity,read_record,read_records,record_table,share_grant,subscription_mute,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_person" },
|
|
756
857
|
{ code: "42703", raised_by: "entity_table,portal_declare" },
|
|
757
|
-
{ code: "53400", raised_by: "anon_rate_take,delete_cascade_closure,promote_field" },
|
|
858
|
+
{ code: "53400", raised_by: "anon_rate_take,delete_cascade_closure,enrich_due,enrich_land,promote_field" },
|
|
758
859
|
{ code: "54001", raised_by: "record_delete" },
|
|
759
860
|
{ code: "PT409", raised_by: "record_update" }
|
|
760
861
|
];
|
|
@@ -1781,6 +1882,11 @@ var ENTITY_TOKENS = [
|
|
|
1781
1882
|
"youtube_video"
|
|
1782
1883
|
];
|
|
1783
1884
|
|
|
1885
|
+
// src/record-scope.ts
|
|
1886
|
+
function scopeChip(scope) {
|
|
1887
|
+
return scope.title ? `About: ${scope.title}` : "About: this record";
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1784
1890
|
// src/core/doors.ts
|
|
1785
1891
|
var OWED_BY = {
|
|
1786
1892
|
metadata_search: "W5-SRV / W5-AGENT \u2014 the agent surface's eight verbs",
|
|
@@ -1929,6 +2035,30 @@ var DOORS = {
|
|
|
1929
2035
|
// are server-lane doors and a browser never calls them.
|
|
1930
2036
|
forms: "forms",
|
|
1931
2037
|
formDeclare: "form_declare",
|
|
2038
|
+
// PRODUCTS row 9 — "pull my spreadsheet in". W4-IO built `io_import_open` and
|
|
2039
|
+
// `io_import_rows`; lane IMPORT gave a run an IDENTITY (the file's sha-256, so
|
|
2040
|
+
// a re-import doubles nothing), a duplicate key, a policy, per-row outcomes
|
|
2041
|
+
// with the source row on them, and the type inference that reads THIS
|
|
2042
|
+
// organization — an address that belongs to a member is a person, a few
|
|
2043
|
+
// repeating words are a dropdown, a column of names that are all records of
|
|
2044
|
+
// another Table points at it. `importOpen` (the older, narrower way in) is
|
|
2045
|
+
// deliberately absent from this catalogue: `importBegin` is a superset and two
|
|
2046
|
+
// ways to start an import from one client is how they drift.
|
|
2047
|
+
importPlan: "io_import_plan",
|
|
2048
|
+
importBegin: "io_import_begin",
|
|
2049
|
+
importRows: "io_import_rows",
|
|
2050
|
+
importFinish: "io_import_finish",
|
|
2051
|
+
importReport: "io_import_report",
|
|
2052
|
+
imports: "io_imports",
|
|
2053
|
+
importForget: "io_import_forget",
|
|
2054
|
+
inferColumn: "io_infer_column",
|
|
2055
|
+
// DOOR-19 (P8) — the address a Table owns. `inboundMailLand` is deliberately
|
|
2056
|
+
// absent: it is the mail gateway's door, granted to `service_role` alone and
|
|
2057
|
+
// declared `non_client_lane`, and a browser that could land mail at an
|
|
2058
|
+
// arbitrary address would be writing into any table of any organization.
|
|
2059
|
+
inboundDeclare: "inbound_declare",
|
|
2060
|
+
inboundAddresses: "inbound_addresses",
|
|
2061
|
+
inboundSet: "inbound_set",
|
|
1932
2062
|
// THE CLIENT PORTAL, OWNER'S SIDE (VIS-31 / PORTAL). A portal is how somebody
|
|
1933
2063
|
// with NO membership is let in to see the records that name them. `portals`
|
|
1934
2064
|
// lists them, `portalCard` opens one, `portalDeclare` states what it exposes,
|
|
@@ -1955,6 +2085,41 @@ var DOORS = {
|
|
|
1955
2085
|
dashboardRun: "dashboard_run",
|
|
1956
2086
|
dashboardStuck: "dashboard_stuck",
|
|
1957
2087
|
dashboardDelete: "dashboard_delete",
|
|
2088
|
+
// PRODUCTS row 4 — "Who changed this price, and can I put it back?" The
|
|
2089
|
+
// history has been in the store since W3-HIST; until 2026-09-20 the only way
|
|
2090
|
+
// to ask for it was `io_revisions`, which answers a raw uuid for the author
|
|
2091
|
+
// and a list of KEYS for what moved. `recordHistory` answers the person (or
|
|
2092
|
+
// the agent AND the person it acted for), the operation in the word somebody
|
|
2093
|
+
// used, and every field with its before, its after, the Rule version that
|
|
2094
|
+
// produced it and its source. `fieldHistory` is the other half nobody ships:
|
|
2095
|
+
// one column's history across the whole Table.
|
|
2096
|
+
recordHistory: "record_history",
|
|
2097
|
+
fieldHistory: "field_history",
|
|
2098
|
+
// THE PUT-IT-BACK THREE. `restorePreview` names what will change BEFORE it
|
|
2099
|
+
// does; `restoreVersion` puts the whole record back and `valueRestore` puts
|
|
2100
|
+
// one column back (HIS-N-2). All three write a NEW version through the
|
|
2101
|
+
// record's own write path — no stored version is ever altered.
|
|
2102
|
+
restorePreview: "record_restore_preview",
|
|
2103
|
+
restoreVersion: "record_restore_version",
|
|
2104
|
+
valueRestore: "value_restore",
|
|
2105
|
+
// SCR-18. The store has had comment doors at the `commenter` rung all along;
|
|
2106
|
+
// these two add the people's NAMES and a mention that reaches somebody.
|
|
2107
|
+
// AGT-N-9 / PRODUCTS row 11 — "What's the history with this customer?" A
|
|
2108
|
+
// conversation can be ABOUT one record, and `recordScopeContext` is the ONE
|
|
2109
|
+
// door that answers everything such a chat is allowed to know in a single
|
|
2110
|
+
// round trip: the Fields with their (record, field, value version) triples,
|
|
2111
|
+
// the relations one hop out, the history, the comments and the Table's other
|
|
2112
|
+
// records — every piece assembled INSIDE the database through the read door
|
|
2113
|
+
// under this person's own field-level security. A Field the store masks is
|
|
2114
|
+
// named as withheld with the store's reason and never valued.
|
|
2115
|
+
recordScopeContext: "record_scope_context",
|
|
2116
|
+
conversationScope: "conversation_scope",
|
|
2117
|
+
conversationScopeBind: "conversation_scope_bind",
|
|
2118
|
+
conversationScopeUnbind: "conversation_scope_unbind",
|
|
2119
|
+
conversationScopeContext: "conversation_scope_context",
|
|
2120
|
+
commentThread: "comment_thread",
|
|
2121
|
+
commentWrite: "comment_write",
|
|
2122
|
+
commentResolve: "io_comment_resolve",
|
|
1958
2123
|
// The eighth verb (AGT-N-8): a grouped, bucketed, filtered count/sum/avg/
|
|
1959
2124
|
// min/max computed INSIDE the read door's own query, so a chart shows exactly
|
|
1960
2125
|
// the rows this person may see and never fetches the ones they may not.
|
|
@@ -1971,6 +2136,10 @@ var DOORS = {
|
|
|
1971
2136
|
// these rows, so "tell me when a patient arrives" can also be un-told.
|
|
1972
2137
|
subscriptions: "subscriptions",
|
|
1973
2138
|
subscriptionMute: "subscription_mute",
|
|
2139
|
+
// The cadence CATALOGUE a person's screen may ask for. `agg_subscription_cadences`
|
|
2140
|
+
// above is the notifier's own and holds no client grant; this door delegates to
|
|
2141
|
+
// it, so a picker and the digest runner can never offer different words.
|
|
2142
|
+
subscriptionCadences: "subscription_cadences",
|
|
1974
2143
|
// The doc doors: a template is saved, a render is written once and frozen,
|
|
1975
2144
|
// and a signature is checked against the exact bytes that were signed.
|
|
1976
2145
|
docTemplateSave: "doc_template_save",
|
|
@@ -1980,6 +2149,15 @@ var DOORS = {
|
|
|
1980
2149
|
docUnresolvedTokens: "doc_unresolved_tokens",
|
|
1981
2150
|
docSign: "doc_sign",
|
|
1982
2151
|
docSignatureIntact: "doc_signature_intact",
|
|
2152
|
+
// THE PLURAL ACTS. Until 2026-09-20 this package read `custom.doc_template`,
|
|
2153
|
+
// `custom.doc_render` and `custom.doc_signature` with a direct PostgREST
|
|
2154
|
+
// `.from()`, and all three hold NO client SELECT — so every list in product #5
|
|
2155
|
+
// opened on "permission denied for view doc_template". A list is a DOOR, never
|
|
2156
|
+
// a grant on the thing behind it (DOORS-TWO).
|
|
2157
|
+
docTemplates: "doc_templates",
|
|
2158
|
+
docTemplateDelete: "doc_template_delete",
|
|
2159
|
+
docRenders: "doc_renders",
|
|
2160
|
+
docSignatures: "doc_signatures",
|
|
1983
2161
|
// THE ANONYMOUS LANE (W4-ANON). It landed, and it landed as SEVEN doors
|
|
1984
2162
|
// rather than the one this package had guessed at: a token is issued and
|
|
1985
2163
|
// verified separately from the write it authorises, a form is published
|
|
@@ -2083,6 +2261,15 @@ var BY_SQLSTATE = {
|
|
|
2083
2261
|
// live-door census caught it — the same way 42703 arrived, which is the
|
|
2084
2262
|
// census working rather than a guess.
|
|
2085
2263
|
"22007": "invalid_argument",
|
|
2264
|
+
// 22003 — a number the store could not hold at the size it was handed. It is
|
|
2265
|
+
// raised by `custom.context_resolve`, which is given a window or a depth a
|
|
2266
|
+
// caller wrote, so the class is the same one 22P02, 42703 and 22007 already
|
|
2267
|
+
// are: the CALL named a value the shape does not accept, and the store's own
|
|
2268
|
+
// sentence names the number and the range. Added 2026-09-20 (lane GRID-TWO)
|
|
2269
|
+
// when the live-door census caught the release gate red on it — which is the
|
|
2270
|
+
// census working, and the fourth time it has been the thing that found a new
|
|
2271
|
+
// refusal class rather than a person guessing one.
|
|
2272
|
+
"22003": "invalid_argument",
|
|
2086
2273
|
"02000": "not_found",
|
|
2087
2274
|
"23503": "missing_reference",
|
|
2088
2275
|
"23505": "already_exists",
|
|
@@ -2630,6 +2817,98 @@ function createRecordsClient(config) {
|
|
|
2630
2817
|
"formDeclare"
|
|
2631
2818
|
);
|
|
2632
2819
|
},
|
|
2820
|
+
async importPlan(args) {
|
|
2821
|
+
return callDoor(
|
|
2822
|
+
DOORS.importPlan,
|
|
2823
|
+
{ p_organization_id: org, p_table_id: args.table_id, p_columns: args.columns },
|
|
2824
|
+
"importPlan"
|
|
2825
|
+
);
|
|
2826
|
+
},
|
|
2827
|
+
async importBegin(args) {
|
|
2828
|
+
return callDoor(
|
|
2829
|
+
DOORS.importBegin,
|
|
2830
|
+
{
|
|
2831
|
+
p_organization_id: org,
|
|
2832
|
+
p_table_id: args.table_id,
|
|
2833
|
+
p_format: args.format ?? "csv",
|
|
2834
|
+
p_source_name: args.source_name ?? null,
|
|
2835
|
+
p_source_columns: args.source_columns ?? [],
|
|
2836
|
+
p_file_hash: args.file_hash ?? null,
|
|
2837
|
+
p_policy: args.policy ?? {},
|
|
2838
|
+
p_dedupe_key: args.dedupe_key ?? null,
|
|
2839
|
+
p_file_bytes: args.file_bytes ?? null,
|
|
2840
|
+
p_force: args.force ?? false
|
|
2841
|
+
},
|
|
2842
|
+
"importBegin"
|
|
2843
|
+
);
|
|
2844
|
+
},
|
|
2845
|
+
async importRows(args) {
|
|
2846
|
+
return callDoor(
|
|
2847
|
+
DOORS.importRows,
|
|
2848
|
+
{
|
|
2849
|
+
p_organization_id: org,
|
|
2850
|
+
p_import_id: args.import_id,
|
|
2851
|
+
p_rows: args.rows,
|
|
2852
|
+
p_mapping: args.mapping ?? {}
|
|
2853
|
+
},
|
|
2854
|
+
"importRows"
|
|
2855
|
+
);
|
|
2856
|
+
},
|
|
2857
|
+
async importFinish(args) {
|
|
2858
|
+
return callDoor(
|
|
2859
|
+
DOORS.importFinish,
|
|
2860
|
+
{ p_organization_id: org, p_import_id: args.import_id, p_unmapped: args.unmapped ?? null },
|
|
2861
|
+
"importFinish"
|
|
2862
|
+
);
|
|
2863
|
+
},
|
|
2864
|
+
async importReport(args) {
|
|
2865
|
+
return callDoor(
|
|
2866
|
+
DOORS.importReport,
|
|
2867
|
+
{
|
|
2868
|
+
p_organization_id: org,
|
|
2869
|
+
p_import_id: args.import_id,
|
|
2870
|
+
p_state: args.state ?? "refused",
|
|
2871
|
+
p_limit: args.limit ?? 100,
|
|
2872
|
+
p_offset: args.offset ?? 0
|
|
2873
|
+
},
|
|
2874
|
+
"importReport"
|
|
2875
|
+
);
|
|
2876
|
+
},
|
|
2877
|
+
async imports(args) {
|
|
2878
|
+
return callDoor(
|
|
2879
|
+
DOORS.imports,
|
|
2880
|
+
{ p_organization_id: org, p_table_id: args?.table_id ?? null, p_limit: args?.limit ?? 25 },
|
|
2881
|
+
"imports"
|
|
2882
|
+
);
|
|
2883
|
+
},
|
|
2884
|
+
async importForget(args) {
|
|
2885
|
+
return callDoor(
|
|
2886
|
+
DOORS.importForget,
|
|
2887
|
+
{ p_organization_id: org, p_import_id: args.import_id },
|
|
2888
|
+
"importForget"
|
|
2889
|
+
);
|
|
2890
|
+
},
|
|
2891
|
+
async inboundDeclare(args) {
|
|
2892
|
+
return callDoor(
|
|
2893
|
+
DOORS.inboundDeclare,
|
|
2894
|
+
{ p_organization_id: org, p_table_id: args.table_id, p_label: args.label ?? null },
|
|
2895
|
+
"inboundDeclare"
|
|
2896
|
+
);
|
|
2897
|
+
},
|
|
2898
|
+
async inboundAddresses(args) {
|
|
2899
|
+
return callDoor(
|
|
2900
|
+
DOORS.inboundAddresses,
|
|
2901
|
+
{ p_organization_id: org, p_table_id: args?.table_id ?? null },
|
|
2902
|
+
"inboundAddresses"
|
|
2903
|
+
);
|
|
2904
|
+
},
|
|
2905
|
+
async inboundSet(args) {
|
|
2906
|
+
return callDoor(
|
|
2907
|
+
DOORS.inboundSet,
|
|
2908
|
+
{ p_organization_id: org, p_inbound_id: args.inbound_id, p_enabled: args.enabled },
|
|
2909
|
+
"inboundSet"
|
|
2910
|
+
);
|
|
2911
|
+
},
|
|
2633
2912
|
async portals() {
|
|
2634
2913
|
return callDoor(DOORS.portals, { p_organization_id: org }, "portals");
|
|
2635
2914
|
},
|
|
@@ -2797,6 +3076,13 @@ function createRecordsClient(config) {
|
|
|
2797
3076
|
async aggSubscriptionCadences() {
|
|
2798
3077
|
return callDoor(DOORS.aggSubscriptionCadences, {}, "aggSubscriptionCadences");
|
|
2799
3078
|
},
|
|
3079
|
+
async subscriptionCadences() {
|
|
3080
|
+
return callDoor(
|
|
3081
|
+
DOORS.subscriptionCadences,
|
|
3082
|
+
{ p_organization_id: org },
|
|
3083
|
+
"subscriptionCadences"
|
|
3084
|
+
);
|
|
3085
|
+
},
|
|
2800
3086
|
async subscriptions(args) {
|
|
2801
3087
|
return callDoor(
|
|
2802
3088
|
DOORS.subscriptions,
|
|
@@ -2861,32 +3147,52 @@ function createRecordsClient(config) {
|
|
|
2861
3147
|
"docSign"
|
|
2862
3148
|
);
|
|
2863
3149
|
},
|
|
3150
|
+
// A LIST IS A DOOR, NEVER A GRANT ON THE THING BEHIND IT. These three used to
|
|
3151
|
+
// read `custom.doc_template`, `custom.doc_render` and `custom.doc_signature`
|
|
3152
|
+
// with a direct PostgREST `.from()`, and none of the three holds a client
|
|
3153
|
+
// SELECT — so a person could save a template they could never list and
|
|
3154
|
+
// render a document they could never find again, and every document screen
|
|
3155
|
+
// opened on "permission denied for view doc_template". The doors below
|
|
3156
|
+
// narrow inside the definer, after the ladder has spoken (DOORS-TWO).
|
|
2864
3157
|
async docTemplates({ table_id }) {
|
|
2865
|
-
const
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
return ok(
|
|
3158
|
+
const answered = await callDoor(
|
|
3159
|
+
DOORS.docTemplates,
|
|
3160
|
+
{ p_organization_id: org, p_table_id: table_id },
|
|
3161
|
+
"docTemplates"
|
|
3162
|
+
);
|
|
3163
|
+
if (!answered.ok) return answered;
|
|
3164
|
+
return ok(
|
|
3165
|
+
answered.data.map((row) => ({ ...row, id: row["template_id"] }))
|
|
3166
|
+
);
|
|
3167
|
+
},
|
|
3168
|
+
async docTemplateDelete({ template_id }) {
|
|
3169
|
+
return callDoor(
|
|
3170
|
+
DOORS.docTemplateDelete,
|
|
3171
|
+
{ p_organization_id: org, p_template_id: template_id },
|
|
3172
|
+
"docTemplateDelete"
|
|
3173
|
+
);
|
|
2872
3174
|
},
|
|
2873
3175
|
async docRenders({ record_id }) {
|
|
2874
|
-
const
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
return ok(
|
|
3176
|
+
const answered = await callDoor(
|
|
3177
|
+
DOORS.docRenders,
|
|
3178
|
+
{ p_organization_id: org, p_record_id: record_id },
|
|
3179
|
+
"docRenders"
|
|
3180
|
+
);
|
|
3181
|
+
if (!answered.ok) return answered;
|
|
3182
|
+
return ok(
|
|
3183
|
+
answered.data.map((row) => ({ ...row, id: row["render_id"] }))
|
|
3184
|
+
);
|
|
2881
3185
|
},
|
|
2882
3186
|
async docSignatures({ record_id }) {
|
|
2883
|
-
const
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
return ok(
|
|
3187
|
+
const answered = await callDoor(
|
|
3188
|
+
DOORS.docSignatures,
|
|
3189
|
+
{ p_organization_id: org, p_record_id: record_id },
|
|
3190
|
+
"docSignatures"
|
|
3191
|
+
);
|
|
3192
|
+
if (!answered.ok) return answered;
|
|
3193
|
+
return ok(
|
|
3194
|
+
answered.data.map((row) => ({ ...row, id: row["signature_id"] }))
|
|
3195
|
+
);
|
|
2890
3196
|
},
|
|
2891
3197
|
async recordValuesVersioned({ record_id }) {
|
|
2892
3198
|
return readValues(record_id);
|
|
@@ -2898,6 +3204,152 @@ function createRecordsClient(config) {
|
|
|
2898
3204
|
"revisions"
|
|
2899
3205
|
);
|
|
2900
3206
|
},
|
|
3207
|
+
async recordScopeContext({ record_id, relations, history, siblings }) {
|
|
3208
|
+
return callDoor(
|
|
3209
|
+
DOORS.recordScopeContext,
|
|
3210
|
+
{
|
|
3211
|
+
p_organization_id: org,
|
|
3212
|
+
p_record_id: record_id,
|
|
3213
|
+
p_relations: relations ?? 12,
|
|
3214
|
+
p_history: history ?? 15,
|
|
3215
|
+
p_siblings: siblings ?? 8
|
|
3216
|
+
},
|
|
3217
|
+
"recordScopeContext"
|
|
3218
|
+
);
|
|
3219
|
+
},
|
|
3220
|
+
async conversationScope({ conversation_id }) {
|
|
3221
|
+
return callDoor(
|
|
3222
|
+
DOORS.conversationScope,
|
|
3223
|
+
{ p_organization_id: org, p_conversation_id: conversation_id },
|
|
3224
|
+
"conversationScope"
|
|
3225
|
+
);
|
|
3226
|
+
},
|
|
3227
|
+
async conversationScopeBind({ conversation_id, record_id }) {
|
|
3228
|
+
return callDoor(
|
|
3229
|
+
DOORS.conversationScopeBind,
|
|
3230
|
+
{
|
|
3231
|
+
p_organization_id: org,
|
|
3232
|
+
p_conversation_id: conversation_id,
|
|
3233
|
+
p_record_id: record_id
|
|
3234
|
+
},
|
|
3235
|
+
"conversationScopeBind"
|
|
3236
|
+
);
|
|
3237
|
+
},
|
|
3238
|
+
async conversationScopeUnbind({ conversation_id }) {
|
|
3239
|
+
return callDoor(
|
|
3240
|
+
DOORS.conversationScopeUnbind,
|
|
3241
|
+
{ p_organization_id: org, p_conversation_id: conversation_id },
|
|
3242
|
+
"conversationScopeUnbind"
|
|
3243
|
+
);
|
|
3244
|
+
},
|
|
3245
|
+
async conversationScopeContext({ conversation_id, relations, history, siblings }) {
|
|
3246
|
+
return callDoor(
|
|
3247
|
+
DOORS.conversationScopeContext,
|
|
3248
|
+
{
|
|
3249
|
+
p_organization_id: org,
|
|
3250
|
+
p_conversation_id: conversation_id,
|
|
3251
|
+
p_relations: relations ?? 12,
|
|
3252
|
+
p_history: history ?? 15,
|
|
3253
|
+
p_siblings: siblings ?? 8
|
|
3254
|
+
},
|
|
3255
|
+
"conversationScopeContext"
|
|
3256
|
+
);
|
|
3257
|
+
},
|
|
3258
|
+
async recordHistory({ record_id, limit, offset }) {
|
|
3259
|
+
return callDoor(
|
|
3260
|
+
DOORS.recordHistory,
|
|
3261
|
+
{
|
|
3262
|
+
p_organization_id: org,
|
|
3263
|
+
p_record_id: record_id,
|
|
3264
|
+
p_limit: limit ?? 200,
|
|
3265
|
+
p_offset: offset ?? 0
|
|
3266
|
+
},
|
|
3267
|
+
"recordHistory"
|
|
3268
|
+
);
|
|
3269
|
+
},
|
|
3270
|
+
async fieldHistory({ table_id, field_key, limit, offset, record_id }) {
|
|
3271
|
+
return callDoor(
|
|
3272
|
+
DOORS.fieldHistory,
|
|
3273
|
+
{
|
|
3274
|
+
p_organization_id: org,
|
|
3275
|
+
p_table_id: table_id,
|
|
3276
|
+
p_field_key: field_key,
|
|
3277
|
+
p_limit: limit ?? 100,
|
|
3278
|
+
p_offset: offset ?? 0,
|
|
3279
|
+
p_record_id: record_id ?? null
|
|
3280
|
+
},
|
|
3281
|
+
"fieldHistory"
|
|
3282
|
+
);
|
|
3283
|
+
},
|
|
3284
|
+
async restorePreview({ record_id, version, field_key }) {
|
|
3285
|
+
return callDoor(
|
|
3286
|
+
DOORS.restorePreview,
|
|
3287
|
+
{
|
|
3288
|
+
p_organization_id: org,
|
|
3289
|
+
p_record_id: record_id,
|
|
3290
|
+
p_version: version,
|
|
3291
|
+
p_field_key: field_key ?? null
|
|
3292
|
+
},
|
|
3293
|
+
"restorePreview"
|
|
3294
|
+
);
|
|
3295
|
+
},
|
|
3296
|
+
async restoreVersion({ record_id, version }) {
|
|
3297
|
+
return callDoor(
|
|
3298
|
+
DOORS.restoreVersion,
|
|
3299
|
+
{ p_organization_id: org, p_record_id: record_id, p_version: version },
|
|
3300
|
+
"restoreVersion"
|
|
3301
|
+
);
|
|
3302
|
+
},
|
|
3303
|
+
async valueRestore({ record_id, field_key, version }) {
|
|
3304
|
+
return callDoor(
|
|
3305
|
+
DOORS.valueRestore,
|
|
3306
|
+
{
|
|
3307
|
+
p_organization_id: org,
|
|
3308
|
+
p_record_id: record_id,
|
|
3309
|
+
p_field_key: field_key,
|
|
3310
|
+
p_version: version
|
|
3311
|
+
},
|
|
3312
|
+
"valueRestore"
|
|
3313
|
+
);
|
|
3314
|
+
},
|
|
3315
|
+
async commentThread({ record_id, include_resolved }) {
|
|
3316
|
+
return callDoor(
|
|
3317
|
+
DOORS.commentThread,
|
|
3318
|
+
{
|
|
3319
|
+
p_organization_id: org,
|
|
3320
|
+
p_record_id: record_id,
|
|
3321
|
+
p_include_resolved: include_resolved ?? false
|
|
3322
|
+
},
|
|
3323
|
+
"commentThread"
|
|
3324
|
+
);
|
|
3325
|
+
},
|
|
3326
|
+
async commentWrite({ record_id, body, field_key, parent_comment_id, mentions }) {
|
|
3327
|
+
return callDoor(
|
|
3328
|
+
DOORS.commentWrite,
|
|
3329
|
+
{
|
|
3330
|
+
p_organization_id: org,
|
|
3331
|
+
p_record_id: record_id,
|
|
3332
|
+
p_body: body,
|
|
3333
|
+
// THE ANCHOR IS WHERE A FIELD COMMENT LIVES. `custom.io_comment` has
|
|
3334
|
+
// always carried it; nothing was ever putting a Field in it.
|
|
3335
|
+
p_anchor: field_key ? { field_key } : {},
|
|
3336
|
+
p_parent_comment_id: parent_comment_id ?? null,
|
|
3337
|
+
p_mentions: mentions && mentions.length > 0 ? mentions : null
|
|
3338
|
+
},
|
|
3339
|
+
"commentWrite"
|
|
3340
|
+
);
|
|
3341
|
+
},
|
|
3342
|
+
async commentResolve({ comment_id, resolved }) {
|
|
3343
|
+
return callDoor(
|
|
3344
|
+
DOORS.commentResolve,
|
|
3345
|
+
{
|
|
3346
|
+
p_organization_id: org,
|
|
3347
|
+
p_comment_id: comment_id,
|
|
3348
|
+
p_resolved: resolved ?? true
|
|
3349
|
+
},
|
|
3350
|
+
"commentResolve"
|
|
3351
|
+
);
|
|
3352
|
+
},
|
|
2901
3353
|
async docSignatureIntact({ signature_id }) {
|
|
2902
3354
|
return callDoor(
|
|
2903
3355
|
DOORS.docSignatureIntact,
|