@ai-matrx/records 0.54.0 → 0.55.1
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 +49 -0
- package/dist/core/index.cjs +76 -8
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +56 -9
- package/dist/core/index.d.ts +56 -9
- package/dist/core/index.js +76 -8
- package/dist/core/index.js.map +1 -1
- package/dist/{field-Ct7_iYEF.d.cts → field-Dr7Ugek4.d.cts} +61 -5
- package/dist/{field-Ct7_iYEF.d.ts → field-Dr7Ugek4.d.ts} +61 -5
- package/dist/index.cjs +11 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +34 -3
- package/dist/index.d.ts +34 -3
- package/dist/index.js +11 -4
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +76 -8
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +142 -9
- package/dist/react/index.d.ts +142 -9
- package/dist/react/index.js +76 -8
- package/dist/react/index.js.map +1 -1
- package/dist/use-cases/index.cjs +15 -0
- 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 +15 -0
- package/dist/use-cases/index.js.map +1 -1
- package/package.json +7 -7
package/dist/core/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { g as Timestamp, U as Uuid, h as RecordDocument, i as RecordsResult, j as
|
|
2
|
-
export { A as ABSENCE_REASONS,
|
|
3
|
-
import { RelationCoordinate, RecordsConfig, TableArchiveProgress, RecordFilter, ArchiveLane, ArchivedRow, Table, TableCapacity, EntityTableFacts, NewEntityFieldDeclaration, EntityFieldRights, EntityRecordRead, EntityRecordsFound, Pipeline, PipelineColumn, PipelineVerdict, PipelineMoveResult, PipelineSpec, PipelineDeclared, StageRuleOnFail, StageRuleEnforcement, StagePending, StagePendingOnBoard, PipelineGate, PipelineGatePreview, FormSummary, BookingSummary, BookingAvailability, BookingDeclared, ImportPlan, ImportPolicy, ImportOpened, ImportColumnsDeclared, ImportBatchResult, ImportFinished, ImportReport, ImportRun, InboundDeclared, InboundAddress, PortalSummary, PortalArchiveFilter, PortalArchiveAnswer, PortalTableRef, PortalCard, PortalInvitation, PortalRevocation, PortalPreviewRow, DashboardSummary, DashboardBlock, DashboardRunResult, StuckRow, CaptureSheetSummary, CaptureSheetFace, CaptureFileRef, CaptureOutcome, EnrichmentSummary, EnrichDeclared, EnrichDueRow, EnrichCell, EnrichRun, AggregateMeasure, AggregateBucket, AggregateRow, Subscription, MySubscription, SubscriptionSpec, DigestPreview, SavedViewRow, SavedViewSpecIn, 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 { ARCHIVE_LANES, ARCHIVE_LANE_LABEL, ARCHIVE_LANE_MEANS, AggregateFilter, AggregateOperation, AggregateWindow, ArchivedDoorRow, BookingWindow, CaptureField, CaptureQuestion, CaptureQueue, CaptureQueueCounts, CaptureQueueOptions, CaptureQueuePorts, CaptureQueueStore, CaptureSyncReport, ChecklistRequirement, ChecklistRequirementKind, ChecklistRoleSpec, ChecklistStepSpec, ChecklistTrigger, ChecklistTriggerKind, ChoiceOption, ChoiceOptions, CoerceOptions, Coerced, CoercedAnswers, CoercibleField, CustomFieldTableType, DEFAULT_ARCHIVE_LANE, DEFAULT_PORTAL_ARCHIVE_FILTER, DashboardBlockKind, DashboardBlockResult, DocSignatureCheck, EnrichAlternate, EnrichSource, Enrichment, EntityFieldValue, EntityRecordMatch, FIELD_KINDS, FieldKind, HistoryActor, HistoryActorKind, HistoryChange, Home, ImportColumnPlan, ImportOutcome, ImportProposal, KernelTargets, MergeField, MergeFieldProvenance, MergeFieldResolution, MergeFieldTransform, MissingBehavior, PERMISSION_LEVELS, PIPELINE_RULE_KINDS, PORTAL_ARCHIVE_FILTERS, PermissionLevel, PipelineMissingField, PipelineRule, PipelineRuleKind, PipelineStage, PortalPrincipal, PortalTableExposure, QueuedCapture, QueuedCaptureFile, QueuedCaptureState, QuietHours, REFUSALS_WORTH_REPEATING, RecordComment, RecordScopeComment, RecordScopeField, RecordScopeHistoryEntry, RecordScopeRelation, RecordScopeWithheld, RecordsActor, RecordsChangeSink, 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, archivedByLine, archivedWhen, asPermissionLevel, atLeast, bookingPath, choiceSlug, choiceValuesOf, choicesOf, coerceTypedAnswer, coerceTypedAnswers, coercionLabel, emptyArchiveLine, emptyPortalArchiveLine, fieldKindFor, forgetAllOps, highestLevel, holdsARetiredChoice, indexedDbStore, isArchiveLane, isDecided, isOwnOp, isPortalArchiveFilter, isTheChosen, looksLikeAnId, mayDrag, measureKey, memoryStore, mintClientKey, mintOpId, openCaptureQueue, optionKey, optionLabel, portalArchiveConsequence, portalConfirmLine, portalPath, portalTitleTypedBack, publicFormPath, rememberedOpCount, sameDocument, scopeChip, stableFilterKey } from '../index.cjs';
|
|
1
|
+
import { g as Timestamp, U as Uuid, h as RecordDocument, i as RecordsResult, j as RecordGraphWritten, k as RecordRead, l as ReadRow, m as Field, n as StoredRecord, N as NewFieldDeclaration, o as FieldPatch, p as RecordRevision, q as ReadValue, r as FieldProposal, s as TableProposal, t as RecordsError, W as WriteConflict, P as PgError, u as StaleWriteDetail, v as PredictedRefusal } from '../field-Dr7Ugek4.cjs';
|
|
2
|
+
export { A as ABSENCE_REASONS, w as ACTOR_VOCABULARY, x as AbsenceReason, y as Actor, z as COMPUTE_ON, B as CONTEXT_POLICIES, C as ComputeOn, e as ContextPolicy, D as DECLARABLE_FIELD_KINDS, E as DELIVERIES, G as DeclarableFieldKind, H as Delivery, I as ENTITY_TOKENS, J as EntityToken, K as FIELD_SENSITIVITIES, L as FIELD_SOURCES, M as FRESHNESS, Q as FieldBehavior, c as FieldRule, d as FieldSensitivity, b as FieldSource, F as FieldTypeWord, V as ForbiddenEnvelopeWord, X as Freshness, Y as HiddenFieldNotice, Z as KERNEL_TABLES, _ as KernelTableName, $ as MERGE_FIELD_MODIFIERS, a0 as MERGE_FIELD_SEMANTIC_TYPES, a1 as MERGE_FIELD_SOURCES, a2 as MergeFieldModifier, a3 as MergeFieldSemanticType, a4 as MergeFieldSource, a5 as ON_DELETE, a6 as OVERRIDE_POLICIES, O as OnDelete, a7 as OverridePolicy, a8 as PARITY_FIELD_TYPES, a9 as PER_VALUE_ACCESS_WORDS, aa as ParityFieldType, ab as ParityFieldTypeDescriptor, ac as PerValueAccessWord, ad as ProvenancePointer, ae as RELATION_BINDINGS, af as RELATION_CARDINALITIES, ag as RELATION_FLAVORS, ah as RETIRED_ACTOR_WORDS, ai as RULE_NODE_KINDS, aj as RULE_USES, ak as RecordsErrorCode, al as RelationBinding, f as RelationCardinality, am as RelationDisplay, R as RelationFlavor, an as RetiredActorWord, ao as RuleNodeKind, ap as RuleUse, aq as STORAGE_MODES, ar as STORE_DOORS, as as STORE_KNOBS, at as STORE_REFUSAL_CODES, S as StorageMode, au as StoreDoorName, av as StoreRefusalCode, aw as TABLE_DISPLAYS, ax as TABLE_ORIGINS, ay as TABLE_TYPES, a as TableDisplay, az as TableOrigin, T as TableType, aA as VALUE_ALTERNATE_KEYS, aB as VALUE_ENVELOPE_KEYS, aC as ValueAlternate, aD as ValueAlternateKey, aE as ValueEnvelope, aF as ValueEnvelopeKey, aG as ValueSource, aH as err, aI as isRecordsErr, aJ as ok } from '../field-Dr7Ugek4.cjs';
|
|
3
|
+
import { RelationCoordinate, RecordsConfig, TableArchiveProgress, RecordFilter, ArchiveLane, ArchivedRow, Table, TableCapacity, RelationWordsManyArgs, EntityTableFacts, NewEntityFieldDeclaration, EntityFieldRights, EntityRecordRead, EntityRecordsFound, Pipeline, PipelineColumn, PipelineVerdict, PipelineMoveResult, PipelineSpec, PipelineDeclared, StageRuleOnFail, StageRuleEnforcement, StagePending, StagePendingOnBoard, PipelineGate, PipelineGatePreview, FormSummary, BookingSummary, BookingAvailability, BookingDeclared, ImportPlan, ImportPolicy, ImportOpened, ImportColumnsDeclared, ImportBatchResult, ImportFinished, ImportReport, ImportRun, InboundDeclared, InboundAddress, PortalSummary, PortalArchiveFilter, PortalArchiveAnswer, PortalTableRef, PortalCard, PortalInvitation, PortalRevocation, PortalPreviewRow, DashboardSummary, DashboardBlock, DashboardRunResult, StuckRow, CaptureSheetSummary, CaptureSheetFace, CaptureFileRef, CaptureOutcome, EnrichmentSummary, EnrichDeclared, EnrichDueRow, EnrichCell, EnrichRun, AggregateMeasure, AggregateBucket, AggregateRow, Subscription, MySubscription, SubscriptionSpec, DigestPreview, SavedViewRow, SavedViewSpecIn, 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 { ARCHIVE_LANES, ARCHIVE_LANE_LABEL, ARCHIVE_LANE_MEANS, AggregateFilter, AggregateOperation, AggregateWindow, ArchivedDoorRow, BookingWindow, CaptureField, CaptureQuestion, CaptureQueue, CaptureQueueCounts, CaptureQueueOptions, CaptureQueuePorts, CaptureQueueStore, CaptureSyncReport, ChecklistRequirement, ChecklistRequirementKind, ChecklistRoleSpec, ChecklistStepSpec, ChecklistTrigger, ChecklistTriggerKind, ChoiceOption, ChoiceOptions, CoerceOptions, Coerced, CoercedAnswers, CoercibleField, CustomFieldTableType, DEFAULT_ARCHIVE_LANE, DEFAULT_PORTAL_ARCHIVE_FILTER, DashboardBlockKind, DashboardBlockResult, DocSignatureCheck, EnrichAlternate, EnrichSource, Enrichment, EntityFieldValue, EntityRecordMatch, FIELD_KINDS, FieldKind, HistoryActor, HistoryActorKind, HistoryChange, Home, ImportColumnPlan, ImportOutcome, ImportProposal, KernelTargets, MergeField, MergeFieldProvenance, MergeFieldResolution, MergeFieldTransform, MissingBehavior, PERMISSION_LEVELS, PIPELINE_RULE_KINDS, PORTAL_ARCHIVE_FILTERS, PermissionLevel, PipelineMissingField, PipelineRule, PipelineRuleKind, PipelineStage, PortalPrincipal, PortalTableExposure, QueuedCapture, QueuedCaptureFile, QueuedCaptureState, QuietHours, REFUSALS_WORTH_REPEATING, RecordComment, RecordScopeComment, RecordScopeField, RecordScopeHistoryEntry, RecordScopeRelation, RecordScopeWithheld, RecordsActor, RecordsChangeSink, RecordsErrorSink, RecordsFilter, RecordsRealtimePort, RecordsResolverPort, RecordsResponse, RecordsTableQuery, RegisteredTable, Relation, RelationCarries, RelationDisplaySpec, RelationProperties, RelationStore, RelationTarget, ResolutionTriple, Rule, RuleAnswer, RuleExpression, STAGE_RULE_ENFORCEMENT, STAGE_RULE_ON_FAIL, StageRuleWarning, SubscriptionBlock, SubscriptionCadence, WorkDueState, WorkInboxKind, WorkOrigin, WorkTemplateNode, WorkTemplateRelation, archivedByLine, archivedWhen, asPermissionLevel, atLeast, bookingPath, choiceSlug, choiceValuesOf, choicesOf, coerceTypedAnswer, coerceTypedAnswers, coercionLabel, emptyArchiveLine, emptyPortalArchiveLine, fieldKindFor, forgetAllOps, highestLevel, holdsARetiredChoice, indexedDbStore, isArchiveLane, isDecided, isOwnOp, isPortalArchiveFilter, isTheChosen, looksLikeAnId, mayDrag, measureKey, memoryStore, mintClientKey, mintOpId, openCaptureQueue, optionKey, optionLabel, portalArchiveConsequence, portalConfirmLine, portalPath, portalTitleTypedBack, publicFormPath, rememberedOpCount, sameDocument, scopeChip, stableFilterKey } from '../index.cjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* DOOR-8. As-of on EITHER clock, and they are different questions:
|
|
@@ -111,6 +111,55 @@ interface RecordsClient {
|
|
|
111
111
|
rows: RecordDocument[];
|
|
112
112
|
ids?: Uuid[];
|
|
113
113
|
}): Promise<RecordsResult<Uuid[]>>;
|
|
114
|
+
/**
|
|
115
|
+
* A PARENT, THE EDGES IT STANDS ON AND THE ROWS THAT BELONG TO IT — ALL OR NOTHING.
|
|
116
|
+
*
|
|
117
|
+
* `recordWrite` and `recordWriteMany` are each ONE statement. A screen or a
|
|
118
|
+
* server path whose unit of work is a GRAPH — an AI artifact and the lines
|
|
119
|
+
* it produced, an order and its items, a research note and its citations —
|
|
120
|
+
* could therefore not save it as one thing: a loop is N transactions, and a
|
|
121
|
+
* failure on row nineteen leaves a parent standing without the lines it
|
|
122
|
+
* promised.
|
|
123
|
+
*
|
|
124
|
+
* `custom.record_write_graph` is one statement, so it is one transaction. It
|
|
125
|
+
* is NOT a second write path: it calls `custom.record_write_many` for the
|
|
126
|
+
* rows, `public.assoc_add` for an edge that points OUT of the store (the
|
|
127
|
+
* message a record was produced by), and `platform.relation_set` for the
|
|
128
|
+
* parent's own declared relation to its children. Same store switch, same
|
|
129
|
+
* editor rung on the Table, same value envelope, same undeclared-key guard,
|
|
130
|
+
* same history rows, same realtime notice.
|
|
131
|
+
*
|
|
132
|
+
* ONE REFUSAL REFUSES THE WHOLE GRAPH, BY NAME — the answer says which member
|
|
133
|
+
* failed and carries the store's own sentence about it, and nothing is
|
|
134
|
+
* written.
|
|
135
|
+
*
|
|
136
|
+
* Every child MUST name a `role`: it is the key of a declared RELATION field
|
|
137
|
+
* on the parent's Table, and an edge out of a record that names no field is
|
|
138
|
+
* refused by the store (REL-10 / T7) because without it nothing can read the
|
|
139
|
+
* relation's delete rule, its cardinality or its organization wall. The order
|
|
140
|
+
* children are handed in IS the order of the relation.
|
|
141
|
+
*/
|
|
142
|
+
recordWriteGraph(args: {
|
|
143
|
+
table_id: Uuid;
|
|
144
|
+
parent: RecordDocument;
|
|
145
|
+
/** Each child: its document, the parent FIELD it fills, and optionally its own Table. */
|
|
146
|
+
children?: Array<{
|
|
147
|
+
data: RecordDocument;
|
|
148
|
+
role: string;
|
|
149
|
+
table_id?: Uuid;
|
|
150
|
+
position?: number;
|
|
151
|
+
}>;
|
|
152
|
+
/** Edges to things OUTSIDE the store. `direction` defaults to `"in"` — that thing produced this record. */
|
|
153
|
+
edges?: Array<{
|
|
154
|
+
entity: string;
|
|
155
|
+
id: Uuid;
|
|
156
|
+
direction?: "in" | "out";
|
|
157
|
+
label?: string;
|
|
158
|
+
role?: string;
|
|
159
|
+
position?: number;
|
|
160
|
+
metadata?: Record<string, unknown>;
|
|
161
|
+
}>;
|
|
162
|
+
}): Promise<RecordsResult<RecordGraphWritten>>;
|
|
114
163
|
recordUpdate(args: {
|
|
115
164
|
record_id: Uuid;
|
|
116
165
|
patch: Record<string, unknown>;
|
|
@@ -303,10 +352,7 @@ interface RecordsClient {
|
|
|
303
352
|
* wherever a grid, board, list or picker resolves more than one chip: the
|
|
304
353
|
* per-id lane is what made a page of relation cells a page of requests.
|
|
305
354
|
*/
|
|
306
|
-
relationWordsMany(args:
|
|
307
|
-
field_id: Uuid;
|
|
308
|
-
record_ids: Uuid[];
|
|
309
|
-
}): Promise<RecordsResult<Record<string, string>>>;
|
|
355
|
+
relationWordsMany(args: RelationWordsManyArgs): Promise<RecordsResult<Record<string, string>>>;
|
|
310
356
|
/** Take a field off a table. Refuses the title field, the last field, and one another field reads through. */
|
|
311
357
|
fieldRetire(args: {
|
|
312
358
|
field_id: Uuid;
|
|
@@ -1493,6 +1539,7 @@ declare const DOORS: {
|
|
|
1493
1539
|
readonly queryTableAsOf: "query_table_as_of";
|
|
1494
1540
|
readonly recordWrite: "record_write";
|
|
1495
1541
|
readonly recordWriteMany: "record_write_many";
|
|
1542
|
+
readonly recordWriteGraph: "record_write_graph";
|
|
1496
1543
|
readonly recordUpdate: "record_update";
|
|
1497
1544
|
readonly recordDelete: "record_delete";
|
|
1498
1545
|
readonly recordRestore: "record_restore";
|
|
@@ -1810,4 +1857,4 @@ declare function parseCsv(text: string): string[][];
|
|
|
1810
1857
|
declare function importCsv(text: string): ParsedImport;
|
|
1811
1858
|
declare function importXlsx(bytes: ArrayBuffer | Uint8Array): Promise<ParsedImport>;
|
|
1812
1859
|
|
|
1813
|
-
export { AggregateBucket, AggregateMeasure, AggregateRow, AnonTokenBinding, ArchiveLane, ArchivedRow, type AsOf, BookingAvailability, BookingDeclared, 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, ImportColumnsDeclared, 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, PortalArchiveAnswer, PortalArchiveFilter, PortalCard, PortalInvitation, PortalPreviewRow, PortalRevocation, PortalSummary, PortalTableRef, PredictedRefusal, type PromotedPredicate, PublishBinding, type QueryPlan, ReadRow, ReadValue, RecordDocument, RecordFilter, RecordHistoryEntry, type RecordQuery, RecordRead, RecordRevision, RecordScopeContext, type RecordsClient, RecordsConfig, RecordsDataSource, RecordsError, RecordsResult, RelationCoordinate, ResolvedPublishBinding, RestorePreview, RestoreResult, SavedViewRow, SavedViewSpecIn, StagePending, StagePendingOnBoard, StageRuleEnforcement, StageRuleOnFail, StaleWriteDetail, StoredRecord, StuckRow, Subscription, SubscriptionSpec, type SupabaseLike, Table, TableArchiveProgress, 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 };
|
|
1860
|
+
export { AggregateBucket, AggregateMeasure, AggregateRow, AnonTokenBinding, ArchiveLane, ArchivedRow, type AsOf, BookingAvailability, BookingDeclared, 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, ImportColumnsDeclared, 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, PortalArchiveAnswer, PortalArchiveFilter, PortalCard, PortalInvitation, PortalPreviewRow, PortalRevocation, PortalSummary, PortalTableRef, PredictedRefusal, type PromotedPredicate, PublishBinding, type QueryPlan, ReadRow, ReadValue, RecordDocument, RecordFilter, RecordGraphWritten, RecordHistoryEntry, type RecordQuery, RecordRead, RecordRevision, RecordScopeContext, type RecordsClient, RecordsConfig, RecordsDataSource, RecordsError, RecordsResult, RelationCoordinate, RelationWordsManyArgs, ResolvedPublishBinding, RestorePreview, RestoreResult, SavedViewRow, SavedViewSpecIn, StagePending, StagePendingOnBoard, StageRuleEnforcement, StageRuleOnFail, StaleWriteDetail, StoredRecord, StuckRow, Subscription, SubscriptionSpec, type SupabaseLike, Table, TableArchiveProgress, 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 RecordsResult, j as
|
|
2
|
-
export { A as ABSENCE_REASONS,
|
|
3
|
-
import { RelationCoordinate, RecordsConfig, TableArchiveProgress, RecordFilter, ArchiveLane, ArchivedRow, Table, TableCapacity, EntityTableFacts, NewEntityFieldDeclaration, EntityFieldRights, EntityRecordRead, EntityRecordsFound, Pipeline, PipelineColumn, PipelineVerdict, PipelineMoveResult, PipelineSpec, PipelineDeclared, StageRuleOnFail, StageRuleEnforcement, StagePending, StagePendingOnBoard, PipelineGate, PipelineGatePreview, FormSummary, BookingSummary, BookingAvailability, BookingDeclared, ImportPlan, ImportPolicy, ImportOpened, ImportColumnsDeclared, ImportBatchResult, ImportFinished, ImportReport, ImportRun, InboundDeclared, InboundAddress, PortalSummary, PortalArchiveFilter, PortalArchiveAnswer, PortalTableRef, PortalCard, PortalInvitation, PortalRevocation, PortalPreviewRow, DashboardSummary, DashboardBlock, DashboardRunResult, StuckRow, CaptureSheetSummary, CaptureSheetFace, CaptureFileRef, CaptureOutcome, EnrichmentSummary, EnrichDeclared, EnrichDueRow, EnrichCell, EnrichRun, AggregateMeasure, AggregateBucket, AggregateRow, Subscription, MySubscription, SubscriptionSpec, DigestPreview, SavedViewRow, SavedViewSpecIn, 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 { ARCHIVE_LANES, ARCHIVE_LANE_LABEL, ARCHIVE_LANE_MEANS, AggregateFilter, AggregateOperation, AggregateWindow, ArchivedDoorRow, BookingWindow, CaptureField, CaptureQuestion, CaptureQueue, CaptureQueueCounts, CaptureQueueOptions, CaptureQueuePorts, CaptureQueueStore, CaptureSyncReport, ChecklistRequirement, ChecklistRequirementKind, ChecklistRoleSpec, ChecklistStepSpec, ChecklistTrigger, ChecklistTriggerKind, ChoiceOption, ChoiceOptions, CoerceOptions, Coerced, CoercedAnswers, CoercibleField, CustomFieldTableType, DEFAULT_ARCHIVE_LANE, DEFAULT_PORTAL_ARCHIVE_FILTER, DashboardBlockKind, DashboardBlockResult, DocSignatureCheck, EnrichAlternate, EnrichSource, Enrichment, EntityFieldValue, EntityRecordMatch, FIELD_KINDS, FieldKind, HistoryActor, HistoryActorKind, HistoryChange, Home, ImportColumnPlan, ImportOutcome, ImportProposal, KernelTargets, MergeField, MergeFieldProvenance, MergeFieldResolution, MergeFieldTransform, MissingBehavior, PERMISSION_LEVELS, PIPELINE_RULE_KINDS, PORTAL_ARCHIVE_FILTERS, PermissionLevel, PipelineMissingField, PipelineRule, PipelineRuleKind, PipelineStage, PortalPrincipal, PortalTableExposure, QueuedCapture, QueuedCaptureFile, QueuedCaptureState, QuietHours, REFUSALS_WORTH_REPEATING, RecordComment, RecordScopeComment, RecordScopeField, RecordScopeHistoryEntry, RecordScopeRelation, RecordScopeWithheld, RecordsActor, RecordsChangeSink, 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, archivedByLine, archivedWhen, asPermissionLevel, atLeast, bookingPath, choiceSlug, choiceValuesOf, choicesOf, coerceTypedAnswer, coerceTypedAnswers, coercionLabel, emptyArchiveLine, emptyPortalArchiveLine, fieldKindFor, forgetAllOps, highestLevel, holdsARetiredChoice, indexedDbStore, isArchiveLane, isDecided, isOwnOp, isPortalArchiveFilter, isTheChosen, looksLikeAnId, mayDrag, measureKey, memoryStore, mintClientKey, mintOpId, openCaptureQueue, optionKey, optionLabel, portalArchiveConsequence, portalConfirmLine, portalPath, portalTitleTypedBack, publicFormPath, rememberedOpCount, sameDocument, scopeChip, stableFilterKey } from '../index.js';
|
|
1
|
+
import { g as Timestamp, U as Uuid, h as RecordDocument, i as RecordsResult, j as RecordGraphWritten, k as RecordRead, l as ReadRow, m as Field, n as StoredRecord, N as NewFieldDeclaration, o as FieldPatch, p as RecordRevision, q as ReadValue, r as FieldProposal, s as TableProposal, t as RecordsError, W as WriteConflict, P as PgError, u as StaleWriteDetail, v as PredictedRefusal } from '../field-Dr7Ugek4.js';
|
|
2
|
+
export { A as ABSENCE_REASONS, w as ACTOR_VOCABULARY, x as AbsenceReason, y as Actor, z as COMPUTE_ON, B as CONTEXT_POLICIES, C as ComputeOn, e as ContextPolicy, D as DECLARABLE_FIELD_KINDS, E as DELIVERIES, G as DeclarableFieldKind, H as Delivery, I as ENTITY_TOKENS, J as EntityToken, K as FIELD_SENSITIVITIES, L as FIELD_SOURCES, M as FRESHNESS, Q as FieldBehavior, c as FieldRule, d as FieldSensitivity, b as FieldSource, F as FieldTypeWord, V as ForbiddenEnvelopeWord, X as Freshness, Y as HiddenFieldNotice, Z as KERNEL_TABLES, _ as KernelTableName, $ as MERGE_FIELD_MODIFIERS, a0 as MERGE_FIELD_SEMANTIC_TYPES, a1 as MERGE_FIELD_SOURCES, a2 as MergeFieldModifier, a3 as MergeFieldSemanticType, a4 as MergeFieldSource, a5 as ON_DELETE, a6 as OVERRIDE_POLICIES, O as OnDelete, a7 as OverridePolicy, a8 as PARITY_FIELD_TYPES, a9 as PER_VALUE_ACCESS_WORDS, aa as ParityFieldType, ab as ParityFieldTypeDescriptor, ac as PerValueAccessWord, ad as ProvenancePointer, ae as RELATION_BINDINGS, af as RELATION_CARDINALITIES, ag as RELATION_FLAVORS, ah as RETIRED_ACTOR_WORDS, ai as RULE_NODE_KINDS, aj as RULE_USES, ak as RecordsErrorCode, al as RelationBinding, f as RelationCardinality, am as RelationDisplay, R as RelationFlavor, an as RetiredActorWord, ao as RuleNodeKind, ap as RuleUse, aq as STORAGE_MODES, ar as STORE_DOORS, as as STORE_KNOBS, at as STORE_REFUSAL_CODES, S as StorageMode, au as StoreDoorName, av as StoreRefusalCode, aw as TABLE_DISPLAYS, ax as TABLE_ORIGINS, ay as TABLE_TYPES, a as TableDisplay, az as TableOrigin, T as TableType, aA as VALUE_ALTERNATE_KEYS, aB as VALUE_ENVELOPE_KEYS, aC as ValueAlternate, aD as ValueAlternateKey, aE as ValueEnvelope, aF as ValueEnvelopeKey, aG as ValueSource, aH as err, aI as isRecordsErr, aJ as ok } from '../field-Dr7Ugek4.js';
|
|
3
|
+
import { RelationCoordinate, RecordsConfig, TableArchiveProgress, RecordFilter, ArchiveLane, ArchivedRow, Table, TableCapacity, RelationWordsManyArgs, EntityTableFacts, NewEntityFieldDeclaration, EntityFieldRights, EntityRecordRead, EntityRecordsFound, Pipeline, PipelineColumn, PipelineVerdict, PipelineMoveResult, PipelineSpec, PipelineDeclared, StageRuleOnFail, StageRuleEnforcement, StagePending, StagePendingOnBoard, PipelineGate, PipelineGatePreview, FormSummary, BookingSummary, BookingAvailability, BookingDeclared, ImportPlan, ImportPolicy, ImportOpened, ImportColumnsDeclared, ImportBatchResult, ImportFinished, ImportReport, ImportRun, InboundDeclared, InboundAddress, PortalSummary, PortalArchiveFilter, PortalArchiveAnswer, PortalTableRef, PortalCard, PortalInvitation, PortalRevocation, PortalPreviewRow, DashboardSummary, DashboardBlock, DashboardRunResult, StuckRow, CaptureSheetSummary, CaptureSheetFace, CaptureFileRef, CaptureOutcome, EnrichmentSummary, EnrichDeclared, EnrichDueRow, EnrichCell, EnrichRun, AggregateMeasure, AggregateBucket, AggregateRow, Subscription, MySubscription, SubscriptionSpec, DigestPreview, SavedViewRow, SavedViewSpecIn, 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 { ARCHIVE_LANES, ARCHIVE_LANE_LABEL, ARCHIVE_LANE_MEANS, AggregateFilter, AggregateOperation, AggregateWindow, ArchivedDoorRow, BookingWindow, CaptureField, CaptureQuestion, CaptureQueue, CaptureQueueCounts, CaptureQueueOptions, CaptureQueuePorts, CaptureQueueStore, CaptureSyncReport, ChecklistRequirement, ChecklistRequirementKind, ChecklistRoleSpec, ChecklistStepSpec, ChecklistTrigger, ChecklistTriggerKind, ChoiceOption, ChoiceOptions, CoerceOptions, Coerced, CoercedAnswers, CoercibleField, CustomFieldTableType, DEFAULT_ARCHIVE_LANE, DEFAULT_PORTAL_ARCHIVE_FILTER, DashboardBlockKind, DashboardBlockResult, DocSignatureCheck, EnrichAlternate, EnrichSource, Enrichment, EntityFieldValue, EntityRecordMatch, FIELD_KINDS, FieldKind, HistoryActor, HistoryActorKind, HistoryChange, Home, ImportColumnPlan, ImportOutcome, ImportProposal, KernelTargets, MergeField, MergeFieldProvenance, MergeFieldResolution, MergeFieldTransform, MissingBehavior, PERMISSION_LEVELS, PIPELINE_RULE_KINDS, PORTAL_ARCHIVE_FILTERS, PermissionLevel, PipelineMissingField, PipelineRule, PipelineRuleKind, PipelineStage, PortalPrincipal, PortalTableExposure, QueuedCapture, QueuedCaptureFile, QueuedCaptureState, QuietHours, REFUSALS_WORTH_REPEATING, RecordComment, RecordScopeComment, RecordScopeField, RecordScopeHistoryEntry, RecordScopeRelation, RecordScopeWithheld, RecordsActor, RecordsChangeSink, RecordsErrorSink, RecordsFilter, RecordsRealtimePort, RecordsResolverPort, RecordsResponse, RecordsTableQuery, RegisteredTable, Relation, RelationCarries, RelationDisplaySpec, RelationProperties, RelationStore, RelationTarget, ResolutionTriple, Rule, RuleAnswer, RuleExpression, STAGE_RULE_ENFORCEMENT, STAGE_RULE_ON_FAIL, StageRuleWarning, SubscriptionBlock, SubscriptionCadence, WorkDueState, WorkInboxKind, WorkOrigin, WorkTemplateNode, WorkTemplateRelation, archivedByLine, archivedWhen, asPermissionLevel, atLeast, bookingPath, choiceSlug, choiceValuesOf, choicesOf, coerceTypedAnswer, coerceTypedAnswers, coercionLabel, emptyArchiveLine, emptyPortalArchiveLine, fieldKindFor, forgetAllOps, highestLevel, holdsARetiredChoice, indexedDbStore, isArchiveLane, isDecided, isOwnOp, isPortalArchiveFilter, isTheChosen, looksLikeAnId, mayDrag, measureKey, memoryStore, mintClientKey, mintOpId, openCaptureQueue, optionKey, optionLabel, portalArchiveConsequence, portalConfirmLine, portalPath, portalTitleTypedBack, publicFormPath, rememberedOpCount, sameDocument, scopeChip, stableFilterKey } from '../index.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* DOOR-8. As-of on EITHER clock, and they are different questions:
|
|
@@ -111,6 +111,55 @@ interface RecordsClient {
|
|
|
111
111
|
rows: RecordDocument[];
|
|
112
112
|
ids?: Uuid[];
|
|
113
113
|
}): Promise<RecordsResult<Uuid[]>>;
|
|
114
|
+
/**
|
|
115
|
+
* A PARENT, THE EDGES IT STANDS ON AND THE ROWS THAT BELONG TO IT — ALL OR NOTHING.
|
|
116
|
+
*
|
|
117
|
+
* `recordWrite` and `recordWriteMany` are each ONE statement. A screen or a
|
|
118
|
+
* server path whose unit of work is a GRAPH — an AI artifact and the lines
|
|
119
|
+
* it produced, an order and its items, a research note and its citations —
|
|
120
|
+
* could therefore not save it as one thing: a loop is N transactions, and a
|
|
121
|
+
* failure on row nineteen leaves a parent standing without the lines it
|
|
122
|
+
* promised.
|
|
123
|
+
*
|
|
124
|
+
* `custom.record_write_graph` is one statement, so it is one transaction. It
|
|
125
|
+
* is NOT a second write path: it calls `custom.record_write_many` for the
|
|
126
|
+
* rows, `public.assoc_add` for an edge that points OUT of the store (the
|
|
127
|
+
* message a record was produced by), and `platform.relation_set` for the
|
|
128
|
+
* parent's own declared relation to its children. Same store switch, same
|
|
129
|
+
* editor rung on the Table, same value envelope, same undeclared-key guard,
|
|
130
|
+
* same history rows, same realtime notice.
|
|
131
|
+
*
|
|
132
|
+
* ONE REFUSAL REFUSES THE WHOLE GRAPH, BY NAME — the answer says which member
|
|
133
|
+
* failed and carries the store's own sentence about it, and nothing is
|
|
134
|
+
* written.
|
|
135
|
+
*
|
|
136
|
+
* Every child MUST name a `role`: it is the key of a declared RELATION field
|
|
137
|
+
* on the parent's Table, and an edge out of a record that names no field is
|
|
138
|
+
* refused by the store (REL-10 / T7) because without it nothing can read the
|
|
139
|
+
* relation's delete rule, its cardinality or its organization wall. The order
|
|
140
|
+
* children are handed in IS the order of the relation.
|
|
141
|
+
*/
|
|
142
|
+
recordWriteGraph(args: {
|
|
143
|
+
table_id: Uuid;
|
|
144
|
+
parent: RecordDocument;
|
|
145
|
+
/** Each child: its document, the parent FIELD it fills, and optionally its own Table. */
|
|
146
|
+
children?: Array<{
|
|
147
|
+
data: RecordDocument;
|
|
148
|
+
role: string;
|
|
149
|
+
table_id?: Uuid;
|
|
150
|
+
position?: number;
|
|
151
|
+
}>;
|
|
152
|
+
/** Edges to things OUTSIDE the store. `direction` defaults to `"in"` — that thing produced this record. */
|
|
153
|
+
edges?: Array<{
|
|
154
|
+
entity: string;
|
|
155
|
+
id: Uuid;
|
|
156
|
+
direction?: "in" | "out";
|
|
157
|
+
label?: string;
|
|
158
|
+
role?: string;
|
|
159
|
+
position?: number;
|
|
160
|
+
metadata?: Record<string, unknown>;
|
|
161
|
+
}>;
|
|
162
|
+
}): Promise<RecordsResult<RecordGraphWritten>>;
|
|
114
163
|
recordUpdate(args: {
|
|
115
164
|
record_id: Uuid;
|
|
116
165
|
patch: Record<string, unknown>;
|
|
@@ -303,10 +352,7 @@ interface RecordsClient {
|
|
|
303
352
|
* wherever a grid, board, list or picker resolves more than one chip: the
|
|
304
353
|
* per-id lane is what made a page of relation cells a page of requests.
|
|
305
354
|
*/
|
|
306
|
-
relationWordsMany(args:
|
|
307
|
-
field_id: Uuid;
|
|
308
|
-
record_ids: Uuid[];
|
|
309
|
-
}): Promise<RecordsResult<Record<string, string>>>;
|
|
355
|
+
relationWordsMany(args: RelationWordsManyArgs): Promise<RecordsResult<Record<string, string>>>;
|
|
310
356
|
/** Take a field off a table. Refuses the title field, the last field, and one another field reads through. */
|
|
311
357
|
fieldRetire(args: {
|
|
312
358
|
field_id: Uuid;
|
|
@@ -1493,6 +1539,7 @@ declare const DOORS: {
|
|
|
1493
1539
|
readonly queryTableAsOf: "query_table_as_of";
|
|
1494
1540
|
readonly recordWrite: "record_write";
|
|
1495
1541
|
readonly recordWriteMany: "record_write_many";
|
|
1542
|
+
readonly recordWriteGraph: "record_write_graph";
|
|
1496
1543
|
readonly recordUpdate: "record_update";
|
|
1497
1544
|
readonly recordDelete: "record_delete";
|
|
1498
1545
|
readonly recordRestore: "record_restore";
|
|
@@ -1810,4 +1857,4 @@ declare function parseCsv(text: string): string[][];
|
|
|
1810
1857
|
declare function importCsv(text: string): ParsedImport;
|
|
1811
1858
|
declare function importXlsx(bytes: ArrayBuffer | Uint8Array): Promise<ParsedImport>;
|
|
1812
1859
|
|
|
1813
|
-
export { AggregateBucket, AggregateMeasure, AggregateRow, AnonTokenBinding, ArchiveLane, ArchivedRow, type AsOf, BookingAvailability, BookingDeclared, 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, ImportColumnsDeclared, 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, PortalArchiveAnswer, PortalArchiveFilter, PortalCard, PortalInvitation, PortalPreviewRow, PortalRevocation, PortalSummary, PortalTableRef, PredictedRefusal, type PromotedPredicate, PublishBinding, type QueryPlan, ReadRow, ReadValue, RecordDocument, RecordFilter, RecordHistoryEntry, type RecordQuery, RecordRead, RecordRevision, RecordScopeContext, type RecordsClient, RecordsConfig, RecordsDataSource, RecordsError, RecordsResult, RelationCoordinate, ResolvedPublishBinding, RestorePreview, RestoreResult, SavedViewRow, SavedViewSpecIn, StagePending, StagePendingOnBoard, StageRuleEnforcement, StageRuleOnFail, StaleWriteDetail, StoredRecord, StuckRow, Subscription, SubscriptionSpec, type SupabaseLike, Table, TableArchiveProgress, 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 };
|
|
1860
|
+
export { AggregateBucket, AggregateMeasure, AggregateRow, AnonTokenBinding, ArchiveLane, ArchivedRow, type AsOf, BookingAvailability, BookingDeclared, 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, ImportColumnsDeclared, 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, PortalArchiveAnswer, PortalArchiveFilter, PortalCard, PortalInvitation, PortalPreviewRow, PortalRevocation, PortalSummary, PortalTableRef, PredictedRefusal, type PromotedPredicate, PublishBinding, type QueryPlan, ReadRow, ReadValue, RecordDocument, RecordFilter, RecordGraphWritten, RecordHistoryEntry, type RecordQuery, RecordRead, RecordRevision, RecordScopeContext, type RecordsClient, RecordsConfig, RecordsDataSource, RecordsError, RecordsResult, RelationCoordinate, RelationWordsManyArgs, ResolvedPublishBinding, RestorePreview, RestoreResult, SavedViewRow, SavedViewSpecIn, StagePending, StagePendingOnBoard, StageRuleEnforcement, StageRuleOnFail, StaleWriteDetail, StoredRecord, StuckRow, Subscription, SubscriptionSpec, type SupabaseLike, Table, TableArchiveProgress, 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
|
@@ -995,6 +995,7 @@ var STORE_DOORS = [
|
|
|
995
995
|
{ name: "doors_not_deciding_the_record", args: "", returns: "TABLE(function_name text, identity_args text, why text)", security: "invoker" },
|
|
996
996
|
{ name: "doors_not_masking_fields", args: "", returns: "TABLE(function_name text, identity_args text, why text)", security: "invoker" },
|
|
997
997
|
{ name: "doors_not_on_one_ladder", args: "", returns: "TABLE(function_name text, identity_args text, why text)", security: "invoker" },
|
|
998
|
+
{ name: "doors_refusing_in_another_doors_name", args: "", returns: "TABLE(function_name text, identity_args text, why text)", security: "invoker" },
|
|
998
999
|
{ name: "effective_level", args: "p_user_id uuid, p_organization_id uuid, p_id uuid, p_type text DEFAULT 'record'::text", returns: "permission_level", security: "definer" },
|
|
999
1000
|
{ name: "enrich_cells", args: "p_organization_id uuid, p_table_id uuid, p_field_keys text[] DEFAULT NULL::text[], p_record_ids uuid[] DEFAULT NULL::uuid[]", returns: "TABLE(record_id uuid, field_key text, agent_owned boolean, value jsonb, value_version integer, actor text, on_behalf_of text, written_at timestamp with time zone, source jsonb, absent_reason text, alternates jsonb, pinned boolean, stale boolean, due_at timestamp with time zone)", security: "definer" },
|
|
1000
1001
|
{ name: "enrich_declare", args: "p_organization_id uuid, p_field_id uuid, p_spec jsonb", returns: "jsonb", security: "definer" },
|
|
@@ -1037,6 +1038,7 @@ var STORE_DOORS = [
|
|
|
1037
1038
|
{ name: "field_rules", args: "p_field_data jsonb", returns: "TABLE(kind text, spec jsonb)", security: "invoker" },
|
|
1038
1039
|
{ name: "field_update", args: "p_organization_id uuid, p_field_id uuid, p_patch jsonb", returns: "uuid", security: "definer" },
|
|
1039
1040
|
{ name: "field_value_convert", args: "p_to jsonb, p_value jsonb", returns: "jsonb", security: "invoker" },
|
|
1041
|
+
{ name: "field_words", args: "p_organization_id uuid, p_field_id uuid, p_value jsonb", returns: "text", security: "invoker" },
|
|
1040
1042
|
{ name: "file_kernel_id", args: "", returns: "uuid", security: "invoker" },
|
|
1041
1043
|
{ name: "form_declare", args: "p_organization_id uuid, p_table_id uuid, p_title text, p_questions jsonb, p_presentation jsonb DEFAULT '{}'::jsonb, p_submission_cap integer DEFAULT NULL::integer, p_quarantine_rule_id uuid DEFAULT NULL::uuid, p_notify_rule_id uuid DEFAULT NULL::uuid, p_form_id uuid DEFAULT NULL::uuid, p_slug text DEFAULT NULL::text", returns: "uuid", security: "definer" },
|
|
1042
1044
|
{ name: "form_notify", args: "p_organization_id uuid, p_form_id uuid, p_record_id uuid, p_submission_id uuid", returns: "uuid", security: "invoker" },
|
|
@@ -1128,6 +1130,7 @@ var STORE_DOORS = [
|
|
|
1128
1130
|
{ name: "migrate_merge", args: "p_organization_id uuid, p_winner_id uuid, p_loser_id uuid, p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
1129
1131
|
{ name: "migrate_promote", args: "p_organization_id uuid, p_table_id uuid, p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
1130
1132
|
{ name: "migrate_purge", args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid, p_dry_run boolean DEFAULT true", returns: "jsonb", security: "definer" },
|
|
1133
|
+
{ name: "migrate_purge_hard", args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid, p_compliance_reason text DEFAULT NULL::text, p_chunk integer DEFAULT 200, p_dry_run boolean DEFAULT true", returns: "jsonb", security: "definer" },
|
|
1131
1134
|
{ name: "migrate_reclass", args: "p_organization_id uuid, p_id uuid, p_to text DEFAULT 'field'::text, p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
1132
1135
|
{ name: "migrate_rename", args: "p_organization_id uuid, p_id uuid, p_to text, p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
1133
1136
|
{ name: "migrate_reparent", args: "p_organization_id uuid, p_id uuid, p_parent_id uuid, p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
|
|
@@ -1255,6 +1258,7 @@ var STORE_DOORS = [
|
|
|
1255
1258
|
{ 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" },
|
|
1256
1259
|
{ name: "record_words", args: "p_organization_id uuid, p_record_id uuid, p_noun text DEFAULT NULL::text", returns: "text", security: "definer" },
|
|
1257
1260
|
{ name: "record_write", args: "p_organization_id uuid, p_table_id uuid, p_data jsonb", returns: "uuid", security: "definer" },
|
|
1261
|
+
{ name: "record_write_graph", args: "p_organization_id uuid, p_table_id uuid, p_parent jsonb, p_edges jsonb DEFAULT '[]'::jsonb, p_children jsonb DEFAULT '[]'::jsonb", returns: "jsonb", security: "definer" },
|
|
1258
1262
|
{ 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" },
|
|
1259
1263
|
{ name: "refusals_claiming_a_level_never_asked", args: "", returns: "TABLE(function_name text, identity_args text, why text)", security: "invoker" },
|
|
1260
1264
|
{ name: "relation_carry", args: "p_organization_id uuid, p_container_id uuid, p_item_id uuid", returns: "uuid", security: "definer" },
|
|
@@ -1333,6 +1337,7 @@ var STORE_DOORS = [
|
|
|
1333
1337
|
{ name: "table_declare", args: "p_organization_id uuid, p_spec jsonb", returns: "uuid", security: "definer" },
|
|
1334
1338
|
{ name: "table_has_a_visible_record", args: "p_user uuid, p_organization_id uuid, p_table_id uuid", returns: "boolean", security: "definer" },
|
|
1335
1339
|
{ name: "table_is_live", args: "p_organization_id uuid, p_table_id uuid", returns: "boolean", security: "invoker" },
|
|
1340
|
+
{ name: "table_is_options_table", args: "p_organization_id uuid, p_table_id uuid", returns: "boolean", security: "invoker" },
|
|
1336
1341
|
{ name: "table_kernel_id", args: "", returns: "uuid", security: "invoker" },
|
|
1337
1342
|
{ name: "table_record_ceiling", args: "", returns: "integer", security: "invoker" },
|
|
1338
1343
|
{ name: "table_record_ceiling", args: "p_organization_id uuid", returns: "integer", security: "invoker" },
|
|
@@ -1346,6 +1351,8 @@ var STORE_DOORS = [
|
|
|
1346
1351
|
{ name: "table_stage_field", args: "p_organization_id uuid, p_table_id uuid", returns: "text", security: "definer" },
|
|
1347
1352
|
{ name: "table_storage", args: "p_organization_id uuid, p_table_id uuid", returns: "text", security: "invoker" },
|
|
1348
1353
|
{ name: "table_type_field", args: "p_organization_id uuid, p_table_id uuid", returns: "text", security: "definer" },
|
|
1354
|
+
{ name: "table_unique_rule_fields", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "invoker" },
|
|
1355
|
+
{ name: "table_work_kind", args: "p_organization_id uuid, p_table_id uuid", returns: "text", security: "invoker" },
|
|
1349
1356
|
{ 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" },
|
|
1350
1357
|
{ name: "tables_described_without_asking", args: "", returns: "TABLE(function_name text, identity_args text, why text)", security: "invoker" },
|
|
1351
1358
|
{ name: "trg_associations_bump_visibility", args: "", returns: "trigger", security: "definer" },
|
|
@@ -1461,15 +1468,15 @@ var STORE_REFUSAL_CODES = [
|
|
|
1461
1468
|
{ code: "02000", raised_by: "_checklist_instantiate,_portal_invite_payload,_share_write_person,_table_share_invite_payload,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_archive,portal_card,portal_declare,portal_invite,portal_invite_accept,portal_preview,portal_principal_bind,portal_restore,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,table_archive,table_share_outside_accept,table_share_outside_invite,table_share_outside_resend,table_share_outside_revoke,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_assign,work_record_states,work_set_state" },
|
|
1462
1469
|
{ 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" },
|
|
1463
1470
|
{ code: "22003", raised_by: "context_resolve" },
|
|
1464
|
-
{ code: "22004", raised_by: "_entity_custom_fields_guard,_share_write_person,_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_archive,table_declare,table_share_outside_invite,value_restore,view_declare,work_approval_decide,work_approval_request,work_template_declare" },
|
|
1471
|
+
{ code: "22004", raised_by: "_entity_custom_fields_guard,_share_write_person,_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_purge_hard,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_graph,record_write_many,relation_carry,relation_own,rule_declare,share_grant,sign_request_create,sign_request_sign,subscription_declare,table_archive,table_declare,table_share_outside_invite,value_restore,view_declare,work_approval_decide,work_approval_request,work_template_declare" },
|
|
1465
1472
|
{ code: "22007", raised_by: "dashboard_window_sql" },
|
|
1466
1473
|
{ code: "22012", raised_by: "rule_eval" },
|
|
1467
|
-
{ code: "22023", raised_by: "_booking_availability,_entity_custom_fields_guard,_take_op_id,_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,field_update,io_export,io_import_begin,io_import_finish,io_import_plan,io_import_report,io_proposal_accept,list_portals,migrate_merge,migrate_reclass,my_levels,organization_clear,page_size,pin_agent_cells,pipeline_move,portal_declare,provenance_write,query_by_coordinates,query_rollup,read_records_archived,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" },
|
|
1474
|
+
{ code: "22023", raised_by: "_booking_availability,_entity_custom_fields_guard,_take_op_id,_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,field_update,io_export,io_import_begin,io_import_finish,io_import_plan,io_import_report,io_proposal_accept,list_portals,migrate_merge,migrate_reclass,my_levels,organization_clear,page_size,pin_agent_cells,pipeline_move,portal_declare,provenance_write,query_by_coordinates,query_rollup,read_records_archived,record_update,record_write_graph,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" },
|
|
1468
1475
|
{ code: "23503", raised_by: "_booking_availability,_checklist_instantiate,_containment_guard,_display_spec_for,_field_document_for,_field_type_parity_guard,_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" },
|
|
1469
1476
|
{ code: "23505", raised_by: "_share_write_person,_unique_rule_holds,doc_sign,doc_signature_write,entity_field_declare,field_declare,home_add,inbound_declare,io_proposal_accept,relation_carry,relation_own,sign_request_cancel,sign_request_create,table_share_outside_resend,work_approval_decide,work_slot_hold" },
|
|
1470
|
-
{ code: "23514", raised_by: "_checklist_instantiate,_checklist_step_guard,_containment_guard,_dated_values_guard,_derived_fields,_display_spec_for,_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,_with_display,_work_shape_guard,_workdoors_approval_guard,assert_columns_are_defined,assert_entity_is_organization_scoped,booking_declare,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_comment_write,io_import_rows,migrate_merge,portal_archive,portal_restore,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" },
|
|
1477
|
+
{ code: "23514", raised_by: "_checklist_instantiate,_checklist_step_guard,_containment_guard,_dated_values_guard,_derived_fields,_display_spec_for,_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,_relation_halves_agree,_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,_with_display,_work_shape_guard,_workdoors_approval_guard,assert_columns_are_defined,assert_entity_is_organization_scoped,booking_declare,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_comment_write,io_import_rows,migrate_merge,migrate_purge_hard,portal_archive,portal_restore,record_write_graph,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" },
|
|
1471
1478
|
{ code: "40001", raised_by: "has_visibility_at" },
|
|
1472
|
-
{ code: "42501", raised_by: "_doc_render_immutable,_doc_signature_immutable,_field_definition_write,_field_write_door,_rule_definition_write,_store_door,agent_table_claim,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,doc_sign,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_invite_accept,portal_principal_bind,promote_table,query_visibility_parity,read_record,read_records,read_records_archived,read_records_by_ids,read_records_matching,record_table,share_grant,subscription_mute,subscription_preview,table_share_outside_accept,table_share_outside_invite,table_share_outside_resend,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_person" },
|
|
1479
|
+
{ code: "42501", raised_by: "_doc_render_immutable,_doc_signature_immutable,_field_definition_write,_field_write_door,_rule_definition_write,_store_door,agent_table_claim,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,doc_sign,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_purge_hard,migrate_reclass,my_levels,organization_clear,portal_declare,portal_invitation,portal_invite,portal_invite_accept,portal_principal_bind,promote_table,query_visibility_parity,read_record,read_records,read_records_archived,read_records_by_ids,read_records_matching,record_table,record_write_graph,share_grant,subscription_mute,subscription_preview,table_share_outside_accept,table_share_outside_invite,table_share_outside_resend,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_person" },
|
|
1473
1480
|
{ code: "42703", raised_by: "entity_table,portal_declare" },
|
|
1474
1481
|
{ code: "53400", raised_by: "anon_rate_take,delete_cascade_closure,enrich_due,enrich_land,promote_field" },
|
|
1475
1482
|
{ code: "54001", raised_by: "record_delete" },
|
|
@@ -2538,6 +2545,18 @@ var TRUST_DOORS = {
|
|
|
2538
2545
|
worldPublishAdmit: "world_publish_admit",
|
|
2539
2546
|
claimWorldNamespace: "claim_world_namespace"
|
|
2540
2547
|
};
|
|
2548
|
+
var WORKBENCH_SCHEMA = "workbench";
|
|
2549
|
+
var WORKBENCH_DOORS = {
|
|
2550
|
+
/**
|
|
2551
|
+
* What a page of the OLDER store's relation cells reads, in one round trip.
|
|
2552
|
+
* Same answer shape as `custom.relation_words_many`, same withheld sentence,
|
|
2553
|
+
* and the ladder is asked per record inside it — so batching buys a round
|
|
2554
|
+
* trip and never a disclosure. An id that names nothing comes back as
|
|
2555
|
+
* NOTHING rather than as the withheld sentence, which is what makes an
|
|
2556
|
+
* unresolvable cell distinguishable from a refused one in that store.
|
|
2557
|
+
*/
|
|
2558
|
+
udtRowWordsMany: "udt_row_words_many"
|
|
2559
|
+
};
|
|
2541
2560
|
var DOOR_NAMES = new Set(STORE_DOORS.map((d) => d.name));
|
|
2542
2561
|
function doorExists(name) {
|
|
2543
2562
|
return DOOR_NAMES.has(name);
|
|
@@ -2590,6 +2609,17 @@ var DOORS = {
|
|
|
2590
2609
|
queryTableAsOf: "query_table_as_of",
|
|
2591
2610
|
recordWrite: "record_write",
|
|
2592
2611
|
recordWriteMany: "record_write_many",
|
|
2612
|
+
// A PARENT, THE EDGES IT STANDS ON AND THE ROWS THAT BELONG TO IT — ALL OR NOTHING.
|
|
2613
|
+
// `recordWrite` and `recordWriteMany` are each ONE statement, so a caller that needs a
|
|
2614
|
+
// parent, its provenance edge and its child rows to land together had no door at all: a
|
|
2615
|
+
// loop is N transactions, and a failure on child nineteen leaves a parent standing without
|
|
2616
|
+
// the lines it promised. `custom.record_write_graph` is one statement, so it is one
|
|
2617
|
+
// transaction — and it is not a second write path: it CALLS `custom.record_write_many` for
|
|
2618
|
+
// the rows, `public.assoc_add` for an edge that points out of the store, and
|
|
2619
|
+
// `platform.relation_set` for the parent's own declared relation to its children. Every
|
|
2620
|
+
// guard, every trigger and the same editor rung, once. A refusal anywhere refuses the whole
|
|
2621
|
+
// graph, by name, and nothing is written.
|
|
2622
|
+
recordWriteGraph: "record_write_graph",
|
|
2593
2623
|
recordUpdate: "record_update",
|
|
2594
2624
|
recordDelete: "record_delete",
|
|
2595
2625
|
recordRestore: "record_restore",
|
|
@@ -3212,6 +3242,15 @@ function createRecordsClient(config) {
|
|
|
3212
3242
|
}
|
|
3213
3243
|
return ok(response.data);
|
|
3214
3244
|
}
|
|
3245
|
+
async function workbenchDoor(door, args, where) {
|
|
3246
|
+
const response = await config.dataSource.rpc(door, args, { schema: WORKBENCH_SCHEMA });
|
|
3247
|
+
if (response.error) {
|
|
3248
|
+
const refusal = mapPgError(response.error, where);
|
|
3249
|
+
scream({ code: refusal.code, message: refusal.message, ...refusal.hint ? { hint: refusal.hint } : {}, where });
|
|
3250
|
+
return err(refusal);
|
|
3251
|
+
}
|
|
3252
|
+
return ok(response.data);
|
|
3253
|
+
}
|
|
3215
3254
|
function unfold(document) {
|
|
3216
3255
|
const raw = document ?? {};
|
|
3217
3256
|
const hidden = raw._hidden ?? {};
|
|
@@ -3251,6 +3290,25 @@ function createRecordsClient(config) {
|
|
|
3251
3290
|
"recordWriteMany"
|
|
3252
3291
|
);
|
|
3253
3292
|
},
|
|
3293
|
+
async recordWriteGraph({ table_id, parent, children, edges }) {
|
|
3294
|
+
const opId = mintOpId();
|
|
3295
|
+
return callDoor(
|
|
3296
|
+
DOORS.recordWriteGraph,
|
|
3297
|
+
{
|
|
3298
|
+
p_organization_id: org,
|
|
3299
|
+
p_table_id: table_id,
|
|
3300
|
+
p_parent: { ...parent, _op_id: opId },
|
|
3301
|
+
p_edges: edges ?? [],
|
|
3302
|
+
p_children: (children ?? []).map((child) => ({
|
|
3303
|
+
data: child.data,
|
|
3304
|
+
role: child.role,
|
|
3305
|
+
...child.table_id === void 0 ? {} : { table_id: child.table_id },
|
|
3306
|
+
...child.position === void 0 ? {} : { position: child.position }
|
|
3307
|
+
}))
|
|
3308
|
+
},
|
|
3309
|
+
"recordWriteGraph"
|
|
3310
|
+
);
|
|
3311
|
+
},
|
|
3254
3312
|
async recordUpdate({ record_id, patch, expectedVersion }) {
|
|
3255
3313
|
const result = await callDoor(
|
|
3256
3314
|
DOORS.recordUpdate,
|
|
@@ -3636,16 +3694,26 @@ function createRecordsClient(config) {
|
|
|
3636
3694
|
"relationWords"
|
|
3637
3695
|
);
|
|
3638
3696
|
},
|
|
3639
|
-
async relationWordsMany(
|
|
3640
|
-
const
|
|
3697
|
+
async relationWordsMany(args) {
|
|
3698
|
+
const older = args.store === "older";
|
|
3699
|
+
const result = older ? await workbenchDoor(
|
|
3700
|
+
WORKBENCH_DOORS.udtRowWordsMany,
|
|
3701
|
+
{
|
|
3702
|
+
p_organization_id: org,
|
|
3703
|
+
p_display: args.display ?? null,
|
|
3704
|
+
p_row_ids: args.record_ids
|
|
3705
|
+
},
|
|
3706
|
+
"relationWordsMany(older)"
|
|
3707
|
+
) : await callDoor(
|
|
3641
3708
|
DOORS.relationWordsMany,
|
|
3642
|
-
{ p_organization_id: org, p_field_id: field_id, p_record_ids: record_ids },
|
|
3709
|
+
{ p_organization_id: org, p_field_id: args.field_id, p_record_ids: args.record_ids },
|
|
3643
3710
|
"relationWordsMany"
|
|
3644
3711
|
);
|
|
3645
3712
|
if (!result.ok) return result;
|
|
3646
3713
|
const map = {};
|
|
3647
3714
|
for (const row of result.data ?? []) {
|
|
3648
|
-
|
|
3715
|
+
const id = row?.record_id ?? row?.row_id;
|
|
3716
|
+
if (id && typeof row.words === "string") map[id] = row.words;
|
|
3649
3717
|
}
|
|
3650
3718
|
return { ok: true, data: map };
|
|
3651
3719
|
},
|