@dropins/storefront-auth 0.0.1-alpha9 → 1.0.0-beta2
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/api/confirmEmail/graphql/confirmEmail.graphql.d.ts +1 -1
- package/api/createCustomer/createCustomer.d.ts +3 -2
- package/api/createCustomer/graphql/createCustomer.graphql.d.ts +1 -1
- package/api/createCustomer/graphql/createCustomerV2.graphql.d.ts +1 -1
- package/api/createCustomerAddress/graphql/createCustomerAddress.graphql.d.ts +1 -1
- package/api/fragments.d.ts +2 -0
- package/api/getAttributesForm/getAttributesForm.d.ts +1 -1
- package/api/getAttributesForm/graphql/getAttributesForm.graphql.d.ts +1 -1
- package/api/getCustomerData/getCustomerData.d.ts +2 -2
- package/api/getCustomerData/graphql/getCustomerData.graphql.d.ts +1 -1
- package/api/getCustomerToken/getCustomerToken.d.ts +2 -2
- package/api/graphql/CustomerFragment.graphql.d.ts +2 -0
- package/api/initialize/initialize.d.ts +5 -1
- package/api/resendConfirmationEmail/graphql/resendConfirmationEmail.graphql.d.ts +1 -1
- package/api/resetPassword/graphql/resetPassword.graphql.d.ts +1 -1
- package/api.js +3 -1
- package/chunks/Button2.js +3 -0
- package/chunks/ResetPasswordForm.js +3 -1
- package/chunks/SignInForm.js +3 -1
- package/chunks/SignUpForm.js +3 -1
- package/chunks/SkeletonLoader.js +2 -0
- package/chunks/confirmEmail.js +5 -4
- package/chunks/createCustomerAddress.js +21 -15
- package/chunks/focusOnEmptyPasswordField.js +3 -0
- package/chunks/getCustomerToken.js +7 -6
- package/chunks/getStoreConfig.js +4 -2
- package/chunks/index.js +3 -1
- package/chunks/index2.js +3 -1
- package/chunks/index3.js +3 -1
- package/chunks/initialize.js +2 -0
- package/chunks/network-error.js +3 -1
- package/chunks/requestPasswordResetEmail.js +2 -0
- package/chunks/resendConfirmationEmail.js +6 -3
- package/chunks/resetPassword.js +12 -2
- package/chunks/revokeCustomerToken.js +2 -0
- package/chunks/setReCaptchaToken.js +3 -1
- package/chunks/simplifyTransformAttributesForm.js +3 -1
- package/chunks/transform-attributes-form.js +3 -1
- package/chunks/usePasswordValidationMessage.js +2 -0
- package/components/Form/Form.d.ts +4 -0
- package/components/Form/FormInputs/FormInputs.d.ts +5 -0
- package/components/index.d.ts +3 -4
- package/configs/defaultCreateUserConfigs.d.ts +42 -5
- package/containers/AuthCombine.js +3 -1
- package/containers/ResetPassword.js +3 -1
- package/containers/SignIn.js +3 -1
- package/containers/SignUp.js +3 -1
- package/containers/SuccessNotification.js +3 -1
- package/containers/UpdatePassword.js +3 -1
- package/data/models/attributes-form.d.ts +36 -16
- package/data/models/customer-data.d.ts +8 -3
- package/data/transforms/index.d.ts +1 -0
- package/data/transforms/transform-attributes-form.d.ts +3 -2
- package/data/transforms/transform-create-customer.d.ts +7 -0
- package/data/transforms/transform-customer-data.d.ts +2 -2
- package/fragments.d.ts +1 -0
- package/fragments.js +11 -0
- package/hooks/api/useGetAttributesForm.d.ts +1 -2
- package/hooks/{ui → components}/useForm.d.ts +3 -2
- package/hooks/components/useSignInForm.d.ts +5 -2
- package/hooks/components/useSignUpForm.d.ts +7 -1
- package/hooks/components/useUpdatePasswordForm.d.ts +5 -2
- package/hooks/useInLineAlert.d.ts +3 -3
- package/i18n/en_US.json.d.ts +32 -12
- package/lib/acdl.d.ts +2 -2
- package/lib/convertCase.d.ts +4 -0
- package/lib/focusOnEmptyPasswordField.d.ts +2 -0
- package/lib/initializeFormDataAndErrors.d.ts +10 -0
- package/lib/mergeFormObjects.d.ts +1 -2
- package/lib/simplifyTransformAttributesForm.d.ts +1 -1
- package/lib/validationFields.d.ts +33 -0
- package/package.json +1 -1
- package/render.js +4 -8
- package/types/api/createCustomer.types.d.ts +16 -11
- package/types/api/createCustomerAddress.types.d.ts +2 -2
- package/types/api/getAttributesForm.types.d.ts +5 -3
- package/types/api/getCustomerData.types.d.ts +1 -0
- package/types/emailConfirmationForm.types.d.ts +4 -4
- package/types/form.types.d.ts +24 -3
- package/types/notification.types.d.ts +5 -1
- package/types/resetPassword.types.d.ts +2 -2
- package/types/signIn.types.d.ts +4 -3
- package/types/signUp.types.d.ts +3 -2
- package/types/successNotification.types.d.ts +4 -2
- package/types/updatePassword.types.d.ts +4 -3
- package/chunks/EmailConfirmationForm.js +0 -1
- package/chunks/useInLineAlert.js +0 -1
- package/components/UI/Form/Form.d.ts +0 -5
- package/components/UI/FormInputs/FormInputs.d.ts +0 -13
- package/components/UI/Title/Title.d.ts +0 -11
- package/components/UI/Title/index.d.ts +0 -3
- package/components/UI/index.d.ts +0 -5
- /package/components/{UI/Button → Button}/Button.d.ts +0 -0
- /package/components/{UI/Button → Button}/index.d.ts +0 -0
- /package/components/{UI → Form}/FormInputs/index.d.ts +0 -0
- /package/components/{UI/Form → Form}/index.d.ts +0 -0
package/components/index.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
+
export * from './EmailConfirmationForm';
|
|
1
2
|
export * from './UpdatePasswordForm';
|
|
2
3
|
export * from './SuccessNotificationForm';
|
|
3
4
|
export * from './SignUpForm';
|
|
4
5
|
export * from './SignInForm';
|
|
5
6
|
export * from './ResetPasswordForm';
|
|
6
7
|
export * from './SkeletonLoader';
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './UI/FormInputs';
|
|
10
|
-
export * from './UI/Title';
|
|
8
|
+
export * from './Form';
|
|
9
|
+
export * from './Button';
|
|
11
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,16 +1,53 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare const DEFAULT__SIGN_IN_EMAIL_FIELD: {
|
|
2
|
+
customUpperCode: string;
|
|
2
3
|
code: string;
|
|
3
4
|
default_value: string;
|
|
4
5
|
entity_type: string;
|
|
5
6
|
frontend_class: string;
|
|
6
7
|
frontend_input: string;
|
|
7
8
|
is_required: boolean;
|
|
9
|
+
multiline_count: number;
|
|
10
|
+
sort_order: number;
|
|
8
11
|
is_unique: boolean;
|
|
9
12
|
label: string;
|
|
10
|
-
options:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
options: never[];
|
|
14
|
+
validateRules: {
|
|
15
|
+
name: string;
|
|
16
|
+
value: string;
|
|
17
|
+
}[];
|
|
18
|
+
}[];
|
|
13
19
|
export declare const DEFAULT__RESET_PASSWORD_EMAIL_FIELD: Record<string, string | boolean | unknown>[];
|
|
14
|
-
export declare const DEFAULT_SIGN_UP_FIELDS:
|
|
20
|
+
export declare const DEFAULT_SIGN_UP_FIELDS: ({
|
|
21
|
+
customUpperCode: string;
|
|
22
|
+
code: string;
|
|
23
|
+
default_value: string;
|
|
24
|
+
entity_type: string;
|
|
25
|
+
frontend_class: string;
|
|
26
|
+
frontend_input: string;
|
|
27
|
+
is_required: boolean;
|
|
28
|
+
is_unique: boolean;
|
|
29
|
+
label: string;
|
|
30
|
+
multiline_count: number;
|
|
31
|
+
sort_order: number;
|
|
32
|
+
options: never[];
|
|
33
|
+
validateRules: {
|
|
34
|
+
name: string;
|
|
35
|
+
value: string;
|
|
36
|
+
}[];
|
|
37
|
+
} | {
|
|
38
|
+
customUpperCode: string;
|
|
39
|
+
code: string;
|
|
40
|
+
default_value: string;
|
|
41
|
+
entity_type: string;
|
|
42
|
+
frontend_class: string;
|
|
43
|
+
frontend_input: string;
|
|
44
|
+
is_required: boolean;
|
|
45
|
+
is_unique: boolean;
|
|
46
|
+
label: string;
|
|
47
|
+
multiline_count: number;
|
|
48
|
+
sort_order: number;
|
|
49
|
+
options: never[];
|
|
50
|
+
validateRules?: undefined;
|
|
51
|
+
})[];
|
|
15
52
|
export declare const DEFAULT_INPUTS_PROPS: Record<string, string | ''>;
|
|
16
53
|
//# sourceMappingURL=defaultCreateUserConfigs.d.ts.map
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{jsx as i}from"@dropins/tools/preact-jsx-runtime.js";import{lazy as d,Suspense as E}from"@dropins/tools/preact-compat.js";import{useState as S,useMemo as P}from"@dropins/tools/preact-hooks.js";import{S as y}from"../chunks/SkeletonLoader.js";import"@dropins/tools/components.js";const L=function(){const r=typeof document<"u"&&document.createElement("link").relList;return r&&r.supports&&r.supports("modulepreload")?"modulepreload":"preload"}(),k=function(l){return"/"+l},f={},p=function(r,c,u){let a=Promise.resolve();if(c&&c.length>0){document.getElementsByTagName("link");const e=document.querySelector("meta[property=csp-nonce]"),t=(e==null?void 0:e.nonce)||(e==null?void 0:e.getAttribute("nonce"));a=Promise.allSettled(c.map(o=>{if(o=k(o),o in f)return;f[o]=!0;const m=o.endsWith(".css"),h=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${o}"]${h}`))return;const n=document.createElement("link");if(n.rel=m?"stylesheet":L,m||(n.as="script"),n.crossOrigin="",n.href=o,t&&n.setAttribute("nonce",t),document.head.appendChild(n),m)return new Promise((_,v)=>{n.addEventListener("load",_),n.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${o}`)))})}))}function s(e){const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return a.then(e=>{for(const t of e||[])t.status==="rejected"&&s(t.reason);return r().catch(s)})},b=d(()=>p(()=>import("../chunks/index.js"),[])),w=d(()=>p(()=>import("../chunks/index2.js"),[])),A=d(()=>p(()=>import("../chunks/index3.js"),[])),O=({defaultView:l="signInForm",signInFormConfig:r,signUpFormConfig:c,resetPasswordFormConfig:u})=>{const[a,s]=S(l),e=P(()=>({signInForm:i(w,{setActiveComponent:s,...r}),signUpForm:i(A,{setActiveComponent:s,...c}),resetPasswordForm:i(b,{setActiveComponent:s,...u})}),[u,r,c,s]);return i("div",{children:i(E,{fallback:i(y,{activeSkeleton:a}),children:i("div",{className:"auth-combine",children:e[a]})})})};export{O as AuthCombine,O as default};
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{jsx as r}from"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/lib.js";import"@dropins/tools/components.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/recaptcha.js";import"@dropins/tools/preact-hooks.js";/* empty css */import{R as i}from"../chunks/ResetPasswordForm.js";import"../chunks/requestPasswordResetEmail.js";import"../chunks/network-error.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/setReCaptchaToken.js";import"../chunks/Button2.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/i18n.js";import"../chunks/simplifyTransformAttributesForm.js";import"../chunks/transform-attributes-form.js";const F=({formSize:o,routeSignIn:t,onErrorCallback:m})=>r("div",{className:"auth-reset-password",children:r(i,{formSize:o,routeSignIn:t,onErrorCallback:m})});export{F as ResetPassword,F as default};
|
package/containers/SignIn.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{jsx as r}from"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/lib.js";import"@dropins/tools/components.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/recaptcha.js";import"@dropins/tools/preact-hooks.js";/* empty css */import{S as u}from"../chunks/SignInForm.js";import"../chunks/Button2.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/i18n.js";import"../chunks/getCustomerToken.js";import"../chunks/network-error.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/initialize.js";import"../fragments.js";import"../chunks/getStoreConfig.js";import"../chunks/setReCaptchaToken.js";import"../chunks/resendConfirmationEmail.js";import"../chunks/simplifyTransformAttributesForm.js";import"../chunks/transform-attributes-form.js";import"../chunks/focusOnEmptyPasswordField.js";import"../chunks/confirmEmail.js";const L=({slots:i,labels:o,enableEmailConfirmation:t,initialEmailValue:m,formSize:p,renderSignUpLink:n,hideCloseBtnOnEmailConfirmation:s,routeRedirectOnEmailConfirmationClose:a,routeRedirectOnSignIn:e,routeForgotPassword:c,routeSignUp:d,onSuccessCallback:f,onErrorCallback:g,onSignUpLinkClick:l})=>r("div",{className:"auth-sign-in",children:r(u,{slots:i,labels:o,formSize:p,renderSignUpLink:n,initialEmailValue:m,enableEmailConfirmation:t,hideCloseBtnOnEmailConfirmation:s,routeRedirectOnEmailConfirmationClose:a,routeSignUp:d,onErrorCallback:g,onSuccessCallback:f,onSignUpLinkClick:l,routeForgotPassword:c,routeRedirectOnSignIn:e})});export{L as SignIn,L as default};
|
package/containers/SignUp.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{jsx as r}from"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/lib.js";import"@dropins/tools/components.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/recaptcha.js";import"@dropins/tools/preact-hooks.js";/* empty css */import{S as h}from"../chunks/SignUpForm.js";import"../chunks/createCustomerAddress.js";import"../fragments.js";import"../chunks/network-error.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/setReCaptchaToken.js";import"../chunks/initialize.js";import"../chunks/transform-attributes-form.js";import"../chunks/getStoreConfig.js";import"../chunks/simplifyTransformAttributesForm.js";import"../chunks/usePasswordValidationMessage.js";import"@dropins/tools/i18n.js";import"../chunks/getCustomerToken.js";import"../chunks/Button2.js";import"@dropins/tools/preact-compat.js";import"../chunks/focusOnEmptyPasswordField.js";import"../chunks/resendConfirmationEmail.js";import"../chunks/SkeletonLoader.js";const P=({slots:i,formSize:o,apiVersion2:t,addressesData:m,isAutoSignInEnabled:p,requireRetypePassword:s,inputsDefaultValueSet:a,displayNewsletterCheckbox:n,displayTermsOfUseCheckbox:e,fieldsConfigForApiVersion1:u,hideCloseBtnOnEmailConfirmation:c,routeRedirectOnEmailConfirmationClose:d,routeRedirectOnSignIn:f,onSuccessCallback:g,onErrorCallback:l,routeSignIn:S})=>r("div",{className:"auth-sign-up",children:r(h,{requireRetypePassword:s,formSize:o,apiVersion2:t,addressesData:m,isAutoSignInEnabled:p,inputsDefaultValueSet:a,fieldsConfigForApiVersion1:u,displayNewsletterCheckbox:n,displayTermsOfUseCheckbox:e,hideCloseBtnOnEmailConfirmation:c,routeRedirectOnEmailConfirmationClose:d,routeRedirectOnSignIn:f,routeSignIn:S,slots:i,onErrorCallback:l,onSuccessCallback:g})});export{P as SignUp,P as default};
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{jsxs as a,jsx as e,Fragment as s}from"@dropins/tools/preact-jsx-runtime.js";import{classes as u,Slot as m}from"@dropins/tools/lib.js";import{Button as r}from"@dropins/tools/components.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/recaptcha.js";import"@dropins/tools/preact-hooks.js";/* empty css */import{r as d}from"../chunks/revokeCustomerToken.js";import{useText as f}from"@dropins/tools/i18n.js";import"../chunks/network-error.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/getStoreConfig.js";const h=({formSize:c="default",className:n="",slots:i,labels:t})=>{const o=f({headingText:"Auth.SuccessNotification.headingText",messageText:"Auth.SuccessNotification.messageText",primaryButtonText:"Auth.SuccessNotification.primaryButtonText",secondaryButtonText:"Auth.SuccessNotification.secondaryButtonText"});return a("div",{className:u(["auth-success-notification-form",`auth-success-notification-form--${c}`,n]),id:"welcome-message",role:"alert","aria-live":"assertive","aria-labelledby":(t==null?void 0:t.headingText)??o.headingText,"aria-describedby":(t==null?void 0:t.messageText)??o.messageText,"tab-index":"-1",children:[e("p",{id:"welcome-heading",className:"auth-success-notification-form__title","data-testid":"notification-title",children:(t==null?void 0:t.headingText)??o.headingText}),e("p",{id:"welcome-details",className:"auth-success-notification-form__content-text","data-testid":"notification-content",children:(t==null?void 0:t.messageText)??o.messageText}),i!=null&&i.SuccessNotificationActions?e(m,{"data-testid":"successNotificationActions",name:"SuccessNotificationActions",slot:i==null?void 0:i.SuccessNotificationActions,context:{}}):a(s,{children:[e(r,{"data-testid":"primaryButton",type:"button",className:"auth-success-notification-form__button auth-success-notification-form__button--top",onClick:()=>window.location.href="/",children:o.primaryButtonText}),e(r,{"data-testid":"secondaryButton",type:"button",variant:"tertiary",onClick:async()=>{await d(),window.location.href="/"},children:o.secondaryButtonText})]})]})},k=({formSize:c="default",slots:n,className:i,labels:t})=>e("div",{className:"auth-success-notification",children:e(h,{formSize:c,className:i,slots:n,labels:t})});export{k as SuccessNotification,k as default};
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{jsx as u,jsxs as H}from"@dropins/tools/preact-jsx-runtime.js";import{Slot as Z,classes as $}from"@dropins/tools/lib.js";import{Header as k,InLineAlert as S,InputPassword as W}from"@dropins/tools/components.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/recaptcha.js";import{useState as h,useEffect as z,useCallback as I}from"@dropins/tools/preact-hooks.js";/* empty css */import{v as O,u as g,a as R}from"../chunks/usePasswordValidationMessage.js";import{a as C}from"../chunks/getCustomerToken.js";import{r as tt}from"../chunks/resetPassword.js";import{c as j,g as et,u as at,F as st,B as rt}from"../chunks/Button2.js";import{useText as K}from"@dropins/tools/i18n.js";import"../chunks/getStoreConfig.js";import"../chunks/network-error.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/initialize.js";import"../fragments.js";import"../chunks/setReCaptchaToken.js";import"@dropins/tools/preact-compat.js";const J=(d,p)=>d.split("&").filter(r=>r.includes(p)).map(r=>r.split("=")[1])[0],it=({isEmailConfirmationRequired:d,signInOnSuccess:p,passwordConfigs:t,routeRedirectOnSignIn:r,routeWrongUrlRedirect:w,onErrorCallback:a,onSuccessCallback:i,handleSetInLineAlertProps:m,routeRedirectOnPasswordUpdate:N,routeSignInPage:o})=>{const s=K({errorNotification:"Auth.Notification.errorNotification",updatePasswordMessage:"Auth.Notification.updatePasswordMessage",updatePasswordActionMessage:"Auth.Notification.updatePasswordActionMessage",customerTokenErrorMessage:"Auth.Api.customerTokenErrorMessage"}),[U,n]=h({userName:"",status:!1}),[x,F]=h(""),[v,A]=h(!1),[P,L]=h(""),[y,M]=h(""),[T,c]=h(!1),[_,q]=h(!1),[b,B]=h([]);z(()=>{v&&!b.length&&(x.length?q(!1):q(!0))},[v,x,b]),z(()=>{const{search:f}=window.location;!f.includes("token=")&&!f.includes("email=")&&j(w)&&(window.location.href=w());const e=decodeURIComponent(f),V=J(e,"token"),E=J(e,"email");L(E),M(V)},[w]);const Q=I(async f=>{f.preventDefault(),c(!0),B([]);const e=et(f.target),V=(e==null?void 0:e.password)&&P&&y;e!=null&&e.password||(q(!0),c(!1));const E=(t==null?void 0:t.requiredCharacterClasses)??0,Y=(t==null?void 0:t.minLength)??0;if(!O(e==null?void 0:e.password,E)||e.password.length<+Y){A(!0),c(!1);return}if(!V){m({type:"error",text:s.errorNotification}),c(!1);return}const{message:D,success:G}=await tt(P,y,e.password);if(G){if(d||!d&&!p){i==null||i(),j(N)&&(window.location.href=N()),A(!0),c(!1),q(!1),F(""),B([{label:s.updatePasswordActionMessage,onClick:()=>{window.location.href=o==null?void 0:o()}}]),m({type:"success",text:s.updatePasswordMessage});return}const l=await C({email:P,password:e.password,handleSetInLineAlertProps:m,onErrorCallback:a,translations:s});l!=null&&l.userName&&(i==null||i(l==null?void 0:l.userName),j(r)?window.location.href=r():n({userName:l==null?void 0:l.userName,status:!0}))}else m({type:"error",text:D}),a==null||a({message:D,success:G});c(!1)},[P,y,t==null?void 0:t.requiredCharacterClasses,t==null?void 0:t.minLength,s,d,p,o,a,i,r,m,N]),X=I(f=>{F(f)},[]);return{additionalActionsAlert:b,passwordError:_,isSuccessful:U,updatePasswordValue:x,isClickSubmit:v,isLoading:T,submitUpdatePassword:Q,handleSetUpdatePasswordValue:X,setIsClickSubmit:A}},ot=({signInOnSuccess:d=!0,formSize:p="default",routeRedirectOnSignIn:t,routeWrongUrlRedirect:r,routeSignInPage:w,slots:a,onErrorCallback:i,onSuccessCallback:m,routeRedirectOnPasswordUpdate:N})=>{const o=K({title:"Auth.UpdatePasswordForm.title",buttonPrimary:"Auth.UpdatePasswordForm.buttonPrimary",placeholder:"Auth.InputPassword.placeholder",floatingLabel:"Auth.InputPassword.floatingLabel",requiredFieldError:"Auth.FormText.requiredFieldError"}),{passwordConfigs:s,isEmailConfirmationRequired:U}=g(),{inLineAlertProps:n,handleSetInLineAlertProps:x}=at(),{additionalActionsAlert:F,passwordError:v,isSuccessful:A,updatePasswordValue:P,isClickSubmit:L,isLoading:y,submitUpdatePassword:M,handleSetUpdatePasswordValue:T}=it({isEmailConfirmationRequired:U,signInOnSuccess:d,passwordConfigs:s,routeRedirectOnSignIn:t,routeWrongUrlRedirect:r,onErrorCallback:i,onSuccessCallback:m,handleSetInLineAlertProps:x,routeRedirectOnPasswordUpdate:N,routeSignInPage:w}),{isValidUniqueSymbols:c,defaultLengthMessage:_}=R({password:P,isClickSubmit:L,passwordConfigs:s});return A.status&&(a!=null&&a.SuccessNotification)?u(Z,{"data-testid":"successNotificationTestId",name:"SuccessNotification",slot:a==null?void 0:a.SuccessNotification,context:{isSuccessful:A}}):H("div",{className:$(["auth-update-password-form",`auth-update-password-form--${p}`]),children:[u(k,{title:o.title,divider:!1,className:"auth-update-password-form__title"}),u(S,{className:$(["auth-update-password-form__notification",["auth-update-password-form__notification--show",!!(n!=null&&n.text)]]),variant:"secondary",heading:n==null?void 0:n.text,icon:n.icon,additionalActions:F}),H(st,{name:"updatePassword_form",className:"auth-update-password-form__form",onSubmit:M,loading:y,fieldsConfig:[],children:[u("div",{style:"display: none;",children:u("input",{type:"text",id:"username",name:"username",autoComplete:"username"})}),u(W,{defaultValue:P,onValue:T,className:"auth-update-password-form__form__item",autoComplete:"new-password",name:"password",errorMessage:v||c==="error"||(_==null?void 0:_.status)==="error"?o.requiredFieldError:void 0,minLength:s==null?void 0:s.minLength,uniqueSymbolsStatus:c,validateLengthConfig:_,requiredCharacterClasses:s==null?void 0:s.requiredCharacterClasses,placeholder:o.placeholder,floatingLabel:o.floatingLabel}),u("div",{className:"auth-update-password-form__button",children:u(rt,{type:"submit",buttonText:o.buttonPrimary,variant:"primary",enableLoader:y})})]})]})},Ut=({slots:d,formSize:p,signInOnSuccess:t,routeRedirectOnPasswordUpdate:r,routeRedirectOnSignIn:w,routeSignInPage:a,routeWrongUrlRedirect:i,onErrorCallback:m,onSuccessCallback:N})=>u("div",{className:"auth-update-password",children:u(ot,{formSize:p,signInOnSuccess:t,routeSignInPage:a,routeRedirectOnSignIn:w,routeWrongUrlRedirect:i,onErrorCallback:m,onSuccessCallback:N,slots:d,routeRedirectOnPasswordUpdate:r})});export{Ut as UpdatePassword,Ut as default};
|
|
@@ -1,25 +1,45 @@
|
|
|
1
|
+
export declare enum FieldEnumList {
|
|
2
|
+
BOOLEAN = "BOOLEAN",
|
|
3
|
+
DATE = "DATE",
|
|
4
|
+
DATETIME = "DATETIME",
|
|
5
|
+
DROPDOWN = "DROPDOWN",
|
|
6
|
+
FILE = "FILE",
|
|
7
|
+
GALLERY = "GALLERY",
|
|
8
|
+
HIDDEN = "HIDDEN",
|
|
9
|
+
IMAGE = "IMAGE",
|
|
10
|
+
MEDIA_IMAGE = "MEDIA_IMAGE",
|
|
11
|
+
MULTILINE = "MULTILINE",
|
|
12
|
+
MULTISELECT = "MULTISELECT",
|
|
13
|
+
PRICE = "PRICE",
|
|
14
|
+
SELECT = "SELECT",
|
|
15
|
+
TEXT = "TEXT",
|
|
16
|
+
TEXTAREA = "TEXTAREA",
|
|
17
|
+
UNDEFINED = "UNDEFINED",
|
|
18
|
+
VISUAL = "VISUAL",
|
|
19
|
+
WEIGHT = "WEIGHT",
|
|
20
|
+
EMPTY = ""
|
|
21
|
+
}
|
|
1
22
|
export interface AttributesFormItemsProps {
|
|
2
|
-
code
|
|
3
|
-
name
|
|
4
|
-
id
|
|
5
|
-
defaultValue
|
|
6
|
-
|
|
7
|
-
className
|
|
8
|
-
fieldType
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
23
|
+
code?: string;
|
|
24
|
+
name?: string;
|
|
25
|
+
id?: string;
|
|
26
|
+
defaultValue?: string | boolean | number;
|
|
27
|
+
entityType?: string;
|
|
28
|
+
className?: string;
|
|
29
|
+
fieldType?: FieldEnumList;
|
|
30
|
+
multilineCount: number;
|
|
31
|
+
required?: boolean;
|
|
32
|
+
unique?: boolean;
|
|
33
|
+
label?: string;
|
|
12
34
|
orderNumber: number;
|
|
13
|
-
options
|
|
35
|
+
options?: {
|
|
14
36
|
is_default: boolean;
|
|
15
37
|
label: string;
|
|
16
38
|
value: string;
|
|
17
39
|
}[];
|
|
40
|
+
hidden?: boolean;
|
|
41
|
+
customUpperCode: string;
|
|
18
42
|
}
|
|
19
|
-
export interface AttributesFormModel {
|
|
20
|
-
fields?: AttributesFormItemsProps[];
|
|
21
|
-
errors?: {
|
|
22
|
-
message: string;
|
|
23
|
-
}[];
|
|
43
|
+
export interface AttributesFormModel extends AttributesFormItemsProps {
|
|
24
44
|
}
|
|
25
45
|
//# sourceMappingURL=attributes-form.d.ts.map
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
export interface
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export interface CustomerModel {
|
|
2
|
+
firstName: string;
|
|
3
|
+
lastName: string;
|
|
4
4
|
email: string;
|
|
5
|
+
isSubscribed: boolean;
|
|
6
|
+
customAttributes?: Record<string, string>[];
|
|
7
|
+
errors?: {
|
|
8
|
+
message: string;
|
|
9
|
+
}[];
|
|
5
10
|
}
|
|
6
11
|
//# sourceMappingURL=customer-data.d.ts.map
|
|
@@ -4,4 +4,5 @@ export * from './transform-password-reset-email';
|
|
|
4
4
|
export * from './transform-revoke-customer-token';
|
|
5
5
|
export * from './transform-customer-data';
|
|
6
6
|
export * from './transform-attributes-form';
|
|
7
|
+
export * from './transform-create-customer';
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GetAttributesFormResponse, ResponseAttributesFormItemsProps } from '../../types';
|
|
2
2
|
import { AttributesFormModel } from '../models';
|
|
3
3
|
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const cloneArrayIfExists: (fields: ResponseAttributesFormItemsProps[]) => any;
|
|
5
|
+
export declare const transformAttributesForm: (response: GetAttributesFormResponse) => AttributesFormModel[];
|
|
5
6
|
//# sourceMappingURL=transform-attributes-form.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DataCreateCustomerV2, DataCreateCustomer } from '../../types';
|
|
2
|
+
import { CustomerModel } from '../models';
|
|
3
|
+
|
|
4
|
+
type ApiResponse<T extends boolean> = T extends true ? DataCreateCustomerV2 : DataCreateCustomer;
|
|
5
|
+
export declare const transformCreateCustomer: <T extends boolean>(response: ApiResponse<T>, apiVersion2: T) => CustomerModel;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=transform-create-customer.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getCustomerDataResponse } from '../../types';
|
|
2
|
-
import {
|
|
2
|
+
import { CustomerModel } from '../models';
|
|
3
3
|
|
|
4
|
-
export declare const transformCustomerData: (response: getCustomerDataResponse) =>
|
|
4
|
+
export declare const transformCustomerData: (response: getCustomerDataResponse) => CustomerModel;
|
|
5
5
|
//# sourceMappingURL=transform-customer-data.d.ts.map
|
package/fragments.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './api/fragments'
|
package/fragments.js
ADDED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { inputsDefaultValueSetProps } from '../../types';
|
|
2
|
-
import { SignUpFieldsProps } from '../../configs/defaultCreateUserConfigs';
|
|
3
2
|
import { AttributesFormItemsProps } from '../../data/models';
|
|
4
3
|
|
|
5
4
|
interface UseGetAttributesFormProps {
|
|
6
|
-
fieldsConfigForApiVersion1:
|
|
5
|
+
fieldsConfigForApiVersion1: {}[];
|
|
7
6
|
apiVersion2: boolean;
|
|
8
7
|
inputsDefaultValueSet?: inputsDefaultValueSetProps[];
|
|
9
8
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { useFormProps } from '../../types';
|
|
2
2
|
|
|
3
|
-
export declare const useForm: ({ fieldsConfig,
|
|
4
|
-
formData: Record<string,
|
|
3
|
+
export declare const useForm: ({ fieldsConfig, onSubmit }: useFormProps) => {
|
|
4
|
+
formData: Record<string, string | number | boolean>;
|
|
5
5
|
errors: Record<string, string>;
|
|
6
6
|
formRef: import('preact').RefObject<HTMLFormElement>;
|
|
7
7
|
handleChange: (event: Event) => void;
|
|
8
8
|
handleBlur: (event: Event) => void;
|
|
9
9
|
handleSubmit: (event: SubmitEvent) => void;
|
|
10
|
+
handleFocus: () => Promise<void>;
|
|
10
11
|
};
|
|
11
12
|
//# sourceMappingURL=useForm.d.ts.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { useSignInFormProps } from '../../types';
|
|
1
|
+
import { AdditionalActionsAlertProps, useSignInFormProps } from '../../types';
|
|
2
2
|
|
|
3
3
|
export declare const useSignInForm: ({ emailConfirmationStatusMessage, translations, initialEmailValue, routeSignUp, routeForgotPassword, routeRedirectOnSignIn, onErrorCallback, setActiveComponent, onSuccessCallback, onSignUpLinkClick, handleSetInLineAlertProps, routeRedirectOnEmailConfirmationClose, }: useSignInFormProps) => {
|
|
4
|
+
additionalActionsAlert: AdditionalActionsAlertProps;
|
|
4
5
|
userEmail: string;
|
|
5
6
|
defaultEnhancedEmailFields: any;
|
|
6
7
|
passwordError: boolean;
|
|
@@ -13,9 +14,11 @@ export declare const useSignInForm: ({ emailConfirmationStatusMessage, translati
|
|
|
13
14
|
showEmailConfirmationForm: boolean;
|
|
14
15
|
setShowEmailConfirmationForm: import('preact/hooks').Dispatch<import('preact/hooks').StateUpdater<boolean>>;
|
|
15
16
|
setSignInPasswordValue: import('preact/hooks').Dispatch<import('preact/hooks').StateUpdater<string>>;
|
|
16
|
-
submitLogInUser: (event:
|
|
17
|
+
submitLogInUser: (event: SubmitEvent, isValid: boolean) => Promise<void>;
|
|
17
18
|
forgotPasswordCallback: () => void;
|
|
18
19
|
onSignUpLinkClickCallback: () => void;
|
|
19
20
|
handledOnPrimaryButtonClick: () => void;
|
|
21
|
+
handleSetPassword: (value: string) => void;
|
|
22
|
+
onBlurPassword: () => void;
|
|
20
23
|
};
|
|
21
24
|
//# sourceMappingURL=useSignInForm.d.ts.map
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { UseSingUpFormProps } from '../../types';
|
|
2
2
|
|
|
3
|
-
export declare const useSignUpForm: ({ addressesData, translations, isEmailConfirmationRequired, apiVersion2, passwordConfigs, isAutoSignInEnabled, routeRedirectOnSignIn, routeSignIn, onErrorCallback, onSuccessCallback, setActiveComponent, handleSetInLineAlertProps, routeRedirectOnEmailConfirmationClose, }: UseSingUpFormProps) => {
|
|
3
|
+
export declare const useSignUpForm: ({ requireRetypePassword, addressesData, translations, isEmailConfirmationRequired, apiVersion2, passwordConfigs, isAutoSignInEnabled, routeRedirectOnSignIn, routeSignIn, onErrorCallback, onSuccessCallback, setActiveComponent, handleSetInLineAlertProps, routeRedirectOnEmailConfirmationClose, }: UseSingUpFormProps) => {
|
|
4
|
+
showPasswordErrorMessage: boolean;
|
|
5
|
+
confirmPassword: string;
|
|
6
|
+
confirmPasswordMessage: string;
|
|
4
7
|
isKeepMeLogged: boolean;
|
|
5
8
|
userEmail: string;
|
|
6
9
|
showEmailConfirmationForm: boolean;
|
|
@@ -16,5 +19,8 @@ export declare const useSignUpForm: ({ addressesData, translations, isEmailConfi
|
|
|
16
19
|
handleSetSignUpPasswordValue: (value: string) => void;
|
|
17
20
|
onKeepMeLoggedChange: ({ target }: any) => void;
|
|
18
21
|
handleHideEmailConfirmationForm: () => void;
|
|
22
|
+
handleConfirmPasswordChange: (value: string) => void;
|
|
23
|
+
onBlurPassword: (event: Event) => void;
|
|
24
|
+
onBlurConfirmPassword: (event: Event) => void;
|
|
19
25
|
};
|
|
20
26
|
//# sourceMappingURL=useSignUpForm.d.ts.map
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { UseUpdatePasswordFormProps } from '../../types';
|
|
1
|
+
import { AdditionalActionsAlertProps, UseUpdatePasswordFormProps } from '../../types';
|
|
2
2
|
|
|
3
|
-
export declare const useUpdatePasswordForm: ({ isEmailConfirmationRequired, signInOnSuccess, passwordConfigs, routeRedirectOnSignIn, routeWrongUrlRedirect, onErrorCallback, onSuccessCallback, handleSetInLineAlertProps, routeRedirectOnPasswordUpdate, }: UseUpdatePasswordFormProps) => {
|
|
3
|
+
export declare const useUpdatePasswordForm: ({ isEmailConfirmationRequired, signInOnSuccess, passwordConfigs, routeRedirectOnSignIn, routeWrongUrlRedirect, onErrorCallback, onSuccessCallback, handleSetInLineAlertProps, routeRedirectOnPasswordUpdate, routeSignInPage, }: UseUpdatePasswordFormProps) => {
|
|
4
|
+
additionalActionsAlert: AdditionalActionsAlertProps;
|
|
5
|
+
passwordError: boolean;
|
|
4
6
|
isSuccessful: {
|
|
5
7
|
userName: string;
|
|
6
8
|
status: boolean;
|
|
@@ -10,5 +12,6 @@ export declare const useUpdatePasswordForm: ({ isEmailConfirmationRequired, sign
|
|
|
10
12
|
isLoading: boolean;
|
|
11
13
|
submitUpdatePassword: (event: Event) => Promise<void>;
|
|
12
14
|
handleSetUpdatePasswordValue: (value: string) => void;
|
|
15
|
+
setIsClickSubmit: import('preact/hooks').Dispatch<import('preact/hooks').StateUpdater<boolean>>;
|
|
13
16
|
};
|
|
14
17
|
//# sourceMappingURL=useUpdatePasswordForm.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InLineAlertInterface } from '../types';
|
|
2
2
|
|
|
3
3
|
export declare const useInLineAlert: () => {
|
|
4
|
-
inLineAlertProps:
|
|
5
|
-
handleSetInLineAlertProps: (notification:
|
|
4
|
+
inLineAlertProps: InLineAlertInterface;
|
|
5
|
+
handleSetInLineAlertProps: (notification: InLineAlertInterface | undefined) => void;
|
|
6
6
|
};
|
|
7
7
|
//# sourceMappingURL=useInLineAlert.d.ts.map
|
package/i18n/en_US.json.d.ts
CHANGED
|
@@ -9,7 +9,8 @@ declare const _default: {
|
|
|
9
9
|
"ResetPasswordForm": {
|
|
10
10
|
"title": "Reset your password",
|
|
11
11
|
"buttonPrimary": "Reset password",
|
|
12
|
-
"buttonSecondary": "Back to sign in"
|
|
12
|
+
"buttonSecondary": "Back to sign in",
|
|
13
|
+
"formAriaLabel": "Reset your password form"
|
|
13
14
|
},
|
|
14
15
|
"SignInForm": {
|
|
15
16
|
"title": "Sign in",
|
|
@@ -24,14 +25,30 @@ declare const _default: {
|
|
|
24
25
|
"privacyPolicyDefaultText": "I’ve read and accept the Terms of Use and Privacy Policy.",
|
|
25
26
|
"subscribedDefaultText": "Subscribe to our newsletter and be the first to know about new arrivals, sales and exclusive offers.",
|
|
26
27
|
"keepMeLoggedText": "Keep me logged in after account creation",
|
|
27
|
-
"failedCreateCustomerAddress": "Failed to create customer addresses:"
|
|
28
|
+
"failedCreateCustomerAddress": "Failed to create customer addresses:",
|
|
29
|
+
"confirmPassword": {
|
|
30
|
+
"placeholder": "Confirm password",
|
|
31
|
+
"floatingLabel": "Confirm password *",
|
|
32
|
+
"passwordMismatch": "Passwords do not match. Please make sure both password fields are identical."
|
|
33
|
+
}
|
|
28
34
|
},
|
|
29
35
|
"UpdatePasswordForm": {
|
|
30
36
|
"title": "Update password",
|
|
31
37
|
"buttonPrimary": "Update password"
|
|
32
38
|
},
|
|
33
39
|
"FormText": {
|
|
34
|
-
"requiredFieldError": "This is a required field."
|
|
40
|
+
"requiredFieldError": "This is a required field.",
|
|
41
|
+
"numericError": "Only numeric values are allowed.",
|
|
42
|
+
"alphaNumWithSpacesError": "Only alphanumeric characters and spaces are allowed.",
|
|
43
|
+
"alphaNumericError": "Only alphanumeric characters are allowed.",
|
|
44
|
+
"alphaError": "Only alphabetic characters are allowed.",
|
|
45
|
+
"emailError": "Please enter a valid email address.",
|
|
46
|
+
"dateError": "Please enter a valid date.",
|
|
47
|
+
"dateLengthError": "Date must be between {min} and {max}.",
|
|
48
|
+
"dateMaxError": "Date must be less than or equal to {max}.",
|
|
49
|
+
"dateMinError": "Date must be greater than or equal to {min}.",
|
|
50
|
+
"urlError": "Please enter a valid URL, e.g., https://www.website.com.",
|
|
51
|
+
"lengthTextError": "Text length must be between {min} and {max} characters."
|
|
35
52
|
},
|
|
36
53
|
"EmailConfirmationForm": {
|
|
37
54
|
"title": "Verify your email address",
|
|
@@ -44,12 +61,12 @@ declare const _default: {
|
|
|
44
61
|
},
|
|
45
62
|
"Notification": {
|
|
46
63
|
"errorNotification": "Your password update failed due to validation errors. Please check your information and try again.",
|
|
47
|
-
"updatePasswordMessage": "The password has been updated.
|
|
64
|
+
"updatePasswordMessage": "The password has been updated.",
|
|
65
|
+
"updatePasswordActionMessage": "Sign in",
|
|
48
66
|
"successPasswordResetEmailNotification": "If there is an account associated with {email} you will receive an email with a link to reset your password.",
|
|
49
67
|
"resendEmailNotification": {
|
|
50
68
|
"informationText": "This account is not confirmed.",
|
|
51
|
-
"buttonText": "
|
|
52
|
-
"additionalText": "to resend confirmation email."
|
|
69
|
+
"buttonText": "Resend confirmation email"
|
|
53
70
|
},
|
|
54
71
|
"emailConfirmationMessage": "Please check your email for confirmation link.",
|
|
55
72
|
"technicalErrors": {
|
|
@@ -57,16 +74,19 @@ declare const _default: {
|
|
|
57
74
|
}
|
|
58
75
|
},
|
|
59
76
|
"SuccessNotification": {
|
|
60
|
-
"headingText":"Welcome!",
|
|
61
|
-
"messageText":"We are glad to see you!",
|
|
62
|
-
"primaryButtonText":"Continue shopping",
|
|
63
|
-
"secondaryButtonText":"Logout"
|
|
77
|
+
"headingText": "Welcome!",
|
|
78
|
+
"messageText": "We are glad to see you!",
|
|
79
|
+
"primaryButtonText": "Continue shopping",
|
|
80
|
+
"secondaryButtonText": "Logout"
|
|
64
81
|
},
|
|
65
82
|
"Api": {
|
|
66
83
|
"customerTokenErrorMessage": "Unable to log in. Please try again later or contact support if the issue persists."
|
|
84
|
+
},
|
|
85
|
+
"InputPassword": {
|
|
86
|
+
"placeholder": "Password",
|
|
87
|
+
"floatingLabel": "Password *"
|
|
67
88
|
}
|
|
68
89
|
}
|
|
69
|
-
}
|
|
70
|
-
;
|
|
90
|
+
};
|
|
71
91
|
|
|
72
92
|
export default _default;
|
package/lib/acdl.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ declare enum EventsList {
|
|
|
3
3
|
SIGN_IN = "sign-in",
|
|
4
4
|
SIGN_OUT = "sign-out"
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
declare function pushEvent(event: string): void;
|
|
7
7
|
declare const publishEvents: (eventType: string, eventParams: any) => null | undefined;
|
|
8
|
-
export { EventsList, publishEvents };
|
|
8
|
+
export { EventsList, publishEvents, pushEvent };
|
|
9
9
|
//# sourceMappingURL=acdl.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const convertToCamelCase: (key: string) => string;
|
|
2
|
+
export declare const convertToSnakeCase: (key: string) => string;
|
|
3
|
+
export declare const convertKeysCase: (data: any, type: 'snakeCase' | 'camelCase', dictionary?: Record<string, string>) => any;
|
|
4
|
+
//# sourceMappingURL=convertCase.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const _default: (fieldsConfig: Array<{
|
|
2
|
+
customUpperCode?: string;
|
|
3
|
+
required?: boolean;
|
|
4
|
+
defaultValue?: unknown;
|
|
5
|
+
}>) => {
|
|
6
|
+
initialData: Record<string, unknown>;
|
|
7
|
+
errorList: Record<string, string>;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
10
|
+
//# sourceMappingURL=initializeFormDataAndErrors.d.ts.map
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export declare const mergeFormObjects: (obj: Record<string, unknown>, apiVersion2: boolean) => any;
|
|
1
|
+
export declare const mergeFormObjects: (input: Record<string, any>, apiVersion2: boolean) => any;
|
|
3
2
|
//# sourceMappingURL=mergeFormObjects.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const simplifyTransformAttributesForm: (defaultSignUpFields: any) => import('../data/models').
|
|
1
|
+
export declare const simplifyTransformAttributesForm: (defaultSignUpFields: any) => import('../data/models').AttributesFormModel[];
|
|
2
2
|
//# sourceMappingURL=simplifyTransformAttributesForm.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
type TranslationList = Record<string, string>;
|
|
2
|
+
type ErrorsList = Record<string, string>;
|
|
3
|
+
export type ValidationFieldsConfig = {
|
|
4
|
+
validateRules: Record<string, string>[];
|
|
5
|
+
code?: string;
|
|
6
|
+
customUpperCode: string;
|
|
7
|
+
required: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare enum InputValidation {
|
|
10
|
+
Numeric = "numeric",
|
|
11
|
+
AlphanumWithSpaces = "alphanum-with-spaces",
|
|
12
|
+
Alphanumeric = "alphanumeric",
|
|
13
|
+
Alpha = "alpha",
|
|
14
|
+
Email = "email",
|
|
15
|
+
Length = "length",
|
|
16
|
+
Date = "date",
|
|
17
|
+
Url = "url"
|
|
18
|
+
}
|
|
19
|
+
export declare const validateNumeric: (value: string) => boolean;
|
|
20
|
+
export declare const validateAlphanumWithSpaces: (value: string) => boolean;
|
|
21
|
+
export declare const validateAlphanumeric: (value: string) => boolean;
|
|
22
|
+
export declare const validateAlpha: (value: string) => boolean;
|
|
23
|
+
export declare const validateEmail: (value: string) => boolean;
|
|
24
|
+
export declare const validateDate: (value: string) => boolean;
|
|
25
|
+
export declare const isDateWithinRange: (date: string, minTimestamp?: number, maxTimestamp?: number) => boolean;
|
|
26
|
+
export declare const convertTimestampToDate: (timestamp: string | undefined | null) => string;
|
|
27
|
+
export declare const validateUrl: (url: string) => boolean;
|
|
28
|
+
export declare const validateLength: (value: string, minLength: number, maxLength: number) => boolean;
|
|
29
|
+
export declare const validationFields: (value: string, configs: ValidationFieldsConfig, translations: TranslationList, errorsList: ErrorsList) => {
|
|
30
|
+
[x: string]: string;
|
|
31
|
+
};
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=validationFields.d.ts.map
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name": "@dropins/storefront-auth", "version": "0.0
|
|
1
|
+
{"name": "@dropins/storefront-auth", "version": "1.0.0-beta2", "@dropins/elsie": "~0.37.0"}
|