@ai-matrx/records 0.99.26 → 0.99.27

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.
@@ -5,7 +5,7 @@ import { d as RecordsDataSource } from '../ports-iATV-A2v.cjs';
5
5
  export { M as MyLevel, O as OpLedger, P as PERMISSION_LEVELS, g as PermissionLevel, h as RecordsActor, e as RecordsChangeSink, a as RecordsConfig, c as RecordsErrorSink, i as RecordsFilter, R as RecordsRealtimePort, j as RecordsResolverPort, k as RecordsResponse, l as RecordsTableQuery, b as RowAgentPort, f as RowAgentTarget, m as asPermissionLevel, n as atLeast, o as createOpLedger, p as defaultOpLedger, q as forgetAllOps, r as highestLevel, s as isOwnOp, t as mintOpId, u as rememberedOpCount } from '../ports-iATV-A2v.cjs';
6
6
  import { F as Field } from '../field-ppX29ddi.cjs';
7
7
  export { A as ADDRESS_PARTS, c as AGENT_WRITER_WORDS, d as AddressPart, e as AddressValue, B as BARCODE_SYMBOLOGIES, f as BUTTON_DOES, g as ButtonDoes, h as ButtonPressed, i as ButtonSettings, C as ChoiceOptions, j as CoerceOptions, k as Coerced, l as CoercedAnswers, m as CoercibleField, n as FIELD_KINDS, o as FieldDuplicated, p as FieldKind, q as FieldOptionEdit, r as FieldPatch, s as FieldProposal, b as FieldRule, a as FieldTypeWord, K as KernelTargets, t as NEWER_FIELD_KINDS, u as NOT_A_MEMBER_WORDS, N as NewFieldDeclaration, v as NewerFieldKind, P as ParityFieldTypeDescriptor, w as PersonStamp, R as RelationDisplay, x as RelationNameIndex, y as RelationNameMatch, z as RelationNamesAnswer, S as STATUS_GROUPS, D as STATUS_GROUP_WORDS, E as SYSTEM_WRITER_WORDS, G as StatusGroup, T as TableProposal, H as addressFromText, I as addressMapUrl, J as addressText, L as allowsOtherValues, M as buttonNeeds, O as buttonOf, Q as buttonUrlPlaceholders, U as coerceTypedAnswer, V as coerceTypedAnswers, W as coercionLabel, X as durationText, Y as entityReferenceKindsOf, Z as fieldKindFor, _ as isAddressValue, $ as isButtonField, a0 as isEntityReferenceConfig, a1 as isPersonStamp, a2 as newerKindExportWords, a3 as newerKindOf, a4 as newerKindWords, a5 as personStampText, a6 as ratingMaxOf, a7 as readTypedDuration, a8 as relationNameIndexOf, a9 as relationNameKey, aa as relationNamesIn, ab as richTextPlain, ac as safeLinkHref, ad as splitListCell, ae as statusGroupOf } from '../field-ppX29ddi.cjs';
