@selfhelp/shared 1.17.0 → 1.18.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
@@ -9,6 +9,35 @@ All notable changes to `@selfhelp/shared` will be documented in this file.
9
9
 
10
10
  This project follows semantic versioning.
11
11
 
12
+ ## v1.18.0
13
+
14
+ **DB-driven public routing types (issue #30)** — additive contracts for the new
15
+ backend public-routing resolver. `IPageContent` (`src/types/pages.ts`) gains the
16
+ optional route metadata `route_params` (`Record<string, string>`),
17
+ `matched_url_pattern`, and `canonical_url`; a new `IResolvePageResponse`
18
+ (`src/types/api/page.ts`) types the `GET /cms-api/v1/pages/resolve` payload; and
19
+ `PAGES.RESOLVE` is added to the endpoint registry (`src/api/endpoints.ts`). The
20
+ resolved dynamic URL params surface to interpolation as `{{route.<snake_case>}}`.
21
+
22
+ All additions are optional/new, so `^1.x` consumers are unaffected. Pairs with
23
+ core `0.1.31`, frontend `0.1.57`, and mobile `0.1.31`.
24
+
25
+ ## v1.17.1
26
+
27
+ **`IShowUserInputStyle.field_labels`** — adds the optional header map
28
+ `field_key => display_name` the backend now sends with `show-user-input` entries
29
+ (host issue #56 v2). Rows are keyed by the immutable data-column `field_key`, so
30
+ the renderer reads `field_labels` to show the human column label in the table
31
+ header; renaming a column relabels the header automatically, and `fields_map`
32
+ stays an explicit override. Additive only — the field is optional, so `^1.x`
33
+ consumers and older hosts (which omit it) fall back to the raw key and are
34
+ unaffected.
35
+
36
+ ### Added (additive, non-breaking)
37
+
38
+ - **`IShowUserInputStyle.field_labels?: Record<string, string>`** — `field_key`
39
+ to `display_name` map for `show-user-input` headers (issue #56 v2).
40
+
12
41
  ## v1.17.0
13
42
 
14
43
  **Mobile host-navigation capability** — adds the optional
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { T as TStyleName, j as IContentField, k as TMobileButtonFeedback, l as TMobileFieldVariant, m as TMobileSelectPresentation } from './styles.registry-4W0LzmZB.mjs';
2
- export { B as BASE_STYLE_REGISTRY, n as IAccordionItemStyle, o as IAccordionStyle, p as IActionIconStyle, q as IAlertStyle, r as IAspectRatioStyle, s as IAudioStyle, t as IAvatarStyle, u as IBackgroundImageStyle, v as IBadgeStyle, w as IBaseStyle, x as IBlockquoteStyle, y as IBoxStyle, z as IButtonStyle, A as ICardSegmentStyle, C as ICardStyle, D as ICarouselStyle, E as ICenterStyle, F as ICheckboxStyle, G as IChipStyle, H as ICodeStyle, J as IColorInputStyle, K as IColorPickerStyle, L as IComboboxStyle, M as IContainerStyle, N as IDataContainerStyle, O as IDatePickerStyle, P as IDividerStyle, Q as IEntryListStyle, R as IEntryRecordDeleteStyle, U as IEntryRecordStyle, V as IFieldsetStyle, W as IFigureStyle, X as IFileInputStyle, Y as IFlexStyle, Z as IFormLogStyle, $ as IFormRecordStyle, a0 as IFormStyle, a1 as IGridColumnStyle, a2 as IGridStyle, a3 as IGroupStyle, a4 as IHighlightStyle, a5 as IHtmlTagStyle, a6 as IImageStyle, a7 as IIndicatorStyle, a8 as IInputStyle, a9 as IKbdStyle, aa as ILinkStyle, ab as IListItemStyle, ac as IListStyle, ad as ILoginStyle, ae as ILoopStyle, af as IMissingStyle, ag as INoAccessStyle, ah as INotFoundStyle, ai as INotificationStyle, aj as INumberInputStyle, ak as IPaperStyle, a as IPluginStyleRegistryEntry, al as IProfileStyle, am as IProgressRootStyle, an as IProgressSectionStyle, ao as IProgressStyle, ap as IRadioStyle, aq as IRangeSliderStyle, ar as IRatingStyle, as as IRefContainerStyle, at as IRegisterStyle, au as IResetPasswordStyle, av as IRichTextEditorStyle, aw as IScrollAreaStyle, ax as ISegmentedControlStyle, ay as ISelectStyle, az as IShowUserInputEntry, aA as IShowUserInputStyle, aB as ISimpleGridStyle, aC as ISliderStyle, aD as ISpaceStyle, aE as ISpoilerStyle, aF as IStackStyle, I as IStyleRegistryEntry, aG as IStyleWithSpacing, aH as ISwitchStyle, aI as ITabStyle, aJ as ITabsStyle, aK as ITextInputStyle, aL as ITextStyle, aM as ITextareaStyle, aN as IThemeIconStyle, aO as ITimelineItemStyle, aP as ITimelineStyle, aQ as ITitleStyle, aR as ITwoFactorAuthStyle, aS as ITypographyStyle, aT as IUnknownStyle, aU as IValidateStyle, aV as IVersionStyle, aW as IVideoStyle, S as STYLE_REGISTRY, c as TConcretePlatform, aX as TMantineAccordionChevronPosition, aY as TMantineAccordionDisableChevronRotation, aZ as TMantineAccordionLoop, a_ as TMantineAccordionMultiple, a$ as TMantineAnchorUnderline, b0 as TMantineBorder, b1 as TMantineCardPadding, b2 as TMantineCardShadow, b3 as TMantineCols, b4 as TMantineDividerVariant, b5 as TMantineGap, b6 as TMantineGridOffset, b7 as TMantineGridOrder, b8 as TMantineHeight, b9 as TMantineIconSize, ba as TMantineImageFit, bb as TMantineLineClamp, bc as TMantineListCenter, bd as TMantineListStyleType, be as TMantineListType, bf as TMantineListWithPadding, bg as TMantinePaperShadow, bh as TMantineProgressTransition, bi as TMantineScrollAreaSize, bj as TMantineScrollAreaType, bk as TMantineTextAlign, bl as TMantineTextDecoration, bm as TMantineTextFontStyle, bn as TMantineTextFontWeight, bo as TMantineTextInherit, bp as TMantineTextInputVariant, bq as TMantineTextSpan, br as TMantineTextTransform, bs as TMantineTextTruncate, bt as TMantineTextVariant, bu as TMantineTextareaAutosize, bv as TMantineTextareaResize, bw as TMantineTextareaVariant, bx as TMantineTimelineAlign, by as TMantineTitleLineClamp, bz as TMantineTitleTextWrap, bA as TMantineTranslatable, bB as TMantineUseInputWrapper, bC as TMantineWidth, bD as TSharedBorder, bE as TSharedCols, bF as TSharedDimension, bG as TSharedDividerLabelPosition, bH as TSharedDividerVariant, bI as TSharedLabelPosition, bJ as TStyle, b as TStylePlacement, d as TStylePlatform, e as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, f as _resetPluginStyleRegistry, g as extendStyleRegistry, h as getMergedStyleRegistry, i as getPluginStyleRegistry } from './styles.registry-4W0LzmZB.mjs';
1
+ import { T as TStyleName, j as IContentField, k as TMobileButtonFeedback, l as TMobileFieldVariant, m as TMobileSelectPresentation } from './styles.registry-6UBNKpyL.mjs';
2
+ export { B as BASE_STYLE_REGISTRY, n as IAccordionItemStyle, o as IAccordionStyle, p as IActionIconStyle, q as IAlertStyle, r as IAspectRatioStyle, s as IAudioStyle, t as IAvatarStyle, u as IBackgroundImageStyle, v as IBadgeStyle, w as IBaseStyle, x as IBlockquoteStyle, y as IBoxStyle, z as IButtonStyle, A as ICardSegmentStyle, C as ICardStyle, D as ICarouselStyle, E as ICenterStyle, F as ICheckboxStyle, G as IChipStyle, H as ICodeStyle, J as IColorInputStyle, K as IColorPickerStyle, L as IComboboxStyle, M as IContainerStyle, N as IDataContainerStyle, O as IDatePickerStyle, P as IDividerStyle, Q as IEntryListStyle, R as IEntryRecordDeleteStyle, U as IEntryRecordStyle, V as IFieldsetStyle, W as IFigureStyle, X as IFileInputStyle, Y as IFlexStyle, Z as IFormLogStyle, $ as IFormRecordStyle, a0 as IFormStyle, a1 as IGridColumnStyle, a2 as IGridStyle, a3 as IGroupStyle, a4 as IHighlightStyle, a5 as IHtmlTagStyle, a6 as IImageStyle, a7 as IIndicatorStyle, a8 as IInputStyle, a9 as IKbdStyle, aa as ILinkStyle, ab as IListItemStyle, ac as IListStyle, ad as ILoginStyle, ae as ILoopStyle, af as IMissingStyle, ag as INoAccessStyle, ah as INotFoundStyle, ai as INotificationStyle, aj as INumberInputStyle, ak as IPaperStyle, a as IPluginStyleRegistryEntry, al as IProfileStyle, am as IProgressRootStyle, an as IProgressSectionStyle, ao as IProgressStyle, ap as IRadioStyle, aq as IRangeSliderStyle, ar as IRatingStyle, as as IRefContainerStyle, at as IRegisterStyle, au as IResetPasswordStyle, av as IRichTextEditorStyle, aw as IScrollAreaStyle, ax as ISegmentedControlStyle, ay as ISelectStyle, az as IShowUserInputEntry, aA as IShowUserInputStyle, aB as ISimpleGridStyle, aC as ISliderStyle, aD as ISpaceStyle, aE as ISpoilerStyle, aF as IStackStyle, I as IStyleRegistryEntry, aG as IStyleWithSpacing, aH as ISwitchStyle, aI as ITabStyle, aJ as ITabsStyle, aK as ITextInputStyle, aL as ITextStyle, aM as ITextareaStyle, aN as IThemeIconStyle, aO as ITimelineItemStyle, aP as ITimelineStyle, aQ as ITitleStyle, aR as ITwoFactorAuthStyle, aS as ITypographyStyle, aT as IUnknownStyle, aU as IValidateStyle, aV as IVersionStyle, aW as IVideoStyle, S as STYLE_REGISTRY, c as TConcretePlatform, aX as TMantineAccordionChevronPosition, aY as TMantineAccordionDisableChevronRotation, aZ as TMantineAccordionLoop, a_ as TMantineAccordionMultiple, a$ as TMantineAnchorUnderline, b0 as TMantineBorder, b1 as TMantineCardPadding, b2 as TMantineCardShadow, b3 as TMantineCols, b4 as TMantineDividerVariant, b5 as TMantineGap, b6 as TMantineGridOffset, b7 as TMantineGridOrder, b8 as TMantineHeight, b9 as TMantineIconSize, ba as TMantineImageFit, bb as TMantineLineClamp, bc as TMantineListCenter, bd as TMantineListStyleType, be as TMantineListType, bf as TMantineListWithPadding, bg as TMantinePaperShadow, bh as TMantineProgressTransition, bi as TMantineScrollAreaSize, bj as TMantineScrollAreaType, bk as TMantineTextAlign, bl as TMantineTextDecoration, bm as TMantineTextFontStyle, bn as TMantineTextFontWeight, bo as TMantineTextInherit, bp as TMantineTextInputVariant, bq as TMantineTextSpan, br as TMantineTextTransform, bs as TMantineTextTruncate, bt as TMantineTextVariant, bu as TMantineTextareaAutosize, bv as TMantineTextareaResize, bw as TMantineTextareaVariant, bx as TMantineTimelineAlign, by as TMantineTitleLineClamp, bz as TMantineTitleTextWrap, bA as TMantineTranslatable, bB as TMantineUseInputWrapper, bC as TMantineWidth, bD as TSharedBorder, bE as TSharedCols, bF as TSharedDimension, bG as TSharedDividerLabelPosition, bH as TSharedDividerVariant, bI as TSharedLabelPosition, bJ as TStyle, b as TStylePlacement, d as TStylePlatform, e as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, f as _resetPluginStyleRegistry, g as extendStyleRegistry, h as getMergedStyleRegistry, i as getPluginStyleRegistry } from './styles.registry-6UBNKpyL.mjs';
3
3
  export { v as TMantineAccordionVariant, y as TMantineActionIconLoading, d as TMantineAlign, z as TMantineAllowNextClicks, A as TMantineAllowStepClick, B as TMantineAspectRatio, C as TMantineAutoContrast, r as TMantineAvatarVariant, q as TMantineBadgeVariant, D as TMantineBlock, E as TMantineCenterInline, F as TMantineChecked, G as TMantineChipChecked, H as TMantineChipMultiple, s as TMantineChipVariant, I as TMantineClampBehavior, J as TMantineCodeBlock, T as TMantineColor, K as TMantineColorFormat, L as TMantineColorInputSwatches, M as TMantineColorPickerSwatches, N as TMantineColorPickerSwatchesPerRow, O as TMantineCompact, P as TMantineContainerFluid, e as TMantineDirection, Q as TMantineDisabled, n as TMantineFieldsetVariant, R as TMantineFileAccept, S as TMantineFileInputMultiple, U as TMantineFluid, V as TMantineFullWidth, i as TMantineGridGrow, g as TMantineGridOverflow, h as TMantineGridSpan, W as TMantineGroupGrow, X as TMantineGroupWrap, Y as TMantineGrow, Z as TMantineHighlight, t as TMantineIndicatorPosition, _ as TMantineInline, $ as TMantineIsLink, c as TMantineJustify, a0 as TMantineKbdSize, a1 as TMantineLoading, a2 as TMantineMultiple, a3 as TMantineNotificationWithCloseButton, a4 as TMantineNumberInputDecimalScale, a5 as TMantineOpenInNewTab, j as TMantineOrientation, a6 as TMantineProcessing, a as TMantineRadius, a7 as TMantineRangeSliderMarks, a8 as TMantineRatingCount, a9 as TMantineRatingFractions, aa as TMantineRatingReadonly, ab as TMantineReadonly, m as TMantineSize, ac as TMantineSpaceHorizontal, ad as TMantineSpacing, o as TMantineSpoilerMaxHeight, ae as TMantineSwatches, af as TMantineTabDisabled, w as TMantineTabsVariant, u as TMantineThemeIconVariant, x as TMantineTimelineLineVariant, l as TMantineTitleOrder, ag as TMantineUseMantineStyle, p as TMantineVariant, ah as TMantineWithCloseButton, ai as TMantineWithIcon, f as TMantineWrap, k as TSharedRadius, b as TSharedSize } from './common-qaDIAYS3.mjs';
4
4
  import { ReactNode, ComponentType } from 'react';
5
5
  import { THeroUiButtonVariant, THeroUiSize } from './theme/index.mjs';
@@ -74,8 +74,34 @@ interface IPageContent {
74
74
  footer_position: number | null;
75
75
  title?: string | null;
76
76
  description?: string | null;
77
+ /**
78
+ * Snake_case route params extracted from the matched public URL pattern
79
+ * (e.g. `{ user_id: '42', token: 'abc' }` or `{ record_id: '7' }`). Present
80
+ * only when the page was resolved via `GET /pages/resolve`. Backend also
81
+ * exposes these to interpolation as `{{route.<name>}}`.
82
+ */
83
+ route_params?: Record<string, string>;
84
+ /** The `page_routes` pattern that matched (e.g. `/reset/{user_id}/{token}`). Resolve responses only. */
85
+ matched_url_pattern?: string | null;
86
+ /** The canonical active route pattern for the page, for canonical-link generation. Resolve responses only. */
87
+ canonical_url?: string | null;
77
88
  sections: IPageSectionWithFields[];
78
89
  }
90
+ /**
91
+ * A public, parameterized route contract for a CMS page (issue #30). Mirrors a
92
+ * backend `page_routes` row. `path_pattern` uses Symfony route syntax
93
+ * (`/team/{record_id}`) and `requirements` maps each placeholder to a regex
94
+ * (`{ record_id: '\\d+' }`). Param names are snake_case and are NEVER remapped
95
+ * on export/import. Used by the admin page-routes editor and page export/import.
96
+ */
97
+ interface IPageRoute {
98
+ id?: number;
99
+ path_pattern: string;
100
+ requirements?: Record<string, string> | null;
101
+ is_canonical: boolean;
102
+ is_active: boolean;
103
+ priority: number;
104
+ }
79
105
  interface IPageFieldTranslation {
80
106
  language_id: number;
81
107
  language_code: string;
@@ -370,6 +396,14 @@ type IGetPageResponse = IBaseApiResponse<{
370
396
  page: IPageContent;
371
397
  }>;
372
398
  type IGetPagesResponse = IBaseApiResponse<IPageItem[]>;
399
+ /**
400
+ * Response of `GET /cms-api/v1/pages/resolve?path=...` (issue #30). Identical
401
+ * envelope to {@link IGetPageResponse}; the resolved `page` additionally carries
402
+ * `route_params`, `matched_url_pattern`, and `canonical_url`.
403
+ */
404
+ type IResolvePageResponse = IBaseApiResponse<{
405
+ page: IPageContent;
406
+ }>;
373
407
 
374
408
  /**
375
409
  * System maintenance / update contracts (SelfHelp Manager <-> CMS <-> admin UI).
@@ -1705,6 +1739,12 @@ declare const ENDPOINTS: {
1705
1739
  readonly LIST_WITH_LANGUAGE: (languageId: number) => string;
1706
1740
  readonly BY_KEYWORD: (keyword: string) => string;
1707
1741
  readonly BY_ID: (pageId: number) => string;
1742
+ /**
1743
+ * DB-driven public path resolution (issue #30): maps a full public URL
1744
+ * path (e.g. `/reset/42/abc`, `/team/7`) to a page payload + route
1745
+ * params. `path` is sent URL-encoded as a query parameter.
1746
+ */
1747
+ readonly RESOLVE: (path: string) => string;
1708
1748
  };
1709
1749
  readonly LANGUAGES: "/cms-api/v1/languages";
1710
1750
  readonly FORMS: {
@@ -2040,4 +2080,4 @@ declare function transformPageData(apiPage: IRawPage): IPageItem;
2040
2080
  */
2041
2081
  declare function transformPagesData(pages: IRawPage[] | null | undefined): IPageItem[];
2042
2082
 
2043
- 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, COLOR_NAMES, type CheckSeverity, type CompatibilityRules, type CoreRelease, type DatabaseMigrationMetadata, ENDPOINTS, type FrontendRelease, HEADER_CLIENT_TYPE, type IApiError, type IApiMeta, type IAssetSource, type IBaseApiResponse, type IBasePageInfo, type IBasePageSection, type IClassPattern, type IClassRemap, type ICompatibilityError, type IConditionContext, IContentField, type IEvaluatedCondition, type IForgotPasswordRequest, type IForgotPasswordResponse, type IFormDeleteRequest, type IFormDeleteResponse, type IFormResultLegacyFields, type IFormSubmitData, type IFormSubmitRequest, type IFormSubmitResponse, type IFormUpdateData, type IFormUpdateRequest, type IFormUpdateResponse, type IFrontendUpdatePreflight, type IFrontendUpdatePreflightResponse, type IFrontendUpdateReleases, type IFrontendUpdateReleasesResponse, type IFrontendUpdateRequest, type IFrontendUpdateRequestResponse, type IGetPageResponse, type IGetPagesResponse, 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 IMeta, type IMobileAdapterBaseProps, type IMobileButtonProps, type IMobileCardProps, type IMobileCheckboxProps, type IMobileContainerProps, 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 IPageAccessTypeInfo, type IPageContent, type IPageField, type IPageFieldTranslation, type IPageFieldsData, type IPageItem, type IPageSectionWithFields, type IPageSectionsData, type IPreviewNavigateCommand, type IPreviewNavigatedMessage, type IPreviewPreferences, type IPreviewPreferencesChangedMessage, type IPreviewReadyMessage, type IPreviewSetPreferencesCommand, type IRefreshRequest, type IRefreshSuccessResponse, type IResetPasswordRequest, type IResetPasswordResponse, type ISpacingValue, 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 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_PREVIEW_ENDPOINTS, type MobilePreviewRelease, 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, SYSTEM_ENDPOINTS, type SchedulerRelease, type SecurityAdvisory, type ServerInventory, type ServiceBackendCompatibility, type SignatureBlock, type SupportBundleMeta, type TCalcedValues, type TClassDecision, type TClientType, THeroUiButtonVariant, THeroUiSize, TMobileButtonFeedback, TMobileFieldVariant, TMobileSelectPresentation, type TPermission, type TPlatform, type TPreviewBridgeMessage, type TPreviewBridgeMessageType, type TPreviewColorScheme, type TPreviewFrameSource, TStyleName, type TSystemAdvisorySeverity, type TSystemComponentStatus, type TSystemDeployment, type TSystemHealthOverall, type TUpdateCheckSeverity, type TUpdateKind, type TUpdateOperationStatus, type TUpdatePreflightStatus, type TrustLevel, type TrustedKey, type TrustedKeysFile, type UpdatePreflightResult, type WorkerRelease, arePreviewPreferencesEqual, buildConditionContext, classifyClass, classifyClassString, evaluateCondition, findRemap, hasInlineFormatting, isPreviewBridgeMessage, parseInlineRich, parseSpacing, previewKeywordFromPath, replaceCalcedValues, resolveAssetSources, resolveAssetUrl, spacingToClasses, stripHtmlToText, transformPageData, transformPagesData };
2083
+ 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, COLOR_NAMES, type CheckSeverity, type CompatibilityRules, type CoreRelease, type DatabaseMigrationMetadata, ENDPOINTS, type FrontendRelease, HEADER_CLIENT_TYPE, type IApiError, type IApiMeta, type IAssetSource, type IBaseApiResponse, type IBasePageInfo, type IBasePageSection, type IClassPattern, type IClassRemap, type ICompatibilityError, type IConditionContext, IContentField, type IEvaluatedCondition, type IForgotPasswordRequest, type IForgotPasswordResponse, type IFormDeleteRequest, type IFormDeleteResponse, type IFormResultLegacyFields, type IFormSubmitData, type IFormSubmitRequest, type IFormSubmitResponse, type IFormUpdateData, type IFormUpdateRequest, type IFormUpdateResponse, type IFrontendUpdatePreflight, type IFrontendUpdatePreflightResponse, type IFrontendUpdateReleases, type IFrontendUpdateReleasesResponse, type IFrontendUpdateRequest, type IFrontendUpdateRequestResponse, type IGetPageResponse, type IGetPagesResponse, 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 IMeta, type IMobileAdapterBaseProps, type IMobileButtonProps, type IMobileCardProps, type IMobileCheckboxProps, type IMobileContainerProps, 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 IPageAccessTypeInfo, type IPageContent, type IPageField, type IPageFieldTranslation, type IPageFieldsData, type IPageItem, type IPageRoute, type IPageSectionWithFields, type IPageSectionsData, type IPreviewNavigateCommand, type IPreviewNavigatedMessage, type IPreviewPreferences, type IPreviewPreferencesChangedMessage, type IPreviewReadyMessage, type IPreviewSetPreferencesCommand, type IRefreshRequest, type IRefreshSuccessResponse, type IResetPasswordRequest, type IResetPasswordResponse, type IResolvePageResponse, type ISpacingValue, 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 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_PREVIEW_ENDPOINTS, type MobilePreviewRelease, 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, SYSTEM_ENDPOINTS, type SchedulerRelease, type SecurityAdvisory, type ServerInventory, type ServiceBackendCompatibility, type SignatureBlock, type SupportBundleMeta, type TCalcedValues, type TClassDecision, type TClientType, THeroUiButtonVariant, THeroUiSize, TMobileButtonFeedback, TMobileFieldVariant, TMobileSelectPresentation, type TPermission, type TPlatform, type TPreviewBridgeMessage, type TPreviewBridgeMessageType, type TPreviewColorScheme, type TPreviewFrameSource, TStyleName, type TSystemAdvisorySeverity, type TSystemComponentStatus, type TSystemDeployment, type TSystemHealthOverall, type TUpdateCheckSeverity, type TUpdateKind, type TUpdateOperationStatus, type TUpdatePreflightStatus, type TrustLevel, type TrustedKey, type TrustedKeysFile, type UpdatePreflightResult, type WorkerRelease, arePreviewPreferencesEqual, buildConditionContext, classifyClass, classifyClassString, evaluateCondition, findRemap, hasInlineFormatting, isPreviewBridgeMessage, parseInlineRich, parseSpacing, previewKeywordFromPath, replaceCalcedValues, resolveAssetSources, resolveAssetUrl, spacingToClasses, stripHtmlToText, transformPageData, transformPagesData };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { T as TStyleName, j as IContentField, k as TMobileButtonFeedback, l as TMobileFieldVariant, m as TMobileSelectPresentation } from './styles.registry-D6xMm5VR.js';
2
- export { B as BASE_STYLE_REGISTRY, n as IAccordionItemStyle, o as IAccordionStyle, p as IActionIconStyle, q as IAlertStyle, r as IAspectRatioStyle, s as IAudioStyle, t as IAvatarStyle, u as IBackgroundImageStyle, v as IBadgeStyle, w as IBaseStyle, x as IBlockquoteStyle, y as IBoxStyle, z as IButtonStyle, A as ICardSegmentStyle, C as ICardStyle, D as ICarouselStyle, E as ICenterStyle, F as ICheckboxStyle, G as IChipStyle, H as ICodeStyle, J as IColorInputStyle, K as IColorPickerStyle, L as IComboboxStyle, M as IContainerStyle, N as IDataContainerStyle, O as IDatePickerStyle, P as IDividerStyle, Q as IEntryListStyle, R as IEntryRecordDeleteStyle, U as IEntryRecordStyle, V as IFieldsetStyle, W as IFigureStyle, X as IFileInputStyle, Y as IFlexStyle, Z as IFormLogStyle, $ as IFormRecordStyle, a0 as IFormStyle, a1 as IGridColumnStyle, a2 as IGridStyle, a3 as IGroupStyle, a4 as IHighlightStyle, a5 as IHtmlTagStyle, a6 as IImageStyle, a7 as IIndicatorStyle, a8 as IInputStyle, a9 as IKbdStyle, aa as ILinkStyle, ab as IListItemStyle, ac as IListStyle, ad as ILoginStyle, ae as ILoopStyle, af as IMissingStyle, ag as INoAccessStyle, ah as INotFoundStyle, ai as INotificationStyle, aj as INumberInputStyle, ak as IPaperStyle, a as IPluginStyleRegistryEntry, al as IProfileStyle, am as IProgressRootStyle, an as IProgressSectionStyle, ao as IProgressStyle, ap as IRadioStyle, aq as IRangeSliderStyle, ar as IRatingStyle, as as IRefContainerStyle, at as IRegisterStyle, au as IResetPasswordStyle, av as IRichTextEditorStyle, aw as IScrollAreaStyle, ax as ISegmentedControlStyle, ay as ISelectStyle, az as IShowUserInputEntry, aA as IShowUserInputStyle, aB as ISimpleGridStyle, aC as ISliderStyle, aD as ISpaceStyle, aE as ISpoilerStyle, aF as IStackStyle, I as IStyleRegistryEntry, aG as IStyleWithSpacing, aH as ISwitchStyle, aI as ITabStyle, aJ as ITabsStyle, aK as ITextInputStyle, aL as ITextStyle, aM as ITextareaStyle, aN as IThemeIconStyle, aO as ITimelineItemStyle, aP as ITimelineStyle, aQ as ITitleStyle, aR as ITwoFactorAuthStyle, aS as ITypographyStyle, aT as IUnknownStyle, aU as IValidateStyle, aV as IVersionStyle, aW as IVideoStyle, S as STYLE_REGISTRY, c as TConcretePlatform, aX as TMantineAccordionChevronPosition, aY as TMantineAccordionDisableChevronRotation, aZ as TMantineAccordionLoop, a_ as TMantineAccordionMultiple, a$ as TMantineAnchorUnderline, b0 as TMantineBorder, b1 as TMantineCardPadding, b2 as TMantineCardShadow, b3 as TMantineCols, b4 as TMantineDividerVariant, b5 as TMantineGap, b6 as TMantineGridOffset, b7 as TMantineGridOrder, b8 as TMantineHeight, b9 as TMantineIconSize, ba as TMantineImageFit, bb as TMantineLineClamp, bc as TMantineListCenter, bd as TMantineListStyleType, be as TMantineListType, bf as TMantineListWithPadding, bg as TMantinePaperShadow, bh as TMantineProgressTransition, bi as TMantineScrollAreaSize, bj as TMantineScrollAreaType, bk as TMantineTextAlign, bl as TMantineTextDecoration, bm as TMantineTextFontStyle, bn as TMantineTextFontWeight, bo as TMantineTextInherit, bp as TMantineTextInputVariant, bq as TMantineTextSpan, br as TMantineTextTransform, bs as TMantineTextTruncate, bt as TMantineTextVariant, bu as TMantineTextareaAutosize, bv as TMantineTextareaResize, bw as TMantineTextareaVariant, bx as TMantineTimelineAlign, by as TMantineTitleLineClamp, bz as TMantineTitleTextWrap, bA as TMantineTranslatable, bB as TMantineUseInputWrapper, bC as TMantineWidth, bD as TSharedBorder, bE as TSharedCols, bF as TSharedDimension, bG as TSharedDividerLabelPosition, bH as TSharedDividerVariant, bI as TSharedLabelPosition, bJ as TStyle, b as TStylePlacement, d as TStylePlatform, e as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, f as _resetPluginStyleRegistry, g as extendStyleRegistry, h as getMergedStyleRegistry, i as getPluginStyleRegistry } from './styles.registry-D6xMm5VR.js';
1
+ import { T as TStyleName, j as IContentField, k as TMobileButtonFeedback, l as TMobileFieldVariant, m as TMobileSelectPresentation } from './styles.registry-CANYbEa5.js';
2
+ export { B as BASE_STYLE_REGISTRY, n as IAccordionItemStyle, o as IAccordionStyle, p as IActionIconStyle, q as IAlertStyle, r as IAspectRatioStyle, s as IAudioStyle, t as IAvatarStyle, u as IBackgroundImageStyle, v as IBadgeStyle, w as IBaseStyle, x as IBlockquoteStyle, y as IBoxStyle, z as IButtonStyle, A as ICardSegmentStyle, C as ICardStyle, D as ICarouselStyle, E as ICenterStyle, F as ICheckboxStyle, G as IChipStyle, H as ICodeStyle, J as IColorInputStyle, K as IColorPickerStyle, L as IComboboxStyle, M as IContainerStyle, N as IDataContainerStyle, O as IDatePickerStyle, P as IDividerStyle, Q as IEntryListStyle, R as IEntryRecordDeleteStyle, U as IEntryRecordStyle, V as IFieldsetStyle, W as IFigureStyle, X as IFileInputStyle, Y as IFlexStyle, Z as IFormLogStyle, $ as IFormRecordStyle, a0 as IFormStyle, a1 as IGridColumnStyle, a2 as IGridStyle, a3 as IGroupStyle, a4 as IHighlightStyle, a5 as IHtmlTagStyle, a6 as IImageStyle, a7 as IIndicatorStyle, a8 as IInputStyle, a9 as IKbdStyle, aa as ILinkStyle, ab as IListItemStyle, ac as IListStyle, ad as ILoginStyle, ae as ILoopStyle, af as IMissingStyle, ag as INoAccessStyle, ah as INotFoundStyle, ai as INotificationStyle, aj as INumberInputStyle, ak as IPaperStyle, a as IPluginStyleRegistryEntry, al as IProfileStyle, am as IProgressRootStyle, an as IProgressSectionStyle, ao as IProgressStyle, ap as IRadioStyle, aq as IRangeSliderStyle, ar as IRatingStyle, as as IRefContainerStyle, at as IRegisterStyle, au as IResetPasswordStyle, av as IRichTextEditorStyle, aw as IScrollAreaStyle, ax as ISegmentedControlStyle, ay as ISelectStyle, az as IShowUserInputEntry, aA as IShowUserInputStyle, aB as ISimpleGridStyle, aC as ISliderStyle, aD as ISpaceStyle, aE as ISpoilerStyle, aF as IStackStyle, I as IStyleRegistryEntry, aG as IStyleWithSpacing, aH as ISwitchStyle, aI as ITabStyle, aJ as ITabsStyle, aK as ITextInputStyle, aL as ITextStyle, aM as ITextareaStyle, aN as IThemeIconStyle, aO as ITimelineItemStyle, aP as ITimelineStyle, aQ as ITitleStyle, aR as ITwoFactorAuthStyle, aS as ITypographyStyle, aT as IUnknownStyle, aU as IValidateStyle, aV as IVersionStyle, aW as IVideoStyle, S as STYLE_REGISTRY, c as TConcretePlatform, aX as TMantineAccordionChevronPosition, aY as TMantineAccordionDisableChevronRotation, aZ as TMantineAccordionLoop, a_ as TMantineAccordionMultiple, a$ as TMantineAnchorUnderline, b0 as TMantineBorder, b1 as TMantineCardPadding, b2 as TMantineCardShadow, b3 as TMantineCols, b4 as TMantineDividerVariant, b5 as TMantineGap, b6 as TMantineGridOffset, b7 as TMantineGridOrder, b8 as TMantineHeight, b9 as TMantineIconSize, ba as TMantineImageFit, bb as TMantineLineClamp, bc as TMantineListCenter, bd as TMantineListStyleType, be as TMantineListType, bf as TMantineListWithPadding, bg as TMantinePaperShadow, bh as TMantineProgressTransition, bi as TMantineScrollAreaSize, bj as TMantineScrollAreaType, bk as TMantineTextAlign, bl as TMantineTextDecoration, bm as TMantineTextFontStyle, bn as TMantineTextFontWeight, bo as TMantineTextInherit, bp as TMantineTextInputVariant, bq as TMantineTextSpan, br as TMantineTextTransform, bs as TMantineTextTruncate, bt as TMantineTextVariant, bu as TMantineTextareaAutosize, bv as TMantineTextareaResize, bw as TMantineTextareaVariant, bx as TMantineTimelineAlign, by as TMantineTitleLineClamp, bz as TMantineTitleTextWrap, bA as TMantineTranslatable, bB as TMantineUseInputWrapper, bC as TMantineWidth, bD as TSharedBorder, bE as TSharedCols, bF as TSharedDimension, bG as TSharedDividerLabelPosition, bH as TSharedDividerVariant, bI as TSharedLabelPosition, bJ as TStyle, b as TStylePlacement, d as TStylePlatform, e as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, f as _resetPluginStyleRegistry, g as extendStyleRegistry, h as getMergedStyleRegistry, i as getPluginStyleRegistry } from './styles.registry-CANYbEa5.js';
3
3
  export { v as TMantineAccordionVariant, y as TMantineActionIconLoading, d as TMantineAlign, z as TMantineAllowNextClicks, A as TMantineAllowStepClick, B as TMantineAspectRatio, C as TMantineAutoContrast, r as TMantineAvatarVariant, q as TMantineBadgeVariant, D as TMantineBlock, E as TMantineCenterInline, F as TMantineChecked, G as TMantineChipChecked, H as TMantineChipMultiple, s as TMantineChipVariant, I as TMantineClampBehavior, J as TMantineCodeBlock, T as TMantineColor, K as TMantineColorFormat, L as TMantineColorInputSwatches, M as TMantineColorPickerSwatches, N as TMantineColorPickerSwatchesPerRow, O as TMantineCompact, P as TMantineContainerFluid, e as TMantineDirection, Q as TMantineDisabled, n as TMantineFieldsetVariant, R as TMantineFileAccept, S as TMantineFileInputMultiple, U as TMantineFluid, V as TMantineFullWidth, i as TMantineGridGrow, g as TMantineGridOverflow, h as TMantineGridSpan, W as TMantineGroupGrow, X as TMantineGroupWrap, Y as TMantineGrow, Z as TMantineHighlight, t as TMantineIndicatorPosition, _ as TMantineInline, $ as TMantineIsLink, c as TMantineJustify, a0 as TMantineKbdSize, a1 as TMantineLoading, a2 as TMantineMultiple, a3 as TMantineNotificationWithCloseButton, a4 as TMantineNumberInputDecimalScale, a5 as TMantineOpenInNewTab, j as TMantineOrientation, a6 as TMantineProcessing, a as TMantineRadius, a7 as TMantineRangeSliderMarks, a8 as TMantineRatingCount, a9 as TMantineRatingFractions, aa as TMantineRatingReadonly, ab as TMantineReadonly, m as TMantineSize, ac as TMantineSpaceHorizontal, ad as TMantineSpacing, o as TMantineSpoilerMaxHeight, ae as TMantineSwatches, af as TMantineTabDisabled, w as TMantineTabsVariant, u as TMantineThemeIconVariant, x as TMantineTimelineLineVariant, l as TMantineTitleOrder, ag as TMantineUseMantineStyle, p as TMantineVariant, ah as TMantineWithCloseButton, ai as TMantineWithIcon, f as TMantineWrap, k as TSharedRadius, b as TSharedSize } from './common-qaDIAYS3.js';
4
4
  import { ReactNode, ComponentType } from 'react';
5
5
  import { THeroUiButtonVariant, THeroUiSize } from './theme/index.js';
@@ -74,8 +74,34 @@ interface IPageContent {
74
74
  footer_position: number | null;
75
75
  title?: string | null;
76
76
  description?: string | null;
77
+ /**
78
+ * Snake_case route params extracted from the matched public URL pattern
79
+ * (e.g. `{ user_id: '42', token: 'abc' }` or `{ record_id: '7' }`). Present
80
+ * only when the page was resolved via `GET /pages/resolve`. Backend also
81
+ * exposes these to interpolation as `{{route.<name>}}`.
82
+ */
83
+ route_params?: Record<string, string>;
84
+ /** The `page_routes` pattern that matched (e.g. `/reset/{user_id}/{token}`). Resolve responses only. */
85
+ matched_url_pattern?: string | null;
86
+ /** The canonical active route pattern for the page, for canonical-link generation. Resolve responses only. */
87
+ canonical_url?: string | null;
77
88
  sections: IPageSectionWithFields[];
78
89
  }
90
+ /**
91
+ * A public, parameterized route contract for a CMS page (issue #30). Mirrors a
92
+ * backend `page_routes` row. `path_pattern` uses Symfony route syntax
93
+ * (`/team/{record_id}`) and `requirements` maps each placeholder to a regex
94
+ * (`{ record_id: '\\d+' }`). Param names are snake_case and are NEVER remapped
95
+ * on export/import. Used by the admin page-routes editor and page export/import.
96
+ */
97
+ interface IPageRoute {
98
+ id?: number;
99
+ path_pattern: string;
100
+ requirements?: Record<string, string> | null;
101
+ is_canonical: boolean;
102
+ is_active: boolean;
103
+ priority: number;
104
+ }
79
105
  interface IPageFieldTranslation {
80
106
  language_id: number;
81
107
  language_code: string;
@@ -370,6 +396,14 @@ type IGetPageResponse = IBaseApiResponse<{
370
396
  page: IPageContent;
371
397
  }>;
372
398
  type IGetPagesResponse = IBaseApiResponse<IPageItem[]>;
399
+ /**
400
+ * Response of `GET /cms-api/v1/pages/resolve?path=...` (issue #30). Identical
401
+ * envelope to {@link IGetPageResponse}; the resolved `page` additionally carries
402
+ * `route_params`, `matched_url_pattern`, and `canonical_url`.
403
+ */
404
+ type IResolvePageResponse = IBaseApiResponse<{
405
+ page: IPageContent;
406
+ }>;
373
407
 
374
408
  /**
375
409
  * System maintenance / update contracts (SelfHelp Manager <-> CMS <-> admin UI).
@@ -1705,6 +1739,12 @@ declare const ENDPOINTS: {
1705
1739
  readonly LIST_WITH_LANGUAGE: (languageId: number) => string;
1706
1740
  readonly BY_KEYWORD: (keyword: string) => string;
1707
1741
  readonly BY_ID: (pageId: number) => string;
1742
+ /**
1743
+ * DB-driven public path resolution (issue #30): maps a full public URL
1744
+ * path (e.g. `/reset/42/abc`, `/team/7`) to a page payload + route
1745
+ * params. `path` is sent URL-encoded as a query parameter.
1746
+ */
1747
+ readonly RESOLVE: (path: string) => string;
1708
1748
  };
1709
1749
  readonly LANGUAGES: "/cms-api/v1/languages";
1710
1750
  readonly FORMS: {
@@ -2040,4 +2080,4 @@ declare function transformPageData(apiPage: IRawPage): IPageItem;
2040
2080
  */
2041
2081
  declare function transformPagesData(pages: IRawPage[] | null | undefined): IPageItem[];
2042
2082
 
2043
- 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, COLOR_NAMES, type CheckSeverity, type CompatibilityRules, type CoreRelease, type DatabaseMigrationMetadata, ENDPOINTS, type FrontendRelease, HEADER_CLIENT_TYPE, type IApiError, type IApiMeta, type IAssetSource, type IBaseApiResponse, type IBasePageInfo, type IBasePageSection, type IClassPattern, type IClassRemap, type ICompatibilityError, type IConditionContext, IContentField, type IEvaluatedCondition, type IForgotPasswordRequest, type IForgotPasswordResponse, type IFormDeleteRequest, type IFormDeleteResponse, type IFormResultLegacyFields, type IFormSubmitData, type IFormSubmitRequest, type IFormSubmitResponse, type IFormUpdateData, type IFormUpdateRequest, type IFormUpdateResponse, type IFrontendUpdatePreflight, type IFrontendUpdatePreflightResponse, type IFrontendUpdateReleases, type IFrontendUpdateReleasesResponse, type IFrontendUpdateRequest, type IFrontendUpdateRequestResponse, type IGetPageResponse, type IGetPagesResponse, 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 IMeta, type IMobileAdapterBaseProps, type IMobileButtonProps, type IMobileCardProps, type IMobileCheckboxProps, type IMobileContainerProps, 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 IPageAccessTypeInfo, type IPageContent, type IPageField, type IPageFieldTranslation, type IPageFieldsData, type IPageItem, type IPageSectionWithFields, type IPageSectionsData, type IPreviewNavigateCommand, type IPreviewNavigatedMessage, type IPreviewPreferences, type IPreviewPreferencesChangedMessage, type IPreviewReadyMessage, type IPreviewSetPreferencesCommand, type IRefreshRequest, type IRefreshSuccessResponse, type IResetPasswordRequest, type IResetPasswordResponse, type ISpacingValue, 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 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_PREVIEW_ENDPOINTS, type MobilePreviewRelease, 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, SYSTEM_ENDPOINTS, type SchedulerRelease, type SecurityAdvisory, type ServerInventory, type ServiceBackendCompatibility, type SignatureBlock, type SupportBundleMeta, type TCalcedValues, type TClassDecision, type TClientType, THeroUiButtonVariant, THeroUiSize, TMobileButtonFeedback, TMobileFieldVariant, TMobileSelectPresentation, type TPermission, type TPlatform, type TPreviewBridgeMessage, type TPreviewBridgeMessageType, type TPreviewColorScheme, type TPreviewFrameSource, TStyleName, type TSystemAdvisorySeverity, type TSystemComponentStatus, type TSystemDeployment, type TSystemHealthOverall, type TUpdateCheckSeverity, type TUpdateKind, type TUpdateOperationStatus, type TUpdatePreflightStatus, type TrustLevel, type TrustedKey, type TrustedKeysFile, type UpdatePreflightResult, type WorkerRelease, arePreviewPreferencesEqual, buildConditionContext, classifyClass, classifyClassString, evaluateCondition, findRemap, hasInlineFormatting, isPreviewBridgeMessage, parseInlineRich, parseSpacing, previewKeywordFromPath, replaceCalcedValues, resolveAssetSources, resolveAssetUrl, spacingToClasses, stripHtmlToText, transformPageData, transformPagesData };
2083
+ 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, COLOR_NAMES, type CheckSeverity, type CompatibilityRules, type CoreRelease, type DatabaseMigrationMetadata, ENDPOINTS, type FrontendRelease, HEADER_CLIENT_TYPE, type IApiError, type IApiMeta, type IAssetSource, type IBaseApiResponse, type IBasePageInfo, type IBasePageSection, type IClassPattern, type IClassRemap, type ICompatibilityError, type IConditionContext, IContentField, type IEvaluatedCondition, type IForgotPasswordRequest, type IForgotPasswordResponse, type IFormDeleteRequest, type IFormDeleteResponse, type IFormResultLegacyFields, type IFormSubmitData, type IFormSubmitRequest, type IFormSubmitResponse, type IFormUpdateData, type IFormUpdateRequest, type IFormUpdateResponse, type IFrontendUpdatePreflight, type IFrontendUpdatePreflightResponse, type IFrontendUpdateReleases, type IFrontendUpdateReleasesResponse, type IFrontendUpdateRequest, type IFrontendUpdateRequestResponse, type IGetPageResponse, type IGetPagesResponse, 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 IMeta, type IMobileAdapterBaseProps, type IMobileButtonProps, type IMobileCardProps, type IMobileCheckboxProps, type IMobileContainerProps, 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 IPageAccessTypeInfo, type IPageContent, type IPageField, type IPageFieldTranslation, type IPageFieldsData, type IPageItem, type IPageRoute, type IPageSectionWithFields, type IPageSectionsData, type IPreviewNavigateCommand, type IPreviewNavigatedMessage, type IPreviewPreferences, type IPreviewPreferencesChangedMessage, type IPreviewReadyMessage, type IPreviewSetPreferencesCommand, type IRefreshRequest, type IRefreshSuccessResponse, type IResetPasswordRequest, type IResetPasswordResponse, type IResolvePageResponse, type ISpacingValue, 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 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_PREVIEW_ENDPOINTS, type MobilePreviewRelease, 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, SYSTEM_ENDPOINTS, type SchedulerRelease, type SecurityAdvisory, type ServerInventory, type ServiceBackendCompatibility, type SignatureBlock, type SupportBundleMeta, type TCalcedValues, type TClassDecision, type TClientType, THeroUiButtonVariant, THeroUiSize, TMobileButtonFeedback, TMobileFieldVariant, TMobileSelectPresentation, type TPermission, type TPlatform, type TPreviewBridgeMessage, type TPreviewBridgeMessageType, type TPreviewColorScheme, type TPreviewFrameSource, TStyleName, type TSystemAdvisorySeverity, type TSystemComponentStatus, type TSystemDeployment, type TSystemHealthOverall, type TUpdateCheckSeverity, type TUpdateKind, type TUpdateOperationStatus, type TUpdatePreflightStatus, type TrustLevel, type TrustedKey, type TrustedKeysFile, type UpdatePreflightResult, type WorkerRelease, arePreviewPreferencesEqual, buildConditionContext, classifyClass, classifyClassString, evaluateCondition, findRemap, hasInlineFormatting, isPreviewBridgeMessage, parseInlineRich, parseSpacing, previewKeywordFromPath, replaceCalcedValues, resolveAssetSources, resolveAssetUrl, spacingToClasses, stripHtmlToText, transformPageData, transformPagesData };
package/dist/index.js CHANGED
@@ -518,7 +518,13 @@ var ENDPOINTS = {
518
518
  LIST: `${API_VERSION_PREFIX}/pages`,
519
519
  LIST_WITH_LANGUAGE: (languageId) => `${API_VERSION_PREFIX}/pages/language/${languageId}`,
520
520
  BY_KEYWORD: (keyword) => `${API_VERSION_PREFIX}/pages/by-keyword/${encodeURIComponent(keyword)}`,
521
- BY_ID: (pageId) => `${API_VERSION_PREFIX}/pages/${pageId}`
521
+ BY_ID: (pageId) => `${API_VERSION_PREFIX}/pages/${pageId}`,
522
+ /**
523
+ * DB-driven public path resolution (issue #30): maps a full public URL
524
+ * path (e.g. `/reset/42/abc`, `/team/7`) to a page payload + route
525
+ * params. `path` is sent URL-encoded as a query parameter.
526
+ */
527
+ RESOLVE: (path) => `${API_VERSION_PREFIX}/pages/resolve?path=${encodeURIComponent(path)}`
522
528
  },
523
529
  LANGUAGES: `${API_VERSION_PREFIX}/languages`,
524
530
  FORMS: {
package/dist/index.mjs CHANGED
@@ -391,7 +391,13 @@ var ENDPOINTS = {
391
391
  LIST: `${API_VERSION_PREFIX}/pages`,
392
392
  LIST_WITH_LANGUAGE: (languageId) => `${API_VERSION_PREFIX}/pages/language/${languageId}`,
393
393
  BY_KEYWORD: (keyword) => `${API_VERSION_PREFIX}/pages/by-keyword/${encodeURIComponent(keyword)}`,
394
- BY_ID: (pageId) => `${API_VERSION_PREFIX}/pages/${pageId}`
394
+ BY_ID: (pageId) => `${API_VERSION_PREFIX}/pages/${pageId}`,
395
+ /**
396
+ * DB-driven public path resolution (issue #30): maps a full public URL
397
+ * path (e.g. `/reset/42/abc`, `/team/7`) to a page payload + route
398
+ * params. `path` is sent URL-encoded as a query parameter.
399
+ */
400
+ RESOLVE: (path) => `${API_VERSION_PREFIX}/pages/resolve?path=${encodeURIComponent(path)}`
395
401
  },
396
402
  LANGUAGES: `${API_VERSION_PREFIX}/languages`,
397
403
  FORMS: {
@@ -1,5 +1,5 @@
1
1
  export { I as IPluginManifest, a as IPluginManifestAdminPage, b as IPluginManifestApiRoute, c as IPluginManifestAsset, d as IPluginManifestCapability, e as IPluginManifestCompatibility, f as IPluginManifestConflict, g as IPluginManifestDataAccess, h as IPluginManifestDependency, i as IPluginManifestExternalHost, j as IPluginManifestFeatureFlag, k as IPluginManifestHealth, l as IPluginManifestLookupExtension, m as IPluginManifestMobile, n as IPluginManifestPermission, o as IPluginManifestRealtimeTopic, p as IPluginManifestScheduledJob, q as IPluginManifestSecurity, r as IPluginManifestStyle, s as IPluginManifestTrustLevel } from '../manifest-8YXAk-4o.mjs';
2
- import { I as IStyleRegistryEntry } from '../styles.registry-4W0LzmZB.mjs';
2
+ import { I as IStyleRegistryEntry } from '../styles.registry-6UBNKpyL.mjs';
3
3
  import '../common-qaDIAYS3.mjs';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  export { I as IPluginManifest, a as IPluginManifestAdminPage, b as IPluginManifestApiRoute, c as IPluginManifestAsset, d as IPluginManifestCapability, e as IPluginManifestCompatibility, f as IPluginManifestConflict, g as IPluginManifestDataAccess, h as IPluginManifestDependency, i as IPluginManifestExternalHost, j as IPluginManifestFeatureFlag, k as IPluginManifestHealth, l as IPluginManifestLookupExtension, m as IPluginManifestMobile, n as IPluginManifestPermission, o as IPluginManifestRealtimeTopic, p as IPluginManifestScheduledJob, q as IPluginManifestSecurity, r as IPluginManifestStyle, s as IPluginManifestTrustLevel } from '../manifest-8YXAk-4o.js';
2
- import { I as IStyleRegistryEntry } from '../styles.registry-D6xMm5VR.js';
2
+ import { I as IStyleRegistryEntry } from '../styles.registry-CANYbEa5.js';
3
3
  import '../common-qaDIAYS3.js';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
- import { T as TStyleName, I as IStyleRegistryEntry, a as IPluginStyleRegistryEntry, b as TStylePlacement, c as TConcretePlatform, d as TStylePlatform } from '../styles.registry-4W0LzmZB.mjs';
2
- export { B as BASE_STYLE_REGISTRY, S as STYLE_REGISTRY, e as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, f as _resetPluginStyleRegistry, g as extendStyleRegistry, h as getMergedStyleRegistry, i as getPluginStyleRegistry } from '../styles.registry-4W0LzmZB.mjs';
1
+ import { T as TStyleName, I as IStyleRegistryEntry, a as IPluginStyleRegistryEntry, b as TStylePlacement, c as TConcretePlatform, d as TStylePlatform } from '../styles.registry-6UBNKpyL.mjs';
2
+ export { B as BASE_STYLE_REGISTRY, S as STYLE_REGISTRY, e as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, f as _resetPluginStyleRegistry, g as extendStyleRegistry, h as getMergedStyleRegistry, i as getPluginStyleRegistry } from '../styles.registry-6UBNKpyL.mjs';
3
3
  import '../common-qaDIAYS3.mjs';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
- import { T as TStyleName, I as IStyleRegistryEntry, a as IPluginStyleRegistryEntry, b as TStylePlacement, c as TConcretePlatform, d as TStylePlatform } from '../styles.registry-D6xMm5VR.js';
2
- export { B as BASE_STYLE_REGISTRY, S as STYLE_REGISTRY, e as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, f as _resetPluginStyleRegistry, g as extendStyleRegistry, h as getMergedStyleRegistry, i as getPluginStyleRegistry } from '../styles.registry-D6xMm5VR.js';
1
+ import { T as TStyleName, I as IStyleRegistryEntry, a as IPluginStyleRegistryEntry, b as TStylePlacement, c as TConcretePlatform, d as TStylePlatform } from '../styles.registry-CANYbEa5.js';
2
+ export { B as BASE_STYLE_REGISTRY, S as STYLE_REGISTRY, e as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, f as _resetPluginStyleRegistry, g as extendStyleRegistry, h as getMergedStyleRegistry, i as getPluginStyleRegistry } from '../styles.registry-CANYbEa5.js';
3
3
  import '../common-qaDIAYS3.js';
4
4
 
5
5
  /**
@@ -1113,7 +1113,18 @@ interface IShowUserInputStyle extends IBaseStyle {
1113
1113
  web_table_with_row_borders?: IContentField<string>;
1114
1114
  web_table_sticky_header?: IContentField<string>;
1115
1115
  web_table_caption_side?: IContentField<string>;
1116
+ /**
1117
+ * show-user-input rows, each keyed by the immutable data-column `field_key`
1118
+ * (issue #56 v2). Header labels come from {@link field_labels}, not the keys.
1119
+ */
1116
1120
  entries?: IShowUserInputEntry[];
1121
+ /**
1122
+ * Header map `field_key => display_name` for {@link entries} (issue #56 v2).
1123
+ * Lets the table show the human column label while rows stay keyed by the
1124
+ * stable `field_key`, so renaming a column relabels the header automatically.
1125
+ * `fields_map` still overrides individual headers when set.
1126
+ */
1127
+ field_labels?: Record<string, string>;
1117
1128
  }
1118
1129
 
1119
1130
  type TMantineAccordionMultiple = '0' | '1';
@@ -1113,7 +1113,18 @@ interface IShowUserInputStyle extends IBaseStyle {
1113
1113
  web_table_with_row_borders?: IContentField<string>;
1114
1114
  web_table_sticky_header?: IContentField<string>;
1115
1115
  web_table_caption_side?: IContentField<string>;
1116
+ /**
1117
+ * show-user-input rows, each keyed by the immutable data-column `field_key`
1118
+ * (issue #56 v2). Header labels come from {@link field_labels}, not the keys.
1119
+ */
1116
1120
  entries?: IShowUserInputEntry[];
1121
+ /**
1122
+ * Header map `field_key => display_name` for {@link entries} (issue #56 v2).
1123
+ * Lets the table show the human column label while rows stay keyed by the
1124
+ * stable `field_key`, so renaming a column relabels the header automatically.
1125
+ * `fields_map` still overrides individual headers when set.
1126
+ */
1127
+ field_labels?: Record<string, string>;
1117
1128
  }
1118
1129
 
1119
1130
  type TMantineAccordionMultiple = '0' | '1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@selfhelp/shared",
3
- "version": "1.17.0",
3
+ "version": "1.18.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",
@@ -43,3 +43,26 @@ describe('ENDPOINTS.AUTH password recovery', () => {
43
43
  );
44
44
  });
45
45
  });
