@selfhelp/shared 1.28.0 → 1.29.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/CHANGELOG.md CHANGED
@@ -10,6 +10,22 @@ All notable changes to `@selfhelp/shared` will be documented in this file.
10
10
  This project follows semantic versioning.
11
11
 
12
12
 
13
+ ## v1.29.0
14
+
15
+ Minor: live-sync follow-ups (task `2026-11-23-live-sync-follow-ups`; pairs with
16
+ backend 0.1.50, frontend 0.1.77, mobile 0.1.39). Additive, no breaking change.
17
+
18
+ - **Added** `LOCK_IDLE_ENDED_ERROR` (`lock_idle_ended`): `409` when a holder's own
19
+ lock ended by idle expiry and they try to renew; data is `IPageLockStatus`;
20
+ resume through take-over.
21
+ - **Added** `IPagePayload` and `pageFromPayload()` (payload `sync` wins, then
22
+ `page.sync`; no page → `null`; no sync → page unchanged). Prefer these over
23
+ client-local copies.
24
+ - **Changed** `IGetPageResponse` / `IResolvePageResponse` data to
25
+ `{ page; sync?: ISyncBlock | null }`.
26
+ - **Added** schema-parity row for `responses/auth/events.json` ↔
27
+ `IAuthEventsBootstrap`.
28
+
13
29
  ## v1.28.0
14
30
 
