@ai-matrx/records 0.51.0 → 0.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { U as Uuid, g as Timestamp, k as ReadRow, h as RecordDocument, T as TableType, a as TableDisplay, S as StorageMode, ay as TableOrigin, m as StoredRecord, l as Field, a9 as ParityFieldType, ao as RuleUse, an as RuleNodeKind, R as RelationFlavor, O as OnDelete, ak as RelationBinding, f as RelationCardinality, a3 as MergeFieldSource, a2 as MergeFieldSemanticType, a1 as MergeFieldModifier, a6 as OverridePolicy, G as Delivery, V as Freshness, x as Actor, P as PgError } from './field-C6_QKP1G.cjs';
2
- export { A as ABSENCE_REASONS, v as ACTOR_VOCABULARY, w as AbsenceReason, y as COMPUTE_ON, z as CONTEXT_POLICIES, C as ComputeOn, e as ContextPolicy, D as DECLARABLE_FIELD_KINDS, B as DELIVERIES, E as DeclarableFieldKind, H as ENTITY_TOKENS, I as EntityToken, J as FIELD_SENSITIVITIES, K as FIELD_SOURCES, L as FRESHNESS, M as FieldBehavior, n as FieldPatch, q as FieldProposal, c as FieldRule, d as FieldSensitivity, b as FieldSource, F as FieldTypeWord, Q as ForbiddenEnvelopeWord, X as HiddenFieldNotice, Y as KERNEL_TABLES, Z as KernelTableName, _ as MERGE_FIELD_MODIFIERS, $ as MERGE_FIELD_SEMANTIC_TYPES, a0 as MERGE_FIELD_SOURCES, N as NewFieldDeclaration, a4 as ON_DELETE, a5 as OVERRIDE_POLICIES, a7 as PARITY_FIELD_TYPES, a8 as PER_VALUE_ACCESS_WORDS, aa as ParityFieldTypeDescriptor, ab as PerValueAccessWord, u as PredictedRefusal, ac as ProvenancePointer, ad as RELATION_BINDINGS, ae as RELATION_CARDINALITIES, af as RELATION_FLAVORS, ag as RETIRED_ACTOR_WORDS, ah as RULE_NODE_KINDS, ai as RULE_USES, p as ReadValue, j as RecordRead, o as RecordRevision, s as RecordsError, aj as RecordsErrorCode, i as RecordsResult, al as RelationDisplay, am as RetiredActorWord, ap as STORAGE_MODES, aq as STORE_DOORS, ar as STORE_KNOBS, as as STORE_REFUSAL_CODES, t as StaleWriteDetail, at as StoreDoorName, au as StoreRefusalCode, av as TABLE_DISPLAYS, aw as TABLE_ORIGINS, ax as TABLE_TYPES, r as TableProposal, az as VALUE_ALTERNATE_KEYS, aA as VALUE_ENVELOPE_KEYS, aB as ValueAlternate, aC as ValueAlternateKey, aD as ValueEnvelope, aE as ValueEnvelopeKey, aF as ValueSource, W as WriteConflict, aG as err, aH as isRecordsErr, aI as ok } from './field-C6_QKP1G.cjs';
1
+ import { U as Uuid, g as Timestamp, k as ReadRow, h as RecordDocument, T as TableType, a as TableDisplay, S as StorageMode, ay as TableOrigin, m as StoredRecord, l as Field, a9 as ParityFieldType, ao as RuleUse, an as RuleNodeKind, R as RelationFlavor, O as OnDelete, ak as RelationBinding, f as RelationCardinality, a3 as MergeFieldSource, a2 as MergeFieldSemanticType, a1 as MergeFieldModifier, a6 as OverridePolicy, G as Delivery, V as Freshness, x as Actor, P as PgError } from './field-ddMymGEI.cjs';
2
+ export { A as ABSENCE_REASONS, v as ACTOR_VOCABULARY, w as AbsenceReason, y as COMPUTE_ON, z as CONTEXT_POLICIES, C as ComputeOn, e as ContextPolicy, D as DECLARABLE_FIELD_KINDS, B as DELIVERIES, E as DeclarableFieldKind, H as ENTITY_TOKENS, I as EntityToken, J as FIELD_SENSITIVITIES, K as FIELD_SOURCES, L as FRESHNESS, M as FieldBehavior, n as FieldPatch, q as FieldProposal, c as FieldRule, d as FieldSensitivity, b as FieldSource, F as FieldTypeWord, Q as ForbiddenEnvelopeWord, X as HiddenFieldNotice, Y as KERNEL_TABLES, Z as KernelTableName, _ as MERGE_FIELD_MODIFIERS, $ as MERGE_FIELD_SEMANTIC_TYPES, a0 as MERGE_FIELD_SOURCES, N as NewFieldDeclaration, a4 as ON_DELETE, a5 as OVERRIDE_POLICIES, a7 as PARITY_FIELD_TYPES, a8 as PER_VALUE_ACCESS_WORDS, aa as ParityFieldTypeDescriptor, ab as PerValueAccessWord, u as PredictedRefusal, ac as ProvenancePointer, ad as RELATION_BINDINGS, ae as RELATION_CARDINALITIES, af as RELATION_FLAVORS, ag as RETIRED_ACTOR_WORDS, ah as RULE_NODE_KINDS, ai as RULE_USES, p as ReadValue, j as RecordRead, o as RecordRevision, s as RecordsError, aj as RecordsErrorCode, i as RecordsResult, al as RelationDisplay, am as RetiredActorWord, ap as STORAGE_MODES, aq as STORE_DOORS, ar as STORE_KNOBS, as as STORE_REFUSAL_CODES, t as StaleWriteDetail, at as StoreDoorName, au as StoreRefusalCode, av as TABLE_DISPLAYS, aw as TABLE_ORIGINS, ax as TABLE_TYPES, r as TableProposal, az as VALUE_ALTERNATE_KEYS, aA as VALUE_ENVELOPE_KEYS, aB as ValueAlternate, aC as ValueAlternateKey, aD as ValueEnvelope, aE as ValueEnvelopeKey, aF as ValueSource, W as WriteConflict, aG as err, aH as isRecordsErr, aI as ok } from './field-ddMymGEI.cjs';
3
3
 
4
4
  /**
5
5
  * THE TWO LANES THE ARCHIVED-ITEMS LAW NAMES (Arman, 2026-09-09) — the same
@@ -169,6 +169,51 @@ interface TableCapacity {
169
169
  /** The knob that decides the ceiling, named so a person can act on it. */
170
170
  knob: string;
171
171
  }
172
+ /**
173
+ * WHAT ONE PASS OF `custom.table_archive` ANSWERS WITH — the numbers a screen
174
+ * needs to draw a bar and write a sentence, instead of a spinner and an
175
+ * SQLSTATE (VERIFIER-10 F3, VERIFIER-11 F3).
176
+ *
177
+ * Archiving a table is a JOB, NOT A STATEMENT. `custom.record_delete` on a
178
+ * Table recurses through everything the Table contains inside one transaction,
179
+ * which is unbounded by construction: at 1,430 records it dies on `57014`,
180
+ * "canceling statement due to statement timeout", and nothing is changed. The
181
+ * remedy for a thing that cannot finish in one statement is more statements,
182
+ * never a longer one — so the caller loops, passing its own `chunk`, until
183
+ * `done`.
184
+ *
185
+ * IT IS RESUMABLE BECAUSE IT IS STATELESS. There is no job row to lose:
186
+ * `remaining` is read off the records themselves on every call, so a browser
187
+ * closed halfway, a failed pass or a deploy mid-run all leave a table that is
188
+ * half archived and a next call that picks up exactly where the last stopped.
189
+ * Which is why a screen driving this may NEVER say "nothing was changed" after
190
+ * a pass that moved rows — `archived_total` is what really landed.
191
+ *
192
+ * NOTHING IS DELETED. Every row goes through `custom.record_delete`, so every
193
+ * guard, history capture and outbox row still happens and `recordRestore`
194
+ * still brings any of them back.
195
+ */
196
+ interface TableArchiveProgress {
197
+ table_id: Uuid;
198
+ /** The table's own name, so a sentence can use it rather than an id. */
199
+ table_name: string;
200
+ /** What THIS pass archived. */
201
+ archived: number;
202
+ /** Records of this table still live. Zero is the end of the row work. */
203
+ remaining: number;
204
+ /** Records this table has ever held: `remaining` + `archived_total`. */
205
+ total: number;
206
+ /** Records of this table already archived, across every pass ever made. */
207
+ archived_total: number;
208
+ /** Whether the Table record itself has been archived. */
209
+ table_archived: boolean;
210
+ /** Nothing live is left to do. The caller's loop ends here. */
211
+ done: boolean;
212
+ /** The chunk the door actually took on — it clamps what it is handed. */
213
+ chunk: number;
214
+ /** The store's own sentence about this pass, in the product's voice. */
215
+ message: string;
216
+ }
172
217
 
173
218
  /** One option, as `_choices` names it and as `optionsOf` returns it. */