46
+
47
+ /**
48
+ * Contract coverage for the DB-driven public path resolver (issue #30). The web
49
+ * frontend SSR layer and the mobile app both build the resolve request from
50
+ * `ENDPOINTS.PAGES.RESOLVE`, so a wrong/missing path silently breaks every
51
+ * parameterized public URL (`/reset/{user_id}/{token}`, `/team/{record_id}`).
52
+ */
53
+ describe('ENDPOINTS.PAGES.RESOLVE (DB-driven routing)', () => {
54
+ it('builds the resolve endpoint with the path as a URL-encoded query param', () => {
55
+ expect(ENDPOINTS.PAGES.RESOLVE('/team/7')).toBe(
56
+ `${API_VERSION_PREFIX}/pages/resolve?path=%2Fteam%2F7`,
57
+ );
58
+ });
59
+
60
+ it('encodes reset/validate token paths so slashes survive transport', () => {
61
+ expect(ENDPOINTS.PAGES.RESOLVE('/reset/42/abc.def~1')).toBe(
62
+ `${API_VERSION_PREFIX}/pages/resolve?path=%2Freset%2F42%2Fabc.def~1`,
63
+ );
64
+ expect(ENDPOINTS.PAGES.RESOLVE('/')).toBe(
65
+ `${API_VERSION_PREFIX}/pages/resolve?path=%2F`,
66
+ );
67
+ });
68
+ });
@@ -40,6 +40,13 @@ export const ENDPOINTS = {
40
40
  BY_KEYWORD: (keyword: string): string =>
41
41
  `${API_VERSION_PREFIX}/pages/by-keyword/${encodeURIComponent(keyword)}`,
42
42
  BY_ID: (pageId: number): string => `${API_VERSION_PREFIX}/pages/${pageId}`,
43
+ /**
44
+ * DB-driven public path resolution (issue #30): maps a full public URL
45
+ * path (e.g. `/reset/42/abc`, `/team/7`) to a page payload + route
46
+ * params. `path` is sent URL-encoded as a query parameter.
47
+ */
48
+ RESOLVE: (path: string): string =>
49
+ `${API_VERSION_PREFIX}/pages/resolve?path=${encodeURIComponent(path)}`,
43
50
  },
