@ai-matrx/records 0.57.0 → 0.57.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 +25 -0
- package/dist/core/index.cjs +94 -17
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +36 -3
- package/dist/core/index.d.ts +36 -3
- package/dist/core/index.js +94 -17
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +6 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +84 -11
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +56 -2
- package/dist/react/index.d.ts +56 -2
- package/dist/react/index.js +84 -11
- package/dist/react/index.js.map +1 -1
- package/dist/{types-DC2tYa4w.d.cts → types-Bsamaf-a.d.cts} +39 -2
- package/dist/{types-DC2tYa4w.d.ts → types-Bsamaf-a.d.ts} +39 -2
- package/dist/use-cases/index.d.cts +2 -2
- package/dist/use-cases/index.d.ts +2 -2
- package/package.json +1 -1
package/dist/react/index.d.cts
CHANGED
|
@@ -4029,6 +4029,8 @@ interface PredictedRefusal {
|
|
|
4029
4029
|
/** The message the store's own body would raise, word for word. */
|
|
4030
4030
|
message: string;
|
|
4031
4031
|
hint?: string;
|
|
4032
|
+
/** The store's structured detail, when its refusal carries one (e.g. `{ example }`). */
|
|
4033
|
+
detail?: Record<string, unknown>;
|
|
4032
4034
|
sqlstate: string;
|
|
4033
4035
|
/**
|
|
4034
4036
|
* Which of the store's bodies would raise it, so a reader can go and check
|
|
@@ -4462,7 +4464,25 @@ interface TableArchiveProgress {
|
|
|
4462
4464
|
/** FLD-3. A constraint attached to a Field. A Rule, never a behaviour. */
|
|
4463
4465
|
interface FieldRule {
|
|
4464
4466
|
kind: "min" | "max" | "length" | "pattern" | "equals_field" | "differs_from_field";
|
|
4465
|
-
|
|
4467
|
+
/**
|
|
4468
|
+
* The rule's own number or word: the least / the most for `min` / `max`, the
|
|
4469
|
+
* LONGEST for `length`, the pattern for `pattern`, the other column's key for
|
|
4470
|
+
* `equals_field` / `differs_from_field`. A `length` rule that only says how
|
|
4471
|
+
* SHORT a value may be carries `min` and no `value`.
|
|
4472
|
+
*/
|
|
4473
|
+
value?: string | number;
|
|
4474
|
+
/**
|
|
4475
|
+
* STORE-RULE-GAPS (the older grid's `patternHint`). On a `pattern` rule only:
|
|
4476
|
+
* how a person writes it, e.g. `"949-555-0142"`. The store refuses an example
|
|
4477
|
+
* its own pattern would refuse, and a refused value is told "Enter it like
|
|
4478
|
+
* 949-555-0142." (the hint, and `detail.example`).
|
|
4479
|
+
*/
|
|
4480
|
+
example?: string;
|
|
4481
|
+
/**
|
|
4482
|
+
* STORE-RULE-GAPS (the older grid's `minLength`). On a `length` rule only: the
|
|
4483
|
+
* fewest characters. A blank is `required`'s question, never "too short".
|
|
4484
|
+
*/
|
|
4485
|
+
min?: number;
|
|
4466
4486
|
/** FLD-10. Empty means "wherever the Field applies". */
|
|
4467
4487
|
applies_to_types?: string[];
|
|
4468
4488
|
}
|
|
@@ -4667,6 +4687,12 @@ interface NewFieldDeclaration {
|
|
|
4667
4687
|
config?: Record<string, unknown>;
|
|
4668
4688
|
/** A text column that holds a signature (`custom.doc_sign` accepts no other). */
|
|
4669
4689
|
format?: string;
|
|
4690
|
+
/**
|
|
4691
|
+
* STORE-RULE-GAPS (the older grid's `allowOther`). A choice list only: a value
|
|
4692
|
+
* that is none of the choices is ADDED to the list as typed instead of
|
|
4693
|
+
* refused. Stored as `config.allow_other`; absent means off.
|
|
4694
|
+
*/
|
|
4695
|
+
allow_other?: boolean;
|
|
4670
4696
|
}
|
|
4671
4697
|
/**
|
|
4672
4698
|
* Every word `custom._field_document_for` resolves for `type`: any parity type
|
|
@@ -4736,6 +4762,12 @@ interface FieldPatch {
|
|
|
4736
4762
|
/** SEAT-SUITES: whether the store builds an index for this column, and a unique one. */
|
|
4737
4763
|
promoted?: boolean;
|
|
4738
4764
|
unique?: boolean;
|
|
4765
|
+
/**
|
|
4766
|
+
* STORE-RULE-GAPS. A choice list's "other values allowed" setting — see
|
|
4767
|
+
* `NewFieldDeclaration.allow_other`. Refused by name on any other column; a
|
|
4768
|
+
* retype that stays a list keeps it.
|
|
4769
|
+
*/
|
|
4770
|
+
allow_other?: boolean;
|
|
4739
4771
|
/** §D / T7: which fields a worked-out column reads. */
|
|
4740
4772
|
depends_on?: Uuid[];
|
|
4741
4773
|
/**
|
|
@@ -4774,6 +4806,11 @@ interface FieldPatch {
|
|
|
4774
4806
|
*/
|
|
4775
4807
|
expr?: Record<string, unknown>;
|
|
4776
4808
|
}
|
|
4809
|
+
/**
|
|
4810
|
+
* Whether a choice column takes values that are not one of its choices
|
|
4811
|
+
* (`config.allow_other`, STORE-RULE-GAPS). Off unless the column says so.
|
|
4812
|
+
*/
|
|
4813
|
+
declare function allowsOtherValues(field: Pick<Field, "type" | "config">): boolean;
|
|
4777
4814
|
|
|
4778
4815
|
/** One option, as `_choices` names it and as `optionsOf` returns it. */
|
|
4779
4816
|
interface ChoiceOption {
|
|
@@ -8610,6 +8647,16 @@ interface RecordsClient {
|
|
|
8610
8647
|
total: number | null;
|
|
8611
8648
|
}>>;
|
|
8612
8649
|
tableList(): Promise<RecordsResult<Table[]>>;
|
|
8650
|
+
/**
|
|
8651
|
+
* IS THIS TABLE IN THE ARCHIVE? (lane HUB-FIX, 2026-09-23.) The archived row for one
|
|
8652
|
+
* Table of this organization, or `null` when the archive does not hold it — which
|
|
8653
|
+
* is an ANSWER, never "it may have been deleted". A table page that cannot find a
|
|
8654
|
+
* Table asks this before saying anything: an archived Table's own address used to
|
|
8655
|
+
* read "…or it may have been deleted" when it was archived and one click from back.
|
|
8656
|
+
*/
|
|
8657
|
+
tableArchived(args: {
|
|
8658
|
+
table_id: Uuid;
|
|
8659
|
+
}): Promise<RecordsResult<ArchivedRow | null>>;
|
|
8613
8660
|
fields(args: {
|
|
8614
8661
|
table_id: Uuid;
|
|
8615
8662
|
recordType?: string;
|
|
@@ -10081,6 +10128,13 @@ interface UseRecordsState extends Async<{
|
|
|
10081
10128
|
/** A page of records, realtime-aware when the host bound the port. */
|
|
10082
10129
|
declare function useRecords(tableId: Uuid | null, options?: UseRecordsOptions): UseRecordsState;
|
|
10083
10130
|
/** One record, its values and (optionally) which Rule version computed each. */
|
|
10131
|
+
/**
|
|
10132
|
+
* HOW MANY TIMES THIS PAGE HAS WRITTEN THIS RECORD (lane RECORDS-UI-FIX, 2026-09-23).
|
|
10133
|
+
* A screen that shows a record puts this in its read's dependencies and re-reads when a
|
|
10134
|
+
* write through any client on the page lands on it — the record panel's history read
|
|
10135
|
+
* "3 versions" after its fourth write because nothing told it. See `core/recordChanges`.
|
|
10136
|
+
*/
|
|
10137
|
+
declare function useRecordChangeRevision(recordId: Uuid | null | undefined): number;
|
|
10084
10138
|
declare function useRecord(recordId: Uuid | null, withComputed?: boolean): Async<RecordRead | null>;
|
|
10085
10139
|
interface UseRecordMutation {
|
|
10086
10140
|
write: (args: {
|
|
@@ -10262,4 +10316,4 @@ declare function useFieldMutation(): UseFieldMutation;
|
|
|
10262
10316
|
*/
|
|
10263
10317
|
declare function useMergeField(key: string | null, state?: Record<string, unknown>): MergeFieldResolution | null;
|
|
10264
10318
|
|
|
10265
|
-
export { ABSENCE_REASONS, ACTOR_VOCABULARY, ARCHIVE_LANES, ARCHIVE_LANE_LABEL, ARCHIVE_LANE_MEANS, type AbsenceReason, type ActionRefusal, type ActionRunResult, type Actor, type AggregateBucket, type AggregateFilter, type AggregateMeasure, type AggregateOperation, type AggregateRow, type AggregateWindow, type AnonTokenBinding, type ArchiveLane, type ArchivedDoorRow, type ArchivedRow, type BookingAvailability, type BookingDeclared, type BookingSummary, type BookingWindow, COMPUTE_ON, CONTEXT_POLICIES, type CaptureField, type CaptureFileRef, type CaptureOutcome, type CaptureQuestion, type CaptureQueue, type CaptureQueueCounts, type CaptureQueueOptions, type CaptureQueuePorts, type CaptureQueueStore, type CaptureSheetFace, type CaptureSheetSummary, type CaptureSyncReport, type ChecklistDeclared, type ChecklistRequirement, type ChecklistRequirementKind, type ChecklistRoleSpec, type ChecklistRunStarted, type ChecklistRunStep, type ChecklistRunSummary, type ChecklistSpec, type ChecklistStepCompleted, type ChecklistStepSpec, type ChecklistTemplateShape, type ChecklistTemplateSummary, type ChecklistTrigger, type ChecklistTriggerKind, type ChoiceOption, type ChoiceOptions, type CoerceOptions, type Coerced, type CoercedAnswers, type CoercibleField, type CommentThreadRead, type CommentWritten, type ComputeOn, type ContextPolicy, type ConversationScope, type ConversationScopeContext, type CustomFieldTableType, DECLARABLE_FIELD_KINDS, DEFAULT_ARCHIVE_LANE, DEFAULT_PORTAL_ARCHIVE_FILTER, DELIVERIES, type DashboardBlock, type DashboardBlockKind, type DashboardBlockResult, type DashboardRunResult, type DashboardSummary, type DeclarableFieldKind, type DecorationColor, type DecorationPath, type DecorationRule, type DecorationRuleOp, type DecorationTarget, type Delivery, type DigestPreview, type DocRenderRow, type DocSignatureCheck, type DocSignatureRow, type DocTemplateRow, type DocToken, type DocUnresolvedToken, ENTITY_TOKENS, type EnrichAlternate, type EnrichCell, type EnrichDeclared, type EnrichDueRow, type EnrichRun, type EnrichSource, type Enrichment, type EnrichmentSummary, type EntityFieldRights, type EntityFieldValue, type EntityRecordMatch, type EntityRecordRead, type EntityRecordsFound, type EntityTableFacts, type EntityToken, type ExampleBuilt, type ExampleSpec, type ExternalPrincipalCard, FIELD_KINDS, FIELD_SENSITIVITIES, FIELD_SOURCES, FRESHNESS, type Field, type FieldBehavior, type FieldHistoryEntry, type FieldKind, type FieldPatch, type FieldProposal, type FieldRule, type FieldSensitivity, type FieldSource, type FieldTypeWord, type ForbiddenEnvelopeWord, type FormSummary, type FormulaParse, type Freshness, type GridLayout, type GridLayoutMode, type GridRowHeight, type HiddenFieldNotice, type HistoryActor, type HistoryActorKind, type HistoryChange, type Home, type ImportBatchResult, type ImportColumnPlan, type ImportColumnsDeclared, type ImportFinished, type ImportOpened, type ImportOutcome, type ImportPlan, type ImportPolicy, type ImportProposal, type ImportReport, type ImportRun, type InboundAddress, type InboundDeclared, type IoExportPage, KERNEL_TABLES, type KernelTableName, type KernelTargets, MERGE_FIELD_MODIFIERS, MERGE_FIELD_SEMANTIC_TYPES, MERGE_FIELD_SOURCES, type MergeField, type MergeFieldModifier, type MergeFieldProvenance, type MergeFieldResolution, type MergeFieldSemanticType, type MergeFieldSource, type MergeFieldTransform, type MissingBehavior, type MyLevel, type MySubscription, type NewEntityFieldDeclaration, type NewFieldDeclaration, ON_DELETE, OVERRIDE_POLICIES, type OnDelete, type OverridePolicy, PARITY_FIELD_TYPES, PERMISSION_LEVELS, PER_VALUE_ACCESS_WORDS, PIPELINE_RULE_KINDS, PORTAL_ARCHIVE_FILTERS, type ParityFieldType, type ParityFieldTypeDescriptor, type PerValueAccessWord, type PermissionLevel, type PgError, type Pipeline, type PipelineColumn, type PipelineDeclared, type PipelineGate, type PipelineGatePreview, type PipelineMissingField, type PipelineMoveResult, type PipelineRule, type PipelineRuleKind, type PipelineSpec, type PipelineStage, type PipelineVerdict, type PortalArchiveAnswer, type PortalArchiveFilter, type PortalCard, type PortalInvitation, type PortalPreviewRow, type PortalPrincipal, type PortalRevocation, type PortalSummary, type PortalTableExposure, type PortalTableRef, type PredictedRefusal, type ProvenancePointer, type PublishBinding, type QueuedCapture, type QueuedCaptureFile, type QueuedCaptureState, type QuietHours, REFUSALS_WORTH_REPEATING, RELATION_BINDINGS, RELATION_CARDINALITIES, RELATION_FLAVORS, RETIRED_ACTOR_WORDS, RULE_NODE_KINDS, RULE_USES, type ReadRow, type ReadValue, type RecordChangeAction, type RecordComment, type RecordDocument, type RecordEvent, type RecordFilter, type RecordGraphWritten, type RecordHistoryEntry, type RecordRead, type RecordRevision, type RecordScopeComment, type RecordScopeContext, type RecordScopeField, type RecordScopeHistoryEntry, type RecordScopeRelation, type RecordScopeWithheld, type RecordsActor, type RecordsChangeSink, type RecordsConfig, type RecordsDataSource, type RecordsError, type RecordsErrorCode, type RecordsErrorSink, type RecordsFilter, RecordsProvider, type RecordsProviderProps, type RecordsRealtimePort, type RecordsResolverPort, type RecordsResponse, type RecordsResult, type RecordsTableQuery, type RegisteredTable, type Relation, type RelationBinding, type RelationCardinality, type RelationCarries, type RelationCoordinate, type RelationDisplay, type RelationDisplaySpec, type RelationFlavor, type RelationProperties, type RelationStore, type RelationTarget, type RelationWordsManyArgs, type ResolutionTriple, type ResolvedPublishBinding, type RestorePreview, type RestoreResult, type RetiredActorWord, type RowAction, type RowActionStep, type Rule, type RuleAnswer, type RuleExpression, type RuleNodeKind, type RuleUse, STAGE_RULE_ENFORCEMENT, STAGE_RULE_ON_FAIL, STORAGE_MODES, STORE_DOORS, STORE_KNOBS, STORE_REFUSAL_CODES, type SavedViewRow, type SavedViewSpecIn, type StagePending, type StagePendingOnBoard, type StageRuleEnforcement, type StageRuleOnFail, type StageRuleWarning, type StaleWriteDetail, type StorageMode, type StoreDoorName, type StoreRefusalCode, type StoredRecord, type StuckRow, type Subscription, type SubscriptionBlock, type SubscriptionCadence, type SubscriptionSpec, TABLE_DISPLAYS, TABLE_ORIGINS, TABLE_TYPES, type Table, type TableArchiveProgress, type TableCapacity, type TableDecorations, type TableDisplay, type TableOrigin, type TableProposal, type TableType, type TableWebhook, type TableWebhookDeclared, type Timestamp, type UseEntityFieldMutation, type UseFieldMutation, type UseRecordMutation, type UseRecordsOptions, type UseRecordsState, type UseTableArchive, type Uuid, VALUE_ALTERNATE_KEYS, VALUE_ENVELOPE_KEYS, type ValueAlternate, type ValueAlternateKey, type ValueEnvelope, type ValueEnvelopeKey, type ValueSource, type ViewLayout, type WorkApprovalDecision, type WorkApprovalFiled, type WorkApprover, type WorkAssignment, type WorkAssignmentField, type WorkChange, type WorkDueState, type WorkGraph, type WorkInboxItem, type WorkInboxKind, type WorkInstantiation, type WorkListFlavour, type WorkListItem, type WorkOrigin, type WorkRecordState, type WorkSlotHold, type WorkState, type WorkTemplateNode, type WorkTemplateRelation, type WorkTurn, type WriteConflict, actionRefusals, archivedByLine, archivedWhen, asPermissionLevel, atLeast, bookingPath, choiceSlug, choiceValuesOf, choicesOf, coerceTypedAnswer, coerceTypedAnswers, coercionLabel, emptyArchiveLine, emptyPortalArchiveLine, err, exampleSpec, exportPageXlsx, fieldKindFor, forgetAllOps, highestLevel, holdsARetiredChoice, indexedDbStore, isArchiveLane, isDecided, isOwnOp, isPortalArchiveFilter, isRecordsErr, isTheChosen, looksLikeAnId, mayDrag, measureKey, memoryStore, mintClientKey, mintOpId, ok, openCaptureQueue, optionKey, optionLabel, portalArchiveConsequence, portalConfirmLine, portalPath, portalTitleTypedBack, publicFormPath, recordChangeTrigger, rememberedOpCount, sameDocument, scopeChip, stableFilterKey, tableShapeChanged, useEntityFieldMutation, useEntityFieldRights, useEntityFields, useEntityRecord, useEntityTable, useFieldMutation, useFields, useMergeField, useMyLevel, useMyLevels, useOptionalRecordsClient, useRecord, useRecordMutation, useRecords, useRecordsActor, useRecordsClient, useTable, useTableArchive, useTables };
|
|
10319
|
+
export { ABSENCE_REASONS, ACTOR_VOCABULARY, ARCHIVE_LANES, ARCHIVE_LANE_LABEL, ARCHIVE_LANE_MEANS, type AbsenceReason, type ActionRefusal, type ActionRunResult, type Actor, type AggregateBucket, type AggregateFilter, type AggregateMeasure, type AggregateOperation, type AggregateRow, type AggregateWindow, type AnonTokenBinding, type ArchiveLane, type ArchivedDoorRow, type ArchivedRow, type BookingAvailability, type BookingDeclared, type BookingSummary, type BookingWindow, COMPUTE_ON, CONTEXT_POLICIES, type CaptureField, type CaptureFileRef, type CaptureOutcome, type CaptureQuestion, type CaptureQueue, type CaptureQueueCounts, type CaptureQueueOptions, type CaptureQueuePorts, type CaptureQueueStore, type CaptureSheetFace, type CaptureSheetSummary, type CaptureSyncReport, type ChecklistDeclared, type ChecklistRequirement, type ChecklistRequirementKind, type ChecklistRoleSpec, type ChecklistRunStarted, type ChecklistRunStep, type ChecklistRunSummary, type ChecklistSpec, type ChecklistStepCompleted, type ChecklistStepSpec, type ChecklistTemplateShape, type ChecklistTemplateSummary, type ChecklistTrigger, type ChecklistTriggerKind, type ChoiceOption, type ChoiceOptions, type CoerceOptions, type Coerced, type CoercedAnswers, type CoercibleField, type CommentThreadRead, type CommentWritten, type ComputeOn, type ContextPolicy, type ConversationScope, type ConversationScopeContext, type CustomFieldTableType, DECLARABLE_FIELD_KINDS, DEFAULT_ARCHIVE_LANE, DEFAULT_PORTAL_ARCHIVE_FILTER, DELIVERIES, type DashboardBlock, type DashboardBlockKind, type DashboardBlockResult, type DashboardRunResult, type DashboardSummary, type DeclarableFieldKind, type DecorationColor, type DecorationPath, type DecorationRule, type DecorationRuleOp, type DecorationTarget, type Delivery, type DigestPreview, type DocRenderRow, type DocSignatureCheck, type DocSignatureRow, type DocTemplateRow, type DocToken, type DocUnresolvedToken, ENTITY_TOKENS, type EnrichAlternate, type EnrichCell, type EnrichDeclared, type EnrichDueRow, type EnrichRun, type EnrichSource, type Enrichment, type EnrichmentSummary, type EntityFieldRights, type EntityFieldValue, type EntityRecordMatch, type EntityRecordRead, type EntityRecordsFound, type EntityTableFacts, type EntityToken, type ExampleBuilt, type ExampleSpec, type ExternalPrincipalCard, FIELD_KINDS, FIELD_SENSITIVITIES, FIELD_SOURCES, FRESHNESS, type Field, type FieldBehavior, type FieldHistoryEntry, type FieldKind, type FieldPatch, type FieldProposal, type FieldRule, type FieldSensitivity, type FieldSource, type FieldTypeWord, type ForbiddenEnvelopeWord, type FormSummary, type FormulaParse, type Freshness, type GridLayout, type GridLayoutMode, type GridRowHeight, type HiddenFieldNotice, type HistoryActor, type HistoryActorKind, type HistoryChange, type Home, type ImportBatchResult, type ImportColumnPlan, type ImportColumnsDeclared, type ImportFinished, type ImportOpened, type ImportOutcome, type ImportPlan, type ImportPolicy, type ImportProposal, type ImportReport, type ImportRun, type InboundAddress, type InboundDeclared, type IoExportPage, KERNEL_TABLES, type KernelTableName, type KernelTargets, MERGE_FIELD_MODIFIERS, MERGE_FIELD_SEMANTIC_TYPES, MERGE_FIELD_SOURCES, type MergeField, type MergeFieldModifier, type MergeFieldProvenance, type MergeFieldResolution, type MergeFieldSemanticType, type MergeFieldSource, type MergeFieldTransform, type MissingBehavior, type MyLevel, type MySubscription, type NewEntityFieldDeclaration, type NewFieldDeclaration, ON_DELETE, OVERRIDE_POLICIES, type OnDelete, type OverridePolicy, PARITY_FIELD_TYPES, PERMISSION_LEVELS, PER_VALUE_ACCESS_WORDS, PIPELINE_RULE_KINDS, PORTAL_ARCHIVE_FILTERS, type ParityFieldType, type ParityFieldTypeDescriptor, type PerValueAccessWord, type PermissionLevel, type PgError, type Pipeline, type PipelineColumn, type PipelineDeclared, type PipelineGate, type PipelineGatePreview, type PipelineMissingField, type PipelineMoveResult, type PipelineRule, type PipelineRuleKind, type PipelineSpec, type PipelineStage, type PipelineVerdict, type PortalArchiveAnswer, type PortalArchiveFilter, type PortalCard, type PortalInvitation, type PortalPreviewRow, type PortalPrincipal, type PortalRevocation, type PortalSummary, type PortalTableExposure, type PortalTableRef, type PredictedRefusal, type ProvenancePointer, type PublishBinding, type QueuedCapture, type QueuedCaptureFile, type QueuedCaptureState, type QuietHours, REFUSALS_WORTH_REPEATING, RELATION_BINDINGS, RELATION_CARDINALITIES, RELATION_FLAVORS, RETIRED_ACTOR_WORDS, RULE_NODE_KINDS, RULE_USES, type ReadRow, type ReadValue, type RecordChangeAction, type RecordComment, type RecordDocument, type RecordEvent, type RecordFilter, type RecordGraphWritten, type RecordHistoryEntry, type RecordRead, type RecordRevision, type RecordScopeComment, type RecordScopeContext, type RecordScopeField, type RecordScopeHistoryEntry, type RecordScopeRelation, type RecordScopeWithheld, type RecordsActor, type RecordsChangeSink, type RecordsConfig, type RecordsDataSource, type RecordsError, type RecordsErrorCode, type RecordsErrorSink, type RecordsFilter, RecordsProvider, type RecordsProviderProps, type RecordsRealtimePort, type RecordsResolverPort, type RecordsResponse, type RecordsResult, type RecordsTableQuery, type RegisteredTable, type Relation, type RelationBinding, type RelationCardinality, type RelationCarries, type RelationCoordinate, type RelationDisplay, type RelationDisplaySpec, type RelationFlavor, type RelationProperties, type RelationStore, type RelationTarget, type RelationWordsManyArgs, type ResolutionTriple, type ResolvedPublishBinding, type RestorePreview, type RestoreResult, type RetiredActorWord, type RowAction, type RowActionStep, type Rule, type RuleAnswer, type RuleExpression, type RuleNodeKind, type RuleUse, STAGE_RULE_ENFORCEMENT, STAGE_RULE_ON_FAIL, STORAGE_MODES, STORE_DOORS, STORE_KNOBS, STORE_REFUSAL_CODES, type SavedViewRow, type SavedViewSpecIn, type StagePending, type StagePendingOnBoard, type StageRuleEnforcement, type StageRuleOnFail, type StageRuleWarning, type StaleWriteDetail, type StorageMode, type StoreDoorName, type StoreRefusalCode, type StoredRecord, type StuckRow, type Subscription, type SubscriptionBlock, type SubscriptionCadence, type SubscriptionSpec, TABLE_DISPLAYS, TABLE_ORIGINS, TABLE_TYPES, type Table, type TableArchiveProgress, type TableCapacity, type TableDecorations, type TableDisplay, type TableOrigin, type TableProposal, type TableType, type TableWebhook, type TableWebhookDeclared, type Timestamp, type UseEntityFieldMutation, type UseFieldMutation, type UseRecordMutation, type UseRecordsOptions, type UseRecordsState, type UseTableArchive, type Uuid, VALUE_ALTERNATE_KEYS, VALUE_ENVELOPE_KEYS, type ValueAlternate, type ValueAlternateKey, type ValueEnvelope, type ValueEnvelopeKey, type ValueSource, type ViewLayout, type WorkApprovalDecision, type WorkApprovalFiled, type WorkApprover, type WorkAssignment, type WorkAssignmentField, type WorkChange, type WorkDueState, type WorkGraph, type WorkInboxItem, type WorkInboxKind, type WorkInstantiation, type WorkListFlavour, type WorkListItem, type WorkOrigin, type WorkRecordState, type WorkSlotHold, type WorkState, type WorkTemplateNode, type WorkTemplateRelation, type WorkTurn, type WriteConflict, actionRefusals, allowsOtherValues, archivedByLine, archivedWhen, asPermissionLevel, atLeast, bookingPath, choiceSlug, choiceValuesOf, choicesOf, coerceTypedAnswer, coerceTypedAnswers, coercionLabel, emptyArchiveLine, emptyPortalArchiveLine, err, exampleSpec, exportPageXlsx, fieldKindFor, forgetAllOps, highestLevel, holdsARetiredChoice, indexedDbStore, isArchiveLane, isDecided, isOwnOp, isPortalArchiveFilter, isRecordsErr, isTheChosen, looksLikeAnId, mayDrag, measureKey, memoryStore, mintClientKey, mintOpId, ok, openCaptureQueue, optionKey, optionLabel, portalArchiveConsequence, portalConfirmLine, portalPath, portalTitleTypedBack, publicFormPath, recordChangeTrigger, rememberedOpCount, sameDocument, scopeChip, stableFilterKey, tableShapeChanged, useEntityFieldMutation, useEntityFieldRights, useEntityFields, useEntityRecord, useEntityTable, useFieldMutation, useFields, useMergeField, useMyLevel, useMyLevels, useOptionalRecordsClient, useRecord, useRecordChangeRevision, useRecordMutation, useRecords, useRecordsActor, useRecordsClient, useTable, useTableArchive, useTables };
|
package/dist/react/index.d.ts
CHANGED
|
@@ -4029,6 +4029,8 @@ interface PredictedRefusal {
|
|
|
4029
4029
|
/** The message the store's own body would raise, word for word. */
|
|
4030
4030
|
message: string;
|
|
4031
4031
|
hint?: string;
|
|
4032
|
+
/** The store's structured detail, when its refusal carries one (e.g. `{ example }`). */
|
|
4033
|
+
detail?: Record<string, unknown>;
|
|
4032
4034
|
sqlstate: string;
|
|
4033
4035
|
/**
|
|
4034
4036
|
* Which of the store's bodies would raise it, so a reader can go and check
|
|
@@ -4462,7 +4464,25 @@ interface TableArchiveProgress {
|
|
|
4462
4464
|
/** FLD-3. A constraint attached to a Field. A Rule, never a behaviour. */
|
|
4463
4465
|
interface FieldRule {
|
|
4464
4466
|
kind: "min" | "max" | "length" | "pattern" | "equals_field" | "differs_from_field";
|
|
4465
|
-
|
|
4467
|
+
/**
|
|
4468
|
+
* The rule's own number or word: the least / the most for `min` / `max`, the
|
|
4469
|
+
* LONGEST for `length`, the pattern for `pattern`, the other column's key for
|
|
4470
|
+
* `equals_field` / `differs_from_field`. A `length` rule that only says how
|
|
4471
|
+
* SHORT a value may be carries `min` and no `value`.
|
|
4472
|
+
*/
|
|
4473
|
+
value?: string | number;
|
|
4474
|
+
/**
|
|
4475
|
+
* STORE-RULE-GAPS (the older grid's `patternHint`). On a `pattern` rule only:
|
|
4476
|
+
* how a person writes it, e.g. `"949-555-0142"`. The store refuses an example
|
|
4477
|
+
* its own pattern would refuse, and a refused value is told "Enter it like
|
|
4478
|
+
* 949-555-0142." (the hint, and `detail.example`).
|
|
4479
|
+
*/
|
|
4480
|
+
example?: string;
|
|
4481
|
+
/**
|
|
4482
|
+
* STORE-RULE-GAPS (the older grid's `minLength`). On a `length` rule only: the
|
|
4483
|
+
* fewest characters. A blank is `required`'s question, never "too short".
|
|
4484
|
+
*/
|
|
4485
|
+
min?: number;
|
|
4466
4486
|
/** FLD-10. Empty means "wherever the Field applies". */
|
|
4467
4487
|
applies_to_types?: string[];
|
|
4468
4488
|
}
|
|
@@ -4667,6 +4687,12 @@ interface NewFieldDeclaration {
|
|
|
4667
4687
|
config?: Record<string, unknown>;
|
|
4668
4688
|
/** A text column that holds a signature (`custom.doc_sign` accepts no other). */
|
|
4669
4689
|
format?: string;
|
|
4690
|
+
/**
|
|
4691
|
+
* STORE-RULE-GAPS (the older grid's `allowOther`). A choice list only: a value
|
|
4692
|
+
* that is none of the choices is ADDED to the list as typed instead of
|
|
4693
|
+
* refused. Stored as `config.allow_other`; absent means off.
|
|
4694
|
+
*/
|
|
4695
|
+
allow_other?: boolean;
|
|
4670
4696
|
}
|
|
4671
4697
|
/**
|
|
4672
4698
|
* Every word `custom._field_document_for` resolves for `type`: any parity type
|
|
@@ -4736,6 +4762,12 @@ interface FieldPatch {
|
|
|
4736
4762
|
/** SEAT-SUITES: whether the store builds an index for this column, and a unique one. */
|
|
4737
4763
|
promoted?: boolean;
|
|
4738
4764
|
unique?: boolean;
|
|
4765
|
+
/**
|
|
4766
|
+
* STORE-RULE-GAPS. A choice list's "other values allowed" setting — see
|
|
4767
|
+
* `NewFieldDeclaration.allow_other`. Refused by name on any other column; a
|
|
4768
|
+
* retype that stays a list keeps it.
|
|
4769
|
+
*/
|
|
4770
|
+
allow_other?: boolean;
|
|
4739
4771
|
/** §D / T7: which fields a worked-out column reads. */
|
|
4740
4772
|
depends_on?: Uuid[];
|
|
4741
4773
|
/**
|
|
@@ -4774,6 +4806,11 @@ interface FieldPatch {
|
|
|
4774
4806
|
*/
|
|
4775
4807
|
expr?: Record<string, unknown>;
|
|
4776
4808
|
}
|
|
4809
|
+
/**
|
|
4810
|
+
* Whether a choice column takes values that are not one of its choices
|
|
4811
|
+
* (`config.allow_other`, STORE-RULE-GAPS). Off unless the column says so.
|
|
4812
|
+
*/
|
|
4813
|
+
declare function allowsOtherValues(field: Pick<Field, "type" | "config">): boolean;
|
|
4777
4814
|
|
|
4778
4815
|
/** One option, as `_choices` names it and as `optionsOf` returns it. */
|
|
4779
4816
|
interface ChoiceOption {
|
|
@@ -8610,6 +8647,16 @@ interface RecordsClient {
|
|
|
8610
8647
|
total: number | null;
|
|
8611
8648
|
}>>;
|
|
8612
8649
|
tableList(): Promise<RecordsResult<Table[]>>;
|
|
8650
|
+
/**
|
|
8651
|
+
* IS THIS TABLE IN THE ARCHIVE? (lane HUB-FIX, 2026-09-23.) The archived row for one
|
|
8652
|
+
* Table of this organization, or `null` when the archive does not hold it — which
|
|
8653
|
+
* is an ANSWER, never "it may have been deleted". A table page that cannot find a
|
|
8654
|
+
* Table asks this before saying anything: an archived Table's own address used to
|
|
8655
|
+
* read "…or it may have been deleted" when it was archived and one click from back.
|
|
8656
|
+
*/
|
|
8657
|
+
tableArchived(args: {
|
|
8658
|
+
table_id: Uuid;
|
|
8659
|
+
}): Promise<RecordsResult<ArchivedRow | null>>;
|
|
8613
8660
|
fields(args: {
|
|
8614
8661
|
table_id: Uuid;
|
|
8615
8662
|
recordType?: string;
|
|
@@ -10081,6 +10128,13 @@ interface UseRecordsState extends Async<{
|
|
|
10081
10128
|
/** A page of records, realtime-aware when the host bound the port. */
|
|
10082
10129
|
declare function useRecords(tableId: Uuid | null, options?: UseRecordsOptions): UseRecordsState;
|
|
10083
10130
|
/** One record, its values and (optionally) which Rule version computed each. */
|
|
10131
|
+
/**
|
|
10132
|
+
* HOW MANY TIMES THIS PAGE HAS WRITTEN THIS RECORD (lane RECORDS-UI-FIX, 2026-09-23).
|
|
10133
|
+
* A screen that shows a record puts this in its read's dependencies and re-reads when a
|
|
10134
|
+
* write through any client on the page lands on it — the record panel's history read
|
|
10135
|
+
* "3 versions" after its fourth write because nothing told it. See `core/recordChanges`.
|
|
10136
|
+
*/
|
|
10137
|
+
declare function useRecordChangeRevision(recordId: Uuid | null | undefined): number;
|
|
10084
10138
|
declare function useRecord(recordId: Uuid | null, withComputed?: boolean): Async<RecordRead | null>;
|
|
10085
10139
|
interface UseRecordMutation {
|
|
10086
10140
|
write: (args: {
|
|
@@ -10262,4 +10316,4 @@ declare function useFieldMutation(): UseFieldMutation;
|
|
|
10262
10316
|
*/
|
|
10263
10317
|
declare function useMergeField(key: string | null, state?: Record<string, unknown>): MergeFieldResolution | null;
|
|
10264
10318
|
|
|
10265
|
-
export { ABSENCE_REASONS, ACTOR_VOCABULARY, ARCHIVE_LANES, ARCHIVE_LANE_LABEL, ARCHIVE_LANE_MEANS, type AbsenceReason, type ActionRefusal, type ActionRunResult, type Actor, type AggregateBucket, type AggregateFilter, type AggregateMeasure, type AggregateOperation, type AggregateRow, type AggregateWindow, type AnonTokenBinding, type ArchiveLane, type ArchivedDoorRow, type ArchivedRow, type BookingAvailability, type BookingDeclared, type BookingSummary, type BookingWindow, COMPUTE_ON, CONTEXT_POLICIES, type CaptureField, type CaptureFileRef, type CaptureOutcome, type CaptureQuestion, type CaptureQueue, type CaptureQueueCounts, type CaptureQueueOptions, type CaptureQueuePorts, type CaptureQueueStore, type CaptureSheetFace, type CaptureSheetSummary, type CaptureSyncReport, type ChecklistDeclared, type ChecklistRequirement, type ChecklistRequirementKind, type ChecklistRoleSpec, type ChecklistRunStarted, type ChecklistRunStep, type ChecklistRunSummary, type ChecklistSpec, type ChecklistStepCompleted, type ChecklistStepSpec, type ChecklistTemplateShape, type ChecklistTemplateSummary, type ChecklistTrigger, type ChecklistTriggerKind, type ChoiceOption, type ChoiceOptions, type CoerceOptions, type Coerced, type CoercedAnswers, type CoercibleField, type CommentThreadRead, type CommentWritten, type ComputeOn, type ContextPolicy, type ConversationScope, type ConversationScopeContext, type CustomFieldTableType, DECLARABLE_FIELD_KINDS, DEFAULT_ARCHIVE_LANE, DEFAULT_PORTAL_ARCHIVE_FILTER, DELIVERIES, type DashboardBlock, type DashboardBlockKind, type DashboardBlockResult, type DashboardRunResult, type DashboardSummary, type DeclarableFieldKind, type DecorationColor, type DecorationPath, type DecorationRule, type DecorationRuleOp, type DecorationTarget, type Delivery, type DigestPreview, type DocRenderRow, type DocSignatureCheck, type DocSignatureRow, type DocTemplateRow, type DocToken, type DocUnresolvedToken, ENTITY_TOKENS, type EnrichAlternate, type EnrichCell, type EnrichDeclared, type EnrichDueRow, type EnrichRun, type EnrichSource, type Enrichment, type EnrichmentSummary, type EntityFieldRights, type EntityFieldValue, type EntityRecordMatch, type EntityRecordRead, type EntityRecordsFound, type EntityTableFacts, type EntityToken, type ExampleBuilt, type ExampleSpec, type ExternalPrincipalCard, FIELD_KINDS, FIELD_SENSITIVITIES, FIELD_SOURCES, FRESHNESS, type Field, type FieldBehavior, type FieldHistoryEntry, type FieldKind, type FieldPatch, type FieldProposal, type FieldRule, type FieldSensitivity, type FieldSource, type FieldTypeWord, type ForbiddenEnvelopeWord, type FormSummary, type FormulaParse, type Freshness, type GridLayout, type GridLayoutMode, type GridRowHeight, type HiddenFieldNotice, type HistoryActor, type HistoryActorKind, type HistoryChange, type Home, type ImportBatchResult, type ImportColumnPlan, type ImportColumnsDeclared, type ImportFinished, type ImportOpened, type ImportOutcome, type ImportPlan, type ImportPolicy, type ImportProposal, type ImportReport, type ImportRun, type InboundAddress, type InboundDeclared, type IoExportPage, KERNEL_TABLES, type KernelTableName, type KernelTargets, MERGE_FIELD_MODIFIERS, MERGE_FIELD_SEMANTIC_TYPES, MERGE_FIELD_SOURCES, type MergeField, type MergeFieldModifier, type MergeFieldProvenance, type MergeFieldResolution, type MergeFieldSemanticType, type MergeFieldSource, type MergeFieldTransform, type MissingBehavior, type MyLevel, type MySubscription, type NewEntityFieldDeclaration, type NewFieldDeclaration, ON_DELETE, OVERRIDE_POLICIES, type OnDelete, type OverridePolicy, PARITY_FIELD_TYPES, PERMISSION_LEVELS, PER_VALUE_ACCESS_WORDS, PIPELINE_RULE_KINDS, PORTAL_ARCHIVE_FILTERS, type ParityFieldType, type ParityFieldTypeDescriptor, type PerValueAccessWord, type PermissionLevel, type PgError, type Pipeline, type PipelineColumn, type PipelineDeclared, type PipelineGate, type PipelineGatePreview, type PipelineMissingField, type PipelineMoveResult, type PipelineRule, type PipelineRuleKind, type PipelineSpec, type PipelineStage, type PipelineVerdict, type PortalArchiveAnswer, type PortalArchiveFilter, type PortalCard, type PortalInvitation, type PortalPreviewRow, type PortalPrincipal, type PortalRevocation, type PortalSummary, type PortalTableExposure, type PortalTableRef, type PredictedRefusal, type ProvenancePointer, type PublishBinding, type QueuedCapture, type QueuedCaptureFile, type QueuedCaptureState, type QuietHours, REFUSALS_WORTH_REPEATING, RELATION_BINDINGS, RELATION_CARDINALITIES, RELATION_FLAVORS, RETIRED_ACTOR_WORDS, RULE_NODE_KINDS, RULE_USES, type ReadRow, type ReadValue, type RecordChangeAction, type RecordComment, type RecordDocument, type RecordEvent, type RecordFilter, type RecordGraphWritten, type RecordHistoryEntry, type RecordRead, type RecordRevision, type RecordScopeComment, type RecordScopeContext, type RecordScopeField, type RecordScopeHistoryEntry, type RecordScopeRelation, type RecordScopeWithheld, type RecordsActor, type RecordsChangeSink, type RecordsConfig, type RecordsDataSource, type RecordsError, type RecordsErrorCode, type RecordsErrorSink, type RecordsFilter, RecordsProvider, type RecordsProviderProps, type RecordsRealtimePort, type RecordsResolverPort, type RecordsResponse, type RecordsResult, type RecordsTableQuery, type RegisteredTable, type Relation, type RelationBinding, type RelationCardinality, type RelationCarries, type RelationCoordinate, type RelationDisplay, type RelationDisplaySpec, type RelationFlavor, type RelationProperties, type RelationStore, type RelationTarget, type RelationWordsManyArgs, type ResolutionTriple, type ResolvedPublishBinding, type RestorePreview, type RestoreResult, type RetiredActorWord, type RowAction, type RowActionStep, type Rule, type RuleAnswer, type RuleExpression, type RuleNodeKind, type RuleUse, STAGE_RULE_ENFORCEMENT, STAGE_RULE_ON_FAIL, STORAGE_MODES, STORE_DOORS, STORE_KNOBS, STORE_REFUSAL_CODES, type SavedViewRow, type SavedViewSpecIn, type StagePending, type StagePendingOnBoard, type StageRuleEnforcement, type StageRuleOnFail, type StageRuleWarning, type StaleWriteDetail, type StorageMode, type StoreDoorName, type StoreRefusalCode, type StoredRecord, type StuckRow, type Subscription, type SubscriptionBlock, type SubscriptionCadence, type SubscriptionSpec, TABLE_DISPLAYS, TABLE_ORIGINS, TABLE_TYPES, type Table, type TableArchiveProgress, type TableCapacity, type TableDecorations, type TableDisplay, type TableOrigin, type TableProposal, type TableType, type TableWebhook, type TableWebhookDeclared, type Timestamp, type UseEntityFieldMutation, type UseFieldMutation, type UseRecordMutation, type UseRecordsOptions, type UseRecordsState, type UseTableArchive, type Uuid, VALUE_ALTERNATE_KEYS, VALUE_ENVELOPE_KEYS, type ValueAlternate, type ValueAlternateKey, type ValueEnvelope, type ValueEnvelopeKey, type ValueSource, type ViewLayout, type WorkApprovalDecision, type WorkApprovalFiled, type WorkApprover, type WorkAssignment, type WorkAssignmentField, type WorkChange, type WorkDueState, type WorkGraph, type WorkInboxItem, type WorkInboxKind, type WorkInstantiation, type WorkListFlavour, type WorkListItem, type WorkOrigin, type WorkRecordState, type WorkSlotHold, type WorkState, type WorkTemplateNode, type WorkTemplateRelation, type WorkTurn, type WriteConflict, actionRefusals, archivedByLine, archivedWhen, asPermissionLevel, atLeast, bookingPath, choiceSlug, choiceValuesOf, choicesOf, coerceTypedAnswer, coerceTypedAnswers, coercionLabel, emptyArchiveLine, emptyPortalArchiveLine, err, exampleSpec, exportPageXlsx, fieldKindFor, forgetAllOps, highestLevel, holdsARetiredChoice, indexedDbStore, isArchiveLane, isDecided, isOwnOp, isPortalArchiveFilter, isRecordsErr, isTheChosen, looksLikeAnId, mayDrag, measureKey, memoryStore, mintClientKey, mintOpId, ok, openCaptureQueue, optionKey, optionLabel, portalArchiveConsequence, portalConfirmLine, portalPath, portalTitleTypedBack, publicFormPath, recordChangeTrigger, rememberedOpCount, sameDocument, scopeChip, stableFilterKey, tableShapeChanged, useEntityFieldMutation, useEntityFieldRights, useEntityFields, useEntityRecord, useEntityTable, useFieldMutation, useFields, useMergeField, useMyLevel, useMyLevels, useOptionalRecordsClient, useRecord, useRecordMutation, useRecords, useRecordsActor, useRecordsClient, useTable, useTableArchive, useTables };
|
|
10319
|
+
export { ABSENCE_REASONS, ACTOR_VOCABULARY, ARCHIVE_LANES, ARCHIVE_LANE_LABEL, ARCHIVE_LANE_MEANS, type AbsenceReason, type ActionRefusal, type ActionRunResult, type Actor, type AggregateBucket, type AggregateFilter, type AggregateMeasure, type AggregateOperation, type AggregateRow, type AggregateWindow, type AnonTokenBinding, type ArchiveLane, type ArchivedDoorRow, type ArchivedRow, type BookingAvailability, type BookingDeclared, type BookingSummary, type BookingWindow, COMPUTE_ON, CONTEXT_POLICIES, type CaptureField, type CaptureFileRef, type CaptureOutcome, type CaptureQuestion, type CaptureQueue, type CaptureQueueCounts, type CaptureQueueOptions, type CaptureQueuePorts, type CaptureQueueStore, type CaptureSheetFace, type CaptureSheetSummary, type CaptureSyncReport, type ChecklistDeclared, type ChecklistRequirement, type ChecklistRequirementKind, type ChecklistRoleSpec, type ChecklistRunStarted, type ChecklistRunStep, type ChecklistRunSummary, type ChecklistSpec, type ChecklistStepCompleted, type ChecklistStepSpec, type ChecklistTemplateShape, type ChecklistTemplateSummary, type ChecklistTrigger, type ChecklistTriggerKind, type ChoiceOption, type ChoiceOptions, type CoerceOptions, type Coerced, type CoercedAnswers, type CoercibleField, type CommentThreadRead, type CommentWritten, type ComputeOn, type ContextPolicy, type ConversationScope, type ConversationScopeContext, type CustomFieldTableType, DECLARABLE_FIELD_KINDS, DEFAULT_ARCHIVE_LANE, DEFAULT_PORTAL_ARCHIVE_FILTER, DELIVERIES, type DashboardBlock, type DashboardBlockKind, type DashboardBlockResult, type DashboardRunResult, type DashboardSummary, type DeclarableFieldKind, type DecorationColor, type DecorationPath, type DecorationRule, type DecorationRuleOp, type DecorationTarget, type Delivery, type DigestPreview, type DocRenderRow, type DocSignatureCheck, type DocSignatureRow, type DocTemplateRow, type DocToken, type DocUnresolvedToken, ENTITY_TOKENS, type EnrichAlternate, type EnrichCell, type EnrichDeclared, type EnrichDueRow, type EnrichRun, type EnrichSource, type Enrichment, type EnrichmentSummary, type EntityFieldRights, type EntityFieldValue, type EntityRecordMatch, type EntityRecordRead, type EntityRecordsFound, type EntityTableFacts, type EntityToken, type ExampleBuilt, type ExampleSpec, type ExternalPrincipalCard, FIELD_KINDS, FIELD_SENSITIVITIES, FIELD_SOURCES, FRESHNESS, type Field, type FieldBehavior, type FieldHistoryEntry, type FieldKind, type FieldPatch, type FieldProposal, type FieldRule, type FieldSensitivity, type FieldSource, type FieldTypeWord, type ForbiddenEnvelopeWord, type FormSummary, type FormulaParse, type Freshness, type GridLayout, type GridLayoutMode, type GridRowHeight, type HiddenFieldNotice, type HistoryActor, type HistoryActorKind, type HistoryChange, type Home, type ImportBatchResult, type ImportColumnPlan, type ImportColumnsDeclared, type ImportFinished, type ImportOpened, type ImportOutcome, type ImportPlan, type ImportPolicy, type ImportProposal, type ImportReport, type ImportRun, type InboundAddress, type InboundDeclared, type IoExportPage, KERNEL_TABLES, type KernelTableName, type KernelTargets, MERGE_FIELD_MODIFIERS, MERGE_FIELD_SEMANTIC_TYPES, MERGE_FIELD_SOURCES, type MergeField, type MergeFieldModifier, type MergeFieldProvenance, type MergeFieldResolution, type MergeFieldSemanticType, type MergeFieldSource, type MergeFieldTransform, type MissingBehavior, type MyLevel, type MySubscription, type NewEntityFieldDeclaration, type NewFieldDeclaration, ON_DELETE, OVERRIDE_POLICIES, type OnDelete, type OverridePolicy, PARITY_FIELD_TYPES, PERMISSION_LEVELS, PER_VALUE_ACCESS_WORDS, PIPELINE_RULE_KINDS, PORTAL_ARCHIVE_FILTERS, type ParityFieldType, type ParityFieldTypeDescriptor, type PerValueAccessWord, type PermissionLevel, type PgError, type Pipeline, type PipelineColumn, type PipelineDeclared, type PipelineGate, type PipelineGatePreview, type PipelineMissingField, type PipelineMoveResult, type PipelineRule, type PipelineRuleKind, type PipelineSpec, type PipelineStage, type PipelineVerdict, type PortalArchiveAnswer, type PortalArchiveFilter, type PortalCard, type PortalInvitation, type PortalPreviewRow, type PortalPrincipal, type PortalRevocation, type PortalSummary, type PortalTableExposure, type PortalTableRef, type PredictedRefusal, type ProvenancePointer, type PublishBinding, type QueuedCapture, type QueuedCaptureFile, type QueuedCaptureState, type QuietHours, REFUSALS_WORTH_REPEATING, RELATION_BINDINGS, RELATION_CARDINALITIES, RELATION_FLAVORS, RETIRED_ACTOR_WORDS, RULE_NODE_KINDS, RULE_USES, type ReadRow, type ReadValue, type RecordChangeAction, type RecordComment, type RecordDocument, type RecordEvent, type RecordFilter, type RecordGraphWritten, type RecordHistoryEntry, type RecordRead, type RecordRevision, type RecordScopeComment, type RecordScopeContext, type RecordScopeField, type RecordScopeHistoryEntry, type RecordScopeRelation, type RecordScopeWithheld, type RecordsActor, type RecordsChangeSink, type RecordsConfig, type RecordsDataSource, type RecordsError, type RecordsErrorCode, type RecordsErrorSink, type RecordsFilter, RecordsProvider, type RecordsProviderProps, type RecordsRealtimePort, type RecordsResolverPort, type RecordsResponse, type RecordsResult, type RecordsTableQuery, type RegisteredTable, type Relation, type RelationBinding, type RelationCardinality, type RelationCarries, type RelationCoordinate, type RelationDisplay, type RelationDisplaySpec, type RelationFlavor, type RelationProperties, type RelationStore, type RelationTarget, type RelationWordsManyArgs, type ResolutionTriple, type ResolvedPublishBinding, type RestorePreview, type RestoreResult, type RetiredActorWord, type RowAction, type RowActionStep, type Rule, type RuleAnswer, type RuleExpression, type RuleNodeKind, type RuleUse, STAGE_RULE_ENFORCEMENT, STAGE_RULE_ON_FAIL, STORAGE_MODES, STORE_DOORS, STORE_KNOBS, STORE_REFUSAL_CODES, type SavedViewRow, type SavedViewSpecIn, type StagePending, type StagePendingOnBoard, type StageRuleEnforcement, type StageRuleOnFail, type StageRuleWarning, type StaleWriteDetail, type StorageMode, type StoreDoorName, type StoreRefusalCode, type StoredRecord, type StuckRow, type Subscription, type SubscriptionBlock, type SubscriptionCadence, type SubscriptionSpec, TABLE_DISPLAYS, TABLE_ORIGINS, TABLE_TYPES, type Table, type TableArchiveProgress, type TableCapacity, type TableDecorations, type TableDisplay, type TableOrigin, type TableProposal, type TableType, type TableWebhook, type TableWebhookDeclared, type Timestamp, type UseEntityFieldMutation, type UseFieldMutation, type UseRecordMutation, type UseRecordsOptions, type UseRecordsState, type UseTableArchive, type Uuid, VALUE_ALTERNATE_KEYS, VALUE_ENVELOPE_KEYS, type ValueAlternate, type ValueAlternateKey, type ValueEnvelope, type ValueEnvelopeKey, type ValueSource, type ViewLayout, type WorkApprovalDecision, type WorkApprovalFiled, type WorkApprover, type WorkAssignment, type WorkAssignmentField, type WorkChange, type WorkDueState, type WorkGraph, type WorkInboxItem, type WorkInboxKind, type WorkInstantiation, type WorkListFlavour, type WorkListItem, type WorkOrigin, type WorkRecordState, type WorkSlotHold, type WorkState, type WorkTemplateNode, type WorkTemplateRelation, type WorkTurn, type WriteConflict, actionRefusals, allowsOtherValues, archivedByLine, archivedWhen, asPermissionLevel, atLeast, bookingPath, choiceSlug, choiceValuesOf, choicesOf, coerceTypedAnswer, coerceTypedAnswers, coercionLabel, emptyArchiveLine, emptyPortalArchiveLine, err, exampleSpec, exportPageXlsx, fieldKindFor, forgetAllOps, highestLevel, holdsARetiredChoice, indexedDbStore, isArchiveLane, isDecided, isOwnOp, isPortalArchiveFilter, isRecordsErr, isTheChosen, looksLikeAnId, mayDrag, measureKey, memoryStore, mintClientKey, mintOpId, ok, openCaptureQueue, optionKey, optionLabel, portalArchiveConsequence, portalConfirmLine, portalPath, portalTitleTypedBack, publicFormPath, recordChangeTrigger, rememberedOpCount, sameDocument, scopeChip, stableFilterKey, tableShapeChanged, useEntityFieldMutation, useEntityFieldRights, useEntityFields, useEntityRecord, useEntityTable, useFieldMutation, useFields, useMergeField, useMyLevel, useMyLevels, useOptionalRecordsClient, useRecord, useRecordChangeRevision, useRecordMutation, useRecords, useRecordsActor, useRecordsClient, useTable, useTableArchive, useTables };
|
package/dist/react/index.js
CHANGED
|
@@ -4895,6 +4895,22 @@ function staleWriteDetail(error) {
|
|
|
4895
4895
|
};
|
|
4896
4896
|
}
|
|
4897
4897
|
|
|
4898
|
+
// src/core/recordChanges.ts
|
|
4899
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
4900
|
+
function announceRecordChanged(recordId) {
|
|
4901
|
+
for (const listener of [...listeners]) {
|
|
4902
|
+
try {
|
|
4903
|
+
listener(recordId);
|
|
4904
|
+
} catch (thrown) {
|
|
4905
|
+
console.error("[@ai-matrx/records] a record-change listener threw", thrown);
|
|
4906
|
+
}
|
|
4907
|
+
}
|
|
4908
|
+
}
|
|
4909
|
+
function onRecordChanged(listener) {
|
|
4910
|
+
listeners.add(listener);
|
|
4911
|
+
return () => listeners.delete(listener);
|
|
4912
|
+
}
|
|
4913
|
+
|
|
4898
4914
|
// src/core/query.ts
|
|
4899
4915
|
var DEFAULT_PAGE_SIZE = 50;
|
|
4900
4916
|
function planQuery(query) {
|
|
@@ -4936,12 +4952,22 @@ function intersectIds(sets) {
|
|
|
4936
4952
|
|
|
4937
4953
|
// src/core/client.ts
|
|
4938
4954
|
var DEFAULT_SCHEMA = "custom";
|
|
4955
|
+
var A_PERSONS_REFUSAL = /* @__PURE__ */ new Set([
|
|
4956
|
+
"refused_by_rule",
|
|
4957
|
+
"stale_write",
|
|
4958
|
+
"invalid_argument",
|
|
4959
|
+
"already_exists",
|
|
4960
|
+
"missing_reference"
|
|
4961
|
+
]);
|
|
4962
|
+
function isAPersonsRefusal(code) {
|
|
4963
|
+
return A_PERSONS_REFUSAL.has(code);
|
|
4964
|
+
}
|
|
4939
4965
|
function sink(config) {
|
|
4940
|
-
return config.onError ?? ((e) =>
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
console.error(
|
|
4944
|
-
)
|
|
4966
|
+
return config.onError ?? ((e) => {
|
|
4967
|
+
const line = `[@ai-matrx/records] ${e.where}: ${e.code} \u2014 ${e.message}${e.hint ? ` (${e.hint})` : ""}`;
|
|
4968
|
+
if (isAPersonsRefusal(e.code)) console.info(line);
|
|
4969
|
+
else console.error(line);
|
|
4970
|
+
});
|
|
4945
4971
|
}
|
|
4946
4972
|
function createRecordsClient(config) {
|
|
4947
4973
|
const schema = config.schema ?? DEFAULT_SCHEMA;
|
|
@@ -5048,21 +5074,26 @@ function createRecordsClient(config) {
|
|
|
5048
5074
|
},
|
|
5049
5075
|
"recordUpdate"
|
|
5050
5076
|
);
|
|
5077
|
+
if (result.ok) announceRecordChanged(record_id);
|
|
5051
5078
|
return result;
|
|
5052
5079
|
},
|
|
5053
5080
|
async recordDelete({ record_id }) {
|
|
5054
|
-
|
|
5081
|
+
const result = await callDoor(
|
|
5055
5082
|
DOORS.recordDelete,
|
|
5056
5083
|
{ p_organization_id: org, p_record_id: record_id },
|
|
5057
5084
|
"recordDelete"
|
|
5058
5085
|
);
|
|
5086
|
+
if (result.ok) announceRecordChanged(record_id);
|
|
5087
|
+
return result;
|
|
5059
5088
|
},
|
|
5060
5089
|
async recordRestore({ record_id }) {
|
|
5061
|
-
|
|
5090
|
+
const result = await callDoor(
|
|
5062
5091
|
DOORS.recordRestore,
|
|
5063
5092
|
{ p_organization_id: org, p_record_id: record_id },
|
|
5064
5093
|
"recordRestore"
|
|
5065
5094
|
);
|
|
5095
|
+
if (result.ok) announceRecordChanged(record_id);
|
|
5096
|
+
return result;
|
|
5066
5097
|
},
|
|
5067
5098
|
async tableArchive({ table_id, chunk, includeTable }) {
|
|
5068
5099
|
return callDoor(
|
|
@@ -5112,6 +5143,24 @@ function createRecordsClient(config) {
|
|
|
5112
5143
|
})
|
|
5113
5144
|
);
|
|
5114
5145
|
},
|
|
5146
|
+
async tableArchived({ table_id }) {
|
|
5147
|
+
const kernel = await callDoor(DOORS.tableKernelId, {}, "tableArchived.kernel");
|
|
5148
|
+
if (!kernel.ok) return err(kernel.error);
|
|
5149
|
+
const PAGE = 200;
|
|
5150
|
+
for (let page = 0; page < 25; page += 1) {
|
|
5151
|
+
const answered = await this.listArchived({
|
|
5152
|
+
table_id: kernel.data,
|
|
5153
|
+
lane: "org",
|
|
5154
|
+
limit: PAGE,
|
|
5155
|
+
offset: page * PAGE
|
|
5156
|
+
});
|
|
5157
|
+
if (!answered.ok) return err(answered.error);
|
|
5158
|
+
const hit = answered.data.rows.find((row) => row.id === table_id);
|
|
5159
|
+
if (hit) return ok(hit);
|
|
5160
|
+
if (answered.data.total !== null) return ok(null);
|
|
5161
|
+
}
|
|
5162
|
+
return ok(null);
|
|
5163
|
+
},
|
|
5115
5164
|
async listArchived({ table_id, lane = DEFAULT_ARCHIVE_LANE, limit = 50, offset = 0 }) {
|
|
5116
5165
|
const door = await callDoor(
|
|
5117
5166
|
DOORS.readRecordsArchived,
|
|
@@ -5313,9 +5362,11 @@ function createRecordsClient(config) {
|
|
|
5313
5362
|
);
|
|
5314
5363
|
},
|
|
5315
5364
|
async fieldDeclare({ table_id, spec }) {
|
|
5365
|
+
const { allow_other, ...rest } = spec;
|
|
5366
|
+
const p_spec = allow_other === void 0 ? rest : { ...rest, config: { ...rest.config ?? {}, allow_other } };
|
|
5316
5367
|
return callDoor(
|
|
5317
5368
|
DOORS.fieldDeclare,
|
|
5318
|
-
{ p_organization_id: org, p_table_id: table_id, p_spec
|
|
5369
|
+
{ p_organization_id: org, p_table_id: table_id, p_spec },
|
|
5319
5370
|
"fieldDeclare"
|
|
5320
5371
|
);
|
|
5321
5372
|
},
|
|
@@ -6283,14 +6334,16 @@ function createRecordsClient(config) {
|
|
|
6283
6334
|
);
|
|
6284
6335
|
},
|
|
6285
6336
|
async restoreVersion({ record_id, version }) {
|
|
6286
|
-
|
|
6337
|
+
const result = await callDoor(
|
|
6287
6338
|
DOORS.restoreVersion,
|
|
6288
6339
|
{ p_organization_id: org, p_record_id: record_id, p_version: version },
|
|
6289
6340
|
"restoreVersion"
|
|
6290
6341
|
);
|
|
6342
|
+
if (result.ok) announceRecordChanged(record_id);
|
|
6343
|
+
return result;
|
|
6291
6344
|
},
|
|
6292
6345
|
async valueRestore({ record_id, field_key, version }) {
|
|
6293
|
-
|
|
6346
|
+
const answered = await callDoor(
|
|
6294
6347
|
DOORS.valueRestore,
|
|
6295
6348
|
{
|
|
6296
6349
|
p_organization_id: org,
|
|
@@ -6300,6 +6353,8 @@ function createRecordsClient(config) {
|
|
|
6300
6353
|
},
|
|
6301
6354
|
"valueRestore"
|
|
6302
6355
|
);
|
|
6356
|
+
if (answered.ok) announceRecordChanged(record_id);
|
|
6357
|
+
return answered;
|
|
6303
6358
|
},
|
|
6304
6359
|
async commentThread({ record_id, include_resolved }) {
|
|
6305
6360
|
return callDoor(
|
|
@@ -7226,13 +7281,24 @@ function useRecords(tableId, options = {}) {
|
|
|
7226
7281
|
const liveReason = realtime ? tableId ? "Live: changes to this table re-read through the read door." : "Not live: no table selected." : "Not live: this host bound no realtime port, so this list updates when you reload it.";
|
|
7227
7282
|
return { ...base, live, liveReason };
|
|
7228
7283
|
}
|
|
7284
|
+
function useRecordChangeRevision(recordId) {
|
|
7285
|
+
const [revision, setRevision] = useState(0);
|
|
7286
|
+
useEffect(() => {
|
|
7287
|
+
if (!recordId) return;
|
|
7288
|
+
return onRecordChanged((changed) => {
|
|
7289
|
+
if (changed === recordId) setRevision((n) => n + 1);
|
|
7290
|
+
});
|
|
7291
|
+
}, [recordId]);
|
|
7292
|
+
return revision;
|
|
7293
|
+
}
|
|
7229
7294
|
function useRecord(recordId, withComputed = false) {
|
|
7295
|
+
const changed = useRecordChangeRevision(recordId);
|
|
7230
7296
|
return useAsync(
|
|
7231
7297
|
async (client) => {
|
|
7232
7298
|
if (!recordId) return { ok: true, data: null };
|
|
7233
7299
|
return client.recordRead({ record_id: recordId, withComputed });
|
|
7234
7300
|
},
|
|
7235
|
-
[recordId, withComputed]
|
|
7301
|
+
[recordId, withComputed, changed]
|
|
7236
7302
|
);
|
|
7237
7303
|
}
|
|
7238
7304
|
function useRecordMutation() {
|
|
@@ -7578,6 +7644,11 @@ var OVERRIDE_POLICIES = [
|
|
|
7578
7644
|
var FRESHNESS = ["live", "cached", "snapshot"];
|
|
7579
7645
|
var TABLE_DISPLAYS = ["list", "grid", "board", "calendar", "timeline"];
|
|
7580
7646
|
|
|
7647
|
+
// src/field.ts
|
|
7648
|
+
function allowsOtherValues(field) {
|
|
7649
|
+
return field.type === "list" && field.config?.["allow_other"] === true;
|
|
7650
|
+
}
|
|
7651
|
+
|
|
7581
7652
|
// src/choice.ts
|
|
7582
7653
|
var UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
7583
7654
|
function optionKey(option) {
|
|
@@ -8207,6 +8278,7 @@ export {
|
|
|
8207
8278
|
VALUE_ALTERNATE_KEYS,
|
|
8208
8279
|
VALUE_ENVELOPE_KEYS,
|
|
8209
8280
|
actionRefusals,
|
|
8281
|
+
allowsOtherValues,
|
|
8210
8282
|
archivedByLine,
|
|
8211
8283
|
archivedWhen,
|
|
8212
8284
|
asPermissionLevel,
|
|
@@ -8267,6 +8339,7 @@ export {
|
|
|
8267
8339
|
useMyLevels,
|
|
8268
8340
|
useOptionalRecordsClient,
|
|
8269
8341
|
useRecord,
|
|
8342
|
+
useRecordChangeRevision,
|
|
8270
8343
|
useRecordMutation,
|
|
8271
8344
|
useRecords,
|
|
8272
8345
|
useRecordsActor,
|