174
219
  interface ChoiceOption {
@@ -1001,6 +1046,14 @@ interface ImportOpened {
1001
1046
  rows_duplicate: number;
1002
1047
  source_name: string | null;
1003
1048
  opened_at?: Timestamp;
1049
+ /**
1050
+ * IMPORT-2. How many rows to send in the FIRST call. The store owns this
1051
+ * number rather than a screen, because nothing has been measured yet when a
1052
+ * run opens and a batch size written into a wizard is wrong on a busy
1053
+ * afternoon and stale the day the write path gets cheaper. Every call after
1054
+ * the first uses `ImportBatchResult.rows_per_call`, which is measured.
1055
+ */
1056
+ rows_per_call?: number;
1004
1057
  message: string;
1005
1058
  }
1006
1059
  /** One row of the file, and what became of it. */
@@ -1045,6 +1098,36 @@ interface ImportBatchResult {
1045
1098
  rows_refused: number;
1046
1099
  outcomes: ImportOutcome[];
1047
1100
  proposals: ImportProposal[];
1101
+ /**
1102
+ * IMPORT-2. The columns this call had to declare because the run never took
1103
+ * the `importDeclareColumns` step. Normally empty: declaring is its own step.
1104
+ */
1105
+ columns_added?: ImportProposal[];
1106
+ /**
1107
+ * IMPORT-2. FALSE means the batch could not be written as one statement — one
1108
+ * row of it was refused by a guard that refuses the whole statement — so every
1109
+ * row was written on its own instead and the refusals below name the rows that
1110
+ * could not be. The answers are identical either way; this says what it cost.
1111
+ */
1112
+ one_statement?: boolean;
1113
+ /** How long THIS call's writing phase took, and what that was a row. */
1114
+ write_ms?: number;
1115
+ ms_per_row?: number;
1116
+ /**
1117
+ * IMPORT-2. How many rows the NEXT call should carry, measured from this one:
1118
+ * the store aims at two seconds of writing, which leaves a database that gets
1119
+ * 50% busier between two calls still inside the three seconds a person should
1120
+ * wait. Send this many next. Ignoring it costs correctness nothing.
1121
+ */
1122
+ rows_per_call?: number;
1123
+ }
1124
+ /** IMPORT-2. What `importDeclareColumns` made, as its own step of the wizard. */
1125
+ interface ImportColumnsDeclared {
1126
+ table_id: Uuid;
1127
+ columns_added: ImportProposal[];
1128
+ /** Header -> Field key, including the headers that already named a column. */
1129
+ mapping: Record<string, string>;
1130
+ message: string;
1048
1131
  }
1049
1132
  interface ImportFinished {
1050
1133
  import_id: Uuid;
@@ -1269,6 +1352,49 @@ interface PortalPreviewRow {
1269
1352
  * nothing more. That is why it is readable and why copying it is safe.
1270
1353
  */
1271
1354
  declare function portalPath(slug: string): string;
1355
+ /**
1356
+ * The platform archive filter's own three values, and no fourth. `custom.list_portals`
1357
+ * refuses anything else with `22023` rather than quietly treating it as one of them.
1358
+ */
1359
+ declare const PORTAL_ARCHIVE_FILTERS: readonly ["active", "archived", "all"];
1360
+ type PortalArchiveFilter = (typeof PORTAL_ARCHIVE_FILTERS)[number];
1361
+ /** THE LAW'S DEFAULT IS TO HIDE. A list nobody narrowed is the live things. */
1362
+ declare const DEFAULT_PORTAL_ARCHIVE_FILTER: PortalArchiveFilter;
1363
+ declare function isPortalArchiveFilter(word: unknown): word is PortalArchiveFilter;
1364
+ /** What `custom.portal_archive` and `custom.portal_restore` answer with. */
1365
+ interface PortalArchiveAnswer {
1366
+ /** Where the portal stands NOW — true after an archive, false after a restore. */
1367
+ archived: boolean;
1368
+ /** False when it was already in that state; the sentence says so rather than lying about an act. */
1369
+ changed: boolean;
1370
+ portal_id: Uuid;
1371
+ archived_at?: Timestamp | null;
1372
+ /** The store's own sentence, in plain English. Show it verbatim; never a constraint name. */
1373
+ sentence: string;
1374
+ }
1375
+ /**
1376
+ * THE CONSEQUENCE, SAID BEFORE THE CLICK — never a generic "are you sure?".
1377
+ *
1378
+ * What actually changes is two things: nobody can sign in to it any more, and it
1379
+ * leaves the organization's portal list. What does NOT change is everything
1380
+ * else, and saying so is the difference between an archive somebody dares to
1381
+ * press and one they avoid.
1382
+ */
1383
+ declare function portalArchiveConsequence(title: string, signedIn: number, invited: number): string;
1384
+ /**
1385
+ * WHY THE TITLE HAS TO BE TYPED BACK, in the store's own reasoning. Ten portals
1386
+ * can carry one title, so the title is not what PICKS this one — the portal you
1387
+ * opened is. Typing it back is how you say you meant this one.
1388
+ */
1389
+ declare function portalConfirmLine(title: string): string;
1390
+ /** True when what the person typed is what the door will accept. The door decides; this only spares them a round trip. */
1391
+ declare function portalTitleTypedBack(typed: string, title: string): boolean;
1392
+ /**
1393
+ * WHAT AN EMPTY ARCHIVE LANE SAYS. An empty list is an answer: it says nothing
1394
+ * has been archived, so "none here" can never be read as "the archive is broken"
1395
+ * or as "this organization has no portals at all".
1396
+ */
1397
+ declare function emptyPortalArchiveLine(): string;
1272
1398
 
1273
1399
  /** The measures the store offers. Asked of `custom.agg_operations()` at run time too. */
1274
1400
  type AggregateOperation = "count" | "sum" | "avg" | "min" | "max";
@@ -3150,4 +3276,4 @@ interface ConversationScopeContext {
3150
3276
  /** `About: Acme Industrial` — the chip a bound chat wears. */
3151
3277
  declare function scopeChip(scope: ConversationScope): string;
3152
3278
 
3153
- export { ARCHIVE_LANES, ARCHIVE_LANE_LABEL, ARCHIVE_LANE_MEANS, 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, 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 ConversationScope, type ConversationScopeContext, type CustomFieldTableType, DEFAULT_ARCHIVE_LANE, type DashboardBlock, type DashboardBlockKind, type DashboardBlockResult, type DashboardRunResult, type DashboardSummary, Delivery, type DigestPreview, type DocRenderRow, type DocSignatureCheck, type DocSignatureRow, type DocTemplateRow, type DocToken, type DocUnresolvedToken, type EnrichAlternate, type EnrichCell, type EnrichDeclared, type EnrichDueRow, type EnrichRun, type EnrichSource, type Enrichment, type EnrichmentSummary, type EntityFieldRights, type EntityFieldValue, type EntityRecordMatch, type EntityRecordRead, type EntityRecordsFound, type EntityTableFacts, type ExternalPrincipalCard, FIELD_KINDS, Field, type FieldHistoryEntry, type FieldKind, type FormSummary, Freshness, type HistoryActor, type HistoryActorKind, type HistoryChange, type Home, type ImportBatchResult, type ImportColumnPlan, type ImportFinished, type ImportOpened, type ImportOutcome, type ImportPlan, type ImportPolicy, type ImportProposal, type ImportReport, type ImportRun, type InboundAddress, type InboundDeclared, type KernelTargets, type MergeField, MergeFieldModifier, type MergeFieldProvenance, type MergeFieldResolution, MergeFieldSemanticType, MergeFieldSource, type MergeFieldTransform, type MissingBehavior, type MyLevel, type MySubscription, type NewEntityFieldDeclaration, OnDelete, OverridePolicy, PERMISSION_LEVELS, PIPELINE_RULE_KINDS, ParityFieldType, type PermissionLevel, PgError, type Pipeline, type PipelineColumn, type PipelineDeclared, type PipelineGate, type PipelineGatePreview, type PipelineMissingField, type PipelineMoveResult, type PipelineRule, type PipelineRuleKind, type PipelineSpec, type PipelineStage, type PipelineVerdict, type PortalCard, type PortalInvitation, type PortalPreviewRow, type PortalPrincipal, type PortalRevocation, type PortalSummary, type PortalTableExposure, type PortalTableRef, type PublishBinding, type QueuedCapture, type QueuedCaptureFile, type QueuedCaptureState, type QuietHours, REFUSALS_WORTH_REPEATING, ReadRow, type RecordComment, RecordDocument, type RecordFilter, type RecordHistoryEntry, type RecordScopeComment, type RecordScopeContext, type RecordScopeField, type RecordScopeHistoryEntry, type RecordScopeRelation, type RecordScopeWithheld, type RecordsActor, type RecordsChangeSink, type RecordsConfig, type RecordsDataSource, type RecordsErrorSink, type RecordsFilter, type RecordsRealtimePort, type RecordsResolverPort, type RecordsResponse, type RecordsTableQuery, type RegisteredTable, type Relation, RelationBinding, RelationCardinality, type RelationCarries, type RelationCoordinate, RelationFlavor, type RelationProperties, type RelationTarget, type ResolutionTriple, type ResolvedPublishBinding, type RestorePreview, type RestoreResult, type Rule, type RuleAnswer, type RuleExpression, RuleNodeKind, RuleUse, STAGE_RULE_ENFORCEMENT, STAGE_RULE_ON_FAIL, type SavedViewRow, type SavedViewSpecIn, type StagePending, type StagePendingOnBoard, type StageRuleEnforcement, type StageRuleOnFail, type StageRuleWarning, StorageMode, StoredRecord, type StuckRow, type Subscription, type SubscriptionBlock, type SubscriptionCadence, type SubscriptionSpec, type Table, type TableCapacity, TableDisplay, TableOrigin, TableType, Timestamp, Uuid, type WorkApprovalDecision, type WorkApprovalFiled, type WorkApprover, type WorkAssignment, type WorkAssignmentField, type WorkChange, type WorkDueState, type WorkGraph, type WorkInboxItem, type WorkInboxKind, type WorkInstantiation, type WorkListFlavour, type WorkListItem, type WorkOrigin, type WorkRecordState, type WorkSlotHold, type WorkState, type WorkTemplateNode, type WorkTemplateRelation, type WorkTurn, archivedByLine, archivedWhen, asPermissionLevel, atLeast, bookingPath, choiceSlug, choiceValuesOf, choicesOf, coerceTypedAnswer, coerceTypedAnswers, coercionLabel, emptyArchiveLine, fieldKindFor, forgetAllOps, highestLevel, holdsARetiredChoice, indexedDbStore, isArchiveLane, isDecided, isOwnOp, isTheChosen, looksLikeAnId, mayDrag, measureKey, memoryStore, mintClientKey, mintOpId, openCaptureQueue, optionKey, optionLabel, portalPath, publicFormPath, rememberedOpCount, sameDocument, scopeChip, stableFilterKey };
3279
+ export { ARCHIVE_LANES, ARCHIVE_LANE_LABEL, ARCHIVE_LANE_MEANS, 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, 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 ConversationScope, type ConversationScopeContext, type CustomFieldTableType, DEFAULT_ARCHIVE_LANE, DEFAULT_PORTAL_ARCHIVE_FILTER, type DashboardBlock, type DashboardBlockKind, type DashboardBlockResult, type DashboardRunResult, type DashboardSummary, Delivery, type DigestPreview, type DocRenderRow, type DocSignatureCheck, type DocSignatureRow, type DocTemplateRow, type DocToken, type DocUnresolvedToken, type EnrichAlternate, type EnrichCell, type EnrichDeclared, type EnrichDueRow, type EnrichRun, type EnrichSource, type Enrichment, type EnrichmentSummary, type EntityFieldRights, type EntityFieldValue, type EntityRecordMatch, type EntityRecordRead, type EntityRecordsFound, type EntityTableFacts, type ExternalPrincipalCard, FIELD_KINDS, Field, type FieldHistoryEntry, type FieldKind, type FormSummary, Freshness, 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 KernelTargets, type MergeField, MergeFieldModifier, type MergeFieldProvenance, type MergeFieldResolution, MergeFieldSemanticType, MergeFieldSource, type MergeFieldTransform, type MissingBehavior, type MyLevel, type MySubscription, type NewEntityFieldDeclaration, OnDelete, OverridePolicy, PERMISSION_LEVELS, PIPELINE_RULE_KINDS, PORTAL_ARCHIVE_FILTERS, ParityFieldType, type PermissionLevel, PgError, type Pipeline, type PipelineColumn, type PipelineDeclared, type PipelineGate, type PipelineGatePreview, type PipelineMissingField, type PipelineMoveResult, type PipelineRule, type PipelineRuleKind, type PipelineSpec, type PipelineStage, type PipelineVerdict, type PortalArchiveAnswer, type PortalArchiveFilter, type PortalCard, type PortalInvitation, type PortalPreviewRow, type PortalPrincipal, type PortalRevocation, type PortalSummary, type PortalTableExposure, type PortalTableRef, type PublishBinding, type QueuedCapture, type QueuedCaptureFile, type QueuedCaptureState, type QuietHours, REFUSALS_WORTH_REPEATING, ReadRow, type RecordComment, RecordDocument, type RecordFilter, type RecordHistoryEntry, type RecordScopeComment, type RecordScopeContext, type RecordScopeField, type RecordScopeHistoryEntry, type RecordScopeRelation, type RecordScopeWithheld, type RecordsActor, type RecordsChangeSink, type RecordsConfig, type RecordsDataSource, type RecordsErrorSink, type RecordsFilter, type RecordsRealtimePort, type RecordsResolverPort, type RecordsResponse, type RecordsTableQuery, type RegisteredTable, type Relation, RelationBinding, RelationCardinality, type RelationCarries, type RelationCoordinate, RelationFlavor, type RelationProperties, type RelationTarget, type ResolutionTriple, type ResolvedPublishBinding, type RestorePreview, type RestoreResult, type Rule, type RuleAnswer, type RuleExpression, RuleNodeKind, RuleUse, STAGE_RULE_ENFORCEMENT, STAGE_RULE_ON_FAIL, type SavedViewRow, type SavedViewSpecIn, type StagePending, type StagePendingOnBoard, type StageRuleEnforcement, type StageRuleOnFail, type StageRuleWarning, StorageMode, StoredRecord, type StuckRow, type Subscription, type SubscriptionBlock, type SubscriptionCadence, type SubscriptionSpec, type Table, type TableArchiveProgress, type TableCapacity, TableDisplay, TableOrigin, TableType, Timestamp, Uuid, type WorkApprovalDecision, type WorkApprovalFiled, type WorkApprover, type WorkAssignment, type WorkAssignmentField, type WorkChange, type WorkDueState, type WorkGraph, type WorkInboxItem, type WorkInboxKind, type WorkInstantiation, type WorkListFlavour, type WorkListItem, type WorkOrigin, type WorkRecordState, type WorkSlotHold, type WorkState, type WorkTemplateNode, type WorkTemplateRelation, type WorkTurn, archivedByLine, archivedWhen, asPermissionLevel, atLeast, bookingPath, choiceSlug, choiceValuesOf, choicesOf, coerceTypedAnswer, coerceTypedAnswers, coercionLabel, emptyArchiveLine, emptyPortalArchiveLine, fieldKindFor, forgetAllOps, highestLevel, holdsARetiredChoice, indexedDbStore, isArchiveLane, isDecided, isOwnOp, isPortalArchiveFilter, isTheChosen, looksLikeAnId, mayDrag, measureKey, memoryStore, mintClientKey, mintOpId, openCaptureQueue, optionKey, optionLabel, portalArchiveConsequence, portalConfirmLine, portalPath, portalTitleTypedBack, publicFormPath, rememberedOpCount, sameDocument, scopeChip, stableFilterKey };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { U as Uuid, g as Timestamp, k as ReadRow, h as RecordDocument, T as TableType, a as TableDisplay, S as StorageMode, ay as TableOrigin, m as StoredRecord, l as Field, a9 as ParityFieldType, ao as RuleUse, an as RuleNodeKind, R as RelationFlavor, O as OnDelete, ak as RelationBinding, f as RelationCardinality, a3 as MergeFieldSource, a2 as MergeFieldSemanticType, a1 as MergeFieldModifier, a6 as OverridePolicy, G as Delivery, V as Freshness, x as Actor, P as PgError } from './field-C6_QKP1G.js';
2
- export { A as ABSENCE_REASONS, v as ACTOR_VOCABULARY, w as AbsenceReason, y as COMPUTE_ON, z as CONTEXT_POLICIES, C as ComputeOn, e as ContextPolicy, D as DECLARABLE_FIELD_KINDS, B as DELIVERIES, E as DeclarableFieldKind, H as ENTITY_TOKENS, I as EntityToken, J as FIELD_SENSITIVITIES, K as FIELD_SOURCES, L as FRESHNESS, M as FieldBehavior, n as FieldPatch, q as FieldProposal, c as FieldRule, d as FieldSensitivity, b as FieldSource, F as FieldTypeWord, Q as ForbiddenEnvelopeWord, X as HiddenFieldNotice, Y as KERNEL_TABLES, Z as KernelTableName, _ as MERGE_FIELD_MODIFIERS, $ as MERGE_FIELD_SEMANTIC_TYPES, a0 as MERGE_FIELD_SOURCES, N as NewFieldDeclaration, a4 as ON_DELETE, a5 as OVERRIDE_POLICIES, a7 as PARITY_FIELD_TYPES, a8 as PER_VALUE_ACCESS_WORDS, aa as ParityFieldTypeDescriptor, ab as PerValueAccessWord, u as PredictedRefusal, ac as ProvenancePointer, ad as RELATION_BINDINGS, ae as RELATION_CARDINALITIES, af as RELATION_FLAVORS, ag as RETIRED_ACTOR_WORDS, ah as RULE_NODE_KINDS, ai as RULE_USES, p as ReadValue, j as RecordRead, o as RecordRevision, s as RecordsError, aj as RecordsErrorCode, i as RecordsResult, al as RelationDisplay, am as RetiredActorWord, ap as STORAGE_MODES, aq as STORE_DOORS, ar as STORE_KNOBS, as as STORE_REFUSAL_CODES, t as StaleWriteDetail, at as StoreDoorName, au as StoreRefusalCode, av as TABLE_DISPLAYS, aw as TABLE_ORIGINS, ax as TABLE_TYPES, r as TableProposal, az as VALUE_ALTERNATE_KEYS, aA as VALUE_ENVELOPE_KEYS, aB as ValueAlternate, aC as ValueAlternateKey, aD as ValueEnvelope, aE as ValueEnvelopeKey, aF as ValueSource, W as WriteConflict, aG as err, aH as isRecordsErr, aI as ok } from './field-C6_QKP1G.js';
1
+ import { U as Uuid, g as Timestamp, k as ReadRow, h as RecordDocument, T as TableType, a as TableDisplay, S as StorageMode, ay as TableOrigin, m as StoredRecord, l as Field, a9 as ParityFieldType, ao as RuleUse, an as RuleNodeKind, R as RelationFlavor, O as OnDelete, ak as RelationBinding, f as RelationCardinality, a3 as MergeFieldSource, a2 as MergeFieldSemanticType, a1 as MergeFieldModifier, a6 as OverridePolicy, G as Delivery, V as Freshness, x as Actor, P as PgError } from './field-ddMymGEI.js';
2
+ export { A as ABSENCE_REASONS, v as ACTOR_VOCABULARY, w as AbsenceReason, y as COMPUTE_ON, z as CONTEXT_POLICIES, C as ComputeOn, e as ContextPolicy, D as DECLARABLE_FIELD_KINDS, B as DELIVERIES, E as DeclarableFieldKind, H as ENTITY_TOKENS, I as EntityToken, J as FIELD_SENSITIVITIES, K as FIELD_SOURCES, L as FRESHNESS, M as FieldBehavior, n as FieldPatch, q as FieldProposal, c as FieldRule, d as FieldSensitivity, b as FieldSource, F as FieldTypeWord, Q as ForbiddenEnvelopeWord, X as HiddenFieldNotice, Y as KERNEL_TABLES, Z as KernelTableName, _ as MERGE_FIELD_MODIFIERS, $ as MERGE_FIELD_SEMANTIC_TYPES, a0 as MERGE_FIELD_SOURCES, N as NewFieldDeclaration, a4 as ON_DELETE, a5 as OVERRIDE_POLICIES, a7 as PARITY_FIELD_TYPES, a8 as PER_VALUE_ACCESS_WORDS, aa as ParityFieldTypeDescriptor, ab as PerValueAccessWord, u as PredictedRefusal, ac as ProvenancePointer, ad as RELATION_BINDINGS, ae as RELATION_CARDINALITIES, af as RELATION_FLAVORS, ag as RETIRED_ACTOR_WORDS, ah as RULE_NODE_KINDS, ai as RULE_USES, p as ReadValue, j as RecordRead, o as RecordRevision, s as RecordsError, aj as RecordsErrorCode, i as RecordsResult, al as RelationDisplay, am as RetiredActorWord, ap as STORAGE_MODES, aq as STORE_DOORS, ar as STORE_KNOBS, as as STORE_REFUSAL_CODES, t as StaleWriteDetail, at as StoreDoorName, au as StoreRefusalCode, av as TABLE_DISPLAYS, aw as TABLE_ORIGINS, ax as TABLE_TYPES, r as TableProposal, az as VALUE_ALTERNATE_KEYS, aA as VALUE_ENVELOPE_KEYS, aB as ValueAlternate, aC as ValueAlternateKey, aD as ValueEnvelope, aE as ValueEnvelopeKey, aF as ValueSource, W as WriteConflict, aG as err, aH as isRecordsErr, aI as ok } from './field-ddMymGEI.js';
3
3
 
4
4
  /**
5
5
  * THE TWO LANES THE ARCHIVED-ITEMS LAW NAMES (Arman, 2026-09-09) — the same
@@ -169,6 +169,51 @@ interface TableCapacity {
169
169
  /** The knob that decides the ceiling, named so a person can act on it. */
170
170
  knob: string;
171
171
  }
172
+ /**
173
+ * WHAT ONE PASS OF `custom.table_archive` ANSWERS WITH — the numbers a screen
174
+ * needs to draw a bar and write a sentence, instead of a spinner and an
175
+ * SQLSTATE (VERIFIER-10 F3, VERIFIER-11 F3).
176
+ *
177
+ * Archiving a table is a JOB, NOT A STATEMENT. `custom.record_delete` on a
178
+ * Table recurses through everything the Table contains inside one transaction,
179
+ * which is unbounded by construction: at 1,430 records it dies on `57014`,
180
+ * "canceling statement due to statement timeout", and nothing is changed. The
181
+ * remedy for a thing that cannot finish in one statement is more statements,
182
+ * never a longer one — so the caller loops, passing its own `chunk`, until
183
+ * `done`.
184
+ *
185
+ * IT IS RESUMABLE BECAUSE IT IS STATELESS. There is no job row to lose:
186
+ * `remaining` is read off the records themselves on every call, so a browser
187
+ * closed halfway, a failed pass or a deploy mid-run all leave a table that is
188
+ * half archived and a next call that picks up exactly where the last stopped.
189
+ * Which is why a screen driving this may NEVER say "nothing was changed" after
190
+ * a pass that moved rows — `archived_total` is what really landed.
191
+ *
192
+ * NOTHING IS DELETED. Every row goes through `custom.record_delete`, so every
193
+ * guard, history capture and outbox row still happens and `recordRestore`
194
+ * still brings any of them back.
195
+ */
196
+ interface TableArchiveProgress {
197
+ table_id: Uuid;
198
+ /** The table's own name, so a sentence can use it rather than an id. */
199
+ table_name: string;
200
+ /** What THIS pass archived. */
201
+ archived: number;
202
+ /** Records of this table still live. Zero is the end of the row work. */
203
+ remaining: number;
204
+ /** Records this table has ever held: `remaining` + `archived_total`. */
205
+ total: number;
206
+ /** Records of this table already archived, across every pass ever made. */
207
+ archived_total: number;
208
+ /** Whether the Table record itself has been archived. */
209
+ table_archived: boolean;
210
+ /** Nothing live is left to do. The caller's loop ends here. */
211
+ done: boolean;
212
+ /** The chunk the door actually took on — it clamps what it is handed. */
213
+ chunk: number;
214
+ /** The store's own sentence about this pass, in the product's voice. */
215
+ message: string;
216
+ }
172
217
 
173
218
  /** One option, as `_choices` names it and as `optionsOf` returns it. */
174
219
  interface ChoiceOption {
@@ -1001,6 +1046,14 @@ interface ImportOpened {
1001
1046
  rows_duplicate: number;
1002
1047
  source_name: string | null;
1003
1048
  opened_at?: Timestamp;
1049
+ /**
1050
+ * IMPORT-2. How many rows to send in the FIRST call. The store owns this
1051
+ * number rather than a screen, because nothing has been measured yet when a
1052
+ * run opens and a batch size written into a wizard is wrong on a busy
1053
+ * afternoon and stale the day the write path gets cheaper. Every call after
1054
+ * the first uses `ImportBatchResult.rows_per_call`, which is measured.
1055
+ */
1056
+ rows_per_call?: number;
1004
1057
  message: string;
1005
1058
  }
1006
1059
  /** One row of the file, and what became of it. */
@@ -1045,6 +1098,36 @@ interface ImportBatchResult {
1045
1098
  rows_refused: number;
1046
1099
  outcomes: ImportOutcome[];
1047
1100
  proposals: ImportProposal[];
1101
+ /**
1102
+ * IMPORT-2. The columns this call had to declare because the run never took
1103
+ * the `importDeclareColumns` step. Normally empty: declaring is its own step.
1104
+ */
1105
+ columns_added?: ImportProposal[];
1106
+ /**
1107
+ * IMPORT-2. FALSE means the batch could not be written as one statement — one
1108
+ * row of it was refused by a guard that refuses the whole statement — so every
1109
+ * row was written on its own instead and the refusals below name the rows that
1110
+ * could not be. The answers are identical either way; this says what it cost.
1111
+ */
1112
+ one_statement?: boolean;
1113
+ /** How long THIS call's writing phase took, and what that was a row. */
1114
+ write_ms?: number;
1115
+ ms_per_row?: number;
1116
+ /**
1117
+ * IMPORT-2. How many rows the NEXT call should carry, measured from this one:
1118
+ * the store aims at two seconds of writing, which leaves a database that gets
1119
+ * 50% busier between two calls still inside the three seconds a person should
1120
+ * wait. Send this many next. Ignoring it costs correctness nothing.
1121
+ */
1122
+ rows_per_call?: number;
1123
+ }
1124
+ /** IMPORT-2. What `importDeclareColumns` made, as its own step of the wizard. */
1125
+ interface ImportColumnsDeclared {
1126
+ table_id: Uuid;
1127
+ columns_added: ImportProposal[];
1128
+ /** Header -> Field key, including the headers that already named a column. */
1129
+ mapping: Record<string, string>;
1130
+ message: string;
1048
1131
  }
1049
1132
  interface ImportFinished {
1050
1133
  import_id: Uuid;
@@ -1269,6 +1352,49 @@ interface PortalPreviewRow {
1269
1352
  * nothing more. That is why it is readable and why copying it is safe.
1270
1353
  */
1271
1354
  declare function portalPath(slug: string): string;
1355
+ /**
1356
+ * The platform archive filter's own three values, and no fourth. `custom.list_portals`
1357
+ * refuses anything else with `22023` rather than quietly treating it as one of them.
1358
+ */
1359
+ declare const PORTAL_ARCHIVE_FILTERS: readonly ["active", "archived", "all"];
1360
+ type PortalArchiveFilter = (typeof PORTAL_ARCHIVE_FILTERS)[number];
1361
+ /** THE LAW'S DEFAULT IS TO HIDE. A list nobody narrowed is the live things. */
1362
+ declare const DEFAULT_PORTAL_ARCHIVE_FILTER: PortalArchiveFilter;
1363
+ declare function isPortalArchiveFilter(word: unknown): word is PortalArchiveFilter;
1364
+ /** What `custom.portal_archive` and `custom.portal_restore` answer with. */
1365
+ interface PortalArchiveAnswer {
1366
+ /** Where the portal stands NOW — true after an archive, false after a restore. */
1367
+ archived: boolean;
1368
+ /** False when it was already in that state; the sentence says so rather than lying about an act. */
1369
+ changed: boolean;
1370
+ portal_id: Uuid;
1371
+ archived_at?: Timestamp | null;
1372
+ /** The store's own sentence, in plain English. Show it verbatim; never a constraint name. */
1373
+ sentence: string;
1374
+ }
1375
+ /**
1376
+ * THE CONSEQUENCE, SAID BEFORE THE CLICK — never a generic "are you sure?".
1377
+ *
1378
+ * What actually changes is two things: nobody can sign in to it any more, and it
1379
+ * leaves the organization's portal list. What does NOT change is everything
1380
+ * else, and saying so is the difference between an archive somebody dares to
1381
+ * press and one they avoid.
1382
+ */
1383
+ declare function portalArchiveConsequence(title: string, signedIn: number, invited: number): string;
1384
+ /**
1385
+ * WHY THE TITLE HAS TO BE TYPED BACK, in the store's own reasoning. Ten portals
1386
+ * can carry one title, so the title is not what PICKS this one — the portal you
1387
+ * opened is. Typing it back is how you say you meant this one.
1388
+ */
1389
+ declare function portalConfirmLine(title: string): string;
1390
+ /** True when what the person typed is what the door will accept. The door decides; this only spares them a round trip. */
1391
+ declare function portalTitleTypedBack(typed: string, title: string): boolean;
1392
+ /**
1393
+ * WHAT AN EMPTY ARCHIVE LANE SAYS. An empty list is an answer: it says nothing
1394
+ * has been archived, so "none here" can never be read as "the archive is broken"
1395
+ * or as "this organization has no portals at all".
1396
+ */
1397
+ declare function emptyPortalArchiveLine(): string;
1272
1398
 
1273
1399
  /** The measures the store offers. Asked of `custom.agg_operations()` at run time too. */
1274
1400
  type AggregateOperation = "count" | "sum" | "avg" | "min" | "max";
@@ -3150,4 +3276,4 @@ interface ConversationScopeContext {
3150
3276
  /** `About: Acme Industrial` — the chip a bound chat wears. */
3151
3277
  declare function scopeChip(scope: ConversationScope): string;
3152
3278
 
3153
- export { ARCHIVE_LANES, ARCHIVE_LANE_LABEL, ARCHIVE_LANE_MEANS, 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, 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 ConversationScope, type ConversationScopeContext, type CustomFieldTableType, DEFAULT_ARCHIVE_LANE, type DashboardBlock, type DashboardBlockKind, type DashboardBlockResult, type DashboardRunResult, type DashboardSummary, Delivery, type DigestPreview, type DocRenderRow, type DocSignatureCheck, type DocSignatureRow, type DocTemplateRow, type DocToken, type DocUnresolvedToken, type EnrichAlternate, type EnrichCell, type EnrichDeclared, type EnrichDueRow, type EnrichRun, type EnrichSource, type Enrichment, type EnrichmentSummary, type EntityFieldRights, type EntityFieldValue, type EntityRecordMatch, type EntityRecordRead, type EntityRecordsFound, type EntityTableFacts, type ExternalPrincipalCard, FIELD_KINDS, Field, type FieldHistoryEntry, type FieldKind, type FormSummary, Freshness, type HistoryActor, type HistoryActorKind, type HistoryChange, type Home, type ImportBatchResult, type ImportColumnPlan, type ImportFinished, type ImportOpened, type ImportOutcome, type ImportPlan, type ImportPolicy, type ImportProposal, type ImportReport, type ImportRun, type InboundAddress, type InboundDeclared, type KernelTargets, type MergeField, MergeFieldModifier, type MergeFieldProvenance, type MergeFieldResolution, MergeFieldSemanticType, MergeFieldSource, type MergeFieldTransform, type MissingBehavior, type MyLevel, type MySubscription, type NewEntityFieldDeclaration, OnDelete, OverridePolicy, PERMISSION_LEVELS, PIPELINE_RULE_KINDS, ParityFieldType, type PermissionLevel, PgError, type Pipeline, type PipelineColumn, type PipelineDeclared, type PipelineGate, type PipelineGatePreview, type PipelineMissingField, type PipelineMoveResult, type PipelineRule, type PipelineRuleKind, type PipelineSpec, type PipelineStage, type PipelineVerdict, type PortalCard, type PortalInvitation, type PortalPreviewRow, type PortalPrincipal, type PortalRevocation, type PortalSummary, type PortalTableExposure, type PortalTableRef, type PublishBinding, type QueuedCapture, type QueuedCaptureFile, type QueuedCaptureState, type QuietHours, REFUSALS_WORTH_REPEATING, ReadRow, type RecordComment, RecordDocument, type RecordFilter, type RecordHistoryEntry, type RecordScopeComment, type RecordScopeContext, type RecordScopeField, type RecordScopeHistoryEntry, type RecordScopeRelation, type RecordScopeWithheld, type RecordsActor, type RecordsChangeSink, type RecordsConfig, type RecordsDataSource, type RecordsErrorSink, type RecordsFilter, type RecordsRealtimePort, type RecordsResolverPort, type RecordsResponse, type RecordsTableQuery, type RegisteredTable, type Relation, RelationBinding, RelationCardinality, type RelationCarries, type RelationCoordinate, RelationFlavor, type RelationProperties, type RelationTarget, type ResolutionTriple, type ResolvedPublishBinding, type RestorePreview, type RestoreResult, type Rule, type RuleAnswer, type RuleExpression, RuleNodeKind, RuleUse, STAGE_RULE_ENFORCEMENT, STAGE_RULE_ON_FAIL, type SavedViewRow, type SavedViewSpecIn, type StagePending, type StagePendingOnBoard, type StageRuleEnforcement, type StageRuleOnFail, type StageRuleWarning, StorageMode, StoredRecord, type StuckRow, type Subscription, type SubscriptionBlock, type SubscriptionCadence, type SubscriptionSpec, type Table, type TableCapacity, TableDisplay, TableOrigin, TableType, Timestamp, Uuid, type WorkApprovalDecision, type WorkApprovalFiled, type WorkApprover, type WorkAssignment, type WorkAssignmentField, type WorkChange, type WorkDueState, type WorkGraph, type WorkInboxItem, type WorkInboxKind, type WorkInstantiation, type WorkListFlavour, type WorkListItem, type WorkOrigin, type WorkRecordState, type WorkSlotHold, type WorkState, type WorkTemplateNode, type WorkTemplateRelation, type WorkTurn, archivedByLine, archivedWhen, asPermissionLevel, atLeast, bookingPath, choiceSlug, choiceValuesOf, choicesOf, coerceTypedAnswer, coerceTypedAnswers, coercionLabel, emptyArchiveLine, fieldKindFor, forgetAllOps, highestLevel, holdsARetiredChoice, indexedDbStore, isArchiveLane, isDecided, isOwnOp, isTheChosen, looksLikeAnId, mayDrag, measureKey, memoryStore, mintClientKey, mintOpId, openCaptureQueue, optionKey, optionLabel, portalPath, publicFormPath, rememberedOpCount, sameDocument, scopeChip, stableFilterKey };
3279
+ export { ARCHIVE_LANES, ARCHIVE_LANE_LABEL, ARCHIVE_LANE_MEANS, 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, 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 ConversationScope, type ConversationScopeContext, type CustomFieldTableType, DEFAULT_ARCHIVE_LANE, DEFAULT_PORTAL_ARCHIVE_FILTER, type DashboardBlock, type DashboardBlockKind, type DashboardBlockResult, type DashboardRunResult, type DashboardSummary, Delivery, type DigestPreview, type DocRenderRow, type DocSignatureCheck, type DocSignatureRow, type DocTemplateRow, type DocToken, type DocUnresolvedToken, type EnrichAlternate, type EnrichCell, type EnrichDeclared, type EnrichDueRow, type EnrichRun, type EnrichSource, type Enrichment, type EnrichmentSummary, type EntityFieldRights, type EntityFieldValue, type EntityRecordMatch, type EntityRecordRead, type EntityRecordsFound, type EntityTableFacts, type ExternalPrincipalCard, FIELD_KINDS, Field, type FieldHistoryEntry, type FieldKind, type FormSummary, Freshness, 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 KernelTargets, type MergeField, MergeFieldModifier, type MergeFieldProvenance, type MergeFieldResolution, MergeFieldSemanticType, MergeFieldSource, type MergeFieldTransform, type MissingBehavior, type MyLevel, type MySubscription, type NewEntityFieldDeclaration, OnDelete, OverridePolicy, PERMISSION_LEVELS, PIPELINE_RULE_KINDS, PORTAL_ARCHIVE_FILTERS, ParityFieldType, type PermissionLevel, PgError, type Pipeline, type PipelineColumn, type PipelineDeclared, type PipelineGate, type PipelineGatePreview, type PipelineMissingField, type PipelineMoveResult, type PipelineRule, type PipelineRuleKind, type PipelineSpec, type PipelineStage, type PipelineVerdict, type PortalArchiveAnswer, type PortalArchiveFilter, type PortalCard, type PortalInvitation, type PortalPreviewRow, type PortalPrincipal, type PortalRevocation, type PortalSummary, type PortalTableExposure, type PortalTableRef, type PublishBinding, type QueuedCapture, type QueuedCaptureFile, type QueuedCaptureState, type QuietHours, REFUSALS_WORTH_REPEATING, ReadRow, type RecordComment, RecordDocument, type RecordFilter, type RecordHistoryEntry, type RecordScopeComment, type RecordScopeContext, type RecordScopeField, type RecordScopeHistoryEntry, type RecordScopeRelation, type RecordScopeWithheld, type RecordsActor, type RecordsChangeSink, type RecordsConfig, type RecordsDataSource, type RecordsErrorSink, type RecordsFilter, type RecordsRealtimePort, type RecordsResolverPort, type RecordsResponse, type RecordsTableQuery, type RegisteredTable, type Relation, RelationBinding, RelationCardinality, type RelationCarries, type RelationCoordinate, RelationFlavor, type RelationProperties, type RelationTarget, type ResolutionTriple, type ResolvedPublishBinding, type RestorePreview, type RestoreResult, type Rule, type RuleAnswer, type RuleExpression, RuleNodeKind, RuleUse, STAGE_RULE_ENFORCEMENT, STAGE_RULE_ON_FAIL, type SavedViewRow, type SavedViewSpecIn, type StagePending, type StagePendingOnBoard, type StageRuleEnforcement, type StageRuleOnFail, type StageRuleWarning, StorageMode, StoredRecord, type StuckRow, type Subscription, type SubscriptionBlock, type SubscriptionCadence, type SubscriptionSpec, type Table, type TableArchiveProgress, type TableCapacity, TableDisplay, TableOrigin, TableType, Timestamp, Uuid, type WorkApprovalDecision, type WorkApprovalFiled, type WorkApprover, type WorkAssignment, type WorkAssignmentField, type WorkChange, type WorkDueState, type WorkGraph, type WorkInboxItem, type WorkInboxKind, type WorkInstantiation, type WorkListFlavour, type WorkListItem, type WorkOrigin, type WorkRecordState, type WorkSlotHold, type WorkState, type WorkTemplateNode, type WorkTemplateRelation, type WorkTurn, archivedByLine, archivedWhen, asPermissionLevel, atLeast, bookingPath, choiceSlug, choiceValuesOf, choicesOf, coerceTypedAnswer, coerceTypedAnswers, coercionLabel, emptyArchiveLine, emptyPortalArchiveLine, fieldKindFor, forgetAllOps, highestLevel, holdsARetiredChoice, indexedDbStore, isArchiveLane, isDecided, isOwnOp, isPortalArchiveFilter, isTheChosen, looksLikeAnId, mayDrag, measureKey, memoryStore, mintClientKey, mintOpId, openCaptureQueue, optionKey, optionLabel, portalArchiveConsequence, portalConfirmLine, portalPath, portalTitleTypedBack, publicFormPath, rememberedOpCount, sameDocument, scopeChip, stableFilterKey };
package/dist/index.js CHANGED
@@ -387,6 +387,24 @@ function publicFormPath(formId) {
387
387
  function portalPath(slug) {
388
388
  return `/portal/c/${slug}`;
389
389
  }
390
+ var PORTAL_ARCHIVE_FILTERS = ["active", "archived", "all"];
391
+ var DEFAULT_PORTAL_ARCHIVE_FILTER = "active";
392
+ function isPortalArchiveFilter(word) {
393
+ return typeof word === "string" && PORTAL_ARCHIVE_FILTERS.includes(word);
394
+ }
395
+ function portalArchiveConsequence(title, signedIn, invited) {
396
+ const people = invited === 0 ? "Nobody is invited to it" : signedIn === 0 ? `The ${invited} ${invited === 1 ? "person" : "people"} invited to it will not be able to sign in` : `The ${signedIn} ${signedIn === 1 ? "person" : "people"} signed in to it, and the ${invited - signedIn} still invited, will not be able to sign in`;
397
+ return `\u201C${title}\u201D will leave your portal list. ${people}, and their invitation links will say this portal was archived and can be restored. Nothing is deleted \u2014 every Table it shows and everyone invited to it is kept exactly as it is, and you can restore it at any time.`;
398
+ }
399
+ function portalConfirmLine(title) {
400
+ return `Type the portal\u2019s title \u2014 ${title} \u2014 to confirm you mean this one.`;
401
+ }
402
+ function portalTitleTypedBack(typed, title) {
403
+ return typed.trim() === (title ?? "").trim();
404
+ }
405
+ function emptyPortalArchiveLine() {
406
+ return "No portal of this organization has been archived. A portal you put away waits here until somebody restores it, and nothing is ever destroyed.";
407
+ }
390
408
 
391
409
  // src/aggregate.ts
392
410
  function measureKey(measure) {
@@ -1062,6 +1080,7 @@ var STORE_DOORS = [
1062
1080
  { name: "io_export", args: "p_organization_id uuid, p_table_id uuid, p_columns text[] DEFAULT NULL::text[], p_limit integer DEFAULT 10000, p_required text DEFAULT 'viewer'::text", returns: "jsonb", security: "definer" },
1063
1081
  { name: "io_export_csv", args: "p_organization_id uuid, p_table_id uuid, p_columns text[] DEFAULT NULL::text[], p_limit integer DEFAULT 10000, p_delimiter text DEFAULT chr(44), p_required text DEFAULT 'viewer'::text", returns: "text", security: "definer" },
1064
1082
  { name: "io_import_begin", args: "p_organization_id uuid, p_table_id uuid, p_format text DEFAULT 'csv'::text, p_source_name text DEFAULT NULL::text, p_source_columns jsonb DEFAULT '[]'::jsonb, p_file_hash text DEFAULT NULL::text, p_policy jsonb DEFAULT '{}'::jsonb, p_dedupe_key text DEFAULT NULL::text, p_file_bytes bigint DEFAULT NULL::bigint, p_force boolean DEFAULT false", returns: "jsonb", security: "definer" },
1083
+ { name: "io_import_declare_columns", args: "p_organization_id uuid, p_table_id uuid, p_rows jsonb, p_mapping jsonb DEFAULT '{}'::jsonb", returns: "jsonb", security: "definer" },
1065
1084
  { name: "io_import_finish", args: "p_organization_id uuid, p_import_id uuid, p_unmapped text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
1066
1085
  { name: "io_import_forget", args: "p_organization_id uuid, p_import_id uuid", returns: "boolean", security: "definer" },
1067
1086
  { name: "io_import_open", args: "p_organization_id uuid, p_table_id uuid, p_format text DEFAULT 'csv'::text, p_source_name text DEFAULT NULL::text, p_source_columns jsonb DEFAULT '[]'::jsonb", returns: "uuid", security: "definer" },
@@ -1095,6 +1114,7 @@ var STORE_DOORS = [
1095
1114
  { name: "levels_raised_by_a_less_specific_rung", args: "", returns: "TABLE(organization_id uuid, organization_name text, member_id uuid, member_email text, record_id uuid, addressed_level permission_level, answered_level permission_level)", security: "definer" },
1096
1115
  { name: "list_door_disagreements", args: "p_pretend text DEFAULT NULL::text, p_only_organization uuid DEFAULT NULL::uuid, p_sample integer DEFAULT 200", returns: "TABLE(organization_id uuid, organization_name text, member_id uuid, table_id uuid, record_id uuid, door text, why text)", security: "invoker" },
1097
1116
  { name: "list_door_disagreements", args: "p_pretend text, p_only_organization uuid, p_sample integer, p_exhaustive boolean", returns: "TABLE(organization_id uuid, organization_name text, member_id uuid, table_id uuid, record_id uuid, door text, why text)", security: "invoker" },
1117
+ { name: "list_portals", args: "p_organization_id uuid, p_archived text DEFAULT 'active'::text", returns: "TABLE(portal_id uuid, title text, slug text, client_table_id uuid, client_table text, is_active boolean, tables integer, invited integer, signed_in integer, sign_in_method text, opened_at timestamp with time zone)", security: "definer" },
1098
1118
  { name: "lookup_value", args: "p_organization_id uuid, p_record_id uuid, p_field_data jsonb", returns: "jsonb", security: "invoker" },
1099
1119
  { name: "mask_document", args: "p_document jsonb, p_visible_keys text[], p_notices jsonb, p_by_id boolean DEFAULT false, p_key_ids jsonb DEFAULT '{}'::jsonb", returns: "jsonb", security: "invoker" },
1100
1120
  { name: "mask_document", args: "p_document jsonb, p_visible_keys text[], p_notices jsonb, p_by_id boolean DEFAULT false, p_key_ids jsonb DEFAULT '{}'::jsonb, p_declared_keys text[] DEFAULT NULL::text[]", returns: "jsonb", security: "invoker" },
@@ -1144,6 +1164,7 @@ var STORE_DOORS = [
1144
1164
  { name: "pipeline_read", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "definer" },
1145
1165
  { name: "pipeline_transition_refusal", args: "p_organization_id uuid, p_record_id uuid, p_to text", returns: "jsonb", security: "definer" },
1146
1166
  { name: "portal_admits", args: "p_organization_id uuid, p_user_id uuid DEFAULT NULL::uuid", returns: "boolean", security: "definer" },
1167
+ { name: "portal_archive", args: "p_organization_id uuid, p_portal_id uuid, p_confirm_title text, p_reason text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
1147
1168
  { name: "portal_card", args: "p_organization_id uuid, p_portal_id uuid", returns: "jsonb", security: "definer" },
1148
1169
  { name: "portal_declare", args: "p_organization_id uuid, p_title text, p_client_table_id uuid, p_tables jsonb, p_portal_id uuid DEFAULT NULL::uuid, p_slug text DEFAULT NULL::text, p_sign_in_method text DEFAULT 'magic_link'::text", returns: "uuid", security: "definer" },
1149
1170
  { name: "portal_field_map", args: "p_organization_id uuid, p_table_id uuid", returns: "TABLE(field_id uuid, field_key text, field_type text, points_at uuid)", security: "definer" },
@@ -1155,6 +1176,7 @@ var STORE_DOORS = [
1155
1176
  { name: "portal_principal_bind", args: "p_organization_id uuid, p_principal_id uuid, p_user_id uuid", returns: "jsonb", security: "definer" },
1156
1177
  { name: "portal_public", args: "p_slug text", returns: "jsonb", security: "definer" },
1157
1178
  { name: "portal_record_title", args: "p_organization_id uuid, p_record_id uuid", returns: "text", security: "definer" },
1179
+ { name: "portal_restore", args: "p_organization_id uuid, p_portal_id uuid, p_confirm_title text", returns: "jsonb", security: "definer" },
1158
1180
  { name: "portal_revoke", args: "p_organization_id uuid, p_portal_id uuid, p_principal_id uuid", returns: "jsonb", security: "definer" },
1159
1181
  { name: "portal_slug", args: "p_organization_id uuid, p_title text, p_portal_id uuid DEFAULT NULL::uuid", returns: "text", security: "definer" },
1160
1182
  { name: "portal_tables", args: "p_organization_id uuid", returns: "TABLE(portal_id uuid, table_id uuid, name text)", security: "definer" },
@@ -1297,6 +1319,7 @@ var STORE_DOORS = [
1297
1319
  { name: "stamp_value_envelopes", args: "p_data jsonb, p_actor text, p_on_behalf_of text, p_at timestamp with time zone", returns: "jsonb", security: "invoker" },
1298
1320
  { name: "storage_modes", args: "", returns: "text[]", security: "invoker" },
1299
1321
  { name: "store_is_open", args: "p_organization_id uuid DEFAULT NULL::uuid", returns: "boolean", security: "invoker" },
1322
+ { name: "store_off_sentence", args: "p_organization_id uuid", returns: "text", security: "invoker" },
1300
1323
  { name: "subscription_cadences", args: "p_organization_id uuid", returns: "text[]", security: "definer" },
1301
1324
  { name: "subscription_declare", args: "p_organization_id uuid, p_table_id uuid, p_spec jsonb", returns: "uuid", security: "definer" },
1302
1325
  { name: "subscription_mute", args: "p_organization_id uuid, p_rule_id uuid, p_muted boolean DEFAULT true", returns: "boolean", security: "definer" },
@@ -1435,16 +1458,16 @@ var STORE_KNOBS = [
1435
1458
  { key: "world_publish_enabled", value: "false", type: "boolean" }
1436
1459
  ];
1437
1460
  var STORE_REFUSAL_CODES = [
1438
- { code: "02000", raised_by: "_checklist_instantiate,_portal_invite_payload,_share_write_person,_table_share_invite_payload,checklist_declare,checklist_run,checklist_step_complete,checklist_step_refusal,checklist_template_shape,conversation_scope_bind,dashboard_delete,dashboard_run,doc_letterhead,doc_render_body,doc_render_document,doc_render_read,doc_sign,doc_signature_intact,doc_signature_read,doc_template_delete,doc_template_read,doc_template_save,enrich_pin,entity_field_retire,entity_field_update,entity_record_read,entity_value_write,external_history_event,external_rows,external_stub_upsert,external_writes_set,io_restore,migrate_delete,migrate_extract_parent,migrate_merge,migrate_reclass,migrate_rename,migrate_reparent,migrate_retype,migrate_split,migrate_undo,organization_clear,portal_card,portal_declare,portal_invite,portal_invite_accept,portal_preview,portal_principal_bind,portal_revoke,read_record,record_delete,record_restore,record_restore_preview,record_table,record_update,relation_uncarry,share_access,share_grant,share_lane_set,share_people,share_revoke,sign_request_cancel,sign_request_create,sign_request_remind,sign_request_unchanged,table_archive,table_share_outside_accept,table_share_outside_invite,table_share_outside_resend,table_share_outside_revoke,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_assign,work_record_states,work_set_state" },
1461
+ { code: "02000", raised_by: "_checklist_instantiate,_portal_invite_payload,_share_write_person,_table_share_invite_payload,checklist_declare,checklist_run,checklist_step_complete,checklist_step_refusal,checklist_template_shape,conversation_scope_bind,dashboard_delete,dashboard_run,doc_letterhead,doc_render_body,doc_render_document,doc_render_read,doc_sign,doc_signature_intact,doc_signature_read,doc_template_delete,doc_template_read,doc_template_save,enrich_pin,entity_field_retire,entity_field_update,entity_record_read,entity_value_write,external_history_event,external_rows,external_stub_upsert,external_writes_set,io_restore,migrate_delete,migrate_extract_parent,migrate_merge,migrate_reclass,migrate_rename,migrate_reparent,migrate_retype,migrate_split,migrate_undo,organization_clear,portal_archive,portal_card,portal_declare,portal_invite,portal_invite_accept,portal_preview,portal_principal_bind,portal_restore,portal_revoke,read_record,record_delete,record_restore,record_restore_preview,record_table,record_update,relation_uncarry,share_access,share_grant,share_lane_set,share_people,share_revoke,sign_request_cancel,sign_request_create,sign_request_remind,sign_request_unchanged,table_archive,table_share_outside_accept,table_share_outside_invite,table_share_outside_resend,table_share_outside_revoke,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_assign,work_record_states,work_set_state" },
1439
1462
  { code: "0A000", raised_by: "checklist_step_complete,external_rows,external_source_declare,external_write_through,promote_field,promoted_index_expr,promoted_query_sql,promoted_read,rule_eval,work_assign" },
1440
1463
  { code: "22003", raised_by: "context_resolve" },
1441
1464
  { code: "22004", raised_by: "_entity_custom_fields_guard,_share_write_person,_value_envelope,actor_word,agg_assert_key,agg_sql,anon_capture,anon_token_issue,anon_write,assert_client_may_reach,booking_declare,capture_submit,checklist_declare,context_resolve,dashboard_block_normalize,dashboard_declare,dashboard_window_sql,doc_render_write,doc_sign,doc_signature_write,doc_template_save,enrich_land,enrich_normalize,external_history_event,external_rows,external_source_declare,external_stub_upsert,external_write_through,external_writes_set,field_history,form_declare,form_submit,home_add,io_comment_write,io_import_begin,io_infer_column,io_outbox_drain,io_restore,migrate_choice_keys,migrate_purge,migrate_reclass,migrate_split,migrate_undo,organization_clear,organization_contents,pipeline_declare,pipeline_gate_preview,portal_declare,portal_invite,portal_principal_bind,provenance_retention_days,provenance_write,query_across_homes,query_by_coordinates,query_rollup,record_delete,record_reparent,record_resolve,record_restore,record_update,record_write,record_write_many,relation_carry,relation_own,rule_declare,share_grant,sign_request_create,sign_request_sign,subscription_declare,table_archive,table_declare,table_share_outside_invite,value_restore,view_declare,work_approval_decide,work_approval_request,work_template_declare" },
1442
1465
  { code: "22007", raised_by: "dashboard_window_sql" },
1443
1466
  { code: "22012", raised_by: "rule_eval" },
1444
- { code: "22023", raised_by: "_booking_availability,_entity_custom_fields_guard,_take_op_id,_value_envelope,_work_shape_guard,actor_word,agg_assert_key,agg_sql,anon_token_issue,booking_declare,containment_parent,dashboard_block_normalize,dashboard_window_sql,doc_render_body,doc_render_write,doc_signature_write,enrich_declare,enrich_land,enrich_normalize,enrich_pin,entity_value_write,external_history_event,external_source_declare,external_stub_upsert,external_write_through,field_history,field_update,io_export,io_import_begin,io_import_finish,io_import_plan,io_import_report,io_proposal_accept,migrate_merge,migrate_reclass,my_levels,organization_clear,page_size,pin_agent_cells,pipeline_move,portal_declare,provenance_write,query_by_coordinates,query_rollup,read_records_archived,record_update,record_write_many,relation_carry,rule_eval,rule_members,share_grant,share_lane_set,sign_request_create,sign_request_sign,subscription_declare,table_rules,visibility_as_of,work_approval_request,work_list,work_slot_hold" },
1467
+ { code: "22023", raised_by: "_booking_availability,_entity_custom_fields_guard,_take_op_id,_value_envelope,_work_shape_guard,actor_word,agg_assert_key,agg_sql,anon_token_issue,booking_declare,containment_parent,dashboard_block_normalize,dashboard_window_sql,doc_render_body,doc_render_write,doc_signature_write,enrich_declare,enrich_land,enrich_normalize,enrich_pin,entity_value_write,external_history_event,external_source_declare,external_stub_upsert,external_write_through,field_history,field_update,io_export,io_import_begin,io_import_finish,io_import_plan,io_import_report,io_proposal_accept,list_portals,migrate_merge,migrate_reclass,my_levels,organization_clear,page_size,pin_agent_cells,pipeline_move,portal_declare,provenance_write,query_by_coordinates,query_rollup,read_records_archived,record_update,record_write_many,relation_carry,rule_eval,rule_members,share_grant,share_lane_set,sign_request_create,sign_request_sign,subscription_declare,table_rules,visibility_as_of,work_approval_request,work_list,work_slot_hold" },
1445
1468
  { code: "23503", raised_by: "_booking_availability,_checklist_instantiate,_containment_guard,_display_spec_for,_field_document_for,_field_type_parity_guard,_pipeline_stage_key,_record_rule_uses,agg_digest_assemble,anon_publish,anon_rate_take,anon_token_issue,anon_write,assert_organization_wall,booking_cancel,booking_confirm,booking_declare,booking_hold,booking_reschedule,capture_publish,checklist_declare,checklist_steps_table,comment_write,dashboard_declare,delete_rule,doc_sign,doc_template_save,enrich_declare,enrich_due,enrich_land,form_declare,form_submit,home_add,inbound_declare,inbound_mail_land,inbound_set,io_comment_write,io_import_begin,io_import_finish,io_import_report,io_import_rows,io_proposal_accept,migrate_demote,migrate_promote,pipeline_board,pipeline_declare,pipeline_move,pipeline_read,pipeline_transition_refusal,promote_field,promote_table,record_applicability,record_reparent,relation_carry,relation_own,resolve_first_match,rule_applies,rule_declare,rule_eval,rule_members,rule_run,sign_request_create,subscription_mute,subscription_preview,view_declare,work_set_state,work_take_assignment,work_template_instantiate" },
1446
1469
  { code: "23505", raised_by: "_share_write_person,_unique_rule_holds,doc_sign,doc_signature_write,entity_field_declare,field_declare,home_add,inbound_declare,io_proposal_accept,relation_carry,relation_own,sign_request_cancel,sign_request_create,table_share_outside_resend,work_approval_decide,work_slot_hold" },
1447
- { code: "23514", raised_by: "_checklist_instantiate,_checklist_step_guard,_containment_guard,_dated_values_guard,_derived_fields,_display_spec_for,_entity_custom_fields_guard,_field_class_guard,_field_document_for,_field_shape_guard,_field_type_parity_guard,_merge_field_shape_guard,_merge_field_temporal_guard,_promoted_field_cap_guard,_record_rule_uses,_resolve_choice_words,_rule_shape_guard,_rule_topology_guard,_store_relation_edge_names_its_field,_table_columns_word_guard,_table_shape_guard,_undeclared_key_guard,_value_envelope,_with_display,_work_shape_guard,_workdoors_approval_guard,assert_columns_are_defined,assert_entity_is_organization_scoped,booking_declare,capture_publish,capture_sheet_declare,checklist_declare,checklist_step_complete,doc_sign,doc_signature_write,doc_template_save,entity_field_declare,entity_field_retire,entity_field_update,entity_records_find,entity_table,field_declare,field_retire,field_update,home_add,io_comment_write,io_import_rows,migrate_merge,relation_carry,relation_own,sign_request_create,sign_request_sign,table_declare,validate_value_envelope,validate_values,work_set_state,work_slots_declare,work_take_assignment,work_template_instantiate" },
1470
+ { code: "23514", raised_by: "_checklist_instantiate,_checklist_step_guard,_containment_guard,_dated_values_guard,_derived_fields,_display_spec_for,_entity_custom_fields_guard,_field_class_guard,_field_document_for,_field_shape_guard,_field_type_parity_guard,_merge_field_shape_guard,_merge_field_temporal_guard,_promoted_field_cap_guard,_record_rule_uses,_resolve_choice_words,_rule_shape_guard,_rule_topology_guard,_store_relation_edge_names_its_field,_table_columns_word_guard,_table_shape_guard,_undeclared_key_guard,_value_envelope,_with_display,_work_shape_guard,_workdoors_approval_guard,assert_columns_are_defined,assert_entity_is_organization_scoped,booking_declare,capture_publish,capture_sheet_declare,checklist_declare,checklist_step_complete,doc_sign,doc_signature_write,doc_template_save,entity_field_declare,entity_field_retire,entity_field_update,entity_records_find,entity_table,field_declare,field_retire,field_update,home_add,io_comment_write,io_import_rows,migrate_merge,portal_archive,portal_restore,relation_carry,relation_own,sign_request_create,sign_request_sign,table_declare,validate_value_envelope,validate_values,work_set_state,work_slots_declare,work_take_assignment,work_template_instantiate" },
1448
1471
  { code: "40001", raised_by: "has_visibility_at" },
1449
1472
  { code: "42501", raised_by: "_doc_render_immutable,_doc_signature_immutable,_field_definition_write,_field_write_door,_rule_definition_write,_store_door,agent_table_claim,anon_capture,anon_inbound_land,anon_publish,anon_token_issue,anon_token_verify,anon_write,assert_client_may_change,assert_client_may_open,assert_client_may_reach,assert_may_know_table,assert_organization_admin,assert_store_door,booking_confirm,booking_declare,booking_hold,capture_submit,checklist_run,comment_write,conversation_scope_bind,conversation_scope_unbind,doc_sign,enrich_declare,enrich_due,enrich_land,enrich_normalize,entity_field_declare,entity_field_retire,entity_field_update,entity_value_write,external_write_through,form_declare,form_submit,inbound_mail_land,io_comment_resolve,io_comment_write,io_import_begin,io_import_finish,io_restore,migrate_purge,migrate_reclass,my_levels,organization_clear,portal_declare,portal_invitation,portal_invite,portal_invite_accept,portal_principal_bind,promote_table,query_visibility_parity,read_record,read_records,read_records_archived,read_records_by_ids,read_records_matching,record_table,share_grant,subscription_mute,subscription_preview,table_share_outside_accept,table_share_outside_invite,table_share_outside_resend,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_person" },
1450
1473
  { code: "42703", raised_by: "entity_table,portal_declare" },
@@ -2495,6 +2518,7 @@ export {
2495
2518
  CONTEXT_POLICIES,
2496
2519
  DECLARABLE_FIELD_KINDS,
2497
2520
  DEFAULT_ARCHIVE_LANE,
2521
+ DEFAULT_PORTAL_ARCHIVE_FILTER,
2498
2522
  DELIVERIES,
2499
2523
  ENTITY_TOKENS,
2500
2524
  FIELD_KINDS,
@@ -2511,6 +2535,7 @@ export {
2511
2535
  PERMISSION_LEVELS,
2512
2536
  PER_VALUE_ACCESS_WORDS,
2513
2537
  PIPELINE_RULE_KINDS,
2538
+ PORTAL_ARCHIVE_FILTERS,
2514
2539
  REFUSALS_WORTH_REPEATING,
2515
2540
  RELATION_BINDINGS,
2516
2541
  RELATION_CARDINALITIES,
@@ -2541,6 +2566,7 @@ export {
2541
2566
  coerceTypedAnswers,
2542
2567
  coercionLabel,
2543
2568
  emptyArchiveLine,
2569
+ emptyPortalArchiveLine,
2544
2570
  err,
2545
2571
  fieldKindFor,
2546
2572
  forgetAllOps,
@@ -2550,6 +2576,7 @@ export {
2550
2576
  isArchiveLane,
2551
2577
  isDecided,
2552
2578
  isOwnOp,
2579
+ isPortalArchiveFilter,
2553
2580
  isRecordsErr,
2554
2581
  isTheChosen,
2555
2582
  looksLikeAnId,
@@ -2562,7 +2589,10 @@ export {
2562
2589
  openCaptureQueue,
2563
2590
  optionKey,
2564
2591
  optionLabel,
2592
+ portalArchiveConsequence,
2593
+ portalConfirmLine,
2565
2594
  portalPath,
2595
+ portalTitleTypedBack,
2566
2596
  publicFormPath,
2567
2597
  rememberedOpCount,
2568
2598
  sameDocument,