8
- export { BaseCopied, BaseCopyProgress, BaseCopyResult, BasePort, BaseSnapshotRecord, BaseTable, CaptureQueue, CaptureQueueCounts, CaptureQueueOptions, CaptureQueuePorts, CaptureQueueStore, CaptureSyncReport, ChooseAlternateArgs, MergeField, MergeFieldProvenance, MergeFieldResolution, MergeFieldTransform, MissingBehavior, QueuedCapture, QueuedCaptureFile, QueuedCaptureState, REFUSALS_WORTH_REPEATING, ResolutionTriple, TypedDate, TypedMatchScore, TypedNumber, TypedTime, alternatePatch, autonumberJoin, autonumberPrefixOf, autonumberSearchOf, autonumberWords, baseCopyName, chooseAlternate, duplicateBase, filterWithAutonumber, indexedDbStore, isAutonumberField, isDecided, localeDateOrder, memoryStore, mintClientKey, openCaptureQueue, rankTypedMatches, readTypedDate, readTypedNumber, readTypedTime, restoreSnapshot, snapshotBase, twoDigitYear, typedDateText, typedMatchScore, typedTimeText } from '../index.cjs';
8
+ export { BaseCopied, BaseCopyProgress, BaseCopyResult, BasePort, BaseSnapshotRecord, BaseTable, CaptureQueue, CaptureQueueCounts, CaptureQueueOptions, CaptureQueuePorts, CaptureQueueStore, CaptureSyncReport, ChooseAlternateArgs, MergeField, MergeFieldProvenance, MergeFieldResolution, MergeFieldTransform, MissingBehavior, QueuedCapture, QueuedCaptureFile, QueuedCaptureState, REFUSALS_WORTH_REPEATING, ResolutionTriple, TypedDate, TypedMatchScore, TypedNumber, TypedTime, alternatePatch, autonumberJoin, autonumberPrefixOf, autonumberSearchOf, autonumberWords, baseCopyName, chooseAlternate, duplicateBase, filterWithAutonumber, indexedDbStore, isAutonumberField, isDecided, localeDateOrder, memoryStore, mintClientKey, openCaptureQueue, pointAtCopies, rankTypedMatches, readTypedDate, readTypedNumber, readTypedTime, restoreSnapshot, snapshotBase, twoDigitYear, typedDateText, typedMatchScore, typedTimeText } from '../index.cjs';
9
9
  export { B as BookingAvailability, a as BookingDeclared, b as BookingSummary, c as BookingWindow, d as FormResults, e as FormRoute, F as FormSummary, f as Rule, g as RuleAnswer, R as RuleExpression, h as bookingPath, p as publicFormPath } from '../rule-BQwUtKk5.cjs';
10
10
  export { D as DEFAULT_PORTAL_ARCHIVE_FILTER, F as FormLookOptions, a as PORTAL_ACCENTS, b as PORTAL_ARCHIVE_FILTERS, P as PortalAccent, c as PortalArchiveAnswer, d as PortalArchiveFilter, e as PortalCard, f as PortalConfig, g as PortalConfigInput, h as PortalFooterLink, i as PortalFormAnswer, j as PortalFormInput, k as PortalFormRef, l as PortalFormSpec, m as PortalInvitation, n as PortalPreviewRow, o as PortalPrincipal, p as PortalRevocation, q as PortalStage, r as PortalStyle, s as PortalStyleInput, t as PortalSummary, u as PortalTableExposure, v as PortalTableRef, w as PublicPicture, x as emptyPortalArchiveLine, y as isPortalAccent, z as isPortalArchiveFilter, A as portalArchiveConsequence, B as portalConfirmLine, C as portalPath, E as portalTitleTypedBack } from '../portal-ffH13fsE.cjs';
11
11
  export { A as AggregateBucket, e as AggregateCompare, f as AggregateCompareKind, g as AggregateCompareWindows, h as AggregateDelta, b as AggregateFilter, i as AggregateGroupValue, c as AggregateMeasure, a as AggregateOperation, j as AggregateRow, k as AggregateWindow, l as DashboardBlock, D as DashboardBlockKind, m as DashboardBlockResult, n as DashboardRunResult, o as DashboardSummary, p as DashboardTarget, q as DashboardTargetBase, r as DashboardTargetOp, s as DashboardTargetResult, t as DashboardTotals, u as DigestPreview, I as InterfaceRead, v as InterfaceRows, w as InterfaceRowsField, M as MySubscription, Q as QuietHours, R as RecordFilter, x as RowTemplateRow, y as SavedViewColorBy, z as SavedViewDefinition, B as SavedViewLayout, d as SavedViewRow, C as SavedViewSpecIn, E as StoreFilter, F as StuckRow, G as Subscription, H as SubscriptionBlock, S as SubscriptionCadence, J as SubscriptionSpec, K as callersTimeZone, L as hasQuietHours, N as isRuleFilter, O as liftWithheld, P as measureKey, T as stableFilterKey, U as withCallersClock } from '../subscription-Ba8RKtPA.cjs';
