@ai-matrx/records 0.29.0 → 0.36.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 +111 -0
- package/dist/core/index.cjs +93 -12
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +52 -7
- package/dist/core/index.d.ts +52 -7
- package/dist/core/index.js +93 -12
- package/dist/core/index.js.map +1 -1
- package/dist/{field-DrOTIPCF.d.cts → field-CWBdZfFv.d.cts} +277 -9
- package/dist/{field-DrOTIPCF.d.ts → field-CWBdZfFv.d.ts} +277 -9
- package/dist/index.cjs +35 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +165 -141
- package/dist/index.d.ts +165 -141
- package/dist/index.js +35 -8
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +93 -12
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +481 -149
- package/dist/react/index.d.ts +481 -149
- package/dist/react/index.js +93 -12
- package/dist/react/index.js.map +1 -1
- package/dist/use-cases/index.cjs +74 -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 +74 -3
- package/dist/use-cases/index.js.map +1 -1
- package/package.json +1 -1
package/dist/core/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { g as Timestamp, U as Uuid, h as RecordDocument, i as
|
|
2
|
-
export { A as ABSENCE_REASONS,
|
|
3
|
-
import { RelationCoordinate, RecordsConfig,
|
|
4
|
-
export { AggregateOperation, AggregateWindow, CaptureField, CaptureQuestion, CaptureQueue, CaptureQueueCounts, CaptureQueueOptions, CaptureQueuePorts, CaptureQueueStore, CaptureSyncReport, ChecklistRequirement, ChecklistRequirementKind, ChecklistRoleSpec, ChecklistStepSpec, ChecklistTrigger, ChecklistTriggerKind, ChoiceOption, CustomFieldTableType, DashboardBlockKind, DashboardBlockResult, DocSignatureCheck, EnrichAlternate, EnrichSource, Enrichment, EntityFieldValue, EntityRecordMatch,
|
|
1
|
+
import { g as Timestamp, U as Uuid, h as RecordDocument, i as RecordsResult, j as RecordRead, k as ReadRow, l as Field, m as StoredRecord, N as NewFieldDeclaration, n as FieldPatch, o as RecordRevision, p as ReadValue, q as FieldProposal, r as TableProposal, s as RecordsError, W as WriteConflict, P as PgError, t as StaleWriteDetail, u as PredictedRefusal } from '../field-CWBdZfFv.cjs';
|
|
2
|
+
export { A as ABSENCE_REASONS, v as ACTOR_VOCABULARY, w as AbsenceReason, x as Actor, y as COMPUTE_ON, z as CONTEXT_POLICIES, C as ComputeOn, e as ContextPolicy, D as DELIVERIES, B as Delivery, E as ENTITY_TOKENS, G as EntityToken, H as FIELD_SENSITIVITIES, I as FIELD_SOURCES, J as FRESHNESS, K as FieldBehavior, c as FieldRule, d as FieldSensitivity, b as FieldSource, F as FieldTypeWord, L as ForbiddenEnvelopeWord, M as Freshness, 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, $ as MergeFieldModifier, a0 as MergeFieldSemanticType, a1 as MergeFieldSource, a2 as ON_DELETE, a3 as OVERRIDE_POLICIES, O as OnDelete, a4 as OverridePolicy, a5 as PARITY_FIELD_TYPES, a6 as PER_VALUE_ACCESS_WORDS, a7 as ParityFieldType, a8 as ParityFieldTypeDescriptor, a9 as PerValueAccessWord, 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, ah as RecordsErrorCode, ai as RelationBinding, f as RelationCardinality, R as RelationFlavor, aj as RetiredActorWord, ak as RuleNodeKind, al as RuleUse, am as STORAGE_MODES, an as STORE_DOORS, ao as STORE_KNOBS, ap as STORE_REFUSAL_CODES, S as StorageMode, aq as StoreDoorName, ar as StoreRefusalCode, as as TABLE_DISPLAYS, at as TABLE_ORIGINS, au as TABLE_TYPES, a as TableDisplay, av as TableOrigin, T as TableType, 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, aD as err, aE as isRecordsErr, aF as ok } from '../field-CWBdZfFv.cjs';
|
|
3
|
+
import { RelationCoordinate, RecordsConfig, Table, TableCapacity, EntityTableFacts, NewEntityFieldDeclaration, EntityFieldRights, EntityRecordRead, EntityRecordsFound, Pipeline, PipelineColumn, PipelineVerdict, PipelineMoveResult, PipelineSpec, PipelineDeclared, StageRuleOnFail, StageRuleEnforcement, StagePending, StagePendingOnBoard, PipelineGate, PipelineGatePreview, FormSummary, BookingSummary, ImportPlan, ImportPolicy, ImportOpened, ImportBatchResult, ImportFinished, ImportReport, ImportRun, InboundDeclared, InboundAddress, PortalSummary, PortalCard, PortalInvitation, PortalRevocation, PortalPreviewRow, DashboardSummary, DashboardBlock, AggregateFilter, DashboardRunResult, StuckRow, CaptureSheetSummary, CaptureSheetFace, CaptureFileRef, CaptureOutcome, EnrichmentSummary, EnrichDeclared, EnrichDueRow, EnrichCell, EnrichRun, AggregateMeasure, AggregateBucket, AggregateRow, Subscription, MySubscription, SubscriptionSpec, DigestPreview, DocToken, DocUnresolvedToken, DocTemplateRow, DocRenderRow, DocSignatureRow, RecordHistoryEntry, RecordScopeContext, ConversationScope, ConversationScopeContext, FieldHistoryEntry, RestorePreview, RestoreResult, CommentThreadRead, CommentWritten, AnonTokenBinding, ChecklistSpec, ChecklistDeclared, ChecklistTemplateSummary, ChecklistTemplateShape, ChecklistRunStarted, ChecklistRunStep, ChecklistRunSummary, ChecklistStepCompleted, WorkState, WorkGraph, WorkInstantiation, WorkTurn, WorkAssignmentField, WorkSlotHold, WorkInboxItem, WorkListFlavour, WorkListItem, WorkAssignment, WorkRecordState, WorkApprover, WorkChange, WorkApprovalFiled, WorkApprovalDecision, ExternalPrincipalCard, PublishBinding, ResolvedPublishBinding, MyLevel, RecordsDataSource } from '../index.cjs';
|
|
4
|
+
export { AggregateOperation, AggregateWindow, CaptureField, CaptureQuestion, CaptureQueue, CaptureQueueCounts, CaptureQueueOptions, CaptureQueuePorts, CaptureQueueStore, CaptureSyncReport, ChecklistRequirement, ChecklistRequirementKind, ChecklistRoleSpec, ChecklistStepSpec, ChecklistTrigger, ChecklistTriggerKind, ChoiceOption, CustomFieldTableType, DashboardBlockKind, DashboardBlockResult, DocSignatureCheck, EnrichAlternate, EnrichSource, Enrichment, EntityFieldValue, EntityRecordMatch, HistoryActor, HistoryActorKind, HistoryChange, Home, ImportColumnPlan, ImportOutcome, ImportProposal, MergeField, MergeFieldProvenance, MergeFieldResolution, MergeFieldTransform, MissingBehavior, PERMISSION_LEVELS, PIPELINE_RULE_KINDS, PermissionLevel, PipelineMissingField, PipelineRule, PipelineRuleKind, PipelineStage, PortalPrincipal, PortalTableExposure, QueuedCapture, QueuedCaptureFile, QueuedCaptureState, QuietHours, REFUSALS_WORTH_REPEATING, RecordComment, RecordScopeComment, RecordScopeField, RecordScopeHistoryEntry, RecordScopeRelation, RecordScopeWithheld, RecordsActor, RecordsErrorSink, RecordsFilter, RecordsRealtimePort, RecordsResolverPort, RecordsResponse, RecordsTableQuery, RegisteredTable, Relation, RelationCarries, RelationProperties, RelationTarget, ResolutionTriple, Rule, RuleAnswer, RuleExpression, STAGE_RULE_ENFORCEMENT, STAGE_RULE_ON_FAIL, StageRuleWarning, SubscriptionBlock, SubscriptionCadence, WorkDueState, WorkInboxKind, WorkOrigin, WorkTemplateNode, WorkTemplateRelation, asPermissionLevel, atLeast, bookingPath, choiceSlug, choiceValuesOf, choicesOf, highestLevel, holdsARetiredChoice, indexedDbStore, isDecided, isTheChosen, looksLikeAnId, mayDrag, measureKey, memoryStore, mintClientKey, openCaptureQueue, optionKey, optionLabel, portalPath, publicFormPath, scopeChip } from '../index.cjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* DOOR-8. As-of on EITHER clock, and they are different questions:
|
|
@@ -246,13 +246,20 @@ interface RecordsClient {
|
|
|
246
246
|
record_id: Uuid;
|
|
247
247
|
to: string;
|
|
248
248
|
}): Promise<RecordsResult<PipelineVerdict>>;
|
|
249
|
-
/**
|
|
249
|
+
/**
|
|
250
|
+
* Move a record to a stage. An ORDINARY record write, judged by the same Rules.
|
|
251
|
+
*
|
|
252
|
+
* It answers an OBJECT on every path. A gate whose `on_fail` is `require_approval`
|
|
253
|
+
* comes back `applied: false` with the wait it filed — the record has NOT moved, and a
|
|
254
|
+
* screen that treated the call's success as the move's success would show the card in
|
|
255
|
+
* the wrong column while somebody is still deciding.
|
|
256
|
+
*/
|
|
250
257
|
pipelineMove(args: {
|
|
251
258
|
record_id: Uuid;
|
|
252
259
|
to: string;
|
|
253
260
|
also?: Record<string, unknown>;
|
|
254
261
|
expected_version?: number | null;
|
|
255
|
-
}): Promise<RecordsResult<
|
|
262
|
+
}): Promise<RecordsResult<PipelineMoveResult>>;
|
|
256
263
|
/** Declare (or re-state) a pipeline: the stage column and its transition Rules. */
|
|
257
264
|
pipelineDeclare(args: {
|
|
258
265
|
table_id: Uuid;
|
|
@@ -262,6 +269,39 @@ interface RecordsClient {
|
|
|
262
269
|
tableStageField(args: {
|
|
263
270
|
table_id: Uuid;
|
|
264
271
|
}): Promise<RecordsResult<string | null>>;
|
|
272
|
+
/** The closed list of what a gate does when it says no — the store is the authority. */
|
|
273
|
+
stageRuleOnFailKinds(): Promise<RecordsResult<{
|
|
274
|
+
behaviour: StageRuleOnFail;
|
|
275
|
+
note: string;
|
|
276
|
+
}[]>>;
|
|
277
|
+
/** Whether this organization's gates refuse or warn. One opinion, asked once. */
|
|
278
|
+
stageRuleEnforcement(): Promise<RecordsResult<StageRuleEnforcement>>;
|
|
279
|
+
/** What is waiting on this card: approvals filed against its own stage column. */
|
|
280
|
+
recordStagePending(args: {
|
|
281
|
+
record_id: Uuid;
|
|
282
|
+
}): Promise<RecordsResult<StagePending[]>>;
|
|
283
|
+
/** The same question for a whole board, in ONE call — what a Kanban badges cards from. */
|
|
284
|
+
pipelinePending(args: {
|
|
285
|
+
table_id: Uuid;
|
|
286
|
+
}): Promise<RecordsResult<StagePendingOnBoard[]>>;
|
|
287
|
+
/**
|
|
288
|
+
* WHAT THIS GATE WOULD DO TO THIS BOARD TODAY — for a gate that has not been saved.
|
|
289
|
+
*
|
|
290
|
+
* The settings screen calls it on every edit of the condition, which is why it takes
|
|
291
|
+
* the gate rather than a rule id: no saved-rule door can answer about a rule that does
|
|
292
|
+
* not exist yet. The store compiles it with the same compiler `pipelineDeclare` uses,
|
|
293
|
+
* so the number here and the refusal at the door are the same rule — a preview with its
|
|
294
|
+
* own compiler would be wrong exactly at the edge of the condition, which is the only
|
|
295
|
+
* place anybody looks.
|
|
296
|
+
*
|
|
297
|
+
* A gate that does not say what it demands is REFUSED, not answered zero: "no cards
|
|
298
|
+
* would be stopped" beside a half-written rule is the sentence that gets it saved.
|
|
299
|
+
*/
|
|
300
|
+
pipelineGatePreview(args: {
|
|
301
|
+
table_id: Uuid;
|
|
302
|
+
stage: string;
|
|
303
|
+
gate: PipelineGate | Record<string, unknown>;
|
|
304
|
+
}): Promise<RecordsResult<PipelineGatePreview>>;
|
|
265
305
|
ruleMembers(args: {
|
|
266
306
|
rule_id: Uuid;
|
|
267
307
|
}): Promise<RecordsResult<StoredRecord[]>>;
|
|
@@ -1270,6 +1310,11 @@ declare const DOORS: {
|
|
|
1270
1310
|
readonly pipelineTransitionRefusal: "pipeline_transition_refusal";
|
|
1271
1311
|
readonly pipelineMove: "pipeline_move";
|
|
1272
1312
|
readonly tableStageField: "table_stage_field";
|
|
1313
|
+
readonly stageRuleOnFailKinds: "stage_rule_on_fail_kinds";
|
|
1314
|
+
readonly stageRuleEnforcement: "stage_rule_enforcement";
|
|
1315
|
+
readonly recordStagePending: "record_stage_pending";
|
|
1316
|
+
readonly pipelinePending: "pipeline_pending";
|
|
1317
|
+
readonly pipelineGatePreview: "pipeline_gate_preview";
|
|
1273
1318
|
readonly ruleMembers: "rule_members";
|
|
1274
1319
|
readonly ruleMembership: "rule_membership";
|
|
1275
1320
|
readonly ruleRun: "rule_run";
|
|
@@ -1522,4 +1567,4 @@ declare function parseCsv(text: string): string[][];
|
|
|
1522
1567
|
declare function importCsv(text: string): ParsedImport;
|
|
1523
1568
|
declare function importXlsx(bytes: ArrayBuffer | Uint8Array): Promise<ParsedImport>;
|
|
1524
1569
|
|
|
1525
|
-
export { AggregateBucket, AggregateFilter, AggregateMeasure, AggregateRow, AnonTokenBinding, type AsOf, BookingSummary, CaptureFileRef, CaptureOutcome, CaptureSheetFace, CaptureSheetSummary, ChecklistDeclared, ChecklistRunStarted, ChecklistRunStep, ChecklistRunSummary, ChecklistSpec, ChecklistStepCompleted, ChecklistTemplateShape, ChecklistTemplateSummary, CommentThreadRead, CommentWritten, ConversationScope, ConversationScopeContext, DEFAULT_DOCUMENT_MAX_BYTES, DEFAULT_PAGE_SIZE, DEFAULT_VALUE_MAX_BYTES, DOORS, DashboardBlock, DashboardRunResult, DashboardSummary, DigestPreview, DocRenderRow, DocSignatureRow, DocTemplateRow, DocToken, DocUnresolvedToken, type DoorKey, EnrichCell, EnrichDeclared, EnrichDueRow, EnrichRun, EnrichmentSummary, EntityFieldRights, EntityRecordRead, EntityRecordsFound, EntityTableFacts, type ExportRow, ExternalPrincipalCard, Field, FieldHistoryEntry, FieldPatch, FieldProposal, FormSummary, ImportBatchResult, ImportFinished, ImportOpened, ImportPlan, ImportPolicy, ImportReport, ImportRun, InboundAddress, InboundDeclared, MAPPED_SQLSTATES, type MirrorLimits, MyLevel, MySubscription, NewEntityFieldDeclaration, NewFieldDeclaration, type ParsedImport, PgError, Pipeline, PipelineColumn, PipelineDeclared, PipelineSpec, PipelineVerdict, PortalCard, PortalInvitation, PortalPreviewRow, PortalRevocation, PortalSummary, PredictedRefusal, type PromotedPredicate, PublishBinding, type QueryPlan, ReadRow, ReadValue, RecordDocument, RecordHistoryEntry, type RecordQuery, RecordRead, RecordRevision, RecordScopeContext, type RecordsClient, RecordsConfig, RecordsDataSource, RecordsError, RecordsResult, RelationCoordinate, ResolvedPublishBinding, RestorePreview, RestoreResult, StaleWriteDetail, StoredRecord, StuckRow, Subscription, SubscriptionSpec, type SupabaseLike, Table, TableCapacity, TableProposal, Timestamp, Uuid, WorkApprovalDecision, WorkApprovalFiled, WorkApprover, WorkAssignment, WorkAssignmentField, WorkChange, WorkGraph, WorkInboxItem, WorkInstantiation, WorkListFlavour, WorkListItem, WorkRecordState, WorkSlotHold, WorkState, WorkTurn, WriteConflict, asWriteConflict, cellText, createRecordsClient, doorAbsent, doorCensus, doorExists, exportCsv, exportXlsx, importCsv, importXlsx, intersectIds, mapPgError, parseCsv, planQuery, predictEnvelopeRefusal, predictSizeRefusal, predictValueRefusals, predictWriteRefusals, staleWriteDetail, supabaseDataSource, toAoa };
|
|
1570
|
+
export { AggregateBucket, AggregateFilter, AggregateMeasure, AggregateRow, AnonTokenBinding, type AsOf, BookingSummary, CaptureFileRef, CaptureOutcome, CaptureSheetFace, CaptureSheetSummary, ChecklistDeclared, ChecklistRunStarted, ChecklistRunStep, ChecklistRunSummary, ChecklistSpec, ChecklistStepCompleted, ChecklistTemplateShape, ChecklistTemplateSummary, CommentThreadRead, CommentWritten, ConversationScope, ConversationScopeContext, DEFAULT_DOCUMENT_MAX_BYTES, DEFAULT_PAGE_SIZE, DEFAULT_VALUE_MAX_BYTES, DOORS, DashboardBlock, DashboardRunResult, DashboardSummary, DigestPreview, DocRenderRow, DocSignatureRow, DocTemplateRow, DocToken, DocUnresolvedToken, type DoorKey, EnrichCell, EnrichDeclared, EnrichDueRow, EnrichRun, EnrichmentSummary, EntityFieldRights, EntityRecordRead, EntityRecordsFound, EntityTableFacts, type ExportRow, ExternalPrincipalCard, Field, FieldHistoryEntry, FieldPatch, FieldProposal, FormSummary, ImportBatchResult, ImportFinished, ImportOpened, ImportPlan, ImportPolicy, ImportReport, ImportRun, InboundAddress, InboundDeclared, MAPPED_SQLSTATES, type MirrorLimits, MyLevel, MySubscription, NewEntityFieldDeclaration, NewFieldDeclaration, type ParsedImport, PgError, Pipeline, PipelineColumn, PipelineDeclared, PipelineGate, PipelineGatePreview, PipelineMoveResult, PipelineSpec, PipelineVerdict, PortalCard, PortalInvitation, PortalPreviewRow, PortalRevocation, PortalSummary, PredictedRefusal, type PromotedPredicate, PublishBinding, type QueryPlan, ReadRow, ReadValue, RecordDocument, RecordHistoryEntry, type RecordQuery, RecordRead, RecordRevision, RecordScopeContext, type RecordsClient, RecordsConfig, RecordsDataSource, RecordsError, RecordsResult, RelationCoordinate, ResolvedPublishBinding, RestorePreview, RestoreResult, StagePending, StagePendingOnBoard, StageRuleEnforcement, StageRuleOnFail, StaleWriteDetail, StoredRecord, StuckRow, Subscription, SubscriptionSpec, type SupabaseLike, Table, TableCapacity, TableProposal, Timestamp, Uuid, WorkApprovalDecision, WorkApprovalFiled, WorkApprover, WorkAssignment, WorkAssignmentField, WorkChange, WorkGraph, WorkInboxItem, WorkInstantiation, WorkListFlavour, WorkListItem, WorkRecordState, WorkSlotHold, WorkState, WorkTurn, WriteConflict, asWriteConflict, cellText, createRecordsClient, doorAbsent, doorCensus, doorExists, exportCsv, exportXlsx, importCsv, importXlsx, intersectIds, mapPgError, parseCsv, planQuery, predictEnvelopeRefusal, predictSizeRefusal, predictValueRefusals, predictWriteRefusals, staleWriteDetail, supabaseDataSource, toAoa };
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { g as Timestamp, U as Uuid, h as RecordDocument, i as
|
|
2
|
-
export { A as ABSENCE_REASONS,
|
|
3
|
-
import { RelationCoordinate, RecordsConfig,
|
|
4
|
-
export { AggregateOperation, AggregateWindow, CaptureField, CaptureQuestion, CaptureQueue, CaptureQueueCounts, CaptureQueueOptions, CaptureQueuePorts, CaptureQueueStore, CaptureSyncReport, ChecklistRequirement, ChecklistRequirementKind, ChecklistRoleSpec, ChecklistStepSpec, ChecklistTrigger, ChecklistTriggerKind, ChoiceOption, CustomFieldTableType, DashboardBlockKind, DashboardBlockResult, DocSignatureCheck, EnrichAlternate, EnrichSource, Enrichment, EntityFieldValue, EntityRecordMatch,
|
|
1
|
+
import { g as Timestamp, U as Uuid, h as RecordDocument, i as RecordsResult, j as RecordRead, k as ReadRow, l as Field, m as StoredRecord, N as NewFieldDeclaration, n as FieldPatch, o as RecordRevision, p as ReadValue, q as FieldProposal, r as TableProposal, s as RecordsError, W as WriteConflict, P as PgError, t as StaleWriteDetail, u as PredictedRefusal } from '../field-CWBdZfFv.js';
|
|
2
|
+
export { A as ABSENCE_REASONS, v as ACTOR_VOCABULARY, w as AbsenceReason, x as Actor, y as COMPUTE_ON, z as CONTEXT_POLICIES, C as ComputeOn, e as ContextPolicy, D as DELIVERIES, B as Delivery, E as ENTITY_TOKENS, G as EntityToken, H as FIELD_SENSITIVITIES, I as FIELD_SOURCES, J as FRESHNESS, K as FieldBehavior, c as FieldRule, d as FieldSensitivity, b as FieldSource, F as FieldTypeWord, L as ForbiddenEnvelopeWord, M as Freshness, 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, $ as MergeFieldModifier, a0 as MergeFieldSemanticType, a1 as MergeFieldSource, a2 as ON_DELETE, a3 as OVERRIDE_POLICIES, O as OnDelete, a4 as OverridePolicy, a5 as PARITY_FIELD_TYPES, a6 as PER_VALUE_ACCESS_WORDS, a7 as ParityFieldType, a8 as ParityFieldTypeDescriptor, a9 as PerValueAccessWord, 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, ah as RecordsErrorCode, ai as RelationBinding, f as RelationCardinality, R as RelationFlavor, aj as RetiredActorWord, ak as RuleNodeKind, al as RuleUse, am as STORAGE_MODES, an as STORE_DOORS, ao as STORE_KNOBS, ap as STORE_REFUSAL_CODES, S as StorageMode, aq as StoreDoorName, ar as StoreRefusalCode, as as TABLE_DISPLAYS, at as TABLE_ORIGINS, au as TABLE_TYPES, a as TableDisplay, av as TableOrigin, T as TableType, 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, aD as err, aE as isRecordsErr, aF as ok } from '../field-CWBdZfFv.js';
|
|
3
|
+
import { RelationCoordinate, RecordsConfig, Table, TableCapacity, EntityTableFacts, NewEntityFieldDeclaration, EntityFieldRights, EntityRecordRead, EntityRecordsFound, Pipeline, PipelineColumn, PipelineVerdict, PipelineMoveResult, PipelineSpec, PipelineDeclared, StageRuleOnFail, StageRuleEnforcement, StagePending, StagePendingOnBoard, PipelineGate, PipelineGatePreview, FormSummary, BookingSummary, ImportPlan, ImportPolicy, ImportOpened, ImportBatchResult, ImportFinished, ImportReport, ImportRun, InboundDeclared, InboundAddress, PortalSummary, PortalCard, PortalInvitation, PortalRevocation, PortalPreviewRow, DashboardSummary, DashboardBlock, AggregateFilter, DashboardRunResult, StuckRow, CaptureSheetSummary, CaptureSheetFace, CaptureFileRef, CaptureOutcome, EnrichmentSummary, EnrichDeclared, EnrichDueRow, EnrichCell, EnrichRun, AggregateMeasure, AggregateBucket, AggregateRow, Subscription, MySubscription, SubscriptionSpec, DigestPreview, DocToken, DocUnresolvedToken, DocTemplateRow, DocRenderRow, DocSignatureRow, RecordHistoryEntry, RecordScopeContext, ConversationScope, ConversationScopeContext, FieldHistoryEntry, RestorePreview, RestoreResult, CommentThreadRead, CommentWritten, AnonTokenBinding, ChecklistSpec, ChecklistDeclared, ChecklistTemplateSummary, ChecklistTemplateShape, ChecklistRunStarted, ChecklistRunStep, ChecklistRunSummary, ChecklistStepCompleted, WorkState, WorkGraph, WorkInstantiation, WorkTurn, WorkAssignmentField, WorkSlotHold, WorkInboxItem, WorkListFlavour, WorkListItem, WorkAssignment, WorkRecordState, WorkApprover, WorkChange, WorkApprovalFiled, WorkApprovalDecision, ExternalPrincipalCard, PublishBinding, ResolvedPublishBinding, MyLevel, RecordsDataSource } from '../index.js';
|
|
4
|
+
export { AggregateOperation, AggregateWindow, CaptureField, CaptureQuestion, CaptureQueue, CaptureQueueCounts, CaptureQueueOptions, CaptureQueuePorts, CaptureQueueStore, CaptureSyncReport, ChecklistRequirement, ChecklistRequirementKind, ChecklistRoleSpec, ChecklistStepSpec, ChecklistTrigger, ChecklistTriggerKind, ChoiceOption, CustomFieldTableType, DashboardBlockKind, DashboardBlockResult, DocSignatureCheck, EnrichAlternate, EnrichSource, Enrichment, EntityFieldValue, EntityRecordMatch, HistoryActor, HistoryActorKind, HistoryChange, Home, ImportColumnPlan, ImportOutcome, ImportProposal, MergeField, MergeFieldProvenance, MergeFieldResolution, MergeFieldTransform, MissingBehavior, PERMISSION_LEVELS, PIPELINE_RULE_KINDS, PermissionLevel, PipelineMissingField, PipelineRule, PipelineRuleKind, PipelineStage, PortalPrincipal, PortalTableExposure, QueuedCapture, QueuedCaptureFile, QueuedCaptureState, QuietHours, REFUSALS_WORTH_REPEATING, RecordComment, RecordScopeComment, RecordScopeField, RecordScopeHistoryEntry, RecordScopeRelation, RecordScopeWithheld, RecordsActor, RecordsErrorSink, RecordsFilter, RecordsRealtimePort, RecordsResolverPort, RecordsResponse, RecordsTableQuery, RegisteredTable, Relation, RelationCarries, RelationProperties, RelationTarget, ResolutionTriple, Rule, RuleAnswer, RuleExpression, STAGE_RULE_ENFORCEMENT, STAGE_RULE_ON_FAIL, StageRuleWarning, SubscriptionBlock, SubscriptionCadence, WorkDueState, WorkInboxKind, WorkOrigin, WorkTemplateNode, WorkTemplateRelation, asPermissionLevel, atLeast, bookingPath, choiceSlug, choiceValuesOf, choicesOf, highestLevel, holdsARetiredChoice, indexedDbStore, isDecided, isTheChosen, looksLikeAnId, mayDrag, measureKey, memoryStore, mintClientKey, openCaptureQueue, optionKey, optionLabel, portalPath, publicFormPath, scopeChip } from '../index.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* DOOR-8. As-of on EITHER clock, and they are different questions:
|
|
@@ -246,13 +246,20 @@ interface RecordsClient {
|
|
|
246
246
|
record_id: Uuid;
|
|
247
247
|
to: string;
|
|
248
248
|
}): Promise<RecordsResult<PipelineVerdict>>;
|
|
249
|
-
/**
|
|
249
|
+
/**
|
|
250
|
+
* Move a record to a stage. An ORDINARY record write, judged by the same Rules.
|
|
251
|
+
*
|
|
252
|
+
* It answers an OBJECT on every path. A gate whose `on_fail` is `require_approval`
|
|
253
|
+
* comes back `applied: false` with the wait it filed — the record has NOT moved, and a
|
|
254
|
+
* screen that treated the call's success as the move's success would show the card in
|
|
255
|
+
* the wrong column while somebody is still deciding.
|
|
256
|
+
*/
|
|
250
257
|
pipelineMove(args: {
|
|
251
258
|
record_id: Uuid;
|
|
252
259
|
to: string;
|
|
253
260
|
also?: Record<string, unknown>;
|
|
254
261
|
expected_version?: number | null;
|
|
255
|
-
}): Promise<RecordsResult<
|
|
262
|
+
}): Promise<RecordsResult<PipelineMoveResult>>;
|
|
256
263
|
/** Declare (or re-state) a pipeline: the stage column and its transition Rules. */
|
|
257
264
|
pipelineDeclare(args: {
|
|
258
265
|
table_id: Uuid;
|
|
@@ -262,6 +269,39 @@ interface RecordsClient {
|
|
|
262
269
|
tableStageField(args: {
|
|
263
270
|
table_id: Uuid;
|
|
264
271
|
}): Promise<RecordsResult<string | null>>;
|
|
272
|
+
/** The closed list of what a gate does when it says no — the store is the authority. */
|
|
273
|
+
stageRuleOnFailKinds(): Promise<RecordsResult<{
|
|
274
|
+
behaviour: StageRuleOnFail;
|
|
275
|
+
note: string;
|
|
276
|
+
}[]>>;
|
|
277
|
+
/** Whether this organization's gates refuse or warn. One opinion, asked once. */
|
|
278
|
+
stageRuleEnforcement(): Promise<RecordsResult<StageRuleEnforcement>>;
|
|
279
|
+
/** What is waiting on this card: approvals filed against its own stage column. */
|
|
280
|
+
recordStagePending(args: {
|
|
281
|
+
record_id: Uuid;
|
|
282
|
+
}): Promise<RecordsResult<StagePending[]>>;
|
|
283
|
+
/** The same question for a whole board, in ONE call — what a Kanban badges cards from. */
|
|
284
|
+
pipelinePending(args: {
|
|
285
|
+
table_id: Uuid;
|
|
286
|
+
}): Promise<RecordsResult<StagePendingOnBoard[]>>;
|
|
287
|
+
/**
|
|
288
|
+
* WHAT THIS GATE WOULD DO TO THIS BOARD TODAY — for a gate that has not been saved.
|
|
289
|
+
*
|
|
290
|
+
* The settings screen calls it on every edit of the condition, which is why it takes
|
|
291
|
+
* the gate rather than a rule id: no saved-rule door can answer about a rule that does
|
|
292
|
+
* not exist yet. The store compiles it with the same compiler `pipelineDeclare` uses,
|
|
293
|
+
* so the number here and the refusal at the door are the same rule — a preview with its
|
|
294
|
+
* own compiler would be wrong exactly at the edge of the condition, which is the only
|
|
295
|
+
* place anybody looks.
|
|
296
|
+
*
|
|
297
|
+
* A gate that does not say what it demands is REFUSED, not answered zero: "no cards
|
|
298
|
+
* would be stopped" beside a half-written rule is the sentence that gets it saved.
|
|
299
|
+
*/
|
|
300
|
+
pipelineGatePreview(args: {
|
|
301
|
+
table_id: Uuid;
|
|
302
|
+
stage: string;
|
|
303
|
+
gate: PipelineGate | Record<string, unknown>;
|
|
304
|
+
}): Promise<RecordsResult<PipelineGatePreview>>;
|
|
265
305
|
ruleMembers(args: {
|
|
266
306
|
rule_id: Uuid;
|
|
267
307
|
}): Promise<RecordsResult<StoredRecord[]>>;
|
|
@@ -1270,6 +1310,11 @@ declare const DOORS: {
|
|
|
1270
1310
|
readonly pipelineTransitionRefusal: "pipeline_transition_refusal";
|
|
1271
1311
|
readonly pipelineMove: "pipeline_move";
|
|
1272
1312
|
readonly tableStageField: "table_stage_field";
|
|
1313
|
+
readonly stageRuleOnFailKinds: "stage_rule_on_fail_kinds";
|
|
1314
|
+
readonly stageRuleEnforcement: "stage_rule_enforcement";
|
|
1315
|
+
readonly recordStagePending: "record_stage_pending";
|
|
1316
|
+
readonly pipelinePending: "pipeline_pending";
|
|
1317
|
+
readonly pipelineGatePreview: "pipeline_gate_preview";
|
|
1273
1318
|
readonly ruleMembers: "rule_members";
|
|
1274
1319
|
readonly ruleMembership: "rule_membership";
|
|
1275
1320
|
readonly ruleRun: "rule_run";
|
|
@@ -1522,4 +1567,4 @@ declare function parseCsv(text: string): string[][];
|
|
|
1522
1567
|
declare function importCsv(text: string): ParsedImport;
|
|
1523
1568
|
declare function importXlsx(bytes: ArrayBuffer | Uint8Array): Promise<ParsedImport>;
|
|
1524
1569
|
|
|
1525
|
-
export { AggregateBucket, AggregateFilter, AggregateMeasure, AggregateRow, AnonTokenBinding, type AsOf, BookingSummary, CaptureFileRef, CaptureOutcome, CaptureSheetFace, CaptureSheetSummary, ChecklistDeclared, ChecklistRunStarted, ChecklistRunStep, ChecklistRunSummary, ChecklistSpec, ChecklistStepCompleted, ChecklistTemplateShape, ChecklistTemplateSummary, CommentThreadRead, CommentWritten, ConversationScope, ConversationScopeContext, DEFAULT_DOCUMENT_MAX_BYTES, DEFAULT_PAGE_SIZE, DEFAULT_VALUE_MAX_BYTES, DOORS, DashboardBlock, DashboardRunResult, DashboardSummary, DigestPreview, DocRenderRow, DocSignatureRow, DocTemplateRow, DocToken, DocUnresolvedToken, type DoorKey, EnrichCell, EnrichDeclared, EnrichDueRow, EnrichRun, EnrichmentSummary, EntityFieldRights, EntityRecordRead, EntityRecordsFound, EntityTableFacts, type ExportRow, ExternalPrincipalCard, Field, FieldHistoryEntry, FieldPatch, FieldProposal, FormSummary, ImportBatchResult, ImportFinished, ImportOpened, ImportPlan, ImportPolicy, ImportReport, ImportRun, InboundAddress, InboundDeclared, MAPPED_SQLSTATES, type MirrorLimits, MyLevel, MySubscription, NewEntityFieldDeclaration, NewFieldDeclaration, type ParsedImport, PgError, Pipeline, PipelineColumn, PipelineDeclared, PipelineSpec, PipelineVerdict, PortalCard, PortalInvitation, PortalPreviewRow, PortalRevocation, PortalSummary, PredictedRefusal, type PromotedPredicate, PublishBinding, type QueryPlan, ReadRow, ReadValue, RecordDocument, RecordHistoryEntry, type RecordQuery, RecordRead, RecordRevision, RecordScopeContext, type RecordsClient, RecordsConfig, RecordsDataSource, RecordsError, RecordsResult, RelationCoordinate, ResolvedPublishBinding, RestorePreview, RestoreResult, StaleWriteDetail, StoredRecord, StuckRow, Subscription, SubscriptionSpec, type SupabaseLike, Table, TableCapacity, TableProposal, Timestamp, Uuid, WorkApprovalDecision, WorkApprovalFiled, WorkApprover, WorkAssignment, WorkAssignmentField, WorkChange, WorkGraph, WorkInboxItem, WorkInstantiation, WorkListFlavour, WorkListItem, WorkRecordState, WorkSlotHold, WorkState, WorkTurn, WriteConflict, asWriteConflict, cellText, createRecordsClient, doorAbsent, doorCensus, doorExists, exportCsv, exportXlsx, importCsv, importXlsx, intersectIds, mapPgError, parseCsv, planQuery, predictEnvelopeRefusal, predictSizeRefusal, predictValueRefusals, predictWriteRefusals, staleWriteDetail, supabaseDataSource, toAoa };
|
|
1570
|
+
export { AggregateBucket, AggregateFilter, AggregateMeasure, AggregateRow, AnonTokenBinding, type AsOf, BookingSummary, CaptureFileRef, CaptureOutcome, CaptureSheetFace, CaptureSheetSummary, ChecklistDeclared, ChecklistRunStarted, ChecklistRunStep, ChecklistRunSummary, ChecklistSpec, ChecklistStepCompleted, ChecklistTemplateShape, ChecklistTemplateSummary, CommentThreadRead, CommentWritten, ConversationScope, ConversationScopeContext, DEFAULT_DOCUMENT_MAX_BYTES, DEFAULT_PAGE_SIZE, DEFAULT_VALUE_MAX_BYTES, DOORS, DashboardBlock, DashboardRunResult, DashboardSummary, DigestPreview, DocRenderRow, DocSignatureRow, DocTemplateRow, DocToken, DocUnresolvedToken, type DoorKey, EnrichCell, EnrichDeclared, EnrichDueRow, EnrichRun, EnrichmentSummary, EntityFieldRights, EntityRecordRead, EntityRecordsFound, EntityTableFacts, type ExportRow, ExternalPrincipalCard, Field, FieldHistoryEntry, FieldPatch, FieldProposal, FormSummary, ImportBatchResult, ImportFinished, ImportOpened, ImportPlan, ImportPolicy, ImportReport, ImportRun, InboundAddress, InboundDeclared, MAPPED_SQLSTATES, type MirrorLimits, MyLevel, MySubscription, NewEntityFieldDeclaration, NewFieldDeclaration, type ParsedImport, PgError, Pipeline, PipelineColumn, PipelineDeclared, PipelineGate, PipelineGatePreview, PipelineMoveResult, PipelineSpec, PipelineVerdict, PortalCard, PortalInvitation, PortalPreviewRow, PortalRevocation, PortalSummary, PredictedRefusal, type PromotedPredicate, PublishBinding, type QueryPlan, ReadRow, ReadValue, RecordDocument, RecordHistoryEntry, type RecordQuery, RecordRead, RecordRevision, RecordScopeContext, type RecordsClient, RecordsConfig, RecordsDataSource, RecordsError, RecordsResult, RelationCoordinate, ResolvedPublishBinding, RestorePreview, RestoreResult, StagePending, StagePendingOnBoard, StageRuleEnforcement, StageRuleOnFail, StaleWriteDetail, StoredRecord, StuckRow, Subscription, SubscriptionSpec, type SupabaseLike, Table, TableCapacity, TableProposal, Timestamp, Uuid, WorkApprovalDecision, WorkApprovalFiled, WorkApprover, WorkAssignment, WorkAssignmentField, WorkChange, WorkGraph, WorkInboxItem, WorkInstantiation, WorkListFlavour, WorkListItem, WorkRecordState, WorkSlotHold, WorkState, WorkTurn, WriteConflict, asWriteConflict, cellText, createRecordsClient, doorAbsent, doorCensus, doorExists, exportCsv, exportXlsx, importCsv, importXlsx, intersectIds, mapPgError, parseCsv, planQuery, predictEnvelopeRefusal, predictSizeRefusal, predictValueRefusals, predictWriteRefusals, staleWriteDetail, supabaseDataSource, toAoa };
|
package/dist/core/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
|
}
|
|
@@ -445,6 +447,7 @@ var RULE_USES = ["validate", "compute", "membership", "applicability"];
|
|
|
445
447
|
var PER_VALUE_ACCESS_WORDS = ["visibility", "access", "share", "acl", "permission", "permissions", "secret"];
|
|
446
448
|
var PARITY_FIELD_TYPES = [
|
|
447
449
|
{ parity_type: "attachment", behavior: "relation", made_of: "REC-31: a File record reached through a relation, target the kernel `File` Table" },
|
|
450
|
+
{ parity_type: "checkbox", behavior: "boolean", made_of: "a ticked or unticked answer, stored as a REAL boolean \u2014 and a record that never answered holds neither, so filters and group-by see three states, not two" },
|
|
448
451
|
{ parity_type: "currency", behavior: "range", made_of: "FLD-N-1: a number whose UNIT is the currency and whose format is currency \u2014 on the Field, never in presentation" },
|
|
449
452
|
{ parity_type: "datetime", behavior: "range", made_of: "a range of kind date or datetime \u2014 the dated modifier says the VALUES are dated, which is a different question" },
|
|
450
453
|
{ parity_type: "email", behavior: "text", made_of: "text whose format is email" },
|
|
@@ -481,6 +484,7 @@ var RULE_NODE_KINDS = [
|
|
|
481
484
|
{ node: "parent_field", evaluated_by: "W1-RULE-APPLY" },
|
|
482
485
|
{ node: "present", evaluated_by: "W1-RULE" },
|
|
483
486
|
{ node: "previous", evaluated_by: "PIPELINES" },
|
|
487
|
+
{ node: "sibling_count", evaluated_by: "STAGE-RULES" },
|
|
484
488
|
{ node: "stage_count", evaluated_by: "PIPELINES" },
|
|
485
489
|
{ node: "sub", evaluated_by: "W1-RULE" }
|
|
486
490
|
];
|
|
@@ -499,6 +503,8 @@ var STORE_DOORS = [
|
|
|
499
503
|
{ name: "absence_reasons", args: "", returns: "text[]", security: "invoker" },
|
|
500
504
|
{ name: "actor_vocabulary", args: "", returns: "text[]", security: "invoker" },
|
|
501
505
|
{ name: "actor_word", args: "p_declared text", returns: "text", security: "invoker" },
|
|
506
|
+
{ name: "addressed_cap", args: "p_user_id uuid, p_type text, p_id uuid, p_organization_id uuid DEFAULT NULL::uuid, p_table_id uuid DEFAULT NULL::uuid", returns: "permission_level", security: "definer" },
|
|
507
|
+
{ name: "addressed_cap_specific", args: "p_user_id uuid, p_type text, p_id uuid, p_organization_id uuid DEFAULT NULL::uuid, p_table_id uuid DEFAULT NULL::uuid", returns: "permission_level", security: "definer" },
|
|
502
508
|
{ name: "agent_change_approval", args: "p_organization uuid, p_conversation uuid DEFAULT NULL::uuid, p_table uuid DEFAULT NULL::uuid", returns: "jsonb", security: "definer" },
|
|
503
509
|
{ name: "agent_context", args: "p_organization_id uuid, p_table_id uuid, p_limit integer DEFAULT 50", returns: "jsonb", security: "invoker" },
|
|
504
510
|
{ name: "agent_table_claim", args: "p_organization uuid, p_table uuid, p_conversation uuid DEFAULT NULL::uuid", returns: "void", security: "definer" },
|
|
@@ -672,7 +678,7 @@ var STORE_DOORS = [
|
|
|
672
678
|
{ 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" },
|
|
673
679
|
{ 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" },
|
|
674
680
|
{ name: "entity_value_write", args: "p_organization_id uuid, p_token text, p_record_id uuid, p_patch jsonb", returns: "jsonb", security: "invoker" },
|
|
675
|
-
{ name: "export_ceiling", args: "p_organization_id uuid DEFAULT NULL::uuid", returns: "integer", security: "
|
|
681
|
+
{ name: "export_ceiling", args: "p_organization_id uuid DEFAULT NULL::uuid", returns: "integer", security: "invoker" },
|
|
676
682
|
{ 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" },
|
|
677
683
|
{ name: "external_foreign_table_findings", args: "", returns: "SETOF text", security: "definer" },
|
|
678
684
|
{ name: "external_history_event", args: "p_organization_id uuid, p_link_id uuid, p_operation text", returns: "bigint", security: "definer" },
|
|
@@ -752,6 +758,9 @@ var STORE_DOORS = [
|
|
|
752
758
|
{ name: "io_proposal_reject", args: "p_organization_id uuid, p_import_id uuid, p_column text", returns: "boolean", security: "definer" },
|
|
753
759
|
{ name: "io_proposal_spec", args: "p_proposal jsonb", returns: "jsonb", security: "invoker" },
|
|
754
760
|
{ name: "io_record_changed", args: "", returns: "trigger", security: "definer" },
|
|
761
|
+
{ name: "io_record_changed_stmt_delete", args: "", returns: "trigger", security: "definer" },
|
|
762
|
+
{ name: "io_record_changed_stmt_insert", args: "", returns: "trigger", security: "definer" },
|
|
763
|
+
{ name: "io_record_changed_stmt_update", args: "", returns: "trigger", security: "definer" },
|
|
755
764
|
{ name: "io_relation_candidate", args: "p_organization_id uuid, p_table_id uuid, p_words text[]", returns: "uuid", security: "invoker" },
|
|
756
765
|
{ name: "io_restore", args: "p_organization_id uuid, p_record_id uuid, p_version integer", returns: "integer", security: "definer" },
|
|
757
766
|
{ name: "io_restore", args: "p_organization_id uuid, p_record_id uuid, p_version integer, p_author jsonb", returns: "integer", security: "definer" },
|
|
@@ -760,6 +769,8 @@ var STORE_DOORS = [
|
|
|
760
769
|
{ name: "io_value_shape", args: "p_envelope jsonb", returns: "jsonb", security: "invoker" },
|
|
761
770
|
{ name: "is_a_retirement", args: "p_old_deleted timestamp with time zone, p_new_deleted timestamp with time zone, p_old_data jsonb, p_new_data jsonb, p_old_table uuid, p_new_table uuid, p_old_org uuid, p_new_org uuid, p_old_class text, p_new_class text", returns: "boolean", security: "invoker" },
|
|
762
771
|
{ name: "ladder_replanners", args: "p_roots text[] DEFAULT ARRAY['custom.has_visibility'::text, 'custom.effective_level'::text, 'custom.reaches_directly'::text, 'custom.visible_set'::text]", returns: "TABLE(fn text, lang text, why text, remedy text)", security: "definer" },
|
|
772
|
+
{ name: "level_floor", args: "", returns: "permission_level", security: "definer" },
|
|
773
|
+
{ name: "levels_raised_by_a_less_specific_rung", args: "", returns: "TABLE(organization_id uuid, organization_name text, member_id uuid, member_email text, record_id uuid, addressed_level permission_level, answered_level permission_level)", security: "definer" },
|
|
763
774
|
{ name: "list_door_disagreements", args: "p_pretend text DEFAULT NULL::text, p_only_organization uuid DEFAULT NULL::uuid, p_sample integer DEFAULT 200", returns: "TABLE(organization_id uuid, organization_name text, member_id uuid, table_id uuid, record_id uuid, door text, why text)", security: "invoker" },
|
|
764
775
|
{ name: "list_door_disagreements", args: "p_pretend text, p_only_organization uuid, p_sample integer, p_exhaustive boolean", returns: "TABLE(organization_id uuid, organization_name text, member_id uuid, table_id uuid, record_id uuid, door text, why text)", security: "invoker" },
|
|
765
776
|
{ name: "lookup_value", args: "p_organization_id uuid, p_record_id uuid, p_field_data jsonb", returns: "jsonb", security: "invoker" },
|
|
@@ -790,9 +801,9 @@ var STORE_DOORS = [
|
|
|
790
801
|
{ 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" },
|
|
791
802
|
{ name: "owning_table", args: "p_organization_id uuid, p_record_id uuid", returns: "uuid", security: "invoker" },
|
|
792
803
|
{ name: "owning_table_gone", args: "p_organization_id uuid, p_record_id uuid", returns: "boolean", security: "invoker" },
|
|
793
|
-
{ name: "page_ceiling", args: "p_organization_id uuid DEFAULT NULL::uuid", returns: "integer", security: "
|
|
804
|
+
{ name: "page_ceiling", args: "p_organization_id uuid DEFAULT NULL::uuid", returns: "integer", security: "invoker" },
|
|
794
805
|
{ name: "page_contract", args: "p_organization_id uuid", returns: "jsonb", security: "definer" },
|
|
795
|
-
{ 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: "
|
|
806
|
+
{ 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: "invoker" },
|
|
796
807
|
{ name: "parity_field_types", args: "", returns: "TABLE(parity_type text, behavior text, made_of text)", security: "invoker" },
|
|
797
808
|
{ name: "parity_type", args: "p_field_data jsonb", returns: "text", security: "invoker" },
|
|
798
809
|
{ 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" },
|
|
@@ -801,7 +812,9 @@ var STORE_DOORS = [
|
|
|
801
812
|
{ name: "pin_agent_cells", args: "p_new jsonb, p_old jsonb, p_agent_keys text[]", returns: "jsonb", security: "invoker" },
|
|
802
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" },
|
|
803
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" },
|
|
804
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" },
|
|
805
818
|
{ name: "pipeline_read", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "definer" },
|
|
806
819
|
{ name: "pipeline_transition_refusal", args: "p_organization_id uuid, p_record_id uuid, p_to text", returns: "jsonb", security: "definer" },
|
|
807
820
|
{ name: "portal_admits", args: "p_organization_id uuid, p_user_id uuid DEFAULT NULL::uuid", returns: "boolean", security: "definer" },
|
|
@@ -868,6 +881,7 @@ var STORE_DOORS = [
|
|
|
868
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" },
|
|
869
882
|
{ name: "record_delete", args: "p_organization_id uuid, p_record_id uuid", returns: "timestamp with time zone", security: "definer" },
|
|
870
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" },
|
|
871
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" },
|
|
872
886
|
{ name: "record_reparent", args: "p_organization_id uuid, p_record_id uuid, p_parent_id uuid", returns: "void", security: "definer" },
|
|
873
887
|
{ name: "record_resolve", args: "p_organization_id uuid, p_id uuid", returns: "jsonb", security: "definer" },
|
|
@@ -876,12 +890,14 @@ var STORE_DOORS = [
|
|
|
876
890
|
{ name: "record_restore_version", args: "p_organization_id uuid, p_record_id uuid, p_version integer", returns: "jsonb", security: "definer" },
|
|
877
891
|
{ name: "record_restore_version", args: "p_organization_id uuid, p_record_id uuid, p_version integer, p_author jsonb", returns: "jsonb", security: "definer" },
|
|
878
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" },
|
|
879
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" },
|
|
880
895
|
{ name: "record_table", args: "p_organization_id uuid, p_record_id uuid", returns: "uuid", security: "definer" },
|
|
881
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" },
|
|
882
897
|
{ name: "record_values", args: "p_organization_id uuid, p_record_id uuid", returns: "jsonb", security: "invoker" },
|
|
883
898
|
{ name: "record_values_versioned", args: "p_organization_id uuid, p_record_id uuid", returns: "TABLE(field_key text, field_id uuid, value jsonb, value_version integer, source jsonb, absent_reason text, actor text, on_behalf_of text, written_at timestamp with time zone, alternates jsonb)", security: "definer" },
|
|
884
899
|
{ name: "record_write", args: "p_organization_id uuid, p_table_id uuid, p_data jsonb", returns: "uuid", security: "definer" },
|
|
900
|
+
{ name: "record_write_many", args: "p_organization_id uuid, p_table_id uuid, p_rows jsonb[], p_ids uuid[] DEFAULT NULL::uuid[]", returns: "uuid[]", security: "definer" },
|
|
885
901
|
{ name: "refusals_claiming_a_level_never_asked", args: "", returns: "TABLE(function_name text, identity_args text, why text)", security: "invoker" },
|
|
886
902
|
{ name: "relation_carry", args: "p_organization_id uuid, p_container_id uuid, p_item_id uuid", returns: "uuid", security: "definer" },
|
|
887
903
|
{ name: "relation_edges_withdraw", args: "p_organization_id uuid, p_field_ids uuid[], p_why text", returns: "integer", security: "definer" },
|
|
@@ -938,6 +954,8 @@ var STORE_DOORS = [
|
|
|
938
954
|
{ name: "size_refusal", args: "p_organization_id uuid, p_data jsonb", returns: "text", security: "invoker" },
|
|
939
955
|
{ name: "source_next_pointer", args: "p_sources jsonb", returns: "text", security: "invoker" },
|
|
940
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" },
|
|
941
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" },
|
|
942
960
|
{ name: "storage_modes", args: "", returns: "text[]", security: "invoker" },
|
|
943
961
|
{ name: "store_is_open", args: "p_organization_id uuid DEFAULT NULL::uuid", returns: "boolean", security: "invoker" },
|
|
@@ -948,6 +966,7 @@ var STORE_DOORS = [
|
|
|
948
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" },
|
|
949
967
|
{ name: "table_capacity", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "definer" },
|
|
950
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" },
|
|
951
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" },
|
|
952
971
|
{ name: "table_declare", args: "p_organization_id uuid, p_spec jsonb", returns: "uuid", security: "definer" },
|
|
953
972
|
{ name: "table_has_a_visible_record", args: "p_user uuid, p_organization_id uuid, p_table_id uuid", returns: "boolean", security: "definer" },
|
|
@@ -962,6 +981,7 @@ var STORE_DOORS = [
|
|
|
962
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" },
|
|
963
982
|
{ name: "tables_described_without_asking", args: "", returns: "TABLE(function_name text, identity_args text, why text)", security: "invoker" },
|
|
964
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" },
|
|
965
985
|
{ name: "validate_custom_fields", args: "p_token text, p_organization_id uuid, p_values jsonb", returns: "void", security: "invoker" },
|
|
966
986
|
{ name: "validate_value_envelope", args: "p_organization_id uuid, p_fields custom.record[], p_data jsonb", returns: "void", security: "invoker" },
|
|
967
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" },
|
|
@@ -973,6 +993,8 @@ var STORE_DOORS = [
|
|
|
973
993
|
{ name: "value_restore", args: "p_organization_id uuid, p_record_id uuid, p_field_key text, p_version integer", returns: "jsonb", security: "definer" },
|
|
974
994
|
{ name: "value_restore", args: "p_organization_id uuid, p_record_id uuid, p_field_key text, p_version integer, p_author jsonb", returns: "jsonb", security: "definer" },
|
|
975
995
|
{ name: "value_versions", args: "p_old jsonb, p_new jsonb", returns: "jsonb", security: "invoker" },
|
|
996
|
+
{ name: "view_declare", args: "p_organization_id uuid, p_table_id uuid, p_spec jsonb", returns: "uuid", security: "definer" },
|
|
997
|
+
{ name: "views", args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid", returns: "TABLE(view_id uuid, name text, table_id uuid, filters jsonb, definition jsonb, created_at timestamp with time zone)", security: "definer" },
|
|
976
998
|
{ name: "visibility_ancestors", args: "p_item_type text, p_item_id uuid", returns: "TABLE(container_type text, container_id uuid, depth integer, max_level permission_level)", security: "definer" },
|
|
977
999
|
{ name: "visibility_as_of", args: "p_organization_id uuid, p_record_id uuid, p_at timestamp with time zone", returns: "TABLE(principal_kind text, principal_id uuid, level permission_level, through_kind text, through_id uuid, reason text, replayed boolean, held_from timestamp with time zone, held_to timestamp with time zone)", security: "definer" },
|
|
978
1000
|
{ name: "visibility_cache_rebuild", args: "", returns: "integer", security: "definer" },
|
|
@@ -1060,6 +1082,7 @@ var STORE_KNOBS = [
|
|
|
1060
1082
|
{ key: "sandbox_message_bytes", value: "65536", type: "integer" },
|
|
1061
1083
|
{ key: "sandbox_org_components", value: "true", type: "boolean" },
|
|
1062
1084
|
{ key: "signup_provisioning_guard", value: "false", type: "boolean" },
|
|
1085
|
+
{ key: "stage_rule_enforcement", value: '"refuse"', type: "enum" },
|
|
1063
1086
|
{ key: "system_enabled", value: "false", type: "boolean" },
|
|
1064
1087
|
{ key: "table_record_ceiling", value: "150000", type: "integer" },
|
|
1065
1088
|
{ key: "value_max_bytes", value: "100000", type: "integer" },
|
|
@@ -1069,19 +1092,20 @@ var STORE_REFUSAL_CODES = [
|
|
|
1069
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" },
|
|
1070
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" },
|
|
1071
1094
|
{ code: "22003", raised_by: "context_resolve" },
|
|
1072
|
-
{ 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" },
|
|
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" },
|
|
1073
1096
|
{ code: "22007", raised_by: "dashboard_window_sql" },
|
|
1074
1097
|
{ code: "22012", raised_by: "rule_eval" },
|
|
1075
|
-
{ 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" },
|
|
1076
|
-
{ 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" },
|
|
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" },
|
|
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" },
|
|
1077
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" },
|
|
1078
|
-
{ 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" },
|
|
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" },
|
|
1079
1102
|
{ code: "40001", raised_by: "has_visibility_at" },
|
|
1080
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" },
|
|
1081
1104
|
{ code: "42703", raised_by: "entity_table,portal_declare" },
|
|
1082
1105
|
{ code: "53400", raised_by: "anon_rate_take,delete_cascade_closure,enrich_due,enrich_land,promote_field" },
|
|
1083
1106
|
{ code: "54001", raised_by: "record_delete" },
|
|
1084
|
-
{ code: "PT409", raised_by: "record_update" }
|
|
1107
|
+
{ code: "PT409", raised_by: "record_update" },
|
|
1108
|
+
{ code: "PT428", raised_by: "_record_rule_uses" }
|
|
1085
1109
|
];
|
|
1086
1110
|
var ENTITY_TOKENS = [
|
|
1087
1111
|
"access_delta_probe",
|
|
@@ -1745,6 +1769,7 @@ var ENTITY_TOKENS = [
|
|
|
1745
1769
|
"plan_node_artifact",
|
|
1746
1770
|
"plan_node_step",
|
|
1747
1771
|
"plan_profile",
|
|
1772
|
+
"platform_action_request",
|
|
1748
1773
|
"platform_actor_session",
|
|
1749
1774
|
"platform_actor_token",
|
|
1750
1775
|
"platform_actor_token_event",
|
|
@@ -2251,6 +2276,14 @@ var DOORS = {
|
|
|
2251
2276
|
pipelineTransitionRefusal: "pipeline_transition_refusal",
|
|
2252
2277
|
pipelineMove: "pipeline_move",
|
|
2253
2278
|
tableStageField: "table_stage_field",
|
|
2279
|
+
// STAGE-RULES. A gate can refuse or it can hand the change to the approvals queue; the
|
|
2280
|
+
// closed list is the store's, the knob is the organization's, and what is WAITING on a
|
|
2281
|
+
// card has to be askable or a card that did not move looks like a card nobody dragged.
|
|
2282
|
+
stageRuleOnFailKinds: "stage_rule_on_fail_kinds",
|
|
2283
|
+
stageRuleEnforcement: "stage_rule_enforcement",
|
|
2284
|
+
recordStagePending: "record_stage_pending",
|
|
2285
|
+
pipelinePending: "pipeline_pending",
|
|
2286
|
+
pipelineGatePreview: "pipeline_gate_preview",
|
|
2254
2287
|
ruleMembers: "rule_members",
|
|
2255
2288
|
ruleMembership: "rule_membership",
|
|
2256
2289
|
ruleRun: "rule_run",
|
|
@@ -2577,7 +2610,17 @@ var BY_SQLSTATE = {
|
|
|
2577
2610
|
// the grants not copied, land here.
|
|
2578
2611
|
PGRST202: "store_not_served",
|
|
2579
2612
|
PGRST205: "store_not_served",
|
|
2580
|
-
PGRST301: "door"
|
|
2613
|
+
PGRST301: "door",
|
|
2614
|
+
// PT428 — NOT A FAILURE, and the release gate's live census is what found it
|
|
2615
|
+
// missing: the store raises it and this package answered `internal`, which is
|
|
2616
|
+
// the one classification that tells a screen nothing. A stage gate whose
|
|
2617
|
+
// `on_fail` is `require_approval` files the request and leaves the record
|
|
2618
|
+
// where it was; the transaction is rolled back to the pipeline's own block, so
|
|
2619
|
+
// "nothing was written" is a fact rather than a promise. Landed by lane
|
|
2620
|
+
// STAGE-RULES; mapped here by STAGE-RULES-2 the day after, when the census
|
|
2621
|
+
// caught it — the sixth time that census has been the thing that found a
|
|
2622
|
+
// refusal class rather than a person guessing one.
|
|
2623
|
+
PT428: "needs_approval"
|
|
2581
2624
|
};
|
|
2582
2625
|
var MAPPED_SQLSTATES = Object.keys(BY_SQLSTATE);
|
|
2583
2626
|
function parseDetail(details) {
|
|
@@ -2756,16 +2799,17 @@ function createRecordsClient(config) {
|
|
|
2756
2799
|
if (!door.ok) return err(door.error);
|
|
2757
2800
|
const { document, hidden } = unfold(door.data);
|
|
2758
2801
|
let computed = [];
|
|
2802
|
+
let computedUnavailable = null;
|
|
2759
2803
|
if (withComputed) {
|
|
2760
2804
|
const provenance = await callDoor(
|
|
2761
2805
|
DOORS.computedProvenance,
|
|
2762
2806
|
{ p_organization_id: org, p_record_id: record_id },
|
|
2763
2807
|
"recordRead.computed"
|
|
2764
2808
|
);
|
|
2765
|
-
if (
|
|
2766
|
-
|
|
2809
|
+
if (provenance.ok) computed = provenance.data ?? [];
|
|
2810
|
+
else computedUnavailable = provenance.error;
|
|
2767
2811
|
}
|
|
2768
|
-
return ok({ record_id, document, hidden, computed });
|
|
2812
|
+
return ok({ record_id, document, hidden, computed, computedUnavailable });
|
|
2769
2813
|
},
|
|
2770
2814
|
async list({ table_id, limit = 50, offset = 0 }) {
|
|
2771
2815
|
const door = await callDoor(
|
|
@@ -3104,6 +3148,41 @@ function createRecordsClient(config) {
|
|
|
3104
3148
|
"tableStageField"
|
|
3105
3149
|
);
|
|
3106
3150
|
},
|
|
3151
|
+
async stageRuleOnFailKinds() {
|
|
3152
|
+
return callDoor(
|
|
3153
|
+
DOORS.stageRuleOnFailKinds,
|
|
3154
|
+
{},
|
|
3155
|
+
"stageRuleOnFailKinds"
|
|
3156
|
+
);
|
|
3157
|
+
},
|
|
3158
|
+
async stageRuleEnforcement() {
|
|
3159
|
+
return callDoor(
|
|
3160
|
+
DOORS.stageRuleEnforcement,
|
|
3161
|
+
{ p_organization_id: org },
|
|
3162
|
+
"stageRuleEnforcement"
|
|
3163
|
+
);
|
|
3164
|
+
},
|
|
3165
|
+
async recordStagePending({ record_id }) {
|
|
3166
|
+
return callDoor(
|
|
3167
|
+
DOORS.recordStagePending,
|
|
3168
|
+
{ p_organization_id: org, p_record_id: record_id },
|
|
3169
|
+
"recordStagePending"
|
|
3170
|
+
);
|
|
3171
|
+
},
|
|
3172
|
+
async pipelinePending({ table_id }) {
|
|
3173
|
+
return callDoor(
|
|
3174
|
+
DOORS.pipelinePending,
|
|
3175
|
+
{ p_organization_id: org, p_table_id: table_id },
|
|
3176
|
+
"pipelinePending"
|
|
3177
|
+
);
|
|
3178
|
+
},
|
|
3179
|
+
async pipelineGatePreview({ table_id, stage, gate }) {
|
|
3180
|
+
return callDoor(
|
|
3181
|
+
DOORS.pipelineGatePreview,
|
|
3182
|
+
{ p_organization_id: org, p_table_id: table_id, p_stage: stage, p_gate: gate },
|
|
3183
|
+
"pipelineGatePreview"
|
|
3184
|
+
);
|
|
3185
|
+
},
|
|
3107
3186
|
async ruleMembers({ rule_id }) {
|
|
3108
3187
|
return callDoor(
|
|
3109
3188
|
DOORS.ruleMembers,
|
|
@@ -4848,6 +4927,8 @@ export {
|
|
|
4848
4927
|
RETIRED_ACTOR_WORDS,
|
|
4849
4928
|
RULE_NODE_KINDS,
|
|
4850
4929
|
RULE_USES,
|
|
4930
|
+
STAGE_RULE_ENFORCEMENT,
|
|
4931
|
+
STAGE_RULE_ON_FAIL,
|
|
4851
4932
|
STORAGE_MODES,
|
|
4852
4933
|
STORE_DOORS,
|
|
4853
4934
|
STORE_KNOBS,
|