44
51
  LANGUAGES: `${API_VERSION_PREFIX}/languages`,
45
52
  FORMS: {
@@ -0,0 +1,110 @@
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 type { IPageContent, IPageRoute } from '../../pages';
8
+ import type { IResolvePageResponse } from '../page';
9
+
10
+ /**
11
+ * Contract coverage for the DB-driven public routing types (issue #30). The web
12
+ * frontend auth styles and the mobile app read `page.route_params.user_id` /
13
+ * `.token` straight off the resolved page, so the route metadata MUST live on
14
+ * `IPageContent` with snake_case param keys. `IPageRoute` is the admin
15
+ * page-routes editor + export/import contract and must keep `path_pattern`
16
+ * placeholders verbatim.
17
+ */
18
+ describe('IPageContent route metadata (resolve responses)', () => {
19
+ it('carries optional snake_case route_params + matched/canonical url', () => {
20
+ const page: IPageContent = {
21
+ id: 7,
22
+ keyword: 'reset-password',
23
+ url: '/reset',
24
+ parent_page_id: null,
25
+ is_headless: true,
26
+ nav_position: null,
27
+ footer_position: null,
28
+ route_params: { user_id: '42', token: 'abc.def~1' },
29
+ matched_url_pattern: '/reset/{user_id}/{token}',
30
+ canonical_url: '/reset',
31
+ sections: [],
32
+ };
33
+
34
+ expect(page.route_params?.user_id).toBe('42');
35
+ expect(page.route_params?.token).toBe('abc.def~1');
36
+ expect(page.matched_url_pattern).toBe('/reset/{user_id}/{token}');
37
+ expect(page.canonical_url).toBe('/reset');
38
+ });
39
+
40
+ it('treats route metadata as optional (a static page omits it)', () => {
41
+ const page: IPageContent = {
42
+ id: 1,
43
+ keyword: 'home',
44
+ url: '/',
45
+ parent_page_id: null,
46
+ is_headless: false,
47
+ nav_position: 1,
48
+ footer_position: null,
49
+ sections: [],
50
+ };
51
+
52
+ expect(page.route_params).toBeUndefined();
53
+ expect(page.matched_url_pattern).toBeUndefined();
54
+ });
55
+
56
+ it('wraps the resolved page in the standard envelope', () => {
57
+ const response: IResolvePageResponse = {
58
+ status: 200,
59
+ message: 'OK',
60
+ error: null,
61
+ logged_in: false,
62
+ meta: { version: 'v1', timestamp: '2026-06-30T00:00:00Z' },
63
+ data: {
64
+ page: {
65
+ id: 9,
66
+ keyword: 'team',
67
+ url: '/team/7',
68
+ parent_page_id: null,
69
+ is_headless: false,
70
+ nav_position: null,
71
+ footer_position: null,
72
+ route_params: { record_id: '7' },
73
+ sections: [],
74
+ },
75
+ },
76
+ };
77
+
78
+ expect(response.data?.page.route_params?.record_id).toBe('7');
79
+ });
80
+ });
81
+
82
+ describe('IPageRoute (admin editor + export/import contract)', () => {
83
+ it('models a parameterized canonical route with regex requirements', () => {
84
+ const route: IPageRoute = {
85
+ id: 12,
86
+ path_pattern: '/team/{record_id}',
87
+ requirements: { record_id: '\\d+' },
88
+ is_canonical: true,
89
+ is_active: true,
90
+ priority: 50,
91
+ };
92
+
93
+ // Param names are NEVER remapped, so the placeholder must survive verbatim.
94
+ expect(route.path_pattern).toContain('{record_id}');
95
+ expect(route.requirements?.record_id).toBe('\\d+');
96
+ expect(route.is_canonical).toBe(true);
97
+ });
98
+
99
+ it('allows a static route with no requirements', () => {
100
+ const route: IPageRoute = {
101
+ path_pattern: '/reset',
102
+ requirements: null,
103
+ is_canonical: true,
104
+ is_active: true,
105
+ priority: 100,
106
+ };
107
+
108
+ expect(route.requirements).toBeNull();
109
+ });
110
+ });
@@ -7,3 +7,10 @@ import type { IPageContent, IPageItem } from '../pages';
7
7
 
8
8
  export type IGetPageResponse = IBaseApiResponse<{ page: IPageContent }>;
9
9
  export type IGetPagesResponse = IBaseApiResponse<IPageItem[]>;
10
+
11
+ /**
12
+ * Response of `GET /cms-api/v1/pages/resolve?path=...` (issue #30). Identical
13
+ * envelope to {@link IGetPageResponse}; the resolved `page` additionally carries
14
+ * `route_params`, `matched_url_pattern`, and `canonical_url`.
15
+ */
16
+ export type IResolvePageResponse = IBaseApiResponse<{ page: IPageContent }>;
@@ -75,9 +75,36 @@ export interface IPageContent {
75
75
  footer_position: number | null;
76
76
  title?: string | null;
77
77
  description?: string | null;
78
+ /**
79
+ * Snake_case route params extracted from the matched public URL pattern
80
+ * (e.g. `{ user_id: '42', token: 'abc' }` or `{ record_id: '7' }`). Present
81
+ * only when the page was resolved via `GET /pages/resolve`. Backend also
82
+ * exposes these to interpolation as `{{route.<name>}}`.
83
+ */
84
+ route_params?: Record<string, string>;
85
+ /** The `page_routes` pattern that matched (e.g. `/reset/{user_id}/{token}`). Resolve responses only. */
86
+ matched_url_pattern?: string | null;
87
+ /** The canonical active route pattern for the page, for canonical-link generation. Resolve responses only. */
88
+ canonical_url?: string | null;
78
89
  sections: IPageSectionWithFields[];
79
90
  }
80
91
 
92
+ /**
93
+ * A public, parameterized route contract for a CMS page (issue #30). Mirrors a
94
+ * backend `page_routes` row. `path_pattern` uses Symfony route syntax
95
+ * (`/team/{record_id}`) and `requirements` maps each placeholder to a regex
96
+ * (`{ record_id: '\\d+' }`). Param names are snake_case and are NEVER remapped
97
+ * on export/import. Used by the admin page-routes editor and page export/import.
98
+ */
99
+ export interface IPageRoute {
100
+ id?: number;
101
+ path_pattern: string;
102
+ requirements?: Record<string, string> | null;
103
+ is_canonical: boolean;
104
+ is_active: boolean;
105
+ priority: number;
106
+ }
107
+
81
108
  export interface IPageFieldTranslation {
82
109
  language_id: number;
83
110
  language_code: string;
@@ -498,5 +498,16 @@ export interface IShowUserInputStyle extends IBaseStyle {
498
498
  web_table_with_row_borders?: IContentField<string>;
499
499
  web_table_sticky_header?: IContentField<string>;
500
500
  web_table_caption_side?: IContentField<string>;
501
+ /**
502
+ * show-user-input rows, each keyed by the immutable data-column `field_key`
503
+ * (issue #56 v2). Header labels come from {@link field_labels}, not the keys.
504
+ */
501
505
  entries?: IShowUserInputEntry[];
506
+ /**
507
+ * Header map `field_key => display_name` for {@link entries} (issue #56 v2).
508
+ * Lets the table show the human column label while rows stay keyed by the
509
+ * stable `field_key`, so renaming a column relabels the header automatically.
510
+ * `fields_map` still overrides individual headers when set.
511
+ */
512
+ field_labels?: Record<string, string>;
502
513
  }