@@ -5,7 +5,7 @@ import { d as RecordsDataSource } from '../ports-BCNNghmf.js';
5
5
  export { M as MyLevel, O as OpLedger, P as PERMISSION_LEVELS, g as PermissionLevel, h as RecordsActor, e as RecordsChangeSink, a as RecordsConfig, c as RecordsErrorSink, i as RecordsFilter, R as RecordsRealtimePort, j as RecordsResolverPort, k as RecordsResponse, l as RecordsTableQuery, b as RowAgentPort, f as RowAgentTarget, m as asPermissionLevel, n as atLeast, o as createOpLedger, p as defaultOpLedger, q as forgetAllOps, r as highestLevel, s as isOwnOp, t as mintOpId, u as rememberedOpCount } from '../ports-BCNNghmf.js';
6
6
  import { F as Field } from '../field-BHlhq24W.js';
7
7
  export { A as ADDRESS_PARTS, c as AGENT_WRITER_WORDS, d as AddressPart, e as AddressValue, B as BARCODE_SYMBOLOGIES, f as BUTTON_DOES, g as ButtonDoes, h as ButtonPressed, i as ButtonSettings, C as ChoiceOptions, j as CoerceOptions, k as Coerced, l as CoercedAnswers, m as CoercibleField, n as FIELD_KINDS, o as FieldDuplicated, p as FieldKind, q as FieldOptionEdit, r as FieldPatch, s as FieldProposal, b as FieldRule, a as FieldTypeWord, K as KernelTargets, t as NEWER_FIELD_KINDS, u as NOT_A_MEMBER_WORDS, N as NewFieldDeclaration, v as NewerFieldKind, P as ParityFieldTypeDescriptor, w as PersonStamp, R as RelationDisplay, x as RelationNameIndex, y as RelationNameMatch, z as RelationNamesAnswer, S as STATUS_GROUPS, D as STATUS_GROUP_WORDS, E as SYSTEM_WRITER_WORDS, G as StatusGroup, T as TableProposal, H as addressFromText, I as addressMapUrl, J as addressText, L as allowsOtherValues, M as buttonNeeds, O as buttonOf, Q as buttonUrlPlaceholders, U as coerceTypedAnswer, V as coerceTypedAnswers, W as coercionLabel, X as durationText, Y as entityReferenceKindsOf, Z as fieldKindFor, _ as isAddressValue, $ as isButtonField, a0 as isEntityReferenceConfig, a1 as isPersonStamp, a2 as newerKindExportWords, a3 as newerKindOf, a4 as newerKindWords, a5 as personStampText, a6 as ratingMaxOf, a7 as readTypedDuration, a8 as relationNameIndexOf, a9 as relationNameKey, aa as relationNamesIn, ab as richTextPlain, ac as safeLinkHref, ad as splitListCell, ae as statusGroupOf } from '../field-BHlhq24W.js';
