@selfhelp/shared 1.21.7 → 1.22.1
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 +19 -0
- package/dist/index.d.mts +23 -3
- package/dist/index.d.ts +23 -3
- package/dist/index.js +26 -0
- package/dist/index.mjs +23 -0
- package/dist/plugin-sdk/index.d.mts +1 -1
- package/dist/plugin-sdk/index.d.ts +1 -1
- package/dist/registry/index.d.mts +2 -2
- package/dist/registry/index.d.ts +2 -2
- package/dist/{styles.registry-ffw0MH3r.d.mts → styles.registry-Dl55-gWX.d.mts} +8 -0
- package/dist/{styles.registry-DX79oirw.d.ts → styles.registry-DylfiWW_.d.ts} +8 -0
- package/package.json +1 -1
- package/src/api/__tests__/rateLimit.test.ts +52 -0
- package/src/api/index.ts +1 -0
- package/src/api/rateLimit.ts +52 -0
- package/src/types/styles/auth.ts +6 -0
- package/src/types/styles/forms.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,25 @@ 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.22.1
|
|
14
|
+
|
|
15
|
+
- `IFileInputStyle.files_public?` — `'1'` makes the field's uploaded files
|
|
16
|
+
readable by anyone; off by default.
|
|
17
|
+
|
|
18
|
+
## v1.22.0
|
|
19
|
+
|
|
20
|
+
Additive auth rate-limit contract (pairs with the core login/2FA brute-force
|
|
21
|
+
limiter that answers `429` with `data.retry_after`).
|
|
22
|
+
|
|
23
|
+
- `ILoginStyle.alert_rate_limited?`, `ITwoFactorAuthStyle.alert_rate_limited?`
|
|
24
|
+
and `IResetPasswordStyle.alert_rate_limited?` — translatable CMS message shown
|
|
25
|
+
when sign-in or a password-reset request is rate-limited; `{minutes}` is
|
|
26
|
+
replaced with the remaining wait.
|
|
27
|
+
- `getRateLimitRetryAfter(error)` — seconds to wait for an axios-style 429
|
|
28
|
+
(`data.retry_after`, else the `Retry-After` header), `null` otherwise.
|
|
29
|
+
- `formatRateLimitMessage(template, seconds)` + `DEFAULT_RATE_LIMIT_MESSAGE` —
|
|
30
|
+
fills `{minutes}` (rounded up, at least 1) so web and mobile render the same text.
|
|
31
|
+
|
|
13
32
|
## v1.21.7
|
|
14
33
|
|
|
15
34
|
Additive page-content contract for the unreleased wave (pairs with core
|
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-
|
|
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 IEntryRecordFormStyle, V as IEntryRecordStyle, W as IEntryTableEntry, X as IEntryTableStyle, Y as IFieldsetStyle, Z as IFigureStyle, $ as IFileInputStyle, a0 as IFlexStyle, a1 as IFormLogStyle, a2 as IFormRecordStyle, a3 as IFormStyle, a4 as IGridColumnStyle, a5 as IGridStyle, a6 as IGroupStyle, a7 as IHighlightStyle, a8 as IHtmlTagStyle, a9 as IImageStyle, aa as IIndicatorStyle, ab as IInputStyle, ac as IKbdStyle, ad as ILinkStyle, ae as IListItemStyle, af as IListStyle, ag as ILoginStyle, ah as ILoopStyle, ai as IMissingStyle, aj as INoAccessStyle, ak as INotFoundStyle, al as INotificationStyle, am as INumberInputStyle, an as IPaperStyle, a as IPluginStyleRegistryEntry, ao as IProfileStyle, ap as IProgressRootStyle, aq as IProgressSectionStyle, ar as IProgressStyle, as as IRadioStyle, at as IRangeSliderStyle, au as IRatingStyle, av as IRefContainerStyle, aw as IRegisterStyle, ax as IResetPasswordStyle, ay as IRichTextEditorStyle, az as IScrollAreaStyle, aA as ISegmentedControlStyle, aB as ISelectStyle, aC as ISimpleGridStyle, aD as ISliderStyle, aE as ISpaceStyle, aF as ISpoilerStyle, aG as IStackStyle, I as IStyleRegistryEntry, aH as IStyleWithSpacing, aI as ISwitchStyle, aJ as ITabStyle, aK as ITabsStyle, aL as ITextInputStyle, aM as ITextStyle, aN as ITextareaStyle, aO as IThemeIconStyle, aP as ITimelineItemStyle, aQ as ITimelineStyle, aR as ITitleStyle, aS as ITwoFactorAuthStyle, aT as ITypographyStyle, aU as IUnknownStyle, aV as IValidateStyle, aW as IVersionStyle, aX as IVideoStyle, S as STYLE_REGISTRY, c as TConcretePlatform, aY as TMantineAccordionChevronPosition, aZ as TMantineAccordionDisableChevronRotation, a_ as TMantineAccordionLoop, a$ as TMantineAccordionMultiple, b0 as TMantineAnchorUnderline, b1 as TMantineBorder, b2 as TMantineCardPadding, b3 as TMantineCardShadow, b4 as TMantineCols, b5 as TMantineDividerVariant, b6 as TMantineGap, b7 as TMantineGridOffset, b8 as TMantineGridOrder, b9 as TMantineHeight, ba as TMantineIconSize, bb as TMantineImageFit, bc as TMantineLineClamp, bd as TMantineListCenter, be as TMantineListStyleType, bf as TMantineListType, bg as TMantineListWithPadding, bh as TMantinePaperShadow, bi as TMantineProgressTransition, bj as TMantineScrollAreaSize, bk as TMantineScrollAreaType, bl as TMantineTextAlign, bm as TMantineTextDecoration, bn as TMantineTextFontStyle, bo as TMantineTextFontWeight, bp as TMantineTextInherit, bq as TMantineTextInputVariant, br as TMantineTextSpan, bs as TMantineTextTransform, bt as TMantineTextTruncate, bu as TMantineTextVariant, bv as TMantineTextareaAutosize, bw as TMantineTextareaResize, bx as TMantineTextareaVariant, by as TMantineTimelineAlign, bz as TMantineTitleLineClamp, bA as TMantineTitleTextWrap, bB as TMantineTranslatable, bC as TMantineUseInputWrapper, bD as TMantineWidth, bE as TSharedBorder, bF as TSharedCols, bG as TSharedDimension, bH as TSharedDividerLabelPosition, bI as TSharedDividerVariant, bJ as TSharedLabelPosition, bK 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-
|
|
1
|
+
import { T as TStyleName, j as IContentField, k as TMobileButtonFeedback, l as TMobileFieldVariant, m as TMobileSelectPresentation } from './styles.registry-Dl55-gWX.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 IEntryRecordFormStyle, V as IEntryRecordStyle, W as IEntryTableEntry, X as IEntryTableStyle, Y as IFieldsetStyle, Z as IFigureStyle, $ as IFileInputStyle, a0 as IFlexStyle, a1 as IFormLogStyle, a2 as IFormRecordStyle, a3 as IFormStyle, a4 as IGridColumnStyle, a5 as IGridStyle, a6 as IGroupStyle, a7 as IHighlightStyle, a8 as IHtmlTagStyle, a9 as IImageStyle, aa as IIndicatorStyle, ab as IInputStyle, ac as IKbdStyle, ad as ILinkStyle, ae as IListItemStyle, af as IListStyle, ag as ILoginStyle, ah as ILoopStyle, ai as IMissingStyle, aj as INoAccessStyle, ak as INotFoundStyle, al as INotificationStyle, am as INumberInputStyle, an as IPaperStyle, a as IPluginStyleRegistryEntry, ao as IProfileStyle, ap as IProgressRootStyle, aq as IProgressSectionStyle, ar as IProgressStyle, as as IRadioStyle, at as IRangeSliderStyle, au as IRatingStyle, av as IRefContainerStyle, aw as IRegisterStyle, ax as IResetPasswordStyle, ay as IRichTextEditorStyle, az as IScrollAreaStyle, aA as ISegmentedControlStyle, aB as ISelectStyle, aC as ISimpleGridStyle, aD as ISliderStyle, aE as ISpaceStyle, aF as ISpoilerStyle, aG as IStackStyle, I as IStyleRegistryEntry, aH as IStyleWithSpacing, aI as ISwitchStyle, aJ as ITabStyle, aK as ITabsStyle, aL as ITextInputStyle, aM as ITextStyle, aN as ITextareaStyle, aO as IThemeIconStyle, aP as ITimelineItemStyle, aQ as ITimelineStyle, aR as ITitleStyle, aS as ITwoFactorAuthStyle, aT as ITypographyStyle, aU as IUnknownStyle, aV as IValidateStyle, aW as IVersionStyle, aX as IVideoStyle, S as STYLE_REGISTRY, c as TConcretePlatform, aY as TMantineAccordionChevronPosition, aZ as TMantineAccordionDisableChevronRotation, a_ as TMantineAccordionLoop, a$ as TMantineAccordionMultiple, b0 as TMantineAnchorUnderline, b1 as TMantineBorder, b2 as TMantineCardPadding, b3 as TMantineCardShadow, b4 as TMantineCols, b5 as TMantineDividerVariant, b6 as TMantineGap, b7 as TMantineGridOffset, b8 as TMantineGridOrder, b9 as TMantineHeight, ba as TMantineIconSize, bb as TMantineImageFit, bc as TMantineLineClamp, bd as TMantineListCenter, be as TMantineListStyleType, bf as TMantineListType, bg as TMantineListWithPadding, bh as TMantinePaperShadow, bi as TMantineProgressTransition, bj as TMantineScrollAreaSize, bk as TMantineScrollAreaType, bl as TMantineTextAlign, bm as TMantineTextDecoration, bn as TMantineTextFontStyle, bo as TMantineTextFontWeight, bp as TMantineTextInherit, bq as TMantineTextInputVariant, br as TMantineTextSpan, bs as TMantineTextTransform, bt as TMantineTextTruncate, bu as TMantineTextVariant, bv as TMantineTextareaAutosize, bw as TMantineTextareaResize, bx as TMantineTextareaVariant, by as TMantineTimelineAlign, bz as TMantineTitleLineClamp, bA as TMantineTitleTextWrap, bB as TMantineTranslatable, bC as TMantineUseInputWrapper, bD as TMantineWidth, bE as TSharedBorder, bF as TSharedCols, bG as TSharedDimension, bH as TSharedDividerLabelPosition, bI as TSharedDividerVariant, bJ as TSharedLabelPosition, bK 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-Dl55-gWX.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';
|
|
@@ -1903,6 +1903,26 @@ declare function buildPagesResolvePath(params: IPagesResolveParams): string;
|
|
|
1903
1903
|
*/
|
|
1904
1904
|
declare function buildPagesResolveUrl(params: IPagesResolveParams): string;
|
|
1905
1905
|
|
|
1906
|
+
/**
|
|
1907
|
+
* Brute-force "too many attempts" handling shared by the web and mobile
|
|
1908
|
+
* login / two-factor-auth renderers, so both platforms read the backend 429
|
|
1909
|
+
* and render the CMS `alert_rate_limited` message identically.
|
|
1910
|
+
*/
|
|
1911
|
+
/** Used when the section has no `alert_rate_limited` content. */
|
|
1912
|
+
declare const DEFAULT_RATE_LIMIT_MESSAGE = "Too many failed attempts. Please try again in {minutes} min.";
|
|
1913
|
+
/**
|
|
1914
|
+
* Seconds to wait when `error` is a backend 429 from the auth rate limiter,
|
|
1915
|
+
* else `null`. Reads the envelope's `data.retry_after` first (the web BFF
|
|
1916
|
+
* drops the `Retry-After` header), then the header; `0` when neither is set.
|
|
1917
|
+
*/
|
|
1918
|
+
declare function getRateLimitRetryAfter(error: unknown): number | null;
|
|
1919
|
+
/**
|
|
1920
|
+
* The CMS message with `{minutes}` replaced by the remaining wait, rounded up
|
|
1921
|
+
* (at least 1). Falls back to {@link DEFAULT_RATE_LIMIT_MESSAGE} when the
|
|
1922
|
+
* template is empty.
|
|
1923
|
+
*/
|
|
1924
|
+
declare function formatRateLimitMessage(template: string | null | undefined, retryAfterSeconds: number): string;
|
|
1925
|
+
|
|
1906
1926
|
/**
|
|
1907
1927
|
* Mirrors the backend `PageDb::replace_calced_values()` regex:
|
|
1908
1928
|
*
|
|
@@ -2810,4 +2830,4 @@ declare function transformPageData(apiPage: IRawPage): IPageItem;
|
|
|
2810
2830
|
*/
|
|
2811
2831
|
declare function transformPagesData(pages: IRawPage[] | null | undefined): IPageItem[];
|
|
2812
2832
|
|
|
2813
|
-
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_WEB_FOOTER_PRESET, DEFAULT_WEB_HEADER_PRESET, type DatabaseMigrationMetadata, ENDPOINTS, FIELDS_MAP_STYLE_CONFIG, FORM_RECORD_PREFILL_SKIP_FIELDS, type FrontendRelease, HEADER_CLIENT_TYPE, type IApiError, type IApiMeta, type IAssetSource, type 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, type IFormDeleteRequest, type IFormDeleteResponse, type IFormRecordPrefill, type IFormRecordPrefillChild, type IFormRecordPrefillSection, type IFormRecordPrefillTranslatedValue, 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 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 IMeta, 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 IPageField, type IPageFieldTranslation, type IPageFieldsData, type IPageItem, 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 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, 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, type TCmsAppRole, type TFormRecordPrefillFieldValue, 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 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, arePreviewPreferencesEqual, buildConditionContext, buildPagesResolvePath, buildPagesResolveQuery, buildPagesResolveUrl, buildPublicPathFromRoute, clampMenuItemsAtDepth, classifyClass, classifyClassString, collectPageIdsFromMenuItems, evaluateCondition, expandedIdsForActiveTrail, findMenuItemByPageId, findNearestBottomTabMenuItemForPage, findPageRefInNavigationPayload, findRemap, flattenFooterItems, flattenFormRecordPrefillValues, flattenMenuItems, flattenNavigationMenuItems, footerColumnItems, footerGroupLinks, footerStandaloneItems, getNavigationItemAriaLabel, getNavigationItemHref, getNavigationItemKeyword, getNavigationItemLabel, getNavigationItemMobileHref, hasInlineFormatting, isBottomTabMenuItemActive, isDoubleWebHeaderPreset, isMenuItemActiveOnMobile, isMenuItemActiveOnWeb, isMobileIconName, isNavigationBundleVersionSupported, isOnAnyMobileMenu, isOnAnyMobileMenuFromPayload, isPageInMenuTree, isPageInResolvedMenus, isPageOnAnyMenu, isPageOnMobileMenu, isPageOnWebMenu, isPreviewBridgeMessage, isWebFooterPreset, isWebHeaderPreset, matchesMobilePath, matchesWebPath, mergeHeaderLayers, normalizePagesResolvePath, pageUrlToMobileRoute, parseFieldsMapCatalog, parseFieldsMapLabels, parseFormRecordPrefill, parseInlineRich, parseOptionCatalog, parseOptionCodes, parseOptionLabels, parseSpacing, 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, transformPageData, transformPagesData };
|
|
2833
|
+
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_RECORD_PREFILL_SKIP_FIELDS, type FrontendRelease, HEADER_CLIENT_TYPE, type IApiError, type IApiMeta, type IAssetSource, type 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, type IFormDeleteRequest, type IFormDeleteResponse, type IFormRecordPrefill, type IFormRecordPrefillChild, type IFormRecordPrefillSection, type IFormRecordPrefillTranslatedValue, 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 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 IMeta, 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 IPageField, type IPageFieldTranslation, type IPageFieldsData, type IPageItem, 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 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, 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, type TCmsAppRole, type TFormRecordPrefillFieldValue, 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 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, arePreviewPreferencesEqual, buildConditionContext, buildPagesResolvePath, buildPagesResolveQuery, buildPagesResolveUrl, buildPublicPathFromRoute, clampMenuItemsAtDepth, classifyClass, classifyClassString, collectPageIdsFromMenuItems, evaluateCondition, expandedIdsForActiveTrail, findMenuItemByPageId, findNearestBottomTabMenuItemForPage, findPageRefInNavigationPayload, findRemap, flattenFooterItems, flattenFormRecordPrefillValues, flattenMenuItems, flattenNavigationMenuItems, footerColumnItems, footerGroupLinks, footerStandaloneItems, formatRateLimitMessage, getNavigationItemAriaLabel, getNavigationItemHref, getNavigationItemKeyword, getNavigationItemLabel, getNavigationItemMobileHref, getRateLimitRetryAfter, hasInlineFormatting, isBottomTabMenuItemActive, isDoubleWebHeaderPreset, isMenuItemActiveOnMobile, isMenuItemActiveOnWeb, isMobileIconName, isNavigationBundleVersionSupported, isOnAnyMobileMenu, isOnAnyMobileMenuFromPayload, isPageInMenuTree, isPageInResolvedMenus, isPageOnAnyMenu, isPageOnMobileMenu, isPageOnWebMenu, isPreviewBridgeMessage, isWebFooterPreset, isWebHeaderPreset, matchesMobilePath, matchesWebPath, mergeHeaderLayers, normalizePagesResolvePath, pageUrlToMobileRoute, parseFieldsMapCatalog, parseFieldsMapLabels, parseFormRecordPrefill, parseInlineRich, parseOptionCatalog, parseOptionCodes, parseOptionLabels, parseSpacing, 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, 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-
|
|
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 IEntryRecordFormStyle, V as IEntryRecordStyle, W as IEntryTableEntry, X as IEntryTableStyle, Y as IFieldsetStyle, Z as IFigureStyle, $ as IFileInputStyle, a0 as IFlexStyle, a1 as IFormLogStyle, a2 as IFormRecordStyle, a3 as IFormStyle, a4 as IGridColumnStyle, a5 as IGridStyle, a6 as IGroupStyle, a7 as IHighlightStyle, a8 as IHtmlTagStyle, a9 as IImageStyle, aa as IIndicatorStyle, ab as IInputStyle, ac as IKbdStyle, ad as ILinkStyle, ae as IListItemStyle, af as IListStyle, ag as ILoginStyle, ah as ILoopStyle, ai as IMissingStyle, aj as INoAccessStyle, ak as INotFoundStyle, al as INotificationStyle, am as INumberInputStyle, an as IPaperStyle, a as IPluginStyleRegistryEntry, ao as IProfileStyle, ap as IProgressRootStyle, aq as IProgressSectionStyle, ar as IProgressStyle, as as IRadioStyle, at as IRangeSliderStyle, au as IRatingStyle, av as IRefContainerStyle, aw as IRegisterStyle, ax as IResetPasswordStyle, ay as IRichTextEditorStyle, az as IScrollAreaStyle, aA as ISegmentedControlStyle, aB as ISelectStyle, aC as ISimpleGridStyle, aD as ISliderStyle, aE as ISpaceStyle, aF as ISpoilerStyle, aG as IStackStyle, I as IStyleRegistryEntry, aH as IStyleWithSpacing, aI as ISwitchStyle, aJ as ITabStyle, aK as ITabsStyle, aL as ITextInputStyle, aM as ITextStyle, aN as ITextareaStyle, aO as IThemeIconStyle, aP as ITimelineItemStyle, aQ as ITimelineStyle, aR as ITitleStyle, aS as ITwoFactorAuthStyle, aT as ITypographyStyle, aU as IUnknownStyle, aV as IValidateStyle, aW as IVersionStyle, aX as IVideoStyle, S as STYLE_REGISTRY, c as TConcretePlatform, aY as TMantineAccordionChevronPosition, aZ as TMantineAccordionDisableChevronRotation, a_ as TMantineAccordionLoop, a$ as TMantineAccordionMultiple, b0 as TMantineAnchorUnderline, b1 as TMantineBorder, b2 as TMantineCardPadding, b3 as TMantineCardShadow, b4 as TMantineCols, b5 as TMantineDividerVariant, b6 as TMantineGap, b7 as TMantineGridOffset, b8 as TMantineGridOrder, b9 as TMantineHeight, ba as TMantineIconSize, bb as TMantineImageFit, bc as TMantineLineClamp, bd as TMantineListCenter, be as TMantineListStyleType, bf as TMantineListType, bg as TMantineListWithPadding, bh as TMantinePaperShadow, bi as TMantineProgressTransition, bj as TMantineScrollAreaSize, bk as TMantineScrollAreaType, bl as TMantineTextAlign, bm as TMantineTextDecoration, bn as TMantineTextFontStyle, bo as TMantineTextFontWeight, bp as TMantineTextInherit, bq as TMantineTextInputVariant, br as TMantineTextSpan, bs as TMantineTextTransform, bt as TMantineTextTruncate, bu as TMantineTextVariant, bv as TMantineTextareaAutosize, bw as TMantineTextareaResize, bx as TMantineTextareaVariant, by as TMantineTimelineAlign, bz as TMantineTitleLineClamp, bA as TMantineTitleTextWrap, bB as TMantineTranslatable, bC as TMantineUseInputWrapper, bD as TMantineWidth, bE as TSharedBorder, bF as TSharedCols, bG as TSharedDimension, bH as TSharedDividerLabelPosition, bI as TSharedDividerVariant, bJ as TSharedLabelPosition, bK 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-
|
|
1
|
+
import { T as TStyleName, j as IContentField, k as TMobileButtonFeedback, l as TMobileFieldVariant, m as TMobileSelectPresentation } from './styles.registry-DylfiWW_.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 IEntryRecordFormStyle, V as IEntryRecordStyle, W as IEntryTableEntry, X as IEntryTableStyle, Y as IFieldsetStyle, Z as IFigureStyle, $ as IFileInputStyle, a0 as IFlexStyle, a1 as IFormLogStyle, a2 as IFormRecordStyle, a3 as IFormStyle, a4 as IGridColumnStyle, a5 as IGridStyle, a6 as IGroupStyle, a7 as IHighlightStyle, a8 as IHtmlTagStyle, a9 as IImageStyle, aa as IIndicatorStyle, ab as IInputStyle, ac as IKbdStyle, ad as ILinkStyle, ae as IListItemStyle, af as IListStyle, ag as ILoginStyle, ah as ILoopStyle, ai as IMissingStyle, aj as INoAccessStyle, ak as INotFoundStyle, al as INotificationStyle, am as INumberInputStyle, an as IPaperStyle, a as IPluginStyleRegistryEntry, ao as IProfileStyle, ap as IProgressRootStyle, aq as IProgressSectionStyle, ar as IProgressStyle, as as IRadioStyle, at as IRangeSliderStyle, au as IRatingStyle, av as IRefContainerStyle, aw as IRegisterStyle, ax as IResetPasswordStyle, ay as IRichTextEditorStyle, az as IScrollAreaStyle, aA as ISegmentedControlStyle, aB as ISelectStyle, aC as ISimpleGridStyle, aD as ISliderStyle, aE as ISpaceStyle, aF as ISpoilerStyle, aG as IStackStyle, I as IStyleRegistryEntry, aH as IStyleWithSpacing, aI as ISwitchStyle, aJ as ITabStyle, aK as ITabsStyle, aL as ITextInputStyle, aM as ITextStyle, aN as ITextareaStyle, aO as IThemeIconStyle, aP as ITimelineItemStyle, aQ as ITimelineStyle, aR as ITitleStyle, aS as ITwoFactorAuthStyle, aT as ITypographyStyle, aU as IUnknownStyle, aV as IValidateStyle, aW as IVersionStyle, aX as IVideoStyle, S as STYLE_REGISTRY, c as TConcretePlatform, aY as TMantineAccordionChevronPosition, aZ as TMantineAccordionDisableChevronRotation, a_ as TMantineAccordionLoop, a$ as TMantineAccordionMultiple, b0 as TMantineAnchorUnderline, b1 as TMantineBorder, b2 as TMantineCardPadding, b3 as TMantineCardShadow, b4 as TMantineCols, b5 as TMantineDividerVariant, b6 as TMantineGap, b7 as TMantineGridOffset, b8 as TMantineGridOrder, b9 as TMantineHeight, ba as TMantineIconSize, bb as TMantineImageFit, bc as TMantineLineClamp, bd as TMantineListCenter, be as TMantineListStyleType, bf as TMantineListType, bg as TMantineListWithPadding, bh as TMantinePaperShadow, bi as TMantineProgressTransition, bj as TMantineScrollAreaSize, bk as TMantineScrollAreaType, bl as TMantineTextAlign, bm as TMantineTextDecoration, bn as TMantineTextFontStyle, bo as TMantineTextFontWeight, bp as TMantineTextInherit, bq as TMantineTextInputVariant, br as TMantineTextSpan, bs as TMantineTextTransform, bt as TMantineTextTruncate, bu as TMantineTextVariant, bv as TMantineTextareaAutosize, bw as TMantineTextareaResize, bx as TMantineTextareaVariant, by as TMantineTimelineAlign, bz as TMantineTitleLineClamp, bA as TMantineTitleTextWrap, bB as TMantineTranslatable, bC as TMantineUseInputWrapper, bD as TMantineWidth, bE as TSharedBorder, bF as TSharedCols, bG as TSharedDimension, bH as TSharedDividerLabelPosition, bI as TSharedDividerVariant, bJ as TSharedLabelPosition, bK 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-DylfiWW_.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';
|
|
@@ -1903,6 +1903,26 @@ declare function buildPagesResolvePath(params: IPagesResolveParams): string;
|
|
|
1903
1903
|
*/
|
|
1904
1904
|
declare function buildPagesResolveUrl(params: IPagesResolveParams): string;
|
|
1905
1905
|
|
|
1906
|
+
/**
|
|
1907
|
+
* Brute-force "too many attempts" handling shared by the web and mobile
|
|
1908
|
+
* login / two-factor-auth renderers, so both platforms read the backend 429
|
|
1909
|
+
* and render the CMS `alert_rate_limited` message identically.
|
|
1910
|
+
*/
|
|
1911
|
+
/** Used when the section has no `alert_rate_limited` content. */
|
|
1912
|
+
declare const DEFAULT_RATE_LIMIT_MESSAGE = "Too many failed attempts. Please try again in {minutes} min.";
|
|
1913
|
+
/**
|
|
1914
|
+
* Seconds to wait when `error` is a backend 429 from the auth rate limiter,
|
|
1915
|
+
* else `null`. Reads the envelope's `data.retry_after` first (the web BFF
|
|
1916
|
+
* drops the `Retry-After` header), then the header; `0` when neither is set.
|
|
1917
|
+
*/
|
|
1918
|
+
declare function getRateLimitRetryAfter(error: unknown): number | null;
|
|
1919
|
+
/**
|
|
1920
|
+
* The CMS message with `{minutes}` replaced by the remaining wait, rounded up
|
|
1921
|
+
* (at least 1). Falls back to {@link DEFAULT_RATE_LIMIT_MESSAGE} when the
|
|
1922
|
+
* template is empty.
|
|
1923
|
+
*/
|
|
1924
|
+
declare function formatRateLimitMessage(template: string | null | undefined, retryAfterSeconds: number): string;
|
|
1925
|
+
|
|
1906
1926
|
/**
|
|
1907
1927
|
* Mirrors the backend `PageDb::replace_calced_values()` regex:
|
|
1908
1928
|
*
|
|
@@ -2810,4 +2830,4 @@ declare function transformPageData(apiPage: IRawPage): IPageItem;
|
|
|
2810
2830
|
*/
|
|
2811
2831
|
declare function transformPagesData(pages: IRawPage[] | null | undefined): IPageItem[];
|
|
2812
2832
|
|
|
2813
|
-
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_WEB_FOOTER_PRESET, DEFAULT_WEB_HEADER_PRESET, type DatabaseMigrationMetadata, ENDPOINTS, FIELDS_MAP_STYLE_CONFIG, FORM_RECORD_PREFILL_SKIP_FIELDS, type FrontendRelease, HEADER_CLIENT_TYPE, type IApiError, type IApiMeta, type IAssetSource, type 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, type IFormDeleteRequest, type IFormDeleteResponse, type IFormRecordPrefill, type IFormRecordPrefillChild, type IFormRecordPrefillSection, type IFormRecordPrefillTranslatedValue, 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 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 IMeta, 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 IPageField, type IPageFieldTranslation, type IPageFieldsData, type IPageItem, 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 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, 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, type TCmsAppRole, type TFormRecordPrefillFieldValue, 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 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, arePreviewPreferencesEqual, buildConditionContext, buildPagesResolvePath, buildPagesResolveQuery, buildPagesResolveUrl, buildPublicPathFromRoute, clampMenuItemsAtDepth, classifyClass, classifyClassString, collectPageIdsFromMenuItems, evaluateCondition, expandedIdsForActiveTrail, findMenuItemByPageId, findNearestBottomTabMenuItemForPage, findPageRefInNavigationPayload, findRemap, flattenFooterItems, flattenFormRecordPrefillValues, flattenMenuItems, flattenNavigationMenuItems, footerColumnItems, footerGroupLinks, footerStandaloneItems, getNavigationItemAriaLabel, getNavigationItemHref, getNavigationItemKeyword, getNavigationItemLabel, getNavigationItemMobileHref, hasInlineFormatting, isBottomTabMenuItemActive, isDoubleWebHeaderPreset, isMenuItemActiveOnMobile, isMenuItemActiveOnWeb, isMobileIconName, isNavigationBundleVersionSupported, isOnAnyMobileMenu, isOnAnyMobileMenuFromPayload, isPageInMenuTree, isPageInResolvedMenus, isPageOnAnyMenu, isPageOnMobileMenu, isPageOnWebMenu, isPreviewBridgeMessage, isWebFooterPreset, isWebHeaderPreset, matchesMobilePath, matchesWebPath, mergeHeaderLayers, normalizePagesResolvePath, pageUrlToMobileRoute, parseFieldsMapCatalog, parseFieldsMapLabels, parseFormRecordPrefill, parseInlineRich, parseOptionCatalog, parseOptionCodes, parseOptionLabels, parseSpacing, 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, transformPageData, transformPagesData };
|
|
2833
|
+
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_RECORD_PREFILL_SKIP_FIELDS, type FrontendRelease, HEADER_CLIENT_TYPE, type IApiError, type IApiMeta, type IAssetSource, type 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, type IFormDeleteRequest, type IFormDeleteResponse, type IFormRecordPrefill, type IFormRecordPrefillChild, type IFormRecordPrefillSection, type IFormRecordPrefillTranslatedValue, 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 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 IMeta, 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 IPageField, type IPageFieldTranslation, type IPageFieldsData, type IPageItem, 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 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, 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, type TCmsAppRole, type TFormRecordPrefillFieldValue, 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 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, arePreviewPreferencesEqual, buildConditionContext, buildPagesResolvePath, buildPagesResolveQuery, buildPagesResolveUrl, buildPublicPathFromRoute, clampMenuItemsAtDepth, classifyClass, classifyClassString, collectPageIdsFromMenuItems, evaluateCondition, expandedIdsForActiveTrail, findMenuItemByPageId, findNearestBottomTabMenuItemForPage, findPageRefInNavigationPayload, findRemap, flattenFooterItems, flattenFormRecordPrefillValues, flattenMenuItems, flattenNavigationMenuItems, footerColumnItems, footerGroupLinks, footerStandaloneItems, formatRateLimitMessage, getNavigationItemAriaLabel, getNavigationItemHref, getNavigationItemKeyword, getNavigationItemLabel, getNavigationItemMobileHref, getRateLimitRetryAfter, hasInlineFormatting, isBottomTabMenuItemActive, isDoubleWebHeaderPreset, isMenuItemActiveOnMobile, isMenuItemActiveOnWeb, isMobileIconName, isNavigationBundleVersionSupported, isOnAnyMobileMenu, isOnAnyMobileMenuFromPayload, isPageInMenuTree, isPageInResolvedMenus, isPageOnAnyMenu, isPageOnMobileMenu, isPageOnWebMenu, isPreviewBridgeMessage, isWebFooterPreset, isWebHeaderPreset, matchesMobilePath, matchesWebPath, mergeHeaderLayers, normalizePagesResolvePath, pageUrlToMobileRoute, parseFieldsMapCatalog, parseFieldsMapLabels, parseFormRecordPrefill, parseInlineRich, parseOptionCatalog, parseOptionCodes, parseOptionLabels, parseSpacing, 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, transformPageData, transformPagesData };
|
package/dist/index.js
CHANGED
|
@@ -44,6 +44,7 @@ __export(index_exports, {
|
|
|
44
44
|
COLOR_SCALES: () => COLOR_SCALES,
|
|
45
45
|
CONTAINER_SIZE_PX: () => CONTAINER_SIZE_PX,
|
|
46
46
|
DEFAULT_MOBILE_ICON: () => DEFAULT_MOBILE_ICON,
|
|
47
|
+
DEFAULT_RATE_LIMIT_MESSAGE: () => DEFAULT_RATE_LIMIT_MESSAGE,
|
|
47
48
|
DEFAULT_WEB_FOOTER_PRESET: () => DEFAULT_WEB_FOOTER_PRESET,
|
|
48
49
|
DEFAULT_WEB_HEADER_PRESET: () => DEFAULT_WEB_HEADER_PRESET,
|
|
49
50
|
ENDPOINTS: () => ENDPOINTS,
|
|
@@ -104,6 +105,7 @@ __export(index_exports, {
|
|
|
104
105
|
footerColumnItems: () => footerColumnItems,
|
|
105
106
|
footerGroupLinks: () => footerGroupLinks,
|
|
106
107
|
footerStandaloneItems: () => footerStandaloneItems,
|
|
108
|
+
formatRateLimitMessage: () => formatRateLimitMessage,
|
|
107
109
|
getMergedStyleRegistry: () => getMergedStyleRegistry,
|
|
108
110
|
getNavigationItemAriaLabel: () => getNavigationItemAriaLabel,
|
|
109
111
|
getNavigationItemHref: () => getNavigationItemHref,
|
|
@@ -111,6 +113,7 @@ __export(index_exports, {
|
|
|
111
113
|
getNavigationItemLabel: () => getNavigationItemLabel,
|
|
112
114
|
getNavigationItemMobileHref: () => getNavigationItemMobileHref,
|
|
113
115
|
getPluginStyleRegistry: () => getPluginStyleRegistry,
|
|
116
|
+
getRateLimitRetryAfter: () => getRateLimitRetryAfter,
|
|
114
117
|
getRegistryEntry: () => getRegistryEntry,
|
|
115
118
|
getRegistryEntryAny: () => getRegistryEntryAny,
|
|
116
119
|
getStylePlacement: () => getStylePlacement,
|
|
@@ -689,6 +692,26 @@ function buildPagesResolveUrl(params) {
|
|
|
689
692
|
return `${API_VERSION_PREFIX}${buildPagesResolvePath(params)}`;
|
|
690
693
|
}
|
|
691
694
|
|
|
695
|
+
// src/api/rateLimit.ts
|
|
696
|
+
var DEFAULT_RATE_LIMIT_MESSAGE = "Too many failed attempts. Please try again in {minutes} min.";
|
|
697
|
+
function getRateLimitRetryAfter(error) {
|
|
698
|
+
const response = error?.response;
|
|
699
|
+
if (response?.status !== 429) {
|
|
700
|
+
return null;
|
|
701
|
+
}
|
|
702
|
+
const fromBody = response.data?.data?.retry_after;
|
|
703
|
+
if (typeof fromBody === "number" && fromBody > 0) {
|
|
704
|
+
return fromBody;
|
|
705
|
+
}
|
|
706
|
+
const fromHeader = Number(response.headers?.["retry-after"]);
|
|
707
|
+
return Number.isFinite(fromHeader) && fromHeader > 0 ? fromHeader : 0;
|
|
708
|
+
}
|
|
709
|
+
function formatRateLimitMessage(template, retryAfterSeconds) {
|
|
710
|
+
const text = template?.trim() ? template : DEFAULT_RATE_LIMIT_MESSAGE;
|
|
711
|
+
const minutes = Math.max(1, Math.ceil(retryAfterSeconds / 60));
|
|
712
|
+
return text.split("{minutes}").join(String(minutes));
|
|
713
|
+
}
|
|
714
|
+
|
|
692
715
|
// src/theme/tokens.ts
|
|
693
716
|
var FONT_SIZE_PX = {
|
|
694
717
|
xs: 12,
|
|
@@ -2811,6 +2834,7 @@ function transformPagesData(pages) {
|
|
|
2811
2834
|
COLOR_SCALES,
|
|
2812
2835
|
CONTAINER_SIZE_PX,
|
|
2813
2836
|
DEFAULT_MOBILE_ICON,
|
|
2837
|
+
DEFAULT_RATE_LIMIT_MESSAGE,
|
|
2814
2838
|
DEFAULT_WEB_FOOTER_PRESET,
|
|
2815
2839
|
DEFAULT_WEB_HEADER_PRESET,
|
|
2816
2840
|
ENDPOINTS,
|
|
@@ -2871,6 +2895,7 @@ function transformPagesData(pages) {
|
|
|
2871
2895
|
footerColumnItems,
|
|
2872
2896
|
footerGroupLinks,
|
|
2873
2897
|
footerStandaloneItems,
|
|
2898
|
+
formatRateLimitMessage,
|
|
2874
2899
|
getMergedStyleRegistry,
|
|
2875
2900
|
getNavigationItemAriaLabel,
|
|
2876
2901
|
getNavigationItemHref,
|
|
@@ -2878,6 +2903,7 @@ function transformPagesData(pages) {
|
|
|
2878
2903
|
getNavigationItemLabel,
|
|
2879
2904
|
getNavigationItemMobileHref,
|
|
2880
2905
|
getPluginStyleRegistry,
|
|
2906
|
+
getRateLimitRetryAfter,
|
|
2881
2907
|
getRegistryEntry,
|
|
2882
2908
|
getRegistryEntryAny,
|
|
2883
2909
|
getStylePlacement,
|
package/dist/index.mjs
CHANGED
|
@@ -473,6 +473,26 @@ function buildPagesResolveUrl(params) {
|
|
|
473
473
|
return `${API_VERSION_PREFIX}${buildPagesResolvePath(params)}`;
|
|
474
474
|
}
|
|
475
475
|
|
|
476
|
+
// src/api/rateLimit.ts
|
|
477
|
+
var DEFAULT_RATE_LIMIT_MESSAGE = "Too many failed attempts. Please try again in {minutes} min.";
|
|
478
|
+
function getRateLimitRetryAfter(error) {
|
|
479
|
+
const response = error?.response;
|
|
480
|
+
if (response?.status !== 429) {
|
|
481
|
+
return null;
|
|
482
|
+
}
|
|
483
|
+
const fromBody = response.data?.data?.retry_after;
|
|
484
|
+
if (typeof fromBody === "number" && fromBody > 0) {
|
|
485
|
+
return fromBody;
|
|
486
|
+
}
|
|
487
|
+
const fromHeader = Number(response.headers?.["retry-after"]);
|
|
488
|
+
return Number.isFinite(fromHeader) && fromHeader > 0 ? fromHeader : 0;
|
|
489
|
+
}
|
|
490
|
+
function formatRateLimitMessage(template, retryAfterSeconds) {
|
|
491
|
+
const text = template?.trim() ? template : DEFAULT_RATE_LIMIT_MESSAGE;
|
|
492
|
+
const minutes = Math.max(1, Math.ceil(retryAfterSeconds / 60));
|
|
493
|
+
return text.split("{minutes}").join(String(minutes));
|
|
494
|
+
}
|
|
495
|
+
|
|
476
496
|
// src/theme/tokens.ts
|
|
477
497
|
var FONT_SIZE_PX = {
|
|
478
498
|
xs: 12,
|
|
@@ -2594,6 +2614,7 @@ export {
|
|
|
2594
2614
|
COLOR_SCALES,
|
|
2595
2615
|
CONTAINER_SIZE_PX,
|
|
2596
2616
|
DEFAULT_MOBILE_ICON,
|
|
2617
|
+
DEFAULT_RATE_LIMIT_MESSAGE,
|
|
2597
2618
|
DEFAULT_WEB_FOOTER_PRESET,
|
|
2598
2619
|
DEFAULT_WEB_HEADER_PRESET,
|
|
2599
2620
|
ENDPOINTS,
|
|
@@ -2654,6 +2675,7 @@ export {
|
|
|
2654
2675
|
footerColumnItems,
|
|
2655
2676
|
footerGroupLinks,
|
|
2656
2677
|
footerStandaloneItems,
|
|
2678
|
+
formatRateLimitMessage,
|
|
2657
2679
|
getMergedStyleRegistry,
|
|
2658
2680
|
getNavigationItemAriaLabel,
|
|
2659
2681
|
getNavigationItemHref,
|
|
@@ -2661,6 +2683,7 @@ export {
|
|
|
2661
2683
|
getNavigationItemLabel,
|
|
2662
2684
|
getNavigationItemMobileHref,
|
|
2663
2685
|
getPluginStyleRegistry,
|
|
2686
|
+
getRateLimitRetryAfter,
|
|
2664
2687
|
getRegistryEntry,
|
|
2665
2688
|
getRegistryEntryAny,
|
|
2666
2689
|
getStylePlacement,
|
|
@@ -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-
|
|
2
|
+
import { I as IStyleRegistryEntry } from '../styles.registry-Dl55-gWX.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-
|
|
2
|
+
import { I as IStyleRegistryEntry } from '../styles.registry-DylfiWW_.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-
|
|
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-
|
|
1
|
+
import { T as TStyleName, I as IStyleRegistryEntry, a as IPluginStyleRegistryEntry, b as TStylePlacement, c as TConcretePlatform, d as TStylePlatform } from '../styles.registry-Dl55-gWX.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-Dl55-gWX.mjs';
|
|
3
3
|
import '../common-qaDIAYS3.mjs';
|
|
4
4
|
|
|
5
5
|
/**
|
package/dist/registry/index.d.ts
CHANGED
|
@@ -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-
|
|
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-
|
|
1
|
+
import { T as TStyleName, I as IStyleRegistryEntry, a as IPluginStyleRegistryEntry, b as TStylePlacement, c as TConcretePlatform, d as TStylePlatform } from '../styles.registry-DylfiWW_.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-DylfiWW_.js';
|
|
3
3
|
import '../common-qaDIAYS3.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -14,6 +14,8 @@ interface ILoginStyle extends IStyleWithSpacing {
|
|
|
14
14
|
color?: IContentField<TMantineColor>;
|
|
15
15
|
/** Label of the link that opens the registration page. */
|
|
16
16
|
label_register?: IContentField<string>;
|
|
17
|
+
/** Shown on a 429 from the login rate limiter; `{minutes}` = remaining wait. */
|
|
18
|
+
alert_rate_limited?: IContentField<string>;
|
|
17
19
|
}
|
|
18
20
|
interface IRegisterStyle extends IStyleWithSpacing {
|
|
19
21
|
style_name: 'register';
|
|
@@ -81,6 +83,8 @@ interface IResetPasswordStyle extends IStyleWithSpacing {
|
|
|
81
83
|
style_name: 'reset-password';
|
|
82
84
|
/** Submit/link-button colour (cross-platform, via the shared mapper). */
|
|
83
85
|
color?: IContentField<TMantineColor>;
|
|
86
|
+
/** Shown on a 429 from the password-recovery limiter; `{minutes}` = remaining wait. */
|
|
87
|
+
alert_rate_limited?: IContentField<string>;
|
|
84
88
|
label_pw_reset?: IContentField<string>;
|
|
85
89
|
alert_success?: IContentField<string>;
|
|
86
90
|
placeholder?: IContentField<string>;
|
|
@@ -105,6 +109,8 @@ interface ITwoFactorAuthStyle extends IStyleWithSpacing {
|
|
|
105
109
|
title?: IContentField<string>;
|
|
106
110
|
text_md?: IContentField<string>;
|
|
107
111
|
label_expiration_2fa?: IContentField<string>;
|
|
112
|
+
/** Shown on a 429 from the 2FA rate limiter; `{minutes}` = remaining wait. */
|
|
113
|
+
alert_rate_limited?: IContentField<string>;
|
|
108
114
|
}
|
|
109
115
|
interface IProfileStyle extends IStyleWithSpacing {
|
|
110
116
|
style_name: 'profile';
|
|
@@ -1029,6 +1035,8 @@ interface IFileInputStyle extends IStyleWithSpacing {
|
|
|
1029
1035
|
placeholder?: IContentField<string>;
|
|
1030
1036
|
disabled?: IContentField<string>;
|
|
1031
1037
|
is_required?: IContentField<string>;
|
|
1038
|
+
/** '1' = uploaded files are readable by anyone; default private (core 0.1.43). */
|
|
1039
|
+
files_public?: IContentField<string>;
|
|
1032
1040
|
name?: IContentField<string>;
|
|
1033
1041
|
label?: IContentField<string>;
|
|
1034
1042
|
description?: IContentField<string>;
|
|
@@ -14,6 +14,8 @@ interface ILoginStyle extends IStyleWithSpacing {
|
|
|
14
14
|
color?: IContentField<TMantineColor>;
|
|
15
15
|
/** Label of the link that opens the registration page. */
|
|
16
16
|
label_register?: IContentField<string>;
|
|
17
|
+
/** Shown on a 429 from the login rate limiter; `{minutes}` = remaining wait. */
|
|
18
|
+
alert_rate_limited?: IContentField<string>;
|
|
17
19
|
}
|
|
18
20
|
interface IRegisterStyle extends IStyleWithSpacing {
|
|
19
21
|
style_name: 'register';
|
|
@@ -81,6 +83,8 @@ interface IResetPasswordStyle extends IStyleWithSpacing {
|
|
|
81
83
|
style_name: 'reset-password';
|
|
82
84
|
/** Submit/link-button colour (cross-platform, via the shared mapper). */
|
|
83
85
|
color?: IContentField<TMantineColor>;
|
|
86
|
+
/** Shown on a 429 from the password-recovery limiter; `{minutes}` = remaining wait. */
|
|
87
|
+
alert_rate_limited?: IContentField<string>;
|
|
84
88
|
label_pw_reset?: IContentField<string>;
|
|
85
89
|
alert_success?: IContentField<string>;
|
|
86
90
|
placeholder?: IContentField<string>;
|
|
@@ -105,6 +109,8 @@ interface ITwoFactorAuthStyle extends IStyleWithSpacing {
|
|
|
105
109
|
title?: IContentField<string>;
|
|
106
110
|
text_md?: IContentField<string>;
|
|
107
111
|
label_expiration_2fa?: IContentField<string>;
|
|
112
|
+
/** Shown on a 429 from the 2FA rate limiter; `{minutes}` = remaining wait. */
|
|
113
|
+
alert_rate_limited?: IContentField<string>;
|
|
108
114
|
}
|
|
109
115
|
interface IProfileStyle extends IStyleWithSpacing {
|
|
110
116
|
style_name: 'profile';
|
|
@@ -1029,6 +1035,8 @@ interface IFileInputStyle extends IStyleWithSpacing {
|
|
|
1029
1035
|
placeholder?: IContentField<string>;
|
|
1030
1036
|
disabled?: IContentField<string>;
|
|
1031
1037
|
is_required?: IContentField<string>;
|
|
1038
|
+
/** '1' = uploaded files are readable by anyone; default private (core 0.1.43). */
|
|
1039
|
+
files_public?: IContentField<string>;
|
|
1032
1040
|
name?: IContentField<string>;
|
|
1033
1041
|
label?: IContentField<string>;
|
|
1034
1042
|
description?: IContentField<string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@selfhelp/shared",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.22.1",
|
|
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,52 @@
|
|
|
1
|
+
/*
|
|
2
|
+
SPDX-FileCopyrightText: 2026 Humdek, University of Bern
|
|
3
|
+
SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { describe, expect, it } from 'vitest';
|
|
6
|
+
import { DEFAULT_RATE_LIMIT_MESSAGE, formatRateLimitMessage, getRateLimitRetryAfter } from '../rateLimit';
|
|
7
|
+
|
|
8
|
+
const rateLimited = (data: unknown, headers: Record<string, unknown> = {}) => ({
|
|
9
|
+
response: { status: 429, data, headers },
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
describe('getRateLimitRetryAfter', () => {
|
|
13
|
+
it('reads the wait from the 429 envelope', () => {
|
|
14
|
+
expect(getRateLimitRetryAfter(rateLimited({ data: { retry_after: 896 } }))).toBe(896);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('falls back to the Retry-After header when the body has no wait (mobile hits the backend directly)', () => {
|
|
18
|
+
expect(getRateLimitRetryAfter(rateLimited({ data: null }, { 'retry-after': '120' }))).toBe(120);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('still reports a rate limit with an unknown wait', () => {
|
|
22
|
+
expect(getRateLimitRetryAfter(rateLimited(null))).toBe(0);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('ignores every error that is not a 429', () => {
|
|
26
|
+
expect(getRateLimitRetryAfter({ response: { status: 401, data: {} } })).toBeNull();
|
|
27
|
+
expect(getRateLimitRetryAfter(new Error('Network Error'))).toBeNull();
|
|
28
|
+
expect(getRateLimitRetryAfter(undefined)).toBeNull();
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
describe('formatRateLimitMessage', () => {
|
|
33
|
+
it('fills the CMS text with the wait in minutes, rounded up', () => {
|
|
34
|
+
expect(formatRateLimitMessage('Bitte in {minutes} Min. erneut versuchen.', 896)).toBe(
|
|
35
|
+
'Bitte in 15 Min. erneut versuchen.',
|
|
36
|
+
);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('never shows zero minutes', () => {
|
|
40
|
+
expect(formatRateLimitMessage('Wait {minutes} min', 0)).toBe('Wait 1 min');
|
|
41
|
+
expect(formatRateLimitMessage('Wait {minutes} min', 30)).toBe('Wait 1 min');
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('uses the default message when the section has no content', () => {
|
|
45
|
+
expect(formatRateLimitMessage('', 120)).toBe(DEFAULT_RATE_LIMIT_MESSAGE.replace('{minutes}', '2'));
|
|
46
|
+
expect(formatRateLimitMessage(undefined, 120)).toBe(DEFAULT_RATE_LIMIT_MESSAGE.replace('{minutes}', '2'));
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('keeps text without a placeholder unchanged', () => {
|
|
50
|
+
expect(formatRateLimitMessage('Please try again later.', 600)).toBe('Please try again later.');
|
|
51
|
+
});
|
|
52
|
+
});
|
package/src/api/index.ts
CHANGED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*
|
|
2
|
+
SPDX-FileCopyrightText: 2026 Humdek, University of Bern
|
|
3
|
+
SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Brute-force "too many attempts" handling shared by the web and mobile
|
|
8
|
+
* login / two-factor-auth renderers, so both platforms read the backend 429
|
|
9
|
+
* and render the CMS `alert_rate_limited` message identically.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/** Used when the section has no `alert_rate_limited` content. */
|
|
13
|
+
export const DEFAULT_RATE_LIMIT_MESSAGE = 'Too many failed attempts. Please try again in {minutes} min.';
|
|
14
|
+
|
|
15
|
+
interface IRateLimitErrorShape {
|
|
16
|
+
response?: {
|
|
17
|
+
status?: number;
|
|
18
|
+
headers?: Record<string, unknown>;
|
|
19
|
+
data?: { data?: { retry_after?: unknown } | null } | null;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Seconds to wait when `error` is a backend 429 from the auth rate limiter,
|
|
25
|
+
* else `null`. Reads the envelope's `data.retry_after` first (the web BFF
|
|
26
|
+
* drops the `Retry-After` header), then the header; `0` when neither is set.
|
|
27
|
+
*/
|
|
28
|
+
export function getRateLimitRetryAfter(error: unknown): number | null {
|
|
29
|
+
const response = (error as IRateLimitErrorShape | null | undefined)?.response;
|
|
30
|
+
if (response?.status !== 429) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const fromBody = response.data?.data?.retry_after;
|
|
35
|
+
if (typeof fromBody === 'number' && fromBody > 0) {
|
|
36
|
+
return fromBody;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const fromHeader = Number(response.headers?.['retry-after']);
|
|
40
|
+
return Number.isFinite(fromHeader) && fromHeader > 0 ? fromHeader : 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The CMS message with `{minutes}` replaced by the remaining wait, rounded up
|
|
45
|
+
* (at least 1). Falls back to {@link DEFAULT_RATE_LIMIT_MESSAGE} when the
|
|
46
|
+
* template is empty.
|
|
47
|
+
*/
|
|
48
|
+
export function formatRateLimitMessage(template: string | null | undefined, retryAfterSeconds: number): string {
|
|
49
|
+
const text = template?.trim() ? template : DEFAULT_RATE_LIMIT_MESSAGE;
|
|
50
|
+
const minutes = Math.max(1, Math.ceil(retryAfterSeconds / 60));
|
|
51
|
+
return text.split('{minutes}').join(String(minutes));
|
|
52
|
+
}
|
package/src/types/styles/auth.ts
CHANGED
|
@@ -19,6 +19,8 @@ export interface ILoginStyle extends IStyleWithSpacing {
|
|
|
19
19
|
color?: IContentField<TMantineColor>;
|
|
20
20
|
/** Label of the link that opens the registration page. */
|
|
21
21
|
label_register?: IContentField<string>;
|
|
22
|
+
/** Shown on a 429 from the login rate limiter; `{minutes}` = remaining wait. */
|
|
23
|
+
alert_rate_limited?: IContentField<string>;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
export interface IRegisterStyle extends IStyleWithSpacing {
|
|
@@ -92,6 +94,8 @@ export interface IResetPasswordStyle extends IStyleWithSpacing {
|
|
|
92
94
|
style_name: 'reset-password';
|
|
93
95
|
/** Submit/link-button colour (cross-platform, via the shared mapper). */
|
|
94
96
|
color?: IContentField<TMantineColor>;
|
|
97
|
+
/** Shown on a 429 from the password-recovery limiter; `{minutes}` = remaining wait. */
|
|
98
|
+
alert_rate_limited?: IContentField<string>;
|
|
95
99
|
label_pw_reset?: IContentField<string>;
|
|
96
100
|
alert_success?: IContentField<string>;
|
|
97
101
|
placeholder?: IContentField<string>; reset_title?: IContentField<string>;
|
|
@@ -116,6 +120,8 @@ export interface ITwoFactorAuthStyle extends IStyleWithSpacing {
|
|
|
116
120
|
title?: IContentField<string>;
|
|
117
121
|
text_md?: IContentField<string>;
|
|
118
122
|
label_expiration_2fa?: IContentField<string>;
|
|
123
|
+
/** Shown on a 429 from the 2FA rate limiter; `{minutes}` = remaining wait. */
|
|
124
|
+
alert_rate_limited?: IContentField<string>;
|
|
119
125
|
}
|
|
120
126
|
|
|
121
127
|
export interface IProfileStyle extends IStyleWithSpacing {
|
|
@@ -412,6 +412,8 @@ export interface IFileInputStyle extends IStyleWithSpacing {
|
|
|
412
412
|
web_right_icon?: IContentField<string>;
|
|
413
413
|
placeholder?: IContentField<string>;
|
|
414
414
|
disabled?: IContentField<string>; is_required?: IContentField<string>;
|
|
415
|
+
/** '1' = uploaded files are readable by anyone; default private (core 0.1.43). */
|
|
416
|
+
files_public?: IContentField<string>;
|
|
415
417
|
name?: IContentField<string>;
|
|
416
418
|
label?: IContentField<string>;
|
|
417
419
|
description?: IContentField<string>;
|