@outbuild-company/schedule-core 1.32.0 → 1.33.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
@@ -230,6 +230,7 @@ declare const DISPATCH_ACTION_KIND: {
230
230
  readonly CELL_CLIPBOARD_CLEAR: "cell-clipboard-clear";
231
231
  readonly CELL_PASTE_COPIED: "cell-paste-copied";
232
232
  readonly PERSISTENCE_ACKNOWLEDGE: "persistence-acknowledge";
233
+ readonly PERSISTENCE_REBASE: "persistence-rebase";
233
234
  readonly BASELINE_APPLY: "baseline-apply";
234
235
  readonly PONDERATOR_CRITERION_SET: "ponderator-criterion-set";
235
236
  readonly STATUS_CRITERIA_SET: "status-criteria-set";
@@ -611,6 +612,198 @@ declare function buildGroupRowId(attributeKey: string, valueId: string): string;
611
612
  */
612
613
  declare function appendGroupRowId(parentRowId: string, attributeKey: string, valueId: string): string;
613
614
 
615
+ /** Backend-encoded work shift consumed during calendar normalization. */
616
+ interface BackendShiftInput {
617
+ shift_string: string;
618
+ }
619
+ /** Backend calendar exception range and optional replacement shifts. */
620
+ interface BackendCalendarExceptionInput {
621
+ from_date: string;
622
+ to_date: string;
623
+ workable: boolean;
624
+ shifts?: BackendShiftInput[];
625
+ /** Recurrence step: `DAILY`, `WEEKLY`, `MONTHLY` or `YEARLY`. Empty or unknown means a plain range. */
626
+ every_type?: string | null;
627
+ }
628
+ /** Calendar payload accepted at the backend normalization boundary. */
629
+ interface BackendCalendarInput {
630
+ id: number;
631
+ name: string;
632
+ is_default: boolean;
633
+ baseDefault?: boolean;
634
+ working_days: string;
635
+ shift_start: string | null;
636
+ shift_end: string | null;
637
+ shifts: BackendShiftInput[];
638
+ exceptiondays: BackendCalendarExceptionInput[];
639
+ baseexceptiondays?: BackendCalendarExceptionInput[];
640
+ }
641
+ /**
642
+ * Activity payload accepted at the backend normalization boundary.
643
+ *
644
+ * Date fields are backend strings, `duration` is in working days, and nullable
645
+ * wire values are normalized into the stricter {@link CoreActivity} shape.
646
+ */
647
+ interface BackendActivityInput {
648
+ id: number | null;
649
+ unique_id: string;
650
+ parent_id: string;
651
+ unique_correlative_id: string;
652
+ correlative_id: number;
653
+ name: string;
654
+ description: string | null;
655
+ type: ActivityType;
656
+ start_date: string;
657
+ end_date: string;
658
+ /** Duration in working days. */
659
+ duration: number;
660
+ constraint: string | null;
661
+ constraint_date?: string | null;
662
+ progress: number;
663
+ cost: number;
664
+ used_cost: number | null;
665
+ real_cost: number | null;
666
+ hhWorkTime: number;
667
+ real_work: number | null;
668
+ ponderator: number | null;
669
+ hasCustomPonderator: boolean;
670
+ has_childs: boolean;
671
+ isOnLookahead: boolean;
672
+ sumOfDurationRecursively: number | null;
673
+ is_critical: boolean;
674
+ newActivitiesArray: string | (string | number)[] | null;
675
+ hasNewActivities: boolean | null;
676
+ isNewActivity: true | null;
677
+ custom_id: string | null;
678
+ ganttId: number;
679
+ sectorId: number;
680
+ companyId: number;
681
+ calendarId: number | null;
682
+ subcontractId: number | null;
683
+ should_be_showed?: boolean | null;
684
+ tasks: unknown[];
685
+ responsables: unknown[];
686
+ tags: unknown[];
687
+ activitymodifications: unknown[];
688
+ pendingRequests?: readonly {
689
+ id?: unknown;
690
+ }[];
691
+ subcontract: unknown;
692
+ date_origin?: string | null;
693
+ baseline_points?: BaselinePoint[];
694
+ createdAt: string;
695
+ updatedAt: string;
696
+ }
697
+ /** Dependency payload accepted at the backend normalization boundary. */
698
+ interface BackendLinkInput {
699
+ id: number | string;
700
+ unique_id?: string | null;
701
+ source_id?: string;
702
+ target_id?: string;
703
+ source?: number | string;
704
+ target?: number | string;
705
+ type?: unknown;
706
+ /** Dependency lag in working days, or `null` for zero. */
707
+ lag: number | null;
708
+ ganttId?: number;
709
+ sectorId?: number;
710
+ }
711
+ /** Schedule metadata accepted from the backend's legacy `sector` field. */
712
+ interface BackendSectorInput {
713
+ id: number;
714
+ name: string;
715
+ /** Working hours per day used for input day/hour conversion. */
716
+ hoursPerDay: number;
717
+ /** Working hours per week. */
718
+ hoursPerWeek: number;
719
+ dateFormat: string;
720
+ projectId: number;
721
+ companyId: number;
722
+ update_duration_for_primavera_for_end_date?: boolean | null;
723
+ activity_creter?: string | null;
724
+ custom_id_prefix?: string | null;
725
+ custom_id_increment?: string | number | null;
726
+ calendars?: BackendCalendarInput[];
727
+ }
728
+ /**
729
+ * Complete consumer-owned backend payload normalized during construction.
730
+ *
731
+ * Calendars are optional; omitted collections normalize to package defaults.
732
+ */
733
+ interface BackendScheduleInput {
734
+ sector: BackendSectorInput;
735
+ activities: BackendActivityInput[];
736
+ links: BackendLinkInput[];
737
+ calendars?: BackendCalendarInput[] | undefined;
738
+ baseCalendars?: BackendCalendarInput[] | undefined;
739
+ }
740
+
741
+ declare const SAVE_FIELD_POLICY: {
742
+ readonly TRACKED: "tracked";
743
+ readonly IGNORED: "ignored";
744
+ };
745
+
746
+ declare const ACTIVITY_SAVE_FIELD_POLICY: {
747
+ readonly id: "ignored";
748
+ readonly proplannerId: "ignored";
749
+ readonly parentId: "tracked";
750
+ readonly name: "tracked";
751
+ readonly description: "tracked";
752
+ readonly type: "tracked";
753
+ readonly startDate: "tracked";
754
+ readonly endDate: "tracked";
755
+ readonly durationHours: "tracked";
756
+ readonly constraintType: "tracked";
757
+ readonly constraintDate: "tracked";
758
+ readonly autoScheduling: "tracked";
759
+ readonly calendarId: "tracked";
760
+ readonly assignedDefaultCalendar: "ignored";
761
+ readonly dateOrigin: "tracked";
762
+ readonly progress: "tracked";
763
+ readonly cost: "tracked";
764
+ readonly usedCost: "tracked";
765
+ readonly realCost: "tracked";
766
+ readonly workHours: "tracked";
767
+ readonly realWorkHours: "tracked";
768
+ readonly ponderator: "tracked";
769
+ readonly hasCustomPonderator: "tracked";
770
+ readonly correlativeId: "tracked";
771
+ readonly uniqueCorrelativeId: "tracked";
772
+ readonly customId: "tracked";
773
+ readonly subcontractId: "tracked";
774
+ readonly isLookahead: "tracked";
775
+ readonly hasLookaheadTasks: "ignored";
776
+ readonly newActivityIds: "tracked";
777
+ readonly hasNewActivities: "tracked";
778
+ readonly isNewActivity: "ignored";
779
+ readonly pendingRequestIds: "ignored";
780
+ readonly responsableIds: "tracked";
781
+ readonly tagIds: "tracked";
782
+ readonly baselinePoints: "ignored";
783
+ readonly baselineSnapshot: "ignored";
784
+ readonly recursiveDurationHours: "ignored";
785
+ readonly isCritical: "ignored";
786
+ readonly freeSlackHours: "ignored";
787
+ readonly calendarDuration: "ignored";
788
+ readonly baselineVarianceDays: "ignored";
789
+ readonly projectBaselineVarianceDays: "ignored";
790
+ readonly primaryBaselineVarianceDays: "ignored";
791
+ readonly expectedProgress: "ignored";
792
+ readonly expectedProgressBaseline: "ignored";
793
+ readonly status: "ignored";
794
+ readonly criticalPath: "ignored";
795
+ readonly p6: "ignored";
796
+ };
797
+ /**
798
+ * Activity field included in consumer persistence comparisons.
799
+ *
800
+ * Derived scheduling, baseline, selection, and backend identity fields are
801
+ * intentionally excluded.
802
+ */
803
+ type PersistableActivityField = {
804
+ [Field in keyof typeof ACTIVITY_SAVE_FIELD_POLICY]: (typeof ACTIVITY_SAVE_FIELD_POLICY)[Field] extends typeof SAVE_FIELD_POLICY.TRACKED ? Field : never;
805
+ }[keyof typeof ACTIVITY_SAVE_FIELD_POLICY];
806
+
614
807
  /** Low-level dependency operation accepted by the canonical dispatcher. */
615
808
  type LinksBatchOperation = {
616
809
  kind: typeof DISPATCH_LINK_OPERATION_KIND.CREATE;
@@ -686,6 +879,100 @@ interface PersistenceCheckpoint {
686
879
  readonly p6LatestRunLog?: Readonly<P6ScheduleRunLog> | null;
687
880
  readonly historyBoundary: number;
688
881
  }
882
+ /**
883
+ * Freshly persisted schedule rows another client saved, in backend wire shape.
884
+ *
885
+ * The package normalizes them with the live calendars and merges them against
886
+ * the last acknowledged checkpoint; it performs no I/O to obtain them.
887
+ */
888
+ interface PersistenceRebaseInput {
889
+ readonly activities: ReadonlyArray<BackendActivityInput>;
890
+ readonly links: ReadonlyArray<BackendLinkInput>;
891
+ }
892
+ /**
893
+ * Why a rebase overrode one side of a merge.
894
+ *
895
+ * `field`, `deleted-remotely`, `deleted-locally`, `parent-removed` and
896
+ * `became-parent-remotely` resolve in favor of the remote save.
897
+ * `became-parent-locally` is the one case where the local structure wins: the
898
+ * local user turned a leaf into a parent, so the leaf-only values the remote
899
+ * save wrote on it (dates, duration, progress, costs) are derived from the
900
+ * children instead.
901
+ * `duplicate-link` means both sides linked the same two activities while
902
+ * neither link was saved yet: the remote link is kept (its id is the conflict
903
+ * `id`), the local one is dropped, and `mine`/`theirs` carry both definitions.
904
+ * `order` means both sides reordered the children of the same parent: the
905
+ * conflict `id` is that parent (`'0'` for the roots), `mine` is the local
906
+ * sibling order and `theirs` the merged one, which follows the remote save.
907
+ * `link-cycle` means a link the local user drew, unsaved, closed a dependency
908
+ * cycle together with the remote links: it is dropped and `mine` carries it.
909
+ */
910
+ declare const PERSISTENCE_REBASE_CONFLICT_KIND: {
911
+ readonly FIELD: "field";
912
+ readonly DELETED_REMOTELY: "deleted-remotely";
913
+ readonly DELETED_LOCALLY: "deleted-locally";
914
+ readonly PARENT_REMOVED: "parent-removed";
915
+ readonly BECAME_PARENT_REMOTELY: "became-parent-remotely";
916
+ readonly BECAME_PARENT_LOCALLY: "became-parent-locally";
917
+ readonly DUPLICATE_LINK: "duplicate-link";
918
+ readonly ORDER: "order";
919
+ readonly LINK_CYCLE: "link-cycle";
920
+ };
921
+ /** Discriminator of a rebase conflict record. */
922
+ type PersistenceRebaseConflictKind = (typeof PERSISTENCE_REBASE_CONFLICT_KIND)[keyof typeof PERSISTENCE_REBASE_CONFLICT_KIND];
923
+ /** Entity family a rebase record refers to. */
924
+ declare const PERSISTENCE_REBASE_ENTITY: {
925
+ readonly ACTIVITY: "activity";
926
+ readonly LINK: "link";
927
+ };
928
+ /** Discriminator of the entity family in a rebase record. */
929
+ type PersistenceRebaseEntity = (typeof PERSISTENCE_REBASE_ENTITY)[keyof typeof PERSISTENCE_REBASE_ENTITY];
930
+ /**
931
+ * One local edit the remote save overrode.
932
+ *
933
+ * `mine` is the value the local user had before the rebase, `theirs` the value
934
+ * now in state. For deletion conflicts the field is `null`.
935
+ */
936
+ interface PersistenceRebaseConflict {
937
+ readonly entity: PersistenceRebaseEntity;
938
+ readonly id: string;
939
+ readonly kind: PersistenceRebaseConflictKind;
940
+ readonly field: PersistableActivityField | keyof Link | null;
941
+ readonly mine: unknown;
942
+ readonly theirs: unknown;
943
+ }
944
+ /** One field another client changed that the local user had not touched. */
945
+ interface PersistenceRebaseRemoteChange {
946
+ readonly entity: PersistenceRebaseEntity;
947
+ readonly id: string;
948
+ readonly field: PersistableActivityField | keyof Link;
949
+ readonly before: unknown;
950
+ readonly after: unknown;
951
+ }
952
+ /**
953
+ * Outcome of a three-way merge between the checkpoint, local state, and a
954
+ * remote save. Remote values win every conflict; local edits that did not
955
+ * collide stay in state and remain dirty.
956
+ */
957
+ interface PersistenceRebaseReport {
958
+ readonly remoteChanges: ReadonlyArray<PersistenceRebaseRemoteChange>;
959
+ readonly conflicts: ReadonlyArray<PersistenceRebaseConflict>;
960
+ readonly createdActivityIds: ReadonlyArray<string>;
961
+ readonly removedActivityIds: ReadonlyArray<string>;
962
+ readonly rekeyedActivities: ReadonlyArray<PersistenceRebaseRekey>;
963
+ readonly rekeyedLinks: ReadonlyArray<PersistenceRebaseRekey>;
964
+ readonly createdLinkIds: ReadonlyArray<string>;
965
+ readonly removedLinkIds: ReadonlyArray<string>;
966
+ }
967
+ /**
968
+ * A locally created, not yet persisted activity or link whose id collided
969
+ * with a row the remote save persisted. The local row keeps its data under
970
+ * `to`; `from` is the id the remote row now owns.
971
+ */
972
+ interface PersistenceRebaseRekey {
973
+ readonly from: string;
974
+ readonly to: string;
975
+ }
689
976
  /** Available activity-batch replacement policies. */
690
977
  declare const ACTIVITY_BATCH_MODE: {
691
978
  readonly APPEND: "append";
@@ -796,6 +1083,9 @@ type DispatchAction = {
796
1083
  activities?: ReadonlyArray<PersistedEntityIdentity>;
797
1084
  links?: ReadonlyArray<PersistedEntityIdentity>;
798
1085
  checkpoint?: PersistenceCheckpoint;
1086
+ } | {
1087
+ kind: typeof DISPATCH_ACTION_KIND.PERSISTENCE_REBASE;
1088
+ remote: PersistenceRebaseInput;
799
1089
  } | {
800
1090
  kind: typeof DISPATCH_ACTION_KIND.BASELINE_APPLY;
801
1091
  points: ReadonlyArray<BaselinePoint>;
@@ -997,6 +1287,7 @@ type DispatchResult = {
997
1287
  verdicts?: ReadonlyArray<DatesBatchVerdict>;
998
1288
  activityVerdicts?: ReadonlyArray<DatesBatchVerdict>;
999
1289
  linkVerdicts?: ReadonlyArray<LinkBatchVerdict>;
1290
+ rebase?: PersistenceRebaseReport;
1000
1291
  } | {
1001
1292
  ok: false;
1002
1293
  reason: string;
@@ -1711,72 +2002,6 @@ interface ActivityClipboardReferences {
1711
2002
  readonly tagIds?: ReadonlyArray<string>;
1712
2003
  }
1713
2004
 
1714
- declare const SAVE_FIELD_POLICY: {
1715
- readonly TRACKED: "tracked";
1716
- readonly IGNORED: "ignored";
1717
- };
1718
-
1719
- declare const ACTIVITY_SAVE_FIELD_POLICY: {
1720
- readonly id: "ignored";
1721
- readonly proplannerId: "ignored";
1722
- readonly parentId: "tracked";
1723
- readonly name: "tracked";
1724
- readonly description: "tracked";
1725
- readonly type: "tracked";
1726
- readonly startDate: "tracked";
1727
- readonly endDate: "tracked";
1728
- readonly durationHours: "tracked";
1729
- readonly constraintType: "tracked";
1730
- readonly constraintDate: "tracked";
1731
- readonly autoScheduling: "tracked";
1732
- readonly calendarId: "tracked";
1733
- readonly assignedDefaultCalendar: "ignored";
1734
- readonly dateOrigin: "tracked";
1735
- readonly progress: "tracked";
1736
- readonly cost: "tracked";
1737
- readonly usedCost: "tracked";
1738
- readonly realCost: "tracked";
1739
- readonly workHours: "tracked";
1740
- readonly realWorkHours: "tracked";
1741
- readonly ponderator: "tracked";
1742
- readonly hasCustomPonderator: "tracked";
1743
- readonly correlativeId: "tracked";
1744
- readonly uniqueCorrelativeId: "tracked";
1745
- readonly customId: "tracked";
1746
- readonly subcontractId: "tracked";
1747
- readonly isLookahead: "tracked";
1748
- readonly hasLookaheadTasks: "ignored";
1749
- readonly newActivityIds: "tracked";
1750
- readonly hasNewActivities: "tracked";
1751
- readonly isNewActivity: "ignored";
1752
- readonly pendingRequestIds: "ignored";
1753
- readonly responsableIds: "tracked";
1754
- readonly tagIds: "tracked";
1755
- readonly baselinePoints: "ignored";
1756
- readonly baselineSnapshot: "ignored";
1757
- readonly recursiveDurationHours: "ignored";
1758
- readonly isCritical: "ignored";
1759
- readonly freeSlackHours: "ignored";
1760
- readonly calendarDuration: "ignored";
1761
- readonly baselineVarianceDays: "ignored";
1762
- readonly projectBaselineVarianceDays: "ignored";
1763
- readonly primaryBaselineVarianceDays: "ignored";
1764
- readonly expectedProgress: "ignored";
1765
- readonly expectedProgressBaseline: "ignored";
1766
- readonly status: "ignored";
1767
- readonly criticalPath: "ignored";
1768
- readonly p6: "ignored";
1769
- };
1770
- /**
1771
- * Activity field included in consumer persistence comparisons.
1772
- *
1773
- * Derived scheduling, baseline, selection, and backend identity fields are
1774
- * intentionally excluded.
1775
- */
1776
- type PersistableActivityField = {
1777
- [Field in keyof typeof ACTIVITY_SAVE_FIELD_POLICY]: (typeof ACTIVITY_SAVE_FIELD_POLICY)[Field] extends typeof SAVE_FIELD_POLICY.TRACKED ? Field : never;
1778
- }[keyof typeof ACTIVITY_SAVE_FIELD_POLICY];
1779
-
1780
2005
  /** Earliest start and latest end from the default calendar's work ranges. */
1781
2006
  interface ProjectWorkHours {
1782
2007
  startHour: string;
@@ -2538,6 +2763,20 @@ interface SchedulePersistenceApi {
2538
2763
  * @returns The complete dispatch result.
2539
2764
  */
2540
2765
  acknowledge(checkpoint: PersistenceCheckpoint): Promise<DispatchResult>;
2766
+ /**
2767
+ * Merges rows another client persisted into the live schedule without
2768
+ * reloading it.
2769
+ *
2770
+ * Three-way merge between the last acknowledged checkpoint, local state and
2771
+ * the remote rows: untouched local edits survive and stay dirty, remote
2772
+ * changes are applied, and every collision resolves in favor of the remote
2773
+ * value. The accepted result carries the merge report under `rebase`, the
2774
+ * checkpoint moves to the remote rows and history is cleared. A fork returns
2775
+ * a rejected dispatch result.
2776
+ * @param remote - Freshly fetched backend activities and links.
2777
+ * @returns The complete dispatch result with `rebase` populated on success.
2778
+ */
2779
+ rebase(remote: PersistenceRebaseInput): Promise<DispatchResult>;
2541
2780
  }
2542
2781
  /** Serialized undo/redo history for the schedule instance. */
2543
2782
  interface ScheduleHistoryApi {
@@ -2648,132 +2887,6 @@ interface ScheduleApiNamespaces {
2648
2887
  readonly diagnostics: ScheduleDiagnosticsApi;
2649
2888
  }
2650
2889
 
2651
- /** Backend-encoded work shift consumed during calendar normalization. */
2652
- interface BackendShiftInput {
2653
- shift_string: string;
2654
- }
2655
- /** Backend calendar exception range and optional replacement shifts. */
2656
- interface BackendCalendarExceptionInput {
2657
- from_date: string;
2658
- to_date: string;
2659
- workable: boolean;
2660
- shifts?: BackendShiftInput[];
2661
- /** Recurrence step: `DAILY`, `WEEKLY`, `MONTHLY` or `YEARLY`. Empty or unknown means a plain range. */
2662
- every_type?: string | null;
2663
- }
2664
- /** Calendar payload accepted at the backend normalization boundary. */
2665
- interface BackendCalendarInput {
2666
- id: number;
2667
- name: string;
2668
- is_default: boolean;
2669
- baseDefault?: boolean;
2670
- working_days: string;
2671
- shift_start: string | null;
2672
- shift_end: string | null;
2673
- shifts: BackendShiftInput[];
2674
- exceptiondays: BackendCalendarExceptionInput[];
2675
- baseexceptiondays?: BackendCalendarExceptionInput[];
2676
- }
2677
- /**
2678
- * Activity payload accepted at the backend normalization boundary.
2679
- *
2680
- * Date fields are backend strings, `duration` is in working days, and nullable
2681
- * wire values are normalized into the stricter {@link CoreActivity} shape.
2682
- */
2683
- interface BackendActivityInput {
2684
- id: number | null;
2685
- unique_id: string;
2686
- parent_id: string;
2687
- unique_correlative_id: string;
2688
- correlative_id: number;
2689
- name: string;
2690
- description: string | null;
2691
- type: ActivityType;
2692
- start_date: string;
2693
- end_date: string;
2694
- /** Duration in working days. */
2695
- duration: number;
2696
- constraint: string | null;
2697
- constraint_date?: string | null;
2698
- progress: number;
2699
- cost: number;
2700
- used_cost: number | null;
2701
- real_cost: number | null;
2702
- hhWorkTime: number;
2703
- real_work: number | null;
2704
- ponderator: number | null;
2705
- hasCustomPonderator: boolean;
2706
- has_childs: boolean;
2707
- isOnLookahead: boolean;
2708
- sumOfDurationRecursively: number | null;
2709
- is_critical: boolean;
2710
- newActivitiesArray: string | (string | number)[] | null;
2711
- hasNewActivities: boolean | null;
2712
- isNewActivity: true | null;
2713
- custom_id: string | null;
2714
- ganttId: number;
2715
- sectorId: number;
2716
- companyId: number;
2717
- calendarId: number | null;
2718
- subcontractId: number | null;
2719
- should_be_showed?: boolean | null;
2720
- tasks: unknown[];
2721
- responsables: unknown[];
2722
- tags: unknown[];
2723
- activitymodifications: unknown[];
2724
- pendingRequests?: readonly {
2725
- id?: unknown;
2726
- }[];
2727
- subcontract: unknown;
2728
- date_origin?: string | null;
2729
- baseline_points?: BaselinePoint[];
2730
- createdAt: string;
2731
- updatedAt: string;
2732
- }
2733
- /** Dependency payload accepted at the backend normalization boundary. */
2734
- interface BackendLinkInput {
2735
- id: number | string;
2736
- unique_id?: string | null;
2737
- source_id?: string;
2738
- target_id?: string;
2739
- source?: number | string;
2740
- target?: number | string;
2741
- type?: unknown;
2742
- /** Dependency lag in working days, or `null` for zero. */
2743
- lag: number | null;
2744
- ganttId?: number;
2745
- sectorId?: number;
2746
- }
2747
- /** Schedule metadata accepted from the backend's legacy `sector` field. */
2748
- interface BackendSectorInput {
2749
- id: number;
2750
- name: string;
2751
- /** Working hours per day used for input day/hour conversion. */
2752
- hoursPerDay: number;
2753
- /** Working hours per week. */
2754
- hoursPerWeek: number;
2755
- dateFormat: string;
2756
- projectId: number;
2757
- companyId: number;
2758
- update_duration_for_primavera_for_end_date?: boolean | null;
2759
- activity_creter?: string | null;
2760
- custom_id_prefix?: string | null;
2761
- custom_id_increment?: string | number | null;
2762
- calendars?: BackendCalendarInput[];
2763
- }
2764
- /**
2765
- * Complete consumer-owned backend payload normalized during construction.
2766
- *
2767
- * Calendars are optional; omitted collections normalize to package defaults.
2768
- */
2769
- interface BackendScheduleInput {
2770
- sector: BackendSectorInput;
2771
- activities: BackendActivityInput[];
2772
- links: BackendLinkInput[];
2773
- calendars?: BackendCalendarInput[] | undefined;
2774
- baseCalendars?: BackendCalendarInput[] | undefined;
2775
- }
2776
-
2777
2890
  /** Consumer diagnostics sink for normalization and background failures. */
2778
2891
  interface ScheduleCoreReporter {
2779
2892
  /** Reports a recoverable warning with optional safe context. */
@@ -3689,6 +3802,8 @@ interface StandaloneCalendar {
3689
3802
  * next shift start for `'future'` and the previous shift end for `'past'`;
3690
3803
  * `'day'` gives the start of the next working day for `'future'` and the
3691
3804
  * end of the previous working day (00:00 of the day after it) for `'past'`.
3805
+ * A `'past'` search looks back up to 3660 days and throws when it finds no
3806
+ * working day.
3692
3807
  */
3693
3808
  readonly getClosestWorkTime: (query: WorkTimeQuery) => Date;
3694
3809
  /**
@@ -3905,4 +4020,4 @@ declare const DISPATCH_TRACK_EVENT: {
3905
4020
  /** Consumer analytics event name emitted by a schedule mutation. */
3906
4021
  type DispatchTrackEvent = (typeof DISPATCH_TRACK_EVENT)[keyof typeof DISPATCH_TRACK_EVENT];
3907
4022
 
3908
- export { ACTIVITY_BATCH_ACTION_KIND, ACTIVITY_BATCH_MODE, ACTIVITY_DATE_EDGE, ACTIVITY_FIELD, ACTIVITY_PONDERATOR_CRITERION, ACTIVITY_PROGRESS_ORIGIN, ACTIVITY_TYPE, type ActivityBaselineSnapshot, type ActivityBatchAction, type ActivityBatchInput, type ActivityBatchItem, type ActivityBatchItemInput, type ActivityBatchLinkInput$1 as ActivityBatchLinkInput, type ActivityBatchMode, type ActivityBatchParentReference, type ActivityBatchReference, type ActivityBulkEdit, type ActivityClipboardEntry, type ActivityClipboardReferences, type ActivityClipboardSnapshot, type ActivityCreateInput, type ActivityCreationOverrides, type ActivityCreter, type ActivityDateEdge, type ActivityDateEdit, type ActivityField, type ActivityFieldEdit, type ActivityFieldValue, type ActivityId, type ActivityLookaheadSyncInput, type ActivityMoveInput, type ActivityPasteDestination, type ActivityStatus, type ActivityType, type ApplyLookaheadConversionInput, BASELINE_ROLE, type BackendActivityInput, type BackendCalendarExceptionInput, type BackendCalendarInput, type BackendLinkInput, type BackendScheduleInput, type BackendSectorInput, type BackendShiftInput, type BaselinePoint, type BaselineRole, type BaselineVersion, type BranchOrderChange, CALENDAR_UNIT, CHANGE_SET_SOURCE_KIND, COLUMN, COMPLETED_PROGRESS, CONFIRMATION_KIND, CONSTRAINT_TYPE, CONSTRAINT_TYPE_TO_LABEL, CONSTRAINT_WARNING_KIND, CREATION_KIND, type Calendar, type CalendarId, type CalendarLike, type CalendarReaderInput, type CalendarUnit, type CalendarWorktime, type ChangeSet, type ChangeSetSource, type ColumnName, type ConfirmationAlternative, type ConfirmationKind, type ConfirmationRequest, type ConstraintType, type ConstraintWarning, type CoreActivity, type CoreBaselinePoint, type CreationKind, type CriticalPathResult, P6_PROPERTY_CONTRACT as DATA_DATE_PROPERTY_CONTRACT, DATE_GESTURE_KIND, DEFAULT_HOURS_PER_DAY, DISPATCH_ACTION_KIND, DISPATCH_ACTION_KINDS, DISPATCH_LINK_OPERATION_KIND, DISPATCH_TRACK_EVENT, type P6ActivityCalculationInputs as DataDateActivityCalculationInputs, type P6ActivityColumnKey as DataDateActivityColumnKey, type P6ActivityData as DataDateActivityData, type P6ActivityDraftState as DataDateActivityDraftState, type P6ActivityInputPatch as DataDateActivityInputPatch, type P6ActivityState as DataDateActivityState, type P6ActivityType as DataDateActivityType, P6CapabilityError as DataDateCapabilityError, type P6CapabilityErrorCode as DataDateCapabilityErrorCode, type P6DependencyReference as DataDateDependencyReference, type P6DiagnosticProjectIdentity as DataDateDiagnosticProjectIdentity, type P6DiagnosticRelationship as DataDateDiagnosticRelationship, type P6DiagnosticRelationshipType as DataDateDiagnosticRelationshipType, type P6DurationType as DataDateDurationType, type P6EndingActivityOption as DataDateEndingActivityOption, type P6EndingActivityPage as DataDateEndingActivityPage, type P6EndingActivitySearch as DataDateEndingActivitySearch, type P6MappedScheduleOptions as DataDateMappedScheduleOptions, type P6MissingActivityInput as DataDateMissingActivityInput, type P6OutOfSequencePolicy as DataDateOutOfSequencePolicy, type P6ProjectPlannedStartChange as DataDateProjectPlannedStartChange, type P6ProjectState as DataDateProjectState, type P6PropertyContractRow as DataDatePropertyContractRow, type P6PropertyEdgeCases as DataDatePropertyEdgeCases, type P6RawProjectOptions as DataDateRawProjectOptions, type P6RawScheduleOptions as DataDateRawScheduleOptions, type P6RequiredHistoricalField as DataDateRequiredHistoricalField, type P6ResourceAssignment as DataDateResourceAssignment, type P6ScheduleDiagnostic as DataDateScheduleDiagnostic, type P6ScheduleDiagnosticCode as DataDateScheduleDiagnosticCode, type P6ScheduleInput as DataDateScheduleInput, type P6ScheduleReadiness as DataDateScheduleReadiness, type P6ScheduleResult as DataDateScheduleResult, type P6ScheduleRunLog as DataDateScheduleRunLog, type P6ScheduleSettings as DataDateScheduleSettings, type P6ScheduleWarning as DataDateScheduleWarning, type P6SettingsChange as DataDateSettingsChange, type DateGesture, type DateGestureKind, type DateGesturePreview, type DatesBatchVerdict, type DeletedActivitySnapshot, type DeletedLinkSnapshot, type DispatchAction, type DispatchActionKind, type DispatchConfirmationRequest, type DispatchManyAction, type DispatchManyChangeSetSource, type DispatchManyResult, type DispatchOptions, type DispatchRejectReason, type DispatchResult, type DispatchTrackEvent, EDIT_ALERT_KEY, EDIT_DENIAL_REASON, ENTITY_CHANGE_KIND, type EditAlertKey, type EditDenialReason, type EditResult, type EditableColumnName, type EffectiveGraphAudit, type EntityChange, type ActivityBatchLinkInput as ErgonomicActivityBatchLinkInput, type ExpectedProgressAdapter, FILTER_FIELD, FILTER_LOGIC, FILTER_OPERATOR, FILTER_REJECTION_REASON, FILTER_VALUE_KIND, FLAT_WBS_DEPTH, type FilterCriterion, type FilterCriterionGroup, type FilterCriterionValue, type FilterDateRange, type FilterField, type FilterLogic, type FilterOperator, type FilterRejection, type FilterState, type FilterValueKind, GROUP_ID_PREFIX, GROUP_ID_SEPARATOR, type GroupCriterion, type GroupCriterionInput, type GroupLevelWindow, type GroupState, type GroupStateInput, type ImpactRequestSyncInput, LINK_BATCH_OPERATION_KIND, LINK_CODE, LINK_CODE_TO_TYPE, LINK_REJECTION_REASON, LINK_RELATIONSHIP, LINK_TYPE, LINK_TYPE_CODE, LOOKAHEAD_CONFIRMATION_KIND, type Link, type LinkBatchOperationKind, type LinkBatchRequest, type LinkBatchVerdict, type LinkCreateRequest, type LinkId, type LinkPatchRequest, type LinkRejection, type LinkRelationship, type LinkType, type LinkTypeCode, type LinkUpdateAction, type LinksBatchOperation, type LoadDiagnostic, type LoadDiagnosticCode, type LookaheadActualIntent, LookaheadActualTransitionError, type LookaheadActualTransitionErrorCode, type LookaheadConfirmationRequest, type LookaheadConversionFormerParent, type LookaheadConversionGroup, type LookaheadConversionInput, type LookaheadConversionMilestoneMove, type LookaheadConversionPlan, type LookaheadConversionResult, type LookaheadDerivedCalendars, type LookaheadDerivedFields, type LookaheadDerivedFieldsResolver, type LookaheadDerivedInput, type LookaheadProgressActualActivityState, type LookaheadProgressActualInput, type LookaheadProgressActualPlan, MINIMUM_GROUP_DEPTH, MINIMUM_GROUP_LEVEL, type MutationContext, NEW_ACTIVITY_DEFAULTS, NOT_STARTED_PROGRESS, ORDER_DIRECTION, ORDER_MODE, type OrderDirection, type OrderMode, type OrderRule, type OrderState, PASTE_PLACEMENT, type ParsedInput, type PendingRequest, type PersistableActivityField, type PersistedEntityIdentity, type PersistenceCheckpoint, type PipelineColumnName, type ProjectWorkHours, REJECTION_REASON, ROOT_PARENT_ID, SCHEDULE_CORE_STATUS, SCHEDULE_EFFECT_KIND, SIR_AUTO_REJECT_REASON, STATUS, STATUS_CRITERIA, type ScheduleActivitiesApi, type ScheduleApiNamespaces, type ScheduleAutoScheduleAction, type ScheduleBaselinesApi, type ScheduleCalendarsApi, type ScheduleCellsApi, ScheduleCore, type ScheduleCoreInput, type ScheduleCoreReporter, type ScheduleCoreStatus, type ScheduleCriticalPathApi, type ScheduleP6Api as ScheduleDataDatesApi, type ScheduleDiagnosticsApi, type ScheduleEffect, type ScheduleHistoryApi, type ScheduleImpactRequestsApi, type ScheduleLinksApi, type SchedulePersistenceApi, type ScheduleProjectionApi, type ScheduleSelectionApi, type ScheduleViewApi, type SectorMetadata, type SelectionToggleInput, type StandaloneCalendar, type StandaloneCalendarReader, type StaticActivityDefaults, type StatusCriteria, type TrackingEvent, UNASSIGNED_GROUP_LABEL, UNASSIGNED_VALUE_ID, type UndoOptions, VIEW_ATTRIBUTE_KIND, VISUAL_ROW_KIND, type ViewAttributeAssignmentInput, type ViewAttributeCatalogInput, type ViewAttributeFilterCriterion, type ViewAttributeOrderRule, type ViewAttributeValueInput, type ViewFilterInput, type ViewStateChange, type ViewStatePropChange, type VisualRow, WORK_TIME_DIRECTION, type WbsDepth, type WithProplannerId, type WorkTimeDirection, type WorkTimeQuery, allowedSecondaryConstraintTypes, appendGroupRowId, buildGroupRowId, checkNoUpdatedLinks, computeExpectedProgress, createCalendarReader, createLookaheadDerivedFields, createOutbuildP6ScheduleSettings as createOutbuildDataDateScheduleSettings, createSchedule, expectedProgressFromBaseline, formatUtcAsP6WallDate, getActiveBaseline, getUnsavedActivities, isRootParent, isViewAttributeCriterion, isViewAttributeOrderRule, mapP6ScheduleOptions as mapDataDateScheduleOptions, normalizeParentKey, parseFromBackend, parseP6DayAsCalendarStart, parseP6WallDateAsUtc, planLookaheadProgressActuals, prepareLookaheadProgressActuals, resolveExpectedFinishDateSelection, resolveLookaheadActualDateSelection, willRunCriticalPath, yieldToBrowser };
4023
+ export { ACTIVITY_BATCH_ACTION_KIND, ACTIVITY_BATCH_MODE, ACTIVITY_DATE_EDGE, ACTIVITY_FIELD, ACTIVITY_PONDERATOR_CRITERION, ACTIVITY_PROGRESS_ORIGIN, ACTIVITY_TYPE, type ActivityBaselineSnapshot, type ActivityBatchAction, type ActivityBatchInput, type ActivityBatchItem, type ActivityBatchItemInput, type ActivityBatchLinkInput$1 as ActivityBatchLinkInput, type ActivityBatchMode, type ActivityBatchParentReference, type ActivityBatchReference, type ActivityBulkEdit, type ActivityClipboardEntry, type ActivityClipboardReferences, type ActivityClipboardSnapshot, type ActivityCreateInput, type ActivityCreationOverrides, type ActivityCreter, type ActivityDateEdge, type ActivityDateEdit, type ActivityField, type ActivityFieldEdit, type ActivityFieldValue, type ActivityId, type ActivityLookaheadSyncInput, type ActivityMoveInput, type ActivityPasteDestination, type ActivityStatus, type ActivityType, type ApplyLookaheadConversionInput, BASELINE_ROLE, type BackendActivityInput, type BackendCalendarExceptionInput, type BackendCalendarInput, type BackendLinkInput, type BackendScheduleInput, type BackendSectorInput, type BackendShiftInput, type BaselinePoint, type BaselineRole, type BaselineVersion, type BranchOrderChange, CALENDAR_UNIT, CHANGE_SET_SOURCE_KIND, COLUMN, COMPLETED_PROGRESS, CONFIRMATION_KIND, CONSTRAINT_TYPE, CONSTRAINT_TYPE_TO_LABEL, CONSTRAINT_WARNING_KIND, CREATION_KIND, type Calendar, type CalendarId, type CalendarLike, type CalendarReaderInput, type CalendarUnit, type CalendarWorktime, type ChangeSet, type ChangeSetSource, type ColumnName, type ConfirmationAlternative, type ConfirmationKind, type ConfirmationRequest, type ConstraintType, type ConstraintWarning, type CoreActivity, type CoreBaselinePoint, type CreationKind, type CriticalPathResult, P6_PROPERTY_CONTRACT as DATA_DATE_PROPERTY_CONTRACT, DATE_GESTURE_KIND, DEFAULT_HOURS_PER_DAY, DISPATCH_ACTION_KIND, DISPATCH_ACTION_KINDS, DISPATCH_LINK_OPERATION_KIND, DISPATCH_TRACK_EVENT, type P6ActivityCalculationInputs as DataDateActivityCalculationInputs, type P6ActivityColumnKey as DataDateActivityColumnKey, type P6ActivityData as DataDateActivityData, type P6ActivityDraftState as DataDateActivityDraftState, type P6ActivityInputPatch as DataDateActivityInputPatch, type P6ActivityState as DataDateActivityState, type P6ActivityType as DataDateActivityType, P6CapabilityError as DataDateCapabilityError, type P6CapabilityErrorCode as DataDateCapabilityErrorCode, type P6DependencyReference as DataDateDependencyReference, type P6DiagnosticProjectIdentity as DataDateDiagnosticProjectIdentity, type P6DiagnosticRelationship as DataDateDiagnosticRelationship, type P6DiagnosticRelationshipType as DataDateDiagnosticRelationshipType, type P6DurationType as DataDateDurationType, type P6EndingActivityOption as DataDateEndingActivityOption, type P6EndingActivityPage as DataDateEndingActivityPage, type P6EndingActivitySearch as DataDateEndingActivitySearch, type P6MappedScheduleOptions as DataDateMappedScheduleOptions, type P6MissingActivityInput as DataDateMissingActivityInput, type P6OutOfSequencePolicy as DataDateOutOfSequencePolicy, type P6ProjectPlannedStartChange as DataDateProjectPlannedStartChange, type P6ProjectState as DataDateProjectState, type P6PropertyContractRow as DataDatePropertyContractRow, type P6PropertyEdgeCases as DataDatePropertyEdgeCases, type P6RawProjectOptions as DataDateRawProjectOptions, type P6RawScheduleOptions as DataDateRawScheduleOptions, type P6RequiredHistoricalField as DataDateRequiredHistoricalField, type P6ResourceAssignment as DataDateResourceAssignment, type P6ScheduleDiagnostic as DataDateScheduleDiagnostic, type P6ScheduleDiagnosticCode as DataDateScheduleDiagnosticCode, type P6ScheduleInput as DataDateScheduleInput, type P6ScheduleReadiness as DataDateScheduleReadiness, type P6ScheduleResult as DataDateScheduleResult, type P6ScheduleRunLog as DataDateScheduleRunLog, type P6ScheduleSettings as DataDateScheduleSettings, type P6ScheduleWarning as DataDateScheduleWarning, type P6SettingsChange as DataDateSettingsChange, type DateGesture, type DateGestureKind, type DateGesturePreview, type DatesBatchVerdict, type DeletedActivitySnapshot, type DeletedLinkSnapshot, type DispatchAction, type DispatchActionKind, type DispatchConfirmationRequest, type DispatchManyAction, type DispatchManyChangeSetSource, type DispatchManyResult, type DispatchOptions, type DispatchRejectReason, type DispatchResult, type DispatchTrackEvent, EDIT_ALERT_KEY, EDIT_DENIAL_REASON, ENTITY_CHANGE_KIND, type EditAlertKey, type EditDenialReason, type EditResult, type EditableColumnName, type EffectiveGraphAudit, type EntityChange, type ActivityBatchLinkInput as ErgonomicActivityBatchLinkInput, type ExpectedProgressAdapter, FILTER_FIELD, FILTER_LOGIC, FILTER_OPERATOR, FILTER_REJECTION_REASON, FILTER_VALUE_KIND, FLAT_WBS_DEPTH, type FilterCriterion, type FilterCriterionGroup, type FilterCriterionValue, type FilterDateRange, type FilterField, type FilterLogic, type FilterOperator, type FilterRejection, type FilterState, type FilterValueKind, GROUP_ID_PREFIX, GROUP_ID_SEPARATOR, type GroupCriterion, type GroupCriterionInput, type GroupLevelWindow, type GroupState, type GroupStateInput, type ImpactRequestSyncInput, LINK_BATCH_OPERATION_KIND, LINK_CODE, LINK_CODE_TO_TYPE, LINK_REJECTION_REASON, LINK_RELATIONSHIP, LINK_TYPE, LINK_TYPE_CODE, LOOKAHEAD_CONFIRMATION_KIND, type Link, type LinkBatchOperationKind, type LinkBatchRequest, type LinkBatchVerdict, type LinkCreateRequest, type LinkId, type LinkPatchRequest, type LinkRejection, type LinkRelationship, type LinkType, type LinkTypeCode, type LinkUpdateAction, type LinksBatchOperation, type LoadDiagnostic, type LoadDiagnosticCode, type LookaheadActualIntent, LookaheadActualTransitionError, type LookaheadActualTransitionErrorCode, type LookaheadConfirmationRequest, type LookaheadConversionFormerParent, type LookaheadConversionGroup, type LookaheadConversionInput, type LookaheadConversionMilestoneMove, type LookaheadConversionPlan, type LookaheadConversionResult, type LookaheadDerivedCalendars, type LookaheadDerivedFields, type LookaheadDerivedFieldsResolver, type LookaheadDerivedInput, type LookaheadProgressActualActivityState, type LookaheadProgressActualInput, type LookaheadProgressActualPlan, MINIMUM_GROUP_DEPTH, MINIMUM_GROUP_LEVEL, type MutationContext, NEW_ACTIVITY_DEFAULTS, NOT_STARTED_PROGRESS, ORDER_DIRECTION, ORDER_MODE, type OrderDirection, type OrderMode, type OrderRule, type OrderState, PASTE_PLACEMENT, PERSISTENCE_REBASE_CONFLICT_KIND, PERSISTENCE_REBASE_ENTITY, type ParsedInput, type PendingRequest, type PersistableActivityField, type PersistedEntityIdentity, type PersistenceCheckpoint, type PersistenceRebaseConflict, type PersistenceRebaseConflictKind, type PersistenceRebaseEntity, type PersistenceRebaseInput, type PersistenceRebaseRekey, type PersistenceRebaseRemoteChange, type PersistenceRebaseReport, type PipelineColumnName, type ProjectWorkHours, REJECTION_REASON, ROOT_PARENT_ID, SCHEDULE_CORE_STATUS, SCHEDULE_EFFECT_KIND, SIR_AUTO_REJECT_REASON, STATUS, STATUS_CRITERIA, type ScheduleActivitiesApi, type ScheduleApiNamespaces, type ScheduleAutoScheduleAction, type ScheduleBaselinesApi, type ScheduleCalendarsApi, type ScheduleCellsApi, ScheduleCore, type ScheduleCoreInput, type ScheduleCoreReporter, type ScheduleCoreStatus, type ScheduleCriticalPathApi, type ScheduleP6Api as ScheduleDataDatesApi, type ScheduleDiagnosticsApi, type ScheduleEffect, type ScheduleHistoryApi, type ScheduleImpactRequestsApi, type ScheduleLinksApi, type SchedulePersistenceApi, type ScheduleProjectionApi, type ScheduleSelectionApi, type ScheduleViewApi, type SectorMetadata, type SelectionToggleInput, type StandaloneCalendar, type StandaloneCalendarReader, type StaticActivityDefaults, type StatusCriteria, type TrackingEvent, UNASSIGNED_GROUP_LABEL, UNASSIGNED_VALUE_ID, type UndoOptions, VIEW_ATTRIBUTE_KIND, VISUAL_ROW_KIND, type ViewAttributeAssignmentInput, type ViewAttributeCatalogInput, type ViewAttributeFilterCriterion, type ViewAttributeOrderRule, type ViewAttributeValueInput, type ViewFilterInput, type ViewStateChange, type ViewStatePropChange, type VisualRow, WORK_TIME_DIRECTION, type WbsDepth, type WithProplannerId, type WorkTimeDirection, type WorkTimeQuery, allowedSecondaryConstraintTypes, appendGroupRowId, buildGroupRowId, checkNoUpdatedLinks, computeExpectedProgress, createCalendarReader, createLookaheadDerivedFields, createOutbuildP6ScheduleSettings as createOutbuildDataDateScheduleSettings, createSchedule, expectedProgressFromBaseline, formatUtcAsP6WallDate, getActiveBaseline, getUnsavedActivities, isRootParent, isViewAttributeCriterion, isViewAttributeOrderRule, mapP6ScheduleOptions as mapDataDateScheduleOptions, normalizeParentKey, parseFromBackend, parseP6DayAsCalendarStart, parseP6WallDateAsUtc, planLookaheadProgressActuals, prepareLookaheadProgressActuals, resolveExpectedFinishDateSelection, resolveLookaheadActualDateSelection, willRunCriticalPath, yieldToBrowser };