15
31
  Minor: live-sync contract (task `2026-11-20-live-sync-and-edit-lock`; pairs with the
package/dist/index.d.mts CHANGED
@@ -79,6 +79,12 @@ interface IAuthEventsBootstrap {
79
79
  declare const PAGE_VERSION_REQUIRED_ERROR: "page_version_required";
80
80
  declare const STALE_PAGE_VERSION_ERROR: "stale_page_version";
81
81
  declare const PAGE_LOCKED_ERROR: "page_locked";
82
+ /**
83
+ * `409` when the caller's own page edit lock ended by idle expiry and they try
84
+ * to renew (`POST .../lock`). Data is {@link IPageLockStatus}. Resume through
85
+ * take-over (`POST .../lock/take-over`), not a plain acquire.
86
+ */
87
+ declare const LOCK_IDLE_ENDED_ERROR: "lock_idle_ended";
82
88
  /**
83
89
  * Draft version of a page (C8). `GET /admin/pages/{page_id}` returns it in its
84
90
  * data (and in the `X-Page-Version` header); admin page types extend this so
@@ -506,6 +512,8 @@ type ILanguagesResponse = IBaseApiResponse<ILanguageItem[]>;
506
512
 
507
513
  type IGetPageResponse = IBaseApiResponse<{
508
514
  page: IPageContent;
515
+ /** Live-sync block next to the page (contract C6); optional on older servers. */
516
+ sync?: ISyncBlock | null;
509
517
  }>;
510
518
  type IGetPagesResponse = IBaseApiResponse<IPageItem[]>;
511
519
  /**
@@ -515,6 +523,8 @@ type IGetPagesResponse = IBaseApiResponse<IPageItem[]>;
515
523
  */
516
524
  type IResolvePageResponse = IBaseApiResponse<{
517
525
  page: IPageContent;
526
+ /** Live-sync block next to the page (contract C6); optional on older servers. */
527
+ sync?: ISyncBlock | null;
518
528
  }>;
519
529
 
520
530
  /**
@@ -3160,6 +3170,27 @@ declare function pageDependsOn(sync: ISyncBlock | null | undefined, tags: readon
3160
3170
  */
3161
3171
  declare function syncRefetchDelayMs(kind: TSyncRefetchKind, random?: () => number): number;
3162
3172
 
3173
+ /**
3174
+ * Unwrap a page API response so the live-sync block travels with the page.
3175
+ *
3176
+ * The backend answers `{ data: { page, sync } }`: the sync block (contract C6)
3177
+ * sits next to the page, not inside it. Clients that cache the page read
3178
+ * `page.sync` for tag matching and `valid_until`, so every unwrap goes through
3179
+ * {@link pageFromPayload}.
3180
+ */
3181
+
3182
+ /** The `data` of a page response (`/pages/by-keyword`, `/pages/resolve`). */
3183
+ interface IPagePayload {
3184
+ page?: IPageContent | null;
3185
+ sync?: ISyncBlock | null;
3186
+ }
3187
+ /**
3188
+ * The page of a response's `data`, carrying the response's `sync` block.
3189
+ * Prefers `payload.sync`, falls back to `page.sync`. Returns `null` when there
3190
+ * is no page. With no sync at all, returns the page unchanged.
3191
+ */
3192
+ declare function pageFromPayload(payload: IPagePayload | null | undefined): IPageContent | null;
3193
+
3163
3194
  /**
3164
3195
  * Parse the unified `spacing` field. The CMS
3165
3196
  * stores this as a JSON string with optional keys for each side:
@@ -3221,4 +3252,4 @@ declare function transformPageData(apiPage: IRawPage): IPageItem;
3221
3252
  */
3222
3253
  declare function transformPagesData(pages: IRawPage[] | null | undefined): IPageItem[];
3223
3254
 
3224
- export { API_VERSION_PREFIX, type AdvisoryAffected, type AdvisoryFeed, type AdvisorySeverity, type BackupManifest, type BackupRetentionPolicy, type BackupSchedulePolicy, type BundledPluginRef, CLASS_PATTERNS, CLASS_REMAP, CLIENT_TYPE_MOBILE, CLIENT_TYPE_MOBILE_AND_WEB, CLIENT_TYPE_WEB, CMS_APP_PRIMARY_ROLES, CMS_APP_ROLES, COLOR_NAMES, type CheckSeverity, type CompatibilityRules, type CoreRelease, DEFAULT_MOBILE_ICON, DEFAULT_RATE_LIMIT_MESSAGE, DEFAULT_WEB_FOOTER_PRESET, DEFAULT_WEB_HEADER_PRESET, type DatabaseMigrationMetadata, ENDPOINTS, FIELDS_MAP_STYLE_CONFIG, FORM_LIST_MAX_PAGE, FORM_LIST_MAX_ROUTE_PARAMS, FORM_LIST_MAX_ROUTE_VALUE_LENGTH, FORM_LIST_MAX_SORTS, FORM_LIST_MAX_VALUE_BYTES, FORM_LIST_MODES, FORM_LIST_SEARCH_MAX_LENGTH, FORM_LIST_SEARCH_MIN_LENGTH, FORM_RECORD_PREFILL_SKIP_FIELDS, type FrontendRelease, HEADER_ACL_STAMP, HEADER_CLIENT_TYPE, HEADER_PAGE_VERSION, HEADER_PAGE_VIEW, IAboutItem, type IAssetSource, type IAuthEventsBootstrap, IBaseApiResponse, type IBasePageInfo, type IBasePageSection, type IBranchNavContext, type IBranchNavSegment, type IBreadcrumbEntry, type IClassPattern, type IClassRemap, type ICmsApp, type ICmsAppAssignedPage, type ICmsAppDetail, type ICmsAppPage, type ICmsAppSummary, type ICompatibilityError, type IConditionContext, IContentField, type IEvaluatedCondition, type IFieldsMapStyleConfig, type IForgotPasswordRequest, type IForgotPasswordResponse, IFormInvalidData, type IFormListCacheScope, type IFormListFailure, IFormListFilesCell, IFormListRestoreBlockedData, IFormListSort, type IFormListUrlError, type IFormListUrlRules, type IFormListUrlState, type IFormRecordPrefill, type IFormRecordPrefillChild, type IFormRecordPrefillSection, type IFormRecordPrefillTranslatedValue, IFormStaleVersionData, type IFrontendUpdatePreflight, type IFrontendUpdatePreflightResponse, type IFrontendUpdateReleases, type IFrontendUpdateReleasesResponse, type IFrontendUpdateRequest, type IFrontendUpdateRequestResponse, type IGetPageResponse, type IGetPagesResponse, type IHeaderLayerSplit, type IInlineNode, type IJwtPayload, type ILanguage, type ILanguageItem, type ILanguagePreference, type ILanguagePreferenceUpdateResponse, type ILanguagesResponse, type ILoginRequest, type ILoginSuccessData, type ILoginSuccessResponse, type ILogoutSuccessResponse, type IMaintenanceSetRequest, type IMenuSearchHit, type IMobileAdapterBaseProps, type IMobileButtonProps, type IMobileCardProps, type IMobileCheckboxProps, type IMobileContainerProps, type IMobileIconEntry, type IMobileInputProps, type IMobileModalProps, type IMobilePreviewExchangeData, type IMobilePreviewExchangeRequest, type IMobilePreviewExchangeResponse, type IMobilePreviewSessionData, type IMobilePreviewSessionRequest, type IMobilePreviewSessionResponse, type IMobilePreviewUpdatePreflight, type IMobilePreviewUpdatePreflightResponse, type IMobilePreviewUpdateReleases, type IMobilePreviewUpdateReleasesResponse, type IMobilePreviewUpdateRequest, type IMobilePreviewUpdateRequestResponse, type IMobileSelectOption, type IMobileSelectProps, type IMobileSwitchProps, type IMobileTextProps, type IMobileTextareaProps, type IMobileUiAdapters, type INavigationBranding, type INavigationBundle, type INavigationBundleImportHints, type INavigationBundleItem, type INavigationBundleItemTranslation, type INavigationBundleMenu, type INavigationMenu, type INavigationMenuItem, type INavigationPayload, type INavigationResolvedPageRef, type INavigationSearchConfig, type INavigationStartupConfig, type IOptionCatalogEntry, type IOptionLabelMap, type IOptionStyleConfig, type IPageAccessTypeInfo, type IPageContent, type IPageDraftVersioned, type IPageField, type IPageFieldTranslation, type IPageFieldsData, type IPageItem, type IPageLockHolder, type IPageLockStatus, type IPageRoute, type IPageSectionWithFields, type IPageSectionsData, type IPagesResolveParams, type IPreviewNavigateCommand, type IPreviewNavigatedMessage, type IPreviewPreferences, type IPreviewPreferencesChangedMessage, type IPreviewReadyMessage, type IPreviewSetPreferencesCommand, type IRefreshRequest, type IRefreshSuccessResponse, type IResetPasswordRequest, type IResetPasswordResponse, type IResolvePageResponse, type IResolvedOption, type ISpacingValue, type IStalePageVersionData, type ISyncBlock, type ISyncChangeMessage, type ISystemAdvisories, type ISystemAdvisoriesResponse, type ISystemAdvisory, type ISystemAdvisoryAffected, type ISystemHealth, type ISystemHealthComponent, type ISystemHealthResponse, type ISystemInstalledPlugin, type ISystemMaintenance, type ISystemMaintenanceResponse, type ISystemVersion, type ISystemVersionResponse, type ITwoFactorRequiredData, type ITwoFactorRequiredResponse, type ITwoFactorVerifyRequest, type ITwoFactorVerifySuccessResponse, type IUpdatePreflight, type IUpdatePreflightCheck, type IUpdatePreflightOption, type IUpdatePreflightResponse, type IUpdateRelease, type IUpdateReleases, type IUpdateReleasesResponse, type IUpdateRequest, type IUpdateRequestResponse, type IUpdateStatus, type IUpdateStatusManager, type IUpdateStatusResponse, type IUpdateStep, type IUserData, type IUserDataResponse, type IWebFooterPresetOption, type IWebHeaderPresetOption, type ImageRef, type InstalledPlugin, type InstanceImages, type InstanceLock, type InstanceManifest, type InstanceMode, type InstanceResourceConfig, type InstanceRouting, type InstanceStatus, type InstanceVersions, type InventoryInstanceEntry, LITERAL_CLASSES, type LockPluginEntry, type LockServiceEntry, MOBILE_ICON_NAMES, MOBILE_ICON_SET, MOBILE_PREVIEW_ENDPOINTS, type MobilePreviewRelease, NAVIGATION_BRANDING_LOGO_HEIGHTS, NAVIGATION_BUNDLE_FORMAT, NAVIGATION_BUNDLE_VERSION, NAVIGATION_HEADER_LAYER_TOP, OPTION_STYLE_CONFIGS, PAGE_LOCKED_ERROR, PAGE_VERSION_REQUIRED_ERROR, PERMISSIONS, PREVIEW_BRIDGE_MESSAGE, PREVIEW_PARENT_ORIGIN_PARAM, PREVIEW_SHELL_PARAM, type PluginRelease, type PreflightCheck, type PreflightOption, type PreflightStatus, RELEASE_CHANNELS, type RegistryIndex, type RegistryReleaseRef, type ReleaseChannel, type RuntimeServicePolicy, type RuntimeServiceRange, SIZE_VALUES, SPACING_VALUES, STALE_PAGE_VERSION_ERROR, SYNC_CHANGED_MAX_DELAY_MS, SYNC_EVENT_NAME, SYNC_MESSAGE_VERSION, SYNC_TAG_PATTERN, SYNC_VALID_UNTIL_MAX_DELAY_MS, SYSTEM_ENDPOINTS, type SchedulerRelease, type SecurityAdvisory, type ServerInventory, type ServiceBackendCompatibility, type SignatureBlock, type SupportBundleMeta, type TCalcedValues, type TClassDecision, type TClientType, type TCmsAppRole, TFormListMode, type TFormListUrlChange, type TFormListUrlErrorReason, type TFormListUrlParse, type TFormRecordPrefillFieldValue, type TFormRecordPrefillFileValue, THeroUiButtonVariant, THeroUiSize, TMobileButtonFeedback, TMobileFieldVariant, type TMobilePagePresentation, TMobileSelectPresentation, type TNavigationBrandingSize, type TNavigationBrandingVariant, type TNavigationBundleExportMode, type TNavigationChildrenNavMode, type TNavigationHeaderLayer, type TNavigationMenuItemType, type TNavigationMenuKey, type TNavigationMobileStartSource, type TNavigationSearchMode, type TNavigationStartMode, type TOptionStyleName, type TPermission, type TPlatform, type TPreviewBridgeMessage, type TPreviewBridgeMessageType, type TPreviewColorScheme, type TPreviewFrameSource, TStyleName, type TSyncRefetchKind, type TSyncTag, type TSystemAdvisorySeverity, type TSystemComponentStatus, type TSystemDeployment, type TSystemHealthOverall, type TUpdateCheckSeverity, type TUpdateKind, type TUpdateOperationStatus, type TUpdatePreflightStatus, type TWebFooterPreset, type TWebHeaderPreset, type TrustLevel, type TrustedKey, type TrustedKeysFile, type UpdatePreflightResult, WEB_FOOTER_PRESET_OPTIONS, WEB_FOOTER_PRESET_VALUES, WEB_HEADER_PRESET_OPTIONS, WEB_HEADER_PRESET_VALUES, type WorkerRelease, applyFormListUrlChange, arePreviewPreferencesEqual, asFilesCell, asRecordVersion, buildConditionContext, buildPagesResolvePath, buildPagesResolveQuery, buildPagesResolveUrl, buildPublicPathFromRoute, clampMenuItemsAtDepth, classifyClass, classifyClassString, collectPageIdsFromMenuItems, emptyFormListUrlState, encodeFormListQuery, evaluateCondition, expandedIdsForActiveTrail, findMenuItemByPageId, findNearestBottomTabMenuItemForPage, findPageRefInNavigationPayload, findRemap, flattenFooterItems, flattenFormRecordPrefillValues, flattenMenuItems, flattenNavigationMenuItems, footerColumnItems, footerGroupLinks, footerStandaloneItems, formListCacheKey, formListQueryString, formListRouteQuery, formatRateLimitMessage, getFormInvalidData, getFormListFailure, getFormListRestoreBlocked, getFormStaleVersion, getNavigationItemAriaLabel, getNavigationItemHref, getNavigationItemKeyword, getNavigationItemLabel, getNavigationItemMobileHref, getRateLimitRetryAfter, hasInlineFormatting, isBottomTabMenuItemActive, isDoubleWebHeaderPreset, isFormListParam, isMenuItemActiveOnMobile, isMenuItemActiveOnWeb, isMobileIconName, isNavigationBundleVersionSupported, isOnAnyMobileMenu, isOnAnyMobileMenuFromPayload, isPageInMenuTree, isPageInResolvedMenus, isPageOnAnyMenu, isPageOnMobileMenu, isPageOnWebMenu, isPreviewBridgeMessage, isWebFooterPreset, isWebHeaderPreset, matchesMobilePath, matchesWebPath, mergeHeaderLayers, nextSortOnHeaderClick, normalizePagesResolvePath, pageDependsOn, pageUrlToMobileRoute, parseFieldsMapCatalog, parseFieldsMapLabels, parseFormListQuery, parseFormRecordPrefill, parseInlineRich, parseOptionCatalog, parseOptionCodes, parseOptionLabels, parseSpacing, parseSyncMessage, parseSyncMessageJson, pickFormListQuery, previewKeywordFromPath, replaceCalcedValues, resolveAssetSources, resolveAssetUrl, resolveBranchNavGroup, resolveBrandingPresentation, resolveFieldsMapLabel, resolveHolderRedirectPath, resolveMenuMaxDepth, resolveMobileIcon, resolveMobilePagePresentation, resolveMobileSegmentGroup, resolveMobileStartupKeyword, resolveMobileStartupRoute, resolveOptionCodesLabels, resolveOptionLabel, resolveOptionValueLabels, resolveOptions, resolveWebBranchNavContext, resolveWebBranchNavGroup, resolveWebFooterPreset, resolveWebHeaderPreset, resolveWebStartupPath, searchMenuPagesInPayload, serializeFieldsMapCatalog, serializeFieldsMapLabels, spacingToClasses, splitHeaderLayers, stripHtmlToText, syncRefetchDelayMs, transformPageData, transformPagesData };
3255
+ export { API_VERSION_PREFIX, type AdvisoryAffected, type AdvisoryFeed, type AdvisorySeverity, type BackupManifest, type BackupRetentionPolicy, type BackupSchedulePolicy, type BundledPluginRef, CLASS_PATTERNS, CLASS_REMAP, CLIENT_TYPE_MOBILE, CLIENT_TYPE_MOBILE_AND_WEB, CLIENT_TYPE_WEB, CMS_APP_PRIMARY_ROLES, CMS_APP_ROLES, COLOR_NAMES, type CheckSeverity, type CompatibilityRules, type CoreRelease, DEFAULT_MOBILE_ICON, DEFAULT_RATE_LIMIT_MESSAGE, DEFAULT_WEB_FOOTER_PRESET, DEFAULT_WEB_HEADER_PRESET, type DatabaseMigrationMetadata, ENDPOINTS, FIELDS_MAP_STYLE_CONFIG, FORM_LIST_MAX_PAGE, FORM_LIST_MAX_ROUTE_PARAMS, FORM_LIST_MAX_ROUTE_VALUE_LENGTH, FORM_LIST_MAX_SORTS, FORM_LIST_MAX_VALUE_BYTES, FORM_LIST_MODES, FORM_LIST_SEARCH_MAX_LENGTH, FORM_LIST_SEARCH_MIN_LENGTH, FORM_RECORD_PREFILL_SKIP_FIELDS, type FrontendRelease, HEADER_ACL_STAMP, HEADER_CLIENT_TYPE, HEADER_PAGE_VERSION, HEADER_PAGE_VIEW, IAboutItem, type IAssetSource, type IAuthEventsBootstrap, IBaseApiResponse, type IBasePageInfo, type IBasePageSection, type IBranchNavContext, type IBranchNavSegment, type IBreadcrumbEntry, type IClassPattern, type IClassRemap, type ICmsApp, type ICmsAppAssignedPage, type ICmsAppDetail, type ICmsAppPage, type ICmsAppSummary, type ICompatibilityError, type IConditionContext, IContentField, type IEvaluatedCondition, type IFieldsMapStyleConfig, type IForgotPasswordRequest, type IForgotPasswordResponse, IFormInvalidData, type IFormListCacheScope, type IFormListFailure, IFormListFilesCell, IFormListRestoreBlockedData, IFormListSort, type IFormListUrlError, type IFormListUrlRules, type IFormListUrlState, type IFormRecordPrefill, type IFormRecordPrefillChild, type IFormRecordPrefillSection, type IFormRecordPrefillTranslatedValue, IFormStaleVersionData, type IFrontendUpdatePreflight, type IFrontendUpdatePreflightResponse, type IFrontendUpdateReleases, type IFrontendUpdateReleasesResponse, type IFrontendUpdateRequest, type IFrontendUpdateRequestResponse, type IGetPageResponse, type IGetPagesResponse, type IHeaderLayerSplit, type IInlineNode, type IJwtPayload, type ILanguage, type ILanguageItem, type ILanguagePreference, type ILanguagePreferenceUpdateResponse, type ILanguagesResponse, type ILoginRequest, type ILoginSuccessData, type ILoginSuccessResponse, type ILogoutSuccessResponse, type IMaintenanceSetRequest, type IMenuSearchHit, type IMobileAdapterBaseProps, type IMobileButtonProps, type IMobileCardProps, type IMobileCheckboxProps, type IMobileContainerProps, type IMobileIconEntry, type IMobileInputProps, type IMobileModalProps, type IMobilePreviewExchangeData, type IMobilePreviewExchangeRequest, type IMobilePreviewExchangeResponse, type IMobilePreviewSessionData, type IMobilePreviewSessionRequest, type IMobilePreviewSessionResponse, type IMobilePreviewUpdatePreflight, type IMobilePreviewUpdatePreflightResponse, type IMobilePreviewUpdateReleases, type IMobilePreviewUpdateReleasesResponse, type IMobilePreviewUpdateRequest, type IMobilePreviewUpdateRequestResponse, type IMobileSelectOption, type IMobileSelectProps, type IMobileSwitchProps, type IMobileTextProps, type IMobileTextareaProps, type IMobileUiAdapters, type INavigationBranding, type INavigationBundle, type INavigationBundleImportHints, type INavigationBundleItem, type INavigationBundleItemTranslation, type INavigationBundleMenu, type INavigationMenu, type INavigationMenuItem, type INavigationPayload, type INavigationResolvedPageRef, type INavigationSearchConfig, type INavigationStartupConfig, type IOptionCatalogEntry, type IOptionLabelMap, type IOptionStyleConfig, type IPageAccessTypeInfo, type IPageContent, type IPageDraftVersioned, type IPageField, type IPageFieldTranslation, type IPageFieldsData, type IPageItem, type IPageLockHolder, type IPageLockStatus, type IPagePayload, type IPageRoute, type IPageSectionWithFields, type IPageSectionsData, type IPagesResolveParams, type IPreviewNavigateCommand, type IPreviewNavigatedMessage, type IPreviewPreferences, type IPreviewPreferencesChangedMessage, type IPreviewReadyMessage, type IPreviewSetPreferencesCommand, type IRefreshRequest, type IRefreshSuccessResponse, type IResetPasswordRequest, type IResetPasswordResponse, type IResolvePageResponse, type IResolvedOption, type ISpacingValue, type IStalePageVersionData, type ISyncBlock, type ISyncChangeMessage, type ISystemAdvisories, type ISystemAdvisoriesResponse, type ISystemAdvisory, type ISystemAdvisoryAffected, type ISystemHealth, type ISystemHealthComponent, type ISystemHealthResponse, type ISystemInstalledPlugin, type ISystemMaintenance, type ISystemMaintenanceResponse, type ISystemVersion, type ISystemVersionResponse, type ITwoFactorRequiredData, type ITwoFactorRequiredResponse, type ITwoFactorVerifyRequest, type ITwoFactorVerifySuccessResponse, type IUpdatePreflight, type IUpdatePreflightCheck, type IUpdatePreflightOption, type IUpdatePreflightResponse, type IUpdateRelease, type IUpdateReleases, type IUpdateReleasesResponse, type IUpdateRequest, type IUpdateRequestResponse, type IUpdateStatus, type IUpdateStatusManager, type IUpdateStatusResponse, type IUpdateStep, type IUserData, type IUserDataResponse, type IWebFooterPresetOption, type IWebHeaderPresetOption, type ImageRef, type InstalledPlugin, type InstanceImages, type InstanceLock, type InstanceManifest, type InstanceMode, type InstanceResourceConfig, type InstanceRouting, type InstanceStatus, type InstanceVersions, type InventoryInstanceEntry, LITERAL_CLASSES, LOCK_IDLE_ENDED_ERROR, type LockPluginEntry, type LockServiceEntry, MOBILE_ICON_NAMES, MOBILE_ICON_SET, MOBILE_PREVIEW_ENDPOINTS, type MobilePreviewRelease, NAVIGATION_BRANDING_LOGO_HEIGHTS, NAVIGATION_BUNDLE_FORMAT, NAVIGATION_BUNDLE_VERSION, NAVIGATION_HEADER_LAYER_TOP, OPTION_STYLE_CONFIGS, PAGE_LOCKED_ERROR, PAGE_VERSION_REQUIRED_ERROR, PERMISSIONS, PREVIEW_BRIDGE_MESSAGE, PREVIEW_PARENT_ORIGIN_PARAM, PREVIEW_SHELL_PARAM, type PluginRelease, type PreflightCheck, type PreflightOption, type PreflightStatus, RELEASE_CHANNELS, type RegistryIndex, type RegistryReleaseRef, type ReleaseChannel, type RuntimeServicePolicy, type RuntimeServiceRange, SIZE_VALUES, SPACING_VALUES, STALE_PAGE_VERSION_ERROR, SYNC_CHANGED_MAX_DELAY_MS, SYNC_EVENT_NAME, SYNC_MESSAGE_VERSION, SYNC_TAG_PATTERN, SYNC_VALID_UNTIL_MAX_DELAY_MS, SYSTEM_ENDPOINTS, type SchedulerRelease, type SecurityAdvisory, type ServerInventory, type ServiceBackendCompatibility, type SignatureBlock, type SupportBundleMeta, type TCalcedValues, type TClassDecision, type TClientType, type TCmsAppRole, TFormListMode, type TFormListUrlChange, type TFormListUrlErrorReason, type TFormListUrlParse, type TFormRecordPrefillFieldValue, type TFormRecordPrefillFileValue, THeroUiButtonVariant, THeroUiSize, TMobileButtonFeedback, TMobileFieldVariant, type TMobilePagePresentation, TMobileSelectPresentation, type TNavigationBrandingSize, type TNavigationBrandingVariant, type TNavigationBundleExportMode, type TNavigationChildrenNavMode, type TNavigationHeaderLayer, type TNavigationMenuItemType, type TNavigationMenuKey, type TNavigationMobileStartSource, type TNavigationSearchMode, type TNavigationStartMode, type TOptionStyleName, type TPermission, type TPlatform, type TPreviewBridgeMessage, type TPreviewBridgeMessageType, type TPreviewColorScheme, type TPreviewFrameSource, TStyleName, type TSyncRefetchKind, type TSyncTag, type TSystemAdvisorySeverity, type TSystemComponentStatus, type TSystemDeployment, type TSystemHealthOverall, type TUpdateCheckSeverity, type TUpdateKind, type TUpdateOperationStatus, type TUpdatePreflightStatus, type TWebFooterPreset, type TWebHeaderPreset, type TrustLevel, type TrustedKey, type TrustedKeysFile, type UpdatePreflightResult, WEB_FOOTER_PRESET_OPTIONS, WEB_FOOTER_PRESET_VALUES, WEB_HEADER_PRESET_OPTIONS, WEB_HEADER_PRESET_VALUES, type WorkerRelease, applyFormListUrlChange, arePreviewPreferencesEqual, asFilesCell, asRecordVersion, buildConditionContext, buildPagesResolvePath, buildPagesResolveQuery, buildPagesResolveUrl, buildPublicPathFromRoute, clampMenuItemsAtDepth, classifyClass, classifyClassString, collectPageIdsFromMenuItems, emptyFormListUrlState, encodeFormListQuery, evaluateCondition, expandedIdsForActiveTrail, findMenuItemByPageId, findNearestBottomTabMenuItemForPage, findPageRefInNavigationPayload, findRemap, flattenFooterItems, flattenFormRecordPrefillValues, flattenMenuItems, flattenNavigationMenuItems, footerColumnItems, footerGroupLinks, footerStandaloneItems, formListCacheKey, formListQueryString, formListRouteQuery, formatRateLimitMessage, getFormInvalidData, getFormListFailure, getFormListRestoreBlocked, getFormStaleVersion, getNavigationItemAriaLabel, getNavigationItemHref, getNavigationItemKeyword, getNavigationItemLabel, getNavigationItemMobileHref, getRateLimitRetryAfter, hasInlineFormatting, isBottomTabMenuItemActive, isDoubleWebHeaderPreset, isFormListParam, isMenuItemActiveOnMobile, isMenuItemActiveOnWeb, isMobileIconName, isNavigationBundleVersionSupported, isOnAnyMobileMenu, isOnAnyMobileMenuFromPayload, isPageInMenuTree, isPageInResolvedMenus, isPageOnAnyMenu, isPageOnMobileMenu, isPageOnWebMenu, isPreviewBridgeMessage, isWebFooterPreset, isWebHeaderPreset, matchesMobilePath, matchesWebPath, mergeHeaderLayers, nextSortOnHeaderClick, normalizePagesResolvePath, pageDependsOn, pageFromPayload, pageUrlToMobileRoute, parseFieldsMapCatalog, parseFieldsMapLabels, parseFormListQuery, parseFormRecordPrefill, parseInlineRich, parseOptionCatalog, parseOptionCodes, parseOptionLabels, parseSpacing, parseSyncMessage, parseSyncMessageJson, pickFormListQuery, previewKeywordFromPath, replaceCalcedValues, resolveAssetSources, resolveAssetUrl, resolveBranchNavGroup, resolveBrandingPresentation, resolveFieldsMapLabel, resolveHolderRedirectPath, resolveMenuMaxDepth, resolveMobileIcon, resolveMobilePagePresentation, resolveMobileSegmentGroup, resolveMobileStartupKeyword, resolveMobileStartupRoute, resolveOptionCodesLabels, resolveOptionLabel, resolveOptionValueLabels, resolveOptions, resolveWebBranchNavContext, resolveWebBranchNavGroup, resolveWebFooterPreset, resolveWebHeaderPreset, resolveWebStartupPath, searchMenuPagesInPayload, serializeFieldsMapCatalog, serializeFieldsMapLabels, spacingToClasses, splitHeaderLayers, stripHtmlToText, syncRefetchDelayMs, transformPageData, transformPagesData };
package/dist/index.d.ts CHANGED
@@ -79,6 +79,12 @@ interface IAuthEventsBootstrap {
79
79
  declare const PAGE_VERSION_REQUIRED_ERROR: "page_version_required";
80
80
  declare const STALE_PAGE_VERSION_ERROR: "stale_page_version";
81
81
  declare const PAGE_LOCKED_ERROR: "page_locked";
82
+ /**
83
+ * `409` when the caller's own page edit lock ended by idle expiry and they try
84
+ * to renew (`POST .../lock`). Data is {@link IPageLockStatus}. Resume through
85
+ * take-over (`POST .../lock/take-over`), not a plain acquire.
86
+ */
87
+ declare const LOCK_IDLE_ENDED_ERROR: "lock_idle_ended";
82
88
  /**
83
89
  * Draft version of a page (C8). `GET /admin/pages/{page_id}` returns it in its
84
90
  * data (and in the `X-Page-Version` header); admin page types extend this so
@@ -506,6 +512,8 @@ type ILanguagesResponse = IBaseApiResponse<ILanguageItem[]>;
506
512
 
507
513
  type IGetPageResponse = IBaseApiResponse<{
508
514
  page: IPageContent;
515
+ /** Live-sync block next to the page (contract C6); optional on older servers. */
516
+ sync?: ISyncBlock | null;
509
517
  }>;
510
518
  type IGetPagesResponse = IBaseApiResponse<IPageItem[]>;
511
519
  /**
@@ -515,6 +523,8 @@ type IGetPagesResponse = IBaseApiResponse<IPageItem[]>;
515
523
  */
516
524
  type IResolvePageResponse = IBaseApiResponse<{
517
525
  page: IPageContent;
526
+ /** Live-sync block next to the page (contract C6); optional on older servers. */
527
+ sync?: ISyncBlock | null;
518
528
  }>;
519
529
 
520
530
  /**
@@ -3160,6 +3170,27 @@ declare function pageDependsOn(sync: ISyncBlock | null | undefined, tags: readon
3160
3170
  */
3161
3171
  declare function syncRefetchDelayMs(kind: TSyncRefetchKind, random?: () => number): number;
3162
3172
 
3173
+ /**
3174
+ * Unwrap a page API response so the live-sync block travels with the page.
3175
+ *
3176
+ * The backend answers `{ data: { page, sync } }`: the sync block (contract C6)
3177
+ * sits next to the page, not inside it. Clients that cache the page read
3178
+ * `page.sync` for tag matching and `valid_until`, so every unwrap goes through
3179
+ * {@link pageFromPayload}.
3180
+ */
3181
+
3182
+ /** The `data` of a page response (`/pages/by-keyword`, `/pages/resolve`). */
3183
+ interface IPagePayload {
3184
+ page?: IPageContent | null;
3185
+ sync?: ISyncBlock | null;
3186
+ }
3187
+ /**
3188
+ * The page of a response's `data`, carrying the response's `sync` block.
3189
+ * Prefers `payload.sync`, falls back to `page.sync`. Returns `null` when there
3190
+ * is no page. With no sync at all, returns the page unchanged.
3191
+ */
3192
+ declare function pageFromPayload(payload: IPagePayload | null | undefined): IPageContent | null;
3193
+
3163
3194
  /**
3164
3195
  * Parse the unified `spacing` field. The CMS
3165
3196
  * stores this as a JSON string with optional keys for each side:
@@ -3221,4 +3252,4 @@ declare function transformPageData(apiPage: IRawPage): IPageItem;
3221
3252
  */
3222
3253
  declare function transformPagesData(pages: IRawPage[] | null | undefined): IPageItem[];
3223
3254
 
3224
- export { API_VERSION_PREFIX, type AdvisoryAffected, type AdvisoryFeed, type AdvisorySeverity, type BackupManifest, type BackupRetentionPolicy, type BackupSchedulePolicy, type BundledPluginRef, CLASS_PATTERNS, CLASS_REMAP, CLIENT_TYPE_MOBILE, CLIENT_TYPE_MOBILE_AND_WEB, CLIENT_TYPE_WEB, CMS_APP_PRIMARY_ROLES, CMS_APP_ROLES, COLOR_NAMES, type CheckSeverity, type CompatibilityRules, type CoreRelease, DEFAULT_MOBILE_ICON, DEFAULT_RATE_LIMIT_MESSAGE, DEFAULT_WEB_FOOTER_PRESET, DEFAULT_WEB_HEADER_PRESET, type DatabaseMigrationMetadata, ENDPOINTS, FIELDS_MAP_STYLE_CONFIG, FORM_LIST_MAX_PAGE, FORM_LIST_MAX_ROUTE_PARAMS, FORM_LIST_MAX_ROUTE_VALUE_LENGTH, FORM_LIST_MAX_SORTS, FORM_LIST_MAX_VALUE_BYTES, FORM_LIST_MODES, FORM_LIST_SEARCH_MAX_LENGTH, FORM_LIST_SEARCH_MIN_LENGTH, FORM_RECORD_PREFILL_SKIP_FIELDS, type FrontendRelease, HEADER_ACL_STAMP, HEADER_CLIENT_TYPE, HEADER_PAGE_VERSION, HEADER_PAGE_VIEW, IAboutItem, type IAssetSource, type IAuthEventsBootstrap, IBaseApiResponse, type IBasePageInfo, type IBasePageSection, type IBranchNavContext, type IBranchNavSegment, type IBreadcrumbEntry, type IClassPattern, type IClassRemap, type ICmsApp, type ICmsAppAssignedPage, type ICmsAppDetail, type ICmsAppPage, type ICmsAppSummary, type ICompatibilityError, type IConditionContext, IContentField, type IEvaluatedCondition, type IFieldsMapStyleConfig, type IForgotPasswordRequest, type IForgotPasswordResponse, IFormInvalidData, type IFormListCacheScope, type IFormListFailure, IFormListFilesCell, IFormListRestoreBlockedData, IFormListSort, type IFormListUrlError, type IFormListUrlRules, type IFormListUrlState, type IFormRecordPrefill, type IFormRecordPrefillChild, type IFormRecordPrefillSection, type IFormRecordPrefillTranslatedValue, IFormStaleVersionData, type IFrontendUpdatePreflight, type IFrontendUpdatePreflightResponse, type IFrontendUpdateReleases, type IFrontendUpdateReleasesResponse, type IFrontendUpdateRequest, type IFrontendUpdateRequestResponse, type IGetPageResponse, type IGetPagesResponse, type IHeaderLayerSplit, type IInlineNode, type IJwtPayload, type ILanguage, type ILanguageItem, type ILanguagePreference, type ILanguagePreferenceUpdateResponse, type ILanguagesResponse, type ILoginRequest, type ILoginSuccessData, type ILoginSuccessResponse, type ILogoutSuccessResponse, type IMaintenanceSetRequest, type IMenuSearchHit, type IMobileAdapterBaseProps, type IMobileButtonProps, type IMobileCardProps, type IMobileCheckboxProps, type IMobileContainerProps, type IMobileIconEntry, type IMobileInputProps, type IMobileModalProps, type IMobilePreviewExchangeData, type IMobilePreviewExchangeRequest, type IMobilePreviewExchangeResponse, type IMobilePreviewSessionData, type IMobilePreviewSessionRequest, type IMobilePreviewSessionResponse, type IMobilePreviewUpdatePreflight, type IMobilePreviewUpdatePreflightResponse, type IMobilePreviewUpdateReleases, type IMobilePreviewUpdateReleasesResponse, type IMobilePreviewUpdateRequest, type IMobilePreviewUpdateRequestResponse, type IMobileSelectOption, type IMobileSelectProps, type IMobileSwitchProps, type IMobileTextProps, type IMobileTextareaProps, type IMobileUiAdapters, type INavigationBranding, type INavigationBundle, type INavigationBundleImportHints, type INavigationBundleItem, type INavigationBundleItemTranslation, type INavigationBundleMenu, type INavigationMenu, type INavigationMenuItem, type INavigationPayload, type INavigationResolvedPageRef, type INavigationSearchConfig, type INavigationStartupConfig, type IOptionCatalogEntry, type IOptionLabelMap, type IOptionStyleConfig, type IPageAccessTypeInfo, type IPageContent, type IPageDraftVersioned, type IPageField, type IPageFieldTranslation, type IPageFieldsData, type IPageItem, type IPageLockHolder, type IPageLockStatus, type IPageRoute, type IPageSectionWithFields, type IPageSectionsData, type IPagesResolveParams, type IPreviewNavigateCommand, type IPreviewNavigatedMessage, type IPreviewPreferences, type IPreviewPreferencesChangedMessage, type IPreviewReadyMessage, type IPreviewSetPreferencesCommand, type IRefreshRequest, type IRefreshSuccessResponse, type IResetPasswordRequest, type IResetPasswordResponse, type IResolvePageResponse, type IResolvedOption, type ISpacingValue, type IStalePageVersionData, type ISyncBlock, type ISyncChangeMessage, type ISystemAdvisories, type ISystemAdvisoriesResponse, type ISystemAdvisory, type ISystemAdvisoryAffected, type ISystemHealth, type ISystemHealthComponent, type ISystemHealthResponse, type ISystemInstalledPlugin, type ISystemMaintenance, type ISystemMaintenanceResponse, type ISystemVersion, type ISystemVersionResponse, type ITwoFactorRequiredData, type ITwoFactorRequiredResponse, type ITwoFactorVerifyRequest, type ITwoFactorVerifySuccessResponse, type IUpdatePreflight, type IUpdatePreflightCheck, type IUpdatePreflightOption, type IUpdatePreflightResponse, type IUpdateRelease, type IUpdateReleases, type IUpdateReleasesResponse, type IUpdateRequest, type IUpdateRequestResponse, type IUpdateStatus, type IUpdateStatusManager, type IUpdateStatusResponse, type IUpdateStep, type IUserData, type IUserDataResponse, type IWebFooterPresetOption, type IWebHeaderPresetOption, type ImageRef, type InstalledPlugin, type InstanceImages, type InstanceLock, type InstanceManifest, type InstanceMode, type InstanceResourceConfig, type InstanceRouting, type InstanceStatus, type InstanceVersions, type InventoryInstanceEntry, LITERAL_CLASSES, type LockPluginEntry, type LockServiceEntry, MOBILE_ICON_NAMES, MOBILE_ICON_SET, MOBILE_PREVIEW_ENDPOINTS, type MobilePreviewRelease, NAVIGATION_BRANDING_LOGO_HEIGHTS, NAVIGATION_BUNDLE_FORMAT, NAVIGATION_BUNDLE_VERSION, NAVIGATION_HEADER_LAYER_TOP, OPTION_STYLE_CONFIGS, PAGE_LOCKED_ERROR, PAGE_VERSION_REQUIRED_ERROR, PERMISSIONS, PREVIEW_BRIDGE_MESSAGE, PREVIEW_PARENT_ORIGIN_PARAM, PREVIEW_SHELL_PARAM, type PluginRelease, type PreflightCheck, type PreflightOption, type PreflightStatus, RELEASE_CHANNELS, type RegistryIndex, type RegistryReleaseRef, type ReleaseChannel, type RuntimeServicePolicy, type RuntimeServiceRange, SIZE_VALUES, SPACING_VALUES, STALE_PAGE_VERSION_ERROR, SYNC_CHANGED_MAX_DELAY_MS, SYNC_EVENT_NAME, SYNC_MESSAGE_VERSION, SYNC_TAG_PATTERN, SYNC_VALID_UNTIL_MAX_DELAY_MS, SYSTEM_ENDPOINTS, type SchedulerRelease, type SecurityAdvisory, type ServerInventory, type ServiceBackendCompatibility, type SignatureBlock, type SupportBundleMeta, type TCalcedValues, type TClassDecision, type TClientType, type TCmsAppRole, TFormListMode, type TFormListUrlChange, type TFormListUrlErrorReason, type TFormListUrlParse, type TFormRecordPrefillFieldValue, type TFormRecordPrefillFileValue, THeroUiButtonVariant, THeroUiSize, TMobileButtonFeedback, TMobileFieldVariant, type TMobilePagePresentation, TMobileSelectPresentation, type TNavigationBrandingSize, type TNavigationBrandingVariant, type TNavigationBundleExportMode, type TNavigationChildrenNavMode, type TNavigationHeaderLayer, type TNavigationMenuItemType, type TNavigationMenuKey, type TNavigationMobileStartSource, type TNavigationSearchMode, type TNavigationStartMode, type TOptionStyleName, type TPermission, type TPlatform, type TPreviewBridgeMessage, type TPreviewBridgeMessageType, type TPreviewColorScheme, type TPreviewFrameSource, TStyleName, type TSyncRefetchKind, type TSyncTag, type TSystemAdvisorySeverity, type TSystemComponentStatus, type TSystemDeployment, type TSystemHealthOverall, type TUpdateCheckSeverity, type TUpdateKind, type TUpdateOperationStatus, type TUpdatePreflightStatus, type TWebFooterPreset, type TWebHeaderPreset, type TrustLevel, type TrustedKey, type TrustedKeysFile, type UpdatePreflightResult, WEB_FOOTER_PRESET_OPTIONS, WEB_FOOTER_PRESET_VALUES, WEB_HEADER_PRESET_OPTIONS, WEB_HEADER_PRESET_VALUES, type WorkerRelease, applyFormListUrlChange, arePreviewPreferencesEqual, asFilesCell, asRecordVersion, buildConditionContext, buildPagesResolvePath, buildPagesResolveQuery, buildPagesResolveUrl, buildPublicPathFromRoute, clampMenuItemsAtDepth, classifyClass, classifyClassString, collectPageIdsFromMenuItems, emptyFormListUrlState, encodeFormListQuery, evaluateCondition, expandedIdsForActiveTrail, findMenuItemByPageId, findNearestBottomTabMenuItemForPage, findPageRefInNavigationPayload, findRemap, flattenFooterItems, flattenFormRecordPrefillValues, flattenMenuItems, flattenNavigationMenuItems, footerColumnItems, footerGroupLinks, footerStandaloneItems, formListCacheKey, formListQueryString, formListRouteQuery, formatRateLimitMessage, getFormInvalidData, getFormListFailure, getFormListRestoreBlocked, getFormStaleVersion, getNavigationItemAriaLabel, getNavigationItemHref, getNavigationItemKeyword, getNavigationItemLabel, getNavigationItemMobileHref, getRateLimitRetryAfter, hasInlineFormatting, isBottomTabMenuItemActive, isDoubleWebHeaderPreset, isFormListParam, isMenuItemActiveOnMobile, isMenuItemActiveOnWeb, isMobileIconName, isNavigationBundleVersionSupported, isOnAnyMobileMenu, isOnAnyMobileMenuFromPayload, isPageInMenuTree, isPageInResolvedMenus, isPageOnAnyMenu, isPageOnMobileMenu, isPageOnWebMenu, isPreviewBridgeMessage, isWebFooterPreset, isWebHeaderPreset, matchesMobilePath, matchesWebPath, mergeHeaderLayers, nextSortOnHeaderClick, normalizePagesResolvePath, pageDependsOn, pageUrlToMobileRoute, parseFieldsMapCatalog, parseFieldsMapLabels, parseFormListQuery, parseFormRecordPrefill, parseInlineRich, parseOptionCatalog, parseOptionCodes, parseOptionLabels, parseSpacing, parseSyncMessage, parseSyncMessageJson, pickFormListQuery, previewKeywordFromPath, replaceCalcedValues, resolveAssetSources, resolveAssetUrl, resolveBranchNavGroup, resolveBrandingPresentation, resolveFieldsMapLabel, resolveHolderRedirectPath, resolveMenuMaxDepth, resolveMobileIcon, resolveMobilePagePresentation, resolveMobileSegmentGroup, resolveMobileStartupKeyword, resolveMobileStartupRoute, resolveOptionCodesLabels, resolveOptionLabel, resolveOptionValueLabels, resolveOptions, resolveWebBranchNavContext, resolveWebBranchNavGroup, resolveWebFooterPreset, resolveWebHeaderPreset, resolveWebStartupPath, searchMenuPagesInPayload, serializeFieldsMapCatalog, serializeFieldsMapLabels, spacingToClasses, splitHeaderLayers, stripHtmlToText, syncRefetchDelayMs, transformPageData, transformPagesData };
3255
+ export { API_VERSION_PREFIX, type AdvisoryAffected, type AdvisoryFeed, type AdvisorySeverity, type BackupManifest, type BackupRetentionPolicy, type BackupSchedulePolicy, type BundledPluginRef, CLASS_PATTERNS, CLASS_REMAP, CLIENT_TYPE_MOBILE, CLIENT_TYPE_MOBILE_AND_WEB, CLIENT_TYPE_WEB, CMS_APP_PRIMARY_ROLES, CMS_APP_ROLES, COLOR_NAMES, type CheckSeverity, type CompatibilityRules, type CoreRelease, DEFAULT_MOBILE_ICON, DEFAULT_RATE_LIMIT_MESSAGE, DEFAULT_WEB_FOOTER_PRESET, DEFAULT_WEB_HEADER_PRESET, type DatabaseMigrationMetadata, ENDPOINTS, FIELDS_MAP_STYLE_CONFIG, FORM_LIST_MAX_PAGE, FORM_LIST_MAX_ROUTE_PARAMS, FORM_LIST_MAX_ROUTE_VALUE_LENGTH, FORM_LIST_MAX_SORTS, FORM_LIST_MAX_VALUE_BYTES, FORM_LIST_MODES, FORM_LIST_SEARCH_MAX_LENGTH, FORM_LIST_SEARCH_MIN_LENGTH, FORM_RECORD_PREFILL_SKIP_FIELDS, type FrontendRelease, HEADER_ACL_STAMP, HEADER_CLIENT_TYPE, HEADER_PAGE_VERSION, HEADER_PAGE_VIEW, IAboutItem, type IAssetSource, type IAuthEventsBootstrap, IBaseApiResponse, type IBasePageInfo, type IBasePageSection, type IBranchNavContext, type IBranchNavSegment, type IBreadcrumbEntry, type IClassPattern, type IClassRemap, type ICmsApp, type ICmsAppAssignedPage, type ICmsAppDetail, type ICmsAppPage, type ICmsAppSummary, type ICompatibilityError, type IConditionContext, IContentField, type IEvaluatedCondition, type IFieldsMapStyleConfig, type IForgotPasswordRequest, type IForgotPasswordResponse, IFormInvalidData, type IFormListCacheScope, type IFormListFailure, IFormListFilesCell, IFormListRestoreBlockedData, IFormListSort, type IFormListUrlError, type IFormListUrlRules, type IFormListUrlState, type IFormRecordPrefill, type IFormRecordPrefillChild, type IFormRecordPrefillSection, type IFormRecordPrefillTranslatedValue, IFormStaleVersionData, type IFrontendUpdatePreflight, type IFrontendUpdatePreflightResponse, type IFrontendUpdateReleases, type IFrontendUpdateReleasesResponse, type IFrontendUpdateRequest, type IFrontendUpdateRequestResponse, type IGetPageResponse, type IGetPagesResponse, type IHeaderLayerSplit, type IInlineNode, type IJwtPayload, type ILanguage, type ILanguageItem, type ILanguagePreference, type ILanguagePreferenceUpdateResponse, type ILanguagesResponse, type ILoginRequest, type ILoginSuccessData, type ILoginSuccessResponse, type ILogoutSuccessResponse, type IMaintenanceSetRequest, type IMenuSearchHit, type IMobileAdapterBaseProps, type IMobileButtonProps, type IMobileCardProps, type IMobileCheckboxProps, type IMobileContainerProps, type IMobileIconEntry, type IMobileInputProps, type IMobileModalProps, type IMobilePreviewExchangeData, type IMobilePreviewExchangeRequest, type IMobilePreviewExchangeResponse, type IMobilePreviewSessionData, type IMobilePreviewSessionRequest, type IMobilePreviewSessionResponse, type IMobilePreviewUpdatePreflight, type IMobilePreviewUpdatePreflightResponse, type IMobilePreviewUpdateReleases, type IMobilePreviewUpdateReleasesResponse, type IMobilePreviewUpdateRequest, type IMobilePreviewUpdateRequestResponse, type IMobileSelectOption, type IMobileSelectProps, type IMobileSwitchProps, type IMobileTextProps, type IMobileTextareaProps, type IMobileUiAdapters, type INavigationBranding, type INavigationBundle, type INavigationBundleImportHints, type INavigationBundleItem, type INavigationBundleItemTranslation, type INavigationBundleMenu, type INavigationMenu, type INavigationMenuItem, type INavigationPayload, type INavigationResolvedPageRef, type INavigationSearchConfig, type INavigationStartupConfig, type IOptionCatalogEntry, type IOptionLabelMap, type IOptionStyleConfig, type IPageAccessTypeInfo, type IPageContent, type IPageDraftVersioned, type IPageField, type IPageFieldTranslation, type IPageFieldsData, type IPageItem, type IPageLockHolder, type IPageLockStatus, type IPagePayload, type IPageRoute, type IPageSectionWithFields, type IPageSectionsData, type IPagesResolveParams, type IPreviewNavigateCommand, type IPreviewNavigatedMessage, type IPreviewPreferences, type IPreviewPreferencesChangedMessage, type IPreviewReadyMessage, type IPreviewSetPreferencesCommand, type IRefreshRequest, type IRefreshSuccessResponse, type IResetPasswordRequest, type IResetPasswordResponse, type IResolvePageResponse, type IResolvedOption, type ISpacingValue, type IStalePageVersionData, type ISyncBlock, type ISyncChangeMessage, type ISystemAdvisories, type ISystemAdvisoriesResponse, type ISystemAdvisory, type ISystemAdvisoryAffected, type ISystemHealth, type ISystemHealthComponent, type ISystemHealthResponse, type ISystemInstalledPlugin, type ISystemMaintenance, type ISystemMaintenanceResponse, type ISystemVersion, type ISystemVersionResponse, type ITwoFactorRequiredData, type ITwoFactorRequiredResponse, type ITwoFactorVerifyRequest, type ITwoFactorVerifySuccessResponse, type IUpdatePreflight, type IUpdatePreflightCheck, type IUpdatePreflightOption, type IUpdatePreflightResponse, type IUpdateRelease, type IUpdateReleases, type IUpdateReleasesResponse, type IUpdateRequest, type IUpdateRequestResponse, type IUpdateStatus, type IUpdateStatusManager, type IUpdateStatusResponse, type IUpdateStep, type IUserData, type IUserDataResponse, type IWebFooterPresetOption, type IWebHeaderPresetOption, type ImageRef, type InstalledPlugin, type InstanceImages, type InstanceLock, type InstanceManifest, type InstanceMode, type InstanceResourceConfig, type InstanceRouting, type InstanceStatus, type InstanceVersions, type InventoryInstanceEntry, LITERAL_CLASSES, LOCK_IDLE_ENDED_ERROR, type LockPluginEntry, type LockServiceEntry, MOBILE_ICON_NAMES, MOBILE_ICON_SET, MOBILE_PREVIEW_ENDPOINTS, type MobilePreviewRelease, NAVIGATION_BRANDING_LOGO_HEIGHTS, NAVIGATION_BUNDLE_FORMAT, NAVIGATION_BUNDLE_VERSION, NAVIGATION_HEADER_LAYER_TOP, OPTION_STYLE_CONFIGS, PAGE_LOCKED_ERROR, PAGE_VERSION_REQUIRED_ERROR, PERMISSIONS, PREVIEW_BRIDGE_MESSAGE, PREVIEW_PARENT_ORIGIN_PARAM, PREVIEW_SHELL_PARAM, type PluginRelease, type PreflightCheck, type PreflightOption, type PreflightStatus, RELEASE_CHANNELS, type RegistryIndex, type RegistryReleaseRef, type ReleaseChannel, type RuntimeServicePolicy, type RuntimeServiceRange, SIZE_VALUES, SPACING_VALUES, STALE_PAGE_VERSION_ERROR, SYNC_CHANGED_MAX_DELAY_MS, SYNC_EVENT_NAME, SYNC_MESSAGE_VERSION, SYNC_TAG_PATTERN, SYNC_VALID_UNTIL_MAX_DELAY_MS, SYSTEM_ENDPOINTS, type SchedulerRelease, type SecurityAdvisory, type ServerInventory, type ServiceBackendCompatibility, type SignatureBlock, type SupportBundleMeta, type TCalcedValues, type TClassDecision, type TClientType, type TCmsAppRole, TFormListMode, type TFormListUrlChange, type TFormListUrlErrorReason, type TFormListUrlParse, type TFormRecordPrefillFieldValue, type TFormRecordPrefillFileValue, THeroUiButtonVariant, THeroUiSize, TMobileButtonFeedback, TMobileFieldVariant, type TMobilePagePresentation, TMobileSelectPresentation, type TNavigationBrandingSize, type TNavigationBrandingVariant, type TNavigationBundleExportMode, type TNavigationChildrenNavMode, type TNavigationHeaderLayer, type TNavigationMenuItemType, type TNavigationMenuKey, type TNavigationMobileStartSource, type TNavigationSearchMode, type TNavigationStartMode, type TOptionStyleName, type TPermission, type TPlatform, type TPreviewBridgeMessage, type TPreviewBridgeMessageType, type TPreviewColorScheme, type TPreviewFrameSource, TStyleName, type TSyncRefetchKind, type TSyncTag, type TSystemAdvisorySeverity, type TSystemComponentStatus, type TSystemDeployment, type TSystemHealthOverall, type TUpdateCheckSeverity, type TUpdateKind, type TUpdateOperationStatus, type TUpdatePreflightStatus, type TWebFooterPreset, type TWebHeaderPreset, type TrustLevel, type TrustedKey, type TrustedKeysFile, type UpdatePreflightResult, WEB_FOOTER_PRESET_OPTIONS, WEB_FOOTER_PRESET_VALUES, WEB_HEADER_PRESET_OPTIONS, WEB_HEADER_PRESET_VALUES, type WorkerRelease, applyFormListUrlChange, arePreviewPreferencesEqual, asFilesCell, asRecordVersion, buildConditionContext, buildPagesResolvePath, buildPagesResolveQuery, buildPagesResolveUrl, buildPublicPathFromRoute, clampMenuItemsAtDepth, classifyClass, classifyClassString, collectPageIdsFromMenuItems, emptyFormListUrlState, encodeFormListQuery, evaluateCondition, expandedIdsForActiveTrail, findMenuItemByPageId, findNearestBottomTabMenuItemForPage, findPageRefInNavigationPayload, findRemap, flattenFooterItems, flattenFormRecordPrefillValues, flattenMenuItems, flattenNavigationMenuItems, footerColumnItems, footerGroupLinks, footerStandaloneItems, formListCacheKey, formListQueryString, formListRouteQuery, formatRateLimitMessage, getFormInvalidData, getFormListFailure, getFormListRestoreBlocked, getFormStaleVersion, getNavigationItemAriaLabel, getNavigationItemHref, getNavigationItemKeyword, getNavigationItemLabel, getNavigationItemMobileHref, getRateLimitRetryAfter, hasInlineFormatting, isBottomTabMenuItemActive, isDoubleWebHeaderPreset, isFormListParam, isMenuItemActiveOnMobile, isMenuItemActiveOnWeb, isMobileIconName, isNavigationBundleVersionSupported, isOnAnyMobileMenu, isOnAnyMobileMenuFromPayload, isPageInMenuTree, isPageInResolvedMenus, isPageOnAnyMenu, isPageOnMobileMenu, isPageOnWebMenu, isPreviewBridgeMessage, isWebFooterPreset, isWebHeaderPreset, matchesMobilePath, matchesWebPath, mergeHeaderLayers, nextSortOnHeaderClick, normalizePagesResolvePath, pageDependsOn, pageFromPayload, pageUrlToMobileRoute, parseFieldsMapCatalog, parseFieldsMapLabels, parseFormListQuery, parseFormRecordPrefill, parseInlineRich, parseOptionCatalog, parseOptionCodes, parseOptionLabels, parseSpacing, parseSyncMessage, parseSyncMessageJson, pickFormListQuery, previewKeywordFromPath, replaceCalcedValues, resolveAssetSources, resolveAssetUrl, resolveBranchNavGroup, resolveBrandingPresentation, resolveFieldsMapLabel, resolveHolderRedirectPath, resolveMenuMaxDepth, resolveMobileIcon, resolveMobilePagePresentation, resolveMobileSegmentGroup, resolveMobileStartupKeyword, resolveMobileStartupRoute, resolveOptionCodesLabels, resolveOptionLabel, resolveOptionValueLabels, resolveOptions, resolveWebBranchNavContext, resolveWebBranchNavGroup, resolveWebFooterPreset, resolveWebHeaderPreset, resolveWebStartupPath, searchMenuPagesInPayload, serializeFieldsMapCatalog, serializeFieldsMapLabels, spacingToClasses, splitHeaderLayers, stripHtmlToText, syncRefetchDelayMs, transformPageData, transformPagesData };
package/dist/index.js CHANGED
@@ -67,6 +67,7 @@ __export(index_exports, {
67
67
  HEADER_PAGE_VIEW: () => HEADER_PAGE_VIEW,
68
68
  LINE_HEIGHT: () => LINE_HEIGHT,
69
69
  LITERAL_CLASSES: () => LITERAL_CLASSES,
70
+ LOCK_IDLE_ENDED_ERROR: () => LOCK_IDLE_ENDED_ERROR,
70
71
  MOBILE_ICON_NAMES: () => MOBILE_ICON_NAMES,
71
72
  MOBILE_ICON_SET: () => MOBILE_ICON_SET,
72
73
  MOBILE_PREVIEW_ENDPOINTS: () => MOBILE_PREVIEW_ENDPOINTS,
@@ -192,6 +193,7 @@ __export(index_exports, {
192
193
  nextSortOnHeaderClick: () => nextSortOnHeaderClick,
193
194
  normalizePagesResolvePath: () => normalizePagesResolvePath,
194
195
  pageDependsOn: () => pageDependsOn,
196
+ pageFromPayload: () => pageFromPayload,
195
197
  pageUrlToMobileRoute: () => pageUrlToMobileRoute,
196
198
  parseDimensionToReactNative: () => parseDimensionToReactNative,
197
199
  parseDimensionToWeb: () => parseDimensionToWeb,
@@ -3290,6 +3292,7 @@ var SYNC_TAG_PATTERN = /^(acl|navigation|global_values|page:\d+|page_draft:\d+|p
3290
3292
  var PAGE_VERSION_REQUIRED_ERROR = "page_version_required";
3291
3293
  var STALE_PAGE_VERSION_ERROR = "stale_page_version";
3292
3294
  var PAGE_LOCKED_ERROR = "page_locked";
3295
+ var LOCK_IDLE_ENDED_ERROR = "lock_idle_ended";
3293
3296
 
3294
3297
  // src/sync/sync.ts
3295
3298
  var SYNC_CHANGED_MAX_DELAY_MS = 300;
@@ -3329,6 +3332,16 @@ function syncRefetchDelayMs(kind, random = Math.random) {
3329
3332
  return Math.min(max, Math.floor(unit * (max + 1)));
3330
3333
  }
3331
3334
 
3335
+ // src/sync/page-payload.ts
3336
+ function pageFromPayload(payload) {
3337
+ const page = payload?.page;
3338
+ if (!page) {
3339
+ return null;
3340
+ }
3341
+ const sync = payload.sync ?? page.sync;
3342
+ return sync ? { ...page, sync } : page;
3343
+ }
3344
+
3332
3345
  // src/utils/spacing.ts
3333
3346
  var ALLOWED_KEYS = ["mt", "mb", "ms", "me", "pt", "pb", "ps", "pe"];
3334
3347
  function parseSpacing(raw) {
@@ -3432,6 +3445,7 @@ function transformPagesData(pages) {
3432
3445
  HEADER_PAGE_VIEW,
3433
3446
  LINE_HEIGHT,
3434
3447
  LITERAL_CLASSES,
3448
+ LOCK_IDLE_ENDED_ERROR,
3435
3449
  MOBILE_ICON_NAMES,
3436
3450
  MOBILE_ICON_SET,
3437
3451
  MOBILE_PREVIEW_ENDPOINTS,
@@ -3557,6 +3571,7 @@ function transformPagesData(pages) {
3557
3571
  nextSortOnHeaderClick,
3558
3572
  normalizePagesResolvePath,
3559
3573
  pageDependsOn,
3574
+ pageFromPayload,
3560
3575
  pageUrlToMobileRoute,
3561
3576
  parseDimensionToReactNative,
3562
3577
  parseDimensionToWeb,
package/dist/index.mjs CHANGED
@@ -3031,6 +3031,7 @@ var SYNC_TAG_PATTERN = /^(acl|navigation|global_values|page:\d+|page_draft:\d+|p
3031
3031
  var PAGE_VERSION_REQUIRED_ERROR = "page_version_required";
3032
3032
  var STALE_PAGE_VERSION_ERROR = "stale_page_version";
3033
3033
  var PAGE_LOCKED_ERROR = "page_locked";
3034
+ var LOCK_IDLE_ENDED_ERROR = "lock_idle_ended";
3034
3035
 
3035
3036
  // src/sync/sync.ts
3036
3037
  var SYNC_CHANGED_MAX_DELAY_MS = 300;
@@ -3070,6 +3071,16 @@ function syncRefetchDelayMs(kind, random = Math.random) {
3070
3071
  return Math.min(max, Math.floor(unit * (max + 1)));
3071
3072
  }
3072
3073
 
3074
+ // src/sync/page-payload.ts
3075
+ function pageFromPayload(payload) {
3076
+ const page = payload?.page;
3077
+ if (!page) {
3078
+ return null;
3079
+ }
3080
+ const sync = payload.sync ?? page.sync;
3081
+ return sync ? { ...page, sync } : page;
3082
+ }
3083
+
3073
3084
  // src/utils/spacing.ts
3074
3085
  var ALLOWED_KEYS = ["mt", "mb", "ms", "me", "pt", "pb", "ps", "pe"];
3075
3086
  function parseSpacing(raw) {
@@ -3172,6 +3183,7 @@ export {
3172
3183
  HEADER_PAGE_VIEW,
3173
3184
  LINE_HEIGHT,
3174
3185
  LITERAL_CLASSES,
3186
+ LOCK_IDLE_ENDED_ERROR,
3175
3187
  MOBILE_ICON_NAMES,
3176
3188
  MOBILE_ICON_SET,
3177
3189
  MOBILE_PREVIEW_ENDPOINTS,
@@ -3297,6 +3309,7 @@ export {
3297
3309
  nextSortOnHeaderClick,
3298
3310
  normalizePagesResolvePath,
3299
3311
  pageDependsOn,
3312
+ pageFromPayload,
3300
3313
  pageUrlToMobileRoute,
3301
3314
  parseDimensionToReactNative,
3302
3315
  parseDimensionToWeb,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@selfhelp/shared",
3
- "version": "1.28.0",
3
+ "version": "1.29.0",
4
4
  "description": "Shared TypeScript package for SelfHelp web frontend and mobile app: style registry, types, API contracts, Mantine theme tokens, condition + interpolation engines, CMS class allow-list.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -0,0 +1,72 @@
1
+ /*
2
+ * SPDX-FileCopyrightText: 2026 Humdek, University of Bern
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
6
+ import { describe, expect, it } from 'vitest';
7
+ import {
8
+ LOCK_IDLE_ENDED_ERROR,
9
+ PAGE_LOCKED_ERROR,
10
+ pageFromPayload,
11
+ type IGetPageResponse,
12
+ type IPageContent,
13
+ type IPagePayload,
14
+ type ISyncBlock,
15
+ } from '../../index';
16
+
17
+ const sync: ISyncBlock = {
18
+ depends_on: ['page:12', 'global_values'],
19
+ valid_until: '2026-11-23T12:00:00Z',
20
+ };
21
+
22
+ const page: IPageContent = {
23
+ id: 12,
24
+ keyword: 'demo',
25
+ url: '/demo',
26
+ parent_page_id: null,
27
+ is_headless: false,
28
+ title: 'Demo',
29
+ sections: [],
30
+ };
31
+
32
+ describe('root exports (P1-A1)', () => {
33
+ it('exports LOCK_IDLE_ENDED_ERROR, IPagePayload and pageFromPayload from the package root', () => {
34
+ expect(LOCK_IDLE_ENDED_ERROR).toBe('lock_idle_ended');
35
+ expect(PAGE_LOCKED_ERROR).toBe('page_locked');
36
+ const payload: IPagePayload = { page, sync };
37
+ expect(pageFromPayload(payload)?.id).toBe(12);
38
+ });
39
+ });
40
+
41
+ describe('pageFromPayload (P1-A2)', () => {
42
+ it('prefers payload.sync over page.sync', () => {
43
+ const onPage: ISyncBlock = { depends_on: ['page:99'], valid_until: null };
44
+ expect(pageFromPayload({ page: { ...page, sync: onPage }, sync })).toEqual({
45
+ ...page,
46
+ sync,
47
+ });
48
+ });
49
+
50
+ it('falls back to page.sync when the payload has no sync', () => {
51
+ expect(pageFromPayload({ page: { ...page, sync } })).toEqual({ ...page, sync });
52
+ });
53
+
54
+ it('returns null when there is no page', () => {
55
+ expect(pageFromPayload({ page: null, sync })).toBeNull();
56
+ expect(pageFromPayload({ sync })).toBeNull();
57
+ expect(pageFromPayload(undefined)).toBeNull();
58
+ expect(pageFromPayload(null)).toBeNull();
59
+ });
60
+
61
+ it('returns the page unchanged when there is no sync at all', () => {
62
+ expect(pageFromPayload({ page })).toBe(page);
63
+ });
64
+ });
65
+
66
+ describe('IGetPageResponse data shape (P1-A3)', () => {
67
+ it('accepts { page, sync } on the response data', () => {
68
+ const data: IGetPageResponse['data'] = { page, sync };
69
+ expect(data.page.id).toBe(12);
70
+ expect(data.sync?.depends_on).toContain('page:12');
71
+ });
72
+ });
package/src/sync/index.ts CHANGED
@@ -4,3 +4,4 @@ SPDX-License-Identifier: MPL-2.0
4
4
  */
5
5
  export * from './types';
6
6
  export * from './sync';
7
+ export * from './page-payload';
@@ -0,0 +1,35 @@
1
+ /*
2
+ SPDX-FileCopyrightText: 2026 Humdek, University of Bern
3
+ SPDX-License-Identifier: MPL-2.0
4
+ */
5
+ /**
6
+ * Unwrap a page API response so the live-sync block travels with the page.
7
+ *
8
+ * The backend answers `{ data: { page, sync } }`: the sync block (contract C6)
9
+ * sits next to the page, not inside it. Clients that cache the page read
10
+ * `page.sync` for tag matching and `valid_until`, so every unwrap goes through
11
+ * {@link pageFromPayload}.
12
+ */
13
+ import type { IPageContent } from '../types/pages';
14
+ import type { ISyncBlock } from './types';
15
+
16
+ /** The `data` of a page response (`/pages/by-keyword`, `/pages/resolve`). */
17
+ export interface IPagePayload {
18
+ page?: IPageContent | null;
19
+ sync?: ISyncBlock | null;
20
+ }
21
+
22
+ /**
23
+ * The page of a response's `data`, carrying the response's `sync` block.
24
+ * Prefers `payload.sync`, falls back to `page.sync`. Returns `null` when there
25
+ * is no page. With no sync at all, returns the page unchanged.
26
+ */
27
+ export function pageFromPayload(payload: IPagePayload | null | undefined): IPageContent | null {
28
+ const page = payload?.page;
29
+ if (!page) {
30
+ return null;
31
+ }
32
+ // An older server (or a payload built elsewhere) may have put the block on the page already.
33
+ const sync = payload.sync ?? page.sync;
34
+ return sync ? { ...page, sync } : page;
35
+ }
package/src/sync/types.ts CHANGED
@@ -92,6 +92,12 @@ export interface IAuthEventsBootstrap {
92
92
  export const PAGE_VERSION_REQUIRED_ERROR = 'page_version_required' as const;
93
93
  export const STALE_PAGE_VERSION_ERROR = 'stale_page_version' as const;
94
94
  export const PAGE_LOCKED_ERROR = 'page_locked' as const;
95
+ /**
96
+ * `409` when the caller's own page edit lock ended by idle expiry and they try
97
+ * to renew (`POST .../lock`). Data is {@link IPageLockStatus}. Resume through
98
+ * take-over (`POST .../lock/take-over`), not a plain acquire.
99
+ */
100
+ export const LOCK_IDLE_ENDED_ERROR = 'lock_idle_ended' as const;
95
101
 
96
102
  /**
97
103
  * Draft version of a page (C8). `GET /admin/pages/{page_id}` returns it in its
@@ -4,8 +4,13 @@ SPDX-License-Identifier: MPL-2.0
4
4
  */
5
5
  import type { IBaseApiResponse } from './envelope';
6
6
  import type { IPageContent, IPageItem } from '../pages';
7
+ import type { ISyncBlock } from '../../sync/types';
7
8
 
8
- export type IGetPageResponse = IBaseApiResponse<{ page: IPageContent }>;
9
+ export type IGetPageResponse = IBaseApiResponse<{
10
+ page: IPageContent;
11
+ /** Live-sync block next to the page (contract C6); optional on older servers. */
12
+ sync?: ISyncBlock | null;
13
+ }>;
9
14
  export type IGetPagesResponse = IBaseApiResponse<IPageItem[]>;
10
15
 
11
16
  /**
@@ -13,4 +18,8 @@ export type IGetPagesResponse = IBaseApiResponse<IPageItem[]>;
13
18
  * envelope to {@link IGetPageResponse}; the resolved `page` additionally carries
14
19
  * `route_params`, `matched_url_pattern`, and `canonical_url`.
15
20
  */
16
- export type IResolvePageResponse = IBaseApiResponse<{ page: IPageContent }>;
21
+ export type IResolvePageResponse = IBaseApiResponse<{
22
+ page: IPageContent;
23
+ /** Live-sync block next to the page (contract C6); optional on older servers. */
24
+ sync?: ISyncBlock | null;
25
+ }>;