@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/core/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as Timestamp, p as Uuid, R as
|
|
2
|
-
export {
|
|
1
|
+
import { T as Timestamp, p as Uuid, R as RecordsErrorCode, q as RecordDocument, r as RecordsResult, s as RecordGraphWritten, t as RecordRead, u as ReadRow, v as Field, S as StoredRecord, w as NewFieldDeclaration, x as FieldPatch, y as RecordRevision, z as ReadValue, A as FieldProposal, C as TableProposal, D as RecordsError, W as WriteConflict, E as PgError, G as StaleWriteDetail, H as PredictedRefusal } from '../types-Bsamaf-a.cjs';
|
|
2
|
+
export { I as ABSENCE_REASONS, J as ACTOR_VOCABULARY, K as AbsenceReason, L as Actor, M as COMPUTE_ON, O as CONTEXT_POLICIES, Q as ComputeOn, V as ContextPolicy, X as DECLARABLE_FIELD_KINDS, Y as DELIVERIES, Z as DeclarableFieldKind, _ as Delivery, $ as ENTITY_TOKENS, a0 as EntityToken, a1 as FIELD_SENSITIVITIES, a2 as FIELD_SOURCES, a3 as FRESHNESS, a4 as FieldBehavior, a5 as FieldRule, a6 as FieldSensitivity, a7 as FieldSource, a8 as FieldTypeWord, a9 as ForbiddenEnvelopeWord, aa as Freshness, ab as HiddenFieldNotice, ac as KERNEL_TABLES, ad as KernelTableName, ae as MERGE_FIELD_MODIFIERS, af as MERGE_FIELD_SEMANTIC_TYPES, ag as MERGE_FIELD_SOURCES, ah as MergeFieldModifier, ai as MergeFieldSemanticType, aj as MergeFieldSource, ak as ON_DELETE, al as OVERRIDE_POLICIES, am as OnDelete, an as OverridePolicy, ao as PARITY_FIELD_TYPES, ap as PER_VALUE_ACCESS_WORDS, aq as ParityFieldType, ar as ParityFieldTypeDescriptor, as as PerValueAccessWord, at as ProvenancePointer, au as RELATION_BINDINGS, av as RELATION_CARDINALITIES, aw as RELATION_FLAVORS, ax as RETIRED_ACTOR_WORDS, ay as RULE_NODE_KINDS, az as RULE_USES, aA as RelationBinding, aB as RelationCardinality, aC as RelationDisplay, aD as RelationFlavor, aE as RetiredActorWord, aF as RuleNodeKind, aG as RuleUse, aH as STORAGE_MODES, aI as STORE_DOORS, aJ as STORE_KNOBS, aK as STORE_REFUSAL_CODES, aL as StorageMode, aM as StoreDoorName, aN as StoreRefusalCode, aO as TABLE_DISPLAYS, aP as TABLE_ORIGINS, aQ as TABLE_TYPES, aR as TableDisplay, aS as TableOrigin, aT as TableType, aU as VALUE_ALTERNATE_KEYS, aV as VALUE_ENVELOPE_KEYS, aW as ValueAlternate, aX as ValueAlternateKey, aY as ValueEnvelope, aZ as ValueEnvelopeKey, a_ as ValueSource, a$ as allowsOtherValues, b0 as err, b1 as isRecordsErr, b2 as ok } from '../types-Bsamaf-a.cjs';
|
|
3
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, DecorationPath, TableDecorations, GridLayout, FormulaParse, RowAction, ActionRunResult, RecordEvent, TableWebhookDeclared, TableWebhook, ExampleBuilt, IoExportPage, RecordsDataSource } from '../index.cjs';
|
|
4
4
|
export { ARCHIVE_LANES, ARCHIVE_LANE_LABEL, ARCHIVE_LANE_MEANS, ActionRefusal, 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, DecorationColor, DecorationRule, DecorationRuleOp, DecorationTarget, DocSignatureCheck, EnrichAlternate, EnrichSource, Enrichment, EntityFieldValue, EntityRecordMatch, ExampleSpec, FIELD_KINDS, FieldKind, GridLayoutMode, GridRowHeight, 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, RecordChangeAction, RecordComment, RecordScopeComment, RecordScopeField, RecordScopeHistoryEntry, RecordScopeRelation, RecordScopeWithheld, RecordsActor, RecordsChangeSink, RecordsErrorSink, RecordsFilter, RecordsRealtimePort, RecordsResolverPort, RecordsResponse, RecordsTableQuery, RegisteredTable, Relation, RelationCarries, RelationDisplaySpec, RelationProperties, RelationStore, RelationTarget, ResolutionTriple, RowActionStep, Rule, RuleAnswer, RuleExpression, STAGE_RULE_ENFORCEMENT, STAGE_RULE_ON_FAIL, StageRuleWarning, SubscriptionBlock, SubscriptionCadence, ViewLayout, WorkDueState, WorkInboxKind, WorkOrigin, WorkTemplateNode, WorkTemplateRelation, actionRefusals, archivedByLine, archivedWhen, asPermissionLevel, atLeast, bookingPath, choiceSlug, choiceValuesOf, choicesOf, coerceTypedAnswer, coerceTypedAnswers, coercionLabel, emptyArchiveLine, emptyPortalArchiveLine, exampleSpec, exportPageXlsx, fieldKindFor, forgetAllOps, highestLevel, holdsARetiredChoice, indexedDbStore, isArchiveLane, isDecided, isOwnOp, isPortalArchiveFilter, isTheChosen, looksLikeAnId, mayDrag, measureKey, memoryStore, mintClientKey, mintOpId, openCaptureQueue, optionKey, optionLabel, portalArchiveConsequence, portalConfirmLine, portalPath, portalTitleTypedBack, publicFormPath, recordChangeTrigger, rememberedOpCount, sameDocument, scopeChip, stableFilterKey } from '../index.cjs';
|
|
5
5
|
|
|
@@ -85,6 +85,23 @@ declare function planQuery(query: RecordQuery): QueryPlan;
|
|
|
85
85
|
/** The intersection of the id sets a plan's calls produced. Order is preserved from the first set. */
|
|
86
86
|
declare function intersectIds(sets: Uuid[][]): Uuid[];
|
|
87
87
|
|
|
88
|
+
/**
|
|
89
|
+
* 🚨 A REFUSAL IS NOT AN APP ERROR (lane RECORDS-UI-FIX, guide re-walk 2026-09-23).
|
|
90
|
+
*
|
|
91
|
+
* A person typing `-3` into a column that takes "at least 0" is the store WORKING: the
|
|
92
|
+
* rule said no, the screen said so in the one notice, and the person fixed it. The default
|
|
93
|
+
* sink printed every one of those through `console.error`, and the app's error capture
|
|
94
|
+
* (matrx-frontend `lib/diagnostics/globalErrorCapture.ts`) counts every `console.error` —
|
|
95
|
+
* so one refused value lit a red "2 errors" pill in the corner, telling an admin the
|
|
96
|
+
* product had failed when a person had simply been told no.
|
|
97
|
+
*
|
|
98
|
+
* These are the codes a PERSON causes by what they typed or when they typed it; each one
|
|
99
|
+
* is already drawn on the screen that asked. They are still said (`console.info`), never
|
|
100
|
+
* silenced. Everything else — a door, the store switched off, a timeout, a class this
|
|
101
|
+
* package did not recognise — is a failure of the system and stays `console.error`.
|
|
102
|
+
*/
|
|
103
|
+
declare const A_PERSONS_REFUSAL: ReadonlySet<RecordsErrorCode>;
|
|
104
|
+
declare function isAPersonsRefusal(code: RecordsErrorCode | string): boolean;
|
|
88
105
|
interface RecordsClient {
|
|
89
106
|
/** The config this client was built with, so a screen can show who it is acting as. */
|
|
90
107
|
readonly config: RecordsConfig;
|
|
@@ -286,6 +303,16 @@ interface RecordsClient {
|
|
|
286
303
|
total: number | null;
|
|
287
304
|
}>>;
|
|
288
305
|
tableList(): Promise<RecordsResult<Table[]>>;
|
|
306
|
+
/**
|
|
307
|
+
* IS THIS TABLE IN THE ARCHIVE? (lane HUB-FIX, 2026-09-23.) The archived row for one
|
|
308
|
+
* Table of this organization, or `null` when the archive does not hold it — which
|
|
309
|
+
* is an ANSWER, never "it may have been deleted". A table page that cannot find a
|
|
310
|
+
* Table asks this before saying anything: an archived Table's own address used to
|
|
311
|
+
* read "…or it may have been deleted" when it was archived and one click from back.
|
|
312
|
+
*/
|
|
313
|
+
tableArchived(args: {
|
|
314
|
+
table_id: Uuid;
|
|
315
|
+
}): Promise<RecordsResult<ArchivedRow | null>>;
|
|
289
316
|
fields(args: {
|
|
290
317
|
table_id: Uuid;
|
|
291
318
|
recordType?: string;
|
|
@@ -1838,6 +1865,12 @@ declare function doorCensus(): {
|
|
|
1838
1865
|
absent: string[];
|
|
1839
1866
|
};
|
|
1840
1867
|
|
|
1868
|
+
type Listener = (recordId: string) => void;
|
|
1869
|
+
/** Called by the client after a write door answered yes. */
|
|
1870
|
+
declare function announceRecordChanged(recordId: string): void;
|
|
1871
|
+
/** Hear every record this page writes. Returns the unsubscribe. */
|
|
1872
|
+
declare function onRecordChanged(listener: Listener): () => void;
|
|
1873
|
+
|
|
1841
1874
|
/**
|
|
1842
1875
|
* The structural shape of the supabase client this adapter needs. Deliberately
|
|
1843
1876
|
* NOT `SupabaseClient<Database>`: a generated `Database` type makes
|
|
@@ -1955,4 +1988,4 @@ declare function parseCsv(text: string): string[][];
|
|
|
1955
1988
|
declare function importCsv(text: string): ParsedImport;
|
|
1956
1989
|
declare function importXlsx(bytes: ArrayBuffer | Uint8Array): Promise<ParsedImport>;
|
|
1957
1990
|
|
|
1958
|
-
export { ActionRunResult, 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, DecorationPath, DigestPreview, DocRenderRow, DocSignatureRow, DocTemplateRow, DocToken, DocUnresolvedToken, type DoorKey, EnrichCell, EnrichDeclared, EnrichDueRow, EnrichRun, EnrichmentSummary, EntityFieldRights, EntityRecordRead, EntityRecordsFound, EntityTableFacts, ExampleBuilt, type ExportRow, ExternalPrincipalCard, Field, FieldHistoryEntry, FieldPatch, FieldProposal, FormSummary, FormulaParse, GridLayout, ImportBatchResult, ImportColumnsDeclared, ImportFinished, ImportOpened, ImportPlan, ImportPolicy, ImportReport, ImportRun, InboundAddress, InboundDeclared, IoExportPage, 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, RecordEvent, RecordFilter, RecordGraphWritten, RecordHistoryEntry, type RecordQuery, RecordRead, RecordRevision, RecordScopeContext, type RecordsClient, RecordsConfig, RecordsDataSource, RecordsError, RecordsResult, RelationCoordinate, RelationWordsManyArgs, ResolvedPublishBinding, RestorePreview, RestoreResult, RowAction, SavedViewRow, SavedViewSpecIn, StagePending, StagePendingOnBoard, StageRuleEnforcement, StageRuleOnFail, StaleWriteDetail, StoredRecord, StuckRow, Subscription, SubscriptionSpec, type SupabaseLike, Table, TableArchiveProgress, TableCapacity, TableDecorations, TableProposal, TableWebhook, TableWebhookDeclared, 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 };
|
|
1991
|
+
export { A_PERSONS_REFUSAL, ActionRunResult, 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, DecorationPath, DigestPreview, DocRenderRow, DocSignatureRow, DocTemplateRow, DocToken, DocUnresolvedToken, type DoorKey, EnrichCell, EnrichDeclared, EnrichDueRow, EnrichRun, EnrichmentSummary, EntityFieldRights, EntityRecordRead, EntityRecordsFound, EntityTableFacts, ExampleBuilt, type ExportRow, ExternalPrincipalCard, Field, FieldHistoryEntry, FieldPatch, FieldProposal, FormSummary, FormulaParse, GridLayout, ImportBatchResult, ImportColumnsDeclared, ImportFinished, ImportOpened, ImportPlan, ImportPolicy, ImportReport, ImportRun, InboundAddress, InboundDeclared, IoExportPage, 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, RecordEvent, RecordFilter, RecordGraphWritten, RecordHistoryEntry, type RecordQuery, RecordRead, RecordRevision, RecordScopeContext, type RecordsClient, RecordsConfig, RecordsDataSource, RecordsError, RecordsErrorCode, RecordsResult, RelationCoordinate, RelationWordsManyArgs, ResolvedPublishBinding, RestorePreview, RestoreResult, RowAction, SavedViewRow, SavedViewSpecIn, StagePending, StagePendingOnBoard, StageRuleEnforcement, StageRuleOnFail, StaleWriteDetail, StoredRecord, StuckRow, Subscription, SubscriptionSpec, type SupabaseLike, Table, TableArchiveProgress, TableCapacity, TableDecorations, TableProposal, TableWebhook, TableWebhookDeclared, Timestamp, Uuid, WorkApprovalDecision, WorkApprovalFiled, WorkApprover, WorkAssignment, WorkAssignmentField, WorkChange, WorkGraph, WorkInboxItem, WorkInstantiation, WorkListFlavour, WorkListItem, WorkRecordState, WorkSlotHold, WorkState, WorkTurn, WriteConflict, announceRecordChanged, asWriteConflict, cellText, createRecordsClient, doorAbsent, doorCensus, doorExists, exportCsv, exportXlsx, importCsv, importXlsx, intersectIds, isAPersonsRefusal, mapPgError, onRecordChanged, parseCsv, planQuery, predictEnvelopeRefusal, predictSizeRefusal, predictValueRefusals, predictWriteRefusals, staleWriteDetail, supabaseDataSource, toAoa };
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as Timestamp, p as Uuid, R as
|
|
2
|
-
export {
|
|
1
|
+
import { T as Timestamp, p as Uuid, R as RecordsErrorCode, q as RecordDocument, r as RecordsResult, s as RecordGraphWritten, t as RecordRead, u as ReadRow, v as Field, S as StoredRecord, w as NewFieldDeclaration, x as FieldPatch, y as RecordRevision, z as ReadValue, A as FieldProposal, C as TableProposal, D as RecordsError, W as WriteConflict, E as PgError, G as StaleWriteDetail, H as PredictedRefusal } from '../types-Bsamaf-a.js';
|
|
2
|
+
export { I as ABSENCE_REASONS, J as ACTOR_VOCABULARY, K as AbsenceReason, L as Actor, M as COMPUTE_ON, O as CONTEXT_POLICIES, Q as ComputeOn, V as ContextPolicy, X as DECLARABLE_FIELD_KINDS, Y as DELIVERIES, Z as DeclarableFieldKind, _ as Delivery, $ as ENTITY_TOKENS, a0 as EntityToken, a1 as FIELD_SENSITIVITIES, a2 as FIELD_SOURCES, a3 as FRESHNESS, a4 as FieldBehavior, a5 as FieldRule, a6 as FieldSensitivity, a7 as FieldSource, a8 as FieldTypeWord, a9 as ForbiddenEnvelopeWord, aa as Freshness, ab as HiddenFieldNotice, ac as KERNEL_TABLES, ad as KernelTableName, ae as MERGE_FIELD_MODIFIERS, af as MERGE_FIELD_SEMANTIC_TYPES, ag as MERGE_FIELD_SOURCES, ah as MergeFieldModifier, ai as MergeFieldSemanticType, aj as MergeFieldSource, ak as ON_DELETE, al as OVERRIDE_POLICIES, am as OnDelete, an as OverridePolicy, ao as PARITY_FIELD_TYPES, ap as PER_VALUE_ACCESS_WORDS, aq as ParityFieldType, ar as ParityFieldTypeDescriptor, as as PerValueAccessWord, at as ProvenancePointer, au as RELATION_BINDINGS, av as RELATION_CARDINALITIES, aw as RELATION_FLAVORS, ax as RETIRED_ACTOR_WORDS, ay as RULE_NODE_KINDS, az as RULE_USES, aA as RelationBinding, aB as RelationCardinality, aC as RelationDisplay, aD as RelationFlavor, aE as RetiredActorWord, aF as RuleNodeKind, aG as RuleUse, aH as STORAGE_MODES, aI as STORE_DOORS, aJ as STORE_KNOBS, aK as STORE_REFUSAL_CODES, aL as StorageMode, aM as StoreDoorName, aN as StoreRefusalCode, aO as TABLE_DISPLAYS, aP as TABLE_ORIGINS, aQ as TABLE_TYPES, aR as TableDisplay, aS as TableOrigin, aT as TableType, aU as VALUE_ALTERNATE_KEYS, aV as VALUE_ENVELOPE_KEYS, aW as ValueAlternate, aX as ValueAlternateKey, aY as ValueEnvelope, aZ as ValueEnvelopeKey, a_ as ValueSource, a$ as allowsOtherValues, b0 as err, b1 as isRecordsErr, b2 as ok } from '../types-Bsamaf-a.js';
|
|
3
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, DecorationPath, TableDecorations, GridLayout, FormulaParse, RowAction, ActionRunResult, RecordEvent, TableWebhookDeclared, TableWebhook, ExampleBuilt, IoExportPage, RecordsDataSource } from '../index.js';
|
|
4
4
|
export { ARCHIVE_LANES, ARCHIVE_LANE_LABEL, ARCHIVE_LANE_MEANS, ActionRefusal, 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, DecorationColor, DecorationRule, DecorationRuleOp, DecorationTarget, DocSignatureCheck, EnrichAlternate, EnrichSource, Enrichment, EntityFieldValue, EntityRecordMatch, ExampleSpec, FIELD_KINDS, FieldKind, GridLayoutMode, GridRowHeight, 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, RecordChangeAction, RecordComment, RecordScopeComment, RecordScopeField, RecordScopeHistoryEntry, RecordScopeRelation, RecordScopeWithheld, RecordsActor, RecordsChangeSink, RecordsErrorSink, RecordsFilter, RecordsRealtimePort, RecordsResolverPort, RecordsResponse, RecordsTableQuery, RegisteredTable, Relation, RelationCarries, RelationDisplaySpec, RelationProperties, RelationStore, RelationTarget, ResolutionTriple, RowActionStep, Rule, RuleAnswer, RuleExpression, STAGE_RULE_ENFORCEMENT, STAGE_RULE_ON_FAIL, StageRuleWarning, SubscriptionBlock, SubscriptionCadence, ViewLayout, WorkDueState, WorkInboxKind, WorkOrigin, WorkTemplateNode, WorkTemplateRelation, actionRefusals, archivedByLine, archivedWhen, asPermissionLevel, atLeast, bookingPath, choiceSlug, choiceValuesOf, choicesOf, coerceTypedAnswer, coerceTypedAnswers, coercionLabel, emptyArchiveLine, emptyPortalArchiveLine, exampleSpec, exportPageXlsx, fieldKindFor, forgetAllOps, highestLevel, holdsARetiredChoice, indexedDbStore, isArchiveLane, isDecided, isOwnOp, isPortalArchiveFilter, isTheChosen, looksLikeAnId, mayDrag, measureKey, memoryStore, mintClientKey, mintOpId, openCaptureQueue, optionKey, optionLabel, portalArchiveConsequence, portalConfirmLine, portalPath, portalTitleTypedBack, publicFormPath, recordChangeTrigger, rememberedOpCount, sameDocument, scopeChip, stableFilterKey } from '../index.js';
|
|
5
5
|
|
|
@@ -85,6 +85,23 @@ declare function planQuery(query: RecordQuery): QueryPlan;
|
|
|
85
85
|
/** The intersection of the id sets a plan's calls produced. Order is preserved from the first set. */
|
|
86
86
|
declare function intersectIds(sets: Uuid[][]): Uuid[];
|
|
87
87
|
|
|
88
|
+
/**
|
|
89
|
+
* 🚨 A REFUSAL IS NOT AN APP ERROR (lane RECORDS-UI-FIX, guide re-walk 2026-09-23).
|
|
90
|
+
*
|
|
91
|
+
* A person typing `-3` into a column that takes "at least 0" is the store WORKING: the
|
|
92
|
+
* rule said no, the screen said so in the one notice, and the person fixed it. The default
|
|
93
|
+
* sink printed every one of those through `console.error`, and the app's error capture
|
|
94
|
+
* (matrx-frontend `lib/diagnostics/globalErrorCapture.ts`) counts every `console.error` —
|
|
95
|
+
* so one refused value lit a red "2 errors" pill in the corner, telling an admin the
|
|
96
|
+
* product had failed when a person had simply been told no.
|
|
97
|
+
*
|
|
98
|
+
* These are the codes a PERSON causes by what they typed or when they typed it; each one
|
|
99
|
+
* is already drawn on the screen that asked. They are still said (`console.info`), never
|
|
100
|
+
* silenced. Everything else — a door, the store switched off, a timeout, a class this
|
|
101
|
+
* package did not recognise — is a failure of the system and stays `console.error`.
|
|
102
|
+
*/
|
|
103
|
+
declare const A_PERSONS_REFUSAL: ReadonlySet<RecordsErrorCode>;
|
|
104
|
+
declare function isAPersonsRefusal(code: RecordsErrorCode | string): boolean;
|
|
88
105
|
interface RecordsClient {
|
|
89
106
|
/** The config this client was built with, so a screen can show who it is acting as. */
|
|
90
107
|
readonly config: RecordsConfig;
|
|
@@ -286,6 +303,16 @@ interface RecordsClient {
|
|
|
286
303
|
total: number | null;
|
|
287
304
|
}>>;
|
|
288
305
|
tableList(): Promise<RecordsResult<Table[]>>;
|
|
306
|
+
/**
|
|
307
|
+
* IS THIS TABLE IN THE ARCHIVE? (lane HUB-FIX, 2026-09-23.) The archived row for one
|
|
308
|
+
* Table of this organization, or `null` when the archive does not hold it — which
|
|
309
|
+
* is an ANSWER, never "it may have been deleted". A table page that cannot find a
|
|
310
|
+
* Table asks this before saying anything: an archived Table's own address used to
|
|
311
|
+
* read "…or it may have been deleted" when it was archived and one click from back.
|
|
312
|
+
*/
|
|
313
|
+
tableArchived(args: {
|
|
314
|
+
table_id: Uuid;
|
|
315
|
+
}): Promise<RecordsResult<ArchivedRow | null>>;
|
|
289
316
|
fields(args: {
|
|
290
317
|
table_id: Uuid;
|
|
291
318
|
recordType?: string;
|
|
@@ -1838,6 +1865,12 @@ declare function doorCensus(): {
|
|
|
1838
1865
|
absent: string[];
|
|
1839
1866
|
};
|
|
1840
1867
|
|
|
1868
|
+
type Listener = (recordId: string) => void;
|
|
1869
|
+
/** Called by the client after a write door answered yes. */
|
|
1870
|
+
declare function announceRecordChanged(recordId: string): void;
|
|
1871
|
+
/** Hear every record this page writes. Returns the unsubscribe. */
|
|
1872
|
+
declare function onRecordChanged(listener: Listener): () => void;
|
|
1873
|
+
|
|
1841
1874
|
/**
|
|
1842
1875
|
* The structural shape of the supabase client this adapter needs. Deliberately
|
|
1843
1876
|
* NOT `SupabaseClient<Database>`: a generated `Database` type makes
|
|
@@ -1955,4 +1988,4 @@ declare function parseCsv(text: string): string[][];
|
|
|
1955
1988
|
declare function importCsv(text: string): ParsedImport;
|
|
1956
1989
|
declare function importXlsx(bytes: ArrayBuffer | Uint8Array): Promise<ParsedImport>;
|
|
1957
1990
|
|
|
1958
|
-
export { ActionRunResult, 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, DecorationPath, DigestPreview, DocRenderRow, DocSignatureRow, DocTemplateRow, DocToken, DocUnresolvedToken, type DoorKey, EnrichCell, EnrichDeclared, EnrichDueRow, EnrichRun, EnrichmentSummary, EntityFieldRights, EntityRecordRead, EntityRecordsFound, EntityTableFacts, ExampleBuilt, type ExportRow, ExternalPrincipalCard, Field, FieldHistoryEntry, FieldPatch, FieldProposal, FormSummary, FormulaParse, GridLayout, ImportBatchResult, ImportColumnsDeclared, ImportFinished, ImportOpened, ImportPlan, ImportPolicy, ImportReport, ImportRun, InboundAddress, InboundDeclared, IoExportPage, 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, RecordEvent, RecordFilter, RecordGraphWritten, RecordHistoryEntry, type RecordQuery, RecordRead, RecordRevision, RecordScopeContext, type RecordsClient, RecordsConfig, RecordsDataSource, RecordsError, RecordsResult, RelationCoordinate, RelationWordsManyArgs, ResolvedPublishBinding, RestorePreview, RestoreResult, RowAction, SavedViewRow, SavedViewSpecIn, StagePending, StagePendingOnBoard, StageRuleEnforcement, StageRuleOnFail, StaleWriteDetail, StoredRecord, StuckRow, Subscription, SubscriptionSpec, type SupabaseLike, Table, TableArchiveProgress, TableCapacity, TableDecorations, TableProposal, TableWebhook, TableWebhookDeclared, 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 };
|
|
1991
|
+
export { A_PERSONS_REFUSAL, ActionRunResult, 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, DecorationPath, DigestPreview, DocRenderRow, DocSignatureRow, DocTemplateRow, DocToken, DocUnresolvedToken, type DoorKey, EnrichCell, EnrichDeclared, EnrichDueRow, EnrichRun, EnrichmentSummary, EntityFieldRights, EntityRecordRead, EntityRecordsFound, EntityTableFacts, ExampleBuilt, type ExportRow, ExternalPrincipalCard, Field, FieldHistoryEntry, FieldPatch, FieldProposal, FormSummary, FormulaParse, GridLayout, ImportBatchResult, ImportColumnsDeclared, ImportFinished, ImportOpened, ImportPlan, ImportPolicy, ImportReport, ImportRun, InboundAddress, InboundDeclared, IoExportPage, 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, RecordEvent, RecordFilter, RecordGraphWritten, RecordHistoryEntry, type RecordQuery, RecordRead, RecordRevision, RecordScopeContext, type RecordsClient, RecordsConfig, RecordsDataSource, RecordsError, RecordsErrorCode, RecordsResult, RelationCoordinate, RelationWordsManyArgs, ResolvedPublishBinding, RestorePreview, RestoreResult, RowAction, SavedViewRow, SavedViewSpecIn, StagePending, StagePendingOnBoard, StageRuleEnforcement, StageRuleOnFail, StaleWriteDetail, StoredRecord, StuckRow, Subscription, SubscriptionSpec, type SupabaseLike, Table, TableArchiveProgress, TableCapacity, TableDecorations, TableProposal, TableWebhook, TableWebhookDeclared, Timestamp, Uuid, WorkApprovalDecision, WorkApprovalFiled, WorkApprover, WorkAssignment, WorkAssignmentField, WorkChange, WorkGraph, WorkInboxItem, WorkInstantiation, WorkListFlavour, WorkListItem, WorkRecordState, WorkSlotHold, WorkState, WorkTurn, WriteConflict, announceRecordChanged, asWriteConflict, cellText, createRecordsClient, doorAbsent, doorCensus, doorExists, exportCsv, exportXlsx, importCsv, importXlsx, intersectIds, isAPersonsRefusal, mapPgError, onRecordChanged, parseCsv, planQuery, predictEnvelopeRefusal, predictSizeRefusal, predictValueRefusals, predictWriteRefusals, staleWriteDetail, supabaseDataSource, toAoa };
|
package/dist/core/index.js
CHANGED
|
@@ -2292,6 +2292,11 @@ function highestLevel(left, right) {
|
|
|
2292
2292
|
return ORDINAL[left] >= ORDINAL[right] ? left : right;
|
|
2293
2293
|
}
|
|
2294
2294
|
|
|
2295
|
+
// src/field.ts
|
|
2296
|
+
function allowsOtherValues(field) {
|
|
2297
|
+
return field.type === "list" && field.config?.["allow_other"] === true;
|
|
2298
|
+
}
|
|
2299
|
+
|
|
2295
2300
|
// src/choice.ts
|
|
2296
2301
|
var UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
2297
2302
|
function optionKey(option) {
|
|
@@ -5550,6 +5555,22 @@ function staleWriteDetail(error) {
|
|
|
5550
5555
|
};
|
|
5551
5556
|
}
|
|
5552
5557
|
|
|
5558
|
+
// src/core/recordChanges.ts
|
|
5559
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
5560
|
+
function announceRecordChanged(recordId) {
|
|
5561
|
+
for (const listener of [...listeners]) {
|
|
5562
|
+
try {
|
|
5563
|
+
listener(recordId);
|
|
5564
|
+
} catch (thrown) {
|
|
5565
|
+
console.error("[@ai-matrx/records] a record-change listener threw", thrown);
|
|
5566
|
+
}
|
|
5567
|
+
}
|
|
5568
|
+
}
|
|
5569
|
+
function onRecordChanged(listener) {
|
|
5570
|
+
listeners.add(listener);
|
|
5571
|
+
return () => listeners.delete(listener);
|
|
5572
|
+
}
|
|
5573
|
+
|
|
5553
5574
|
// src/core/query.ts
|
|
5554
5575
|
var DEFAULT_PAGE_SIZE = 50;
|
|
5555
5576
|
function planQuery(query) {
|
|
@@ -5591,12 +5612,22 @@ function intersectIds(sets) {
|
|
|
5591
5612
|
|
|
5592
5613
|
// src/core/client.ts
|
|
5593
5614
|
var DEFAULT_SCHEMA = "custom";
|
|
5615
|
+
var A_PERSONS_REFUSAL = /* @__PURE__ */ new Set([
|
|
5616
|
+
"refused_by_rule",
|
|
5617
|
+
"stale_write",
|
|
5618
|
+
"invalid_argument",
|
|
5619
|
+
"already_exists",
|
|
5620
|
+
"missing_reference"
|
|
5621
|
+
]);
|
|
5622
|
+
function isAPersonsRefusal(code) {
|
|
5623
|
+
return A_PERSONS_REFUSAL.has(code);
|
|
5624
|
+
}
|
|
5594
5625
|
function sink(config) {
|
|
5595
|
-
return config.onError ?? ((e) =>
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
console.error(
|
|
5599
|
-
)
|
|
5626
|
+
return config.onError ?? ((e) => {
|
|
5627
|
+
const line = `[@ai-matrx/records] ${e.where}: ${e.code} \u2014 ${e.message}${e.hint ? ` (${e.hint})` : ""}`;
|
|
5628
|
+
if (isAPersonsRefusal(e.code)) console.info(line);
|
|
5629
|
+
else console.error(line);
|
|
5630
|
+
});
|
|
5600
5631
|
}
|
|
5601
5632
|
function createRecordsClient(config) {
|
|
5602
5633
|
const schema = config.schema ?? DEFAULT_SCHEMA;
|
|
@@ -5703,21 +5734,26 @@ function createRecordsClient(config) {
|
|
|
5703
5734
|
},
|
|
5704
5735
|
"recordUpdate"
|
|
5705
5736
|
);
|
|
5737
|
+
if (result.ok) announceRecordChanged(record_id);
|
|
5706
5738
|
return result;
|
|
5707
5739
|
},
|
|
5708
5740
|
async recordDelete({ record_id }) {
|
|
5709
|
-
|
|
5741
|
+
const result = await callDoor(
|
|
5710
5742
|
DOORS.recordDelete,
|
|
5711
5743
|
{ p_organization_id: org, p_record_id: record_id },
|
|
5712
5744
|
"recordDelete"
|
|
5713
5745
|
);
|
|
5746
|
+
if (result.ok) announceRecordChanged(record_id);
|
|
5747
|
+
return result;
|
|
5714
5748
|
},
|
|
5715
5749
|
async recordRestore({ record_id }) {
|
|
5716
|
-
|
|
5750
|
+
const result = await callDoor(
|
|
5717
5751
|
DOORS.recordRestore,
|
|
5718
5752
|
{ p_organization_id: org, p_record_id: record_id },
|
|
5719
5753
|
"recordRestore"
|
|
5720
5754
|
);
|
|
5755
|
+
if (result.ok) announceRecordChanged(record_id);
|
|
5756
|
+
return result;
|
|
5721
5757
|
},
|
|
5722
5758
|
async tableArchive({ table_id, chunk, includeTable }) {
|
|
5723
5759
|
return callDoor(
|
|
@@ -5767,6 +5803,24 @@ function createRecordsClient(config) {
|
|
|
5767
5803
|
})
|
|
5768
5804
|
);
|
|
5769
5805
|
},
|
|
5806
|
+
async tableArchived({ table_id }) {
|
|
5807
|
+
const kernel = await callDoor(DOORS.tableKernelId, {}, "tableArchived.kernel");
|
|
5808
|
+
if (!kernel.ok) return err(kernel.error);
|
|
5809
|
+
const PAGE = 200;
|
|
5810
|
+
for (let page = 0; page < 25; page += 1) {
|
|
5811
|
+
const answered = await this.listArchived({
|
|
5812
|
+
table_id: kernel.data,
|
|
5813
|
+
lane: "org",
|
|
5814
|
+
limit: PAGE,
|
|
5815
|
+
offset: page * PAGE
|
|
5816
|
+
});
|
|
5817
|
+
if (!answered.ok) return err(answered.error);
|
|
5818
|
+
const hit = answered.data.rows.find((row) => row.id === table_id);
|
|
5819
|
+
if (hit) return ok(hit);
|
|
5820
|
+
if (answered.data.total !== null) return ok(null);
|
|
5821
|
+
}
|
|
5822
|
+
return ok(null);
|
|
5823
|
+
},
|
|
5770
5824
|
async listArchived({ table_id, lane = DEFAULT_ARCHIVE_LANE, limit = 50, offset = 0 }) {
|
|
5771
5825
|
const door = await callDoor(
|
|
5772
5826
|
DOORS.readRecordsArchived,
|
|
@@ -5968,9 +6022,11 @@ function createRecordsClient(config) {
|
|
|
5968
6022
|
);
|
|
5969
6023
|
},
|
|
5970
6024
|
async fieldDeclare({ table_id, spec }) {
|
|
6025
|
+
const { allow_other, ...rest } = spec;
|
|
6026
|
+
const p_spec = allow_other === void 0 ? rest : { ...rest, config: { ...rest.config ?? {}, allow_other } };
|
|
5971
6027
|
return callDoor(
|
|
5972
6028
|
DOORS.fieldDeclare,
|
|
5973
|
-
{ p_organization_id: org, p_table_id: table_id, p_spec
|
|
6029
|
+
{ p_organization_id: org, p_table_id: table_id, p_spec },
|
|
5974
6030
|
"fieldDeclare"
|
|
5975
6031
|
);
|
|
5976
6032
|
},
|
|
@@ -6938,14 +6994,16 @@ function createRecordsClient(config) {
|
|
|
6938
6994
|
);
|
|
6939
6995
|
},
|
|
6940
6996
|
async restoreVersion({ record_id, version }) {
|
|
6941
|
-
|
|
6997
|
+
const result = await callDoor(
|
|
6942
6998
|
DOORS.restoreVersion,
|
|
6943
6999
|
{ p_organization_id: org, p_record_id: record_id, p_version: version },
|
|
6944
7000
|
"restoreVersion"
|
|
6945
7001
|
);
|
|
7002
|
+
if (result.ok) announceRecordChanged(record_id);
|
|
7003
|
+
return result;
|
|
6946
7004
|
},
|
|
6947
7005
|
async valueRestore({ record_id, field_key, version }) {
|
|
6948
|
-
|
|
7006
|
+
const answered = await callDoor(
|
|
6949
7007
|
DOORS.valueRestore,
|
|
6950
7008
|
{
|
|
6951
7009
|
p_organization_id: org,
|
|
@@ -6955,6 +7013,8 @@ function createRecordsClient(config) {
|
|
|
6955
7013
|
},
|
|
6956
7014
|
"valueRestore"
|
|
6957
7015
|
);
|
|
7016
|
+
if (answered.ok) announceRecordChanged(record_id);
|
|
7017
|
+
return answered;
|
|
6958
7018
|
},
|
|
6959
7019
|
async commentThread({ record_id, include_resolved }) {
|
|
6960
7020
|
return callDoor(
|
|
@@ -7736,12 +7796,30 @@ function ruleRefusal(field, rule, item, values) {
|
|
|
7736
7796
|
}
|
|
7737
7797
|
return null;
|
|
7738
7798
|
case "length":
|
|
7739
|
-
if (typeof item
|
|
7799
|
+
if (typeof item !== "string") return null;
|
|
7800
|
+
if (rule.value !== void 0 && rule.value !== null && rule.value !== "" && item.length > Number(rule.value)) {
|
|
7740
7801
|
return { ...base, message: `${label} is longer than ${rule.value} characters`, hint: "FLD-3." };
|
|
7741
7802
|
}
|
|
7803
|
+
if (typeof rule.min === "number" && item !== "" && item.length < rule.min) {
|
|
7804
|
+
return {
|
|
7805
|
+
...base,
|
|
7806
|
+
message: `${label} has to be at least ${rule.min} characters long`,
|
|
7807
|
+
hint: "FLD-3.",
|
|
7808
|
+
detail: { field_key: field.key, rule: "length", min: rule.min }
|
|
7809
|
+
};
|
|
7810
|
+
}
|
|
7742
7811
|
return null;
|
|
7743
7812
|
case "pattern":
|
|
7744
7813
|
if (typeof item === "string" && !new RegExp(String(rule.value)).test(item)) {
|
|
7814
|
+
const example = typeof rule.example === "string" ? rule.example.trim() : "";
|
|
7815
|
+
if (example !== "") {
|
|
7816
|
+
return {
|
|
7817
|
+
...base,
|
|
7818
|
+
message: `${label} is not written the way this field expects`,
|
|
7819
|
+
hint: `Enter it like ${example}.`,
|
|
7820
|
+
detail: { field_key: field.key, rule: "pattern", example }
|
|
7821
|
+
};
|
|
7822
|
+
}
|
|
7745
7823
|
return { ...base, message: `${label} is not written the way this field expects`, hint: "FLD-3." };
|
|
7746
7824
|
}
|
|
7747
7825
|
return null;
|
|
@@ -7826,12 +7904,6 @@ function predictValueRefusals(fields, values, recordType) {
|
|
|
7826
7904
|
message: `${label} takes one of its choices, and it was given a ${jsonType(item)}`,
|
|
7827
7905
|
hint: "FLD-5 / FLD-6: a list field stores the id of the option RECORD, because every pick-list is already a Table."
|
|
7828
7906
|
});
|
|
7829
|
-
} else if (!UUID2.test(item)) {
|
|
7830
|
-
found.push({
|
|
7831
|
-
...base,
|
|
7832
|
-
message: `${label} was given a choice that is not one of its choices`,
|
|
7833
|
-
hint: `REC-51: option membership. ${label} stores the id of an option record, and what it was given is not an id at all.`
|
|
7834
|
-
});
|
|
7835
7907
|
}
|
|
7836
7908
|
} else if (field.type === "relation") {
|
|
7837
7909
|
if (typeof item !== "string") {
|
|
@@ -8126,6 +8198,7 @@ export {
|
|
|
8126
8198
|
ARCHIVE_LANES,
|
|
8127
8199
|
ARCHIVE_LANE_LABEL,
|
|
8128
8200
|
ARCHIVE_LANE_MEANS,
|
|
8201
|
+
A_PERSONS_REFUSAL,
|
|
8129
8202
|
COMPUTE_ON,
|
|
8130
8203
|
CONTEXT_POLICIES,
|
|
8131
8204
|
DECLARABLE_FIELD_KINDS,
|
|
@@ -8172,6 +8245,8 @@ export {
|
|
|
8172
8245
|
VALUE_ALTERNATE_KEYS,
|
|
8173
8246
|
VALUE_ENVELOPE_KEYS,
|
|
8174
8247
|
actionRefusals,
|
|
8248
|
+
allowsOtherValues,
|
|
8249
|
+
announceRecordChanged,
|
|
8175
8250
|
archivedByLine,
|
|
8176
8251
|
archivedWhen,
|
|
8177
8252
|
asPermissionLevel,
|
|
@@ -8204,6 +8279,7 @@ export {
|
|
|
8204
8279
|
importXlsx,
|
|
8205
8280
|
indexedDbStore,
|
|
8206
8281
|
intersectIds,
|
|
8282
|
+
isAPersonsRefusal,
|
|
8207
8283
|
isArchiveLane,
|
|
8208
8284
|
isDecided,
|
|
8209
8285
|
isOwnOp,
|
|
@@ -8218,6 +8294,7 @@ export {
|
|
|
8218
8294
|
mintClientKey,
|
|
8219
8295
|
mintOpId,
|
|
8220
8296
|
ok,
|
|
8297
|
+
onRecordChanged,
|
|
8221
8298
|
openCaptureQueue,
|
|
8222
8299
|
optionKey,
|
|
8223
8300
|
optionLabel,
|