@dropins/storefront-account 0.1.0-alpha2 → 0.1.0-alpha21
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/createCustomerAddress/createCustomerAddress.d.ts +4 -0
- package/api/createCustomerAddress/graphql/createCustomerAddress.graphql.d.ts +2 -0
- package/api/createCustomerAddress/index.d.ts +2 -0
- package/api/fetch-graphql/fetch-graphql.d.ts +8 -0
- package/api/fetch-graphql/index.d.ts +2 -0
- package/api/fragments/CustomerFragment.graphql.d.ts +2 -0
- package/api/getAttributesForm/getAttributesForm.d.ts +4 -0
- package/api/getAttributesForm/graphql/getAttributesForm.graphql.d.ts +3 -0
- package/api/getAttributesForm/index.d.ts +2 -0
- package/api/getCountries/getCountries.d.ts +9 -0
- package/api/getCountries/graphql/getCountries.graphql.d.ts +2 -0
- package/api/getCountries/index.d.ts +2 -0
- package/api/getCustomer/getCustomer.d.ts +4 -0
- package/api/getCustomer/graphql/getCustomer.graphql.d.ts +2 -0
- package/api/getCustomer/index.d.ts +2 -0
- package/api/getCustomerAddress/getCustomerAddress.d.ts +4 -0
- package/api/getCustomerAddress/graphql/getCustomerAddress.graphql.d.ts +2 -0
- package/api/getCustomerAddress/index.d.ts +2 -0
- package/api/getOrderHistoryList/getOrderHistoryList.d.ts +4 -0
- package/api/getOrderHistoryList/graphql/customerAddressFragment.graphql.d.ts +2 -0
- package/api/getOrderHistoryList/graphql/getOrderHistoryList.graphql.d.ts +2 -0
- package/api/getOrderHistoryList/graphql/orderSummaryFragment.graphql.d.ts +2 -0
- package/api/getOrderHistoryList/index.d.ts +2 -0
- package/api/getRegions/getRegions.d.ts +5 -0
- package/api/getRegions/graphql/getRegions.graphql.d.ts +2 -0
- package/api/getRegions/index.d.ts +2 -0
- package/api/getStoreConfig/getStoreConfig.d.ts +4 -0
- package/api/getStoreConfig/graphql/getStoreConfig.graphql.d.ts +2 -0
- package/api/getStoreConfig/index.d.ts +2 -0
- package/api/index.d.ts +16 -0
- package/api/initialize/index.d.ts +2 -0
- package/api/initialize/initialize.d.ts +14 -0
- package/api/removeCustomerAddress/graphql/removeCustomerAddress.graphql.d.ts +2 -0
- package/api/removeCustomerAddress/index.d.ts +2 -0
- package/api/removeCustomerAddress/removeCustomerAddress.d.ts +2 -0
- package/api/updateCustomer/graphql/updateCustomer.graphql.d.ts +2 -0
- package/api/updateCustomer/index.d.ts +2 -0
- package/api/updateCustomer/updateCustomer.d.ts +2 -0
- package/api/updateCustomerAddress/graphql/updateCustomerAddress.graphql.d.ts +2 -0
- package/api/updateCustomerAddress/index.d.ts +2 -0
- package/api/updateCustomerAddress/updateCustomerAddress.d.ts +8 -0
- package/api/updateCustomerEmail/graphql/updateCustomerEmail.graphql.d.ts +2 -0
- package/api/updateCustomerEmail/index.d.ts +2 -0
- package/api/updateCustomerEmail/updateCustomerEmail.d.ts +5 -0
- package/api/updateCustomerPassword/graphql/updateCustomerPassword.graphql.d.ts +2 -0
- package/api/updateCustomerPassword/index.d.ts +2 -0
- package/api/updateCustomerPassword/updateCustomerPassword.d.ts +4 -0
- package/api.d.ts +1 -0
- package/api.js +1 -2
- package/chunks/CustomerInformationCard.js +1 -0
- package/chunks/getOrderHistoryList.js +124 -0
- package/chunks/removeCustomerAddress.js +120 -0
- package/chunks/updateCustomer.js +57 -0
- package/components/AccountLoaders/AccountLoaders.d.ts +8 -0
- package/components/AccountLoaders/index.d.ts +3 -0
- package/components/AddressActions/AddressActions.d.ts +5 -0
- package/components/AddressActions/index.d.ts +3 -0
- package/components/AddressCard/AddressCard.d.ts +5 -0
- package/components/AddressCard/index.d.ts +3 -0
- package/components/AddressFormWrapper/AddressFormWrapper.d.ts +5 -0
- package/components/AddressFormWrapper/index.d.ts +3 -0
- package/components/AddressModal/AddressModal.d.ts +5 -0
- package/components/AddressModal/index.d.ts +3 -0
- package/components/AddressesWrapper/AddressesWrapper.d.ts +5 -0
- package/components/AddressesWrapper/index.d.ts +3 -0
- package/components/ChangePassword/ChangePassword.d.ts +5 -0
- package/components/ChangePassword/index.d.ts +3 -0
- package/components/CustomerInformationCard/CustomerInformationCard.d.ts +5 -0
- package/components/CustomerInformationCard/index.d.ts +3 -0
- package/components/EditCustomerInformation/EditCustomerInformation.d.ts +5 -0
- package/components/EditCustomerInformation/index.d.ts +3 -0
- package/components/EmptyList/EmptyList.d.ts +5 -0
- package/components/EmptyList/index.d.ts +3 -0
- package/components/Form/Form.d.ts +6 -0
- package/components/Form/FormInputs/FormInputs.d.ts +5 -0
- package/components/Form/FormInputs/index.d.ts +3 -0
- package/components/Form/index.d.ts +3 -0
- package/components/OrdersListAction/OrdersListAction.d.ts +5 -0
- package/components/OrdersListAction/index.d.ts +3 -0
- package/components/OrdersListCard/OrdersListCard.d.ts +5 -0
- package/components/OrdersListCard/index.d.ts +3 -0
- package/components/OrdersListWrapper/OrdersListWrapper.d.ts +5 -0
- package/components/OrdersListWrapper/index.d.ts +3 -0
- package/components/index.d.ts +16 -0
- package/configs/addressField.config.d.ts +39 -0
- package/configs/defaultAttributePreset.config.d.ts +3 -0
- package/configs/mockDefaultAddress.config.d.ts +153 -0
- package/configs/mockOrdersList.config.d.ts +205 -0
- package/containers/AddressForm/AddressForm.d.ts +5 -0
- package/containers/AddressForm/index.d.ts +3 -0
- package/containers/AddressForm.d.ts +3 -0
- package/containers/AddressForm.js +1 -0
- package/containers/Addresses/Addresses.d.ts +5 -0
- package/containers/Addresses/index.d.ts +3 -0
- package/containers/Addresses.d.ts +3 -0
- package/containers/Addresses.js +1 -0
- package/containers/CustomerInformation/CustomerInformation.d.ts +5 -0
- package/containers/CustomerInformation/index.d.ts +3 -0
- package/containers/CustomerInformation.d.ts +3 -0
- package/containers/CustomerInformation.js +1 -0
- package/containers/OrdersList/OrdersList.d.ts +5 -0
- package/containers/OrdersList/index.d.ts +3 -0
- package/containers/OrdersList.d.ts +3 -0
- package/containers/OrdersList.js +1 -0
- package/containers/index.d.ts +5 -0
- package/data/models/attributes-form.d.ts +46 -0
- package/data/models/country.d.ts +5 -0
- package/data/models/customer-address.d.ts +21 -0
- package/data/models/customer.d.ts +14 -0
- package/data/models/index.d.ts +7 -0
- package/data/models/order-history-list.d.ts +80 -0
- package/data/models/region.d.ts +11 -0
- package/data/models/store-config.d.ts +5 -0
- package/data/transforms/index.d.ts +8 -0
- package/data/transforms/transform-attributes-form.d.ts +6 -0
- package/data/transforms/transform-countries.d.ts +10 -0
- package/data/transforms/transform-customer-address.d.ts +7 -0
- package/data/transforms/transform-customer.d.ts +5 -0
- package/data/transforms/transform-order-history-list.d.ts +5 -0
- package/data/transforms/transform-regions.d.ts +6 -0
- package/data/transforms/transform-store-config.d.ts +5 -0
- package/hooks/components/useChangePassword.d.ts +26 -0
- package/hooks/components/useForm.d.ts +14 -0
- package/hooks/components/usePasswordValidationMessage.d.ts +16 -0
- package/hooks/containers/useAddressForm.d.ts +31 -0
- package/hooks/containers/useAddresses.d.ts +24 -0
- package/hooks/containers/useCustomerInformation.d.ts +50 -0
- package/hooks/containers/useGetStoreConfigs.d.ts +7 -0
- package/hooks/containers/useOrderSelectList.d.ts +12 -0
- package/hooks/containers/useOrdersList.d.ts +13 -0
- package/hooks/useDebounce.d.ts +3 -0
- package/hooks/useInLineAlert.d.ts +7 -0
- package/hooks/useIsMobile.d.ts +2 -0
- package/i18n/en_US.json.d.ts +170 -0
- package/lib/areRequiredFieldsValid.d.ts +6 -0
- package/lib/checkIsFunction.d.ts +2 -0
- package/lib/convertCase.d.ts +4 -0
- package/lib/convertToBoolean.d.ts +2 -0
- package/lib/convertToInputDateFormat.d.ts +2 -0
- package/lib/fetch-error.d.ts +5 -0
- package/lib/formatDateToLocale.d.ts +31 -0
- package/lib/getDateRange.d.ts +10 -0
- package/lib/getFieldsConfig.d.ts +4 -0
- package/lib/getFormValues.d.ts +2 -0
- package/lib/getFormValuesFromRef.d.ts +5 -0
- package/lib/initializeFormDataAndErrors.d.ts +10 -0
- package/lib/manageAddressDeletion.d.ts +9 -0
- package/lib/network-error.d.ts +6 -0
- package/lib/normalizeAttributes.d.ts +2 -0
- package/lib/normalizeGetAddressData.d.ts +6 -0
- package/lib/prepareNormalizedData.d.ts +21 -0
- package/lib/serializeAddressForm.d.ts +4 -0
- package/lib/sortingAddressesList.d.ts +5 -0
- package/lib/transformDefaultValuesAddresses.d.ts +11 -0
- package/lib/transformSessionData.d.ts +6 -0
- package/lib/validationChangePassword.d.ts +17 -0
- package/lib/validationFields.d.ts +33 -0
- package/lib/validationUniqueSymbolsPassword.d.ts +2 -0
- package/package.json +1 -1
- package/render/Provider.d.ts +8 -0
- package/render/index.d.ts +2 -0
- package/render/render.d.ts +4 -0
- package/render.d.ts +1 -0
- package/render.js +3 -2
- package/types/addressForm.types.d.ts +46 -0
- package/types/addresses.types.d.ts +90 -0
- package/types/api/createCustomerAddress.types.d.ts +47 -0
- package/types/api/getAttributesForm.types.d.ts +31 -0
- package/types/api/getCountries.types.d.ts +19 -0
- package/types/api/getCustomer.types.d.ts +24 -0
- package/types/api/getCustomerAddress.type.d.ts +40 -0
- package/types/api/getOrderHistoryList.types.d.ts +91 -0
- package/types/api/getRegions.types.d.ts +16 -0
- package/types/api/removeCustomerAddress.types.d.ts +9 -0
- package/types/api/storeConfig.types.d.ts +13 -0
- package/types/api/updateCustomerAddress.types.d.ts +11 -0
- package/types/api/updateCustomerPassword.types.d.ts +15 -0
- package/types/customerInformation.types.d.ts +61 -0
- package/types/emptyList.types.d.ts +8 -0
- package/types/form.types.d.ts +56 -0
- package/types/index.d.ts +19 -0
- package/types/notification.types.d.ts +19 -0
- package/types/ordersList.types.d.ts +64 -0
- package/api.js.map +0 -1
- package/render.js.map +0 -1
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import{events as b}from"@dropins/tools/event-bus.js";import{FetchGraphQL as C}from"@dropins/tools/fetch-graphql.js";const S=t=>t.replace(/_([a-z])/g,(n,e)=>e.toUpperCase()),p=t=>t.replace(/([A-Z])/g,n=>`_${n.toLowerCase()}`),g=(t,n,e)=>{const r=["string","boolean","number"],o=n==="camelCase"?S:p;return Array.isArray(t)?t.map(i=>r.includes(typeof i)||i===null?i:typeof i=="object"?g(i,n,e):i):t!==null&&typeof t=="object"?Object.entries(t).reduce((i,[c,a])=>{const u=e&&e[c]?e[c]:o(c);return i[u]=r.includes(typeof a)||a===null?a:g(a,n,e),i},{}):t},{setEndpoint:k,setFetchGraphQlHeader:H,removeFetchGraphQlHeader:J,setFetchGraphQlHeaders:K,fetchGraphQl:s,getConfig:L}=new C().getMethods(),T=`
|
|
2
|
+
query GET_ATTRIBUTES_FORM($formCode: String!) {
|
|
3
|
+
attributesForm(formCode: $formCode) {
|
|
4
|
+
items {
|
|
5
|
+
code
|
|
6
|
+
default_value
|
|
7
|
+
entity_type
|
|
8
|
+
frontend_class
|
|
9
|
+
frontend_input
|
|
10
|
+
is_required
|
|
11
|
+
is_unique
|
|
12
|
+
label
|
|
13
|
+
options {
|
|
14
|
+
is_default
|
|
15
|
+
label
|
|
16
|
+
value
|
|
17
|
+
}
|
|
18
|
+
... on CustomerAttributeMetadata {
|
|
19
|
+
multiline_count
|
|
20
|
+
sort_order
|
|
21
|
+
validate_rules {
|
|
22
|
+
name
|
|
23
|
+
value
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
errors {
|
|
28
|
+
type
|
|
29
|
+
message
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
`,A=`
|
|
34
|
+
query GET_ATTRIBUTES_FORM_SHORT {
|
|
35
|
+
attributesForm(formCode: "customer_register_address") {
|
|
36
|
+
items {
|
|
37
|
+
frontend_input
|
|
38
|
+
label
|
|
39
|
+
code
|
|
40
|
+
... on CustomerAttributeMetadata {
|
|
41
|
+
multiline_count
|
|
42
|
+
sort_order
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
`,_=t=>{throw t instanceof DOMException&&t.name==="AbortError"||b.emit("error",{source:"auth",type:"network",error:t}),t},f=t=>{const n=t.map(e=>e.message).join(" ");throw Error(n)},y=t=>{let n=[];for(const e of t)if(!(e.frontend_input!=="MULTILINE"||e.multiline_count<2))for(let r=2;r<=e.multiline_count;r++){const o={...e,is_required:!1,name:`${e.code}_multiline_${r}`,code:`${e.code}_multiline_${r}`,id:`${e.code}_multiline_${r}`};n.push(o)}return n},R=t=>{var i,c,a;const n=((c=(i=t==null?void 0:t.data)==null?void 0:i.attributesForm)==null?void 0:c.items)||[];if(!n.length)return[];const e=(a=n.filter(u=>{var l;return!((l=u.frontend_input)!=null&&l.includes("HIDDEN"))}))==null?void 0:a.map(({code:u,...l})=>{const m=u!=="country_id"?u:"country_code";return{...l,name:m,id:m,code:m}}),r=y(e);return e.concat(r).map(u=>{var E;const l=u.code==="middlename"?"middleName":u.code==="firstname"?"firstName":u.code==="lastname"?"lastName":S(u.code),m=(E=u.options)==null?void 0:E.map(h=>({isDefault:h.is_default,text:h.label,value:h.value}));return g({...u,options:m,customUpperCode:l},"camelCase",{frontend_input:"fieldType",frontend_class:"className",is_required:"required",sort_order:"orderNumber"})}).sort((u,l)=>u.orderNumber-l.orderNumber)},v=t=>{const n={};for(const e in t){const r=t[e];!Array.isArray(r)||r.length===0||(e==="custom_attributesV2"?r.forEach(o=>{typeof o=="object"&&"value"in o&&(n[o==null?void 0:o.code]=o==null?void 0:o.value)}):r.length>1?r.forEach((o,i)=>{i===0?n[e]=o:n[`${e}_multiline_${i+1}`]=o}):n[e]=r[0])}return n},N=t=>({prefix:(t==null?void 0:t.prefix)??"",suffix:(t==null?void 0:t.suffix)??"",firstname:(t==null?void 0:t.firstname)??"",lastname:(t==null?void 0:t.lastname)??"",middlename:(t==null?void 0:t.middlename)??""}),O=t=>({id:(t==null?void 0:t.id)??"",vat_id:(t==null?void 0:t.vat_id)??"",postcode:(t==null?void 0:t.postcode)??"",country_code:(t==null?void 0:t.country_code)??""}),I=t=>({company:(t==null?void 0:t.company)??"",telephone:(t==null?void 0:t.telephone)??"",fax:(t==null?void 0:t.fax)??""}),$=t=>{var e,r,o;return g({...N(t),...O(t),...I(t),city:(t==null?void 0:t.city)??"",region:{region:((e=t==null?void 0:t.region)==null?void 0:e.region)??"",region_code:((r=t==null?void 0:t.region)==null?void 0:r.region_code)??"",region_id:((o=t==null?void 0:t.region)==null?void 0:o.region_id)??""},default_shipping:(t==null?void 0:t.default_shipping)||!1,default_billing:(t==null?void 0:t.default_billing)||!1,...v(t)},"camelCase",{})},G=t=>{var r,o;const n=((o=(r=t==null?void 0:t.data)==null?void 0:r.customer)==null?void 0:o.addresses)||[];return n.length?n.map($).sort((i,c)=>(Number(c.defaultBilling)||Number(c.defaultShipping))-(Number(i.defaultBilling)||Number(i.defaultShipping))):[]},M=t=>{var c,a;if(!((a=(c=t==null?void 0:t.data)==null?void 0:c.countries)!=null&&a.length))return{availableCountries:[],countriesWithRequiredRegion:[],optionalZipCountries:[]};const{countries:n,storeConfig:e}=t.data,r=e==null?void 0:e.countries_with_required_region.split(","),o=e==null?void 0:e.optional_zip_countries.split(",");return{availableCountries:n.filter(({two_letter_abbreviation:u,full_name_locale:l})=>!!(u&&l)).map(u=>{const{two_letter_abbreviation:l,full_name_locale:m}=u;return{value:l,text:m}}).sort((u,l)=>u.text.localeCompare(l.text)),countriesWithRequiredRegion:r,optionalZipCountries:o}},U=t=>{var e,r;return(r=(e=t==null?void 0:t.data)==null?void 0:e.country)!=null&&r.available_regions?t.data.country.available_regions.filter(o=>{if(!o)return!1;const{id:i,code:c,name:a}=o;return!!(i&&c&&a)}).map(o=>{const{id:i}=o;return{id:i,text:o.name,value:`${o.code},${o.id}`}}):[]},P=async t=>{const n=`_account_attributesForm_${t}`,e=sessionStorage.getItem(n);return e?JSON.parse(e):await s(t!=="shortRequest"?T:A,{method:"GET",cache:"force-cache",variables:{formCode:t}}).then(r=>{var i;if((i=r.errors)!=null&&i.length)return f(r.errors);const o=R(r);return sessionStorage.setItem(n,JSON.stringify(o)),o}).catch(_)},w=`
|
|
48
|
+
mutation CREATE_CUSTOMER_ADDRESS($input: CustomerAddressInput!) {
|
|
49
|
+
createCustomerAddress(input:$input) {
|
|
50
|
+
firstname
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
`,d=async t=>await s(w,{method:"POST",variables:{input:g(t,"snakeCase",{custom_attributesV2:"custom_attributesV2",firstName:"firstname",lastName:"lastname",middleName:"middlename"})}}).then(n=>{var e,r,o;return(e=n.errors)!=null&&e.length?f(n.errors):((o=(r=n==null?void 0:n.data)==null?void 0:r.createCustomerAddress)==null?void 0:o.firstname)||""}).catch(_),x=`
|
|
54
|
+
query GET_CUSTOMER_ADDRESS {
|
|
55
|
+
customer {
|
|
56
|
+
addresses {
|
|
57
|
+
firstname
|
|
58
|
+
lastname
|
|
59
|
+
middlename
|
|
60
|
+
fax
|
|
61
|
+
prefix
|
|
62
|
+
suffix
|
|
63
|
+
city
|
|
64
|
+
company
|
|
65
|
+
country_code
|
|
66
|
+
region {
|
|
67
|
+
region
|
|
68
|
+
region_code
|
|
69
|
+
region_id
|
|
70
|
+
}
|
|
71
|
+
custom_attributesV2 {
|
|
72
|
+
... on AttributeValue {
|
|
73
|
+
code
|
|
74
|
+
value
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
telephone
|
|
78
|
+
id
|
|
79
|
+
vat_id
|
|
80
|
+
postcode
|
|
81
|
+
street
|
|
82
|
+
default_shipping
|
|
83
|
+
default_billing
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
`,z=async()=>await s(x,{method:"GET",cache:"no-cache"}).then(t=>{var n;return(n=t.errors)!=null&&n.length?f(t.errors):G(t)}).catch(_),F=`
|
|
88
|
+
query GET_COUNTRIES_QUERY {
|
|
89
|
+
countries {
|
|
90
|
+
two_letter_abbreviation
|
|
91
|
+
full_name_locale
|
|
92
|
+
}
|
|
93
|
+
storeConfig {
|
|
94
|
+
countries_with_required_region
|
|
95
|
+
optional_zip_countries
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
`,Z=async()=>{const t="_account_countries",n=sessionStorage.getItem(t);return n?JSON.parse(n):await s(F,{method:"GET",cache:"no-cache"}).then(e=>{var o;if((o=e.errors)!=null&&o.length)return f(e.errors);const r=M(e);return sessionStorage.setItem(t,JSON.stringify(r)),r}).catch(_)},q=`
|
|
99
|
+
query GET_REGIONS($countryCode: String!) {
|
|
100
|
+
country(id: $countryCode) {
|
|
101
|
+
id
|
|
102
|
+
available_regions {
|
|
103
|
+
id
|
|
104
|
+
code
|
|
105
|
+
name
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
`,W=async t=>{const n=`_account_regions_${t}`,e=sessionStorage.getItem(n);return e?JSON.parse(e):await s(q,{method:"GET",cache:"no-cache",variables:{countryCode:t}}).then(r=>{var i;if((i=r.errors)!=null&&i.length)return f(r.errors);const o=U(r);return sessionStorage.setItem(n,JSON.stringify(o)),o}).catch(_)},V=`
|
|
110
|
+
mutation UPDATE_CUSTOMER_ADDRESS($id: Int!,
|
|
111
|
+
$input: CustomerAddressInput) {
|
|
112
|
+
updateCustomerAddress(id:$id, input:$input) {
|
|
113
|
+
firstname
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
`,Y=async t=>{const{addressId:n,...e}=t;return n?await s(V,{method:"POST",variables:{id:n,input:g(e,"snakeCase",{custom_attributesV2:"custom_attributesV2",firstName:"firstname",lastName:"lastname",middleName:"middlename"})}}).then(r=>{var o,i,c;return(o=r.errors)!=null&&o.length?f(r.errors):((c=(i=r==null?void 0:r.data)==null?void 0:i.updateCustomerAddress)==null?void 0:c.firstname)||""}).catch(_):""},B=`
|
|
117
|
+
mutation REMOVE_CUSTOMER_ADDRESS($id: Int!) {
|
|
118
|
+
deleteCustomerAddress(id:$id)
|
|
119
|
+
}
|
|
120
|
+
`,X=async t=>await s(B,{method:"POST",variables:{id:t}}).then(n=>{var e;return(e=n.errors)!=null&&e.length?f(n.errors):n.data.deleteCustomerAddress}).catch(_);export{H as a,K as b,P as c,d,z as e,s as f,L as g,Z as h,W as i,X as j,g as k,f as l,_ as m,S as n,p as o,J as r,k as s,$ as t,Y as u};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import{n as $,f as d,l,m as _,k as I}from"./removeCustomerAddress.js";const y=t=>{var r,m,u,c,i,h,C,f,o,e,E,g,T,S,w,n,O,P,b,A,R,U,N;const a=(u=(m=(r=t==null?void 0:t.data)==null?void 0:r.customer)==null?void 0:m.custom_attributes)==null?void 0:u.reduce((G,M)=>(G[$(M.code)]=M.value??"",G),{});return{email:((i=(c=t==null?void 0:t.data)==null?void 0:c.customer)==null?void 0:i.email)||"",firstName:((C=(h=t==null?void 0:t.data)==null?void 0:h.customer)==null?void 0:C.firstname)||"",lastName:((o=(f=t==null?void 0:t.data)==null?void 0:f.customer)==null?void 0:o.lastname)||"",middleName:((E=(e=t==null?void 0:t.data)==null?void 0:e.customer)==null?void 0:E.middlename)||"",gender:((T=(g=t==null?void 0:t.data)==null?void 0:g.customer)==null?void 0:T.gender)||"1",dob:((w=(S=t==null?void 0:t.data)==null?void 0:S.customer)==null?void 0:w.dob)||"",dateOfBirth:((O=(n=t==null?void 0:t.data)==null?void 0:n.customer)==null?void 0:O.date_of_birth)||"",prefix:((b=(P=t==null?void 0:t.data)==null?void 0:P.customer)==null?void 0:b.prefix)||"",suffix:((R=(A=t==null?void 0:t.data)==null?void 0:A.customer)==null?void 0:R.suffix)||"",createdAt:((N=(U=t==null?void 0:t.data)==null?void 0:U.customer)==null?void 0:N.created_at)||"",...a}},v=t=>{var a,r,m,u;return{minLength:+((r=(a=t==null?void 0:t.data)==null?void 0:a.storeConfig)==null?void 0:r.minimum_password_length)||3,requiredCharacterClasses:+((u=(m=t==null?void 0:t.data)==null?void 0:m.storeConfig)==null?void 0:u.required_character_classes_number)||0}},x=`
|
|
2
|
+
fragment BasicCustomerInfo on Customer {
|
|
3
|
+
date_of_birth
|
|
4
|
+
dob
|
|
5
|
+
email
|
|
6
|
+
firstname
|
|
7
|
+
gender
|
|
8
|
+
lastname
|
|
9
|
+
middlename
|
|
10
|
+
prefix
|
|
11
|
+
suffix
|
|
12
|
+
created_at
|
|
13
|
+
}
|
|
14
|
+
`,D=`
|
|
15
|
+
query GET_CUSTOMER {
|
|
16
|
+
customer {
|
|
17
|
+
...BasicCustomerInfo
|
|
18
|
+
custom_attributes {
|
|
19
|
+
... on AttributeValue {
|
|
20
|
+
code
|
|
21
|
+
value
|
|
22
|
+
}
|
|
23
|
+
code
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
${x}`,k=async()=>await d(D,{method:"GET",cache:"no-cache"}).then(t=>{var a;return(a=t.errors)!=null&&a.length?l(t.errors):y(t)}).catch(_),q=`
|
|
28
|
+
mutation CHANGE_CUSTOMER_PASSWORD($currentPassword: String!, $newPassword: String!) {
|
|
29
|
+
changeCustomerPassword(currentPassword: $currentPassword, newPassword: $newPassword) {
|
|
30
|
+
email
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
`,H=async({currentPassword:t,newPassword:a})=>await d(q,{method:"POST",variables:{currentPassword:t,newPassword:a}}).then(r=>{var m,u,c;return(m=r.errors)!=null&&m.length?l(r.errors):((c=(u=r==null?void 0:r.data)==null?void 0:u.changeCustomerPassword)==null?void 0:c.email)||""}).catch(_),F=`
|
|
34
|
+
query GET_STORE_CONFIG {
|
|
35
|
+
storeConfig {
|
|
36
|
+
autocomplete_on_storefront
|
|
37
|
+
minimum_password_length
|
|
38
|
+
required_character_classes_number
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
`,W=async()=>await d(F,{method:"GET",cache:"force-cache"}).then(t=>{var a;return(a=t.errors)!=null&&a.length?l(t.errors):v(t)}).catch(_),V=`
|
|
42
|
+
mutation UPDATE_CUSTOMER_EMAIL($email: String! $password: String!) {
|
|
43
|
+
updateCustomerEmail(email:$email password:$password) {
|
|
44
|
+
customer {
|
|
45
|
+
email
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
`,K=async({email:t,password:a})=>await d(V,{method:"POST",variables:{email:t,password:a}}).then(r=>{var m,u,c,i;return(m=r.errors)!=null&&m.length?l(r.errors):((i=(c=(u=r==null?void 0:r.data)==null?void 0:u.updateCustomerEmail)==null?void 0:c.customer)==null?void 0:i.email)||""}).catch(_),B=`
|
|
50
|
+
mutation UPDATE_CUSTOMER_V2($input: CustomerUpdateInput!) {
|
|
51
|
+
updateCustomerV2(input:$input) {
|
|
52
|
+
customer {
|
|
53
|
+
email
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
`,Q=async t=>await d(B,{method:"POST",variables:{input:I(t,"snakeCase",{firstName:"firstname",lastName:"lastname",middleName:"middlename",custom_attributesV2:"custom_attributes"})}}).then(a=>{var r,m,u,c;return(r=a.errors)!=null&&r.length?l(a.errors):((c=(u=(m=a==null?void 0:a.data)==null?void 0:m.updateCustomerV2)==null?void 0:u.customer)==null?void 0:c.email)||""}).catch(_);export{W as a,K as b,Q as c,k as g,H as u};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
export declare const CardLoader: ({ testId, withCard, }: {
|
|
3
|
+
testId?: string | undefined;
|
|
4
|
+
withCard?: boolean | undefined;
|
|
5
|
+
}) => import("preact").JSX.Element;
|
|
6
|
+
export declare const AddressFormLoader: () => import("preact").JSX.Element;
|
|
7
|
+
export declare const PickerLoader: (props: any) => import("preact").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=AccountLoaders.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from '../containers/AddressForm';
|
|
2
|
+
export * from './Form';
|
|
3
|
+
export * from './Form/FormInputs';
|
|
4
|
+
export * from './AddressCard';
|
|
5
|
+
export * from './AddressActions';
|
|
6
|
+
export * from './AddressModal';
|
|
7
|
+
export * from './EmptyList';
|
|
8
|
+
export * from './OrdersListAction';
|
|
9
|
+
export * from './OrdersListCard';
|
|
10
|
+
export * from './AccountLoaders';
|
|
11
|
+
export * from './AddressesWrapper';
|
|
12
|
+
export * from './AddressFormWrapper';
|
|
13
|
+
export * from './ChangePassword';
|
|
14
|
+
export * from './EditCustomerInformation';
|
|
15
|
+
export * from './CustomerInformationCard';
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { FieldEnumList } from '../data/models';
|
|
2
|
+
|
|
3
|
+
export declare const defaultShippingCheckBox: {
|
|
4
|
+
label: string;
|
|
5
|
+
name: string;
|
|
6
|
+
id: string;
|
|
7
|
+
code: string;
|
|
8
|
+
customUpperCode: string;
|
|
9
|
+
entityType: string;
|
|
10
|
+
isUnique: boolean;
|
|
11
|
+
options: never[];
|
|
12
|
+
multilineCount: number;
|
|
13
|
+
validateRules: never[];
|
|
14
|
+
defaultValue: boolean;
|
|
15
|
+
fieldType: FieldEnumList;
|
|
16
|
+
className: string;
|
|
17
|
+
required: boolean;
|
|
18
|
+
orderNumber: number;
|
|
19
|
+
isHidden: boolean;
|
|
20
|
+
};
|
|
21
|
+
export declare const defaultBillingCheckBox: {
|
|
22
|
+
label: string;
|
|
23
|
+
name: string;
|
|
24
|
+
id: string;
|
|
25
|
+
code: string;
|
|
26
|
+
customUpperCode: string;
|
|
27
|
+
entityType: string;
|
|
28
|
+
isUnique: boolean;
|
|
29
|
+
options: never[];
|
|
30
|
+
multilineCount: number;
|
|
31
|
+
validateRules: never[];
|
|
32
|
+
defaultValue: boolean;
|
|
33
|
+
fieldType: FieldEnumList;
|
|
34
|
+
className: string;
|
|
35
|
+
required: boolean;
|
|
36
|
+
orderNumber: number;
|
|
37
|
+
isHidden: boolean;
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=addressField.config.d.ts.map
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
export declare const mockResponseInputFieldsList: ({
|
|
2
|
+
default_value: null;
|
|
3
|
+
entity_type: string;
|
|
4
|
+
frontend_class: null;
|
|
5
|
+
frontend_input: string;
|
|
6
|
+
required: boolean;
|
|
7
|
+
is_unique: boolean;
|
|
8
|
+
label: string;
|
|
9
|
+
options: never[];
|
|
10
|
+
multiline_count: number;
|
|
11
|
+
sort_order: number;
|
|
12
|
+
validate_rules: never[];
|
|
13
|
+
name: string;
|
|
14
|
+
id: string;
|
|
15
|
+
code: string;
|
|
16
|
+
isHidden?: undefined;
|
|
17
|
+
} | {
|
|
18
|
+
default_value: boolean;
|
|
19
|
+
entity_type: string;
|
|
20
|
+
is_unique: boolean;
|
|
21
|
+
options: never[];
|
|
22
|
+
multiline_count: number;
|
|
23
|
+
validate_rules: never[];
|
|
24
|
+
frontend_input: string;
|
|
25
|
+
frontend_class: string;
|
|
26
|
+
required: boolean;
|
|
27
|
+
sort_order: number;
|
|
28
|
+
isHidden: boolean;
|
|
29
|
+
label: string;
|
|
30
|
+
name: string;
|
|
31
|
+
id: string;
|
|
32
|
+
code: string;
|
|
33
|
+
})[];
|
|
34
|
+
export declare const mockInputFieldsList: ({
|
|
35
|
+
defaultValue: null;
|
|
36
|
+
entityType: string;
|
|
37
|
+
className: null;
|
|
38
|
+
fieldType: string;
|
|
39
|
+
required: boolean;
|
|
40
|
+
isUnique: boolean;
|
|
41
|
+
label: string;
|
|
42
|
+
options: never[];
|
|
43
|
+
multilineCount: number;
|
|
44
|
+
orderNumber: number;
|
|
45
|
+
validateRules: never[];
|
|
46
|
+
name: string;
|
|
47
|
+
id: string;
|
|
48
|
+
code: string;
|
|
49
|
+
customUpperCode: string;
|
|
50
|
+
isHidden?: undefined;
|
|
51
|
+
} | {
|
|
52
|
+
entityType: string;
|
|
53
|
+
isUnique: boolean;
|
|
54
|
+
options: never[];
|
|
55
|
+
multilineCount: number;
|
|
56
|
+
validateRules: never[];
|
|
57
|
+
defaultValue: boolean;
|
|
58
|
+
fieldType: string;
|
|
59
|
+
className: string;
|
|
60
|
+
required: boolean;
|
|
61
|
+
orderNumber: number;
|
|
62
|
+
isHidden: boolean;
|
|
63
|
+
label: string;
|
|
64
|
+
name: string;
|
|
65
|
+
id: string;
|
|
66
|
+
code: string;
|
|
67
|
+
customUpperCode: string;
|
|
68
|
+
})[];
|
|
69
|
+
export declare const mockKeysSortOrder: ({
|
|
70
|
+
name: string;
|
|
71
|
+
orderNumber: number;
|
|
72
|
+
label: null;
|
|
73
|
+
} | {
|
|
74
|
+
name: string;
|
|
75
|
+
orderNumber: number;
|
|
76
|
+
label: string;
|
|
77
|
+
})[];
|
|
78
|
+
export declare const mockDefaultAddress: {
|
|
79
|
+
firstname: string;
|
|
80
|
+
lastname: string;
|
|
81
|
+
city: string;
|
|
82
|
+
company: string;
|
|
83
|
+
countryCode: string;
|
|
84
|
+
region: {
|
|
85
|
+
region: string;
|
|
86
|
+
regionCode: string;
|
|
87
|
+
regionId: number;
|
|
88
|
+
};
|
|
89
|
+
telephone: string;
|
|
90
|
+
id: string;
|
|
91
|
+
vatId: string;
|
|
92
|
+
postcode: string;
|
|
93
|
+
street: string;
|
|
94
|
+
streetMultiline_2: string;
|
|
95
|
+
defaultShipping: boolean;
|
|
96
|
+
defaultBilling: boolean;
|
|
97
|
+
fax: string;
|
|
98
|
+
middlename: string;
|
|
99
|
+
prefix: string;
|
|
100
|
+
suffix: string;
|
|
101
|
+
};
|
|
102
|
+
export declare const mockResponseAddressWithText: {
|
|
103
|
+
firstname: string;
|
|
104
|
+
lastname: string;
|
|
105
|
+
city: string;
|
|
106
|
+
company: string;
|
|
107
|
+
country_code: string;
|
|
108
|
+
region: {
|
|
109
|
+
region: string;
|
|
110
|
+
region_code: string;
|
|
111
|
+
region_id: number;
|
|
112
|
+
};
|
|
113
|
+
telephone: string;
|
|
114
|
+
id: string;
|
|
115
|
+
vat_id: string;
|
|
116
|
+
postcode: string;
|
|
117
|
+
street: string[];
|
|
118
|
+
default_shipping: boolean;
|
|
119
|
+
default_billing: boolean;
|
|
120
|
+
custom_attributesV2: never[];
|
|
121
|
+
fax: string;
|
|
122
|
+
middlename: string;
|
|
123
|
+
prefix: string;
|
|
124
|
+
suffix: string;
|
|
125
|
+
};
|
|
126
|
+
export declare const mockResponseCountries: {
|
|
127
|
+
two_letter_abbreviation: string;
|
|
128
|
+
full_name_locale: string;
|
|
129
|
+
}[];
|
|
130
|
+
export declare const mockResponseCountriesEmpty: {
|
|
131
|
+
two_letter_abbreviation: null;
|
|
132
|
+
full_name_locale: null;
|
|
133
|
+
}[];
|
|
134
|
+
export declare const mockDefaultCountries: {
|
|
135
|
+
value: string;
|
|
136
|
+
text: string;
|
|
137
|
+
}[];
|
|
138
|
+
export declare const mockResponseRegions: {
|
|
139
|
+
id: number;
|
|
140
|
+
code: string;
|
|
141
|
+
name: string;
|
|
142
|
+
}[];
|
|
143
|
+
export declare const mockResponseRegionsEmpty: {
|
|
144
|
+
id: null;
|
|
145
|
+
code: null;
|
|
146
|
+
name: null;
|
|
147
|
+
}[];
|
|
148
|
+
export declare const mockDefaultRegions: {
|
|
149
|
+
id: number;
|
|
150
|
+
value: string;
|
|
151
|
+
text: string;
|
|
152
|
+
}[];
|
|
153
|
+
//# sourceMappingURL=mockDefaultAddress.config.d.ts.map
|