@dropins/storefront-account 0.1.0-alpha2 → 0.1.0-alpha20
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 +116 -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 +184 -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 +8 -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/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 +36 -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,116 @@
|
|
|
1
|
+
import{events as C}from"@dropins/tools/event-bus.js";import{FetchGraphQL as T}from"@dropins/tools/fetch-graphql.js";const b=t=>t.replace(/_([a-z])/g,(e,r)=>r.toUpperCase()),A=t=>t.replace(/([A-Z])/g,e=>`_${e.toLowerCase()}`),a=(t,e,r)=>{const n=["string","boolean","number"],o=e==="camelCase"?b:A;return Array.isArray(t)?t.map(i=>n.includes(typeof i)||i===null?i:typeof i=="object"?a(i,e,r):i):t!==null&&typeof t=="object"?Object.entries(t).reduce((i,[c,_])=>{const u=r&&r[c]?r[c]:o(c);return i[u]=n.includes(typeof _)||_===null?_:a(_,e,r),i},{}):t},{setEndpoint:x,setFetchGraphQlHeader:B,removeFetchGraphQlHeader:Q,setFetchGraphQlHeaders:j,fetchGraphQl:s,getConfig:k}=new T().getMethods(),p=`
|
|
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
|
+
`,R=`
|
|
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
|
+
`,f=t=>{throw t instanceof DOMException&&t.name==="AbortError"||C.emit("error",{source:"auth",type:"network",error:t}),t},h=t=>{const e=t.map(r=>r.message).join(" ");throw Error(e)},S=t=>{let e=[];for(const r of t)if(!(r.frontend_input!=="MULTILINE"||r.multiline_count<2))for(let n=2;n<=r.multiline_count;n++){const o={...r,is_required:!1,name:`${r.code}_multiline_${n}`,code:`${r.code}_multiline_${n}`,id:`${r.code}_multiline_${n}`};e.push(o)}return e},y=t=>{var i,c,_;const e=((c=(i=t==null?void 0:t.data)==null?void 0:i.attributesForm)==null?void 0:c.items)||[];if(!e.length)return[];const r=(_=e.filter(u=>{var l;return!((l=u.frontend_input)!=null&&l.includes("HIDDEN"))}))==null?void 0:_.map(({code:u,...l})=>{const m=u!=="country_id"?u:"country_code";return{...l,name:m,id:m,code:m}}),n=S(r);return r.concat(n).map(u=>{var g;const l=u.code==="middlename"?"middleName":u.code==="firstname"?"firstName":u.code==="lastname"?"lastName":b(u.code),m=(g=u.options)==null?void 0:g.map(E=>({isDefault:E.is_default,text:E.label,value:E.value}));return a({...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 e={};for(const r in t){const n=t[r];!Array.isArray(n)||n.length===0||(r==="custom_attributesV2"?n.forEach(o=>{typeof o=="object"&&"value"in o&&(e[o==null?void 0:o.code]=o==null?void 0:o.value)}):n.length>1?n.forEach((o,i)=>{i===0?e[r]=o:e[`${r}_multiline_${i+1}`]=o}):e[r]=n[0])}return e},d=t=>{var e,r,n;return a({firstname:(t==null?void 0:t.firstname)||"",lastname:(t==null?void 0:t.lastname)||"",city:(t==null?void 0:t.city)||"",company:(t==null?void 0:t.company)||"",country_code:(t==null?void 0:t.country_code)||"",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:((n=t==null?void 0:t.region)==null?void 0:n.region_id)||""},telephone:(t==null?void 0:t.telephone)||"",id:(t==null?void 0:t.id)||"",vat_id:(t==null?void 0:t.vat_id)||"",postcode:(t==null?void 0:t.postcode)||"",default_shipping:(t==null?void 0:t.default_shipping)||!1,default_billing:(t==null?void 0:t.default_billing)||!1,...v(t)},"camelCase",{})},O=t=>{var r,n;const e=((n=(r=t==null?void 0:t.data)==null?void 0:r.customer)==null?void 0:n.addresses)||[];return e.length?e.map(d).sort((o,i)=>(Number(i.defaultBilling)||Number(i.defaultShipping))-(Number(o.defaultBilling)||Number(o.defaultShipping))):[]},$=t=>{var c,_;if(!((_=(c=t==null?void 0:t.data)==null?void 0:c.countries)!=null&&_.length))return{availableCountries:[],countriesWithRequiredRegion:[],optionalZipCountries:[]};const{countries:e,storeConfig:r}=t.data,n=r==null?void 0:r.countries_with_required_region.split(","),o=r==null?void 0:r.optional_zip_countries.split(",");return{availableCountries:e.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:n,optionalZipCountries:o}},N=t=>{var r,n;return(n=(r=t==null?void 0:t.data)==null?void 0:r.country)!=null&&n.available_regions?t.data.country.available_regions.filter(o=>{if(!o)return!1;const{id:i,code:c,name:_}=o;return!!(i&&c&&_)}).map(o=>{const{id:i}=o;return{id:i,text:o.name,value:`${o.code},${o.id}`}}):[]},H=async t=>await s(t!=="shortRequest"?p:R,{method:"GET",cache:"force-cache",variables:{formCode:t}}).then(e=>{var r;return(r=e.errors)!=null&&r.length?h(e.errors):y(e)}).catch(f),G=`
|
|
48
|
+
mutation CREATE_CUSTOMER_ADDRESS($input: CustomerAddressInput!) {
|
|
49
|
+
createCustomerAddress(input:$input) {
|
|
50
|
+
firstname
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
`,L=async t=>await s(G,{method:"POST",variables:{input:a(t,"snakeCase",{custom_attributesV2:"custom_attributesV2",firstName:"firstname",lastName:"lastname"})}}).then(e=>{var r,n,o;return(r=e.errors)!=null&&r.length?h(e.errors):((o=(n=e==null?void 0:e.data)==null?void 0:n.createCustomerAddress)==null?void 0:o.firstname)||""}).catch(f),I=`
|
|
54
|
+
query GET_CUSTOMER_ADDRESS {
|
|
55
|
+
customer {
|
|
56
|
+
addresses {
|
|
57
|
+
firstname
|
|
58
|
+
lastname
|
|
59
|
+
city
|
|
60
|
+
company
|
|
61
|
+
country_code
|
|
62
|
+
region {
|
|
63
|
+
region
|
|
64
|
+
region_code
|
|
65
|
+
region_id
|
|
66
|
+
}
|
|
67
|
+
custom_attributesV2 {
|
|
68
|
+
... on AttributeValue {
|
|
69
|
+
code
|
|
70
|
+
value
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
telephone
|
|
74
|
+
id
|
|
75
|
+
vat_id
|
|
76
|
+
postcode
|
|
77
|
+
street
|
|
78
|
+
default_shipping
|
|
79
|
+
default_billing
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
`,P=async()=>await s(I,{method:"GET",cache:"no-cache"}).then(t=>{var e;return(e=t.errors)!=null&&e.length?h(t.errors):O(t)}).catch(f),M=`
|
|
84
|
+
query GET_COUNTRIES_QUERY {
|
|
85
|
+
countries {
|
|
86
|
+
two_letter_abbreviation
|
|
87
|
+
full_name_locale
|
|
88
|
+
}
|
|
89
|
+
storeConfig {
|
|
90
|
+
countries_with_required_region
|
|
91
|
+
optional_zip_countries
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
`,z=async()=>await s(M,{method:"GET",cache:"no-cache"}).then(t=>{var e;return(e=t.errors)!=null&&e.length?h(t.errors):$(t)}).catch(f),U=`
|
|
95
|
+
query GET_REGIONS($countryCode: String!) {
|
|
96
|
+
country(id: $countryCode) {
|
|
97
|
+
id
|
|
98
|
+
available_regions {
|
|
99
|
+
id
|
|
100
|
+
code
|
|
101
|
+
name
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
`,Z=async t=>await s(U,{method:"GET",cache:"no-cache",variables:{countryCode:t}}).then(e=>{var r;return(r=e.errors)!=null&&r.length?h(e.errors):N(e)}).catch(f),w=`
|
|
106
|
+
mutation UPDATE_CUSTOMER_ADDRESS($id: Int!,
|
|
107
|
+
$input: CustomerAddressInput) {
|
|
108
|
+
updateCustomerAddress(id:$id, input:$input) {
|
|
109
|
+
firstname
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
`,K=async t=>{const{addressId:e,...r}=t;return e?await s(w,{method:"POST",variables:{id:e,input:a(r,"snakeCase",{custom_attributesV2:"custom_attributesV2",firstName:"firstname",lastName:"lastname"})}}).then(n=>{var o,i,c;return(o=n.errors)!=null&&o.length?h(n.errors):((c=(i=n==null?void 0:n.data)==null?void 0:i.updateCustomerAddress)==null?void 0:c.firstname)||""}).catch(f):""},q=`
|
|
113
|
+
mutation REMOVE_CUSTOMER_ADDRESS($id: Int!) {
|
|
114
|
+
deleteCustomerAddress(id:$id)
|
|
115
|
+
}
|
|
116
|
+
`,W=async t=>await s(q,{method:"POST",variables:{id:t}}).then(e=>{var r;return(r=e.errors)!=null&&r.length?h(e.errors):e.data.deleteCustomerAddress}).catch(f);export{B as a,j as b,H as c,L as d,P as e,s as f,k as g,z as h,Z as i,W as j,a as k,h as l,f as m,b as n,A as o,Q as r,x as s,d as t,K 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,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,184 @@
|
|
|
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
|
+
};
|
|
98
|
+
export declare const mockResponseAddressWithText: {
|
|
99
|
+
firstname: string;
|
|
100
|
+
lastname: string;
|
|
101
|
+
city: string;
|
|
102
|
+
company: string;
|
|
103
|
+
country_code: string;
|
|
104
|
+
region: {
|
|
105
|
+
region: string;
|
|
106
|
+
region_code: string;
|
|
107
|
+
region_id: number;
|
|
108
|
+
};
|
|
109
|
+
telephone: string;
|
|
110
|
+
id: string;
|
|
111
|
+
vat_id: string;
|
|
112
|
+
postcode: string;
|
|
113
|
+
street: string[];
|
|
114
|
+
default_shipping: boolean;
|
|
115
|
+
default_billing: boolean;
|
|
116
|
+
custom_attributesV2: never[];
|
|
117
|
+
};
|
|
118
|
+
export declare const mockResponseAddressEmpty: {
|
|
119
|
+
firstname: string;
|
|
120
|
+
lastname: string;
|
|
121
|
+
city: string;
|
|
122
|
+
company: string;
|
|
123
|
+
country_code: string;
|
|
124
|
+
region: {
|
|
125
|
+
region: string;
|
|
126
|
+
region_code: string;
|
|
127
|
+
region_id: string;
|
|
128
|
+
};
|
|
129
|
+
telephone: string;
|
|
130
|
+
id: string;
|
|
131
|
+
vat_id: string;
|
|
132
|
+
postcode: string;
|
|
133
|
+
street: string[];
|
|
134
|
+
default_shipping: boolean;
|
|
135
|
+
default_billing: boolean;
|
|
136
|
+
custom_attributesV2: never[];
|
|
137
|
+
};
|
|
138
|
+
export declare const mockDefaultAddressEmpty: {
|
|
139
|
+
firstname: string;
|
|
140
|
+
lastname: string;
|
|
141
|
+
city: string;
|
|
142
|
+
company: string;
|
|
143
|
+
countryCode: string;
|
|
144
|
+
region: {
|
|
145
|
+
region: string;
|
|
146
|
+
regionCode: string;
|
|
147
|
+
regionId: string;
|
|
148
|
+
};
|
|
149
|
+
telephone: string;
|
|
150
|
+
id: string;
|
|
151
|
+
vatId: string;
|
|
152
|
+
postcode: string;
|
|
153
|
+
street: string;
|
|
154
|
+
defaultShipping: boolean;
|
|
155
|
+
defaultBilling: boolean;
|
|
156
|
+
};
|
|
157
|
+
export declare const mockResponseCountries: {
|
|
158
|
+
two_letter_abbreviation: string;
|
|
159
|
+
full_name_locale: string;
|
|
160
|
+
}[];
|
|
161
|
+
export declare const mockResponseCountriesEmpty: {
|
|
162
|
+
two_letter_abbreviation: null;
|
|
163
|
+
full_name_locale: null;
|
|
164
|
+
}[];
|
|
165
|
+
export declare const mockDefaultCountries: {
|
|
166
|
+
value: string;
|
|
167
|
+
text: string;
|
|
168
|
+
}[];
|
|
169
|
+
export declare const mockResponseRegions: {
|
|
170
|
+
id: number;
|
|
171
|
+
code: string;
|
|
172
|
+
name: string;
|
|
173
|
+
}[];
|
|
174
|
+
export declare const mockResponseRegionsEmpty: {
|
|
175
|
+
id: null;
|
|
176
|
+
code: null;
|
|
177
|
+
name: null;
|
|
178
|
+
}[];
|
|
179
|
+
export declare const mockDefaultRegions: {
|
|
180
|
+
id: number;
|
|
181
|
+
value: string;
|
|
182
|
+
text: string;
|
|
183
|
+
}[];
|
|
184
|
+
//# sourceMappingURL=mockDefaultAddress.config.d.ts.map
|