@ai-matrx/records 0.30.0 → 0.37.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 +108 -0
- package/dist/core/index.cjs +126 -7
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +100 -7
- package/dist/core/index.d.ts +100 -7
- package/dist/core/index.js +126 -7
- package/dist/core/index.js.map +1 -1
- package/dist/{field-D08d_e7R.d.cts → field-CWBdZfFv.d.cts} +218 -4
- package/dist/{field-D08d_e7R.d.ts → field-CWBdZfFv.d.ts} +218 -4
- package/dist/index.cjs +19 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +237 -141
- package/dist/index.d.ts +237 -141
- package/dist/index.js +19 -3
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +126 -7
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +539 -144
- package/dist/react/index.d.ts +539 -144
- package/dist/react/index.js +126 -7
- package/dist/react/index.js.map +1 -1
- package/dist/use-cases/index.cjs +17 -3
- package/dist/use-cases/index.cjs.map +1 -1
- package/dist/use-cases/index.d.cts +1 -1
- package/dist/use-cases/index.d.ts +1 -1
- package/dist/use-cases/index.js +17 -3
- package/dist/use-cases/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { U as Uuid, T as TableType, a as TableDisplay, S as StorageMode, g as Timestamp,
|
|
2
|
-
export { A as ABSENCE_REASONS,
|
|
1
|
+
import { U as Uuid, T as TableType, a as TableDisplay, S as StorageMode, g as Timestamp, av as TableOrigin, h as RecordDocument, m as StoredRecord, l as Field, a7 as ParityFieldType, al as RuleUse, ak as RuleNodeKind, R as RelationFlavor, O as OnDelete, ai as RelationBinding, f as RelationCardinality, a1 as MergeFieldSource, a0 as MergeFieldSemanticType, $ as MergeFieldModifier, a4 as OverridePolicy, B as Delivery, M as Freshness, x as Actor, P as PgError } from './field-CWBdZfFv.js';
|
|
2
|
+
export { A as ABSENCE_REASONS, v as ACTOR_VOCABULARY, w as AbsenceReason, y as COMPUTE_ON, z as CONTEXT_POLICIES, C as ComputeOn, e as ContextPolicy, D as DELIVERIES, E as ENTITY_TOKENS, G as EntityToken, H as FIELD_SENSITIVITIES, I as FIELD_SOURCES, J as FRESHNESS, K as FieldBehavior, n as FieldPatch, q as FieldProposal, c as FieldRule, d as FieldSensitivity, b as FieldSource, F as FieldTypeWord, L as ForbiddenEnvelopeWord, Q as HiddenFieldNotice, V as KERNEL_TABLES, X as KernelTableName, Y as MERGE_FIELD_MODIFIERS, Z as MERGE_FIELD_SEMANTIC_TYPES, _ as MERGE_FIELD_SOURCES, N as NewFieldDeclaration, a2 as ON_DELETE, a3 as OVERRIDE_POLICIES, a5 as PARITY_FIELD_TYPES, a6 as PER_VALUE_ACCESS_WORDS, a8 as ParityFieldTypeDescriptor, a9 as PerValueAccessWord, u as PredictedRefusal, aa as ProvenancePointer, ab as RELATION_BINDINGS, ac as RELATION_CARDINALITIES, ad as RELATION_FLAVORS, ae as RETIRED_ACTOR_WORDS, af as RULE_NODE_KINDS, ag as RULE_USES, k as ReadRow, p as ReadValue, j as RecordRead, o as RecordRevision, s as RecordsError, ah as RecordsErrorCode, i as RecordsResult, aj as RetiredActorWord, am as STORAGE_MODES, an as STORE_DOORS, ao as STORE_KNOBS, ap as STORE_REFUSAL_CODES, t as StaleWriteDetail, aq as StoreDoorName, ar as StoreRefusalCode, as as TABLE_DISPLAYS, at as TABLE_ORIGINS, au as TABLE_TYPES, r as TableProposal, aw as VALUE_ALTERNATE_KEYS, ax as VALUE_ENVELOPE_KEYS, ay as ValueAlternate, az as ValueAlternateKey, aA as ValueEnvelope, aB as ValueEnvelopeKey, aC as ValueSource, W as WriteConflict, aD as err, aE as isRecordsErr, aF as ok } from './field-CWBdZfFv.js';
|
|
3
3
|
|
|
4
4
|
/** `public.permission_level`, in the store's own order. */
|
|
5
5
|
type PermissionLevel = "viewer" | "commenter" | "editor" | "admin";
|
|
@@ -274,7 +274,25 @@ interface PipelineStage {
|
|
|
274
274
|
}
|
|
275
275
|
/** What each Rule of a pipeline is about. Closed, and the store is the authority. */
|
|
276
276
|
declare const PIPELINE_RULE_KINDS: readonly ["moves", "requires", "who", "limit", "entry"];
|
|
277
|
-
|
|
277
|
+
/**
|
|
278
|
+
* A GATE is the general form under `requires`, `who` and `limit`, and the store spells it
|
|
279
|
+
* `gate:1`, `gate:2` … so several gates can sit on one stage without one overwriting the
|
|
280
|
+
* next. It is matched as a prefix rather than listed, because the number is open.
|
|
281
|
+
*/
|
|
282
|
+
type PipelineRuleKind = (typeof PIPELINE_RULE_KINDS)[number] | `gate:${number}`;
|
|
283
|
+
/**
|
|
284
|
+
* WHAT A GATE DOES WHEN IT SAYS NO. The closed list `custom.stage_rule_on_fail_kinds()`
|
|
285
|
+
* answers — a screen offering a third answer would be offering something no Rule can carry.
|
|
286
|
+
*/
|
|
287
|
+
declare const STAGE_RULE_ON_FAIL: readonly ["refuse", "require_approval"];
|
|
288
|
+
type StageRuleOnFail = (typeof STAGE_RULE_ON_FAIL)[number];
|
|
289
|
+
/**
|
|
290
|
+
* THE ORGANIZATION'S ONE KNOB (`custom/stage_rule_enforcement`). `refuse` is the default and
|
|
291
|
+
* what a gate is for; `warn` lets the move through and hands the same sentence back. It never
|
|
292
|
+
* softens `require_approval` — "ask somebody" and "carry on with a note" are different answers.
|
|
293
|
+
*/
|
|
294
|
+
declare const STAGE_RULE_ENFORCEMENT: readonly ["refuse", "warn"];
|
|
295
|
+
type StageRuleEnforcement = (typeof STAGE_RULE_ENFORCEMENT)[number];
|
|
278
296
|
/**
|
|
279
297
|
* One transition Rule, as `custom.pipeline_read` hands it back — WITH the sentence it says
|
|
280
298
|
* when it refuses, because a screen that knows a rule exists but not what it refuses in
|
|
@@ -291,8 +309,64 @@ interface PipelineRule {
|
|
|
291
309
|
uses: string[];
|
|
292
310
|
/** What happens when a card ARRIVES in this stage — assign, notify, start a checklist. */
|
|
293
311
|
on_entry: Record<string, unknown> | null;
|
|
312
|
+
/**
|
|
313
|
+
* What this Rule does when it STOPS a move. `refuse` is the default and what every
|
|
314
|
+
* pipeline Rule did before gates existed; `require_approval` files the change in the
|
|
315
|
+
* approvals queue with this Rule's sentence as the reason and leaves the record alone.
|
|
316
|
+
*/
|
|
317
|
+
on_fail?: StageRuleOnFail;
|
|
318
|
+
/**
|
|
319
|
+
* THE GATE AS IT WAS WRITTEN, which is the only thing that makes it EDITABLE.
|
|
320
|
+
*
|
|
321
|
+
* A gate is saved as one Rule whose expression is an `or` of four arms — not this
|
|
322
|
+
* stage, OR not a move, OR the gate is not about this card, OR the demand holds. That
|
|
323
|
+
* compiled form used to be the only copy, so a settings screen could read a gate's name
|
|
324
|
+
* and its sentence and nothing else: it would open every existing rule with a blank
|
|
325
|
+
* condition and overwrite it the first time somebody pressed Save.
|
|
326
|
+
*
|
|
327
|
+
* Absent on the four sugar rules (`moves`, `requires`, `who`, `limit`), which nobody
|
|
328
|
+
* writes in a condition builder, and on any gate declared before the store started
|
|
329
|
+
* keeping them. Absent means "this one was not written here" — never "it has no
|
|
330
|
+
* condition", which is a different and dangerous thing to draw.
|
|
331
|
+
*/
|
|
332
|
+
when?: Record<string, unknown> | null;
|
|
333
|
+
/** @see {@link PipelineRule.when} — the condition that has to hold, as it was written. */
|
|
334
|
+
demands?: Record<string, unknown> | null;
|
|
294
335
|
version: number;
|
|
295
336
|
}
|
|
337
|
+
/**
|
|
338
|
+
* WHAT A GATE WOULD DO TO THIS BOARD TODAY, from `custom.pipeline_gate_preview`.
|
|
339
|
+
*
|
|
340
|
+
* The one question somebody writing a rule that will refuse their colleagues' work
|
|
341
|
+
* actually has, answered while they are still typing it — the gate is judged as an
|
|
342
|
+
* argument, nothing is saved, and nothing is written. The store compiles it with the
|
|
343
|
+
* SAME compiler `pipeline_declare` uses, so this count and the refusal at the door are
|
|
344
|
+
* the same rule.
|
|
345
|
+
*/
|
|
346
|
+
interface PipelineGatePreview {
|
|
347
|
+
is_pipeline: boolean;
|
|
348
|
+
/** Present, and it says what would make a board exist, when `is_pipeline` is false. */
|
|
349
|
+
why?: string;
|
|
350
|
+
/** The stage key the gate was tried against. */
|
|
351
|
+
stage?: string;
|
|
352
|
+
/** Live cards of this board this person may see that are not already in that stage. */
|
|
353
|
+
considered: number;
|
|
354
|
+
/** How many of them this gate would turn away. */
|
|
355
|
+
refused: number;
|
|
356
|
+
/**
|
|
357
|
+
* Up to three of them, BY NAME. A count with no names is a number nobody can check, and
|
|
358
|
+
* checking it is the whole reason to show it before saving.
|
|
359
|
+
*/
|
|
360
|
+
examples: {
|
|
361
|
+
record_id: Uuid;
|
|
362
|
+
title: string;
|
|
363
|
+
}[];
|
|
364
|
+
/** True when the board is larger than the preview will walk, so the count is a floor. */
|
|
365
|
+
truncated?: boolean;
|
|
366
|
+
on_fail?: StageRuleOnFail;
|
|
367
|
+
/** The word this board uses for one of its cards — "quote", "deal" — for the sentence. */
|
|
368
|
+
noun?: string;
|
|
369
|
+
}
|
|
296
370
|
/** The whole board's definition, from `custom.pipeline_read`. */
|
|
297
371
|
interface Pipeline {
|
|
298
372
|
is_pipeline: boolean;
|
|
@@ -338,6 +412,20 @@ interface PipelineMissingField {
|
|
|
338
412
|
interface PipelineVerdict {
|
|
339
413
|
allowed: boolean;
|
|
340
414
|
is_pipeline: boolean;
|
|
415
|
+
/**
|
|
416
|
+
* The THREE answers a board has to draw differently, and the reason `allowed` alone is
|
|
417
|
+
* not enough: a card that is going for approval has not been refused, and a card that
|
|
418
|
+
* moved under `warn` has not been waved through silently.
|
|
419
|
+
*/
|
|
420
|
+
outcome?: "allowed" | "refused" | "needs_approval" | "warned";
|
|
421
|
+
/** What this organization's one knob says right now. */
|
|
422
|
+
enforcement?: StageRuleEnforcement;
|
|
423
|
+
/** Set on `needs_approval`: what pressing on will actually do, in plain words. */
|
|
424
|
+
what_happens?: string;
|
|
425
|
+
/** Set on `warned`: the gates this organization asked to be told about, not stopped by. */
|
|
426
|
+
warnings?: StageRuleWarning[];
|
|
427
|
+
/** Approvals already filed against this card's own stage column that nobody has decided. */
|
|
428
|
+
pending?: StagePending[];
|
|
341
429
|
/** The stage key the move was asked about. */
|
|
342
430
|
to?: string;
|
|
343
431
|
/** The store's own sentence — shown verbatim, never paraphrased by a screen. */
|
|
@@ -346,6 +434,8 @@ interface PipelineVerdict {
|
|
|
346
434
|
rule_id?: Uuid;
|
|
347
435
|
rule_version?: number;
|
|
348
436
|
kind?: PipelineRuleKind;
|
|
437
|
+
/** What this Rule does when it stops a move. */
|
|
438
|
+
on_fail?: StageRuleOnFail;
|
|
349
439
|
/**
|
|
350
440
|
* When a stage demands columns that are empty, exactly which ones — so the screen can
|
|
351
441
|
* prompt for them on entry instead of sending the person away to find them.
|
|
@@ -382,9 +472,80 @@ interface PipelineSpec {
|
|
|
382
472
|
limits?: Record<string, number>;
|
|
383
473
|
/** Stage name → what happens when a card arrives: assign, notify, start a checklist. */
|
|
384
474
|
on_entry?: Record<string, Record<string, unknown>>;
|
|
475
|
+
/**
|
|
476
|
+
* Stage name → the gates a card has to get past to land there. The general form under
|
|
477
|
+
* `requires`, `who` and `limits`, and the only one that can say `require_approval`.
|
|
478
|
+
*/
|
|
479
|
+
gates?: Record<string, PipelineGate[]>;
|
|
385
480
|
moves_message?: string;
|
|
386
481
|
requires_messages?: Record<string, string>;
|
|
387
482
|
}
|
|
483
|
+
/**
|
|
484
|
+
* A gate the organization's own knob overruled. NOTHING FAILS SILENTLY: the move happened
|
|
485
|
+
* and the sentence comes back WITH it, together with what to do about it.
|
|
486
|
+
*/
|
|
487
|
+
interface StageRuleWarning {
|
|
488
|
+
rule_id: Uuid;
|
|
489
|
+
rule: string;
|
|
490
|
+
/** The gate's own sentence, shown verbatim. */
|
|
491
|
+
why: string;
|
|
492
|
+
what_to_do: string;
|
|
493
|
+
}
|
|
494
|
+
/** An approval filed against this card's stage column that nobody has decided yet. */
|
|
495
|
+
interface StagePending {
|
|
496
|
+
approval_id: Uuid;
|
|
497
|
+
/** The stage key the card is waiting to go to. */
|
|
498
|
+
to: string;
|
|
499
|
+
why: string | null;
|
|
500
|
+
requested_at: string;
|
|
501
|
+
state: string;
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* The same wait, asked for a WHOLE BOARD in one question (`custom.pipeline_pending`), so a
|
|
505
|
+
* board can badge every card that is waiting without a round trip per card — and therefore
|
|
506
|
+
* actually does it, instead of drawing a filed card as if nobody had ever dragged it.
|
|
507
|
+
*/
|
|
508
|
+
interface StagePendingOnBoard extends StagePending {
|
|
509
|
+
record_id: Uuid;
|
|
510
|
+
}
|
|
511
|
+
/** What `custom.pipeline_move` answers — an OBJECT on every path, never a bare number. */
|
|
512
|
+
interface PipelineMoveResult {
|
|
513
|
+
applied: boolean;
|
|
514
|
+
moved: boolean;
|
|
515
|
+
outcome: "moved" | "moved_with_warnings" | "needs_approval";
|
|
516
|
+
to: string;
|
|
517
|
+
version: number;
|
|
518
|
+
/** Set on `moved_with_warnings`. */
|
|
519
|
+
warnings?: StageRuleWarning[];
|
|
520
|
+
/** Set on `needs_approval`: the gate's sentence, the wait that was filed, and who has it. */
|
|
521
|
+
why?: string;
|
|
522
|
+
rule?: string;
|
|
523
|
+
rule_id?: Uuid;
|
|
524
|
+
approval_id?: Uuid;
|
|
525
|
+
approvers?: {
|
|
526
|
+
user_id: Uuid;
|
|
527
|
+
name: string | null;
|
|
528
|
+
why: string;
|
|
529
|
+
}[];
|
|
530
|
+
what_happens?: string;
|
|
531
|
+
}
|
|
532
|
+
/**
|
|
533
|
+
* ONE GATE ON A STAGE, as the condition builder on the stage settings screen writes it.
|
|
534
|
+
* `requires`, `who` and `limits` are sugar over this shape; this is the general form, and
|
|
535
|
+
* it speaks the SAME condition language as filters and formulas — never a second one.
|
|
536
|
+
*/
|
|
537
|
+
interface PipelineGate {
|
|
538
|
+
/** What the gate is called in the settings list. */
|
|
539
|
+
name?: string;
|
|
540
|
+
/** The sentence a person reads when it stops them. Required: a refusal with no words is a dead end. */
|
|
541
|
+
message: string;
|
|
542
|
+
/** WHEN this gate is about this record at all. Absent means always. */
|
|
543
|
+
when?: Record<string, unknown>;
|
|
544
|
+
/** What has to hold. One condition node of the one Rule language. */
|
|
545
|
+
demands: Record<string, unknown>;
|
|
546
|
+
/** Default `refuse`. */
|
|
547
|
+
on_fail?: StageRuleOnFail;
|
|
548
|
+
}
|
|
388
549
|
/**
|
|
389
550
|
* THE ONE PLACE A SCREEN DECIDES WHETHER A CARD LOOKS DRAGGABLE — and it decides on the
|
|
390
551
|
* PERSON, not on the rules. Whether a particular move is allowed is
|
|
@@ -520,6 +681,56 @@ interface BookingSummary {
|
|
|
520
681
|
/** draft · open · closed — the store's own word, never derived on a screen. */
|
|
521
682
|
state: string;
|
|
522
683
|
}
|
|
684
|
+
/**
|
|
685
|
+
* ONE WINDOW OF AN ORGANIZATION'S WEEK, in the shape `custom._booking_availability`
|
|
686
|
+
* normalises to and `custom._booking_slots` generates from. `weekday` is 0 for Sunday
|
|
687
|
+
* and 6 for Saturday — the database's own numbering, so a picker and the store cannot
|
|
688
|
+
* disagree about which day Monday is. A window may name ONE member, which is the "with
|
|
689
|
+
* whom" of an appointment; naming somebody who is not a member is refused BY NAME.
|
|
690
|
+
*/
|
|
691
|
+
interface BookingWindow {
|
|
692
|
+
weekday: number;
|
|
693
|
+
/** "09:00" */
|
|
694
|
+
from: string;
|
|
695
|
+
/** "17:00" — later in the day than `from`, or the store refuses it by name. */
|
|
696
|
+
to: string;
|
|
697
|
+
member_user_id?: string | null;
|
|
698
|
+
}
|
|
699
|
+
/**
|
|
700
|
+
* WHAT IS ON OFFER. Every field is the store's to default: a page declared with an
|
|
701
|
+
* empty availability comes back with the organization's timezone, a 30-minute slot and
|
|
702
|
+
* Monday-to-Friday nine-to-five, because a booking page that offered nothing would look
|
|
703
|
+
* broken rather than unconfigured. A screen shows what came BACK, never what it sent.
|
|
704
|
+
*/
|
|
705
|
+
interface BookingAvailability {
|
|
706
|
+
timezone: string;
|
|
707
|
+
slot_minutes: number;
|
|
708
|
+
/** Dead time kept after each appointment, so two never touch. */
|
|
709
|
+
buffer_minutes: number;
|
|
710
|
+
/** How far ahead of now the earliest bookable slot is. */
|
|
711
|
+
lead_minutes: number;
|
|
712
|
+
/** Most appointments in one day, across every window. */
|
|
713
|
+
max_per_day: number;
|
|
714
|
+
/** How many days ahead the page offers. */
|
|
715
|
+
days: number;
|
|
716
|
+
windows: BookingWindow[];
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* WHAT `custom.booking_declare` ANSWERS. `availability` is the NORMALISED offer —
|
|
720
|
+
* show that, not the draft — and `questions_filled_in` is how many questions the store
|
|
721
|
+
* took over (`slot`, `status`, `booked_with`), which a visitor is never asked.
|
|
722
|
+
*
|
|
723
|
+
* It does NOT publish. `anonPublish` is still the one act that opens the link, exactly
|
|
724
|
+
* as it is for a form, so there is one act and one word for opening a public surface.
|
|
725
|
+
*/
|
|
726
|
+
interface BookingDeclared {
|
|
727
|
+
form_id: string;
|
|
728
|
+
slot_table_id: string;
|
|
729
|
+
availability: BookingAvailability;
|
|
730
|
+
questions_asked: number;
|
|
731
|
+
questions_filled_in: number;
|
|
732
|
+
ms: number;
|
|
733
|
+
}
|
|
523
734
|
/**
|
|
524
735
|
* THE VISITOR'S OWN LINK to a booking page. The page id IS the capability, exactly
|
|
525
736
|
* as it is for a form; `custom.anon_submission.booking_ref` is the separate secret
|
|
@@ -1691,6 +1902,28 @@ interface DigestPreview {
|
|
|
1691
1902
|
*/
|
|
1692
1903
|
incomplete: string | null;
|
|
1693
1904
|
}
|
|
1905
|
+
/**
|
|
1906
|
+
* ONE SAVED VIEW — `custom.views`. A subscription is written OVER one of these, so
|
|
1907
|
+
* a person with no saved view has nothing to be told about; `viewDeclare` is how a
|
|
1908
|
+
* screen gives them one without leaving the screen they are on.
|
|
1909
|
+
*
|
|
1910
|
+
* `filters` is written in the ONE shape `custom.agg_view_admits` reads, so a view
|
|
1911
|
+
* saved here needs no translation before the notifier can admit records to it.
|
|
1912
|
+
*/
|
|
1913
|
+
interface SavedViewRow {
|
|
1914
|
+
view_id: Uuid;
|
|
1915
|
+
name: string;
|
|
1916
|
+
table_id: Uuid | null;
|
|
1917
|
+
filters: Record<string, unknown>;
|
|
1918
|
+
created_at: string;
|
|
1919
|
+
}
|
|
1920
|
+
/** What `custom.view_declare` is asked for. `view_id` re-states rather than doubling. */
|
|
1921
|
+
interface SavedViewSpecIn {
|
|
1922
|
+
name: string;
|
|
1923
|
+
filters?: Record<string, unknown> | null;
|
|
1924
|
+
definition?: Record<string, unknown> | null;
|
|
1925
|
+
view_id?: Uuid | null;
|
|
1926
|
+
}
|
|
1694
1927
|
/** What `custom.subscription_declare` is asked for. The store refuses the rest BY NAME. */
|
|
1695
1928
|
interface SubscriptionSpec {
|
|
1696
1929
|
name: string;
|
|
@@ -2347,143 +2580,6 @@ interface ResolvedPublishBinding {
|
|
|
2347
2580
|
notice: string;
|
|
2348
2581
|
}
|
|
2349
2582
|
|
|
2350
|
-
/**
|
|
2351
|
-
* What KIND of refusal it was. The mapping from SQLSTATE to code lives in
|
|
2352
|
-
* `/core`, and it is checked against `STORE_REFUSAL_CODES` — the list of every
|
|
2353
|
-
* SQLSTATE the store's own bodies raise, generated from the live catalogue. A
|
|
2354
|
-
* code the store can raise and this union cannot name is a hole, and the
|
|
2355
|
-
* real-door suite fails on it.
|
|
2356
|
-
*/
|
|
2357
|
-
type RecordsErrorCode =
|
|
2358
|
-
/** `PT409` — somebody else's write won. The record clock moved under you. */
|
|
2359
|
-
"stale_write"
|
|
2360
|
-
/** `42501` — a door. Either the schema is revoked, or the store is switched off, or this principal may not pass. */
|
|
2361
|
-
| "door"
|
|
2362
|
-
/** `23514` — a Rule, a shape guard, or a validation the store enforces refused it. */
|
|
2363
|
-
| "refused_by_rule"
|
|
2364
|
-
/**
|
|
2365
|
-
* `22004` / `22023` / `22P02` — the call itself was malformed: a missing id, a
|
|
2366
|
-
* patch that is not an object, or a value that does not fit the type the
|
|
2367
|
-
* store holds for that Field. The store's own message names the value and the
|
|
2368
|
-
* type it could not be read as.
|
|
2369
|
-
*/
|
|
2370
|
-
| "invalid_argument"
|
|
2371
|
-
/** `02000` — the record is not here (deleted, never existed, or another organization's). */
|
|
2372
|
-
| "not_found"
|
|
2373
|
-
/** `23503` — something it points at is not there. */
|
|
2374
|
-
| "missing_reference"
|
|
2375
|
-
/** `23505` — that thing is already here. */
|
|
2376
|
-
| "already_exists"
|
|
2377
|
-
/** `0A000` — the store does not do this yet, and says which part. */
|
|
2378
|
-
| "not_supported"
|
|
2379
|
-
/** `53400` / `22012` — the store ran out of something, or the arithmetic could not be done. */
|
|
2380
|
-
| "store_limit"
|
|
2381
|
-
/**
|
|
2382
|
-
* `40001` — the visibility snapshot this connection carries is older than a
|
|
2383
|
-
* write the reader has already observed, so the store refused to answer at
|
|
2384
|
-
* all rather than hand back something they just lost. Retry on a fresh
|
|
2385
|
-
* connection; it is the one refusal in this list that is worth repeating.
|
|
2386
|
-
*/
|
|
2387
|
-
| "stale_read"
|
|
2388
|
-
/**
|
|
2389
|
-
* `57014` — the store cancelled the statement at its own timeout. Nothing was
|
|
2390
|
-
* refused on its merits and nothing was written; the same call can succeed on
|
|
2391
|
-
* a smaller page or a quieter moment. With `stale_read`, one of the only two
|
|
2392
|
-
* refusals in this list worth repeating.
|
|
2393
|
-
*/
|
|
2394
|
-
| "timed_out"
|
|
2395
|
-
/**
|
|
2396
|
-
* THE DOOR THAT DOES NOT EXIST YET. Not an error condition in the database —
|
|
2397
|
-
* this package asked for a door that is not in the live catalogue, so it
|
|
2398
|
-
* refused to guess. `door_absent` always names the door and the lane that
|
|
2399
|
-
* owns it; it is never a silent no-op and never an empty list.
|
|
2400
|
-
*/
|
|
2401
|
-
| "door_absent"
|
|
2402
|
-
/**
|
|
2403
|
-
* `PGRST202` / `PGRST205` — PostgREST could not find the function or the
|
|
2404
|
-
* schema. The database this client is pointed at is not serving the record
|
|
2405
|
-
* store: the schema is not exposed, or the grants are not there.
|
|
2406
|
-
*/
|
|
2407
|
-
| "store_not_served"
|
|
2408
|
-
/** Anything the mapper could not place. It still carries the store's own words. */
|
|
2409
|
-
| "internal";
|
|
2410
|
-
/** A refusal, in the store's own words. */
|
|
2411
|
-
interface RecordsError {
|
|
2412
|
-
code: RecordsErrorCode;
|
|
2413
|
-
/** THE STORE'S message, verbatim. Never paraphrased. */
|
|
2414
|
-
message: string;
|
|
2415
|
-
/** THE STORE'S hint, verbatim — this is where the remedy is written. */
|
|
2416
|
-
hint?: string;
|
|
2417
|
-
/** The SQLSTATE, so a caller can be exact when a code is not exact enough. */
|
|
2418
|
-
sqlstate?: string;
|
|
2419
|
-
/** Whatever the store put in DETAIL, parsed when it was json. */
|
|
2420
|
-
detail?: unknown;
|
|
2421
|
-
}
|
|
2422
|
-
type RecordsResult<T> = {
|
|
2423
|
-
ok: true;
|
|
2424
|
-
data: T;
|
|
2425
|
-
} | {
|
|
2426
|
-
ok: false;
|
|
2427
|
-
error: RecordsError;
|
|
2428
|
-
};
|
|
2429
|
-
/** Narrowing helper for hosts compiled without `strictNullChecks`. */
|
|
2430
|
-
declare function isRecordsErr<T>(result: RecordsResult<T>): result is {
|
|
2431
|
-
ok: false;
|
|
2432
|
-
error: RecordsError;
|
|
2433
|
-
};
|
|
2434
|
-
declare const ok: <T>(data: T) => RecordsResult<T>;
|
|
2435
|
-
declare const err: <T>(error: RecordsError) => RecordsResult<T>;
|
|
2436
|
-
/**
|
|
2437
|
-
* A `stale_write` carries everything the screen needs to show the conflict
|
|
2438
|
-
* rather than a toast: which version you wrote against, which one won, and the
|
|
2439
|
-
* value of every field you touched as it stands now. The store builds this and
|
|
2440
|
-
* this type is its shape — nothing is reconstructed on the client.
|
|
2441
|
-
*/
|
|
2442
|
-
interface StaleWriteDetail {
|
|
2443
|
-
expected_version: number;
|
|
2444
|
-
current_version: number;
|
|
2445
|
-
contested_fields: Record<string, unknown>;
|
|
2446
|
-
}
|
|
2447
|
-
/** The parsed form of a `stale_write`, for `useRecordMutation`'s conflict state. */
|
|
2448
|
-
interface WriteConflict extends StaleWriteDetail {
|
|
2449
|
-
record_id: Uuid;
|
|
2450
|
-
/** The store's own sentence — what the screen shows. */
|
|
2451
|
-
message: string;
|
|
2452
|
-
/** The store's own remedy. */
|
|
2453
|
-
hint: string;
|
|
2454
|
-
}
|
|
2455
|
-
/**
|
|
2456
|
-
* The structural shape of a PostgREST failure as supabase-js resolves it: a
|
|
2457
|
-
* PLAIN OBJECT parsed from the response body, NOT an `Error`. Reading
|
|
2458
|
-
* `.message` off `instanceof Error` discards the real database message on every
|
|
2459
|
-
* genuine failure.
|
|
2460
|
-
*/
|
|
2461
|
-
interface PgError {
|
|
2462
|
-
code?: string | null;
|
|
2463
|
-
message: string;
|
|
2464
|
-
details?: string | null;
|
|
2465
|
-
hint?: string | null;
|
|
2466
|
-
}
|
|
2467
|
-
/** What the validation mirror answers: the same sentence the trigger would raise. */
|
|
2468
|
-
interface PredictedRefusal {
|
|
2469
|
-
/** The field key the store would name, when it names one. */
|
|
2470
|
-
field_key?: string;
|
|
2471
|
-
/** The message the store's own body would raise, word for word. */
|
|
2472
|
-
message: string;
|
|
2473
|
-
hint?: string;
|
|
2474
|
-
sqlstate: string;
|
|
2475
|
-
/**
|
|
2476
|
-
* Which of the store's bodies would raise it, so a reader can go and check
|
|
2477
|
-
* that this mirror still tells the truth.
|
|
2478
|
-
*/
|
|
2479
|
-
predicted_by: string;
|
|
2480
|
-
}
|
|
2481
|
-
/** VAL-5 / VAL-6, named so a caller can say which word was the problem. */
|
|
2482
|
-
interface ForbiddenEnvelopeWord {
|
|
2483
|
-
field_key: string;
|
|
2484
|
-
word: PerValueAccessWord;
|
|
2485
|
-
}
|
|
2486
|
-
|
|
2487
2583
|
/**
|
|
2488
2584
|
* The data seam: a structural subset of `SupabaseClient`. The package never
|
|
2489
2585
|
* opens a database connection of its own and never holds a key — the HOST
|
|
@@ -2720,4 +2816,4 @@ interface ConversationScopeContext {
|
|
|
2720
2816
|
/** `About: Acme Industrial` — the chip a bound chat wears. */
|
|
2721
2817
|
declare function scopeChip(scope: ConversationScope): string;
|
|
2722
2818
|
|
|
2723
|
-
export { Actor, type AggregateBucket, type AggregateFilter, type AggregateMeasure, type AggregateOperation, type AggregateRow, type AggregateWindow, type AnonTokenBinding, type BookingSummary, type CaptureField, type CaptureFileRef, type CaptureOutcome, type CaptureQuestion, type CaptureQueue, type CaptureQueueCounts, type CaptureQueueOptions, type CaptureQueuePorts, type CaptureQueueStore, type CaptureSheetFace, type CaptureSheetSummary, type CaptureSyncReport, type ChecklistDeclared, type ChecklistRequirement, type ChecklistRequirementKind, type ChecklistRoleSpec, type ChecklistRunStarted, type ChecklistRunStep, type ChecklistRunSummary, type ChecklistSpec, type ChecklistStepCompleted, type ChecklistStepSpec, type ChecklistTemplateShape, type ChecklistTemplateSummary, type ChecklistTrigger, type ChecklistTriggerKind, type ChoiceOption, type CommentThreadRead, type CommentWritten, type ConversationScope, type ConversationScopeContext, type CustomFieldTableType, type DashboardBlock, type DashboardBlockKind, type DashboardBlockResult, type DashboardRunResult, type DashboardSummary, Delivery, type DigestPreview, type DocRenderRow, type DocSignatureCheck, type DocSignatureRow, type DocTemplateRow, type DocToken, type DocUnresolvedToken, type EnrichAlternate, type EnrichCell, type EnrichDeclared, type EnrichDueRow, type EnrichRun, type EnrichSource, type Enrichment, type EnrichmentSummary, type EntityFieldRights, type EntityFieldValue, type EntityRecordMatch, type EntityRecordRead, type EntityRecordsFound, type EntityTableFacts, type ExternalPrincipalCard, Field, type FieldHistoryEntry, type
|
|
2819
|
+
export { Actor, type AggregateBucket, type AggregateFilter, type AggregateMeasure, type AggregateOperation, type AggregateRow, type AggregateWindow, type AnonTokenBinding, type BookingAvailability, type BookingDeclared, type BookingSummary, type BookingWindow, type CaptureField, type CaptureFileRef, type CaptureOutcome, type CaptureQuestion, type CaptureQueue, type CaptureQueueCounts, type CaptureQueueOptions, type CaptureQueuePorts, type CaptureQueueStore, type CaptureSheetFace, type CaptureSheetSummary, type CaptureSyncReport, type ChecklistDeclared, type ChecklistRequirement, type ChecklistRequirementKind, type ChecklistRoleSpec, type ChecklistRunStarted, type ChecklistRunStep, type ChecklistRunSummary, type ChecklistSpec, type ChecklistStepCompleted, type ChecklistStepSpec, type ChecklistTemplateShape, type ChecklistTemplateSummary, type ChecklistTrigger, type ChecklistTriggerKind, type ChoiceOption, type CommentThreadRead, type CommentWritten, type ConversationScope, type ConversationScopeContext, type CustomFieldTableType, type DashboardBlock, type DashboardBlockKind, type DashboardBlockResult, type DashboardRunResult, type DashboardSummary, Delivery, type DigestPreview, type DocRenderRow, type DocSignatureCheck, type DocSignatureRow, type DocTemplateRow, type DocToken, type DocUnresolvedToken, type EnrichAlternate, type EnrichCell, type EnrichDeclared, type EnrichDueRow, type EnrichRun, type EnrichSource, type Enrichment, type EnrichmentSummary, type EntityFieldRights, type EntityFieldValue, type EntityRecordMatch, type EntityRecordRead, type EntityRecordsFound, type EntityTableFacts, type ExternalPrincipalCard, Field, type FieldHistoryEntry, type FormSummary, Freshness, type HistoryActor, type HistoryActorKind, type HistoryChange, type Home, type ImportBatchResult, type ImportColumnPlan, type ImportFinished, type ImportOpened, type ImportOutcome, type ImportPlan, type ImportPolicy, type ImportProposal, type ImportReport, type ImportRun, type InboundAddress, type InboundDeclared, type MergeField, MergeFieldModifier, type MergeFieldProvenance, type MergeFieldResolution, MergeFieldSemanticType, MergeFieldSource, type MergeFieldTransform, type MissingBehavior, type MyLevel, type MySubscription, type NewEntityFieldDeclaration, OnDelete, OverridePolicy, PERMISSION_LEVELS, PIPELINE_RULE_KINDS, ParityFieldType, type PermissionLevel, PgError, type Pipeline, type PipelineColumn, type PipelineDeclared, type PipelineGate, type PipelineGatePreview, type PipelineMissingField, type PipelineMoveResult, type PipelineRule, type PipelineRuleKind, type PipelineSpec, type PipelineStage, type PipelineVerdict, type PortalCard, type PortalInvitation, type PortalPreviewRow, type PortalPrincipal, type PortalRevocation, type PortalSummary, type PortalTableExposure, type PublishBinding, type QueuedCapture, type QueuedCaptureFile, type QueuedCaptureState, type QuietHours, REFUSALS_WORTH_REPEATING, type RecordComment, RecordDocument, type RecordHistoryEntry, type RecordScopeComment, type RecordScopeContext, type RecordScopeField, type RecordScopeHistoryEntry, type RecordScopeRelation, type RecordScopeWithheld, type RecordsActor, type RecordsConfig, type RecordsDataSource, type RecordsErrorSink, type RecordsFilter, type RecordsRealtimePort, type RecordsResolverPort, type RecordsResponse, type RecordsTableQuery, type RegisteredTable, type Relation, RelationBinding, RelationCardinality, type RelationCarries, type RelationCoordinate, RelationFlavor, type RelationProperties, type RelationTarget, type ResolutionTriple, type ResolvedPublishBinding, type RestorePreview, type RestoreResult, type Rule, type RuleAnswer, type RuleExpression, RuleNodeKind, RuleUse, STAGE_RULE_ENFORCEMENT, STAGE_RULE_ON_FAIL, type SavedViewRow, type SavedViewSpecIn, type StagePending, type StagePendingOnBoard, type StageRuleEnforcement, type StageRuleOnFail, type StageRuleWarning, StorageMode, StoredRecord, type StuckRow, type Subscription, type SubscriptionBlock, type SubscriptionCadence, type SubscriptionSpec, type Table, type TableCapacity, TableDisplay, TableOrigin, TableType, Timestamp, Uuid, type WorkApprovalDecision, type WorkApprovalFiled, type WorkApprover, type WorkAssignment, type WorkAssignmentField, type WorkChange, type WorkDueState, type WorkGraph, type WorkInboxItem, type WorkInboxKind, type WorkInstantiation, type WorkListFlavour, type WorkListItem, type WorkOrigin, type WorkRecordState, type WorkSlotHold, type WorkState, type WorkTemplateNode, type WorkTemplateRelation, type WorkTurn, asPermissionLevel, atLeast, bookingPath, choiceSlug, choiceValuesOf, choicesOf, highestLevel, holdsARetiredChoice, indexedDbStore, isDecided, isTheChosen, looksLikeAnId, mayDrag, measureKey, memoryStore, mintClientKey, openCaptureQueue, optionKey, optionLabel, portalPath, publicFormPath, scopeChip };
|
package/dist/index.js
CHANGED
|
@@ -126,6 +126,8 @@ function looksLikeAnId(value) {
|
|
|
126
126
|
|
|
127
127
|
// src/pipeline.ts
|
|
128
128
|
var PIPELINE_RULE_KINDS = ["moves", "requires", "who", "limit", "entry"];
|
|
129
|
+
var STAGE_RULE_ON_FAIL = ["refuse", "require_approval"];
|
|
130
|
+
var STAGE_RULE_ENFORCEMENT = ["refuse", "warn"];
|
|
129
131
|
function mayDrag(level) {
|
|
130
132
|
return level === "editor" || level === "admin" || level === "owner";
|
|
131
133
|
}
|
|
@@ -482,6 +484,7 @@ var RULE_NODE_KINDS = [
|
|
|
482
484
|
{ node: "parent_field", evaluated_by: "W1-RULE-APPLY" },
|
|
483
485
|
{ node: "present", evaluated_by: "W1-RULE" },
|
|
484
486
|
{ node: "previous", evaluated_by: "PIPELINES" },
|
|
487
|
+
{ node: "sibling_count", evaluated_by: "STAGE-RULES" },
|
|
485
488
|
{ node: "stage_count", evaluated_by: "PIPELINES" },
|
|
486
489
|
{ node: "sub", evaluated_by: "W1-RULE" }
|
|
487
490
|
];
|
|
@@ -809,7 +812,9 @@ var STORE_DOORS = [
|
|
|
809
812
|
{ name: "pin_agent_cells", args: "p_new jsonb, p_old jsonb, p_agent_keys text[]", returns: "jsonb", security: "invoker" },
|
|
810
813
|
{ 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" },
|
|
811
814
|
{ name: "pipeline_declare", args: "p_organization_id uuid, p_table_id uuid, p_spec jsonb", returns: "jsonb", security: "definer" },
|
|
815
|
+
{ name: "pipeline_gate_preview", args: "p_organization_id uuid, p_table_id uuid, p_stage text, p_gate jsonb", returns: "jsonb", security: "definer" },
|
|
812
816
|
{ 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" },
|
|
817
|
+
{ name: "pipeline_pending", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "definer" },
|
|
813
818
|
{ name: "pipeline_read", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "definer" },
|
|
814
819
|
{ name: "pipeline_transition_refusal", args: "p_organization_id uuid, p_record_id uuid, p_to text", returns: "jsonb", security: "definer" },
|
|
815
820
|
{ name: "portal_admits", args: "p_organization_id uuid, p_user_id uuid DEFAULT NULL::uuid", returns: "boolean", security: "definer" },
|
|
@@ -876,6 +881,7 @@ var STORE_DOORS = [
|
|
|
876
881
|
{ 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" },
|
|
877
882
|
{ name: "record_delete", args: "p_organization_id uuid, p_record_id uuid", returns: "timestamp with time zone", security: "definer" },
|
|
878
883
|
{ name: "record_history", args: "p_organization_id uuid, p_record_id uuid, p_limit integer DEFAULT 200, p_offset integer DEFAULT 0", returns: "TABLE(version integer, occurred_at timestamp with time zone, operation text, operation_label text, actor jsonb, changes jsonb, migration_id uuid, undoable boolean)", security: "definer" },
|
|
884
|
+
{ name: "record_platform_keys", args: "", returns: "text[]", security: "invoker" },
|
|
879
885
|
{ name: "record_relation_edges", args: "p_organization_id uuid, p_id uuid, p_table_id uuid, p_data_class text, p_data jsonb, p_deleted_at timestamp with time zone", returns: "TABLE(target_id uuid, edge_role text, field_id uuid, ord integer)", security: "invoker" },
|
|
880
886
|
{ name: "record_reparent", args: "p_organization_id uuid, p_record_id uuid, p_parent_id uuid", returns: "void", security: "definer" },
|
|
881
887
|
{ name: "record_resolve", args: "p_organization_id uuid, p_id uuid", returns: "jsonb", security: "definer" },
|
|
@@ -884,6 +890,7 @@ var STORE_DOORS = [
|
|
|
884
890
|
{ name: "record_restore_version", args: "p_organization_id uuid, p_record_id uuid, p_version integer", returns: "jsonb", security: "definer" },
|
|
885
891
|
{ name: "record_restore_version", args: "p_organization_id uuid, p_record_id uuid, p_version integer, p_author jsonb", returns: "jsonb", security: "definer" },
|
|
886
892
|
{ name: "record_scope_context", args: "p_organization_id uuid, p_record_id uuid, p_relations integer DEFAULT 12, p_history integer DEFAULT 15, p_siblings integer DEFAULT 8", returns: "jsonb", security: "definer" },
|
|
893
|
+
{ name: "record_stage_pending", args: "p_organization_id uuid, p_record_id uuid", returns: "jsonb", security: "definer" },
|
|
887
894
|
{ name: "record_state_as_of", args: "p_record_id uuid, p_at timestamp with time zone", returns: "TABLE(state jsonb, replayed boolean)", security: "definer" },
|
|
888
895
|
{ name: "record_table", args: "p_organization_id uuid, p_record_id uuid", returns: "uuid", security: "definer" },
|
|
889
896
|
{ name: "record_update", args: "p_organization_id uuid, p_record_id uuid, p_patch jsonb, p_expected_version integer DEFAULT NULL::integer", returns: "integer", security: "definer" },
|
|
@@ -947,6 +954,8 @@ var STORE_DOORS = [
|
|
|
947
954
|
{ name: "size_refusal", args: "p_organization_id uuid, p_data jsonb", returns: "text", security: "invoker" },
|
|
948
955
|
{ name: "source_next_pointer", args: "p_sources jsonb", returns: "text", security: "invoker" },
|
|
949
956
|
{ name: "source_pointer", args: "p_sources jsonb, p_source jsonb", returns: "text", security: "invoker" },
|
|
957
|
+
{ name: "stage_rule_enforcement", args: "p_organization_id uuid", returns: "text", security: "invoker" },
|
|
958
|
+
{ name: "stage_rule_on_fail_kinds", args: "", returns: "TABLE(behaviour text, note text)", security: "invoker" },
|
|
950
959
|
{ name: "stamp_value_envelopes", args: "p_data jsonb, p_actor text, p_on_behalf_of text, p_at timestamp with time zone", returns: "jsonb", security: "invoker" },
|
|
951
960
|
{ name: "storage_modes", args: "", returns: "text[]", security: "invoker" },
|
|
952
961
|
{ name: "store_is_open", args: "p_organization_id uuid DEFAULT NULL::uuid", returns: "boolean", security: "invoker" },
|
|
@@ -957,6 +966,7 @@ var STORE_DOORS = [
|
|
|
957
966
|
{ 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" },
|
|
958
967
|
{ name: "table_capacity", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "definer" },
|
|
959
968
|
{ 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" },
|
|
969
|
+
{ name: "table_column_source", args: "p_organization_id uuid, p_table_id uuid", returns: "text", security: "invoker" },
|
|
960
970
|
{ name: "table_contents", args: "p_organization_id uuid, p_table_id uuid", returns: "TABLE(record_id uuid, kind text, goes_at integer)", security: "invoker" },
|
|
961
971
|
{ name: "table_declare", args: "p_organization_id uuid, p_spec jsonb", returns: "uuid", security: "definer" },
|
|
962
972
|
{ name: "table_has_a_visible_record", args: "p_user uuid, p_organization_id uuid, p_table_id uuid", returns: "boolean", security: "definer" },
|
|
@@ -971,6 +981,7 @@ var STORE_DOORS = [
|
|
|
971
981
|
{ 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" },
|
|
972
982
|
{ name: "tables_described_without_asking", args: "", returns: "TABLE(function_name text, identity_args text, why text)", security: "invoker" },
|
|
973
983
|
{ name: "trg_associations_bump_visibility", args: "", returns: "trigger", security: "definer" },
|
|
984
|
+
{ name: "undeclared_keys", args: "p_organization_id uuid, p_table_id uuid, p_data jsonb", returns: "text[]", security: "invoker" },
|
|
974
985
|
{ name: "validate_custom_fields", args: "p_token text, p_organization_id uuid, p_values jsonb", returns: "void", security: "invoker" },
|
|
975
986
|
{ name: "validate_value_envelope", args: "p_organization_id uuid, p_fields custom.record[], p_data jsonb", returns: "void", security: "invoker" },
|
|
976
987
|
{ name: "validate_values", args: "p_organization_id uuid, p_fields custom.record[], p_values jsonb, p_record_type text DEFAULT NULL::text", returns: "void", security: "invoker" },
|
|
@@ -1071,6 +1082,7 @@ var STORE_KNOBS = [
|
|
|
1071
1082
|
{ key: "sandbox_message_bytes", value: "65536", type: "integer" },
|
|
1072
1083
|
{ key: "sandbox_org_components", value: "true", type: "boolean" },
|
|
1073
1084
|
{ key: "signup_provisioning_guard", value: "false", type: "boolean" },
|
|
1085
|
+
{ key: "stage_rule_enforcement", value: '"refuse"', type: "enum" },
|
|
1074
1086
|
{ key: "system_enabled", value: "false", type: "boolean" },
|
|
1075
1087
|
{ key: "table_record_ceiling", value: "150000", type: "integer" },
|
|
1076
1088
|
{ key: "value_max_bytes", value: "100000", type: "integer" },
|
|
@@ -1080,19 +1092,20 @@ var STORE_REFUSAL_CODES = [
|
|
|
1080
1092
|
{ 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" },
|
|
1081
1093
|
{ 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" },
|
|
1082
1094
|
{ code: "22003", raised_by: "context_resolve" },
|
|
1083
|
-
{ 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,record_write_many,relation_carry,relation_own,rule_declare,share_grant,sign_request_create,sign_request_sign,subscription_declare,table_declare,value_restore,view_declare,work_approval_decide,work_approval_request,work_template_declare" },
|
|
1095
|
+
{ 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,pipeline_gate_preview,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,record_write_many,relation_carry,relation_own,rule_declare,share_grant,sign_request_create,sign_request_sign,subscription_declare,table_declare,value_restore,view_declare,work_approval_decide,work_approval_request,work_template_declare" },
|
|
1084
1096
|
{ code: "22007", raised_by: "dashboard_window_sql" },
|
|
1085
1097
|
{ code: "22012", raised_by: "rule_eval" },
|
|
1086
1098
|
{ 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_export,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,record_write_many,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" },
|
|
1087
1099
|
{ 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,view_declare,work_set_state,work_take_assignment,work_template_instantiate" },
|
|
1088
1100
|
{ 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" },
|
|
1089
|
-
{ 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,table_declare,validate_value_envelope,validate_values,work_set_state,work_slots_declare,work_take_assignment,work_template_instantiate" },
|
|
1101
|
+
{ code: "23514", raised_by: "_checklist_instantiate,_checklist_step_guard,_claimed_column_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_columns_word_guard,_table_shape_guard,_undeclared_key_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,table_declare,validate_value_envelope,validate_values,work_set_state,work_slots_declare,work_take_assignment,work_template_instantiate" },
|
|
1090
1102
|
{ code: "40001", raised_by: "has_visibility_at" },
|
|
1091
1103
|
{ 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" },
|
|
1092
1104
|
{ code: "42703", raised_by: "entity_table,portal_declare" },
|
|
1093
1105
|
{ code: "53400", raised_by: "anon_rate_take,delete_cascade_closure,enrich_due,enrich_land,promote_field" },
|
|
1094
1106
|
{ code: "54001", raised_by: "record_delete" },
|
|
1095
|
-
{ code: "PT409", raised_by: "record_update" }
|
|
1107
|
+
{ code: "PT409", raised_by: "record_update" },
|
|
1108
|
+
{ code: "PT428", raised_by: "_record_rule_uses" }
|
|
1096
1109
|
];
|
|
1097
1110
|
var ENTITY_TOKENS = [
|
|
1098
1111
|
"access_delta_probe",
|
|
@@ -1756,6 +1769,7 @@ var ENTITY_TOKENS = [
|
|
|
1756
1769
|
"plan_node_artifact",
|
|
1757
1770
|
"plan_node_step",
|
|
1758
1771
|
"plan_profile",
|
|
1772
|
+
"platform_action_request",
|
|
1759
1773
|
"platform_actor_session",
|
|
1760
1774
|
"platform_actor_token",
|
|
1761
1775
|
"platform_actor_token_event",
|
|
@@ -2149,6 +2163,8 @@ export {
|
|
|
2149
2163
|
RETIRED_ACTOR_WORDS,
|
|
2150
2164
|
RULE_NODE_KINDS,
|
|
2151
2165
|
RULE_USES,
|
|
2166
|
+
STAGE_RULE_ENFORCEMENT,
|
|
2167
|
+
STAGE_RULE_ON_FAIL,
|
|
2152
2168
|
STORAGE_MODES,
|
|
2153
2169
|
STORE_DOORS,
|
|
2154
2170
|
STORE_KNOBS,
|