@ai-matrx/records 0.58.8 → 0.58.11

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.
@@ -2714,7 +2714,7 @@ declare const STORE_DOORS: readonly [{
2714
2714
  readonly security: "definer";
2715
2715
  }, {
2716
2716
  readonly name: "read_records_in_view_order";
2717
- readonly args: "p_organization_id uuid, p_view_id uuid, p_by_id boolean DEFAULT false, p_limit integer DEFAULT 200, p_offset integer DEFAULT 0";
2717
+ readonly args: "p_organization_id uuid, p_view_id uuid, p_by_id boolean DEFAULT false, p_limit integer DEFAULT 200, p_offset integer DEFAULT 0, p_filter jsonb DEFAULT NULL::jsonb";
2718
2718
  readonly returns: "TABLE(id uuid, document jsonb, level permission_level, \"position\" numeric)";
2719
2719
  readonly security: "definer";
2720
2720
  }, {
@@ -2837,6 +2837,21 @@ declare const STORE_DOORS: readonly [{
2837
2837
  readonly args: "p_organization_id uuid, p_record_id uuid, p_relations integer DEFAULT 12, p_history integer DEFAULT 15, p_siblings integer DEFAULT 8";
2838
2838
  readonly returns: "jsonb";
2839
2839
  readonly security: "definer";
2840
+ }, {
2841
+ readonly name: "record_source_key";
2842
+ readonly args: "p_table_id uuid";
2843
+ readonly returns: "text";
2844
+ readonly security: "invoker";
2845
+ }, {
2846
+ readonly name: "record_source_keys";
2847
+ readonly args: "p_table_id uuid";
2848
+ readonly returns: "text[]";
2849
+ readonly security: "invoker";
2850
+ }, {
2851
+ readonly name: "record_source_table";
2852
+ readonly args: "p_key text";
2853
+ readonly returns: "uuid";
2854
+ readonly security: "invoker";
2840
2855
  }, {
2841
2856
  readonly name: "record_stage_pending";
2842
2857
  readonly args: "p_organization_id uuid, p_record_id uuid";
@@ -3735,7 +3750,7 @@ declare const STORE_DOORS: readonly [{
3735
3750
  }, {
3736
3751
  readonly name: "work_inbox";
3737
3752
  readonly args: "p_organization_id uuid, p_limit integer DEFAULT 50, p_offset integer DEFAULT 0, p_include_decided boolean DEFAULT false, p_view text DEFAULT 'inbox'::text";
3738
- readonly 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, table_id uuid, table_name text, decided_by uuid, decided_by_name text, decided_at timestamp with time zone, outcome text, snoozed_until timestamp with time zone, cleared_at timestamp with time zone, snoozed_count integer, cleared_count integer)";
3753
+ readonly 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, table_id uuid, table_name text, decided_by uuid, decided_by_name text, decided_at timestamp with time zone, outcome text, snoozed_until timestamp with time zone, cleared_at timestamp with time zone, snoozed_count integer, cleared_count integer, undo_seconds integer, undo_refusal text)";
3739
3754
  readonly security: "definer";
3740
3755
  }, {
3741
3756
  readonly name: "work_instantiation_shape";
@@ -3925,6 +3940,10 @@ declare const STORE_KNOBS: readonly [{
3925
3940
  readonly key: "cross_organization_links";
3926
3941
  readonly value: "false";
3927
3942
  readonly type: "boolean";
3943
+ }, {
3944
+ readonly key: "decision_undo_seconds";
3945
+ readonly value: "5";
3946
+ readonly type: "integer";
3928
3947
  }, {
3929
3948
  readonly key: "decoration_rules_max";
3930
3949
  readonly value: "50";
@@ -4161,7 +4180,7 @@ declare const STORE_REFUSAL_CODES: readonly [{
4161
4180
  readonly raised_by: "_portal_config_judge,_share_write_person,_unique_rule_holds,doc_sign,doc_signature_write,entity_field_declare,field_declare,home_add,inbound_declare,io_proposal_accept,relation_carry,relation_own,sign_request_cancel,sign_request_create,table_share_outside_resend,work_approval_decide,work_slot_hold";
4162
4181
  }, {
4163
4182
  readonly code: "23514";
4164
- readonly raised_by: "_checklist_instantiate,_checklist_step_guard,_containment_guard,_dated_values_guard,_derived_fields,_display_format_check,_display_spec_for,_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,_relation_halves_agree,_relation_kernel_targets,_resolve_choice_words,_rule_shape_guard,_rule_topology_guard,_store_relation_edge_names_its_field,_table_columns_word_guard,_table_shape_guard,_undeclared_key_guard,_value_envelope,_with_display,_work_shape_guard,_workdoors_approval_guard,action_run,assert_columns_are_defined,assert_entity_is_organization_scoped,booking_declare,capture_publish,capture_sheet_declare,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_comment_write,io_import_rows,migrate_merge,migrate_purge_hard,portal_archive,portal_restore,record_restore,record_write_graph,relation_carry,relation_halves_repair,relation_own,sign_request_create,sign_request_sign,table_declare,table_from_example,validate_value_envelope,validate_values,work_set_state,work_slots_declare,work_take_assignment,work_template_instantiate";
4183
+ readonly raised_by: "_checklist_instantiate,_checklist_step_guard,_containment_guard,_dated_values_guard,_derived_fields,_display_format_check,_display_spec_for,_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,_record_source_key_is_record,_relation_halves_agree,_relation_kernel_targets,_resolve_choice_words,_rule_shape_guard,_rule_topology_guard,_store_relation_edge_names_its_field,_table_columns_word_guard,_table_shape_guard,_undeclared_key_guard,_value_envelope,_with_display,_work_shape_guard,_workdoors_approval_guard,action_run,assert_columns_are_defined,assert_entity_is_organization_scoped,booking_declare,capture_publish,capture_sheet_declare,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_comment_write,io_import_rows,migrate_merge,migrate_purge_hard,portal_archive,portal_restore,record_restore,record_write_graph,relation_carry,relation_halves_repair,relation_own,sign_request_create,sign_request_sign,table_declare,table_from_example,validate_value_envelope,validate_values,work_set_state,work_slots_declare,work_take_assignment,work_template_instantiate";
4165
4184
  }, {
4166
4185
  readonly code: "40001";
4167
4186
  readonly raised_by: "has_visibility_at,table_move";
@@ -9191,6 +9210,14 @@ interface WorkInboxItem {
9191
9210
  /** How many of this person's items are snoozed / cleared right now — the same on every row. */
9192
9211
  snoozed_count?: number;
9193
9212
  cleared_count?: number;
9213
+ /**
9214
+ * HOW LONG A DECISION ON THIS ROW IS HELD WITH UNDO before it is made (VERIFIER-20), in seconds:
9215
+ * the organization's `custom/decision_undo_seconds` (default 5) for a pending approval or
9216
+ * proposal; 0 when something already waits on the answer; null for work and closed rows.
9217
+ */
9218
+ undo_seconds?: number | null;
9219
+ /** Why a decision here cannot be held (it is made at once) — the store's sentence, or null. */
9220
+ undo_refusal?: string | null;
9194
9221
  }
9195
9222
  /**
9196
9223
  * Which of a person's three inbox views `custom.work_inbox` answers (lane S5-PRIME-2): what is
@@ -11448,9 +11475,16 @@ interface RecordsClient {
11448
11475
  view_id: Uuid;
11449
11476
  record_ids: Uuid[];
11450
11477
  }): Promise<RecordsResult<ViewOrderSet>>;
11451
- /** G13. A page of a hand-ordered view: placed rows by position, then the rest by created time. */
11478
+ /**
11479
+ * G13 + ORDER-FILTER. A page of a hand-ordered view: placed rows by position, then the rest by
11480
+ * created time. `filter` is the list door's question (`StoreFilter`: a flat map or a nested
11481
+ * Rule — the view's own `where`, or a number clicked on a dashboard); given, the store reads
11482
+ * exactly the rows that match, in their places, and `limit`/`offset` page THAT order. Each row
11483
+ * answers the position stored for it; rows the filter hides keep theirs.
11484
+ */
11452
11485
  readInViewOrder(args: {
11453
11486
  view_id: Uuid;
11487
+ filter?: StoreFilter | null | undefined;
11454
11488
  limit?: number;
11455
11489
  offset?: number;
11456
11490
  }): Promise<RecordsResult<Array<ReadRow & {
@@ -2714,7 +2714,7 @@ declare const STORE_DOORS: readonly [{
2714
2714
  readonly security: "definer";
2715
2715
  }, {
2716
2716
  readonly name: "read_records_in_view_order";
2717
- readonly args: "p_organization_id uuid, p_view_id uuid, p_by_id boolean DEFAULT false, p_limit integer DEFAULT 200, p_offset integer DEFAULT 0";
2717
+ readonly args: "p_organization_id uuid, p_view_id uuid, p_by_id boolean DEFAULT false, p_limit integer DEFAULT 200, p_offset integer DEFAULT 0, p_filter jsonb DEFAULT NULL::jsonb";
2718
2718
  readonly returns: "TABLE(id uuid, document jsonb, level permission_level, \"position\" numeric)";
2719
2719
  readonly security: "definer";
2720
2720
  }, {
@@ -2837,6 +2837,21 @@ declare const STORE_DOORS: readonly [{
2837
2837
  readonly args: "p_organization_id uuid, p_record_id uuid, p_relations integer DEFAULT 12, p_history integer DEFAULT 15, p_siblings integer DEFAULT 8";
2838
2838
  readonly returns: "jsonb";
2839
2839
  readonly security: "definer";
2840
+ }, {
2841
+ readonly name: "record_source_key";
2842
+ readonly args: "p_table_id uuid";
2843
+ readonly returns: "text";
2844
+ readonly security: "invoker";
2845
+ }, {
2846
+ readonly name: "record_source_keys";
2847
+ readonly args: "p_table_id uuid";
2848
+ readonly returns: "text[]";
2849
+ readonly security: "invoker";
2850
+ }, {
2851
+ readonly name: "record_source_table";
2852
+ readonly args: "p_key text";
2853
+ readonly returns: "uuid";
2854
+ readonly security: "invoker";
2840
2855
  }, {
2841
2856
  readonly name: "record_stage_pending";
2842
2857
  readonly args: "p_organization_id uuid, p_record_id uuid";
@@ -3735,7 +3750,7 @@ declare const STORE_DOORS: readonly [{
3735
3750
  }, {
3736
3751
  readonly name: "work_inbox";
3737
3752
  readonly args: "p_organization_id uuid, p_limit integer DEFAULT 50, p_offset integer DEFAULT 0, p_include_decided boolean DEFAULT false, p_view text DEFAULT 'inbox'::text";
3738
- readonly 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, table_id uuid, table_name text, decided_by uuid, decided_by_name text, decided_at timestamp with time zone, outcome text, snoozed_until timestamp with time zone, cleared_at timestamp with time zone, snoozed_count integer, cleared_count integer)";
3753
+ readonly 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, table_id uuid, table_name text, decided_by uuid, decided_by_name text, decided_at timestamp with time zone, outcome text, snoozed_until timestamp with time zone, cleared_at timestamp with time zone, snoozed_count integer, cleared_count integer, undo_seconds integer, undo_refusal text)";
3739
3754
  readonly security: "definer";
3740
3755
  }, {
3741
3756
  readonly name: "work_instantiation_shape";
@@ -3925,6 +3940,10 @@ declare const STORE_KNOBS: readonly [{
3925
3940
  readonly key: "cross_organization_links";
3926
3941
  readonly value: "false";
3927
3942
  readonly type: "boolean";
3943
+ }, {
3944
+ readonly key: "decision_undo_seconds";
3945
+ readonly value: "5";
3946
+ readonly type: "integer";
3928
3947
  }, {
3929
3948
  readonly key: "decoration_rules_max";
3930
3949
  readonly value: "50";
@@ -4161,7 +4180,7 @@ declare const STORE_REFUSAL_CODES: readonly [{
4161
4180
  readonly raised_by: "_portal_config_judge,_share_write_person,_unique_rule_holds,doc_sign,doc_signature_write,entity_field_declare,field_declare,home_add,inbound_declare,io_proposal_accept,relation_carry,relation_own,sign_request_cancel,sign_request_create,table_share_outside_resend,work_approval_decide,work_slot_hold";
4162
4181
  }, {
4163
4182
  readonly code: "23514";
4164
- readonly raised_by: "_checklist_instantiate,_checklist_step_guard,_containment_guard,_dated_values_guard,_derived_fields,_display_format_check,_display_spec_for,_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,_relation_halves_agree,_relation_kernel_targets,_resolve_choice_words,_rule_shape_guard,_rule_topology_guard,_store_relation_edge_names_its_field,_table_columns_word_guard,_table_shape_guard,_undeclared_key_guard,_value_envelope,_with_display,_work_shape_guard,_workdoors_approval_guard,action_run,assert_columns_are_defined,assert_entity_is_organization_scoped,booking_declare,capture_publish,capture_sheet_declare,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_comment_write,io_import_rows,migrate_merge,migrate_purge_hard,portal_archive,portal_restore,record_restore,record_write_graph,relation_carry,relation_halves_repair,relation_own,sign_request_create,sign_request_sign,table_declare,table_from_example,validate_value_envelope,validate_values,work_set_state,work_slots_declare,work_take_assignment,work_template_instantiate";
4183
+ readonly raised_by: "_checklist_instantiate,_checklist_step_guard,_containment_guard,_dated_values_guard,_derived_fields,_display_format_check,_display_spec_for,_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,_record_source_key_is_record,_relation_halves_agree,_relation_kernel_targets,_resolve_choice_words,_rule_shape_guard,_rule_topology_guard,_store_relation_edge_names_its_field,_table_columns_word_guard,_table_shape_guard,_undeclared_key_guard,_value_envelope,_with_display,_work_shape_guard,_workdoors_approval_guard,action_run,assert_columns_are_defined,assert_entity_is_organization_scoped,booking_declare,capture_publish,capture_sheet_declare,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_comment_write,io_import_rows,migrate_merge,migrate_purge_hard,portal_archive,portal_restore,record_restore,record_write_graph,relation_carry,relation_halves_repair,relation_own,sign_request_create,sign_request_sign,table_declare,table_from_example,validate_value_envelope,validate_values,work_set_state,work_slots_declare,work_take_assignment,work_template_instantiate";
4165
4184
  }, {
4166
4185
  readonly code: "40001";
4167
4186
  readonly raised_by: "has_visibility_at,table_move";
@@ -9191,6 +9210,14 @@ interface WorkInboxItem {
9191
9210
  /** How many of this person's items are snoozed / cleared right now — the same on every row. */
9192
9211
  snoozed_count?: number;
9193
9212
  cleared_count?: number;
9213
+ /**
9214
+ * HOW LONG A DECISION ON THIS ROW IS HELD WITH UNDO before it is made (VERIFIER-20), in seconds:
9215
+ * the organization's `custom/decision_undo_seconds` (default 5) for a pending approval or
9216
+ * proposal; 0 when something already waits on the answer; null for work and closed rows.
9217
+ */
9218
+ undo_seconds?: number | null;
9219
+ /** Why a decision here cannot be held (it is made at once) — the store's sentence, or null. */
9220
+ undo_refusal?: string | null;
9194
9221
  }
9195
9222
  /**
9196
9223
  * Which of a person's three inbox views `custom.work_inbox` answers (lane S5-PRIME-2): what is
@@ -11448,9 +11475,16 @@ interface RecordsClient {
11448
11475
  view_id: Uuid;
11449
11476
  record_ids: Uuid[];
11450
11477
  }): Promise<RecordsResult<ViewOrderSet>>;
11451
- /** G13. A page of a hand-ordered view: placed rows by position, then the rest by created time. */
11478
+ /**
11479
+ * G13 + ORDER-FILTER. A page of a hand-ordered view: placed rows by position, then the rest by
11480
+ * created time. `filter` is the list door's question (`StoreFilter`: a flat map or a nested
11481
+ * Rule — the view's own `where`, or a number clicked on a dashboard); given, the store reads
11482
+ * exactly the rows that match, in their places, and `limit`/`offset` page THAT order. Each row
11483
+ * answers the position stored for it; rows the filter hides keep theirs.
11484
+ */
11452
11485
  readInViewOrder(args: {
11453
11486
  view_id: Uuid;
11487
+ filter?: StoreFilter | null | undefined;
11454
11488
  limit?: number;
11455
11489
  offset?: number;
11456
11490
  }): Promise<RecordsResult<Array<ReadRow & {
@@ -3151,7 +3151,7 @@ var STORE_DOORS = [
3151
3151
  { 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" },
3152
3152
  { name: "read_records_archived", args: "p_organization_id uuid, p_table_id uuid, p_lane text DEFAULT 'org'::text, 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, archived_at timestamp with time zone, archived_by uuid, archived_by_name text)", security: "definer" },
3153
3153
  { name: "read_records_by_ids", args: "p_organization_id uuid, p_table_id uuid, p_record_ids uuid[], p_by_id boolean DEFAULT false", returns: "TABLE(id uuid, document jsonb, level permission_level)", security: "definer" },
3154
- { name: "read_records_in_view_order", args: "p_organization_id uuid, p_view_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, "position" numeric)', security: "definer" },
3154
+ { name: "read_records_in_view_order", args: "p_organization_id uuid, p_view_id uuid, p_by_id boolean DEFAULT false, p_limit integer DEFAULT 200, p_offset integer DEFAULT 0, p_filter jsonb DEFAULT NULL::jsonb", returns: 'TABLE(id uuid, document jsonb, level permission_level, "position" numeric)', security: "definer" },
3155
3155
  { name: "read_records_matching", args: "p_organization_id uuid, p_table_id uuid, p_filter jsonb DEFAULT '{}'::jsonb, 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" },
3156
3156
  { name: "realtime_topic_admits", args: "p_topic text", returns: "boolean", security: "definer" },
3157
3157
  { name: "record_aggregate", args: "p_organization_id uuid, p_table_id uuid, p_group_by jsonb DEFAULT '[]'::jsonb, p_measures jsonb DEFAULT '[]'::jsonb, p_bucket jsonb DEFAULT NULL::jsonb, p_filter jsonb DEFAULT '{}'::jsonb, p_limit integer DEFAULT 200, p_required text DEFAULT 'viewer'::text, p_compare jsonb DEFAULT NULL::jsonb", returns: "TABLE(groups jsonb, measures jsonb, row_count bigint, prior_groups jsonb, prior_measures jsonb, prior_row_count bigint, delta jsonb, compare jsonb)", security: "definer" },
@@ -3176,6 +3176,9 @@ var STORE_DOORS = [
3176
3176
  { name: "record_restore_version", args: "p_organization_id uuid, p_record_id uuid, p_version integer", returns: "jsonb", security: "definer" },
3177
3177
  { name: "record_restore_version", args: "p_organization_id uuid, p_record_id uuid, p_version integer, p_author jsonb", returns: "jsonb", security: "definer" },
3178
3178
  { 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" },
3179
+ { name: "record_source_key", args: "p_table_id uuid", returns: "text", security: "invoker" },
3180
+ { name: "record_source_keys", args: "p_table_id uuid", returns: "text[]", security: "invoker" },
3181
+ { name: "record_source_table", args: "p_key text", returns: "uuid", security: "invoker" },
3179
3182
  { name: "record_stage_pending", args: "p_organization_id uuid, p_record_id uuid", returns: "jsonb", security: "definer" },
3180
3183
  { name: "record_state_as_of", args: "p_record_id uuid, p_at timestamp with time zone", returns: "TABLE(state jsonb, replayed boolean)", security: "definer" },
3181
3184
  { name: "record_table", args: "p_organization_id uuid, p_record_id uuid", returns: "uuid", security: "definer" },
@@ -3355,7 +3358,7 @@ var STORE_DOORS = [
3355
3358
  { name: "work_assignment_fields", args: "p_options_table_id uuid DEFAULT NULL::uuid", returns: "TABLE(key text, label text, spec jsonb)", security: "invoker" },
3356
3359
  { name: "work_decide_many", args: "p_organization_id uuid, p_decisions jsonb", returns: "jsonb", security: "definer" },
3357
3360
  { name: "work_has_assignment", args: "p_organization_id uuid, p_table_id uuid", returns: "boolean", security: "definer" },
3358
- { name: "work_inbox", args: "p_organization_id uuid, p_limit integer DEFAULT 50, p_offset integer DEFAULT 0, p_include_decided boolean DEFAULT false, p_view text DEFAULT 'inbox'::text", 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, table_id uuid, table_name text, decided_by uuid, decided_by_name text, decided_at timestamp with time zone, outcome text, snoozed_until timestamp with time zone, cleared_at timestamp with time zone, snoozed_count integer, cleared_count integer)", security: "definer" },
3361
+ { name: "work_inbox", args: "p_organization_id uuid, p_limit integer DEFAULT 50, p_offset integer DEFAULT 0, p_include_decided boolean DEFAULT false, p_view text DEFAULT 'inbox'::text", 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, table_id uuid, table_name text, decided_by uuid, decided_by_name text, decided_at timestamp with time zone, outcome text, snoozed_until timestamp with time zone, cleared_at timestamp with time zone, snoozed_count integer, cleared_count integer, undo_seconds integer, undo_refusal text)", security: "definer" },
3359
3362
  { name: "work_instantiation_shape", args: "p_organization_id uuid, p_instantiation_id uuid", returns: "jsonb", security: "definer" },
3360
3363
  { 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" },
3361
3364
  { name: "work_person", args: "p_organization_id uuid, p_user_id uuid, p_create boolean DEFAULT true", returns: "uuid", security: "definer" },
@@ -3399,6 +3402,7 @@ var STORE_KNOBS = [
3399
3402
  { key: "containment_depth_ceiling", value: "16", type: "integer" },
3400
3403
  { key: "context_copy_following", value: "true", type: "boolean" },
3401
3404
  { key: "cross_organization_links", value: "false", type: "boolean" },
3405
+ { key: "decision_undo_seconds", value: "5", type: "integer" },
3402
3406
  { key: "decoration_rules_max", value: "50", type: "integer" },
3403
3407
  { key: "decorations_max_bytes", value: "262144", type: "integer" },
3404
3408
  { key: "document_letterhead", value: "{}", type: "json" },
@@ -3460,7 +3464,7 @@ var STORE_REFUSAL_CODES = [
3460
3464
  { code: "22023", raised_by: "_action_check,_booking_availability,_decorations_check,_entity_custom_fields_guard,_fx_date,_fx_num,_fx_unit,_fxp_level,_fxp_resolve,_fxp_tokens,_portal_config_judge,_take_op_id,_value_envelope,_view_field_key,_view_key_value,_work_shape_guard,action_run,actor_word,agg_assert_key,agg_calendar,agg_compare_windows,agg_sql,anon_token_issue,booking_declare,containment_parent,dashboard_block_normalize,dashboard_run,dashboard_target_field_assert,dashboard_window_sql,doc_render_body,doc_render_write,doc_signature_write,enrich_declare,enrich_land,enrich_normalize,enrich_pin,entity_reference_words,entity_value_write,external_history_event,external_source_declare,external_stub_upsert,external_write_through,field_history,field_update,form_declare,form_draft_save,formula_eval,formula_parse,grid_layout_check,hub_changed_by,inbox_snooze,io_export,io_import_begin,io_import_finish,io_import_plan,io_import_report,io_proposal_accept,list_portals,migrate_merge,migrate_reclass,my_levels,organization_clear,page_size,pin_agent_cells,pipeline_move,pipeline_move_many,portal_declare,portal_form_submit,provenance_write,query_by_coordinates,query_rollup,read_records_archived,read_records_in_view_order,record_filter_sql,record_update,record_write_graph,record_write_many,relation_carry,rule_eval,rule_filter_node_sql,rule_members,rule_members_visible,rule_sql_op,scope_table_provision,share_grant,share_lane_set,sign_request_create,sign_request_sign,subscription_declare,table_from_example,table_move,table_rules,table_share_outside_grant,table_sync,table_webhook_declare,view_declare,view_keys_check,view_record_order_set,visibility_as_of,work_approval_request,work_decide_many,work_inbox,work_list,work_slot_hold" },
3461
3465
  { code: "23503", raised_by: "_action_check,_booking_availability,_checklist_instantiate,_containment_guard,_decorations_check,_display_spec_for,_field_document_for,_field_type_parity_guard,_pipeline_stage_key,_record_rule_uses,action_declare,action_run,agg_digest_assemble,anon_publish,anon_rate_take,anon_token_issue,anon_write,assert_organization_wall,autonumber_backfill,booking_cancel,booking_confirm,booking_declare,booking_hold,booking_reschedule,capture_publish,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_draft_save,form_submit,grid_layout,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,pipeline_board,pipeline_declare,pipeline_move,pipeline_read,pipeline_transition_refusal,promote_field,promote_table,read_records_in_view_order,record_applicability,record_reparent,relation_carry,relation_own,resolve_first_match,rule_applies,rule_declare,rule_eval,rule_filter_node_sql,rule_members,rule_members_visible,rule_run,sign_request_create,subscription_mute,subscription_preview,table_decorate,table_from_example,table_webhook_archive,table_webhook_declare,view_declare,view_record_order_set,work_set_state,work_take_assignment,work_template_instantiate" },
3462
3466
  { code: "23505", raised_by: "_portal_config_judge,_share_write_person,_unique_rule_holds,doc_sign,doc_signature_write,entity_field_declare,field_declare,home_add,inbound_declare,io_proposal_accept,relation_carry,relation_own,sign_request_cancel,sign_request_create,table_share_outside_resend,work_approval_decide,work_slot_hold" },
3463
- { code: "23514", raised_by: "_checklist_instantiate,_checklist_step_guard,_containment_guard,_dated_values_guard,_derived_fields,_display_format_check,_display_spec_for,_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,_relation_halves_agree,_relation_kernel_targets,_resolve_choice_words,_rule_shape_guard,_rule_topology_guard,_store_relation_edge_names_its_field,_table_columns_word_guard,_table_shape_guard,_undeclared_key_guard,_value_envelope,_with_display,_work_shape_guard,_workdoors_approval_guard,action_run,assert_columns_are_defined,assert_entity_is_organization_scoped,booking_declare,capture_publish,capture_sheet_declare,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_comment_write,io_import_rows,migrate_merge,migrate_purge_hard,portal_archive,portal_restore,record_restore,record_write_graph,relation_carry,relation_halves_repair,relation_own,sign_request_create,sign_request_sign,table_declare,table_from_example,validate_value_envelope,validate_values,work_set_state,work_slots_declare,work_take_assignment,work_template_instantiate" },
3467
+ { code: "23514", raised_by: "_checklist_instantiate,_checklist_step_guard,_containment_guard,_dated_values_guard,_derived_fields,_display_format_check,_display_spec_for,_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,_record_source_key_is_record,_relation_halves_agree,_relation_kernel_targets,_resolve_choice_words,_rule_shape_guard,_rule_topology_guard,_store_relation_edge_names_its_field,_table_columns_word_guard,_table_shape_guard,_undeclared_key_guard,_value_envelope,_with_display,_work_shape_guard,_workdoors_approval_guard,action_run,assert_columns_are_defined,assert_entity_is_organization_scoped,booking_declare,capture_publish,capture_sheet_declare,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_comment_write,io_import_rows,migrate_merge,migrate_purge_hard,portal_archive,portal_restore,record_restore,record_write_graph,relation_carry,relation_halves_repair,relation_own,sign_request_create,sign_request_sign,table_declare,table_from_example,validate_value_envelope,validate_values,work_set_state,work_slots_declare,work_take_assignment,work_template_instantiate" },
3464
3468
  { code: "40001", raised_by: "has_visibility_at,table_move" },
3465
3469
  { code: "42501", raised_by: "_context_copy_fence,_doc_render_immutable,_doc_signature_immutable,_field_definition_write,_field_write_door,_portal_config_judge,_portal_principal_here,_rule_definition_write,_store_door,agent_table_claim,agg_fields_readable_assert,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,booking_confirm,booking_declare,booking_hold,capture_submit,checklist_run,comment_write,context_resolve,conversation_scope_bind,conversation_scope_unbind,dashboard_target_field_assert,doc_sign,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_draft_save,form_public_asks,form_submit,inbound_mail_land,inbox_clear,inbox_snooze,inbox_unclear,inbox_unsnooze,io_comment_resolve,io_comment_write,io_import_begin,io_import_finish,io_restore,migrate_purge,migrate_purge_hard,migrate_purge_hard_request,migrate_reclass,my_levels,organization_clear,organization_contents,portal_declare,portal_form,portal_form_submit,portal_invitation,portal_invite,portal_invite_accept,portal_principal_bind,promote_table,query_visibility_parity,read_record,read_records,read_records_archived,read_records_by_ids,read_records_matching,record_table,record_write_graph,relation_halves_disagreements,relation_halves_repair,resolve_context,scope_table_provision,share_grant,subscription_mute,subscription_preview,table_move,table_share_outside_accept,table_share_outside_grant,table_share_outside_invite,table_share_outside_resend,table_webhook_declare,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_person" },
3466
3470
  { code: "42703", raised_by: "entity_table,portal_declare" },
@@ -7542,10 +7546,18 @@ function createRecordsClient(config) {
7542
7546
  "viewRecordOrderSet"
7543
7547
  );
7544
7548
  },
7545
- async readInViewOrder({ view_id, limit, offset }) {
7549
+ async readInViewOrder({ view_id, filter, limit, offset }) {
7550
+ const asked = filter && Object.keys(filter).length > 0 ? filter : null;
7546
7551
  const door = await callDoor(
7547
7552
  DOORS.readRecordsInViewOrder,
7548
- { p_organization_id: org, p_view_id: view_id, p_by_id: false, p_limit: limit ?? 200, p_offset: offset ?? 0 },
7553
+ {
7554
+ p_organization_id: org,
7555
+ p_view_id: view_id,
7556
+ p_by_id: false,
7557
+ p_limit: limit ?? 200,
7558
+ p_offset: offset ?? 0,
7559
+ ...asked ? { p_filter: asked } : {}
7560
+ },
7549
7561
  "readInViewOrder"
7550
7562
  );
7551
7563
  if (!door.ok) return err(door.error);