@ai-matrx/records 0.24.0 → 0.27.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 +97 -0
- package/dist/core/index.cjs +491 -8
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +110 -3
- package/dist/core/index.d.ts +110 -3
- package/dist/core/index.js +491 -8
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +350 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +737 -15
- package/dist/index.d.ts +737 -15
- package/dist/index.js +350 -8
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +491 -8
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +831 -15
- package/dist/react/index.d.ts +831 -15
- package/dist/react/index.js +491 -8
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
package/dist/core/index.js
CHANGED
|
@@ -124,6 +124,12 @@ function looksLikeAnId(value) {
|
|
|
124
124
|
return typeof value === "string" && UUID.test(value);
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
+
// src/pipeline.ts
|
|
128
|
+
var PIPELINE_RULE_KINDS = ["moves", "requires", "who", "limit", "entry"];
|
|
129
|
+
function mayDrag(level) {
|
|
130
|
+
return level === "editor" || level === "admin" || level === "owner";
|
|
131
|
+
}
|
|
132
|
+
|
|
127
133
|
// src/rule.ts
|
|
128
134
|
function publicFormPath(formId) {
|
|
129
135
|
return `/f/${formId}`;
|
|
@@ -139,6 +145,285 @@ function measureKey(measure) {
|
|
|
139
145
|
return measure.op === "count" ? "count" : `${measure.op}_${measure.key ?? ""}`;
|
|
140
146
|
}
|
|
141
147
|
|
|
148
|
+
// src/capture-queue.ts
|
|
149
|
+
var DB_NAME = "matrx-capture";
|
|
150
|
+
var DB_VERSION = 1;
|
|
151
|
+
var ITEMS = "captures";
|
|
152
|
+
var META = "meta";
|
|
153
|
+
var REFUSALS_WORTH_REPEATING = /* @__PURE__ */ new Set([
|
|
154
|
+
"stale_read",
|
|
155
|
+
"timed_out",
|
|
156
|
+
"store_limit"
|
|
157
|
+
]);
|
|
158
|
+
var SQLSTATES_WORTH_REPEATING = /* @__PURE__ */ new Set(["40001", "57014", "53400"]);
|
|
159
|
+
function isDecided(error) {
|
|
160
|
+
if (!error) return false;
|
|
161
|
+
const { code, sqlstate } = error;
|
|
162
|
+
if (code && REFUSALS_WORTH_REPEATING.has(code)) return false;
|
|
163
|
+
if (sqlstate && SQLSTATES_WORTH_REPEATING.has(sqlstate)) return false;
|
|
164
|
+
return !!(code || sqlstate);
|
|
165
|
+
}
|
|
166
|
+
function mintClientKey() {
|
|
167
|
+
const c = typeof crypto !== "undefined" ? crypto : void 0;
|
|
168
|
+
if (c && typeof c.randomUUID === "function") return `cap-${c.randomUUID()}`;
|
|
169
|
+
if (c && typeof c.getRandomValues === "function") {
|
|
170
|
+
const b = c.getRandomValues(new Uint8Array(16));
|
|
171
|
+
return `cap-${Array.from(b, (x) => x.toString(16).padStart(2, "0")).join("")}`;
|
|
172
|
+
}
|
|
173
|
+
return `cap-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 12)}`;
|
|
174
|
+
}
|
|
175
|
+
function indexedDbStore(name = DB_NAME) {
|
|
176
|
+
const idb = typeof globalThis !== "undefined" ? globalThis.indexedDB : void 0;
|
|
177
|
+
if (!idb) return null;
|
|
178
|
+
const open = () => new Promise((resolve, reject) => {
|
|
179
|
+
const req = idb.open(name, DB_VERSION);
|
|
180
|
+
req.onupgradeneeded = () => {
|
|
181
|
+
const db = req.result;
|
|
182
|
+
if (!db.objectStoreNames.contains(ITEMS)) db.createObjectStore(ITEMS, { keyPath: "client_key" });
|
|
183
|
+
if (!db.objectStoreNames.contains(META)) db.createObjectStore(META);
|
|
184
|
+
};
|
|
185
|
+
req.onsuccess = () => resolve(req.result);
|
|
186
|
+
req.onerror = () => reject(req.error);
|
|
187
|
+
});
|
|
188
|
+
const run = (store, mode, fn) => open().then(
|
|
189
|
+
(db) => new Promise((resolve, reject) => {
|
|
190
|
+
const tx = db.transaction(store, mode);
|
|
191
|
+
const req = fn(tx.objectStore(store));
|
|
192
|
+
req.onsuccess = () => resolve(req.result);
|
|
193
|
+
req.onerror = () => reject(req.error);
|
|
194
|
+
tx.oncomplete = () => db.close();
|
|
195
|
+
})
|
|
196
|
+
);
|
|
197
|
+
return {
|
|
198
|
+
all: () => run(ITEMS, "readonly", (s) => s.getAll()),
|
|
199
|
+
put: (item) => run(ITEMS, "readwrite", (s) => s.put(item)).then(() => void 0),
|
|
200
|
+
remove: (key) => run(ITEMS, "readwrite", (s) => s.delete(key)).then(() => void 0),
|
|
201
|
+
meta: (key) => run(META, "readonly", (s) => s.get(key)).then((v) => v ?? null),
|
|
202
|
+
setMeta: (key, value) => run(META, "readwrite", (s) => s.put(value, key)).then(() => void 0)
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
function memoryStore() {
|
|
206
|
+
const rows = /* @__PURE__ */ new Map();
|
|
207
|
+
const meta = /* @__PURE__ */ new Map();
|
|
208
|
+
return {
|
|
209
|
+
all: async () => Array.from(rows.values()),
|
|
210
|
+
put: async (item) => void rows.set(item.client_key, item),
|
|
211
|
+
remove: async (key) => void rows.delete(key),
|
|
212
|
+
meta: async (key) => meta.get(key) ?? null,
|
|
213
|
+
setMeta: async (key, value) => void meta.set(key, value)
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
function countOf(items) {
|
|
217
|
+
const c = { waiting: 0, sending: 0, refused: 0, landed: 0 };
|
|
218
|
+
for (const i of items) c[i.state] += 1;
|
|
219
|
+
return c;
|
|
220
|
+
}
|
|
221
|
+
function openCaptureQueue(opts) {
|
|
222
|
+
const now = opts.now ?? (() => /* @__PURE__ */ new Date());
|
|
223
|
+
const store = opts.store ?? indexedDbStore() ?? memoryStore();
|
|
224
|
+
let syncing = null;
|
|
225
|
+
let disposed = false;
|
|
226
|
+
const online = () => {
|
|
227
|
+
const nav = typeof navigator !== "undefined" ? navigator : void 0;
|
|
228
|
+
return nav ? nav.onLine !== false : true;
|
|
229
|
+
};
|
|
230
|
+
const announce = async () => {
|
|
231
|
+
if (!opts.onChange) return;
|
|
232
|
+
const items = await store.all();
|
|
233
|
+
opts.onChange(countOf(items), items);
|
|
234
|
+
};
|
|
235
|
+
const oldestFirst = (items) => items.slice().sort((a, b) => a.captured_at.localeCompare(b.captured_at));
|
|
236
|
+
const queue = {
|
|
237
|
+
async enqueue(input) {
|
|
238
|
+
const key = input.client_key ?? mintClientKey();
|
|
239
|
+
const item = {
|
|
240
|
+
client_key: key,
|
|
241
|
+
organization_id: input.organization_id,
|
|
242
|
+
sheet_id: input.sheet_id,
|
|
243
|
+
sheet_title: input.sheet_title,
|
|
244
|
+
answers: input.answers ?? {},
|
|
245
|
+
files: (input.files ?? []).map((f) => ({ ...f, uploaded: null })),
|
|
246
|
+
device: input.device ?? null,
|
|
247
|
+
captured_at: input.captured_at ?? now().toISOString(),
|
|
248
|
+
location: input.location ?? null,
|
|
249
|
+
state: "waiting",
|
|
250
|
+
attempts: 0,
|
|
251
|
+
last_error: null,
|
|
252
|
+
record_id: null,
|
|
253
|
+
replayed: false,
|
|
254
|
+
queued_at: now().toISOString(),
|
|
255
|
+
landed_at: null
|
|
256
|
+
};
|
|
257
|
+
await store.put(item);
|
|
258
|
+
await announce();
|
|
259
|
+
return key;
|
|
260
|
+
},
|
|
261
|
+
list: () => store.all().then(oldestFirst),
|
|
262
|
+
counts: () => store.all().then(countOf),
|
|
263
|
+
async sync() {
|
|
264
|
+
if (syncing) return syncing;
|
|
265
|
+
syncing = (async () => {
|
|
266
|
+
const report = {
|
|
267
|
+
attempted: 0,
|
|
268
|
+
landed: 0,
|
|
269
|
+
replayed: 0,
|
|
270
|
+
refused: 0,
|
|
271
|
+
deferred: 0,
|
|
272
|
+
outcomes: []
|
|
273
|
+
};
|
|
274
|
+
const pending = oldestFirst(await store.all()).filter((i) => i.state === "waiting" || i.state === "sending");
|
|
275
|
+
if (!online()) {
|
|
276
|
+
report.deferred = pending.length;
|
|
277
|
+
report.stopped_because = "There is no signal, so nothing was sent. Everything is still here.";
|
|
278
|
+
return report;
|
|
279
|
+
}
|
|
280
|
+
for (const item of pending) {
|
|
281
|
+
report.attempted += 1;
|
|
282
|
+
item.state = "sending";
|
|
283
|
+
item.attempts += 1;
|
|
284
|
+
await store.put(item);
|
|
285
|
+
await announce();
|
|
286
|
+
try {
|
|
287
|
+
for (const f of item.files) {
|
|
288
|
+
if (f.uploaded) continue;
|
|
289
|
+
f.uploaded = await opts.ports.uploadFile(f, item);
|
|
290
|
+
f.blob = null;
|
|
291
|
+
await store.put(item);
|
|
292
|
+
}
|
|
293
|
+
const refs = item.files.map((f) => ({
|
|
294
|
+
field: f.field,
|
|
295
|
+
name: f.name,
|
|
296
|
+
mime_type: f.mime_type,
|
|
297
|
+
size_bytes: f.size_bytes,
|
|
298
|
+
duration_ms: f.duration_ms ?? null,
|
|
299
|
+
file_id: f.uploaded?.file_id ?? null,
|
|
300
|
+
url: f.uploaded?.url ?? null
|
|
301
|
+
}));
|
|
302
|
+
const res = await opts.ports.submit({
|
|
303
|
+
sheet_id: item.sheet_id,
|
|
304
|
+
client_key: item.client_key,
|
|
305
|
+
answers: item.answers,
|
|
306
|
+
files: refs,
|
|
307
|
+
device: item.device,
|
|
308
|
+
captured_at: item.captured_at,
|
|
309
|
+
location: item.location
|
|
310
|
+
});
|
|
311
|
+
if (res.ok && res.data && res.data.record_id) {
|
|
312
|
+
item.state = "landed";
|
|
313
|
+
item.record_id = res.data.record_id;
|
|
314
|
+
item.replayed = !!res.data.replay;
|
|
315
|
+
item.landed_at = now().toISOString();
|
|
316
|
+
item.last_error = null;
|
|
317
|
+
report.landed += 1;
|
|
318
|
+
if (item.replayed) report.replayed += 1;
|
|
319
|
+
report.outcomes.push({
|
|
320
|
+
client_key: item.client_key,
|
|
321
|
+
state: item.state,
|
|
322
|
+
record_id: item.record_id,
|
|
323
|
+
replay: item.replayed,
|
|
324
|
+
says: res.data.message ?? null
|
|
325
|
+
});
|
|
326
|
+
} else if (res.ok && res.data && !res.data.record_id) {
|
|
327
|
+
item.state = "refused";
|
|
328
|
+
item.last_error = res.data.message ?? `This sheet is ${res.data.state}.`;
|
|
329
|
+
report.refused += 1;
|
|
330
|
+
report.outcomes.push({
|
|
331
|
+
client_key: item.client_key,
|
|
332
|
+
state: item.state,
|
|
333
|
+
record_id: null,
|
|
334
|
+
replay: false,
|
|
335
|
+
says: item.last_error
|
|
336
|
+
});
|
|
337
|
+
} else if (isDecided(res.error)) {
|
|
338
|
+
item.state = "refused";
|
|
339
|
+
item.last_error = res.error?.message ?? "The store refused this capture.";
|
|
340
|
+
report.refused += 1;
|
|
341
|
+
report.outcomes.push({
|
|
342
|
+
client_key: item.client_key,
|
|
343
|
+
state: item.state,
|
|
344
|
+
record_id: null,
|
|
345
|
+
replay: false,
|
|
346
|
+
says: item.last_error
|
|
347
|
+
});
|
|
348
|
+
} else {
|
|
349
|
+
item.state = "waiting";
|
|
350
|
+
item.last_error = res.error?.message ?? "It could not be sent just now.";
|
|
351
|
+
report.deferred += 1;
|
|
352
|
+
report.outcomes.push({
|
|
353
|
+
client_key: item.client_key,
|
|
354
|
+
state: item.state,
|
|
355
|
+
record_id: null,
|
|
356
|
+
replay: false,
|
|
357
|
+
says: item.last_error
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
} catch (err2) {
|
|
361
|
+
item.state = "waiting";
|
|
362
|
+
item.last_error = err2 instanceof Error ? err2.message : "It could not be sent just now.";
|
|
363
|
+
report.deferred += 1;
|
|
364
|
+
report.outcomes.push({
|
|
365
|
+
client_key: item.client_key,
|
|
366
|
+
state: item.state,
|
|
367
|
+
record_id: null,
|
|
368
|
+
replay: false,
|
|
369
|
+
says: item.last_error
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
await store.put(item);
|
|
373
|
+
await announce();
|
|
374
|
+
if (!online()) {
|
|
375
|
+
report.stopped_because = "The signal went away again. Everything still on the phone is still here.";
|
|
376
|
+
break;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
await store.setMeta("last_synced_at", now().toISOString());
|
|
380
|
+
return report;
|
|
381
|
+
})();
|
|
382
|
+
try {
|
|
383
|
+
return await syncing;
|
|
384
|
+
} finally {
|
|
385
|
+
syncing = null;
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
async retry(clientKey, patch) {
|
|
389
|
+
const items = await store.all();
|
|
390
|
+
const item = items.find((i) => i.client_key === clientKey);
|
|
391
|
+
if (!item) return;
|
|
392
|
+
if (patch?.answers) item.answers = { ...item.answers, ...patch.answers };
|
|
393
|
+
item.state = "waiting";
|
|
394
|
+
item.last_error = null;
|
|
395
|
+
await store.put(item);
|
|
396
|
+
await announce();
|
|
397
|
+
},
|
|
398
|
+
async discard(clientKey) {
|
|
399
|
+
await store.remove(clientKey);
|
|
400
|
+
await announce();
|
|
401
|
+
},
|
|
402
|
+
async clearLanded() {
|
|
403
|
+
const items = await store.all();
|
|
404
|
+
const landed = items.filter((i) => i.state === "landed");
|
|
405
|
+
for (const i of landed) await store.remove(i.client_key);
|
|
406
|
+
await announce();
|
|
407
|
+
return landed.length;
|
|
408
|
+
},
|
|
409
|
+
lastSyncedAt: () => store.meta("last_synced_at"),
|
|
410
|
+
isOnline: online,
|
|
411
|
+
dispose() {
|
|
412
|
+
disposed = true;
|
|
413
|
+
if (typeof window !== "undefined" && handler) window.removeEventListener("online", handler);
|
|
414
|
+
}
|
|
415
|
+
};
|
|
416
|
+
let handler = null;
|
|
417
|
+
const auto = opts.autoSync ?? typeof window !== "undefined";
|
|
418
|
+
if (auto && typeof window !== "undefined") {
|
|
419
|
+
handler = () => {
|
|
420
|
+
if (!disposed) void queue.sync();
|
|
421
|
+
};
|
|
422
|
+
window.addEventListener("online", handler);
|
|
423
|
+
}
|
|
424
|
+
return queue;
|
|
425
|
+
}
|
|
426
|
+
|
|
142
427
|
// src/results.ts
|
|
143
428
|
function isRecordsErr(result) {
|
|
144
429
|
return result.ok === false;
|
|
@@ -171,6 +456,7 @@ var PARITY_FIELD_TYPES = [
|
|
|
171
456
|
{ parity_type: "url", behavior: "text", made_of: "text whose format is url, with the pattern Rule that makes the format enforceable" }
|
|
172
457
|
];
|
|
173
458
|
var RULE_NODE_KINDS = [
|
|
459
|
+
{ node: "actor_at_least", evaluated_by: "PIPELINES" },
|
|
174
460
|
{ node: "add", evaluated_by: "W1-RULE" },
|
|
175
461
|
{ node: "and", evaluated_by: "W1-RULE" },
|
|
176
462
|
{ node: "concat", evaluated_by: "W1-RULE" },
|
|
@@ -191,6 +477,8 @@ var RULE_NODE_KINDS = [
|
|
|
191
477
|
{ node: "or", evaluated_by: "W1-RULE" },
|
|
192
478
|
{ node: "parent_field", evaluated_by: "W1-RULE-APPLY" },
|
|
193
479
|
{ node: "present", evaluated_by: "W1-RULE" },
|
|
480
|
+
{ node: "previous", evaluated_by: "PIPELINES" },
|
|
481
|
+
{ node: "stage_count", evaluated_by: "PIPELINES" },
|
|
194
482
|
{ node: "sub", evaluated_by: "W1-RULE" }
|
|
195
483
|
];
|
|
196
484
|
var KERNEL_TABLES = [
|
|
@@ -213,16 +501,27 @@ var STORE_DOORS = [
|
|
|
213
501
|
{ name: "agent_table_claim", args: "p_organization uuid, p_table uuid, p_conversation uuid DEFAULT NULL::uuid", returns: "void", security: "definer" },
|
|
214
502
|
{ name: "agg_assert_key", args: "p_key text", returns: "text", security: "invoker" },
|
|
215
503
|
{ name: "agg_buckets", args: "", returns: "text[]", security: "invoker" },
|
|
216
|
-
{ name: "
|
|
504
|
+
{ name: "agg_cadence_normalize", args: "p_cadence text", returns: "text", security: "invoker" },
|
|
505
|
+
{ 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, p_dedupe_suffix text DEFAULT NULL::text", returns: "uuid", security: "invoker" },
|
|
506
|
+
{ name: "agg_deliver_quietly", args: "p_organization_id uuid, p_rule_id uuid, p_subject_id uuid, p_channel text, p_recipient_user_id uuid, p_event_key text, p_subject text, p_body text, p_payload jsonb, p_quiet_hours jsonb, p_link text, p_dedupe_suffix text DEFAULT NULL::text", returns: "uuid", security: "invoker" },
|
|
507
|
+
{ name: "agg_digest_assemble", args: "p_organization_id uuid, p_rule_id uuid, p_since timestamp with time zone DEFAULT NULL::timestamp with time zone, p_until timestamp with time zone DEFAULT NULL::timestamp with time zone", returns: "jsonb", security: "invoker" },
|
|
508
|
+
{ name: "agg_digest_due_at", args: "p_cadence text, p_schedule text, p_quiet jsonb, p_after timestamp with time zone", returns: "timestamp with time zone", security: "invoker" },
|
|
217
509
|
{ name: "agg_digest_run", args: "p_organization_id uuid, p_rule_id uuid DEFAULT NULL::uuid, p_since timestamp with time zone DEFAULT NULL::timestamp with time zone", returns: "integer", security: "invoker" },
|
|
510
|
+
{ name: "agg_digest_tick", args: "", returns: "integer", security: "invoker" },
|
|
218
511
|
{ name: "agg_explain", 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_required text DEFAULT 'viewer'::text", returns: "jsonb", security: "definer" },
|
|
512
|
+
{ name: "agg_last_digest_at", args: "p_organization_id uuid, p_rule_id uuid", returns: "timestamp with time zone", security: "invoker" },
|
|
219
513
|
{ name: "agg_operations", args: "", returns: "text[]", security: "invoker" },
|
|
514
|
+
{ name: "agg_quiet_until", args: "p_quiet jsonb, p_at timestamp with time zone", returns: "timestamp with time zone", security: "invoker" },
|
|
515
|
+
{ name: "agg_record_name", args: "p_organization_id uuid, p_record_id uuid, p_state jsonb DEFAULT NULL::jsonb", returns: "text", security: "invoker" },
|
|
220
516
|
{ name: "agg_sql", 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: "text", security: "invoker" },
|
|
221
517
|
{ name: "agg_subscription_cadences", args: "", returns: "text[]", security: "invoker" },
|
|
222
518
|
{ name: "agg_subscription_fire", args: "p_organization_id uuid, p_record_id uuid, p_table_id uuid DEFAULT NULL::uuid, p_changed_field_ids jsonb DEFAULT '[]'::jsonb", returns: "integer", security: "invoker" },
|
|
223
|
-
{ name: "
|
|
519
|
+
{ name: "agg_subscription_fire_entered", args: "p_organization_id uuid, p_record_id uuid, p_table_id uuid DEFAULT NULL::uuid, p_since timestamp with time zone DEFAULT NULL::timestamp with time zone", returns: "integer", security: "invoker" },
|
|
520
|
+
{ name: "agg_subscription_tick", args: "p_window interval DEFAULT '00:15:00'::interval", returns: "integer", security: "invoker" },
|
|
521
|
+
{ name: "agg_subscriptions", args: "p_organization_id uuid, p_saved_view_id uuid DEFAULT NULL::uuid, p_cadence text DEFAULT NULL::text", returns: "TABLE(rule_id uuid, saved_view_id uuid, table_id uuid, cadence text, schedule text, quiet_hours jsonb, channel text, recipient_user_id uuid, event_key text, name text)", security: "invoker" },
|
|
224
522
|
{ name: "agg_value_sql", args: "p_key text", returns: "text", security: "invoker" },
|
|
225
523
|
{ name: "agg_view_admits", args: "p_organization_id uuid, p_saved_view_id uuid, p_record_id uuid", returns: "boolean", security: "invoker" },
|
|
524
|
+
{ name: "agg_view_admits_state", args: "p_definition jsonb, p_state jsonb", returns: "boolean", security: "invoker" },
|
|
226
525
|
{ name: "anon_capture", args: "p_organization_id uuid, p_client_key text, p_table_id uuid, p_payload jsonb, p_device text DEFAULT NULL::text, p_captured_at timestamp with time zone DEFAULT NULL::timestamp with time zone", returns: "uuid", security: "definer" },
|
|
227
526
|
{ name: "anon_clear", args: "p_organization_id uuid, p_submission_id uuid", returns: "uuid", security: "definer" },
|
|
228
527
|
{ 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" },
|
|
@@ -243,9 +542,23 @@ var STORE_DOORS = [
|
|
|
243
542
|
{ name: "assert_organization_admin", args: "p_organization_id uuid, p_door text, p_what text", returns: "void", security: "invoker" },
|
|
244
543
|
{ name: "assert_organization_wall", args: "p_kind text, p_organization_id uuid, p_row jsonb", returns: "void", security: "invoker" },
|
|
245
544
|
{ name: "assert_store_door", args: "p_organization_id uuid, p_door text", returns: "void", security: "invoker" },
|
|
545
|
+
{ name: "booking_cancel", args: "p_booking_ref text, p_origin text DEFAULT NULL::text", returns: "TABLE(booking_ref text, record_id uuid, slot_key text, state text, message text)", security: "definer" },
|
|
546
|
+
{ name: "booking_confirm", args: "p_form_id uuid, p_hold_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(booking_ref text, record_id uuid, submission_id uuid, slot_key text, slot_at timestamp with time zone, state text, message text)", security: "definer" },
|
|
547
|
+
{ name: "booking_declare", args: "p_organization_id uuid, p_table_id uuid, p_title text, p_questions jsonb, p_availability jsonb DEFAULT '{}'::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, p_home_id uuid DEFAULT NULL::uuid", returns: "jsonb", security: "definer" },
|
|
548
|
+
{ name: "booking_hold", args: "p_form_id uuid, p_slot_key text, p_origin text, p_bucket text, p_client_key text DEFAULT NULL::text", returns: "TABLE(hold_id uuid, slot_key text, expires_at timestamp with time zone, member_user_id uuid, state text, message text)", security: "definer" },
|
|
549
|
+
{ name: "booking_manage", args: "p_booking_ref text, p_days integer DEFAULT NULL::integer", returns: "TABLE(booking_ref text, form_id uuid, title text, slot_key text, slot_at timestamp with time zone, status text, slots jsonb, availability jsonb, state text, message text)", security: "definer" },
|
|
550
|
+
{ name: "booking_notify", args: "p_organization_id uuid, p_form_id uuid, p_record_id uuid, p_submission_id uuid, p_event text, p_when text", returns: "uuid", security: "invoker" },
|
|
551
|
+
{ name: "booking_public", args: "p_form_id uuid, p_days integer DEFAULT NULL::integer", returns: "TABLE(form_id uuid, organization_id uuid, table_id uuid, title text, presentation jsonb, fields jsonb, honeypot_key text, availability jsonb, slots jsonb, state text, message text)", security: "definer" },
|
|
552
|
+
{ name: "booking_reschedule", args: "p_booking_ref text, p_slot_key text, p_origin text, p_bucket text DEFAULT NULL::text", returns: "TABLE(booking_ref text, record_id uuid, slot_key text, slot_at timestamp with time zone, state text, message text)", security: "definer" },
|
|
553
|
+
{ name: "bookings", 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, slot_minutes integer, timezone text, slot_table_id uuid, booked bigint, cancelled bigint, upcoming bigint, held bigint, next_at timestamp with time zone, state text)", security: "definer" },
|
|
246
554
|
{ name: "bump_epoch", args: "p_entity_type text, p_entity_id uuid, p_organization_id uuid DEFAULT NULL::uuid", returns: "bigint", security: "definer" },
|
|
247
555
|
{ 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" },
|
|
248
556
|
{ name: "caller_role", args: "", returns: "name", security: "invoker" },
|
|
557
|
+
{ name: "capture_open", args: "p_organization_id uuid, p_sheet_id uuid", returns: "TABLE(sheet_id uuid, organization_id uuid, table_id uuid, title text, presentation jsonb, fields jsonb, state text, may_capture boolean, message text)", security: "definer" },
|
|
558
|
+
{ name: "capture_publish", args: "p_organization_id uuid, p_sheet_id uuid, p_open boolean DEFAULT true", returns: "timestamp with time zone", security: "definer" },
|
|
559
|
+
{ name: "capture_sheet_declare", args: "p_organization_id uuid, p_table_id uuid, p_title text, p_questions jsonb, p_presentation jsonb DEFAULT '{}'::jsonb, p_sheet_id uuid DEFAULT NULL::uuid, p_notify_rule_id uuid DEFAULT NULL::uuid", returns: "uuid", security: "definer" },
|
|
560
|
+
{ name: "capture_sheets", args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid", returns: "TABLE(sheet_id uuid, table_id uuid, title text, slug text, state text, opened_at timestamp with time zone, captures bigint, replays bigint, last_capture_at timestamp with time zone, presentation jsonb)", security: "definer" },
|
|
561
|
+
{ name: "capture_submit", args: "p_organization_id uuid, p_sheet_id uuid, p_client_key text, p_payload jsonb, p_files jsonb DEFAULT '[]'::jsonb, p_device text DEFAULT NULL::text, p_captured_at timestamp with time zone DEFAULT NULL::timestamp with time zone, p_location jsonb DEFAULT NULL::jsonb", returns: "TABLE(record_id uuid, state text, message text, replay boolean, file_ids uuid[])", security: "definer" },
|
|
249
562
|
{ name: "carry_unchanged_value_stamps", args: "p_old jsonb, p_new jsonb", returns: "jsonb", security: "invoker" },
|
|
250
563
|
{ 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" },
|
|
251
564
|
{ 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" },
|
|
@@ -356,6 +669,7 @@ var STORE_DOORS = [
|
|
|
356
669
|
{ 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" },
|
|
357
670
|
{ 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" },
|
|
358
671
|
{ name: "entity_value_write", args: "p_organization_id uuid, p_token text, p_record_id uuid, p_patch jsonb", returns: "jsonb", security: "invoker" },
|
|
672
|
+
{ name: "export_ceiling", args: "p_organization_id uuid DEFAULT NULL::uuid", returns: "integer", security: "definer" },
|
|
359
673
|
{ 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" },
|
|
360
674
|
{ name: "external_foreign_table_findings", args: "", returns: "SETOF text", security: "definer" },
|
|
361
675
|
{ name: "external_history_event", args: "p_organization_id uuid, p_link_id uuid, p_operation text", returns: "bigint", security: "definer" },
|
|
@@ -383,6 +697,7 @@ var STORE_DOORS = [
|
|
|
383
697
|
{ 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" },
|
|
384
698
|
{ 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" },
|
|
385
699
|
{ 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" },
|
|
700
|
+
{ name: "freshness_verdict", args: "p_written_at timestamp with time zone, p_ceiling_seconds numeric", returns: "jsonb", security: "definer" },
|
|
386
701
|
{ name: "guard_refusals_are_complete", args: "", returns: "TABLE(guard text, said text)", security: "invoker" },
|
|
387
702
|
{ 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" },
|
|
388
703
|
{ 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" },
|
|
@@ -472,12 +787,20 @@ var STORE_DOORS = [
|
|
|
472
787
|
{ 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" },
|
|
473
788
|
{ name: "owning_table", args: "p_organization_id uuid, p_record_id uuid", returns: "uuid", security: "invoker" },
|
|
474
789
|
{ name: "owning_table_gone", args: "p_organization_id uuid, p_record_id uuid", returns: "boolean", security: "invoker" },
|
|
790
|
+
{ name: "page_ceiling", args: "p_organization_id uuid DEFAULT NULL::uuid", returns: "integer", security: "definer" },
|
|
791
|
+
{ name: "page_contract", args: "p_organization_id uuid", returns: "jsonb", security: "definer" },
|
|
792
|
+
{ name: "page_size", args: "p_organization_id uuid, p_door text, p_limit integer, p_default integer DEFAULT NULL::integer, p_ceiling integer DEFAULT NULL::integer", returns: "integer", security: "definer" },
|
|
475
793
|
{ name: "parity_field_types", args: "", returns: "TABLE(parity_type text, behavior text, made_of text)", security: "invoker" },
|
|
476
794
|
{ name: "parity_type", args: "p_field_data jsonb", returns: "text", security: "invoker" },
|
|
477
795
|
{ 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" },
|
|
478
796
|
{ name: "per_value_access_words", args: "", returns: "text[]", security: "invoker" },
|
|
479
797
|
{ name: "person_kernel_id", args: "", returns: "uuid", security: "invoker" },
|
|
480
798
|
{ name: "pin_agent_cells", args: "p_new jsonb, p_old jsonb, p_agent_keys text[]", returns: "jsonb", security: "invoker" },
|
|
799
|
+
{ name: "pipeline_board", args: "p_organization_id uuid, p_table_id uuid, p_measure text DEFAULT NULL::text", returns: "TABLE(stage_key text, stage_label text, stage_position integer, cards bigint, total numeric, wip_limit integer, over_limit boolean)", security: "definer" },
|
|
800
|
+
{ name: "pipeline_declare", args: "p_organization_id uuid, p_table_id uuid, p_spec jsonb", returns: "jsonb", security: "definer" },
|
|
801
|
+
{ name: "pipeline_move", args: "p_organization_id uuid, p_record_id uuid, p_to text, p_also jsonb DEFAULT '{}'::jsonb, p_expected_version integer DEFAULT NULL::integer", returns: "jsonb", security: "definer" },
|
|
802
|
+
{ name: "pipeline_read", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "definer" },
|
|
803
|
+
{ name: "pipeline_transition_refusal", args: "p_organization_id uuid, p_record_id uuid, p_to text", returns: "jsonb", security: "definer" },
|
|
481
804
|
{ name: "portal_admits", args: "p_organization_id uuid, p_user_id uuid DEFAULT NULL::uuid", returns: "boolean", security: "definer" },
|
|
482
805
|
{ name: "portal_card", args: "p_organization_id uuid, p_portal_id uuid", returns: "jsonb", security: "definer" },
|
|
483
806
|
{ 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" },
|
|
@@ -505,6 +828,9 @@ var STORE_DOORS = [
|
|
|
505
828
|
{ name: "promoted_read", args: "p_organization_id uuid, p_table_id uuid, p_field_key text, p_value text", returns: "SETOF uuid", security: "invoker" },
|
|
506
829
|
{ name: "promoted_value_path", args: "p_field_data jsonb", returns: "text", security: "invoker" },
|
|
507
830
|
{ name: "promotion_inline_ceiling", args: "", returns: "integer", security: "invoker" },
|
|
831
|
+
{ name: "provenance_prune", args: "p_organization_id uuid DEFAULT NULL::uuid, p_dry_run boolean DEFAULT true, p_limit integer DEFAULT 200000", returns: "jsonb", security: "definer" },
|
|
832
|
+
{ name: "provenance_retention_days", args: "p_organization_id uuid", returns: "integer", security: "definer" },
|
|
833
|
+
{ name: "provenance_write", args: "p_organization_id uuid, p_conversation_id uuid, p_turn_id text, p_rows jsonb", returns: "integer", security: "definer" },
|
|
508
834
|
{ name: "query_access_ids", args: "p_organization_id uuid, p_required text DEFAULT 'viewer'::text", returns: "uuid[]", security: "invoker" },
|
|
509
835
|
{ name: "query_across_homes", args: "p_organization_id uuid, p_table_id uuid, p_limit integer DEFAULT 50, p_offset integer DEFAULT 0, p_required text DEFAULT 'viewer'::text", returns: "TABLE(record_id uuid, home_record_id uuid, data jsonb, created_at timestamp with time zone)", security: "definer" },
|
|
510
836
|
{ name: "query_by_coordinates", args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid, p_coordinates jsonb DEFAULT '[]'::jsonb, p_limit integer DEFAULT 50, p_offset integer DEFAULT 0, p_required text DEFAULT 'viewer'::text", returns: "TABLE(record_id uuid, table_id uuid, data jsonb, coordinates_matched integer)", security: "definer" },
|
|
@@ -605,6 +931,7 @@ var STORE_DOORS = [
|
|
|
605
931
|
{ name: "sign_requests", args: "p_organization_id uuid, p_record_id uuid", returns: "TABLE(request_id uuid, render_id uuid, record_id uuid, field_key text, document_title text, signer_name text, signer_email text, signer_has_account boolean, state text, sentence text, document_version integer, document_hash text, sent_at timestamp with time zone, expires_at timestamp with time zone, viewed_at timestamp with time zone, signed_at timestamp with time zone, declined_at timestamp with time zone, invalidated_at timestamp with time zone, signature_id uuid, signature_mark text, reminder_count integer)", security: "definer" },
|
|
606
932
|
{ name: "sign_token_decode", args: "p_token text", returns: "bytea", security: "invoker" },
|
|
607
933
|
{ name: "sign_token_encode", args: "p_bytes bytea", returns: "text", security: "invoker" },
|
|
934
|
+
{ name: "silent_page_doors", args: "", returns: "TABLE(door text, why text)", security: "definer" },
|
|
608
935
|
{ name: "size_refusal", args: "p_organization_id uuid, p_data jsonb", returns: "text", security: "invoker" },
|
|
609
936
|
{ name: "source_next_pointer", args: "p_sources jsonb", returns: "text", security: "invoker" },
|
|
610
937
|
{ name: "source_pointer", args: "p_sources jsonb, p_source jsonb", returns: "text", security: "invoker" },
|
|
@@ -612,8 +939,10 @@ var STORE_DOORS = [
|
|
|
612
939
|
{ name: "storage_modes", args: "", returns: "text[]", security: "invoker" },
|
|
613
940
|
{ name: "store_is_open", args: "p_organization_id uuid DEFAULT NULL::uuid", returns: "boolean", security: "invoker" },
|
|
614
941
|
{ name: "subscription_cadences", args: "p_organization_id uuid", returns: "text[]", security: "definer" },
|
|
942
|
+
{ name: "subscription_declare", args: "p_organization_id uuid, p_table_id uuid, p_spec jsonb", returns: "uuid", security: "definer" },
|
|
615
943
|
{ name: "subscription_mute", args: "p_organization_id uuid, p_rule_id uuid, p_muted boolean DEFAULT true", returns: "boolean", security: "definer" },
|
|
616
|
-
{ name: "
|
|
944
|
+
{ name: "subscription_preview", args: "p_organization_id uuid, p_rule_id uuid", returns: "jsonb", security: "definer" },
|
|
945
|
+
{ 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, quiet_hours jsonb, channel text, recipient_user_id uuid, event_key text, muted boolean, mine boolean, i_may_mute boolean, last_sent_at timestamp with time zone, next_digest_at timestamp with time zone)", security: "definer" },
|
|
617
946
|
{ name: "table_capacity", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "definer" },
|
|
618
947
|
{ 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" },
|
|
619
948
|
{ name: "table_contents", args: "p_organization_id uuid, p_table_id uuid", returns: "TABLE(record_id uuid, kind text, goes_at integer)", security: "invoker" },
|
|
@@ -624,6 +953,7 @@ var STORE_DOORS = [
|
|
|
624
953
|
{ name: "table_record_ceiling", args: "", returns: "integer", security: "invoker" },
|
|
625
954
|
{ name: "table_record_ceiling", args: "p_organization_id uuid", returns: "integer", security: "invoker" },
|
|
626
955
|
{ 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" },
|
|
956
|
+
{ name: "table_stage_field", args: "p_organization_id uuid, p_table_id uuid", returns: "text", security: "definer" },
|
|
627
957
|
{ name: "table_storage", args: "p_organization_id uuid, p_table_id uuid", returns: "text", security: "invoker" },
|
|
628
958
|
{ name: "table_type_field", args: "p_organization_id uuid, p_table_id uuid", returns: "text", security: "definer" },
|
|
629
959
|
{ 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" },
|
|
@@ -711,12 +1041,15 @@ var STORE_KNOBS = [
|
|
|
711
1041
|
{ key: "enrichment_sensitivity_ceiling", value: '"internal"', type: "string" },
|
|
712
1042
|
{ key: "entity_custom_fields_guard", value: "false", type: "boolean" },
|
|
713
1043
|
{ key: "entity_types_guard", value: "false", type: "boolean" },
|
|
1044
|
+
{ key: "export_rows_ceiling", value: "100000", type: "integer" },
|
|
714
1045
|
{ key: "external_principal_enabled", value: "false", type: "boolean" },
|
|
715
1046
|
{ key: "field_index_guard", value: "false", type: "boolean" },
|
|
716
1047
|
{ 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" },
|
|
717
1048
|
{ key: "inbound_domain", value: '"inbound.matrxserver.com"', type: "string" },
|
|
718
1049
|
{ key: "member_default_level", value: '"viewer"', type: "enum" },
|
|
719
1050
|
{ key: "member_default_visibility", value: '"all_records"', type: "enum" },
|
|
1051
|
+
{ key: "page_size_ceiling", value: "1000", type: "integer" },
|
|
1052
|
+
{ key: "provenance_retention_days", value: "30", type: "number" },
|
|
720
1053
|
{ key: "records_tool_default", value: "true", type: "boolean" },
|
|
721
1054
|
{ key: "row_versions_guard", value: "false", type: "boolean" },
|
|
722
1055
|
{ key: "sandbox_expanded_frame_height_px", value: "20000", type: "integer" },
|
|
@@ -733,15 +1066,15 @@ var STORE_REFUSAL_CODES = [
|
|
|
733
1066
|
{ code: "02000", raised_by: "_checklist_instantiate,checklist_declare,checklist_run,checklist_step_complete,checklist_step_refusal,checklist_template_shape,conversation_scope_bind,dashboard_delete,dashboard_run,doc_letterhead,doc_render_body,doc_render_document,doc_render_read,doc_sign,doc_signature_intact,doc_signature_read,doc_template_delete,doc_template_read,doc_template_save,enrich_pin,entity_field_retire,entity_field_update,entity_record_read,entity_value_write,external_history_event,external_rows,external_stub_upsert,external_writes_set,io_restore,migrate_delete,migrate_extract_parent,migrate_merge,migrate_reclass,migrate_rename,migrate_reparent,migrate_retype,migrate_split,migrate_undo,organization_clear,portal_card,portal_declare,portal_invite,portal_preview,portal_principal_bind,portal_revoke,read_record,record_delete,record_restore,record_restore_preview,record_table,record_update,relation_uncarry,share_access,share_grant,share_lane_set,share_people,share_revoke,sign_request_cancel,sign_request_create,sign_request_remind,sign_request_unchanged,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_assign,work_record_states,work_set_state" },
|
|
734
1067
|
{ code: "0A000", raised_by: "checklist_step_complete,external_rows,external_source_declare,external_write_through,promote_field,promoted_index_expr,promoted_query_sql,promoted_read,rule_eval,work_assign" },
|
|
735
1068
|
{ code: "22003", raised_by: "context_resolve" },
|
|
736
|
-
{ code: "22004", raised_by: "_entity_custom_fields_guard,_value_envelope,actor_word,agg_assert_key,agg_sql,anon_capture,anon_token_issue,anon_write,assert_client_may_reach,checklist_declare,context_resolve,dashboard_block_normalize,dashboard_declare,dashboard_window_sql,doc_render_write,doc_sign,doc_signature_write,doc_template_save,enrich_land,enrich_normalize,external_history_event,external_rows,external_source_declare,external_stub_upsert,external_write_through,external_writes_set,field_history,form_declare,form_submit,home_add,io_comment_write,io_import_begin,io_infer_column,io_outbox_drain,io_restore,migrate_choice_keys,migrate_purge,migrate_reclass,migrate_split,migrate_undo,organization_clear,organization_contents,portal_declare,portal_invite,portal_principal_bind,query_across_homes,query_by_coordinates,query_rollup,record_delete,record_reparent,record_resolve,record_restore,record_update,record_write,relation_carry,relation_own,rule_declare,share_grant,sign_request_create,sign_request_sign,table_declare,value_restore,work_approval_decide,work_approval_request,work_template_declare" },
|
|
1069
|
+
{ 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,booking_declare,capture_submit,checklist_declare,context_resolve,dashboard_block_normalize,dashboard_declare,dashboard_window_sql,doc_render_write,doc_sign,doc_signature_write,doc_template_save,enrich_land,enrich_normalize,external_history_event,external_rows,external_source_declare,external_stub_upsert,external_write_through,external_writes_set,field_history,form_declare,form_submit,home_add,io_comment_write,io_import_begin,io_infer_column,io_outbox_drain,io_restore,migrate_choice_keys,migrate_purge,migrate_reclass,migrate_split,migrate_undo,organization_clear,organization_contents,pipeline_declare,portal_declare,portal_invite,portal_principal_bind,provenance_retention_days,provenance_write,query_across_homes,query_by_coordinates,query_rollup,record_delete,record_reparent,record_resolve,record_restore,record_update,record_write,relation_carry,relation_own,rule_declare,share_grant,sign_request_create,sign_request_sign,subscription_declare,table_declare,value_restore,work_approval_decide,work_approval_request,work_template_declare" },
|
|
737
1070
|
{ code: "22007", raised_by: "dashboard_window_sql" },
|
|
738
1071
|
{ code: "22012", raised_by: "rule_eval" },
|
|
739
|
-
{ code: "22023", raised_by: "_entity_custom_fields_guard,_value_envelope,_work_shape_guard,actor_word,agg_assert_key,agg_sql,anon_token_issue,containment_parent,dashboard_block_normalize,dashboard_window_sql,doc_render_body,doc_render_write,doc_signature_write,enrich_declare,enrich_land,enrich_normalize,enrich_pin,entity_value_write,external_history_event,external_source_declare,external_stub_upsert,external_write_through,field_history,io_import_begin,io_import_finish,io_import_plan,io_import_report,io_proposal_accept,migrate_merge,migrate_reclass,my_levels,organization_clear,pin_agent_cells,portal_declare,query_by_coordinates,query_rollup,record_update,relation_carry,rule_eval,rule_members,share_grant,share_lane_set,sign_request_create,sign_request_sign,table_rules,visibility_as_of,work_approval_request,work_list,work_slot_hold" },
|
|
740
|
-
{ code: "23503", raised_by: "_checklist_instantiate,_containment_guard,_field_document_for,_record_rule_uses,anon_publish,anon_rate_take,anon_token_issue,anon_write,assert_organization_wall,checklist_declare,checklist_steps_table,comment_write,dashboard_declare,delete_rule,doc_sign,doc_template_save,enrich_declare,enrich_due,enrich_land,form_declare,form_submit,home_add,inbound_declare,inbound_mail_land,inbound_set,io_comment_write,io_import_begin,io_import_finish,io_import_report,io_import_rows,io_proposal_accept,migrate_demote,migrate_promote,promote_field,promote_table,record_applicability,record_reparent,relation_carry,relation_own,resolve_first_match,rule_applies,rule_declare,rule_eval,rule_members,rule_run,sign_request_create,subscription_mute,work_set_state,work_take_assignment,work_template_instantiate" },
|
|
1072
|
+
{ code: "22023", raised_by: "_booking_availability,_entity_custom_fields_guard,_value_envelope,_work_shape_guard,actor_word,agg_assert_key,agg_sql,anon_token_issue,booking_declare,containment_parent,dashboard_block_normalize,dashboard_window_sql,doc_render_body,doc_render_write,doc_signature_write,enrich_declare,enrich_land,enrich_normalize,enrich_pin,entity_value_write,external_history_event,external_source_declare,external_stub_upsert,external_write_through,field_history,io_import_begin,io_import_finish,io_import_plan,io_import_report,io_proposal_accept,migrate_merge,migrate_reclass,my_levels,organization_clear,page_size,pin_agent_cells,pipeline_move,portal_declare,provenance_write,query_by_coordinates,query_rollup,record_update,relation_carry,rule_eval,rule_members,share_grant,share_lane_set,sign_request_create,sign_request_sign,subscription_declare,table_rules,visibility_as_of,work_approval_request,work_list,work_slot_hold" },
|
|
1073
|
+
{ code: "23503", raised_by: "_booking_availability,_checklist_instantiate,_containment_guard,_field_document_for,_pipeline_stage_key,_record_rule_uses,agg_digest_assemble,anon_publish,anon_rate_take,anon_token_issue,anon_write,assert_organization_wall,booking_cancel,booking_confirm,booking_declare,booking_hold,booking_reschedule,capture_publish,checklist_declare,checklist_steps_table,comment_write,dashboard_declare,delete_rule,doc_sign,doc_template_save,enrich_declare,enrich_due,enrich_land,form_declare,form_submit,home_add,inbound_declare,inbound_mail_land,inbound_set,io_comment_write,io_import_begin,io_import_finish,io_import_report,io_import_rows,io_proposal_accept,migrate_demote,migrate_promote,pipeline_board,pipeline_declare,pipeline_move,pipeline_read,pipeline_transition_refusal,promote_field,promote_table,record_applicability,record_reparent,relation_carry,relation_own,resolve_first_match,rule_applies,rule_declare,rule_eval,rule_members,rule_run,sign_request_create,subscription_mute,subscription_preview,work_set_state,work_take_assignment,work_template_instantiate" },
|
|
741
1074
|
{ code: "23505", raised_by: "_unique_rule_holds,doc_sign,doc_signature_write,entity_field_declare,field_declare,home_add,inbound_declare,io_proposal_accept,relation_carry,relation_own,share_grant,sign_request_cancel,sign_request_create,work_approval_decide,work_slot_hold" },
|
|
742
|
-
{ code: "23514", raised_by: "_checklist_instantiate,_checklist_step_guard,_containment_guard,_dated_values_guard,_derived_fields,_entity_custom_fields_guard,_field_class_guard,_field_document_for,_field_shape_guard,_field_type_parity_guard,_merge_field_shape_guard,_merge_field_temporal_guard,_promoted_field_cap_guard,_record_rule_uses,_resolve_choice_words,_rule_shape_guard,_rule_topology_guard,_store_relation_edge_names_its_field,_table_shape_guard,_value_envelope,_work_shape_guard,_workdoors_approval_guard,assert_entity_is_organization_scoped,checklist_declare,checklist_step_complete,doc_sign,doc_signature_write,doc_template_save,entity_field_declare,entity_field_retire,entity_field_update,entity_records_find,entity_table,field_declare,field_retire,field_update,home_add,io_import_rows,migrate_merge,relation_carry,relation_own,sign_request_create,sign_request_sign,validate_value_envelope,validate_values,work_set_state,work_slots_declare,work_take_assignment,work_template_instantiate" },
|
|
1075
|
+
{ code: "23514", raised_by: "_checklist_instantiate,_checklist_step_guard,_containment_guard,_dated_values_guard,_derived_fields,_entity_custom_fields_guard,_field_class_guard,_field_document_for,_field_shape_guard,_field_type_parity_guard,_merge_field_shape_guard,_merge_field_temporal_guard,_promoted_field_cap_guard,_record_rule_uses,_resolve_choice_words,_rule_shape_guard,_rule_topology_guard,_store_relation_edge_names_its_field,_table_shape_guard,_value_envelope,_work_shape_guard,_workdoors_approval_guard,assert_entity_is_organization_scoped,capture_publish,capture_sheet_declare,checklist_declare,checklist_step_complete,doc_sign,doc_signature_write,doc_template_save,entity_field_declare,entity_field_retire,entity_field_update,entity_records_find,entity_table,field_declare,field_retire,field_update,home_add,io_import_rows,migrate_merge,relation_carry,relation_own,sign_request_create,sign_request_sign,validate_value_envelope,validate_values,work_set_state,work_slots_declare,work_take_assignment,work_template_instantiate" },
|
|
743
1076
|
{ code: "40001", raised_by: "has_visibility_at" },
|
|
744
|
-
{ code: "42501", raised_by: "_doc_render_immutable,_doc_signature_immutable,_field_definition_write,_field_write_door,_rule_definition_write,_store_door,anon_capture,anon_inbound_land,anon_publish,anon_token_issue,anon_token_verify,anon_write,assert_client_may_change,assert_client_may_open,assert_client_may_reach,assert_may_know_table,assert_organization_admin,assert_store_door,checklist_run,comment_write,conversation_scope_bind,conversation_scope_unbind,enrich_declare,enrich_due,enrich_land,enrich_normalize,entity_field_declare,entity_field_retire,entity_field_update,entity_value_write,external_write_through,form_declare,form_submit,inbound_mail_land,io_comment_resolve,io_comment_write,io_import_begin,io_import_finish,io_restore,migrate_purge,migrate_reclass,my_levels,organization_clear,portal_declare,portal_invitation,portal_invite,portal_principal_bind,promote_table,query_visibility_parity,read_record,read_records,record_table,share_grant,subscription_mute,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_person" },
|
|
1077
|
+
{ 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,booking_confirm,booking_declare,booking_hold,capture_submit,checklist_run,comment_write,conversation_scope_bind,conversation_scope_unbind,enrich_declare,enrich_due,enrich_land,enrich_normalize,entity_field_declare,entity_field_retire,entity_field_update,entity_value_write,external_write_through,form_declare,form_submit,inbound_mail_land,io_comment_resolve,io_comment_write,io_import_begin,io_import_finish,io_restore,migrate_purge,migrate_reclass,my_levels,organization_clear,portal_declare,portal_invitation,portal_invite,portal_principal_bind,promote_table,query_visibility_parity,read_record,read_records,record_table,share_grant,subscription_mute,subscription_preview,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_person" },
|
|
745
1078
|
{ code: "42703", raised_by: "entity_table,portal_declare" },
|
|
746
1079
|
{ code: "53400", raised_by: "anon_rate_take,delete_cascade_closure,enrich_due,enrich_land,promote_field" },
|
|
747
1080
|
{ code: "54001", raised_by: "record_delete" },
|
|
@@ -1358,6 +1691,7 @@ var ENTITY_TOKENS = [
|
|
|
1358
1691
|
"notification_event_override",
|
|
1359
1692
|
"notification_event_type",
|
|
1360
1693
|
"notification_preference",
|
|
1694
|
+
"notification_submission",
|
|
1361
1695
|
"notify_outsider_door_baseline",
|
|
1362
1696
|
"oauth_handoff_claim",
|
|
1363
1697
|
"opinion_clusters",
|
|
@@ -1908,6 +2242,12 @@ var DOORS = {
|
|
|
1908
2242
|
tableKernelId: "table_kernel_id",
|
|
1909
2243
|
// A saved view references its membership Rule, and the STORE decides who is
|
|
1910
2244
|
// in it — the screen never re-implements the predicate.
|
|
2245
|
+
pipelineDeclare: "pipeline_declare",
|
|
2246
|
+
pipelineRead: "pipeline_read",
|
|
2247
|
+
pipelineBoard: "pipeline_board",
|
|
2248
|
+
pipelineTransitionRefusal: "pipeline_transition_refusal",
|
|
2249
|
+
pipelineMove: "pipeline_move",
|
|
2250
|
+
tableStageField: "table_stage_field",
|
|
1911
2251
|
ruleMembers: "rule_members",
|
|
1912
2252
|
ruleMembership: "rule_membership",
|
|
1913
2253
|
ruleRun: "rule_run",
|
|
@@ -1982,6 +2322,16 @@ var DOORS = {
|
|
|
1982
2322
|
// this product that decides whether anybody ever trusts it: the moment a
|
|
1983
2323
|
// person types over an agent-owned cell the store pins it, and the next run
|
|
1984
2324
|
// leaves it exactly as they left it.
|
|
2325
|
+
// PRODUCTS row 15 — "let my crew photograph each bin and log the weight on
|
|
2326
|
+
// site". A capture sheet is the ONE Form object saying `audience = 'crew'`,
|
|
2327
|
+
// opened by `capture_opened_at`; these five are SIGNED-IN doors granted to
|
|
2328
|
+
// `authenticated`, unlike the public form's two, because a crew member has an
|
|
2329
|
+
// account and their own level on the Table is the whole access decision.
|
|
2330
|
+
captureSheetDeclare: "capture_sheet_declare",
|
|
2331
|
+
capturePublish: "capture_publish",
|
|
2332
|
+
captureSheets: "capture_sheets",
|
|
2333
|
+
captureOpen: "capture_open",
|
|
2334
|
+
captureSubmit: "capture_submit",
|
|
1985
2335
|
enrichments: "enrichments",
|
|
1986
2336
|
enrichDeclare: "enrich_declare",
|
|
1987
2337
|
enrichDue: "enrich_due",
|
|
@@ -2040,6 +2390,11 @@ var DOORS = {
|
|
|
2040
2390
|
// these rows, so "tell me when a patient arrives" can also be un-told.
|
|
2041
2391
|
subscriptions: "subscriptions",
|
|
2042
2392
|
subscriptionMute: "subscription_mute",
|
|
2393
|
+
// The two DOOR-18 acts that had no door at all until 2026-09-20: WRITE a
|
|
2394
|
+
// subscription (a Rule is declared, never written as a record — REC-72) and SEE
|
|
2395
|
+
// the summary it would send right now without sending it.
|
|
2396
|
+
subscriptionDeclare: "subscription_declare",
|
|
2397
|
+
subscriptionPreview: "subscription_preview",
|
|
2043
2398
|
// The cadence CATALOGUE a person's screen may ask for. `agg_subscription_cadences`
|
|
2044
2399
|
// above is the notifier's own and holds no client grant; this door delegates to
|
|
2045
2400
|
// it, so a picker and the digest runner can never offer different words.
|
|
@@ -2692,6 +3047,54 @@ function createRecordsClient(config) {
|
|
|
2692
3047
|
async ruleKernelId() {
|
|
2693
3048
|
return callDoor(DOORS.ruleKernelId, {}, "ruleKernelId");
|
|
2694
3049
|
},
|
|
3050
|
+
async pipelineRead({ table_id }) {
|
|
3051
|
+
return callDoor(
|
|
3052
|
+
DOORS.pipelineRead,
|
|
3053
|
+
{ p_organization_id: org, p_table_id: table_id },
|
|
3054
|
+
"pipelineRead"
|
|
3055
|
+
);
|
|
3056
|
+
},
|
|
3057
|
+
async pipelineBoard({ table_id, measure }) {
|
|
3058
|
+
return callDoor(
|
|
3059
|
+
DOORS.pipelineBoard,
|
|
3060
|
+
{ p_organization_id: org, p_table_id: table_id, p_measure: measure ?? null },
|
|
3061
|
+
"pipelineBoard"
|
|
3062
|
+
);
|
|
3063
|
+
},
|
|
3064
|
+
async pipelineTransitionRefusal({ record_id, to }) {
|
|
3065
|
+
return callDoor(
|
|
3066
|
+
DOORS.pipelineTransitionRefusal,
|
|
3067
|
+
{ p_organization_id: org, p_record_id: record_id, p_to: to },
|
|
3068
|
+
"pipelineTransitionRefusal"
|
|
3069
|
+
);
|
|
3070
|
+
},
|
|
3071
|
+
async pipelineMove({ record_id, to, also, expected_version }) {
|
|
3072
|
+
return callDoor(
|
|
3073
|
+
DOORS.pipelineMove,
|
|
3074
|
+
{
|
|
3075
|
+
p_organization_id: org,
|
|
3076
|
+
p_record_id: record_id,
|
|
3077
|
+
p_to: to,
|
|
3078
|
+
p_also: also ?? {},
|
|
3079
|
+
p_expected_version: expected_version ?? null
|
|
3080
|
+
},
|
|
3081
|
+
"pipelineMove"
|
|
3082
|
+
);
|
|
3083
|
+
},
|
|
3084
|
+
async pipelineDeclare({ table_id, spec }) {
|
|
3085
|
+
return callDoor(
|
|
3086
|
+
DOORS.pipelineDeclare,
|
|
3087
|
+
{ p_organization_id: org, p_table_id: table_id, p_spec: spec },
|
|
3088
|
+
"pipelineDeclare"
|
|
3089
|
+
);
|
|
3090
|
+
},
|
|
3091
|
+
async tableStageField({ table_id }) {
|
|
3092
|
+
return callDoor(
|
|
3093
|
+
DOORS.tableStageField,
|
|
3094
|
+
{ p_organization_id: org, p_table_id: table_id },
|
|
3095
|
+
"tableStageField"
|
|
3096
|
+
);
|
|
3097
|
+
},
|
|
2695
3098
|
async ruleMembers({ rule_id }) {
|
|
2696
3099
|
return callDoor(
|
|
2697
3100
|
DOORS.ruleMembers,
|
|
@@ -2906,6 +3309,64 @@ function createRecordsClient(config) {
|
|
|
2906
3309
|
"ruleEval"
|
|
2907
3310
|
);
|
|
2908
3311
|
},
|
|
3312
|
+
async captureSheetDeclare(args) {
|
|
3313
|
+
return callDoor(
|
|
3314
|
+
DOORS.captureSheetDeclare,
|
|
3315
|
+
{
|
|
3316
|
+
p_organization_id: org,
|
|
3317
|
+
p_table_id: args.table_id,
|
|
3318
|
+
p_title: args.title,
|
|
3319
|
+
p_questions: args.questions,
|
|
3320
|
+
p_presentation: args.presentation ?? {},
|
|
3321
|
+
p_sheet_id: args.sheet_id ?? null,
|
|
3322
|
+
p_notify_rule_id: args.notify_rule_id ?? null
|
|
3323
|
+
},
|
|
3324
|
+
"captureSheetDeclare"
|
|
3325
|
+
);
|
|
3326
|
+
},
|
|
3327
|
+
async capturePublish(args) {
|
|
3328
|
+
return callDoor(
|
|
3329
|
+
DOORS.capturePublish,
|
|
3330
|
+
{ p_organization_id: org, p_sheet_id: args.sheet_id, p_open: args.open ?? true },
|
|
3331
|
+
"capturePublish"
|
|
3332
|
+
);
|
|
3333
|
+
},
|
|
3334
|
+
async captureSheets(args) {
|
|
3335
|
+
return callDoor(
|
|
3336
|
+
DOORS.captureSheets,
|
|
3337
|
+
{ p_organization_id: org, p_table_id: args?.table_id ?? null },
|
|
3338
|
+
"captureSheets"
|
|
3339
|
+
);
|
|
3340
|
+
},
|
|
3341
|
+
async captureOpen(args) {
|
|
3342
|
+
const out = await callDoor(
|
|
3343
|
+
DOORS.captureOpen,
|
|
3344
|
+
{ p_organization_id: org, p_sheet_id: args.sheet_id },
|
|
3345
|
+
"captureOpen"
|
|
3346
|
+
);
|
|
3347
|
+
if (!out.ok) return out;
|
|
3348
|
+
const rows = Array.isArray(out.data) ? out.data : out.data ? [out.data] : [];
|
|
3349
|
+
return { ...out, data: rows[0] ?? null };
|
|
3350
|
+
},
|
|
3351
|
+
async captureSubmit(args) {
|
|
3352
|
+
const out = await callDoor(
|
|
3353
|
+
DOORS.captureSubmit,
|
|
3354
|
+
{
|
|
3355
|
+
p_organization_id: org,
|
|
3356
|
+
p_sheet_id: args.sheet_id,
|
|
3357
|
+
p_client_key: args.client_key,
|
|
3358
|
+
p_payload: args.answers ?? {},
|
|
3359
|
+
p_files: args.files ?? [],
|
|
3360
|
+
p_device: args.device ?? null,
|
|
3361
|
+
p_captured_at: args.captured_at ?? null,
|
|
3362
|
+
p_location: args.location ?? null
|
|
3363
|
+
},
|
|
3364
|
+
"captureSubmit"
|
|
3365
|
+
);
|
|
3366
|
+
if (!out.ok) return out;
|
|
3367
|
+
const rows = Array.isArray(out.data) ? out.data : out.data ? [out.data] : [];
|
|
3368
|
+
return { ...out, data: rows[0] ?? null };
|
|
3369
|
+
},
|
|
2909
3370
|
async enrichments(args) {
|
|
2910
3371
|
return callDoor(
|
|
2911
3372
|
DOORS.enrichments,
|
|
@@ -3065,6 +3526,20 @@ function createRecordsClient(config) {
|
|
|
3065
3526
|
"subscriptions"
|
|
3066
3527
|
);
|
|
3067
3528
|
},
|
|
3529
|
+
async subscriptionDeclare({ table_id, spec }) {
|
|
3530
|
+
return callDoor(
|
|
3531
|
+
DOORS.subscriptionDeclare,
|
|
3532
|
+
{ p_organization_id: org, p_table_id: table_id, p_spec: spec },
|
|
3533
|
+
"subscriptionDeclare"
|
|
3534
|
+
);
|
|
3535
|
+
},
|
|
3536
|
+
async subscriptionPreview({ rule_id }) {
|
|
3537
|
+
return callDoor(
|
|
3538
|
+
DOORS.subscriptionPreview,
|
|
3539
|
+
{ p_organization_id: org, p_rule_id: rule_id },
|
|
3540
|
+
"subscriptionPreview"
|
|
3541
|
+
);
|
|
3542
|
+
},
|
|
3068
3543
|
async subscriptionMute({ rule_id, muted }) {
|
|
3069
3544
|
return callDoor(
|
|
3070
3545
|
DOORS.subscriptionMute,
|
|
@@ -4349,6 +4824,8 @@ export {
|
|
|
4349
4824
|
PARITY_FIELD_TYPES,
|
|
4350
4825
|
PERMISSION_LEVELS,
|
|
4351
4826
|
PER_VALUE_ACCESS_WORDS,
|
|
4827
|
+
PIPELINE_RULE_KINDS,
|
|
4828
|
+
REFUSALS_WORTH_REPEATING,
|
|
4352
4829
|
RELATION_BINDINGS,
|
|
4353
4830
|
RELATION_CARDINALITIES,
|
|
4354
4831
|
RELATION_FLAVORS,
|
|
@@ -4382,13 +4859,19 @@ export {
|
|
|
4382
4859
|
holdsARetiredChoice,
|
|
4383
4860
|
importCsv,
|
|
4384
4861
|
importXlsx,
|
|
4862
|
+
indexedDbStore,
|
|
4385
4863
|
intersectIds,
|
|
4864
|
+
isDecided,
|
|
4386
4865
|
isRecordsErr,
|
|
4387
4866
|
isTheChosen,
|
|
4388
4867
|
looksLikeAnId,
|
|
4389
4868
|
mapPgError,
|
|
4869
|
+
mayDrag,
|
|
4390
4870
|
measureKey,
|
|
4871
|
+
memoryStore,
|
|
4872
|
+
mintClientKey,
|
|
4391
4873
|
ok,
|
|
4874
|
+
openCaptureQueue,
|
|
4392
4875
|
optionKey,
|
|
4393
4876
|
optionLabel,
|
|
4394
4877
|
parseCsv,
|