8
- export { BaseCopied, BaseCopyProgress, BaseCopyResult, BasePort, BaseSnapshotRecord, BaseTable, CaptureQueue, CaptureQueueCounts, CaptureQueueOptions, CaptureQueuePorts, CaptureQueueStore, CaptureSyncReport, ChooseAlternateArgs, MergeField, MergeFieldProvenance, MergeFieldResolution, MergeFieldTransform, MissingBehavior, QueuedCapture, QueuedCaptureFile, QueuedCaptureState, REFUSALS_WORTH_REPEATING, ResolutionTriple, TypedDate, TypedMatchScore, TypedNumber, TypedTime, alternatePatch, autonumberJoin, autonumberPrefixOf, autonumberSearchOf, autonumberWords, baseCopyName, chooseAlternate, duplicateBase, filterWithAutonumber, indexedDbStore, isAutonumberField, isDecided, localeDateOrder, memoryStore, mintClientKey, openCaptureQueue, rankTypedMatches, readTypedDate, readTypedNumber, readTypedTime, restoreSnapshot, snapshotBase, twoDigitYear, typedDateText, typedMatchScore, typedTimeText } from '../index.js';
8
+ export { BaseCopied, BaseCopyProgress, BaseCopyResult, BasePort, BaseSnapshotRecord, BaseTable, CaptureQueue, CaptureQueueCounts, CaptureQueueOptions, CaptureQueuePorts, CaptureQueueStore, CaptureSyncReport, ChooseAlternateArgs, MergeField, MergeFieldProvenance, MergeFieldResolution, MergeFieldTransform, MissingBehavior, QueuedCapture, QueuedCaptureFile, QueuedCaptureState, REFUSALS_WORTH_REPEATING, ResolutionTriple, TypedDate, TypedMatchScore, TypedNumber, TypedTime, alternatePatch, autonumberJoin, autonumberPrefixOf, autonumberSearchOf, autonumberWords, baseCopyName, chooseAlternate, duplicateBase, filterWithAutonumber, indexedDbStore, isAutonumberField, isDecided, localeDateOrder, memoryStore, mintClientKey, openCaptureQueue, pointAtCopies, rankTypedMatches, readTypedDate, readTypedNumber, readTypedTime, restoreSnapshot, snapshotBase, twoDigitYear, typedDateText, typedMatchScore, typedTimeText } from '../index.js';
9
9
  export { B as BookingAvailability, a as BookingDeclared, b as BookingSummary, c as BookingWindow, d as FormResults, e as FormRoute, F as FormSummary, f as Rule, g as RuleAnswer, R as RuleExpression, h as bookingPath, p as publicFormPath } from '../rule-cGqclk_0.js';
10
10
  export { D as DEFAULT_PORTAL_ARCHIVE_FILTER, F as FormLookOptions, a as PORTAL_ACCENTS, b as PORTAL_ARCHIVE_FILTERS, P as PortalAccent, c as PortalArchiveAnswer, d as PortalArchiveFilter, e as PortalCard, f as PortalConfig, g as PortalConfigInput, h as PortalFooterLink, i as PortalFormAnswer, j as PortalFormInput, k as PortalFormRef, l as PortalFormSpec, m as PortalInvitation, n as PortalPreviewRow, o as PortalPrincipal, p as PortalRevocation, q as PortalStage, r as PortalStyle, s as PortalStyleInput, t as PortalSummary, u as PortalTableExposure, v as PortalTableRef, w as PublicPicture, x as emptyPortalArchiveLine, y as isPortalAccent, z as isPortalArchiveFilter, A as portalArchiveConsequence, B as portalConfirmLine, C as portalPath, E as portalTitleTypedBack } from '../portal-DmxuUr2f.js';
11
11
  export { A as AggregateBucket, e as AggregateCompare, f as AggregateCompareKind, g as AggregateCompareWindows, h as AggregateDelta, b as AggregateFilter, i as AggregateGroupValue, c as AggregateMeasure, a as AggregateOperation, j as AggregateRow, k as AggregateWindow, l as DashboardBlock, D as DashboardBlockKind, m as DashboardBlockResult, n as DashboardRunResult, o as DashboardSummary, p as DashboardTarget, q as DashboardTargetBase, r as DashboardTargetOp, s as DashboardTargetResult, t as DashboardTotals, u as DigestPreview, I as InterfaceRead, v as InterfaceRows, w as InterfaceRowsField, M as MySubscription, Q as QuietHours, R as RecordFilter, x as RowTemplateRow, y as SavedViewColorBy, z as SavedViewDefinition, B as SavedViewLayout, d as SavedViewRow, C as SavedViewSpecIn, E as StoreFilter, F as StuckRow, G as Subscription, H as SubscriptionBlock, S as SubscriptionCadence, J as SubscriptionSpec, K as callersTimeZone, L as hasQuietHours, N as isRuleFilter, O as liftWithheld, P as measureKey, T as stableFilterKey, U as withCallersClock } from '../subscription-eNzL9scc.js';
