@selfhelp/shared 1.2.4 → 1.3.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 +31 -0
- package/dist/index.d.mts +27 -3
- package/dist/index.d.ts +27 -3
- package/dist/index.js +2 -0
- package/dist/index.mjs +2 -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-AO_5OpNC.d.mts → styles.registry-0MsmyRmF.d.mts} +12 -2
- package/dist/{styles.registry-eE7TbLsk.d.ts → styles.registry-CtpsJ4gS.d.ts} +12 -2
- package/package.json +1 -1
- package/src/api/__tests__/endpoints.test.ts +45 -0
- package/src/api/endpoints.ts +2 -0
- package/src/types/api/auth.ts +22 -0
- package/src/types/styles/auth.ts +21 -11
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,37 @@ All notable changes to `@selfhelp/shared` will be documented in this file.
|
|
|
9
9
|
|
|
10
10
|
This project follows semantic versioning.
|
|
11
11
|
|
|
12
|
+
## [1.3.0]
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- `ENDPOINTS.AUTH.FORGOT_PASSWORD` (`/cms-api/v1/auth/forgot-password`) and
|
|
17
|
+
`ENDPOINTS.AUTH.RESET_PASSWORD` (`/cms-api/v1/auth/reset-password`) so the
|
|
18
|
+
password-recovery flow is part of the shared API contract (issue #31). The
|
|
19
|
+
web frontend and the mobile app now build these requests from shared
|
|
20
|
+
constants instead of local/ad-hoc paths.
|
|
21
|
+
- Request DTOs `IForgotPasswordRequest` and `IResetPasswordRequest`, and
|
|
22
|
+
response types `IForgotPasswordResponse` / `IResetPasswordResponse`,
|
|
23
|
+
mirroring the backend `requests/auth/forgot_password.json` and
|
|
24
|
+
`reset_password.json` schemas. `scripts/check-schema-parity.mjs` now covers
|
|
25
|
+
these request schemas.
|
|
26
|
+
|
|
27
|
+
## [1.2.5]
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
|
|
31
|
+
- `IResetPasswordStyle` now models the full two-step reset flow instead of
|
|
32
|
+
just the "request a recovery mail" screen. Added optional CMS fields for
|
|
33
|
+
the set-password mode: `reset_title`, `reset_label_pw`,
|
|
34
|
+
`reset_pw_placeholder`, `reset_label_pw_confirm`,
|
|
35
|
+
`reset_pw_confirm_placeholder`, `reset_label_submit`,
|
|
36
|
+
`reset_success_title`, `reset_alert_success`, `reset_redirect_text`,
|
|
37
|
+
`reset_error_invalid_token`, `reset_error_pw_short`, and
|
|
38
|
+
`reset_error_pw_mismatch`.
|
|
39
|
+
- Removed the stale legacy `text_md` and `email_user` fields from
|
|
40
|
+
`IResetPasswordStyle` so the shared contract matches the backend
|
|
41
|
+
`resetPassword` style schema.
|
|
42
|
+
|
|
12
43
|
## [1.2.4] - 2026-06-05
|
|
13
44
|
|
|
14
45
|
### Added
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TStyleName, f as IContentField } from './styles.registry-
|
|
2
|
-
export { B as BASE_STYLE_REGISTRY, h as IAccordionItemStyle, i as IAccordionStyle, j as IActionIconStyle, k as IAlertStyle, l as IAspectRatioStyle, m as IAudioStyle, n as IAvatarStyle, o as IBackgroundImageStyle, p as IBadgeStyle, q as IBaseStyle, r as IBlockquoteStyle, s as IBoxStyle, t as IButtonStyle, u as ICardSegmentStyle, v as ICardStyle, w as ICarouselStyle, x as ICenterStyle, y as ICheckboxStyle, z as IChipStyle, A as ICodeStyle, C as IColorInputStyle, D as IColorPickerStyle, E as IComboboxStyle, F as IContainerStyle, G as IDatePickerStyle, H as IDividerStyle, J as IEntryListStyle, K as IEntryRecordDeleteStyle, L as IEntryRecordStyle, M as IFieldsetStyle, N as IFigureStyle, O as IFileInputStyle, P as IFlexStyle, Q as IFormLogStyle, R as IFormRecordStyle, U as IFormStyle, V as IGridColumnStyle, W as IGridStyle, X as IGroupStyle, Y as IHighlightStyle, Z as IHtmlTagStyle, $ as IImageStyle, a0 as IIndicatorStyle, a1 as IInputStyle, a2 as IKbdStyle, a3 as ILinkStyle, a4 as IListItemStyle, a5 as IListStyle, a6 as ILoginStyle, a7 as ILoopStyle, a8 as INotificationStyle, a9 as INumberInputStyle, aa as IPaperStyle, a as IPluginStyleRegistryEntry, ab as IProfileStyle, ac as IProgressRootStyle, ad as IProgressSectionStyle, ae as IProgressStyle, af as IRadioStyle, ag as IRangeSliderStyle, ah as IRatingStyle, ai as IRegisterStyle, aj as IResetPasswordStyle, ak as IRichTextEditorStyle, al as IScrollAreaStyle, am as ISegmentedControlStyle, an as ISelectStyle, ao as ISimpleGridStyle, ap as ISliderStyle, aq as ISpaceStyle, ar as ISpoilerStyle, as as IStackStyle, I as IStyleRegistryEntry, at as IStyleWithSpacing, au as ISwitchStyle, av as ITabStyle, aw as ITabsStyle, ax as ITextInputStyle, ay as ITextStyle, az as ITextareaStyle, aA as IThemeIconStyle, aB as ITimelineStyle, aC as ITitleStyle, aD as ITwoFactorAuthStyle, aE as ITypographyStyle, aF as IUnknownStyle, aG as IValidateStyle, aH as IVideoStyle, S as STYLE_REGISTRY, aI as TMantineAccordionChevronPosition, aJ as TMantineAccordionDisableChevronRotation, aK as TMantineAccordionLoop, aL as TMantineAccordionMultiple, aM as TMantineBorder, aN as TMantineCardShadow, aO as TMantineCheckboxLabelPosition, aP as TMantineCols, aQ as TMantineDividerVariant, aR as TMantineGap, aS as TMantineGridOffset, aT as TMantineGridOrder, aU as TMantineHeight, aV as TMantineIconSize, aW as TMantineImageFit, aX as TMantineLineClamp, aY as TMantineListCenter, aZ as TMantineListStyleType, a_ as TMantineListType, a$ as TMantineListWithPadding, b0 as TMantinePaperShadow, b1 as TMantineProgressTransition, b2 as TMantineScrollAreaSize, b3 as TMantineScrollAreaType, b4 as TMantineTextAlign, b5 as TMantineTextDecoration, b6 as TMantineTextFontStyle, b7 as TMantineTextFontWeight, b8 as TMantineTextInherit, b9 as TMantineTextInputVariant, ba as TMantineTextSpan, bb as TMantineTextTransform, bc as TMantineTextTruncate, bd as TMantineTextVariant, be as TMantineTextareaAutosize, bf as TMantineTextareaResize, bg as TMantineTextareaVariant, bh as TMantineTimelineAlign, bi as TMantineTitleLineClamp, bj as TMantineTitleTextWrap, bk as TMantineTranslatable, bl as TMantineUseInputWrapper, bm as TMantineWidth, bn as TStyle, b as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, c as _resetPluginStyleRegistry, e as extendStyleRegistry, g as getMergedStyleRegistry, d as getPluginStyleRegistry } from './styles.registry-
|
|
1
|
+
import { T as TStyleName, f as IContentField } from './styles.registry-0MsmyRmF.mjs';
|
|
2
|
+
export { B as BASE_STYLE_REGISTRY, h as IAccordionItemStyle, i as IAccordionStyle, j as IActionIconStyle, k as IAlertStyle, l as IAspectRatioStyle, m as IAudioStyle, n as IAvatarStyle, o as IBackgroundImageStyle, p as IBadgeStyle, q as IBaseStyle, r as IBlockquoteStyle, s as IBoxStyle, t as IButtonStyle, u as ICardSegmentStyle, v as ICardStyle, w as ICarouselStyle, x as ICenterStyle, y as ICheckboxStyle, z as IChipStyle, A as ICodeStyle, C as IColorInputStyle, D as IColorPickerStyle, E as IComboboxStyle, F as IContainerStyle, G as IDatePickerStyle, H as IDividerStyle, J as IEntryListStyle, K as IEntryRecordDeleteStyle, L as IEntryRecordStyle, M as IFieldsetStyle, N as IFigureStyle, O as IFileInputStyle, P as IFlexStyle, Q as IFormLogStyle, R as IFormRecordStyle, U as IFormStyle, V as IGridColumnStyle, W as IGridStyle, X as IGroupStyle, Y as IHighlightStyle, Z as IHtmlTagStyle, $ as IImageStyle, a0 as IIndicatorStyle, a1 as IInputStyle, a2 as IKbdStyle, a3 as ILinkStyle, a4 as IListItemStyle, a5 as IListStyle, a6 as ILoginStyle, a7 as ILoopStyle, a8 as INotificationStyle, a9 as INumberInputStyle, aa as IPaperStyle, a as IPluginStyleRegistryEntry, ab as IProfileStyle, ac as IProgressRootStyle, ad as IProgressSectionStyle, ae as IProgressStyle, af as IRadioStyle, ag as IRangeSliderStyle, ah as IRatingStyle, ai as IRegisterStyle, aj as IResetPasswordStyle, ak as IRichTextEditorStyle, al as IScrollAreaStyle, am as ISegmentedControlStyle, an as ISelectStyle, ao as ISimpleGridStyle, ap as ISliderStyle, aq as ISpaceStyle, ar as ISpoilerStyle, as as IStackStyle, I as IStyleRegistryEntry, at as IStyleWithSpacing, au as ISwitchStyle, av as ITabStyle, aw as ITabsStyle, ax as ITextInputStyle, ay as ITextStyle, az as ITextareaStyle, aA as IThemeIconStyle, aB as ITimelineStyle, aC as ITitleStyle, aD as ITwoFactorAuthStyle, aE as ITypographyStyle, aF as IUnknownStyle, aG as IValidateStyle, aH as IVideoStyle, S as STYLE_REGISTRY, aI as TMantineAccordionChevronPosition, aJ as TMantineAccordionDisableChevronRotation, aK as TMantineAccordionLoop, aL as TMantineAccordionMultiple, aM as TMantineBorder, aN as TMantineCardShadow, aO as TMantineCheckboxLabelPosition, aP as TMantineCols, aQ as TMantineDividerVariant, aR as TMantineGap, aS as TMantineGridOffset, aT as TMantineGridOrder, aU as TMantineHeight, aV as TMantineIconSize, aW as TMantineImageFit, aX as TMantineLineClamp, aY as TMantineListCenter, aZ as TMantineListStyleType, a_ as TMantineListType, a$ as TMantineListWithPadding, b0 as TMantinePaperShadow, b1 as TMantineProgressTransition, b2 as TMantineScrollAreaSize, b3 as TMantineScrollAreaType, b4 as TMantineTextAlign, b5 as TMantineTextDecoration, b6 as TMantineTextFontStyle, b7 as TMantineTextFontWeight, b8 as TMantineTextInherit, b9 as TMantineTextInputVariant, ba as TMantineTextSpan, bb as TMantineTextTransform, bc as TMantineTextTruncate, bd as TMantineTextVariant, be as TMantineTextareaAutosize, bf as TMantineTextareaResize, bg as TMantineTextareaVariant, bh as TMantineTimelineAlign, bi as TMantineTitleLineClamp, bj as TMantineTitleTextWrap, bk as TMantineTranslatable, bl as TMantineUseInputWrapper, bm as TMantineWidth, bn as TStyle, b as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, c as _resetPluginStyleRegistry, e as extendStyleRegistry, g as getMergedStyleRegistry, d as getPluginStyleRegistry } from './styles.registry-0MsmyRmF.mjs';
|
|
3
3
|
export { s as TMantineAccordionVariant, v as TMantineActionIconLoading, d as TMantineAlign, w as TMantineAllowNextClicks, x as TMantineAllowStepClick, y as TMantineAspectRatio, z as TMantineAutoContrast, o as TMantineAvatarVariant, n as TMantineBadgeVariant, A as TMantineBlock, B as TMantineCenterInline, C as TMantineChecked, D as TMantineChipChecked, E as TMantineChipMultiple, p as TMantineChipVariant, F as TMantineClampBehavior, G as TMantineCodeBlock, i as TMantineColor, H as TMantineColorFormat, I as TMantineColorInputSwatches, J as TMantineColorPickerSwatches, K as TMantineColorPickerSwatchesPerRow, L as TMantineCompact, M as TMantineContainerFluid, e as TMantineDirection, N as TMantineDisabled, k as TMantineFieldsetVariant, O as TMantineFileAccept, P as TMantineFileInputMultiple, Q as TMantineFluid, R as TMantineFullWidth, S as TMantineGridGrow, U as TMantineGridOverflow, g as TMantineGridSpan, V as TMantineGroupGrow, W as TMantineGroupWrap, X as TMantineGrow, Y as TMantineHighlight, q as TMantineIndicatorPosition, Z as TMantineInline, _ as TMantineIsLink, c as TMantineJustify, $ as TMantineKbdSize, a0 as TMantineLoading, a1 as TMantineMultiple, a2 as TMantineNotificationWithCloseButton, a3 as TMantineNumberInputDecimalScale, a4 as TMantineOpenInNewTab, h as TMantineOrientation, a5 as TMantineProcessing, T as TMantineRadius, a6 as TMantineRangeSliderMarks, a7 as TMantineRatingCount, a8 as TMantineRatingFractions, a9 as TMantineRatingReadonly, aa as TMantineReadonly, a as TMantineSize, ab as TMantineSpaceHorizontal, b as TMantineSpacing, l as TMantineSpoilerMaxHeight, ac as TMantineSwatches, ad as TMantineTabDisabled, t as TMantineTabsVariant, r as TMantineThemeIconVariant, u as TMantineTimelineLineVariant, j as TMantineTitleOrder, ae as TMantineUseMantineStyle, m as TMantineVariant, af as TMantineWithCloseButton, ag as TMantineWithIcon, f as TMantineWrap } from './common-B96dASgu.mjs';
|
|
4
4
|
export { TAnyStyleName, TPluginStyleImplMap, TStyleImplMap, getRegistryEntry, getRegistryEntryAny, getStylePluginId, isKnownStyleName, isRegisteredStyleName } from './registry/index.mjs';
|
|
5
5
|
export { COLOR_PALETTE, COLOR_SCALES, CONTAINER_SIZE_PX, FONT_SIZE_PX, ISpacingResolved, LINE_HEIGHT, RADIUS_PX, SPACING_PX, SPACING_TO_TAILWIND, TCanonicalColor, TCanonicalRadius, TCanonicalSpacing, colorToHex, radiusToPx, sizeToFontPx, spacingToPx } from './theme/index.mjs';
|
|
@@ -244,6 +244,16 @@ interface ITwoFactorVerifyRequest {
|
|
|
244
244
|
interface IRefreshRequest {
|
|
245
245
|
refresh_token: string;
|
|
246
246
|
}
|
|
247
|
+
/** POST /auth/forgot-password — request a recovery email. */
|
|
248
|
+
interface IForgotPasswordRequest {
|
|
249
|
+
email: string;
|
|
250
|
+
}
|
|
251
|
+
/** POST /auth/reset-password — set a new password from the one-time token. */
|
|
252
|
+
interface IResetPasswordRequest {
|
|
253
|
+
id_users: number;
|
|
254
|
+
token: string;
|
|
255
|
+
password: string;
|
|
256
|
+
}
|
|
247
257
|
interface ILoginSuccessData {
|
|
248
258
|
access_token: string;
|
|
249
259
|
refresh_token: string;
|
|
@@ -268,6 +278,18 @@ type ILanguagePreferenceUpdateResponse = IBaseApiResponse<{
|
|
|
268
278
|
access_token?: string;
|
|
269
279
|
language_id: number;
|
|
270
280
|
}>;
|
|
281
|
+
/**
|
|
282
|
+
* Generic success for the forgot-password request. The backend always returns
|
|
283
|
+
* `requested: true` regardless of whether the email matched an account, so the
|
|
284
|
+
* endpoint cannot be used to enumerate registered users.
|
|
285
|
+
*/
|
|
286
|
+
type IForgotPasswordResponse = IBaseApiResponse<{
|
|
287
|
+
requested: boolean;
|
|
288
|
+
}>;
|
|
289
|
+
/** Success when the recovery token was valid and the password was changed. */
|
|
290
|
+
type IResetPasswordResponse = IBaseApiResponse<{
|
|
291
|
+
reset: boolean;
|
|
292
|
+
}>;
|
|
271
293
|
|
|
272
294
|
interface IFormSubmitRequest {
|
|
273
295
|
section_id: number;
|
|
@@ -358,6 +380,8 @@ declare const ENDPOINTS: {
|
|
|
358
380
|
readonly TWO_FACTOR_VERIFY: "/cms-api/v1/auth/two-factor-verify";
|
|
359
381
|
readonly LOGOUT: "/cms-api/v1/auth/logout";
|
|
360
382
|
readonly REFRESH: "/cms-api/v1/auth/refresh-token";
|
|
383
|
+
readonly FORGOT_PASSWORD: "/cms-api/v1/auth/forgot-password";
|
|
384
|
+
readonly RESET_PASSWORD: "/cms-api/v1/auth/reset-password";
|
|
361
385
|
readonly SET_LANGUAGE: "/cms-api/v1/auth/set-language";
|
|
362
386
|
readonly USER_DATA: "/cms-api/v1/auth/user-data";
|
|
363
387
|
readonly EVENTS: "/cms-api/v1/auth/events";
|
|
@@ -640,4 +664,4 @@ declare function transformPageData(apiPage: IRawPage): IPageItem;
|
|
|
640
664
|
*/
|
|
641
665
|
declare function transformPagesData(pages: IRawPage[] | null | undefined): IPageItem[];
|
|
642
666
|
|
|
643
|
-
export { API_VERSION_PREFIX, CLASS_PATTERNS, CLASS_REMAP, CLIENT_TYPE_MOBILE, CLIENT_TYPE_MOBILE_AND_WEB, CLIENT_TYPE_WEB, COLOR_NAMES, ENDPOINTS, HEADER_CLIENT_TYPE, type IApiError, type IApiMeta, type IAssetSource, type IBaseApiResponse, type IBasePageInfo, type IBasePageSection, type IClassPattern, type IClassRemap, type IConditionContext, IContentField, type IEvaluatedCondition, type IFormDeleteRequest, type IFormDeleteResponse, type IFormResultLegacyFields, type IFormSubmitData, type IFormSubmitRequest, type IFormSubmitResponse, type IFormUpdateData, type IFormUpdateRequest, type IFormUpdateResponse, type IGetPageResponse, type IGetPagesResponse, type IJwtPayload, type ILanguage, type ILanguageItem, type ILanguagePreference, type ILanguagePreferenceUpdateResponse, type ILanguagesResponse, type ILoginRequest, type ILoginSuccessData, type ILoginSuccessResponse, type ILogoutSuccessResponse, type IMeta, type IPageAccessTypeInfo, type IPageContent, type IPageField, type IPageFieldTranslation, type IPageFieldsData, type IPageItem, type IPageSectionWithFields, type IPageSectionsData, type IRefreshRequest, type IRefreshSuccessResponse, type ISpacingValue, type ITwoFactorRequiredData, type ITwoFactorRequiredResponse, type ITwoFactorVerifyRequest, type ITwoFactorVerifySuccessResponse, type IUserData, type IUserDataResponse, LITERAL_CLASSES, PERMISSIONS, SIZE_VALUES, SPACING_VALUES, type TCalcedValues, type TClassDecision, type TClientType, type TPermission, type TPlatform, TStyleName, buildConditionContext, classifyClass, classifyClassString, evaluateCondition, findRemap, parseSpacing, replaceCalcedValues, resolveAssetSources, resolveAssetUrl, spacingToClasses, transformPageData, transformPagesData };
|
|
667
|
+
export { API_VERSION_PREFIX, CLASS_PATTERNS, CLASS_REMAP, CLIENT_TYPE_MOBILE, CLIENT_TYPE_MOBILE_AND_WEB, CLIENT_TYPE_WEB, COLOR_NAMES, ENDPOINTS, HEADER_CLIENT_TYPE, type IApiError, type IApiMeta, type IAssetSource, type IBaseApiResponse, type IBasePageInfo, type IBasePageSection, type IClassPattern, type IClassRemap, 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 IGetPageResponse, type IGetPagesResponse, type IJwtPayload, type ILanguage, type ILanguageItem, type ILanguagePreference, type ILanguagePreferenceUpdateResponse, type ILanguagesResponse, type ILoginRequest, type ILoginSuccessData, type ILoginSuccessResponse, type ILogoutSuccessResponse, type IMeta, type IPageAccessTypeInfo, type IPageContent, type IPageField, type IPageFieldTranslation, type IPageFieldsData, type IPageItem, type IPageSectionWithFields, type IPageSectionsData, type IRefreshRequest, type IRefreshSuccessResponse, type IResetPasswordRequest, type IResetPasswordResponse, type ISpacingValue, type ITwoFactorRequiredData, type ITwoFactorRequiredResponse, type ITwoFactorVerifyRequest, type ITwoFactorVerifySuccessResponse, type IUserData, type IUserDataResponse, LITERAL_CLASSES, PERMISSIONS, SIZE_VALUES, SPACING_VALUES, type TCalcedValues, type TClassDecision, type TClientType, type TPermission, type TPlatform, TStyleName, buildConditionContext, classifyClass, classifyClassString, evaluateCondition, findRemap, parseSpacing, replaceCalcedValues, resolveAssetSources, resolveAssetUrl, spacingToClasses, transformPageData, transformPagesData };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TStyleName, f as IContentField } from './styles.registry-
|
|
2
|
-
export { B as BASE_STYLE_REGISTRY, h as IAccordionItemStyle, i as IAccordionStyle, j as IActionIconStyle, k as IAlertStyle, l as IAspectRatioStyle, m as IAudioStyle, n as IAvatarStyle, o as IBackgroundImageStyle, p as IBadgeStyle, q as IBaseStyle, r as IBlockquoteStyle, s as IBoxStyle, t as IButtonStyle, u as ICardSegmentStyle, v as ICardStyle, w as ICarouselStyle, x as ICenterStyle, y as ICheckboxStyle, z as IChipStyle, A as ICodeStyle, C as IColorInputStyle, D as IColorPickerStyle, E as IComboboxStyle, F as IContainerStyle, G as IDatePickerStyle, H as IDividerStyle, J as IEntryListStyle, K as IEntryRecordDeleteStyle, L as IEntryRecordStyle, M as IFieldsetStyle, N as IFigureStyle, O as IFileInputStyle, P as IFlexStyle, Q as IFormLogStyle, R as IFormRecordStyle, U as IFormStyle, V as IGridColumnStyle, W as IGridStyle, X as IGroupStyle, Y as IHighlightStyle, Z as IHtmlTagStyle, $ as IImageStyle, a0 as IIndicatorStyle, a1 as IInputStyle, a2 as IKbdStyle, a3 as ILinkStyle, a4 as IListItemStyle, a5 as IListStyle, a6 as ILoginStyle, a7 as ILoopStyle, a8 as INotificationStyle, a9 as INumberInputStyle, aa as IPaperStyle, a as IPluginStyleRegistryEntry, ab as IProfileStyle, ac as IProgressRootStyle, ad as IProgressSectionStyle, ae as IProgressStyle, af as IRadioStyle, ag as IRangeSliderStyle, ah as IRatingStyle, ai as IRegisterStyle, aj as IResetPasswordStyle, ak as IRichTextEditorStyle, al as IScrollAreaStyle, am as ISegmentedControlStyle, an as ISelectStyle, ao as ISimpleGridStyle, ap as ISliderStyle, aq as ISpaceStyle, ar as ISpoilerStyle, as as IStackStyle, I as IStyleRegistryEntry, at as IStyleWithSpacing, au as ISwitchStyle, av as ITabStyle, aw as ITabsStyle, ax as ITextInputStyle, ay as ITextStyle, az as ITextareaStyle, aA as IThemeIconStyle, aB as ITimelineStyle, aC as ITitleStyle, aD as ITwoFactorAuthStyle, aE as ITypographyStyle, aF as IUnknownStyle, aG as IValidateStyle, aH as IVideoStyle, S as STYLE_REGISTRY, aI as TMantineAccordionChevronPosition, aJ as TMantineAccordionDisableChevronRotation, aK as TMantineAccordionLoop, aL as TMantineAccordionMultiple, aM as TMantineBorder, aN as TMantineCardShadow, aO as TMantineCheckboxLabelPosition, aP as TMantineCols, aQ as TMantineDividerVariant, aR as TMantineGap, aS as TMantineGridOffset, aT as TMantineGridOrder, aU as TMantineHeight, aV as TMantineIconSize, aW as TMantineImageFit, aX as TMantineLineClamp, aY as TMantineListCenter, aZ as TMantineListStyleType, a_ as TMantineListType, a$ as TMantineListWithPadding, b0 as TMantinePaperShadow, b1 as TMantineProgressTransition, b2 as TMantineScrollAreaSize, b3 as TMantineScrollAreaType, b4 as TMantineTextAlign, b5 as TMantineTextDecoration, b6 as TMantineTextFontStyle, b7 as TMantineTextFontWeight, b8 as TMantineTextInherit, b9 as TMantineTextInputVariant, ba as TMantineTextSpan, bb as TMantineTextTransform, bc as TMantineTextTruncate, bd as TMantineTextVariant, be as TMantineTextareaAutosize, bf as TMantineTextareaResize, bg as TMantineTextareaVariant, bh as TMantineTimelineAlign, bi as TMantineTitleLineClamp, bj as TMantineTitleTextWrap, bk as TMantineTranslatable, bl as TMantineUseInputWrapper, bm as TMantineWidth, bn as TStyle, b as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, c as _resetPluginStyleRegistry, e as extendStyleRegistry, g as getMergedStyleRegistry, d as getPluginStyleRegistry } from './styles.registry-
|
|
1
|
+
import { T as TStyleName, f as IContentField } from './styles.registry-CtpsJ4gS.js';
|
|
2
|
+
export { B as BASE_STYLE_REGISTRY, h as IAccordionItemStyle, i as IAccordionStyle, j as IActionIconStyle, k as IAlertStyle, l as IAspectRatioStyle, m as IAudioStyle, n as IAvatarStyle, o as IBackgroundImageStyle, p as IBadgeStyle, q as IBaseStyle, r as IBlockquoteStyle, s as IBoxStyle, t as IButtonStyle, u as ICardSegmentStyle, v as ICardStyle, w as ICarouselStyle, x as ICenterStyle, y as ICheckboxStyle, z as IChipStyle, A as ICodeStyle, C as IColorInputStyle, D as IColorPickerStyle, E as IComboboxStyle, F as IContainerStyle, G as IDatePickerStyle, H as IDividerStyle, J as IEntryListStyle, K as IEntryRecordDeleteStyle, L as IEntryRecordStyle, M as IFieldsetStyle, N as IFigureStyle, O as IFileInputStyle, P as IFlexStyle, Q as IFormLogStyle, R as IFormRecordStyle, U as IFormStyle, V as IGridColumnStyle, W as IGridStyle, X as IGroupStyle, Y as IHighlightStyle, Z as IHtmlTagStyle, $ as IImageStyle, a0 as IIndicatorStyle, a1 as IInputStyle, a2 as IKbdStyle, a3 as ILinkStyle, a4 as IListItemStyle, a5 as IListStyle, a6 as ILoginStyle, a7 as ILoopStyle, a8 as INotificationStyle, a9 as INumberInputStyle, aa as IPaperStyle, a as IPluginStyleRegistryEntry, ab as IProfileStyle, ac as IProgressRootStyle, ad as IProgressSectionStyle, ae as IProgressStyle, af as IRadioStyle, ag as IRangeSliderStyle, ah as IRatingStyle, ai as IRegisterStyle, aj as IResetPasswordStyle, ak as IRichTextEditorStyle, al as IScrollAreaStyle, am as ISegmentedControlStyle, an as ISelectStyle, ao as ISimpleGridStyle, ap as ISliderStyle, aq as ISpaceStyle, ar as ISpoilerStyle, as as IStackStyle, I as IStyleRegistryEntry, at as IStyleWithSpacing, au as ISwitchStyle, av as ITabStyle, aw as ITabsStyle, ax as ITextInputStyle, ay as ITextStyle, az as ITextareaStyle, aA as IThemeIconStyle, aB as ITimelineStyle, aC as ITitleStyle, aD as ITwoFactorAuthStyle, aE as ITypographyStyle, aF as IUnknownStyle, aG as IValidateStyle, aH as IVideoStyle, S as STYLE_REGISTRY, aI as TMantineAccordionChevronPosition, aJ as TMantineAccordionDisableChevronRotation, aK as TMantineAccordionLoop, aL as TMantineAccordionMultiple, aM as TMantineBorder, aN as TMantineCardShadow, aO as TMantineCheckboxLabelPosition, aP as TMantineCols, aQ as TMantineDividerVariant, aR as TMantineGap, aS as TMantineGridOffset, aT as TMantineGridOrder, aU as TMantineHeight, aV as TMantineIconSize, aW as TMantineImageFit, aX as TMantineLineClamp, aY as TMantineListCenter, aZ as TMantineListStyleType, a_ as TMantineListType, a$ as TMantineListWithPadding, b0 as TMantinePaperShadow, b1 as TMantineProgressTransition, b2 as TMantineScrollAreaSize, b3 as TMantineScrollAreaType, b4 as TMantineTextAlign, b5 as TMantineTextDecoration, b6 as TMantineTextFontStyle, b7 as TMantineTextFontWeight, b8 as TMantineTextInherit, b9 as TMantineTextInputVariant, ba as TMantineTextSpan, bb as TMantineTextTransform, bc as TMantineTextTruncate, bd as TMantineTextVariant, be as TMantineTextareaAutosize, bf as TMantineTextareaResize, bg as TMantineTextareaVariant, bh as TMantineTimelineAlign, bi as TMantineTitleLineClamp, bj as TMantineTitleTextWrap, bk as TMantineTranslatable, bl as TMantineUseInputWrapper, bm as TMantineWidth, bn as TStyle, b as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, c as _resetPluginStyleRegistry, e as extendStyleRegistry, g as getMergedStyleRegistry, d as getPluginStyleRegistry } from './styles.registry-CtpsJ4gS.js';
|
|
3
3
|
export { s as TMantineAccordionVariant, v as TMantineActionIconLoading, d as TMantineAlign, w as TMantineAllowNextClicks, x as TMantineAllowStepClick, y as TMantineAspectRatio, z as TMantineAutoContrast, o as TMantineAvatarVariant, n as TMantineBadgeVariant, A as TMantineBlock, B as TMantineCenterInline, C as TMantineChecked, D as TMantineChipChecked, E as TMantineChipMultiple, p as TMantineChipVariant, F as TMantineClampBehavior, G as TMantineCodeBlock, i as TMantineColor, H as TMantineColorFormat, I as TMantineColorInputSwatches, J as TMantineColorPickerSwatches, K as TMantineColorPickerSwatchesPerRow, L as TMantineCompact, M as TMantineContainerFluid, e as TMantineDirection, N as TMantineDisabled, k as TMantineFieldsetVariant, O as TMantineFileAccept, P as TMantineFileInputMultiple, Q as TMantineFluid, R as TMantineFullWidth, S as TMantineGridGrow, U as TMantineGridOverflow, g as TMantineGridSpan, V as TMantineGroupGrow, W as TMantineGroupWrap, X as TMantineGrow, Y as TMantineHighlight, q as TMantineIndicatorPosition, Z as TMantineInline, _ as TMantineIsLink, c as TMantineJustify, $ as TMantineKbdSize, a0 as TMantineLoading, a1 as TMantineMultiple, a2 as TMantineNotificationWithCloseButton, a3 as TMantineNumberInputDecimalScale, a4 as TMantineOpenInNewTab, h as TMantineOrientation, a5 as TMantineProcessing, T as TMantineRadius, a6 as TMantineRangeSliderMarks, a7 as TMantineRatingCount, a8 as TMantineRatingFractions, a9 as TMantineRatingReadonly, aa as TMantineReadonly, a as TMantineSize, ab as TMantineSpaceHorizontal, b as TMantineSpacing, l as TMantineSpoilerMaxHeight, ac as TMantineSwatches, ad as TMantineTabDisabled, t as TMantineTabsVariant, r as TMantineThemeIconVariant, u as TMantineTimelineLineVariant, j as TMantineTitleOrder, ae as TMantineUseMantineStyle, m as TMantineVariant, af as TMantineWithCloseButton, ag as TMantineWithIcon, f as TMantineWrap } from './common-B96dASgu.js';
|
|
4
4
|
export { TAnyStyleName, TPluginStyleImplMap, TStyleImplMap, getRegistryEntry, getRegistryEntryAny, getStylePluginId, isKnownStyleName, isRegisteredStyleName } from './registry/index.js';
|
|
5
5
|
export { COLOR_PALETTE, COLOR_SCALES, CONTAINER_SIZE_PX, FONT_SIZE_PX, ISpacingResolved, LINE_HEIGHT, RADIUS_PX, SPACING_PX, SPACING_TO_TAILWIND, TCanonicalColor, TCanonicalRadius, TCanonicalSpacing, colorToHex, radiusToPx, sizeToFontPx, spacingToPx } from './theme/index.js';
|
|
@@ -244,6 +244,16 @@ interface ITwoFactorVerifyRequest {
|
|
|
244
244
|
interface IRefreshRequest {
|
|
245
245
|
refresh_token: string;
|
|
246
246
|
}
|
|
247
|
+
/** POST /auth/forgot-password — request a recovery email. */
|
|
248
|
+
interface IForgotPasswordRequest {
|
|
249
|
+
email: string;
|
|
250
|
+
}
|
|
251
|
+
/** POST /auth/reset-password — set a new password from the one-time token. */
|
|
252
|
+
interface IResetPasswordRequest {
|
|
253
|
+
id_users: number;
|
|
254
|
+
token: string;
|
|
255
|
+
password: string;
|
|
256
|
+
}
|
|
247
257
|
interface ILoginSuccessData {
|
|
248
258
|
access_token: string;
|
|
249
259
|
refresh_token: string;
|
|
@@ -268,6 +278,18 @@ type ILanguagePreferenceUpdateResponse = IBaseApiResponse<{
|
|
|
268
278
|
access_token?: string;
|
|
269
279
|
language_id: number;
|
|
270
280
|
}>;
|
|
281
|
+
/**
|
|
282
|
+
* Generic success for the forgot-password request. The backend always returns
|
|
283
|
+
* `requested: true` regardless of whether the email matched an account, so the
|
|
284
|
+
* endpoint cannot be used to enumerate registered users.
|
|
285
|
+
*/
|
|
286
|
+
type IForgotPasswordResponse = IBaseApiResponse<{
|
|
287
|
+
requested: boolean;
|
|
288
|
+
}>;
|
|
289
|
+
/** Success when the recovery token was valid and the password was changed. */
|
|
290
|
+
type IResetPasswordResponse = IBaseApiResponse<{
|
|
291
|
+
reset: boolean;
|
|
292
|
+
}>;
|
|
271
293
|
|
|
272
294
|
interface IFormSubmitRequest {
|
|
273
295
|
section_id: number;
|
|
@@ -358,6 +380,8 @@ declare const ENDPOINTS: {
|
|
|
358
380
|
readonly TWO_FACTOR_VERIFY: "/cms-api/v1/auth/two-factor-verify";
|
|
359
381
|
readonly LOGOUT: "/cms-api/v1/auth/logout";
|
|
360
382
|
readonly REFRESH: "/cms-api/v1/auth/refresh-token";
|
|
383
|
+
readonly FORGOT_PASSWORD: "/cms-api/v1/auth/forgot-password";
|
|
384
|
+
readonly RESET_PASSWORD: "/cms-api/v1/auth/reset-password";
|
|
361
385
|
readonly SET_LANGUAGE: "/cms-api/v1/auth/set-language";
|
|
362
386
|
readonly USER_DATA: "/cms-api/v1/auth/user-data";
|
|
363
387
|
readonly EVENTS: "/cms-api/v1/auth/events";
|
|
@@ -640,4 +664,4 @@ declare function transformPageData(apiPage: IRawPage): IPageItem;
|
|
|
640
664
|
*/
|
|
641
665
|
declare function transformPagesData(pages: IRawPage[] | null | undefined): IPageItem[];
|
|
642
666
|
|
|
643
|
-
export { API_VERSION_PREFIX, CLASS_PATTERNS, CLASS_REMAP, CLIENT_TYPE_MOBILE, CLIENT_TYPE_MOBILE_AND_WEB, CLIENT_TYPE_WEB, COLOR_NAMES, ENDPOINTS, HEADER_CLIENT_TYPE, type IApiError, type IApiMeta, type IAssetSource, type IBaseApiResponse, type IBasePageInfo, type IBasePageSection, type IClassPattern, type IClassRemap, type IConditionContext, IContentField, type IEvaluatedCondition, type IFormDeleteRequest, type IFormDeleteResponse, type IFormResultLegacyFields, type IFormSubmitData, type IFormSubmitRequest, type IFormSubmitResponse, type IFormUpdateData, type IFormUpdateRequest, type IFormUpdateResponse, type IGetPageResponse, type IGetPagesResponse, type IJwtPayload, type ILanguage, type ILanguageItem, type ILanguagePreference, type ILanguagePreferenceUpdateResponse, type ILanguagesResponse, type ILoginRequest, type ILoginSuccessData, type ILoginSuccessResponse, type ILogoutSuccessResponse, type IMeta, type IPageAccessTypeInfo, type IPageContent, type IPageField, type IPageFieldTranslation, type IPageFieldsData, type IPageItem, type IPageSectionWithFields, type IPageSectionsData, type IRefreshRequest, type IRefreshSuccessResponse, type ISpacingValue, type ITwoFactorRequiredData, type ITwoFactorRequiredResponse, type ITwoFactorVerifyRequest, type ITwoFactorVerifySuccessResponse, type IUserData, type IUserDataResponse, LITERAL_CLASSES, PERMISSIONS, SIZE_VALUES, SPACING_VALUES, type TCalcedValues, type TClassDecision, type TClientType, type TPermission, type TPlatform, TStyleName, buildConditionContext, classifyClass, classifyClassString, evaluateCondition, findRemap, parseSpacing, replaceCalcedValues, resolveAssetSources, resolveAssetUrl, spacingToClasses, transformPageData, transformPagesData };
|
|
667
|
+
export { API_VERSION_PREFIX, CLASS_PATTERNS, CLASS_REMAP, CLIENT_TYPE_MOBILE, CLIENT_TYPE_MOBILE_AND_WEB, CLIENT_TYPE_WEB, COLOR_NAMES, ENDPOINTS, HEADER_CLIENT_TYPE, type IApiError, type IApiMeta, type IAssetSource, type IBaseApiResponse, type IBasePageInfo, type IBasePageSection, type IClassPattern, type IClassRemap, 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 IGetPageResponse, type IGetPagesResponse, type IJwtPayload, type ILanguage, type ILanguageItem, type ILanguagePreference, type ILanguagePreferenceUpdateResponse, type ILanguagesResponse, type ILoginRequest, type ILoginSuccessData, type ILoginSuccessResponse, type ILogoutSuccessResponse, type IMeta, type IPageAccessTypeInfo, type IPageContent, type IPageField, type IPageFieldTranslation, type IPageFieldsData, type IPageItem, type IPageSectionWithFields, type IPageSectionsData, type IRefreshRequest, type IRefreshSuccessResponse, type IResetPasswordRequest, type IResetPasswordResponse, type ISpacingValue, type ITwoFactorRequiredData, type ITwoFactorRequiredResponse, type ITwoFactorVerifyRequest, type ITwoFactorVerifySuccessResponse, type IUserData, type IUserDataResponse, LITERAL_CLASSES, PERMISSIONS, SIZE_VALUES, SPACING_VALUES, type TCalcedValues, type TClassDecision, type TClientType, type TPermission, type TPlatform, TStyleName, buildConditionContext, classifyClass, classifyClassString, evaluateCondition, findRemap, parseSpacing, replaceCalcedValues, resolveAssetSources, resolveAssetUrl, spacingToClasses, transformPageData, transformPagesData };
|
package/dist/index.js
CHANGED
|
@@ -317,6 +317,8 @@ var ENDPOINTS = {
|
|
|
317
317
|
TWO_FACTOR_VERIFY: `${API_VERSION_PREFIX}/auth/two-factor-verify`,
|
|
318
318
|
LOGOUT: `${API_VERSION_PREFIX}/auth/logout`,
|
|
319
319
|
REFRESH: `${API_VERSION_PREFIX}/auth/refresh-token`,
|
|
320
|
+
FORGOT_PASSWORD: `${API_VERSION_PREFIX}/auth/forgot-password`,
|
|
321
|
+
RESET_PASSWORD: `${API_VERSION_PREFIX}/auth/reset-password`,
|
|
320
322
|
SET_LANGUAGE: `${API_VERSION_PREFIX}/auth/set-language`,
|
|
321
323
|
USER_DATA: `${API_VERSION_PREFIX}/auth/user-data`,
|
|
322
324
|
EVENTS: `${API_VERSION_PREFIX}/auth/events`
|
package/dist/index.mjs
CHANGED
|
@@ -232,6 +232,8 @@ var ENDPOINTS = {
|
|
|
232
232
|
TWO_FACTOR_VERIFY: `${API_VERSION_PREFIX}/auth/two-factor-verify`,
|
|
233
233
|
LOGOUT: `${API_VERSION_PREFIX}/auth/logout`,
|
|
234
234
|
REFRESH: `${API_VERSION_PREFIX}/auth/refresh-token`,
|
|
235
|
+
FORGOT_PASSWORD: `${API_VERSION_PREFIX}/auth/forgot-password`,
|
|
236
|
+
RESET_PASSWORD: `${API_VERSION_PREFIX}/auth/reset-password`,
|
|
235
237
|
SET_LANGUAGE: `${API_VERSION_PREFIX}/auth/set-language`,
|
|
236
238
|
USER_DATA: `${API_VERSION_PREFIX}/auth/user-data`,
|
|
237
239
|
EVENTS: `${API_VERSION_PREFIX}/auth/events`
|
|
@@ -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-C8sBTLJb.mjs';
|
|
2
|
-
import { I as IStyleRegistryEntry } from '../styles.registry-
|
|
2
|
+
import { I as IStyleRegistryEntry } from '../styles.registry-0MsmyRmF.mjs';
|
|
3
3
|
import '../common-B96dASgu.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-C8sBTLJb.js';
|
|
2
|
-
import { I as IStyleRegistryEntry } from '../styles.registry-
|
|
2
|
+
import { I as IStyleRegistryEntry } from '../styles.registry-CtpsJ4gS.js';
|
|
3
3
|
import '../common-B96dASgu.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TStyleName, I as IStyleRegistryEntry, a as IPluginStyleRegistryEntry } from '../styles.registry-
|
|
2
|
-
export { B as BASE_STYLE_REGISTRY, S as STYLE_REGISTRY, b as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, c as _resetPluginStyleRegistry, e as extendStyleRegistry, g as getMergedStyleRegistry, d as getPluginStyleRegistry } from '../styles.registry-
|
|
1
|
+
import { T as TStyleName, I as IStyleRegistryEntry, a as IPluginStyleRegistryEntry } from '../styles.registry-0MsmyRmF.mjs';
|
|
2
|
+
export { B as BASE_STYLE_REGISTRY, S as STYLE_REGISTRY, b as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, c as _resetPluginStyleRegistry, e as extendStyleRegistry, g as getMergedStyleRegistry, d as getPluginStyleRegistry } from '../styles.registry-0MsmyRmF.mjs';
|
|
3
3
|
import '../common-B96dASgu.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 } from '../styles.registry-
|
|
2
|
-
export { B as BASE_STYLE_REGISTRY, S as STYLE_REGISTRY, b as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, c as _resetPluginStyleRegistry, e as extendStyleRegistry, g as getMergedStyleRegistry, d as getPluginStyleRegistry } from '../styles.registry-
|
|
1
|
+
import { T as TStyleName, I as IStyleRegistryEntry, a as IPluginStyleRegistryEntry } from '../styles.registry-CtpsJ4gS.js';
|
|
2
|
+
export { B as BASE_STYLE_REGISTRY, S as STYLE_REGISTRY, b as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, c as _resetPluginStyleRegistry, e as extendStyleRegistry, g as getMergedStyleRegistry, d as getPluginStyleRegistry } from '../styles.registry-CtpsJ4gS.js';
|
|
3
3
|
import '../common-B96dASgu.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -79,13 +79,23 @@ interface IValidateStyle extends IStyleWithSpacing {
|
|
|
79
79
|
interface IResetPasswordStyle extends IStyleWithSpacing {
|
|
80
80
|
style_name: 'resetPassword';
|
|
81
81
|
label_pw_reset?: IContentField<string>;
|
|
82
|
-
text_md?: IContentField<string>;
|
|
83
82
|
type?: IContentField<string>;
|
|
84
83
|
alert_success?: IContentField<string>;
|
|
85
84
|
placeholder?: IContentField<string>;
|
|
86
|
-
email_user?: IContentField<string>;
|
|
87
85
|
subject_user?: IContentField<string>;
|
|
88
86
|
is_html?: IContentField<string>;
|
|
87
|
+
reset_title?: IContentField<string>;
|
|
88
|
+
reset_label_pw?: IContentField<string>;
|
|
89
|
+
reset_pw_placeholder?: IContentField<string>;
|
|
90
|
+
reset_label_pw_confirm?: IContentField<string>;
|
|
91
|
+
reset_pw_confirm_placeholder?: IContentField<string>;
|
|
92
|
+
reset_label_submit?: IContentField<string>;
|
|
93
|
+
reset_success_title?: IContentField<string>;
|
|
94
|
+
reset_alert_success?: IContentField<string>;
|
|
95
|
+
reset_redirect_text?: IContentField<string>;
|
|
96
|
+
reset_error_invalid_token?: IContentField<string>;
|
|
97
|
+
reset_error_pw_short?: IContentField<string>;
|
|
98
|
+
reset_error_pw_mismatch?: IContentField<string>;
|
|
89
99
|
}
|
|
90
100
|
interface ITwoFactorAuthStyle extends IStyleWithSpacing {
|
|
91
101
|
style_name: 'twoFactorAuth';
|
|
@@ -79,13 +79,23 @@ interface IValidateStyle extends IStyleWithSpacing {
|
|
|
79
79
|
interface IResetPasswordStyle extends IStyleWithSpacing {
|
|
80
80
|
style_name: 'resetPassword';
|
|
81
81
|
label_pw_reset?: IContentField<string>;
|
|
82
|
-
text_md?: IContentField<string>;
|
|
83
82
|
type?: IContentField<string>;
|
|
84
83
|
alert_success?: IContentField<string>;
|
|
85
84
|
placeholder?: IContentField<string>;
|
|
86
|
-
email_user?: IContentField<string>;
|
|
87
85
|
subject_user?: IContentField<string>;
|
|
88
86
|
is_html?: IContentField<string>;
|
|
87
|
+
reset_title?: IContentField<string>;
|
|
88
|
+
reset_label_pw?: IContentField<string>;
|
|
89
|
+
reset_pw_placeholder?: IContentField<string>;
|
|
90
|
+
reset_label_pw_confirm?: IContentField<string>;
|
|
91
|
+
reset_pw_confirm_placeholder?: IContentField<string>;
|
|
92
|
+
reset_label_submit?: IContentField<string>;
|
|
93
|
+
reset_success_title?: IContentField<string>;
|
|
94
|
+
reset_alert_success?: IContentField<string>;
|
|
95
|
+
reset_redirect_text?: IContentField<string>;
|
|
96
|
+
reset_error_invalid_token?: IContentField<string>;
|
|
97
|
+
reset_error_pw_short?: IContentField<string>;
|
|
98
|
+
reset_error_pw_mismatch?: IContentField<string>;
|
|
89
99
|
}
|
|
90
100
|
interface ITwoFactorAuthStyle extends IStyleWithSpacing {
|
|
91
101
|
style_name: 'twoFactorAuth';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@selfhelp/shared",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Shared TypeScript package for SelfHelp web frontend and mobile app: style registry, types, API contracts, Mantine theme tokens, condition + interpolation engines, CMS class allow-list.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -0,0 +1,45 @@
|
|
|
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 { API_VERSION_PREFIX, ENDPOINTS } from '../endpoints';
|
|
8
|
+
import type {
|
|
9
|
+
IForgotPasswordRequest,
|
|
10
|
+
IResetPasswordRequest,
|
|
11
|
+
} from '../../types/api/auth';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Contract coverage for the public auth endpoint catalog. The frontend and the
|
|
15
|
+
* mobile app both build their password-recovery requests from these constants,
|
|
16
|
+
* so a wrong/missing path silently breaks the cross-repo flow (issue #31). The
|
|
17
|
+
* backend serves these under `/cms-api/v1/auth/...`.
|
|
18
|
+
*/
|
|
19
|
+
describe('ENDPOINTS.AUTH password recovery', () => {
|
|
20
|
+
it('exposes the forgot-password endpoint at the backend path', () => {
|
|
21
|
+
expect(ENDPOINTS.AUTH.FORGOT_PASSWORD).toBe(
|
|
22
|
+
`${API_VERSION_PREFIX}/auth/forgot-password`,
|
|
23
|
+
);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('exposes the reset-password endpoint at the backend path', () => {
|
|
27
|
+
expect(ENDPOINTS.AUTH.RESET_PASSWORD).toBe(
|
|
28
|
+
`${API_VERSION_PREFIX}/auth/reset-password`,
|
|
29
|
+
);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('models the request DTOs with the backend-required fields', () => {
|
|
33
|
+
const forgot: IForgotPasswordRequest = { email: 'qa.user@selfhelp.test' };
|
|
34
|
+
const reset: IResetPasswordRequest = {
|
|
35
|
+
id_users: 1,
|
|
36
|
+
token: 'qa-token',
|
|
37
|
+
password: 'qa-password-123',
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
expect(Object.keys(forgot)).toEqual(['email']);
|
|
41
|
+
expect(Object.keys(reset).sort()).toEqual(
|
|
42
|
+
['id_users', 'password', 'token'],
|
|
43
|
+
);
|
|
44
|
+
});
|
|
45
|
+
});
|
package/src/api/endpoints.ts
CHANGED
|
@@ -15,6 +15,8 @@ export const ENDPOINTS = {
|
|
|
15
15
|
TWO_FACTOR_VERIFY: `${API_VERSION_PREFIX}/auth/two-factor-verify`,
|
|
16
16
|
LOGOUT: `${API_VERSION_PREFIX}/auth/logout`,
|
|
17
17
|
REFRESH: `${API_VERSION_PREFIX}/auth/refresh-token`,
|
|
18
|
+
FORGOT_PASSWORD: `${API_VERSION_PREFIX}/auth/forgot-password`,
|
|
19
|
+
RESET_PASSWORD: `${API_VERSION_PREFIX}/auth/reset-password`,
|
|
18
20
|
SET_LANGUAGE: `${API_VERSION_PREFIX}/auth/set-language`,
|
|
19
21
|
USER_DATA: `${API_VERSION_PREFIX}/auth/user-data`,
|
|
20
22
|
EVENTS: `${API_VERSION_PREFIX}/auth/events`,
|
package/src/types/api/auth.ts
CHANGED
|
@@ -20,6 +20,18 @@ export interface IRefreshRequest {
|
|
|
20
20
|
refresh_token: string;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
/** POST /auth/forgot-password — request a recovery email. */
|
|
24
|
+
export interface IForgotPasswordRequest {
|
|
25
|
+
email: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** POST /auth/reset-password — set a new password from the one-time token. */
|
|
29
|
+
export interface IResetPasswordRequest {
|
|
30
|
+
id_users: number;
|
|
31
|
+
token: string;
|
|
32
|
+
password: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
23
35
|
export interface ILoginSuccessData {
|
|
24
36
|
access_token: string;
|
|
25
37
|
refresh_token: string;
|
|
@@ -44,3 +56,13 @@ export type ILanguagePreferenceUpdateResponse = IBaseApiResponse<{
|
|
|
44
56
|
access_token?: string;
|
|
45
57
|
language_id: number;
|
|
46
58
|
}>;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Generic success for the forgot-password request. The backend always returns
|
|
62
|
+
* `requested: true` regardless of whether the email matched an account, so the
|
|
63
|
+
* endpoint cannot be used to enumerate registered users.
|
|
64
|
+
*/
|
|
65
|
+
export type IForgotPasswordResponse = IBaseApiResponse<{ requested: boolean }>;
|
|
66
|
+
|
|
67
|
+
/** Success when the recovery token was valid and the password was changed. */
|
|
68
|
+
export type IResetPasswordResponse = IBaseApiResponse<{ reset: boolean }>;
|
package/src/types/styles/auth.ts
CHANGED
|
@@ -84,17 +84,27 @@ export interface IValidateStyle extends IStyleWithSpacing {
|
|
|
84
84
|
redirect_text?: IContentField<string>;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
export interface IResetPasswordStyle extends IStyleWithSpacing {
|
|
88
|
-
style_name: 'resetPassword';
|
|
89
|
-
label_pw_reset?: IContentField<string>;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
87
|
+
export interface IResetPasswordStyle extends IStyleWithSpacing {
|
|
88
|
+
style_name: 'resetPassword';
|
|
89
|
+
label_pw_reset?: IContentField<string>;
|
|
90
|
+
type?: IContentField<string>;
|
|
91
|
+
alert_success?: IContentField<string>;
|
|
92
|
+
placeholder?: IContentField<string>;
|
|
93
|
+
subject_user?: IContentField<string>;
|
|
94
|
+
is_html?: IContentField<string>;
|
|
95
|
+
reset_title?: IContentField<string>;
|
|
96
|
+
reset_label_pw?: IContentField<string>;
|
|
97
|
+
reset_pw_placeholder?: IContentField<string>;
|
|
98
|
+
reset_label_pw_confirm?: IContentField<string>;
|
|
99
|
+
reset_pw_confirm_placeholder?: IContentField<string>;
|
|
100
|
+
reset_label_submit?: IContentField<string>;
|
|
101
|
+
reset_success_title?: IContentField<string>;
|
|
102
|
+
reset_alert_success?: IContentField<string>;
|
|
103
|
+
reset_redirect_text?: IContentField<string>;
|
|
104
|
+
reset_error_invalid_token?: IContentField<string>;
|
|
105
|
+
reset_error_pw_short?: IContentField<string>;
|
|
106
|
+
reset_error_pw_mismatch?: IContentField<string>;
|
|
107
|
+
}
|
|
98
108
|
|
|
99
109
|
export interface ITwoFactorAuthStyle extends IStyleWithSpacing {
|
|
100
110
|
style_name: 'twoFactorAuth';
|