@ai-matrx/records 0.6.2 → 0.8.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 +68 -0
- package/dist/core/index.cjs +191 -33
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +44 -4
- package/dist/core/index.d.ts +44 -4
- package/dist/core/index.js +191 -33
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +126 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +375 -30
- package/dist/index.d.ts +375 -30
- package/dist/index.js +126 -30
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +222 -33
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +443 -31
- package/dist/react/index.d.ts +443 -31
- package/dist/react/index.js +222 -33
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,73 @@
|
|
|
1
1
|
# Changelog — @ai-matrx/records
|
|
2
2
|
|
|
3
|
+
## 0.7.2
|
|
4
|
+
|
|
5
|
+
**The door catalogue, regenerated while the store was still growing.** 0.7.1
|
|
6
|
+
mirrored 300 doors and the gate, running twelve minutes later, counted 301 —
|
|
7
|
+
another lane shipped one in the window. Regenerated: 301 doors. Nothing else
|
|
8
|
+
changed.
|
|
9
|
+
|
|
10
|
+
## 0.7.1
|
|
11
|
+
|
|
12
|
+
**The live suite opens the switch the way the store resolves it.**
|
|
13
|
+
|
|
14
|
+
0.7.0's release gate failed four clauses against the live store and none of them
|
|
15
|
+
was about this package's code. `platform.knob_resolve` reads an organization's
|
|
16
|
+
own override ABOVE the base knob row, and Test's Org gained one
|
|
17
|
+
(`custom/system_enabled` = false, written through the ramp screen's own writer)
|
|
18
|
+
— so the suite's in-transaction `update platform.feature_knob` stopped opening
|
|
19
|
+
anything and three cases met the store's switched-off refusal. Both rungs are
|
|
20
|
+
set inside the transaction now, for the member's organization and for the
|
|
21
|
+
stranger organization the membership wall case names, and the `rollback` still
|
|
22
|
+
puts both back.
|
|
23
|
+
|
|
24
|
+
The fourth was the door catalogue: 293 mirrored names against 300 live doors,
|
|
25
|
+
because other lanes added seven. `src/store.generated.ts` is regenerated from
|
|
26
|
+
the live store — 300 doors, 35 knobs, 1020 entity tokens — which is the file's
|
|
27
|
+
whole contract: nothing in it is typed by a person.
|
|
28
|
+
|
|
29
|
+
## 0.7.0
|
|
30
|
+
|
|
31
|
+
**A screen can ask what this person may do, before it offers it.**
|
|
32
|
+
|
|
33
|
+
The 19–20 September verdict (sixth pass) watched a colleague who had been shared
|
|
34
|
+
a table at Viewer double-click a cell, get a live editor, type a value and press
|
|
35
|
+
Enter — and only then be told she may not write. "The permission is right; the
|
|
36
|
+
screen told her she could." No screen could have done better: the store answers
|
|
37
|
+
"what may this person do to this thing?" in exactly one place,
|
|
38
|
+
`custom.effective_level`, which has no grant to `authenticated` and no decision
|
|
39
|
+
of its own — it takes ANY principal and ANY subject, so granting it to clients
|
|
40
|
+
would be handing out a visibility probe.
|
|
41
|
+
|
|
42
|
+
- **`client.myLevels({ ids })`** — the new `custom.my_levels` door. What level
|
|
43
|
+
the CALLER holds on the subjects they name, with no principal argument: the
|
|
44
|
+
person is resolved from the session, so you can ask about your own access and
|
|
45
|
+
about nobody else's. It takes a LIST so a page of fifty rows is one call, and
|
|
46
|
+
**every id asked about gets a row** — `null` included, because a missing row
|
|
47
|
+
and "no access" would be the same thing to the screen that asked and one of
|
|
48
|
+
them is a silence. `null` for an id that does not exist is the same answer, so
|
|
49
|
+
it is not an existence oracle.
|
|
50
|
+
- **`useMyLevel(id)` / `useMyLevels(ids)`** in `/react`.
|
|
51
|
+
- **`level.ts`**: `PermissionLevel`, `PERMISSION_LEVELS`, `atLeast`,
|
|
52
|
+
`asPermissionLevel`, `highestLevel`. The ladder a screen compares with is the
|
|
53
|
+
ladder the door compares with; two orderings would be two answers to one
|
|
54
|
+
question and the second is always wrong.
|
|
55
|
+
|
|
56
|
+
**What this release deliberately does NOT do.** A `Table.your_level` carried off
|
|
57
|
+
the read door looked free and was wrong: `tableList` reads the Table KERNEL, so
|
|
58
|
+
`read_records`'s `level` there is the caller's level on the kernel — viewer, for
|
|
59
|
+
everybody — and not on the table that row describes. It was written, measured
|
|
60
|
+
wrong within the hour (a table's own owner came back `viewer`), and removed; the
|
|
61
|
+
reason is in `core/client.ts` where the next person will reach for it. A table
|
|
62
|
+
is a record, and its level is asked for like any other record's.
|
|
63
|
+
|
|
64
|
+
### Consumer action
|
|
65
|
+
|
|
66
|
+
None required. `custom.my_levels` is live on the main database (lane UI-HONEST,
|
|
67
|
+
`uihonest_a_screen_can_ask_what_it_may_offer.sql` +
|
|
68
|
+
`uihonest_the_level_door_takes_a_json_list.sql`), so `myLevels` answers as soon
|
|
69
|
+
as this version is installed.
|
|
70
|
+
|
|
3
71
|
## 0.6.2
|
|
4
72
|
|
|
5
73
|
The generated store contract, regenerated at 279 doors. 0.6.1's gate was red on
|
package/dist/core/index.cjs
CHANGED
|
@@ -51,6 +51,7 @@ __export(core_exports, {
|
|
|
51
51
|
ON_DELETE: () => ON_DELETE,
|
|
52
52
|
OVERRIDE_POLICIES: () => OVERRIDE_POLICIES,
|
|
53
53
|
PARITY_FIELD_TYPES: () => PARITY_FIELD_TYPES,
|
|
54
|
+
PERMISSION_LEVELS: () => PERMISSION_LEVELS,
|
|
54
55
|
PER_VALUE_ACCESS_WORDS: () => PER_VALUE_ACCESS_WORDS,
|
|
55
56
|
RELATION_BINDINGS: () => RELATION_BINDINGS,
|
|
56
57
|
RELATION_CARDINALITIES: () => RELATION_CARDINALITIES,
|
|
@@ -67,7 +68,9 @@ __export(core_exports, {
|
|
|
67
68
|
TABLE_TYPES: () => TABLE_TYPES,
|
|
68
69
|
VALUE_ALTERNATE_KEYS: () => VALUE_ALTERNATE_KEYS,
|
|
69
70
|
VALUE_ENVELOPE_KEYS: () => VALUE_ENVELOPE_KEYS,
|
|
71
|
+
asPermissionLevel: () => asPermissionLevel,
|
|
70
72
|
asWriteConflict: () => asWriteConflict,
|
|
73
|
+
atLeast: () => atLeast,
|
|
71
74
|
cellText: () => cellText,
|
|
72
75
|
createRecordsClient: () => createRecordsClient,
|
|
73
76
|
doorAbsent: () => doorAbsent,
|
|
@@ -76,6 +79,7 @@ __export(core_exports, {
|
|
|
76
79
|
err: () => err,
|
|
77
80
|
exportCsv: () => exportCsv,
|
|
78
81
|
exportXlsx: () => exportXlsx,
|
|
82
|
+
highestLevel: () => highestLevel,
|
|
79
83
|
importCsv: () => importCsv,
|
|
80
84
|
importXlsx: () => importXlsx,
|
|
81
85
|
intersectIds: () => intersectIds,
|
|
@@ -89,6 +93,7 @@ __export(core_exports, {
|
|
|
89
93
|
predictSizeRefusal: () => predictSizeRefusal,
|
|
90
94
|
predictValueRefusals: () => predictValueRefusals,
|
|
91
95
|
predictWriteRefusals: () => predictWriteRefusals,
|
|
96
|
+
publicFormPath: () => publicFormPath,
|
|
92
97
|
staleWriteDetail: () => staleWriteDetail,
|
|
93
98
|
supabaseDataSource: () => supabaseDataSource,
|
|
94
99
|
toAoa: () => toAoa
|
|
@@ -151,6 +156,38 @@ var OVERRIDE_POLICIES = [
|
|
|
151
156
|
var FRESHNESS = ["live", "cached", "snapshot"];
|
|
152
157
|
var TABLE_DISPLAYS = ["list", "grid", "board", "calendar", "timeline"];
|
|
153
158
|
|
|
159
|
+
// src/level.ts
|
|
160
|
+
var PERMISSION_LEVELS = [
|
|
161
|
+
"viewer",
|
|
162
|
+
"commenter",
|
|
163
|
+
"editor",
|
|
164
|
+
"admin"
|
|
165
|
+
];
|
|
166
|
+
var ORDINAL = {
|
|
167
|
+
viewer: 1,
|
|
168
|
+
commenter: 2,
|
|
169
|
+
editor: 3,
|
|
170
|
+
admin: 4
|
|
171
|
+
};
|
|
172
|
+
function atLeast(held, needed) {
|
|
173
|
+
if (!held) return false;
|
|
174
|
+
const have = ORDINAL[held];
|
|
175
|
+
return have !== void 0 && have >= ORDINAL[needed];
|
|
176
|
+
}
|
|
177
|
+
function asPermissionLevel(word) {
|
|
178
|
+
return typeof word === "string" && word in ORDINAL ? word : null;
|
|
179
|
+
}
|
|
180
|
+
function highestLevel(left, right) {
|
|
181
|
+
if (!left) return right ?? null;
|
|
182
|
+
if (!right) return left;
|
|
183
|
+
return ORDINAL[left] >= ORDINAL[right] ? left : right;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// src/rule.ts
|
|
187
|
+
function publicFormPath(formId) {
|
|
188
|
+
return `/f/${formId}`;
|
|
189
|
+
}
|
|
190
|
+
|
|
154
191
|
// src/aggregate.ts
|
|
155
192
|
function measureKey(measure) {
|
|
156
193
|
return measure.op === "count" ? "count" : `${measure.op}_${measure.key ?? ""}`;
|
|
@@ -225,7 +262,9 @@ var STORE_DOORS = [
|
|
|
225
262
|
{ name: "absence_reasons", args: "", returns: "text[]", security: "invoker" },
|
|
226
263
|
{ name: "actor_vocabulary", args: "", returns: "text[]", security: "invoker" },
|
|
227
264
|
{ name: "actor_word", args: "p_declared text", returns: "text", security: "invoker" },
|
|
265
|
+
{ name: "agent_change_approval", args: "p_organization uuid, p_conversation uuid DEFAULT NULL::uuid, p_table uuid DEFAULT NULL::uuid", returns: "jsonb", security: "definer" },
|
|
228
266
|
{ name: "agent_context", args: "p_organization_id uuid, p_table_id uuid, p_limit integer DEFAULT 50", returns: "jsonb", security: "invoker" },
|
|
267
|
+
{ name: "agent_table_claim", args: "p_organization uuid, p_table uuid, p_conversation uuid DEFAULT NULL::uuid", returns: "void", security: "definer" },
|
|
229
268
|
{ name: "agg_assert_key", args: "p_key text", returns: "text", security: "invoker" },
|
|
230
269
|
{ name: "agg_buckets", args: "", returns: "text[]", security: "invoker" },
|
|
231
270
|
{ name: "agg_deliver", args: "p_organization_id uuid, p_rule_id uuid, p_record_id uuid, p_channel text, p_recipient_user_id uuid, p_event_key text, p_subject text, p_body text, p_payload jsonb DEFAULT '{}'::jsonb", returns: "uuid", security: "invoker" },
|
|
@@ -243,6 +282,7 @@ var STORE_DOORS = [
|
|
|
243
282
|
{ name: "anon_inbound_land", args: "p_address text, p_secret text, p_payload jsonb, p_raw_payload jsonb DEFAULT '{}'::jsonb, p_client_key text DEFAULT NULL::text", returns: "uuid", security: "definer" },
|
|
244
283
|
{ name: "anon_publish", args: "p_organization_id uuid, p_form_id uuid, p_published boolean DEFAULT true", returns: "timestamp with time zone", security: "definer" },
|
|
245
284
|
{ name: "anon_rate_take", args: "p_organization_id uuid, p_form_id uuid, p_bucket text, p_token_id uuid DEFAULT NULL::uuid", returns: "integer", security: "definer" },
|
|
285
|
+
{ name: "anon_submissions", args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid, p_state text DEFAULT NULL::text, p_limit integer DEFAULT 100, p_offset integer DEFAULT 0", returns: "TABLE(id uuid, form_id uuid, inbound_id uuid, table_id uuid, source text, state text, payload jsonb, raw_payload jsonb, client_key text, record_id uuid, remote_origin text, rejection_reason text, created_at timestamp with time zone, cleared_at timestamp with time zone)", security: "definer" },
|
|
246
286
|
{ name: "anon_token_issue", args: "p_organization_id uuid, p_mode text, p_allowed_origins jsonb, p_form_id uuid DEFAULT NULL::uuid, p_saved_view_id uuid DEFAULT NULL::uuid, p_record_id uuid DEFAULT NULL::uuid, p_expires_at timestamp with time zone DEFAULT NULL::timestamp with time zone", returns: "TABLE(token_id uuid, secret text)", security: "definer" },
|
|
247
287
|
{ name: "anon_token_revoke", args: "p_organization_id uuid, p_token_id uuid", returns: "boolean", security: "definer" },
|
|
248
288
|
{ name: "anon_token_verify", args: "p_secret text, p_origin text, p_required_mode text", returns: "TABLE(token_id uuid, organization_id uuid, form_id uuid, saved_view_id uuid, record_id uuid, mode text)", security: "definer" },
|
|
@@ -251,6 +291,8 @@ var STORE_DOORS = [
|
|
|
251
291
|
{ name: "assert_client_may_change", args: "p_organization_id uuid, p_subject_id uuid, p_door text, p_required permission_level DEFAULT 'editor'::permission_level, p_subject_word text DEFAULT 'record'::text", returns: "void", security: "invoker" },
|
|
252
292
|
{ name: "assert_client_may_open", args: "p_organization_id uuid, p_subject_id uuid, p_door text, p_required permission_level DEFAULT 'viewer'::permission_level, p_subject_word text DEFAULT 'record'::text", returns: "void", security: "invoker" },
|
|
253
293
|
{ name: "assert_client_may_reach", args: "p_organization_id uuid, p_door text", returns: "void", security: "invoker" },
|
|
294
|
+
{ name: "assert_entity_door", args: "p_organization_id uuid, p_door text", returns: "void", security: "definer" },
|
|
295
|
+
{ name: "assert_entity_is_organization_scoped", args: "p_token text, p_label text, p_scoped boolean", returns: "void", security: "invoker" },
|
|
254
296
|
{ name: "assert_may_know_table", args: "p_organization_id uuid, p_table_id uuid, p_door text", returns: "void", security: "invoker" },
|
|
255
297
|
{ name: "assert_organization_admin", args: "p_organization_id uuid, p_door text, p_what text", returns: "void", security: "invoker" },
|
|
256
298
|
{ name: "assert_organization_wall", args: "p_kind text, p_organization_id uuid, p_row jsonb", returns: "void", security: "invoker" },
|
|
@@ -258,6 +300,8 @@ var STORE_DOORS = [
|
|
|
258
300
|
{ name: "bump_epoch", args: "p_entity_type text, p_entity_id uuid, p_organization_id uuid DEFAULT NULL::uuid", returns: "bigint", security: "definer" },
|
|
259
301
|
{ name: "cache_lookup", args: "p_container_type text, p_container_id uuid, p_item_type text, p_item_id uuid", returns: "permission_level", security: "definer" },
|
|
260
302
|
{ name: "caller_role", args: "", returns: "name", security: "invoker" },
|
|
303
|
+
{ 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" },
|
|
304
|
+
{ 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" },
|
|
261
305
|
{ name: "client_write_grants", args: "", returns: "TABLE(role_name text, object_name text, privilege text)", security: "invoker" },
|
|
262
306
|
{ 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" },
|
|
263
307
|
{ name: "containment_chain", args: "p_organization_id uuid, p_record_id uuid", returns: "TABLE(ancestor_id uuid, depth integer)", security: "invoker" },
|
|
@@ -267,6 +311,7 @@ var STORE_DOORS = [
|
|
|
267
311
|
{ name: "cross_organization_links_open", args: "p_source_organization_id uuid, p_target_organization_id uuid", returns: "boolean", security: "invoker" },
|
|
268
312
|
{ name: "custom_fields_tables", args: "", returns: "TABLE(token text, schema_name text, table_name text)", security: "invoker" },
|
|
269
313
|
{ name: "delete_cascade_closure", args: "p_organization_id uuid, p_record_id uuid", returns: "uuid[]", security: "invoker" },
|
|
314
|
+
{ name: "delete_preview", args: "p_organization_id uuid, p_record_id uuid", returns: "jsonb", security: "definer" },
|
|
270
315
|
{ name: "delete_rule", args: "p_organization_id uuid, p_record_id uuid, p_apply boolean DEFAULT true", returns: "jsonb", security: "definer" },
|
|
271
316
|
{ name: "dependency_cycle", args: "p_organization_id uuid, p_row custom.record", returns: "text[]", security: "invoker" },
|
|
272
317
|
{ name: "dependency_label", args: "p_organization_id uuid, p_node text", returns: "text", security: "invoker" },
|
|
@@ -277,11 +322,14 @@ var STORE_DOORS = [
|
|
|
277
322
|
{ name: "doc_format_value", args: "p_field_data jsonb, p_value jsonb", returns: "text", security: "invoker" },
|
|
278
323
|
{ name: "doc_render_body", args: "p_organization_id uuid, p_template_id uuid, p_record_id uuid", returns: "text", security: "invoker" },
|
|
279
324
|
{ name: "doc_render_document", args: "p_organization_id uuid, p_template_id uuid, p_record_id uuid", returns: "uuid", security: "definer" },
|
|
325
|
+
{ name: "doc_render_read", args: "p_organization_id uuid, p_render_id uuid", returns: "jsonb", security: "definer" },
|
|
280
326
|
{ 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" },
|
|
281
327
|
{ 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" },
|
|
282
328
|
{ name: "doc_signature_field_ok", args: "p_field_data jsonb", returns: "boolean", security: "invoker" },
|
|
283
329
|
{ name: "doc_signature_intact", args: "p_organization_id uuid, p_signature_id uuid", returns: "jsonb", security: "invoker" },
|
|
330
|
+
{ name: "doc_signature_read", args: "p_organization_id uuid, p_signature_id uuid", returns: "jsonb", security: "definer" },
|
|
284
331
|
{ 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" },
|
|
332
|
+
{ name: "doc_template_read", args: "p_organization_id uuid, p_template_id uuid", returns: "jsonb", security: "definer" },
|
|
285
333
|
{ 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" },
|
|
286
334
|
{ name: "doc_token_pattern", args: "", returns: "text", security: "invoker" },
|
|
287
335
|
{ name: "doc_tokens", args: "p_body text", returns: "TABLE(ordinal integer, raw text, field_id uuid)", security: "invoker" },
|
|
@@ -290,6 +338,15 @@ var STORE_DOORS = [
|
|
|
290
338
|
{ name: "doors_not_deciding_the_record", args: "", returns: "TABLE(function_name text, identity_args text, why text)", security: "invoker" },
|
|
291
339
|
{ name: "doors_not_on_one_ladder", args: "", returns: "TABLE(function_name text, identity_args text, why text)", security: "invoker" },
|
|
292
340
|
{ name: "effective_level", args: "p_user_id uuid, p_organization_id uuid, p_id uuid, p_type text DEFAULT 'record'::text", returns: "permission_level", security: "definer" },
|
|
341
|
+
{ name: "entity_field_declare", args: "p_organization_id uuid, p_token text, p_spec jsonb", returns: "uuid", security: "definer" },
|
|
342
|
+
{ name: "entity_field_retire", args: "p_organization_id uuid, p_field_id uuid", returns: "uuid", security: "definer" },
|
|
343
|
+
{ name: "entity_field_rights", args: "p_organization_id uuid, p_token text", returns: "jsonb", security: "definer" },
|
|
344
|
+
{ name: "entity_field_update", args: "p_organization_id uuid, p_field_id uuid, p_patch jsonb", returns: "uuid", security: "definer" },
|
|
345
|
+
{ name: "entity_fields", args: "p_organization_id uuid, p_token text", returns: "SETOF custom.record", security: "definer" },
|
|
346
|
+
{ name: "entity_record_read", args: "p_organization_id uuid, p_token text, p_record_id uuid", returns: "jsonb", security: "invoker" },
|
|
347
|
+
{ name: "entity_records_find", args: "p_organization_id uuid, p_token text, p_key text, p_value jsonb DEFAULT NULL::jsonb, p_limit integer DEFAULT 50, p_offset integer DEFAULT 0", returns: "jsonb", security: "invoker" },
|
|
348
|
+
{ name: "entity_table", args: "p_token text", returns: "TABLE(token text, schema_name text, table_name text, type text, title_column text, label text, has_organization boolean, has_deleted_at boolean)", security: "invoker" },
|
|
349
|
+
{ name: "entity_value_write", args: "p_organization_id uuid, p_token text, p_record_id uuid, p_patch jsonb", returns: "jsonb", security: "invoker" },
|
|
293
350
|
{ name: "export_records", args: "p_organization_id uuid, p_table_id uuid, p_limit integer DEFAULT 1000", returns: "TABLE(id uuid, document jsonb)", security: "invoker" },
|
|
294
351
|
{ name: "external_foreign_table_findings", args: "", returns: "SETOF text", security: "definer" },
|
|
295
352
|
{ name: "external_history_event", args: "p_organization_id uuid, p_link_id uuid, p_operation text", returns: "bigint", security: "definer" },
|
|
@@ -301,7 +358,7 @@ var STORE_DOORS = [
|
|
|
301
358
|
{ name: "external_writes_set", args: "p_organization_id uuid, p_source_id uuid, p_enabled boolean", returns: "boolean", security: "definer" },
|
|
302
359
|
{ name: "field_behaviour", args: "p_field_data jsonb", returns: "text", security: "invoker" },
|
|
303
360
|
{ name: "field_declare", args: "p_organization_id uuid, p_table_id uuid, p_spec jsonb", returns: "uuid", security: "definer" },
|
|
304
|
-
{ name: "field_dependants", args: "p_organization_id uuid, p_field_id uuid", returns: "TABLE(kind text, dependant_id uuid, label text, how text)", security: "
|
|
361
|
+
{ 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" },
|
|
305
362
|
{ name: "field_kernel_id", args: "", returns: "uuid", security: "invoker" },
|
|
306
363
|
{ name: "field_options", args: "p_organization_id uuid, p_field_id uuid", returns: "SETOF custom.record", security: "definer" },
|
|
307
364
|
{ name: "field_retire", args: "p_organization_id uuid, p_field_id uuid", returns: "boolean", security: "definer" },
|
|
@@ -309,7 +366,14 @@ var STORE_DOORS = [
|
|
|
309
366
|
{ name: "field_update", args: "p_organization_id uuid, p_field_id uuid, p_patch jsonb", returns: "uuid", security: "definer" },
|
|
310
367
|
{ name: "field_value_convert", args: "p_to jsonb, p_value jsonb", returns: "jsonb", security: "invoker" },
|
|
311
368
|
{ name: "file_kernel_id", args: "", returns: "uuid", security: "invoker" },
|
|
369
|
+
{ name: "form_declare", args: "p_organization_id uuid, p_table_id uuid, p_title text, p_questions jsonb, p_presentation jsonb DEFAULT '{}'::jsonb, p_submission_cap integer DEFAULT NULL::integer, p_quarantine_rule_id uuid DEFAULT NULL::uuid, p_notify_rule_id uuid DEFAULT NULL::uuid, p_form_id uuid DEFAULT NULL::uuid, p_slug text DEFAULT NULL::text", returns: "uuid", security: "definer" },
|
|
370
|
+
{ name: "form_notify", args: "p_organization_id uuid, p_form_id uuid, p_record_id uuid, p_submission_id uuid", returns: "uuid", security: "invoker" },
|
|
371
|
+
{ name: "form_public", args: "p_form_id uuid", returns: "TABLE(form_id uuid, organization_id uuid, table_id uuid, title text, presentation jsonb, fields jsonb, honeypot_key text, state text, message text)", security: "definer" },
|
|
372
|
+
{ name: "form_slug", args: "p_organization_id uuid, p_title text, p_form_id uuid DEFAULT NULL::uuid", returns: "text", security: "invoker" },
|
|
373
|
+
{ name: "form_submit", args: "p_form_id uuid, p_origin text, p_payload jsonb, p_bucket text, p_honeypot text DEFAULT NULL::text, p_client_key text DEFAULT NULL::text", returns: "TABLE(submission_id uuid, record_id uuid, state text, message text)", security: "definer" },
|
|
374
|
+
{ name: "forms", args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid", returns: "TABLE(form_id uuid, table_id uuid, title text, slug text, published_at timestamp with time zone, closed_at timestamp with time zone, submission_cap integer, responses bigint, in_table bigint, held bigint, rejected bigint, state text, quarantine_rule_id uuid, notify_rule_id uuid, presentation jsonb)", security: "definer" },
|
|
312
375
|
{ name: "formula_value", args: "p_organization_id uuid, p_record_id uuid, p_field_data jsonb, p_values jsonb DEFAULT NULL::jsonb", returns: "jsonb", security: "invoker" },
|
|
376
|
+
{ name: "guard_refusals_are_complete", args: "", returns: "TABLE(guard text, said text)", security: "invoker" },
|
|
313
377
|
{ 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" },
|
|
314
378
|
{ 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" },
|
|
315
379
|
{ name: "hidden_field_notice", args: "p_field custom.record, p_action text DEFAULT 'read'::text", returns: "jsonb", security: "invoker" },
|
|
@@ -341,6 +405,7 @@ var STORE_DOORS = [
|
|
|
341
405
|
{ name: "io_record_changed", args: "", returns: "trigger", security: "definer" },
|
|
342
406
|
{ name: "io_restore", args: "p_organization_id uuid, p_record_id uuid, p_version integer", returns: "integer", security: "definer" },
|
|
343
407
|
{ 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" },
|
|
408
|
+
{ 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" },
|
|
344
409
|
{ name: "lookup_value", args: "p_organization_id uuid, p_record_id uuid, p_field_data jsonb", returns: "jsonb", security: "invoker" },
|
|
345
410
|
{ 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" },
|
|
346
411
|
{ 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" },
|
|
@@ -353,9 +418,14 @@ var STORE_DOORS = [
|
|
|
353
418
|
{ 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" },
|
|
354
419
|
{ name: "migrate_rename", args: "p_organization_id uuid, p_id uuid, p_to text, p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
355
420
|
{ 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" },
|
|
356
|
-
{ name: "migrate_retype", args: "p_organization_id uuid, p_id uuid, p_to text, p_note text DEFAULT NULL::text", returns: "jsonb", security: "
|
|
421
|
+
{ name: "migrate_retype", args: "p_organization_id uuid, p_id uuid, p_to text, p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
357
422
|
{ name: "migrate_split", args: "p_organization_id uuid, p_record_id uuid, p_moved_keys text[], p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
358
423
|
{ name: "migrate_undo", args: "p_organization_id uuid, p_log_id uuid", returns: "jsonb", security: "definer" },
|
|
424
|
+
{ name: "migrations", args: "p_organization_id uuid, p_target_id uuid DEFAULT NULL::uuid, p_limit integer DEFAULT 100", returns: "TABLE(id uuid, verb text, target_kind text, target_id uuid, note text, applied_at timestamp with time zone, applied_by uuid, undone_at timestamp with time zone)", security: "definer" },
|
|
425
|
+
{ name: "my_level", args: "p_organization_id uuid, p_id uuid, p_type text DEFAULT 'record'::text", returns: "permission_level", security: "definer" },
|
|
426
|
+
{ name: "my_levels", args: "p_organization_id uuid, p_ids jsonb, p_type text DEFAULT 'record'::text", returns: "TABLE(id uuid, level permission_level)", security: "definer" },
|
|
427
|
+
{ name: "organization_clear", args: "p_organization_id uuid, p_confirm text, p_and_destroy boolean DEFAULT false", returns: "jsonb", security: "definer" },
|
|
428
|
+
{ name: "organization_contents", args: "p_organization_id uuid", returns: "jsonb", security: "definer" },
|
|
359
429
|
{ name: "organization_kernel_id", args: "", returns: "uuid", security: "invoker" },
|
|
360
430
|
{ name: "organization_references", args: "p_kind text, p_organization_id uuid, p_row jsonb", returns: "TABLE(site text, what text, ref_id uuid, openable boolean)", security: "invoker" },
|
|
361
431
|
{ name: "owning_table", args: "p_organization_id uuid, p_record_id uuid", returns: "uuid", security: "invoker" },
|
|
@@ -396,11 +466,17 @@ var STORE_DOORS = [
|
|
|
396
466
|
{ name: "query_visibility_parity", args: "p_organization_id uuid", returns: "TABLE(side text, container_type text, container_id uuid, item_type text, item_id uuid, stored_level permission_level, derived_level permission_level, reason text)", security: "definer" },
|
|
397
467
|
{ name: "query_visible_ids", args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid, p_required text DEFAULT 'viewer'::text", returns: "SETOF uuid", security: "definer" },
|
|
398
468
|
{ name: "reachable_from", args: "p_organization_id uuid, p_roots uuid[]", returns: "TABLE(record_id uuid, depth integer, via text)", security: "invoker" },
|
|
469
|
+
{ name: "reaches_directly", args: "p_user_id uuid, p_type text, p_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level", returns: "boolean", security: "definer" },
|
|
470
|
+
{ name: "read_door_carried_ids", args: "p_user uuid, p_organization_id uuid, p_table_id uuid, p_required permission_level, OUT o_ids uuid[], OUT o_containers integer", returns: "record", security: "definer" },
|
|
471
|
+
{ name: "read_door_granted_ids", args: "p_organization_id uuid, p_table_id uuid", returns: "uuid[]", security: "definer" },
|
|
472
|
+
{ name: "read_door_ladder_ceiling", args: "", returns: "integer", security: "invoker" },
|
|
473
|
+
{ name: "read_door_parity", args: "p_organization_id uuid, p_table_id uuid, p_user uuid, p_required permission_level, p_sample integer", returns: "TABLE(record_id uuid, set_based boolean, per_row boolean, verdict text)", security: "definer" },
|
|
399
474
|
{ name: "read_paths_outside_the_door", args: "", returns: "TABLE(object_name text, why text)", security: "invoker" },
|
|
400
475
|
{ name: "read_record", args: "p_organization_id uuid, p_record_id uuid, p_by_id boolean DEFAULT false", returns: "jsonb", security: "definer" },
|
|
401
476
|
{ 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" },
|
|
402
477
|
{ 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", returns: "TABLE(groups jsonb, measures jsonb, row_count bigint)", security: "definer" },
|
|
403
478
|
{ name: "record_applicability", args: "p_organization_id uuid, p_record_id uuid", returns: "TABLE(rule_id uuid, rule_name text, rule_version integer, applies boolean, answer jsonb)", security: "invoker" },
|
|
479
|
+
{ name: "record_as_of", args: "p_organization_id uuid, p_record_id uuid, p_at timestamp with time zone", returns: "TABLE(state jsonb, replayed boolean)", security: "definer" },
|
|
404
480
|
{ name: "record_card", args: "p_viewer uuid, p_organization_id uuid, p_record_id uuid", returns: "jsonb", security: "definer" },
|
|
405
481
|
{ 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" },
|
|
406
482
|
{ name: "record_delete", args: "p_organization_id uuid, p_record_id uuid", returns: "timestamp with time zone", security: "definer" },
|
|
@@ -414,6 +490,7 @@ var STORE_DOORS = [
|
|
|
414
490
|
{ 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" },
|
|
415
491
|
{ name: "record_write", args: "p_organization_id uuid, p_table_id uuid, p_data jsonb", returns: "uuid", security: "definer" },
|
|
416
492
|
{ name: "relation_carry", args: "p_organization_id uuid, p_container_id uuid, p_item_id uuid", returns: "uuid", security: "definer" },
|
|
493
|
+
{ name: "relation_edges_withdraw", args: "p_organization_id uuid, p_field_ids uuid[], p_why text", returns: "integer", security: "definer" },
|
|
417
494
|
{ name: "relation_own", args: "p_organization_id uuid, p_owner_id uuid, p_target_id uuid", returns: "uuid", security: "definer" },
|
|
418
495
|
{ name: "relation_target_card", args: "p_organization_id uuid, p_record_id uuid, p_via_key text DEFAULT NULL::text", returns: "TABLE(target_id uuid, target_organization_id uuid, is_foreign boolean, masked boolean, reader_level permission_level, card jsonb, why text)", security: "definer" },
|
|
419
496
|
{ name: "relation_target_external", args: "p_connection_token text, p_external_table text, p_external_key text", returns: "jsonb", security: "definer" },
|
|
@@ -428,6 +505,7 @@ var STORE_DOORS = [
|
|
|
428
505
|
{ name: "rollup_value", args: "p_organization_id uuid, p_record_id uuid, p_field_data jsonb", returns: "jsonb", security: "invoker" },
|
|
429
506
|
{ name: "rule_applies", args: "p_organization_id uuid, p_rule_id uuid, p_record_id uuid", returns: "jsonb", security: "invoker" },
|
|
430
507
|
{ name: "rule_context", args: "p_organization_id uuid, p_record_id uuid", returns: "jsonb", security: "invoker" },
|
|
508
|
+
{ name: "rule_declare", args: "p_organization_id uuid, p_spec jsonb, p_rule_id uuid DEFAULT NULL::uuid", returns: "uuid", security: "definer" },
|
|
431
509
|
{ name: "rule_dependency_edges", args: "p_organization_id uuid, p_row custom.record DEFAULT NULL::custom.record", returns: "TABLE(needs text, needed text)", security: "invoker" },
|
|
432
510
|
{ name: "rule_eval", args: "p_organization_id uuid, p_expr jsonb, p_values jsonb, p_context jsonb DEFAULT '{}'::jsonb", returns: "jsonb", security: "invoker" },
|
|
433
511
|
{ name: "rule_field_key", args: "p_organization_id uuid, p_field_id uuid", returns: "text", security: "invoker" },
|
|
@@ -440,6 +518,7 @@ var STORE_DOORS = [
|
|
|
440
518
|
{ name: "rule_truth", args: "p_answer jsonb", returns: "boolean", security: "invoker" },
|
|
441
519
|
{ name: "rule_uses", args: "", returns: "text[]", security: "invoker" },
|
|
442
520
|
{ name: "rule_version", args: "p_organization_id uuid, p_rule_id uuid", returns: "integer", security: "invoker" },
|
|
521
|
+
{ name: "said", args: "p_value text, p_when_there_is_none text", returns: "text", security: "invoker" },
|
|
443
522
|
{ name: "share_access", args: "p_organization_id uuid, p_subject_id uuid", returns: "TABLE(principal_kind text, principal_id uuid, principal_label text, level permission_level, reason text, reason_detail text, via_type text, via_id uuid, revocable boolean)", security: "definer" },
|
|
444
523
|
{ name: "share_grant", args: "p_organization_id uuid, p_subject_id uuid, p_principal_kind text, p_principal_id uuid, p_level permission_level DEFAULT 'viewer'::permission_level", returns: "jsonb", security: "definer" },
|
|
445
524
|
{ name: "share_lane_set", args: "p_organization_id uuid, p_subject_id uuid, p_choice text, p_level permission_level DEFAULT NULL::permission_level", returns: "jsonb", security: "definer" },
|
|
@@ -448,6 +527,7 @@ var STORE_DOORS = [
|
|
|
448
527
|
{ name: "share_people", args: "p_organization_id uuid, p_subject_id uuid DEFAULT NULL::uuid, p_query text DEFAULT NULL::text, p_limit integer DEFAULT 25", returns: "TABLE(user_id uuid, email text, display_name text, membership text, already_at permission_level, already_why text)", security: "definer" },
|
|
449
528
|
{ name: "share_revoke", args: "p_organization_id uuid, p_subject_id uuid, p_principal_kind text, p_principal_id uuid", returns: "jsonb", security: "definer" },
|
|
450
529
|
{ name: "share_subject_name", args: "p_organization_id uuid, p_type text, p_id uuid", returns: "text", security: "definer" },
|
|
530
|
+
{ name: "shared_only_disagreements", args: "p_pretend text DEFAULT NULL::text", returns: "TABLE(organization_id uuid, organization_name text, member_id uuid, record_id uuid, table_id uuid, ladder boolean, read_door boolean, rls_mirror boolean, why text)", security: "invoker" },
|
|
451
531
|
{ name: "size_refusal", args: "p_organization_id uuid, p_data jsonb", returns: "text", security: "invoker" },
|
|
452
532
|
{ name: "source_next_pointer", args: "p_sources jsonb", returns: "text", security: "invoker" },
|
|
453
533
|
{ name: "source_pointer", args: "p_sources jsonb, p_source jsonb", returns: "text", security: "invoker" },
|
|
@@ -457,13 +537,14 @@ var STORE_DOORS = [
|
|
|
457
537
|
{ name: "table_capacity", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "definer" },
|
|
458
538
|
{ name: "table_contents", args: "p_organization_id uuid, p_table_id uuid", returns: "TABLE(record_id uuid, kind text, goes_at integer)", security: "invoker" },
|
|
459
539
|
{ name: "table_declare", args: "p_organization_id uuid, p_spec jsonb", returns: "uuid", security: "definer" },
|
|
540
|
+
{ name: "table_has_a_visible_record", args: "p_user uuid, p_organization_id uuid, p_table_id uuid", returns: "boolean", security: "definer" },
|
|
460
541
|
{ name: "table_is_live", args: "p_organization_id uuid, p_table_id uuid", returns: "boolean", security: "invoker" },
|
|
461
542
|
{ name: "table_kernel_id", args: "", returns: "uuid", security: "invoker" },
|
|
462
543
|
{ name: "table_record_ceiling", args: "", returns: "integer", security: "invoker" },
|
|
463
544
|
{ name: "table_record_ceiling", args: "p_organization_id uuid", returns: "integer", security: "invoker" },
|
|
464
545
|
{ name: "table_rules", args: "p_organization_id uuid, p_table_id uuid, p_use text, p_record_type text DEFAULT NULL::text", returns: "SETOF custom.record", security: "invoker" },
|
|
465
546
|
{ name: "table_storage", args: "p_organization_id uuid, p_table_id uuid", returns: "text", security: "invoker" },
|
|
466
|
-
{ name: "table_type_field", args: "p_organization_id uuid, p_table_id uuid", returns: "text", security: "
|
|
547
|
+
{ name: "table_type_field", args: "p_organization_id uuid, p_table_id uuid", returns: "text", security: "definer" },
|
|
467
548
|
{ name: "tables_at_home", args: "p_organization_id uuid, p_home_ids uuid[]", returns: "TABLE(table_id uuid, home_record_id uuid, kind text)", security: "definer" },
|
|
468
549
|
{ name: "tables_described_without_asking", args: "", returns: "TABLE(function_name text, identity_args text, why text)", security: "invoker" },
|
|
469
550
|
{ name: "trg_associations_bump_visibility", args: "", returns: "trigger", security: "definer" },
|
|
@@ -474,38 +555,52 @@ var STORE_DOORS = [
|
|
|
474
555
|
{ name: "value_envelope_keys", args: "", returns: "text[]", security: "invoker" },
|
|
475
556
|
{ name: "value_envelope_ok", args: "p_data jsonb", returns: "boolean", security: "invoker" },
|
|
476
557
|
{ name: "value_envelope_refusal", args: "p_data jsonb", returns: "text", security: "invoker" },
|
|
477
|
-
{ 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: "
|
|
558
|
+
{ 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" },
|
|
478
559
|
{ name: "value_versions", args: "p_old jsonb, p_new jsonb", returns: "jsonb", security: "invoker" },
|
|
479
560
|
{ 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" },
|
|
480
561
|
{ 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" },
|
|
481
562
|
{ name: "visibility_cache_rebuild", args: "", returns: "integer", security: "definer" },
|
|
482
563
|
{ name: "visibility_parity", args: "", returns: "TABLE(side text, container_type text, container_id uuid, item_type text, item_id uuid, stored_level permission_level, derived_level permission_level, reason text)", security: "definer" },
|
|
483
564
|
{ name: "visibility_warm", args: "p_container_type text, p_container_id uuid", returns: "integer", security: "definer" },
|
|
565
|
+
{ name: "visible_predicate_sql", args: "p_user uuid, p_organization_id uuid, p_table_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level, p_alias text DEFAULT 'r'::text", returns: "text", security: "definer" },
|
|
484
566
|
{ name: "visible_record_ids", args: "p_user_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level", returns: "TABLE(id uuid)", security: "definer" },
|
|
567
|
+
{ name: "visible_set", args: "p_user uuid, p_organization_id uuid, p_table_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level, OUT o_all_visible boolean, OUT o_true_visibility platform.visibility[], OUT o_granted_all uuid[], OUT o_granted_visible uuid[], OUT o_carried_visible uuid[], OUT o_ladder_calls integer, OUT o_fallback boolean, OUT o_note text", returns: "record", security: "definer" },
|
|
485
568
|
{ name: "widget_kernel_id", args: "", returns: "uuid", security: "invoker" },
|
|
569
|
+
{ 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" },
|
|
570
|
+
{ 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" },
|
|
571
|
+
{ name: "work_approval_may_decide", args: "p_organization_id uuid, p_approval_id uuid", returns: "boolean", security: "definer" },
|
|
572
|
+
{ name: "work_approval_read", args: "p_organization_id uuid, p_approval_id uuid", returns: "jsonb", security: "definer" },
|
|
573
|
+
{ 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" },
|
|
574
|
+
{ name: "work_assign", args: "p_organization_id uuid, p_record_id uuid, p_assignee_user_id uuid, p_due_date timestamp with time zone DEFAULT NULL::timestamp with time zone, p_clear_due boolean DEFAULT false", returns: "jsonb", security: "definer" },
|
|
486
575
|
{ name: "work_assignment_fields", args: "p_options_table_id uuid DEFAULT NULL::uuid", returns: "TABLE(key text, label text, spec jsonb)", security: "invoker" },
|
|
487
|
-
{ name: "work_has_assignment", args: "p_organization_id uuid, p_table_id uuid", returns: "boolean", security: "
|
|
488
|
-
{ name: "
|
|
576
|
+
{ name: "work_has_assignment", args: "p_organization_id uuid, p_table_id uuid", returns: "boolean", security: "definer" },
|
|
577
|
+
{ name: "work_inbox", args: "p_organization_id uuid, p_limit integer DEFAULT 50, p_offset integer DEFAULT 0, p_include_decided boolean DEFAULT false", returns: "TABLE(item_id uuid, kind text, origin text, title text, subject_id uuid, subject_kind text, summary text, state text, due_on timestamp with time zone, due_state text, actionable boolean, requested_by uuid, requested_by_name text, at timestamp with time zone)", security: "definer" },
|
|
578
|
+
{ name: "work_instantiation_shape", args: "p_organization_id uuid, p_instantiation_id uuid", returns: "jsonb", security: "definer" },
|
|
579
|
+
{ 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" },
|
|
580
|
+
{ name: "work_person", args: "p_organization_id uuid, p_user_id uuid, p_create boolean DEFAULT true", returns: "uuid", security: "definer" },
|
|
581
|
+
{ name: "work_record_states", args: "p_organization_id uuid, p_record_id uuid", returns: "TABLE(state_id uuid, name text, sort integer, terminal boolean, is_current boolean, allowed boolean, refusal text)", security: "definer" },
|
|
489
582
|
{ name: "work_relation_kinds", args: "", returns: "TABLE(kind text, available boolean, why text)", security: "invoker" },
|
|
490
|
-
{ name: "
|
|
491
|
-
{ name: "
|
|
492
|
-
{ name: "
|
|
583
|
+
{ name: "work_set_state", args: "p_organization_id uuid, p_record_id uuid, p_state_id uuid", returns: "jsonb", security: "definer" },
|
|
584
|
+
{ name: "work_slot_expire", args: "p_organization_id uuid, p_table_id uuid", returns: "integer", security: "definer" },
|
|
585
|
+
{ name: "work_slot_hold", args: "p_organization_id uuid, p_table_id uuid, p_slot_key text, p_holder text, p_ttl interval DEFAULT '00:15:00'::interval", returns: "jsonb", security: "definer" },
|
|
586
|
+
{ name: "work_slot_holds", args: "p_organization_id uuid, p_table_id uuid", returns: "TABLE(hold_id uuid, slot_key text, holder text, expires_at timestamp with time zone, expired boolean)", security: "definer" },
|
|
493
587
|
{ name: "work_slot_index_name", args: "p_table_id uuid", returns: "text", security: "invoker" },
|
|
494
|
-
{ name: "work_slot_release", args: "p_organization_id uuid, p_hold_id uuid", returns: "boolean", security: "
|
|
495
|
-
{ 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: "
|
|
588
|
+
{ name: "work_slot_release", args: "p_organization_id uuid, p_hold_id uuid", returns: "boolean", security: "definer" },
|
|
589
|
+
{ 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" },
|
|
496
590
|
{ name: "work_states", args: "", returns: "TABLE(sort integer, name text, terminal boolean, next text[])", security: "invoker" },
|
|
497
|
-
{ name: "work_take_assignment", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "
|
|
498
|
-
{ name: "work_template_declare", args: "p_organization_id uuid, p_name text, p_graph jsonb", returns: "uuid", security: "
|
|
499
|
-
{ name: "work_template_instantiate", args: "p_organization_id uuid, p_template_id uuid, p_overrides jsonb DEFAULT '{}'::jsonb", returns: "jsonb", security: "
|
|
591
|
+
{ name: "work_take_assignment", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "definer" },
|
|
592
|
+
{ name: "work_template_declare", args: "p_organization_id uuid, p_name text, p_graph jsonb", returns: "uuid", security: "definer" },
|
|
593
|
+
{ name: "work_template_instantiate", args: "p_organization_id uuid, p_template_id uuid, p_overrides jsonb DEFAULT '{}'::jsonb", returns: "jsonb", security: "definer" },
|
|
500
594
|
{ name: "work_template_refusal", args: "p_graph jsonb", returns: "text", security: "invoker" },
|
|
501
|
-
{ name: "work_template_shape", args: "p_organization_id uuid, p_template_id uuid", returns: "jsonb", security: "
|
|
502
|
-
{ name: "
|
|
503
|
-
{ name: "
|
|
595
|
+
{ name: "work_template_shape", args: "p_organization_id uuid, p_template_id uuid", returns: "jsonb", security: "definer" },
|
|
596
|
+
{ name: "work_templates", args: "p_organization_id uuid, p_limit integer DEFAULT 100", returns: "TABLE(template_id uuid, name text, nodes integer, relations integer, created_at timestamp with time zone)", security: "definer" },
|
|
597
|
+
{ name: "work_transition_refusal", args: "p_organization_id uuid, p_from_state_id uuid, p_to_state_id uuid", returns: "text", security: "definer" },
|
|
598
|
+
{ name: "work_whose_turn", args: "p_organization_id uuid, p_table_id uuid, p_include_finished boolean DEFAULT false", returns: "TABLE(record_id uuid, title text, assignee_id uuid, turn text, due_on timestamp with time zone, state text, status text, terminal boolean)", security: "definer" }
|
|
504
599
|
];
|
|
505
600
|
var STORE_KNOBS = [
|
|
506
|
-
{ key: "accessible_entity_ids_guard", value: "
|
|
507
|
-
{ key: "agent_schema_changes", value: '"
|
|
508
|
-
{ key: "associations_guard", value: "
|
|
601
|
+
{ key: "accessible_entity_ids_guard", value: "true", type: "boolean" },
|
|
602
|
+
{ key: "agent_schema_changes", value: '"ask"', type: "string" },
|
|
603
|
+
{ key: "associations_guard", value: "true", type: "boolean" },
|
|
509
604
|
{ key: "code_paths_enabled", value: "false", type: "boolean" },
|
|
510
605
|
{ key: "consumer_chat_seeding_enabled", value: "false", type: "boolean" },
|
|
511
606
|
{ key: "consumer_checkout_enabled", value: "false", type: "boolean" },
|
|
@@ -525,7 +620,7 @@ var STORE_KNOBS = [
|
|
|
525
620
|
{ key: "external_principal_enabled", value: "false", type: "boolean" },
|
|
526
621
|
{ key: "field_index_guard", value: "false", type: "boolean" },
|
|
527
622
|
{ key: "field_sensitivity_levels", value: '{"edit": {"public": "editor", "internal": "editor", "restricted": "admin", "confidential": "admin"}, "read": {"public": "viewer", "internal": "viewer", "restricted": "admin", "confidential": "editor"}}', type: "json" },
|
|
528
|
-
{ key: "member_default_level", value: '"viewer"', type: "
|
|
623
|
+
{ key: "member_default_level", value: '"viewer"', type: "enum" },
|
|
529
624
|
{ key: "member_default_visibility", value: '"all_records"', type: "enum" },
|
|
530
625
|
{ key: "records_tool_default", value: "true", type: "boolean" },
|
|
531
626
|
{ key: "row_versions_guard", value: "false", type: "boolean" },
|
|
@@ -540,16 +635,17 @@ var STORE_KNOBS = [
|
|
|
540
635
|
{ key: "world_publish_enabled", value: "false", type: "boolean" }
|
|
541
636
|
];
|
|
542
637
|
var STORE_REFUSAL_CODES = [
|
|
543
|
-
{ code: "02000", raised_by: "doc_render_body,doc_render_document,doc_sign,doc_signature_intact,doc_template_save,external_history_event,external_rows,external_stub_upsert,external_writes_set,migrate_delete,migrate_extract_parent,migrate_merge,migrate_rename,migrate_reparent,migrate_retype,migrate_split,migrate_undo,read_record,record_delete,record_restore,record_update,relation_uncarry,share_access,share_grant,share_lane_set,share_people,share_revoke,visibility_as_of" },
|
|
544
|
-
{ code: "0A000", raised_by: "external_rows,external_source_declare,external_write_through,promote_field,promoted_index_expr,promoted_query_sql,promoted_read,rule_eval,work_slots_declare" },
|
|
545
|
-
{ code: "22004", raised_by: "_value_envelope,actor_word,agg_assert_key,agg_sql,anon_capture,anon_token_issue,anon_write,assert_client_may_reach,doc_render_write,doc_sign,doc_signature_write,doc_template_save,external_history_event,external_rows,external_source_declare,external_stub_upsert,external_write_through,external_writes_set,home_add,io_comment_write,io_import_open,io_outbox_drain,io_restore,migrate_purge,migrate_split,migrate_undo,query_across_homes,query_by_coordinates,query_rollup,record_delete,record_reparent,record_resolve,record_restore,record_update,record_write,relation_carry,relation_own,share_grant,table_declare,work_template_declare" },
|
|
638
|
+
{ 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" },
|
|
639
|
+
{ code: "0A000", raised_by: "external_rows,external_source_declare,external_write_through,promote_field,promoted_index_expr,promoted_query_sql,promoted_read,rule_eval,work_assign,work_slots_declare" },
|
|
640
|
+
{ 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" },
|
|
546
641
|
{ code: "22012", raised_by: "rule_eval" },
|
|
547
|
-
{ code: "22023", raised_by: "_value_envelope,_work_shape_guard,actor_word,agg_assert_key,agg_sql,anon_token_issue,containment_parent,doc_render_body,doc_render_write,doc_signature_write,external_history_event,external_source_declare,external_stub_upsert,external_write_through,io_import_open,io_proposal_accept,migrate_merge,query_by_coordinates,query_rollup,record_update,relation_carry,rule_eval,rule_members,share_grant,share_lane_set,table_rules,visibility_as_of,work_slot_hold" },
|
|
548
|
-
{ code: "23503", raised_by: "_containment_guard,_record_rule_uses,anon_publish,anon_rate_take,anon_token_issue,anon_write,assert_organization_wall,delete_rule,doc_sign,doc_template_save,home_add,io_comment_write,io_import_rows,io_proposal_accept,migrate_demote,migrate_promote,promote_field,promote_table,record_applicability,record_reparent,relation_carry,relation_own,resolve_first_match,rule_applies,rule_eval,rule_members,rule_run,work_take_assignment,work_template_instantiate" },
|
|
549
|
-
{ code: "23505", raised_by: "doc_sign,doc_signature_write,field_declare,home_add,io_proposal_accept,relation_carry,relation_own,share_grant,work_slot_hold" },
|
|
550
|
-
{ code: "23514", raised_by: "_containment_guard,_dated_values_guard,_derived_fields,_field_document_for,_field_shape_guard,_field_type_parity_guard,_merge_field_shape_guard,_merge_field_temporal_guard,_promoted_field_cap_guard,_record_rule_uses,_rule_shape_guard,_rule_topology_guard,_store_relation_edge_names_its_field,_table_shape_guard,_value_envelope,_work_shape_guard,doc_sign,doc_signature_write,doc_template_save,field_declare,field_retire,field_update,home_add,migrate_merge,relation_carry,relation_own,validate_value_envelope,validate_values,work_slots_declare,work_take_assignment,work_template_instantiate" },
|
|
642
|
+
{ 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" },
|
|
643
|
+
{ 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" },
|
|
644
|
+
{ 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" },
|
|
645
|
+
{ 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" },
|
|
551
646
|
{ code: "40001", raised_by: "has_visibility_at" },
|
|
552
|
-
{ 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_organization_admin,assert_store_door,external_write_through,io_comment_resolve,io_comment_write,io_restore,migrate_purge,promote_table,query_visibility_parity,read_record,read_records,share_grant,visibility_as_of" },
|
|
647
|
+
{ 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" },
|
|
648
|
+
{ code: "42703", raised_by: "entity_table" },
|
|
553
649
|
{ code: "53400", raised_by: "anon_rate_take,delete_cascade_closure,promote_field" },
|
|
554
650
|
{ code: "54001", raised_by: "record_delete" },
|
|
555
651
|
{ code: "PT409", raised_by: "record_update" }
|
|
@@ -1671,6 +1767,10 @@ var DOORS = {
|
|
|
1671
1767
|
recordReparent: "record_reparent",
|
|
1672
1768
|
containmentChain: "containment_chain",
|
|
1673
1769
|
storeIsOpen: "store_is_open",
|
|
1770
|
+
// DOOR-1, from the screen's side. What level the CALLER holds on the subjects
|
|
1771
|
+
// they name — the one question a screen has to answer BEFORE it draws a
|
|
1772
|
+
// control, and the only one the store had no client answer to.
|
|
1773
|
+
myLevels: "my_levels",
|
|
1674
1774
|
// DOOR-11. The record's own revision list. A screen that offers an optimistic
|
|
1675
1775
|
// save needs the version it LOADED, and the read door answers documents, not
|
|
1676
1776
|
// versions — so the version comes from here, once, for the one record being
|
|
@@ -1692,6 +1792,17 @@ var DOORS = {
|
|
|
1692
1792
|
ruleMembership: "rule_membership",
|
|
1693
1793
|
ruleRun: "rule_run",
|
|
1694
1794
|
ruleEval: "rule_eval",
|
|
1795
|
+
// REC-15: the door that makes a Rule a RULE. `custom.record_write` into the
|
|
1796
|
+
// Rule kernel produces a valid Rule document carrying `data_class = 'record'`,
|
|
1797
|
+
// and every reader that goes LOOKING for a Rule looks for the class — so a
|
|
1798
|
+
// subscription written that way was invisible to DOOR-18 and nothing fired.
|
|
1799
|
+
// PRODUCTS row 1 — a form is a view on a real Table. `forms` lists an
|
|
1800
|
+
// organization's own, `formDeclare` writes one, and `anonPublish` is the one
|
|
1801
|
+
// act that opens it to people with no account. The PUBLIC pair
|
|
1802
|
+
// (`custom.form_public`, `custom.form_submit`) is deliberately absent: those
|
|
1803
|
+
// are server-lane doors and a browser never calls them.
|
|
1804
|
+
forms: "forms",
|
|
1805
|
+
formDeclare: "form_declare",
|
|
1695
1806
|
// The eighth verb (AGT-N-8): a grouped, bucketed, filtered count/sum/avg/
|
|
1696
1807
|
// min/max computed INSIDE the read door's own query, so a chart shows exactly
|
|
1697
1808
|
// the rows this person may see and never fetches the ones they may not.
|
|
@@ -1781,6 +1892,14 @@ var BY_SQLSTATE = {
|
|
|
1781
1892
|
// is wrong for the shape the store holds, which is what `invalid_argument`
|
|
1782
1893
|
// already means — the store's own sentence names the value and the type.
|
|
1783
1894
|
"22P02": "invalid_argument",
|
|
1895
|
+
// 42703 — a column that is not there. The store raises it from
|
|
1896
|
+
// `custom.entity_table`, which is asked for a column by NAME, so the class is
|
|
1897
|
+
// exactly "the call named something the shape does not have": the same thing
|
|
1898
|
+
// `invalid_argument` already means, and the store's own sentence names the
|
|
1899
|
+
// column. Added 2026-09-20 (lane FORMS) because the package's live-door suite
|
|
1900
|
+
// caught it raised by a door this package did not know about — which is the
|
|
1901
|
+
// suite working, and is why the map is a census rather than a guess.
|
|
1902
|
+
"42703": "invalid_argument",
|
|
1784
1903
|
"02000": "not_found",
|
|
1785
1904
|
"23503": "missing_reference",
|
|
1786
1905
|
"23505": "already_exists",
|
|
@@ -2219,6 +2338,31 @@ function createRecordsClient(config) {
|
|
|
2219
2338
|
"ruleMembership"
|
|
2220
2339
|
);
|
|
2221
2340
|
},
|
|
2341
|
+
async forms(args) {
|
|
2342
|
+
return callDoor(
|
|
2343
|
+
DOORS.forms,
|
|
2344
|
+
{ p_organization_id: org, p_table_id: args?.table_id ?? null },
|
|
2345
|
+
"forms"
|
|
2346
|
+
);
|
|
2347
|
+
},
|
|
2348
|
+
async formDeclare(args) {
|
|
2349
|
+
return callDoor(
|
|
2350
|
+
DOORS.formDeclare,
|
|
2351
|
+
{
|
|
2352
|
+
p_organization_id: org,
|
|
2353
|
+
p_table_id: args.table_id,
|
|
2354
|
+
p_title: args.title,
|
|
2355
|
+
p_questions: args.questions,
|
|
2356
|
+
p_presentation: args.presentation ?? {},
|
|
2357
|
+
p_submission_cap: args.submission_cap ?? null,
|
|
2358
|
+
p_quarantine_rule_id: args.quarantine_rule_id ?? null,
|
|
2359
|
+
p_notify_rule_id: args.notify_rule_id ?? null,
|
|
2360
|
+
p_form_id: args.form_id ?? null,
|
|
2361
|
+
p_slug: args.slug ?? null
|
|
2362
|
+
},
|
|
2363
|
+
"formDeclare"
|
|
2364
|
+
);
|
|
2365
|
+
},
|
|
2222
2366
|
async ruleRun({ rule_id, values, context }) {
|
|
2223
2367
|
return callDoor(
|
|
2224
2368
|
DOORS.ruleRun,
|
|
@@ -2627,10 +2771,12 @@ function createRecordsClient(config) {
|
|
|
2627
2771
|
"publishToWorld"
|
|
2628
2772
|
);
|
|
2629
2773
|
},
|
|
2630
|
-
async ruleDeclare() {
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2774
|
+
async ruleDeclare({ spec, rule_id }) {
|
|
2775
|
+
return callDoor(
|
|
2776
|
+
DOORS.ruleDeclare,
|
|
2777
|
+
{ p_organization_id: org, p_spec: spec, p_rule_id: rule_id ?? null },
|
|
2778
|
+
"ruleDeclare"
|
|
2779
|
+
);
|
|
2634
2780
|
},
|
|
2635
2781
|
async metadataSearch() {
|
|
2636
2782
|
const refusal = doorAbsent(DOORS.metadataSearch);
|
|
@@ -2663,6 +2809,18 @@ function createRecordsClient(config) {
|
|
|
2663
2809
|
},
|
|
2664
2810
|
async storeIsOpen() {
|
|
2665
2811
|
return callDoor(DOORS.storeIsOpen, { p_organization_id: org }, "storeIsOpen");
|
|
2812
|
+
},
|
|
2813
|
+
async myLevels({ ids, subject }) {
|
|
2814
|
+
if (ids.length === 0) return ok([]);
|
|
2815
|
+
const answered = await callDoor(
|
|
2816
|
+
DOORS.myLevels,
|
|
2817
|
+
{ p_organization_id: org, p_ids: ids, p_type: subject ?? "record" },
|
|
2818
|
+
"myLevels"
|
|
2819
|
+
);
|
|
2820
|
+
if (!answered.ok) return err(answered.error);
|
|
2821
|
+
return ok(
|
|
2822
|
+
(answered.data ?? []).map((row) => ({ id: row.id, level: asPermissionLevel(row.level) }))
|
|
2823
|
+
);
|
|
2666
2824
|
}
|
|
2667
2825
|
};
|
|
2668
2826
|
return client;
|