@@ -1719,6 +1719,7 @@ async function duplicateBase(port, args) {
1719
1719
  }
1720
1720
  const fin = args.tables.length > 1 ? await port.finish({ organizationId: args.organizationId, pairs }) : null;
1721
1721
  if (fin && !fin.ok) return { ok: false, error: fin.error, stoppedAt: args.tables[args.tables.length - 1], made };
1722
+ const extras = await copyExtras(port, args.tables, pairs);
1722
1723
  return {
1723
1724
  ok: true,
1724
1725
  data: {
@@ -1726,10 +1727,53 @@ async function duplicateBase(port, args) {
1726
1727
  tables: made,
1727
1728
  relinkedColumns: fin?.ok ? fin.data.relinked_columns : 0,
1728
1729
  relinkedCells: fin?.ok ? fin.data.relinked_cells : 0,
1730
+ ...extras,
1729
1731
  notCopied: [...notCopied]
1730
1732
  }
1731
1733
  };
1732
1734
  }
1735
+ function pointAtCopies(doc, pairs) {
1736
+ let text2 = JSON.stringify(doc);
1737
+ for (const [from, to] of Object.entries(pairs)) text2 = text2.split(from).join(to);
1738
+ return JSON.parse(text2);
1739
+ }
1740
+ async function copyExtras(port, tables, pairs) {
1741
+ let automations = 0;
1742
+ let pages = 0;
1743
+ const extrasRefused = [];
1744
+ for (const t of tables) {
1745
+ const copy = pairs[t.id];
1746
+ if (!copy) continue;
1747
+ if (port.automations && port.automationDeclare) {
1748
+ const list = await port.automations(t.id);
1749
+ if (list.ok) {
1750
+ for (const a of list.data.automations) {
1751
+ const made = await port.automationDeclare({ table_id: copy, spec: pointAtCopies(a.spec, pairs) });
1752
+ if (made.ok && made.data.ok && made.data.automation_id) {
1753
+ await port.automationSetEnabled?.({ automation_id: made.data.automation_id, enabled: false });
1754
+ automations += 1;
1755
+ } else extrasRefused.push(`Automation "${a.name}" on ${t.name} was not copied.`);
1756
+ }
1757
+ }
1758
+ }
1759
+ if (port.dashboards && port.dashboardDeclare) {
1760
+ const list = await port.dashboards(t.id);
1761
+ if (list.ok) {
1762
+ for (const d of list.data) {
1763
+ const made = await port.dashboardDeclare({
1764
+ table_id: copy,
1765
+ name: d.name,
1766
+ blocks: pointAtCopies(d.blocks, pairs),
1767
+ presentation: pointAtCopies(d.presentation, pairs)
1768
+ });
1769
+ if (made.ok) pages += 1;
1770
+ else extrasRefused.push(`Page "${d.name}" on ${t.name} was not copied.`);
1771
+ }
1772
+ }
1773
+ }
1774
+ }
1775
+ return { automations, pages, extrasRefused };
1776
+ }
1733
1777
  async function snapshotBase(port, args) {
1734
1778
  const copied = await duplicateBase(port, {
1735
1779
  organizationId: args.organizationId,
@@ -12178,6 +12222,7 @@ export {
12178
12222
  parseTableMoved,
12179
12223
  personStampText,
12180
12224
  planQuery,
12225
+ pointAtCopies,
12181
12226
  portalArchiveConsequence,
12182
12227
  portalConfirmLine,
12183
12228
  portalPath,