@ai-matrx/records 0.11.0 → 0.17.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 +154 -0
- package/dist/core/index.cjs +364 -34
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +157 -8
- package/dist/core/index.d.ts +157 -8
- package/dist/core/index.js +364 -34
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +134 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +719 -11
- package/dist/index.d.ts +719 -11
- package/dist/index.js +134 -8
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +361 -31
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +855 -16
- package/dist/react/index.d.ts +855 -16
- package/dist/react/index.js +361 -31
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -145,7 +145,24 @@ var STORE_DOORS = [
|
|
|
145
145
|
{ name: "caller_role", args: "", returns: "name", security: "invoker" },
|
|
146
146
|
{ 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" },
|
|
147
147
|
{ 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" },
|
|
148
|
+
{ name: "choice_census", args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid", returns: "jsonb", security: "definer" },
|
|
149
|
+
{ name: "choice_field_map", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "invoker" },
|
|
150
|
+
{ name: "choice_filter_normalize", args: "p_map jsonb, p_filter jsonb", returns: "jsonb", security: "invoker" },
|
|
151
|
+
{ name: "choice_key_for", args: "p_organization_id uuid, p_options_table_id uuid, p_title text, p_exclude uuid DEFAULT NULL::uuid", returns: "text", security: "invoker" },
|
|
152
|
+
{ name: "choice_key_of", args: "p_field jsonb, p_token text", returns: "text", security: "invoker" },
|
|
153
|
+
{ name: "choice_options", args: "p_organization_id uuid, p_options_table_id uuid", returns: "jsonb", security: "invoker" },
|
|
154
|
+
{ name: "choice_render", args: "p_organization_id uuid, p_table_id uuid, p_doc jsonb", returns: "jsonb", security: "invoker" },
|
|
155
|
+
{ name: "choice_render_groups", args: "p_map jsonb, p_groups jsonb", returns: "jsonb", security: "invoker" },
|
|
156
|
+
{ name: "choice_render_note", args: "p_field jsonb, p_value jsonb", returns: "jsonb", security: "invoker" },
|
|
157
|
+
{ name: "choice_render_value", args: "p_field jsonb, p_value jsonb", returns: "jsonb", security: "invoker" },
|
|
158
|
+
{ name: "choice_slug", args: "p_word text", returns: "text", security: "invoker" },
|
|
159
|
+
{ name: "choice_synonyms", args: "p_organization_id uuid, p_table_id uuid, p_token text", returns: "text[]", security: "invoker" },
|
|
160
|
+
{ name: "choice_synonyms_in", args: "p_map jsonb, p_token text", returns: "text[]", security: "invoker" },
|
|
161
|
+
{ name: "choice_words", args: "p_field jsonb", returns: "text", security: "invoker" },
|
|
148
162
|
{ name: "client_write_grants", args: "", returns: "TABLE(role_name text, object_name text, privilege text)", security: "invoker" },
|
|
163
|
+
{ 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" },
|
|
164
|
+
{ name: "comment_thread", args: "p_organization_id uuid, p_record_id uuid, p_include_resolved boolean DEFAULT false", returns: "jsonb", security: "definer" },
|
|
165
|
+
{ 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" },
|
|
149
166
|
{ 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" },
|
|
150
167
|
{ name: "containment_chain", args: "p_organization_id uuid, p_record_id uuid", returns: "TABLE(ancestor_id uuid, depth integer)", security: "invoker" },
|
|
151
168
|
{ name: "containment_depth_ceiling", args: "p_organization_id uuid DEFAULT NULL::uuid", returns: "integer", security: "invoker" },
|
|
@@ -153,6 +170,17 @@ var STORE_DOORS = [
|
|
|
153
170
|
{ name: "containment_parent", args: "p_data jsonb", returns: "uuid", security: "invoker" },
|
|
154
171
|
{ name: "cross_organization_links_open", args: "p_source_organization_id uuid, p_target_organization_id uuid", returns: "boolean", security: "invoker" },
|
|
155
172
|
{ name: "custom_fields_tables", args: "", returns: "TABLE(token text, schema_name text, table_name text)", security: "invoker" },
|
|
173
|
+
{ name: "dashboard_block_normalize", args: "p_organization_id uuid, p_subject_table_id uuid, p_block jsonb", returns: "jsonb", security: "definer" },
|
|
174
|
+
{ name: "dashboard_class", args: "", returns: "text", security: "invoker" },
|
|
175
|
+
{ name: "dashboard_declare", args: "p_organization_id uuid, p_table_id uuid, p_name text, p_blocks jsonb DEFAULT '[]'::jsonb, p_presentation jsonb DEFAULT '{}'::jsonb, p_dashboard_id uuid DEFAULT NULL::uuid", returns: "uuid", security: "definer" },
|
|
176
|
+
{ name: "dashboard_delete", args: "p_organization_id uuid, p_dashboard_id uuid", returns: "boolean", security: "definer" },
|
|
177
|
+
{ name: "dashboard_field_keys", args: "p_organization_id uuid, p_table_id uuid", returns: "text[]", security: "definer" },
|
|
178
|
+
{ name: "dashboard_kinds", args: "", returns: "text[]", security: "invoker" },
|
|
179
|
+
{ name: "dashboard_moment_sql", args: "p_key text", returns: "text", security: "invoker" },
|
|
180
|
+
{ name: "dashboard_run", args: "p_organization_id uuid, p_dashboard_id uuid, p_filter jsonb DEFAULT '{}'::jsonb", returns: "jsonb", security: "definer" },
|
|
181
|
+
{ name: "dashboard_stuck", args: "p_organization_id uuid, p_table_id uuid, p_state_key text, p_days integer DEFAULT 14, p_filter jsonb DEFAULT '{}'::jsonb, p_limit integer DEFAULT 50, p_required text DEFAULT 'viewer'::text", returns: "TABLE(record_id uuid, title text, state text, last_changed_at timestamp with time zone, days_unchanged numeric, measured_from text)", security: "definer" },
|
|
182
|
+
{ name: "dashboard_window_sql", args: "p_key text, p_window jsonb", returns: "text", security: "invoker" },
|
|
183
|
+
{ name: "dashboards", args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid", returns: "TABLE(dashboard_id uuid, table_id uuid, name text, blocks jsonb, presentation jsonb, block_count integer, version integer, created_at timestamp with time zone, updated_at timestamp with time zone)", security: "definer" },
|
|
156
184
|
{ name: "delete_cascade_closure", args: "p_organization_id uuid, p_record_id uuid", returns: "uuid[]", security: "invoker" },
|
|
157
185
|
{ name: "delete_preview", args: "p_organization_id uuid, p_record_id uuid", returns: "jsonb", security: "definer" },
|
|
158
186
|
{ name: "delete_rule", args: "p_organization_id uuid, p_record_id uuid, p_apply boolean DEFAULT true", returns: "jsonb", security: "definer" },
|
|
@@ -167,13 +195,17 @@ var STORE_DOORS = [
|
|
|
167
195
|
{ name: "doc_render_document", args: "p_organization_id uuid, p_template_id uuid, p_record_id uuid", returns: "uuid", security: "definer" },
|
|
168
196
|
{ name: "doc_render_read", args: "p_organization_id uuid, p_render_id uuid", returns: "jsonb", security: "definer" },
|
|
169
197
|
{ 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" },
|
|
198
|
+
{ 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" },
|
|
170
199
|
{ 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" },
|
|
171
200
|
{ name: "doc_signature_field_ok", args: "p_field_data jsonb", returns: "boolean", security: "invoker" },
|
|
172
201
|
{ name: "doc_signature_intact", args: "p_organization_id uuid, p_signature_id uuid", returns: "jsonb", security: "invoker" },
|
|
173
202
|
{ name: "doc_signature_read", args: "p_organization_id uuid, p_signature_id uuid", returns: "jsonb", security: "definer" },
|
|
174
203
|
{ 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" },
|
|
204
|
+
{ 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" },
|
|
205
|
+
{ name: "doc_template_delete", args: "p_organization_id uuid, p_template_id uuid", returns: "boolean", security: "definer" },
|
|
175
206
|
{ name: "doc_template_read", args: "p_organization_id uuid, p_template_id uuid", returns: "jsonb", security: "definer" },
|
|
176
207
|
{ 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" },
|
|
208
|
+
{ 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" },
|
|
177
209
|
{ name: "doc_token_pattern", args: "", returns: "text", security: "invoker" },
|
|
178
210
|
{ name: "doc_tokens", args: "p_body text", returns: "TABLE(ordinal integer, raw text, field_id uuid)", security: "invoker" },
|
|
179
211
|
{ 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" },
|
|
@@ -202,6 +234,7 @@ var STORE_DOORS = [
|
|
|
202
234
|
{ name: "field_behaviour", args: "p_field_data jsonb", returns: "text", security: "invoker" },
|
|
203
235
|
{ name: "field_declare", args: "p_organization_id uuid, p_table_id uuid, p_spec jsonb", returns: "uuid", security: "definer" },
|
|
204
236
|
{ 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" },
|
|
237
|
+
{ 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" },
|
|
205
238
|
{ name: "field_kernel_id", args: "", returns: "uuid", security: "invoker" },
|
|
206
239
|
{ name: "field_options", args: "p_organization_id uuid, p_field_id uuid", returns: "SETOF custom.record", security: "definer" },
|
|
207
240
|
{ name: "field_retire", args: "p_organization_id uuid, p_field_id uuid", returns: "boolean", security: "definer" },
|
|
@@ -220,7 +253,11 @@ var STORE_DOORS = [
|
|
|
220
253
|
{ 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" },
|
|
221
254
|
{ 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" },
|
|
222
255
|
{ name: "hidden_field_notice", args: "p_field custom.record, p_action text DEFAULT 'read'::text", returns: "jsonb", security: "invoker" },
|
|
256
|
+
{ name: "history_actor", args: "p_tier text, p_document jsonb, p_actor_id uuid, p_people jsonb", returns: "jsonb", security: "invoker" },
|
|
257
|
+
{ name: "history_changes", args: "p_organization_id uuid, p_table_id uuid, p_old jsonb, p_new jsonb", returns: "jsonb", security: "invoker" },
|
|
258
|
+
{ name: "history_people", args: "p_organization_id uuid, p_ids uuid[]", returns: "jsonb", security: "definer" },
|
|
223
259
|
{ 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" },
|
|
260
|
+
{ name: "history_restore_body", args: "p_current jsonb, p_target jsonb, p_field_key text DEFAULT NULL::text", returns: "jsonb", security: "invoker" },
|
|
224
261
|
{ name: "history_retention", args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid", returns: "jsonb", security: "definer" },
|
|
225
262
|
{ name: "history_retention_floor_raise", args: "p_organization_id uuid, p_days integer", returns: "integer", security: "definer" },
|
|
226
263
|
{ name: "history_retention_set", args: "p_organization_id uuid, p_table_id uuid, p_days integer", returns: "integer", security: "definer" },
|
|
@@ -249,16 +286,20 @@ var STORE_DOORS = [
|
|
|
249
286
|
{ name: "io_restore", args: "p_organization_id uuid, p_record_id uuid, p_version integer", returns: "integer", security: "definer" },
|
|
250
287
|
{ 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" },
|
|
251
288
|
{ 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" },
|
|
289
|
+
{ 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" },
|
|
290
|
+
{ 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" },
|
|
252
291
|
{ name: "lookup_value", args: "p_organization_id uuid, p_record_id uuid, p_field_data jsonb", returns: "jsonb", security: "invoker" },
|
|
253
292
|
{ 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" },
|
|
254
293
|
{ 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" },
|
|
255
294
|
{ name: "merge_field_kernel_id", args: "", returns: "uuid", security: "invoker" },
|
|
295
|
+
{ name: "migrate_choice_keys", args: "p_organization_id uuid, p_table_id uuid, p_dry_run boolean DEFAULT false", returns: "jsonb", security: "definer" },
|
|
256
296
|
{ name: "migrate_delete", args: "p_organization_id uuid, p_record_id uuid, p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
257
297
|
{ name: "migrate_demote", args: "p_organization_id uuid, p_table_id uuid, p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
258
298
|
{ name: "migrate_extract_parent", args: "p_organization_id uuid, p_id uuid, p_parent_table_id uuid, p_moved_keys text[], p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
259
299
|
{ name: "migrate_merge", args: "p_organization_id uuid, p_winner_id uuid, p_loser_id uuid, p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
260
300
|
{ name: "migrate_promote", args: "p_organization_id uuid, p_table_id uuid, p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
261
301
|
{ name: "migrate_purge", args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid, p_dry_run boolean DEFAULT true", returns: "jsonb", security: "definer" },
|
|
302
|
+
{ name: "migrate_reclass", args: "p_organization_id uuid, p_id uuid, p_to text DEFAULT 'field'::text, p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
262
303
|
{ name: "migrate_rename", args: "p_organization_id uuid, p_id uuid, p_to text, p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
263
304
|
{ name: "migrate_reparent", args: "p_organization_id uuid, p_id uuid, p_parent_id uuid, p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
264
305
|
{ name: "migrate_retype", args: "p_organization_id uuid, p_id uuid, p_to text, p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
@@ -278,6 +319,20 @@ var STORE_DOORS = [
|
|
|
278
319
|
{ 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" },
|
|
279
320
|
{ name: "per_value_access_words", args: "", returns: "text[]", security: "invoker" },
|
|
280
321
|
{ name: "person_kernel_id", args: "", returns: "uuid", security: "invoker" },
|
|
322
|
+
{ name: "portal_admits", args: "p_organization_id uuid, p_user_id uuid DEFAULT NULL::uuid", returns: "boolean", security: "definer" },
|
|
323
|
+
{ name: "portal_card", args: "p_organization_id uuid, p_portal_id uuid", returns: "jsonb", security: "definer" },
|
|
324
|
+
{ 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" },
|
|
325
|
+
{ name: "portal_field_map", args: "p_organization_id uuid, p_table_id uuid", returns: "TABLE(field_id uuid, field_key text, field_type text, points_at uuid)", security: "definer" },
|
|
326
|
+
{ name: "portal_invitation", args: "p_slug text, p_email text", returns: "jsonb", security: "definer" },
|
|
327
|
+
{ name: "portal_invite", args: "p_organization_id uuid, p_portal_id uuid, p_client_record_id uuid, p_email text, p_user_id uuid DEFAULT NULL::uuid", returns: "jsonb", security: "definer" },
|
|
328
|
+
{ name: "portal_me", args: "", returns: "jsonb", security: "definer" },
|
|
329
|
+
{ name: "portal_preview", args: "p_organization_id uuid, p_portal_id uuid, p_principal_id uuid, p_table_id uuid", returns: "TABLE(record_id uuid, title text)", security: "definer" },
|
|
330
|
+
{ name: "portal_principal_bind", args: "p_organization_id uuid, p_principal_id uuid, p_user_id uuid", returns: "jsonb", security: "definer" },
|
|
331
|
+
{ name: "portal_public", args: "p_slug text", returns: "jsonb", security: "definer" },
|
|
332
|
+
{ name: "portal_record_title", args: "p_organization_id uuid, p_record_id uuid", returns: "text", security: "definer" },
|
|
333
|
+
{ name: "portal_revoke", args: "p_organization_id uuid, p_portal_id uuid, p_principal_id uuid", returns: "jsonb", security: "definer" },
|
|
334
|
+
{ name: "portal_slug", args: "p_organization_id uuid, p_title text, p_portal_id uuid DEFAULT NULL::uuid", returns: "text", security: "definer" },
|
|
335
|
+
{ name: "portals", args: "p_organization_id uuid", returns: "TABLE(portal_id uuid, title text, slug text, client_table_id uuid, client_table text, is_active boolean, tables integer, invited integer, signed_in integer, sign_in_method text, opened_at timestamp with time zone)", security: "definer" },
|
|
281
336
|
{ name: "presentation_kernel_id", args: "", returns: "uuid", security: "invoker" },
|
|
282
337
|
{ name: "promote_field", args: "p_organization_id uuid, p_table_id uuid, p_field_id uuid", returns: "jsonb", security: "invoker" },
|
|
283
338
|
{ name: "promote_table", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "definer" },
|
|
@@ -323,15 +378,20 @@ var STORE_DOORS = [
|
|
|
323
378
|
{ name: "record_card", args: "p_viewer uuid, p_organization_id uuid, p_record_id uuid", returns: "jsonb", security: "definer" },
|
|
324
379
|
{ 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" },
|
|
325
380
|
{ name: "record_delete", args: "p_organization_id uuid, p_record_id uuid", returns: "timestamp with time zone", security: "definer" },
|
|
381
|
+
{ 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" },
|
|
326
382
|
{ 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" },
|
|
327
383
|
{ name: "record_reparent", args: "p_organization_id uuid, p_record_id uuid, p_parent_id uuid", returns: "void", security: "definer" },
|
|
328
384
|
{ name: "record_resolve", args: "p_organization_id uuid, p_id uuid", returns: "jsonb", security: "definer" },
|
|
329
385
|
{ name: "record_restore", args: "p_organization_id uuid, p_record_id uuid", returns: "void", security: "definer" },
|
|
386
|
+
{ 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" },
|
|
387
|
+
{ name: "record_restore_version", args: "p_organization_id uuid, p_record_id uuid, p_version integer", returns: "jsonb", security: "definer" },
|
|
330
388
|
{ name: "record_state_as_of", args: "p_record_id uuid, p_at timestamp with time zone", returns: "TABLE(state jsonb, replayed boolean)", security: "definer" },
|
|
389
|
+
{ name: "record_table", args: "p_organization_id uuid, p_record_id uuid", returns: "uuid", security: "definer" },
|
|
331
390
|
{ 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" },
|
|
332
391
|
{ name: "record_values", args: "p_organization_id uuid, p_record_id uuid", returns: "jsonb", security: "invoker" },
|
|
333
392
|
{ name: "record_values_versioned", args: "p_organization_id uuid, p_record_id uuid", returns: "TABLE(field_key text, field_id uuid, value jsonb, value_version integer, source jsonb, absent_reason text, actor text, on_behalf_of text, written_at timestamp with time zone, alternates jsonb)", security: "definer" },
|
|
334
393
|
{ name: "record_write", args: "p_organization_id uuid, p_table_id uuid, p_data jsonb", returns: "uuid", security: "definer" },
|
|
394
|
+
{ name: "refusals_claiming_a_level_never_asked", args: "", returns: "TABLE(function_name text, identity_args text, why text)", security: "invoker" },
|
|
335
395
|
{ name: "relation_carry", args: "p_organization_id uuid, p_container_id uuid, p_item_id uuid", returns: "uuid", security: "definer" },
|
|
336
396
|
{ name: "relation_edges_withdraw", args: "p_organization_id uuid, p_field_ids uuid[], p_why text", returns: "integer", security: "definer" },
|
|
337
397
|
{ name: "relation_own", args: "p_organization_id uuid, p_owner_id uuid, p_target_id uuid", returns: "uuid", security: "definer" },
|
|
@@ -377,7 +437,11 @@ var STORE_DOORS = [
|
|
|
377
437
|
{ 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" },
|
|
378
438
|
{ name: "storage_modes", args: "", returns: "text[]", security: "invoker" },
|
|
379
439
|
{ name: "store_is_open", args: "p_organization_id uuid DEFAULT NULL::uuid", returns: "boolean", security: "invoker" },
|
|
440
|
+
{ name: "subscription_cadences", args: "p_organization_id uuid", returns: "text[]", security: "definer" },
|
|
441
|
+
{ name: "subscription_mute", args: "p_organization_id uuid, p_rule_id uuid, p_muted boolean DEFAULT true", returns: "boolean", security: "definer" },
|
|
442
|
+
{ 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" },
|
|
380
443
|
{ name: "table_capacity", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "definer" },
|
|
444
|
+
{ name: "table_carries_its_rows", args: "p_user_id uuid, p_table_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level", returns: "boolean", security: "definer" },
|
|
381
445
|
{ name: "table_contents", args: "p_organization_id uuid, p_table_id uuid", returns: "TABLE(record_id uuid, kind text, goes_at integer)", security: "invoker" },
|
|
382
446
|
{ name: "table_declare", args: "p_organization_id uuid, p_spec jsonb", returns: "uuid", security: "definer" },
|
|
383
447
|
{ name: "table_has_a_visible_record", args: "p_user uuid, p_organization_id uuid, p_table_id uuid", returns: "boolean", security: "definer" },
|
|
@@ -399,6 +463,7 @@ var STORE_DOORS = [
|
|
|
399
463
|
{ name: "value_envelope_ok", args: "p_data jsonb", returns: "boolean", security: "invoker" },
|
|
400
464
|
{ name: "value_envelope_refusal", args: "p_data jsonb", returns: "text", security: "invoker" },
|
|
401
465
|
{ 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" },
|
|
466
|
+
{ name: "value_restore", args: "p_organization_id uuid, p_record_id uuid, p_field_key text, p_version integer", returns: "jsonb", security: "definer" },
|
|
402
467
|
{ name: "value_versions", args: "p_old jsonb, p_new jsonb", returns: "jsonb", security: "invoker" },
|
|
403
468
|
{ 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" },
|
|
404
469
|
{ 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" },
|
|
@@ -411,6 +476,7 @@ var STORE_DOORS = [
|
|
|
411
476
|
{ name: "widget_kernel_id", args: "", returns: "uuid", security: "invoker" },
|
|
412
477
|
{ name: "work_approval_approvers", args: "p_organization_id uuid, p_subject_id uuid, p_approver_id uuid DEFAULT NULL::uuid", returns: "TABLE(user_id uuid, name text, why text)", security: "definer" },
|
|
413
478
|
{ 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" },
|
|
479
|
+
{ name: "work_approval_kinds", args: "", returns: "text[]", security: "invoker" },
|
|
414
480
|
{ name: "work_approval_may_decide", args: "p_organization_id uuid, p_approval_id uuid", returns: "boolean", security: "definer" },
|
|
415
481
|
{ name: "work_approval_read", args: "p_organization_id uuid, p_approval_id uuid", returns: "jsonb", security: "definer" },
|
|
416
482
|
{ name: "work_approval_request", args: "p_organization_id uuid, p_subject_id uuid, p_change jsonb, p_note text DEFAULT NULL::text, p_approver_id uuid DEFAULT NULL::uuid, p_origin text DEFAULT 'person'::text, p_conversation_id uuid DEFAULT NULL::uuid", returns: "jsonb", security: "definer" },
|
|
@@ -430,6 +496,7 @@ var STORE_DOORS = [
|
|
|
430
496
|
{ name: "work_slot_index_name", args: "p_table_id uuid", returns: "text", security: "invoker" },
|
|
431
497
|
{ name: "work_slot_release", args: "p_organization_id uuid, p_hold_id uuid", returns: "boolean", security: "definer" },
|
|
432
498
|
{ name: "work_slots_declare", args: "p_organization_id uuid, p_name text, p_slug text, p_home_id uuid DEFAULT NULL::uuid", returns: "jsonb", security: "definer" },
|
|
499
|
+
{ name: "work_state_id", args: "p_organization_id uuid, p_table_id uuid, p_value text", returns: "uuid", security: "invoker" },
|
|
433
500
|
{ name: "work_states", args: "", returns: "TABLE(sort integer, name text, terminal boolean, next text[])", security: "invoker" },
|
|
434
501
|
{ name: "work_take_assignment", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "definer" },
|
|
435
502
|
{ name: "work_template_declare", args: "p_organization_id uuid, p_name text, p_graph jsonb", returns: "uuid", security: "definer" },
|
|
@@ -447,6 +514,7 @@ var STORE_KNOBS = [
|
|
|
447
514
|
{ key: "code_paths_enabled", value: "false", type: "boolean" },
|
|
448
515
|
{ key: "consumer_chat_seeding_enabled", value: "false", type: "boolean" },
|
|
449
516
|
{ key: "consumer_checkout_enabled", value: "false", type: "boolean" },
|
|
517
|
+
{ key: "consumer_context_enabled", value: "false", type: "boolean" },
|
|
450
518
|
{ key: "consumer_education_enabled", value: "false", type: "boolean" },
|
|
451
519
|
{ key: "consumer_extension_enabled", value: "false", type: "boolean" },
|
|
452
520
|
{ key: "consumer_grid_enabled", value: "false", type: "boolean" },
|
|
@@ -478,17 +546,18 @@ var STORE_KNOBS = [
|
|
|
478
546
|
{ key: "world_publish_enabled", value: "false", type: "boolean" }
|
|
479
547
|
];
|
|
480
548
|
var STORE_REFUSAL_CODES = [
|
|
481
|
-
{ code: "02000", raised_by: "doc_render_body,doc_render_document,doc_render_read,doc_sign,doc_signature_intact,doc_signature_read,doc_template_read,doc_template_save,entity_field_retire,entity_field_update,entity_record_read,entity_value_write,external_history_event,external_rows,external_stub_upsert,external_writes_set,migrate_delete,migrate_extract_parent,migrate_merge,migrate_rename,migrate_reparent,migrate_retype,migrate_split,migrate_undo,organization_clear,read_record,record_delete,record_restore,record_update,relation_uncarry,share_access,share_grant,share_lane_set,share_people,share_revoke,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_assign,work_record_states,work_set_state" },
|
|
482
|
-
{ code: "0A000", raised_by: "external_rows,external_source_declare,external_write_through,promote_field,promoted_index_expr,promoted_query_sql,promoted_read,rule_eval,work_assign
|
|
483
|
-
{ code: "22004", raised_by: "_entity_custom_fields_guard,_value_envelope,actor_word,agg_assert_key,agg_sql,anon_capture,anon_token_issue,anon_write,assert_client_may_reach,doc_render_write,doc_sign,doc_signature_write,doc_template_save,external_history_event,external_rows,external_source_declare,external_stub_upsert,external_write_through,external_writes_set,form_declare,form_submit,home_add,io_comment_write,io_import_open,io_outbox_drain,io_restore,migrate_purge,migrate_split,migrate_undo,organization_clear,organization_contents,query_across_homes,query_by_coordinates,query_rollup,record_delete,record_reparent,record_resolve,record_restore,record_update,record_write,relation_carry,relation_own,rule_declare,share_grant,table_declare,work_approval_decide,work_approval_request,work_template_declare" },
|
|
549
|
+
{ 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_delete,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,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,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_assign,work_record_states,work_set_state" },
|
|
550
|
+
{ 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" },
|
|
551
|
+
{ 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,dashboard_block_normalize,dashboard_declare,dashboard_window_sql,doc_render_write,doc_sign,doc_signature_write,doc_template_save,external_history_event,external_rows,external_source_declare,external_stub_upsert,external_write_through,external_writes_set,field_history,form_declare,form_submit,home_add,io_comment_write,io_import_open,io_outbox_drain,io_restore,migrate_choice_keys,migrate_purge,migrate_reclass,migrate_split,migrate_undo,organization_clear,organization_contents,portal_declare,portal_invite,portal_principal_bind,query_across_homes,query_by_coordinates,query_rollup,record_delete,record_reparent,record_resolve,record_restore,record_update,record_write,relation_carry,relation_own,rule_declare,share_grant,table_declare,value_restore,work_approval_decide,work_approval_request,work_template_declare" },
|
|
552
|
+
{ code: "22007", raised_by: "dashboard_window_sql" },
|
|
484
553
|
{ code: "22012", raised_by: "rule_eval" },
|
|
485
|
-
{ code: "22023", raised_by: "_entity_custom_fields_guard,_value_envelope,_work_shape_guard,actor_word,agg_assert_key,agg_sql,anon_token_issue,containment_parent,doc_render_body,doc_render_write,doc_signature_write,entity_value_write,external_history_event,external_source_declare,external_stub_upsert,external_write_through,io_import_open,io_proposal_accept,migrate_merge,my_levels,organization_clear,query_by_coordinates,query_rollup,record_update,relation_carry,rule_eval,rule_members,share_grant,share_lane_set,table_rules,visibility_as_of,work_approval_request,work_list,work_slot_hold" },
|
|
486
|
-
{ code: "23503", raised_by: "_containment_guard,_field_document_for,_record_rule_uses,anon_publish,anon_rate_take,anon_token_issue,anon_write,assert_organization_wall,delete_rule,doc_sign,doc_template_save,form_declare,form_submit,home_add,io_comment_write,io_import_rows,io_proposal_accept,migrate_demote,migrate_promote,promote_field,promote_table,record_applicability,record_reparent,relation_carry,relation_own,resolve_first_match,rule_applies,rule_declare,rule_eval,rule_members,rule_run,work_set_state,work_take_assignment,work_template_instantiate" },
|
|
554
|
+
{ 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,field_history,io_import_open,io_proposal_accept,migrate_merge,migrate_reclass,my_levels,organization_clear,portal_declare,query_by_coordinates,query_rollup,record_update,relation_carry,rule_eval,rule_members,share_grant,share_lane_set,table_rules,visibility_as_of,work_approval_request,work_list,work_slot_hold" },
|
|
555
|
+
{ 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,comment_write,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" },
|
|
487
556
|
{ code: "23505", raised_by: "_unique_rule_holds,doc_sign,doc_signature_write,entity_field_declare,field_declare,home_add,io_proposal_accept,relation_carry,relation_own,share_grant,work_approval_decide,work_slot_hold" },
|
|
488
|
-
{ code: "23514", raised_by: "_containment_guard,_dated_values_guard,_derived_fields,_entity_custom_fields_guard,_field_document_for,_field_shape_guard,_field_type_parity_guard,_merge_field_shape_guard,_merge_field_temporal_guard,_promoted_field_cap_guard,_record_rule_uses,_resolve_choice_words,_rule_shape_guard,_rule_topology_guard,_store_relation_edge_names_its_field,_table_shape_guard,_value_envelope,_work_shape_guard,_workdoors_approval_guard,assert_entity_is_organization_scoped,doc_sign,doc_signature_write,doc_template_save,entity_field_declare,entity_field_retire,entity_field_update,entity_records_find,entity_table,field_declare,field_retire,field_update,home_add,migrate_merge,relation_carry,relation_own,validate_value_envelope,validate_values,work_set_state,work_slots_declare,work_take_assignment,work_template_instantiate" },
|
|
557
|
+
{ 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" },
|
|
489
558
|
{ code: "40001", raised_by: "has_visibility_at" },
|
|
490
|
-
{ code: "42501", raised_by: "_doc_render_immutable,_doc_signature_immutable,_field_definition_write,_field_write_door,_rule_definition_write,_store_door,anon_capture,anon_inbound_land,anon_publish,anon_token_issue,anon_token_verify,anon_write,assert_client_may_change,assert_client_may_open,assert_client_may_reach,assert_may_know_table,assert_organization_admin,assert_store_door,entity_field_declare,entity_field_retire,entity_field_update,entity_value_write,external_write_through,form_declare,form_submit,io_comment_resolve,io_comment_write,io_restore,migrate_purge,my_levels,organization_clear,promote_table,query_visibility_parity,read_record,read_records,share_grant,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_person" },
|
|
491
|
-
{ code: "42703", raised_by: "entity_table" },
|
|
559
|
+
{ 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,comment_write,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,record_table,share_grant,subscription_mute,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_person" },
|
|
560
|
+
{ code: "42703", raised_by: "entity_table,portal_declare" },
|
|
492
561
|
{ code: "53400", raised_by: "anon_rate_take,delete_cascade_closure,promote_field" },
|
|
493
562
|
{ code: "54001", raised_by: "record_delete" },
|
|
494
563
|
{ code: "PT409", raised_by: "record_update" }
|
|
@@ -1664,6 +1733,32 @@ var DOORS = {
|
|
|
1664
1733
|
// are server-lane doors and a browser never calls them.
|
|
1665
1734
|
forms: "forms",
|
|
1666
1735
|
formDeclare: "form_declare",
|
|
1736
|
+
// THE CLIENT PORTAL, OWNER'S SIDE (VIS-31 / PORTAL). A portal is how somebody
|
|
1737
|
+
// with NO membership is let in to see the records that name them. `portals`
|
|
1738
|
+
// lists them, `portalCard` opens one, `portalDeclare` states what it exposes,
|
|
1739
|
+
// `portalInvite` and `portalRevoke` are the two acts on a person, and
|
|
1740
|
+
// `portalPreview` is "view as this client" — it asks `custom.visible_set` for
|
|
1741
|
+
// HER user id, the same call `custom.read_records` makes when she opens the
|
|
1742
|
+
// page, so the preview cannot disagree with what she sees. The CLIENT-side
|
|
1743
|
+
// pair (`custom.portal_public`, `custom.portal_invitation`, `custom.portal_me`)
|
|
1744
|
+
// is deliberately absent here: those belong to the outsider's own shell.
|
|
1745
|
+
portals: "portals",
|
|
1746
|
+
portalCard: "portal_card",
|
|
1747
|
+
portalDeclare: "portal_declare",
|
|
1748
|
+
portalInvite: "portal_invite",
|
|
1749
|
+
portalRevoke: "portal_revoke",
|
|
1750
|
+
portalPreview: "portal_preview",
|
|
1751
|
+
// SCR-16 — the canvas. A dashboard is a record in the presentation kernel
|
|
1752
|
+
// whose blocks are saved SPECS for the eighth verb; `dashboardRun` walks them
|
|
1753
|
+
// under the CALLER'S principal, so nothing here is precomputed and nothing is
|
|
1754
|
+
// summed in a browser. `dashboardStuck` is the seventh block kind on its own,
|
|
1755
|
+
// because "what has not moved in fourteen days" is a question a screen asks
|
|
1756
|
+
// outside a canvas too.
|
|
1757
|
+
dashboards: "dashboards",
|
|
1758
|
+
dashboardDeclare: "dashboard_declare",
|
|
1759
|
+
dashboardRun: "dashboard_run",
|
|
1760
|
+
dashboardStuck: "dashboard_stuck",
|
|
1761
|
+
dashboardDelete: "dashboard_delete",
|
|
1667
1762
|
// The eighth verb (AGT-N-8): a grouped, bucketed, filtered count/sum/avg/
|
|
1668
1763
|
// min/max computed INSIDE the read door's own query, so a chart shows exactly
|
|
1669
1764
|
// the rows this person may see and never fetches the ones they may not.
|
|
@@ -1674,6 +1769,16 @@ var DOORS = {
|
|
|
1674
1769
|
// over a saved view. There is no subscription TABLE and no second notifier.
|
|
1675
1770
|
aggSubscriptions: "agg_subscriptions",
|
|
1676
1771
|
aggSubscriptionCadences: "agg_subscription_cadences",
|
|
1772
|
+
// The OWNER's side of DOOR-18. `agg_subscriptions` is the notifier's reader
|
|
1773
|
+
// and is not client-callable; these two are what a person reaches: what am I
|
|
1774
|
+
// being told about, and switch this one off. A form's notify Rule is one of
|
|
1775
|
+
// these rows, so "tell me when a patient arrives" can also be un-told.
|
|
1776
|
+
subscriptions: "subscriptions",
|
|
1777
|
+
subscriptionMute: "subscription_mute",
|
|
1778
|
+
// The cadence CATALOGUE a person's screen may ask for. `agg_subscription_cadences`
|
|
1779
|
+
// above is the notifier's own and holds no client grant; this door delegates to
|
|
1780
|
+
// it, so a picker and the digest runner can never offer different words.
|
|
1781
|
+
subscriptionCadences: "subscription_cadences",
|
|
1677
1782
|
// The doc doors: a template is saved, a render is written once and frozen,
|
|
1678
1783
|
// and a signature is checked against the exact bytes that were signed.
|
|
1679
1784
|
docTemplateSave: "doc_template_save",
|
|
@@ -1683,6 +1788,15 @@ var DOORS = {
|
|
|
1683
1788
|
docUnresolvedTokens: "doc_unresolved_tokens",
|
|
1684
1789
|
docSign: "doc_sign",
|
|
1685
1790
|
docSignatureIntact: "doc_signature_intact",
|
|
1791
|
+
// THE PLURAL ACTS. Until 2026-09-20 this package read `custom.doc_template`,
|
|
1792
|
+
// `custom.doc_render` and `custom.doc_signature` with a direct PostgREST
|
|
1793
|
+
// `.from()`, and all three hold NO client SELECT — so every list in product #5
|
|
1794
|
+
// opened on "permission denied for view doc_template". A list is a DOOR, never
|
|
1795
|
+
// a grant on the thing behind it (DOORS-TWO).
|
|
1796
|
+
docTemplates: "doc_templates",
|
|
1797
|
+
docTemplateDelete: "doc_template_delete",
|
|
1798
|
+
docRenders: "doc_renders",
|
|
1799
|
+
docSignatures: "doc_signatures",
|
|
1686
1800
|
// THE ANONYMOUS LANE (W4-ANON). It landed, and it landed as SEVEN doors
|
|
1687
1801
|
// rather than the one this package had guessed at: a token is issued and
|
|
1688
1802
|
// verified separately from the write it authorises, a form is published
|
|
@@ -1770,6 +1884,14 @@ var BY_SQLSTATE = {
|
|
|
1770
1884
|
// caught it raised by a door this package did not know about — which is the
|
|
1771
1885
|
// suite working, and is why the map is a census rather than a guess.
|
|
1772
1886
|
"42703": "invalid_argument",
|
|
1887
|
+
// 22007 — a date or a time the store could not read as one. It is raised by
|
|
1888
|
+
// `custom.dashboard_window_sql`, which is handed a window a caller wrote
|
|
1889
|
+
// ("last 30 days", a literal date), so the class is again "the call named
|
|
1890
|
+
// something the shape does not accept" and the store's own sentence names the
|
|
1891
|
+
// text it could not read. Added 2026-09-20 (lane SCREEN-BREAK) after the
|
|
1892
|
+
// live-door census caught it — the same way 42703 arrived, which is the
|
|
1893
|
+
// census working rather than a guess.
|
|
1894
|
+
"22007": "invalid_argument",
|
|
1773
1895
|
"02000": "not_found",
|
|
1774
1896
|
"23503": "missing_reference",
|
|
1775
1897
|
"23505": "already_exists",
|
|
@@ -2139,9 +2261,11 @@ function createRecordsClient(config) {
|
|
|
2139
2261
|
);
|
|
2140
2262
|
if (!applicable.ok) return err(applicable.error);
|
|
2141
2263
|
const rows = applicable.data ?? [];
|
|
2142
|
-
|
|
2143
|
-
|
|
2264
|
+
const fields = rows.map((row) => ({ id: row.id, ...row.data }));
|
|
2265
|
+
fields.sort(
|
|
2266
|
+
(a, b) => (a.sort ?? 0) - (b.sort ?? 0) || (a.label ?? "").localeCompare(b.label ?? "")
|
|
2144
2267
|
);
|
|
2268
|
+
return ok(fields);
|
|
2145
2269
|
},
|
|
2146
2270
|
async fieldOptions({ field_id }) {
|
|
2147
2271
|
return callDoor(
|
|
@@ -2315,6 +2439,65 @@ function createRecordsClient(config) {
|
|
|
2315
2439
|
"formDeclare"
|
|
2316
2440
|
);
|
|
2317
2441
|
},
|
|
2442
|
+
async portals() {
|
|
2443
|
+
return callDoor(DOORS.portals, { p_organization_id: org }, "portals");
|
|
2444
|
+
},
|
|
2445
|
+
async portalCard({ portal_id }) {
|
|
2446
|
+
return callDoor(
|
|
2447
|
+
DOORS.portalCard,
|
|
2448
|
+
{ p_organization_id: org, p_portal_id: portal_id },
|
|
2449
|
+
"portalCard"
|
|
2450
|
+
);
|
|
2451
|
+
},
|
|
2452
|
+
async portalDeclare(args) {
|
|
2453
|
+
return callDoor(
|
|
2454
|
+
DOORS.portalDeclare,
|
|
2455
|
+
{
|
|
2456
|
+
p_organization_id: org,
|
|
2457
|
+
p_title: args.title,
|
|
2458
|
+
p_client_table_id: args.client_table_id,
|
|
2459
|
+
p_tables: args.tables,
|
|
2460
|
+
p_portal_id: args.portal_id ?? null,
|
|
2461
|
+
p_slug: args.slug ?? null,
|
|
2462
|
+
p_sign_in_method: args.sign_in_method ?? "magic_link"
|
|
2463
|
+
},
|
|
2464
|
+
"portalDeclare"
|
|
2465
|
+
);
|
|
2466
|
+
},
|
|
2467
|
+
async portalInvite(args) {
|
|
2468
|
+
return callDoor(
|
|
2469
|
+
DOORS.portalInvite,
|
|
2470
|
+
{
|
|
2471
|
+
p_organization_id: org,
|
|
2472
|
+
p_portal_id: args.portal_id,
|
|
2473
|
+
p_client_record_id: args.client_record_id,
|
|
2474
|
+
p_email: args.email,
|
|
2475
|
+
// ALWAYS null from a client. See the interface comment: an invitation
|
|
2476
|
+
// confers nothing until the person follows their own sign-in link.
|
|
2477
|
+
p_user_id: null
|
|
2478
|
+
},
|
|
2479
|
+
"portalInvite"
|
|
2480
|
+
);
|
|
2481
|
+
},
|
|
2482
|
+
async portalRevoke({ portal_id, principal_id }) {
|
|
2483
|
+
return callDoor(
|
|
2484
|
+
DOORS.portalRevoke,
|
|
2485
|
+
{ p_organization_id: org, p_portal_id: portal_id, p_principal_id: principal_id },
|
|
2486
|
+
"portalRevoke"
|
|
2487
|
+
);
|
|
2488
|
+
},
|
|
2489
|
+
async portalPreview({ portal_id, principal_id, table_id }) {
|
|
2490
|
+
return callDoor(
|
|
2491
|
+
DOORS.portalPreview,
|
|
2492
|
+
{
|
|
2493
|
+
p_organization_id: org,
|
|
2494
|
+
p_portal_id: portal_id,
|
|
2495
|
+
p_principal_id: principal_id,
|
|
2496
|
+
p_table_id: table_id
|
|
2497
|
+
},
|
|
2498
|
+
"portalPreview"
|
|
2499
|
+
);
|
|
2500
|
+
},
|
|
2318
2501
|
async ruleRun({ rule_id, values, context }) {
|
|
2319
2502
|
return callDoor(
|
|
2320
2503
|
DOORS.ruleRun,
|
|
@@ -2339,6 +2522,55 @@ function createRecordsClient(config) {
|
|
|
2339
2522
|
"ruleEval"
|
|
2340
2523
|
);
|
|
2341
2524
|
},
|
|
2525
|
+
async dashboards(args) {
|
|
2526
|
+
return callDoor(
|
|
2527
|
+
DOORS.dashboards,
|
|
2528
|
+
{ p_organization_id: org, p_table_id: args?.table_id ?? null },
|
|
2529
|
+
"dashboards"
|
|
2530
|
+
);
|
|
2531
|
+
},
|
|
2532
|
+
async dashboardDeclare(args) {
|
|
2533
|
+
return callDoor(
|
|
2534
|
+
DOORS.dashboardDeclare,
|
|
2535
|
+
{
|
|
2536
|
+
p_organization_id: org,
|
|
2537
|
+
p_table_id: args.table_id,
|
|
2538
|
+
p_name: args.name,
|
|
2539
|
+
p_blocks: args.blocks ?? [],
|
|
2540
|
+
p_presentation: args.presentation ?? {},
|
|
2541
|
+
p_dashboard_id: args.dashboard_id ?? null
|
|
2542
|
+
},
|
|
2543
|
+
"dashboardDeclare"
|
|
2544
|
+
);
|
|
2545
|
+
},
|
|
2546
|
+
async dashboardRun({ dashboard_id, filter }) {
|
|
2547
|
+
return callDoor(
|
|
2548
|
+
DOORS.dashboardRun,
|
|
2549
|
+
{ p_organization_id: org, p_dashboard_id: dashboard_id, p_filter: filter ?? {} },
|
|
2550
|
+
"dashboardRun"
|
|
2551
|
+
);
|
|
2552
|
+
},
|
|
2553
|
+
async dashboardStuck({ table_id, state_key, days, filter, limit }) {
|
|
2554
|
+
return callDoor(
|
|
2555
|
+
DOORS.dashboardStuck,
|
|
2556
|
+
{
|
|
2557
|
+
p_organization_id: org,
|
|
2558
|
+
p_table_id: table_id,
|
|
2559
|
+
p_state_key: state_key,
|
|
2560
|
+
p_days: days ?? 14,
|
|
2561
|
+
p_filter: filter ?? {},
|
|
2562
|
+
p_limit: limit ?? 50
|
|
2563
|
+
},
|
|
2564
|
+
"dashboardStuck"
|
|
2565
|
+
);
|
|
2566
|
+
},
|
|
2567
|
+
async dashboardDelete({ dashboard_id }) {
|
|
2568
|
+
return callDoor(
|
|
2569
|
+
DOORS.dashboardDelete,
|
|
2570
|
+
{ p_organization_id: org, p_dashboard_id: dashboard_id },
|
|
2571
|
+
"dashboardDelete"
|
|
2572
|
+
);
|
|
2573
|
+
},
|
|
2342
2574
|
async recordAggregate({ table_id, groupBy, measures, bucket, filter, limit }) {
|
|
2343
2575
|
return callDoor(
|
|
2344
2576
|
DOORS.recordAggregate,
|
|
@@ -2374,6 +2606,27 @@ function createRecordsClient(config) {
|
|
|
2374
2606
|
async aggSubscriptionCadences() {
|
|
2375
2607
|
return callDoor(DOORS.aggSubscriptionCadences, {}, "aggSubscriptionCadences");
|
|
2376
2608
|
},
|
|
2609
|
+
async subscriptionCadences() {
|
|
2610
|
+
return callDoor(
|
|
2611
|
+
DOORS.subscriptionCadences,
|
|
2612
|
+
{ p_organization_id: org },
|
|
2613
|
+
"subscriptionCadences"
|
|
2614
|
+
);
|
|
2615
|
+
},
|
|
2616
|
+
async subscriptions(args) {
|
|
2617
|
+
return callDoor(
|
|
2618
|
+
DOORS.subscriptions,
|
|
2619
|
+
{ p_organization_id: org, p_table_id: args?.table_id ?? null },
|
|
2620
|
+
"subscriptions"
|
|
2621
|
+
);
|
|
2622
|
+
},
|
|
2623
|
+
async subscriptionMute({ rule_id, muted }) {
|
|
2624
|
+
return callDoor(
|
|
2625
|
+
DOORS.subscriptionMute,
|
|
2626
|
+
{ p_organization_id: org, p_rule_id: rule_id, p_muted: muted },
|
|
2627
|
+
"subscriptionMute"
|
|
2628
|
+
);
|
|
2629
|
+
},
|
|
2377
2630
|
async docTemplateSave({ table_id, name, body, template_id }) {
|
|
2378
2631
|
return callDoor(
|
|
2379
2632
|
DOORS.docTemplateSave,
|
|
@@ -2424,32 +2677,52 @@ function createRecordsClient(config) {
|
|
|
2424
2677
|
"docSign"
|
|
2425
2678
|
);
|
|
2426
2679
|
},
|
|
2680
|
+
// A LIST IS A DOOR, NEVER A GRANT ON THE THING BEHIND IT. These three used to
|
|
2681
|
+
// read `custom.doc_template`, `custom.doc_render` and `custom.doc_signature`
|
|
2682
|
+
// with a direct PostgREST `.from()`, and none of the three holds a client
|
|
2683
|
+
// SELECT — so a person could save a template they could never list and
|
|
2684
|
+
// render a document they could never find again, and every document screen
|
|
2685
|
+
// opened on "permission denied for view doc_template". The doors below
|
|
2686
|
+
// narrow inside the definer, after the ladder has spoken (DOORS-TWO).
|
|
2427
2687
|
async docTemplates({ table_id }) {
|
|
2428
|
-
const
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
return ok(
|
|
2688
|
+
const answered = await callDoor(
|
|
2689
|
+
DOORS.docTemplates,
|
|
2690
|
+
{ p_organization_id: org, p_table_id: table_id },
|
|
2691
|
+
"docTemplates"
|
|
2692
|
+
);
|
|
2693
|
+
if (!answered.ok) return answered;
|
|
2694
|
+
return ok(
|
|
2695
|
+
answered.data.map((row) => ({ ...row, id: row["template_id"] }))
|
|
2696
|
+
);
|
|
2697
|
+
},
|
|
2698
|
+
async docTemplateDelete({ template_id }) {
|
|
2699
|
+
return callDoor(
|
|
2700
|
+
DOORS.docTemplateDelete,
|
|
2701
|
+
{ p_organization_id: org, p_template_id: template_id },
|
|
2702
|
+
"docTemplateDelete"
|
|
2703
|
+
);
|
|
2435
2704
|
},
|
|
2436
2705
|
async docRenders({ record_id }) {
|
|
2437
|
-
const
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
return ok(
|
|
2706
|
+
const answered = await callDoor(
|
|
2707
|
+
DOORS.docRenders,
|
|
2708
|
+
{ p_organization_id: org, p_record_id: record_id },
|
|
2709
|
+
"docRenders"
|
|
2710
|
+
);
|
|
2711
|
+
if (!answered.ok) return answered;
|
|
2712
|
+
return ok(
|
|
2713
|
+
answered.data.map((row) => ({ ...row, id: row["render_id"] }))
|
|
2714
|
+
);
|
|
2444
2715
|
},
|
|
2445
2716
|
async docSignatures({ record_id }) {
|
|
2446
|
-
const
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
return ok(
|
|
2717
|
+
const answered = await callDoor(
|
|
2718
|
+
DOORS.docSignatures,
|
|
2719
|
+
{ p_organization_id: org, p_record_id: record_id },
|
|
2720
|
+
"docSignatures"
|
|
2721
|
+
);
|
|
2722
|
+
if (!answered.ok) return answered;
|
|
2723
|
+
return ok(
|
|
2724
|
+
answered.data.map((row) => ({ ...row, id: row["signature_id"] }))
|
|
2725
|
+
);
|
|
2453
2726
|
},
|
|
2454
2727
|
async recordValuesVersioned({ record_id }) {
|
|
2455
2728
|
return readValues(record_id);
|
|
@@ -3305,11 +3578,59 @@ var OVERRIDE_POLICIES = [
|
|
|
3305
3578
|
var FRESHNESS = ["live", "cached", "snapshot"];
|
|
3306
3579
|
var TABLE_DISPLAYS = ["list", "grid", "board", "calendar", "timeline"];
|
|
3307
3580
|
|
|
3581
|
+
// src/choice.ts
|
|
3582
|
+
var UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
3583
|
+
function optionKey(option) {
|
|
3584
|
+
const stored = option.metadata?.["option_key"];
|
|
3585
|
+
if (typeof stored === "string" && stored.trim() !== "") return stored;
|
|
3586
|
+
return choiceSlug(optionLabel(option));
|
|
3587
|
+
}
|
|
3588
|
+
function optionLabel(option) {
|
|
3589
|
+
const doc = option.data;
|
|
3590
|
+
const title = doc?.["title"] ?? doc?.["name"];
|
|
3591
|
+
if (typeof title === "string" && title.trim() !== "") return title;
|
|
3592
|
+
return "Unnamed choice";
|
|
3593
|
+
}
|
|
3594
|
+
function choiceSlug(word) {
|
|
3595
|
+
const slug = word.trim().toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "").slice(0, 55);
|
|
3596
|
+
return slug === "" ? "choice" : slug;
|
|
3597
|
+
}
|
|
3598
|
+
function isTheChosen(option, value) {
|
|
3599
|
+
if (typeof value !== "string") return false;
|
|
3600
|
+
const asked = value.trim().toLowerCase();
|
|
3601
|
+
if (asked === "") return false;
|
|
3602
|
+
return asked === optionKey(option).toLowerCase() || asked === optionLabel(option).toLowerCase() || asked === option.id.toLowerCase();
|
|
3603
|
+
}
|
|
3604
|
+
function choiceValuesOf(value) {
|
|
3605
|
+
if (Array.isArray(value)) return value.filter((v) => typeof v === "string");
|
|
3606
|
+
if (typeof value === "string" && value !== "") return [value];
|
|
3607
|
+
return [];
|
|
3608
|
+
}
|
|
3609
|
+
function choicesOf(document, fieldKeyOrId) {
|
|
3610
|
+
const block = document?.["_choices"];
|
|
3611
|
+
if (!block || typeof block !== "object") return [];
|
|
3612
|
+
const entry = block[fieldKeyOrId];
|
|
3613
|
+
if (!entry) return [];
|
|
3614
|
+
const list = Array.isArray(entry) ? entry : [entry];
|
|
3615
|
+
return list.filter((x) => !!x && typeof x === "object" && typeof x.key === "string");
|
|
3616
|
+
}
|
|
3617
|
+
function holdsARetiredChoice(document, fieldKeyOrId) {
|
|
3618
|
+
return choicesOf(document, fieldKeyOrId).some((c) => c.retired === true);
|
|
3619
|
+
}
|
|
3620
|
+
function looksLikeAnId(value) {
|
|
3621
|
+
return typeof value === "string" && UUID.test(value);
|
|
3622
|
+
}
|
|
3623
|
+
|
|
3308
3624
|
// src/rule.ts
|
|
3309
3625
|
function publicFormPath(formId) {
|
|
3310
3626
|
return `/f/${formId}`;
|
|
3311
3627
|
}
|
|
3312
3628
|
|
|
3629
|
+
// src/portal.ts
|
|
3630
|
+
function portalPath(slug) {
|
|
3631
|
+
return `/portal/c/${slug}`;
|
|
3632
|
+
}
|
|
3633
|
+
|
|
3313
3634
|
// src/aggregate.ts
|
|
3314
3635
|
function measureKey(measure) {
|
|
3315
3636
|
return measure.op === "count" ? "count" : `${measure.op}_${measure.key ?? ""}`;
|
|
@@ -3351,11 +3672,20 @@ export {
|
|
|
3351
3672
|
VALUE_ENVELOPE_KEYS,
|
|
3352
3673
|
asPermissionLevel,
|
|
3353
3674
|
atLeast,
|
|
3675
|
+
choiceSlug,
|
|
3676
|
+
choiceValuesOf,
|
|
3677
|
+
choicesOf,
|
|
3354
3678
|
err,
|
|
3355
3679
|
highestLevel,
|
|
3680
|
+
holdsARetiredChoice,
|
|
3356
3681
|
isRecordsErr,
|
|
3682
|
+
isTheChosen,
|
|
3683
|
+
looksLikeAnId,
|
|
3357
3684
|
measureKey,
|
|
3358
3685
|
ok,
|
|
3686
|
+
optionKey,
|
|
3687
|
+
optionLabel,
|
|
3688
|
+
portalPath,
|
|
3359
3689
|
publicFormPath,
|
|
3360
3690
|
useEntityFieldMutation,
|
|
3361
3691
|
useEntityFieldRights,
|