@remoteoss/remote-flows 0.4.0-alpha.2 → 0.4.0-alpha.4
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/dist/chunk-2SDJ4PZ5.js +2 -0
- package/dist/chunk-2SDJ4PZ5.js.map +1 -0
- package/dist/chunk-2URGWNSM.js +2 -0
- package/dist/chunk-2URGWNSM.js.map +1 -0
- package/dist/chunk-2Y22JKVE.js +2 -0
- package/dist/{chunk-QOMUXX6W.js → chunk-3PH5E6CZ.js} +2 -2
- package/dist/chunk-76JJOA3E.js +2 -0
- package/dist/{chunk-I6NVZI7W.js.map → chunk-76JJOA3E.js.map} +1 -1
- package/dist/{chunk-P2COURSU.js → chunk-7CP4PNU4.js} +2 -2
- package/dist/chunk-A36XQBXQ.js +2 -0
- package/dist/chunk-A36XQBXQ.js.map +1 -0
- package/dist/chunk-CXIHR6DZ.js +2 -0
- package/dist/chunk-CXIHR6DZ.js.map +1 -0
- package/dist/{chunk-5CJPGBXJ.js → chunk-FNTHWOZU.js} +2 -2
- package/dist/chunk-G7BISHWK.js +2 -0
- package/dist/chunk-G7BISHWK.js.map +1 -0
- package/dist/{chunk-GR6EY46K.js → chunk-GLCG6IVW.js} +2 -2
- package/dist/chunk-GMU3QGAR.js +2 -0
- package/dist/chunk-GMU3QGAR.js.map +1 -0
- package/dist/{chunk-CRHTUOZT.js → chunk-JT5XHQEY.js} +2 -2
- package/dist/{chunk-U25ZZ3LM.js → chunk-KGUR7YMA.js} +2 -2
- package/dist/{chunk-5OXN2O6C.js → chunk-MI3HDT5D.js} +2 -2
- package/dist/chunk-NNF342EY.js +2 -0
- package/dist/chunk-NNF342EY.js.map +1 -0
- package/dist/{chunk-KQ6TGZJS.js → chunk-NVMRRBRE.js} +2 -2
- package/dist/chunk-NVMRRBRE.js.map +1 -0
- package/dist/{chunk-7OMSCFTM.js → chunk-OXOB35EA.js} +2 -2
- package/dist/{chunk-UIAP5KT2.js → chunk-PBUHBIVK.js} +2 -2
- package/dist/chunk-PBWLAISE.js +2 -0
- package/dist/chunk-PBWLAISE.js.map +1 -0
- package/dist/{chunk-GQD6NNYO.js → chunk-PX72OIDO.js} +2 -2
- package/dist/{chunk-SMHHCUP4.js → chunk-PZ4HXIHQ.js} +2 -2
- package/dist/{chunk-LMDX5IAX.js → chunk-QOXOAPGX.js} +2 -2
- package/dist/{chunk-FZ2HS6G7.js → chunk-S4XU4SE7.js} +1 -1
- package/dist/chunk-S4XU4SE7.js.map +1 -0
- package/dist/{chunk-JFOOILST.js → chunk-T3PTQ4QM.js} +2 -2
- package/dist/{chunk-S4FKLPBB.js → chunk-TICIER55.js} +2 -2
- package/dist/chunk-U3I3TJKB.js +2 -0
- package/dist/chunk-U3I3TJKB.js.map +1 -0
- package/dist/{chunk-EDNELJVE.js → chunk-VT2PJJC7.js} +2 -2
- package/dist/chunk-VT2PJJC7.js.map +1 -0
- package/dist/{chunk-D3SD6MMV.js → chunk-WEIRXEXU.js} +2 -2
- package/dist/chunk-WVJDCDGZ.js +2 -0
- package/dist/chunk-WVJDCDGZ.js.map +1 -0
- package/dist/{chunk-Y477IGTZ.js → chunk-WZ5AXHQT.js} +2 -2
- package/dist/{chunk-TPPGI73P.js → chunk-XOUAD7MS.js} +2 -2
- package/dist/chunk-XZ4CTDOS.js +2 -0
- package/dist/chunk-XZ4CTDOS.js.map +1 -0
- package/dist/{chunk-LM5GAAUB.js → chunk-YIBRPAR3.js} +2 -2
- package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentForm.d.ts +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
- package/dist/flows/ContractAmendment/context.d.ts +2 -2
- package/dist/flows/ContractAmendment/hooks.d.ts +2 -2
- package/dist/flows/ContractAmendment/hooks.js +1 -1
- package/dist/flows/ContractAmendment/index.d.ts +1 -1
- package/dist/flows/ContractAmendment/index.js +1 -1
- package/dist/flows/ContractAmendment/types.d.ts +1 -1
- package/dist/flows/ContractAmendment/utils.d.ts +2 -2
- package/dist/flows/ContractAmendment/utils.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +1 -1
- package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +1 -1
- package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorResults.d.ts +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorResults.js +1 -1
- package/dist/flows/CostCalculator/context.d.ts +1 -1
- package/dist/flows/CostCalculator/hooks.d.ts +1 -1
- package/dist/flows/CostCalculator/hooks.js +1 -1
- package/dist/flows/CostCalculator/index.d.ts +1 -1
- package/dist/flows/CostCalculator/index.js +1 -1
- package/dist/flows/CostCalculator/types.d.ts +1 -1
- package/dist/flows/CostCalculator/utils.d.ts +1 -1
- package/dist/flows/CostCalculator/utils.js +1 -1
- package/dist/flows/Onboarding/BasicInformationStep.d.ts +1 -1
- package/dist/flows/Onboarding/BasicInformationStep.js +1 -1
- package/dist/flows/Onboarding/BenefitsStep.d.ts +3 -2
- package/dist/flows/Onboarding/BenefitsStep.js +1 -1
- package/dist/flows/Onboarding/ContractDetailsStep.d.ts +1 -1
- package/dist/flows/Onboarding/ContractDetailsStep.js +1 -1
- package/dist/flows/Onboarding/OnboardingFlow.d.ts +9 -4
- package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
- package/dist/flows/Onboarding/OnboardingForm.d.ts +3 -2
- package/dist/flows/Onboarding/OnboardingForm.js +1 -1
- package/dist/flows/Onboarding/OnboardingInvite.d.ts +1 -1
- package/dist/flows/Onboarding/OnboardingInvite.js +1 -1
- package/dist/flows/Onboarding/SelectCountryStep.d.ts +15 -0
- package/dist/flows/Onboarding/SelectCountryStep.js +2 -0
- package/dist/flows/Onboarding/SelectCountryStep.js.map +1 -0
- package/dist/flows/Onboarding/api.d.ts +114 -0
- package/dist/flows/Onboarding/api.js +2 -0
- package/dist/flows/Onboarding/api.js.map +1 -0
- package/dist/flows/Onboarding/context.d.ts +17 -5
- package/dist/flows/Onboarding/hooks.d.ts +38 -23
- package/dist/flows/Onboarding/hooks.js +1 -1
- package/dist/flows/Onboarding/index.d.ts +6 -4
- package/dist/flows/Onboarding/index.js +1 -1
- package/dist/flows/Onboarding/json-schemas/selectCountryStep.d.ts +24 -0
- package/dist/flows/Onboarding/json-schemas/selectCountryStep.js +2 -0
- package/dist/flows/Onboarding/json-schemas/selectCountryStep.js.map +1 -0
- package/dist/flows/Onboarding/types.d.ts +9 -3
- package/dist/flows/Onboarding/utils.d.ts +11 -3
- package/dist/flows/Onboarding/utils.js +1 -1
- package/dist/flows/Termination/AdditionalDetailsForm.d.ts +1 -1
- package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
- package/dist/flows/Termination/EmployeeComunicationForm.d.ts +1 -1
- package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
- package/dist/flows/Termination/PaidTimeOffForm.d.ts +1 -1
- package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
- package/dist/flows/Termination/TerminationDetailsForm.d.ts +1 -1
- package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
- package/dist/flows/Termination/TerminationFlow.d.ts +2 -1
- package/dist/flows/Termination/TerminationFlow.js +1 -1
- package/dist/flows/Termination/TerminationForm.d.ts +1 -1
- package/dist/flows/Termination/TerminationForm.js +1 -1
- package/dist/flows/Termination/TimeOff.d.ts +1 -1
- package/dist/flows/Termination/TimeOff.js +1 -1
- package/dist/flows/Termination/context.d.ts +3 -2
- package/dist/flows/Termination/hooks.d.ts +3 -2
- package/dist/flows/Termination/hooks.js +1 -1
- package/dist/flows/Termination/index.d.ts +2 -1
- package/dist/flows/Termination/index.js +1 -1
- package/dist/flows/Termination/json-schemas/schema.js +1 -1
- package/dist/flows/Termination/types.d.ts +1 -1
- package/dist/flows/Termination/utils.d.ts +1 -1
- package/dist/flows/Termination/utils.js +1 -1
- package/dist/flows/types.d.ts +1 -1
- package/dist/flows/useStepState.d.ts +10 -4
- package/dist/flows/useStepState.js +1 -1
- package/dist/flows/utils.d.ts +3 -11
- package/dist/flows/utils.js +1 -1
- package/dist/index.d.ts +9 -5
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/{remoteFlows-CswYencu.d.ts → remoteFlows-DN0q7MPW.d.ts} +1 -2
- package/dist/types-pzyQqNc8.d.ts +3 -0
- package/dist/{types.gen-D5alruJJ.d.ts → types.gen-CAOUvsW-.d.ts} +268 -2
- package/package.json +1 -1
- package/dist/chunk-2PXGLWCY.js +0 -2
- package/dist/chunk-2PXGLWCY.js.map +0 -1
- package/dist/chunk-2YWRQJ7P.js +0 -2
- package/dist/chunk-2YWRQJ7P.js.map +0 -1
- package/dist/chunk-36UPHOJS.js +0 -2
- package/dist/chunk-36UPHOJS.js.map +0 -1
- package/dist/chunk-DHRIURRT.js +0 -2
- package/dist/chunk-DHRIURRT.js.map +0 -1
- package/dist/chunk-EDNELJVE.js.map +0 -1
- package/dist/chunk-FZ2HS6G7.js.map +0 -1
- package/dist/chunk-HDQGO453.js +0 -2
- package/dist/chunk-HDQGO453.js.map +0 -1
- package/dist/chunk-HSW5HMHH.js +0 -2
- package/dist/chunk-I6NVZI7W.js +0 -2
- package/dist/chunk-KQ6TGZJS.js.map +0 -1
- package/dist/chunk-LCZQVL4U.js +0 -2
- package/dist/chunk-LCZQVL4U.js.map +0 -1
- package/dist/chunk-PKX5K2UY.js +0 -2
- package/dist/chunk-PKX5K2UY.js.map +0 -1
- package/dist/chunk-S56EWAS4.js +0 -2
- package/dist/chunk-S56EWAS4.js.map +0 -1
- /package/dist/{chunk-HSW5HMHH.js.map → chunk-2Y22JKVE.js.map} +0 -0
- /package/dist/{chunk-QOMUXX6W.js.map → chunk-3PH5E6CZ.js.map} +0 -0
- /package/dist/{chunk-P2COURSU.js.map → chunk-7CP4PNU4.js.map} +0 -0
- /package/dist/{chunk-5CJPGBXJ.js.map → chunk-FNTHWOZU.js.map} +0 -0
- /package/dist/{chunk-GR6EY46K.js.map → chunk-GLCG6IVW.js.map} +0 -0
- /package/dist/{chunk-CRHTUOZT.js.map → chunk-JT5XHQEY.js.map} +0 -0
- /package/dist/{chunk-U25ZZ3LM.js.map → chunk-KGUR7YMA.js.map} +0 -0
- /package/dist/{chunk-5OXN2O6C.js.map → chunk-MI3HDT5D.js.map} +0 -0
- /package/dist/{chunk-7OMSCFTM.js.map → chunk-OXOB35EA.js.map} +0 -0
- /package/dist/{chunk-UIAP5KT2.js.map → chunk-PBUHBIVK.js.map} +0 -0
- /package/dist/{chunk-GQD6NNYO.js.map → chunk-PX72OIDO.js.map} +0 -0
- /package/dist/{chunk-SMHHCUP4.js.map → chunk-PZ4HXIHQ.js.map} +0 -0
- /package/dist/{chunk-LMDX5IAX.js.map → chunk-QOXOAPGX.js.map} +0 -0
- /package/dist/{chunk-JFOOILST.js.map → chunk-T3PTQ4QM.js.map} +0 -0
- /package/dist/{chunk-S4FKLPBB.js.map → chunk-TICIER55.js.map} +0 -0
- /package/dist/{chunk-D3SD6MMV.js.map → chunk-WEIRXEXU.js.map} +0 -0
- /package/dist/{chunk-Y477IGTZ.js.map → chunk-WZ5AXHQT.js.map} +0 -0
- /package/dist/{chunk-TPPGI73P.js.map → chunk-XOUAD7MS.js.map} +0 -0
- /package/dist/{chunk-LM5GAAUB.js.map → chunk-YIBRPAR3.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./chunk-M22FKNEY.js";import{a as te}from"./chunk-
|
|
1
|
+
import"./chunk-M22FKNEY.js";import{a as te}from"./chunk-GLCG6IVW.js";import"./chunk-KSGPQCSG.js";import"./chunk-WEIRXEXU.js";import"./chunk-PBUHBIVK.js";import"./chunk-WWANHPT7.js";import"./chunk-2Y22JKVE.js";import"./chunk-JODJFARP.js";import"./chunk-W5DG5WWJ.js";import"./chunk-VX2UC3HG.js";import"./chunk-XSHHMBMT.js";import"./chunk-XFD3ULUF.js";import"./chunk-S4XU4SE7.js";import"./chunk-WZ5AXHQT.js";import"./chunk-T3PTQ4QM.js";import"./chunk-KGUR7YMA.js";import"./chunk-YOC3VDC7.js";import"./chunk-QOXOAPGX.js";import"./chunk-MI3HDT5D.js";import"./chunk-DZYFSFZ7.js";import"./chunk-GULCZWSK.js";import{a as oe}from"./chunk-CXIHR6DZ.js";import"./chunk-2SDJ4PZ5.js";import"./chunk-MHKNAQLP.js";import"./chunk-XZ4CTDOS.js";import"./chunk-PBWLAISE.js";import"./chunk-NNF342EY.js";import"./chunk-A36XQBXQ.js";import"./chunk-WVJDCDGZ.js";import"./chunk-YIBRPAR3.js";import"./chunk-FNTHWOZU.js";import"./chunk-OXOB35EA.js";import"./chunk-M7WCW7WD.js";import"./chunk-76JJOA3E.js";import"./chunk-WS3C3WIJ.js";import"./chunk-FGBEOUQK.js";import{a as S}from"./chunk-TICIER55.js";import"./chunk-J55S4SEH.js";import"./chunk-6A3F6JG6.js";import"./chunk-GMGKIQLI.js";import"./chunk-WQHKB5T7.js";import"./chunk-KH6QS5OU.js";import"./chunk-3FVI5JIC.js";import"./chunk-MESREYTZ.js";import{a as P}from"./chunk-XOUAD7MS.js";import{a as R}from"./chunk-7CYG2RHP.js";import{a as F}from"./chunk-EAAIAMTY.js";import"./chunk-A7ZJQCNU.js";import{a as E}from"./chunk-DGPRFQYK.js";import{a as _}from"./chunk-DYB3RWP7.js";import{a as z}from"./chunk-PX72OIDO.js";import"./chunk-OLJ2S6A6.js";import{b as y,c as k,e as C}from"./chunk-7CP4PNU4.js";import"./chunk-UPRUP24B.js";import"./chunk-G7BISHWK.js";import{a as ae}from"./chunk-PZ4HXIHQ.js";import{a as H}from"./chunk-XLFHHYVS.js";import{a as re}from"./chunk-VT2PJJC7.js";import{a as J,b as ee}from"./chunk-3PH5E6CZ.js";import"./chunk-JRQSZHUU.js";import"./chunk-NVMRRBRE.js";import{a as p}from"./chunk-GMU3QGAR.js";import"./chunk-2URGWNSM.js";import"./chunk-FMT2OTOL.js";import{a as Z}from"./chunk-BLPOQIGB.js";import{a as $}from"./chunk-JT5XHQEY.js";import"./chunk-U3I3TJKB.js";import"./chunk-GFBF55NR.js";import"./chunk-A4RX3KRZ.js";import{a as g,c as v}from"./chunk-WRDKLT4N.js";import"./chunk-56BNVYTD.js";import"./chunk-IDSJI7KQ.js";import"./chunk-N25EBX6R.js";import"./chunk-6HGUGIYJ.js";import{c as T}from"./chunk-5ETXP2QF.js";import{a}from"./chunk-AYDF3IFZ.js";import{QueryClient as L,QueryClientProvider as q}from"@tanstack/react-query";import n from"react";function l(e){let r=document.documentElement;Object.keys(e).forEach(t=>{let o=e[t];o&&r.style.setProperty(t,o)})}a(l,"setCssProperties");function B(e){let r={};return Object.keys(e).forEach(t=>{r[`--${t}`]=e[t]}),r}a(B,"mapThemeColors");function j(e){return{"--spacing":e}}a(j,"mapThemeSpacing");function M(e){return{"--radius":e}}a(M,"mapThemeBorderRadius");function I(e){return{"--fontSizeBase":e.fontSizeBase}}a(I,"mapThemeFont");function u(e){e?.colors&&l(B(e.colors)),e?.spacing&&l(j(e.spacing)),e?.borderRadius&&l(M(e.borderRadius)),e?.font&&l(I(e.font))}a(u,"applyTheme");import A,{createContext as N,useEffect as O,useMemo as U}from"react";var D=N({theme:{}});function h(e){O(()=>{e.theme&&Object.keys(e.theme).length>0&&u(e.theme)},[e.theme]);let r=U(()=>({theme:e.theme}),[e.theme]);return A.createElement(D.Provider,{value:r},e.children)}a(h,"ThemeProvider");var m={staging:"https://gateway.niceremote.com",partners:"https://gateway.partners.remote-sandbox.com",production:"https://gateway.remote.com"};import{createClient as K}from"@hey-api/client-fetch";import{useQuery as V}from"@tanstack/react-query";import{useRef as f}from"react";function W(e){try{return new URL(e),!0}catch{return!1}}a(W,"isValidUrl");var w=a(({auth:e,options:r})=>{let t=f(null),{refetch:o}=V({queryKey:["auth"],queryFn:e,enabled:!1}),s=r.isTestingMode?m.partners:"https://gateway.remote.com",c=p.getConfig(),b="0.4.0-alpha.4",d=!!r.proxy&&W(r.proxy.url);return r.proxy&&!d&&console.error("Invalid proxy URL provided. Using default base URL."),f(K({...c,headers:{...c.headers,...d?r.proxy?.headers:{},"X-Client-Name":"remote-flows-sdk","X-Client-Version":b},baseUrl:d?r.proxy?.url:s,auth:a(async()=>{function x(i){return!i||Date.now()+6e4>i}if(a(x,"hasTokenExpired"),!t.current||x(t.current.expiresAt)){let{data:i}=await o();i&&(t.current={accessToken:i.accessToken,expiresAt:Date.now()+i.expiresIn*1e3})}return t.current?.accessToken},"auth")}))},"useAuth");var Q=new L;function X({children:e,auth:r,isTestingMode:t,proxy:o}){let s=w({auth:r,options:{isTestingMode:!!t,proxy:o}});return n.createElement(v.Provider,{value:{client:s.current}},e)}a(X,"RemoteFlowContextWrapper");function Y({children:e,components:r}){return n.createElement(g.Provider,{value:r?{components:r}:{components:{}}},e)}a(Y,"FormFieldsProvider");function G({auth:e,children:r,components:t,isTestingMode:o=!1,theme:s,proxy:c}){return n.createElement(q,{client:Q},n.createElement(Y,{components:t},n.createElement(X,{isTestingMode:o,auth:e,proxy:c},n.createElement(h,{theme:s},r))))}a(G,"RemoteFlows");export{Z as ContractAmendmentConfirmationForm,ae as ContractAmendmentFlow,$ as ContractAmendmentForm,H as ContractAmendmentSubmit,E as CostCalculatorDisclaimer,z as CostCalculatorFlow,P as CostCalculatorForm,R as CostCalculatorResetButton,S as CostCalculatorResults,F as CostCalculatorSubmitButton,oe as OnboardingFlow,G as RemoteFlows,te as TerminationFlow,y as buildCostCalculatorEstimationPayload,_ as disclaimerData,T as transformYupErrorsIntoObject,re as useContractAmendment,C as useCostCalculator,k as useCostCalculatorEstimationPdf,J as useEmploymentQuery,ee as useTimeOffQuery};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/RemoteFlowsProvider.tsx","../src/lib/applyTheme.ts","../src/theme.tsx","../src/environments.ts","../src/useAuth.ts"],"sourcesContent":["import { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport type { PropsWithChildren } from 'react';\nimport React from 'react';\n\nimport { ThemeProvider } from '@/src/theme';\nimport { FormFieldsContext, RemoteFlowContext } from './context';\nimport { Components, RemoteFlowsSDKProps } from './types/remoteFlows';\nimport { useAuth } from './useAuth';\n\nconst queryClient = new QueryClient();\n\ntype RemoteFlowContextWrapperProps = {\n auth: RemoteFlowsSDKProps['auth'];\n children: React.ReactNode;\n isTestingMode?: RemoteFlowsSDKProps['isTestingMode'];\n proxy?: RemoteFlowsSDKProps['proxy'];\n};\n\nfunction RemoteFlowContextWrapper({\n children,\n auth,\n isTestingMode,\n proxy,\n}: RemoteFlowContextWrapperProps) {\n const remoteApiClient = useAuth({\n auth,\n options: {\n isTestingMode: !!isTestingMode,\n proxy,\n },\n });\n return (\n <RemoteFlowContext.Provider value={{ client: remoteApiClient.current }}>\n {children}\n </RemoteFlowContext.Provider>\n );\n}\n\nexport function FormFieldsProvider({\n children,\n components,\n}: PropsWithChildren<{\n components?: Components;\n}>) {\n return (\n <FormFieldsContext.Provider\n value={components ? { components } : { components: {} }}\n >\n {children}\n </FormFieldsContext.Provider>\n );\n}\n\nexport function RemoteFlows({\n auth,\n children,\n components,\n isTestingMode = false,\n theme,\n proxy,\n}: PropsWithChildren<RemoteFlowsSDKProps>) {\n return (\n <QueryClientProvider client={queryClient}>\n <FormFieldsProvider components={components}>\n <RemoteFlowContextWrapper\n isTestingMode={isTestingMode}\n auth={auth}\n proxy={proxy}\n >\n <ThemeProvider theme={theme}>{children}</ThemeProvider>\n </RemoteFlowContextWrapper>\n </FormFieldsProvider>\n </QueryClientProvider>\n );\n}\n","import {\n CssThemeBorder,\n CssThemeColors,\n CssThemeFont,\n CssThemeSpacing,\n ThemeColors,\n ThemeFont,\n ThemeProviderProps,\n} from '@/src/types/theme';\n\nfunction setCssProperties(variables: Record<string, string>) {\n const root = document.documentElement;\n Object.keys(variables).forEach((v) => {\n const propertyVal = variables[v];\n if (propertyVal) {\n root.style.setProperty(v, propertyVal);\n }\n });\n}\n\nfunction mapThemeColors(colors: ThemeColors): CssThemeColors {\n const result: CssThemeColors = {};\n Object.keys(colors).forEach((key) => {\n result[`--${key}` as keyof CssThemeColors] =\n colors[key as keyof ThemeColors];\n });\n return result;\n}\n\nfunction mapThemeSpacing(spacing: string): CssThemeSpacing {\n return {\n '--spacing': spacing,\n };\n}\n\nfunction mapThemeBorderRadius(borderRadius: string): CssThemeBorder {\n return {\n '--radius': borderRadius,\n };\n}\n\nfunction mapThemeFont(font: ThemeFont): CssThemeFont {\n return {\n '--fontSizeBase': font.fontSizeBase,\n };\n}\n\nexport function applyTheme(theme: ThemeProviderProps['theme']) {\n if (theme?.colors) {\n setCssProperties(mapThemeColors(theme.colors));\n }\n\n if (theme?.spacing) {\n setCssProperties(mapThemeSpacing(theme.spacing));\n }\n\n if (theme?.borderRadius) {\n setCssProperties(mapThemeBorderRadius(theme.borderRadius));\n }\n\n if (theme?.font) {\n setCssProperties(mapThemeFont(theme.font));\n }\n}\n","import { applyTheme } from '@/src/lib/applyTheme';\nimport React, { createContext, useEffect, useMemo } from 'react';\nimport { ThemeProviderProps } from './types/theme';\n\nconst ThemeContext = createContext<Omit<ThemeProviderProps, 'children'>>({\n theme: {},\n});\n\nexport function ThemeProvider(props: ThemeProviderProps) {\n useEffect(() => {\n if (props.theme && Object.keys(props.theme).length > 0) {\n applyTheme(props.theme);\n }\n }, [props.theme]);\n\n const value = useMemo(() => {\n return { theme: props.theme };\n }, [props.theme]);\n\n return (\n <ThemeContext.Provider value={value}>\n {props.children}\n </ThemeContext.Provider>\n );\n}\n","export const ENVIRONMENTS = {\n staging: 'https://gateway.niceremote.com',\n partners: 'https://gateway.partners.remote-sandbox.com',\n production: 'https://gateway.remote.com',\n};\n","import { client } from '@/src/client/client.gen';\nimport { ENVIRONMENTS } from '@/src/environments';\nimport { createClient } from '@hey-api/client-fetch';\nimport { useQuery } from '@tanstack/react-query';\nimport { useRef } from 'react';\nimport { RemoteFlowsSDKProps } from './types/remoteFlows';\n\ntype AuthResponse = {\n accessToken: string;\n expiresIn: number;\n};\n\ntype Options = {\n isTestingMode: boolean;\n proxy?: RemoteFlowsSDKProps['proxy'];\n};\n\nfunction isValidUrl(url: string) {\n try {\n new URL(url);\n return true;\n } catch {\n return false;\n }\n}\n\nexport const useAuth = ({\n auth,\n options,\n}: {\n auth: () => Promise<AuthResponse>;\n options: Options;\n}) => {\n const session = useRef<{ accessToken: string; expiresAt: number } | null>(\n null,\n );\n const { refetch } = useQuery({\n queryKey: ['auth'],\n queryFn: auth,\n enabled: false,\n });\n\n const baseUrl = options.isTestingMode\n ? ENVIRONMENTS.partners\n : process.env.REMOTE_GATEWAY_URL;\n\n const clientConfig = client.getConfig();\n const npmPackageVersion = process.env.VERSION;\n const isValidProxy = !!options.proxy && isValidUrl(options.proxy.url);\n\n if (options.proxy && !isValidProxy) {\n console.error('Invalid proxy URL provided. Using default base URL.');\n }\n\n return useRef(\n createClient({\n ...clientConfig,\n headers: {\n ...clientConfig.headers,\n ...(isValidProxy ? options.proxy?.headers : {}),\n 'X-Client-Name': 'remote-flows-sdk',\n 'X-Client-Version': npmPackageVersion,\n },\n baseUrl: isValidProxy ? options.proxy?.url : baseUrl,\n auth: async () => {\n function hasTokenExpired(expiresAt: number | undefined) {\n return !expiresAt || Date.now() + 60000 > expiresAt;\n }\n if (!session.current || hasTokenExpired(session.current.expiresAt)) {\n const { data } = await refetch();\n if (data) {\n session.current = {\n accessToken: data.accessToken,\n expiresAt: Date.now() + data.expiresIn * 1000,\n };\n }\n }\n return session.current?.accessToken;\n },\n }),\n );\n};\n"],"mappings":"wwEAAA,OAAS,eAAAA,EAAa,uBAAAC,MAA2B,wBAEjD,OA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,EAAgBX,EAAQ,QAAQ,SAAS,EAAG,CAClE,GAAM,CAAE,KAAAa,CAAK,EAAI,MAAMX,EAAQ,EAC3BW,IACFb,EAAQ,QAAU,CAChB,YAAaa,EAAK,YAClB,UAAW,KAAK,IAAI,EAAIA,EAAK,UAAY,GAC3C,EAEJ,CACA,OAAOb,EAAQ,SAAS,WAC1B,EAdM,OAeR,CAAC,CACH,CACF,EAvDuB,WJjBvB,IAAMc,EAAc,IAAIC,EASxB,SAASC,EAAyB,CAChC,SAAAC,EACA,KAAAC,EACA,cAAAC,EACA,MAAAC,CACF,EAAkC,CAChC,IAAMC,EAAkBC,EAAQ,CAC9B,KAAAJ,EACA,QAAS,CACP,cAAe,CAAC,CAACC,EACjB,MAAAC,CACF,CACF,CAAC,EACD,OACEG,EAAA,cAACC,EAAkB,SAAlB,CAA2B,MAAO,CAAE,OAAQH,EAAgB,OAAQ,GAClEJ,CACH,CAEJ,CAlBSQ,EAAAT,EAAA,4BAoBF,SAASU,EAAmB,CACjC,SAAAT,EACA,WAAAU,CACF,EAEI,CACF,OACEJ,EAAA,cAACK,EAAkB,SAAlB,CACC,MAAOD,EAAa,CAAE,WAAAA,CAAW,EAAI,CAAE,WAAY,CAAC,CAAE,GAErDV,CACH,CAEJ,CAbgBQ,EAAAC,EAAA,sBAeT,SAASG,EAAY,CAC1B,KAAAX,EACA,SAAAD,EACA,WAAAU,EACA,cAAAR,EAAgB,GAChB,MAAAW,EACA,MAAAV,CACF,EAA2C,CACzC,OACEG,EAAA,cAACQ,EAAA,CAAoB,OAAQjB,GAC3BS,EAAA,cAACG,EAAA,CAAmB,WAAYC,GAC9BJ,EAAA,cAACP,EAAA,CACC,cAAeG,EACf,KAAMD,EACN,MAAOE,GAEPG,EAAA,cAACS,EAAA,CAAc,MAAOF,GAAQb,CAAS,CACzC,CACF,CACF,CAEJ,CArBgBQ,EAAAI,EAAA","names":["QueryClient","QueryClientProvider","React","setCssProperties","variables","root","v","propertyVal","__name","mapThemeColors","colors","result","key","mapThemeSpacing","spacing","mapThemeBorderRadius","borderRadius","mapThemeFont","font","applyTheme","theme","React","createContext","useEffect","useMemo","ThemeContext","createContext","ThemeProvider","props","useEffect","applyTheme","value","useMemo","React","__name","ENVIRONMENTS","createClient","useQuery","useRef","isValidUrl","url","__name","useAuth","auth","options","session","useRef","refetch","useQuery","baseUrl","ENVIRONMENTS","clientConfig","client","npmPackageVersion","isValidProxy","createClient","hasTokenExpired","expiresAt","data","queryClient","QueryClient","RemoteFlowContextWrapper","children","auth","isTestingMode","proxy","remoteApiClient","useAuth","React","RemoteFlowContext","__name","FormFieldsProvider","components","FormFieldsContext","RemoteFlows","theme","QueryClientProvider","ThemeProvider"]}
|
|
1
|
+
{"version":3,"sources":["../src/RemoteFlowsProvider.tsx","../src/lib/applyTheme.ts","../src/theme.tsx","../src/environments.ts","../src/useAuth.ts"],"sourcesContent":["import { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport type { PropsWithChildren } from 'react';\nimport React from 'react';\n\nimport { ThemeProvider } from '@/src/theme';\nimport { FormFieldsContext, RemoteFlowContext } from './context';\nimport { Components, RemoteFlowsSDKProps } from './types/remoteFlows';\nimport { useAuth } from './useAuth';\n\nconst queryClient = new QueryClient();\n\ntype RemoteFlowContextWrapperProps = {\n auth: RemoteFlowsSDKProps['auth'];\n children: React.ReactNode;\n isTestingMode?: RemoteFlowsSDKProps['isTestingMode'];\n proxy?: RemoteFlowsSDKProps['proxy'];\n};\n\nfunction RemoteFlowContextWrapper({\n children,\n auth,\n isTestingMode,\n proxy,\n}: RemoteFlowContextWrapperProps) {\n const remoteApiClient = useAuth({\n auth,\n options: {\n isTestingMode: !!isTestingMode,\n proxy,\n },\n });\n return (\n <RemoteFlowContext.Provider value={{ client: remoteApiClient.current }}>\n {children}\n </RemoteFlowContext.Provider>\n );\n}\n\nexport function FormFieldsProvider({\n children,\n components,\n}: PropsWithChildren<{\n components?: Components;\n}>) {\n return (\n <FormFieldsContext.Provider\n value={components ? { components } : { components: {} }}\n >\n {children}\n </FormFieldsContext.Provider>\n );\n}\n\nexport function RemoteFlows({\n auth,\n children,\n components,\n isTestingMode = false,\n theme,\n proxy,\n}: PropsWithChildren<RemoteFlowsSDKProps>) {\n return (\n <QueryClientProvider client={queryClient}>\n <FormFieldsProvider components={components}>\n <RemoteFlowContextWrapper\n isTestingMode={isTestingMode}\n auth={auth}\n proxy={proxy}\n >\n <ThemeProvider theme={theme}>{children}</ThemeProvider>\n </RemoteFlowContextWrapper>\n </FormFieldsProvider>\n </QueryClientProvider>\n );\n}\n","import {\n CssThemeBorder,\n CssThemeColors,\n CssThemeFont,\n CssThemeSpacing,\n ThemeColors,\n ThemeFont,\n ThemeProviderProps,\n} from '@/src/types/theme';\n\nfunction setCssProperties(variables: Record<string, string>) {\n const root = document.documentElement;\n Object.keys(variables).forEach((v) => {\n const propertyVal = variables[v];\n if (propertyVal) {\n root.style.setProperty(v, propertyVal);\n }\n });\n}\n\nfunction mapThemeColors(colors: ThemeColors): CssThemeColors {\n const result: CssThemeColors = {};\n Object.keys(colors).forEach((key) => {\n result[`--${key}` as keyof CssThemeColors] =\n colors[key as keyof ThemeColors];\n });\n return result;\n}\n\nfunction mapThemeSpacing(spacing: string): CssThemeSpacing {\n return {\n '--spacing': spacing,\n };\n}\n\nfunction mapThemeBorderRadius(borderRadius: string): CssThemeBorder {\n return {\n '--radius': borderRadius,\n };\n}\n\nfunction mapThemeFont(font: ThemeFont): CssThemeFont {\n return {\n '--fontSizeBase': font.fontSizeBase,\n };\n}\n\nexport function applyTheme(theme: ThemeProviderProps['theme']) {\n if (theme?.colors) {\n setCssProperties(mapThemeColors(theme.colors));\n }\n\n if (theme?.spacing) {\n setCssProperties(mapThemeSpacing(theme.spacing));\n }\n\n if (theme?.borderRadius) {\n setCssProperties(mapThemeBorderRadius(theme.borderRadius));\n }\n\n if (theme?.font) {\n setCssProperties(mapThemeFont(theme.font));\n }\n}\n","import { applyTheme } from '@/src/lib/applyTheme';\nimport React, { createContext, useEffect, useMemo } from 'react';\nimport { ThemeProviderProps } from './types/theme';\n\nconst ThemeContext = createContext<Omit<ThemeProviderProps, 'children'>>({\n theme: {},\n});\n\nexport function ThemeProvider(props: ThemeProviderProps) {\n useEffect(() => {\n if (props.theme && Object.keys(props.theme).length > 0) {\n applyTheme(props.theme);\n }\n }, [props.theme]);\n\n const value = useMemo(() => {\n return { theme: props.theme };\n }, [props.theme]);\n\n return (\n <ThemeContext.Provider value={value}>\n {props.children}\n </ThemeContext.Provider>\n );\n}\n","export const ENVIRONMENTS = {\n staging: 'https://gateway.niceremote.com',\n partners: 'https://gateway.partners.remote-sandbox.com',\n production: 'https://gateway.remote.com',\n};\n","import { client } from '@/src/client/client.gen';\nimport { ENVIRONMENTS } from '@/src/environments';\nimport { createClient } from '@hey-api/client-fetch';\nimport { useQuery } from '@tanstack/react-query';\nimport { useRef } from 'react';\nimport { RemoteFlowsSDKProps } from './types/remoteFlows';\n\ntype AuthResponse = {\n accessToken: string;\n expiresIn: number;\n};\n\ntype Options = {\n isTestingMode: boolean;\n proxy?: RemoteFlowsSDKProps['proxy'];\n};\n\nfunction isValidUrl(url: string) {\n try {\n new URL(url);\n return true;\n } catch {\n return false;\n }\n}\n\nexport const useAuth = ({\n auth,\n options,\n}: {\n auth: () => Promise<AuthResponse>;\n options: Options;\n}) => {\n const session = useRef<{ accessToken: string; expiresAt: number } | null>(\n null,\n );\n const { refetch } = useQuery({\n queryKey: ['auth'],\n queryFn: auth,\n enabled: false,\n });\n\n const baseUrl = options.isTestingMode\n ? ENVIRONMENTS.partners\n : process.env.REMOTE_GATEWAY_URL;\n\n const clientConfig = client.getConfig();\n const npmPackageVersion = process.env.VERSION;\n const isValidProxy = !!options.proxy && isValidUrl(options.proxy.url);\n\n if (options.proxy && !isValidProxy) {\n console.error('Invalid proxy URL provided. Using default base URL.');\n }\n\n return useRef(\n createClient({\n ...clientConfig,\n headers: {\n ...clientConfig.headers,\n ...(isValidProxy ? options.proxy?.headers : {}),\n 'X-Client-Name': 'remote-flows-sdk',\n 'X-Client-Version': npmPackageVersion,\n },\n baseUrl: isValidProxy ? options.proxy?.url : baseUrl,\n auth: async () => {\n function hasTokenExpired(expiresAt: number | undefined) {\n return !expiresAt || Date.now() + 60000 > expiresAt;\n }\n if (!session.current || hasTokenExpired(session.current.expiresAt)) {\n const { data } = await refetch();\n if (data) {\n session.current = {\n accessToken: data.accessToken,\n expiresAt: Date.now() + data.expiresIn * 1000,\n };\n }\n }\n return session.current?.accessToken;\n },\n }),\n );\n};\n"],"mappings":"41EAAA,OAAS,eAAAA,EAAa,uBAAAC,MAA2B,wBAEjD,OAAOC,MAAW,QCQlB,SAASC,EAAiBC,EAAmC,CAC3D,IAAMC,EAAO,SAAS,gBACtB,OAAO,KAAKD,CAAS,EAAE,QAASE,GAAM,CACpC,IAAMC,EAAcH,EAAUE,CAAC,EAC3BC,GACFF,EAAK,MAAM,YAAYC,EAAGC,CAAW,CAEzC,CAAC,CACH,CARSC,EAAAL,EAAA,oBAUT,SAASM,EAAeC,EAAqC,CAC3D,IAAMC,EAAyB,CAAC,EAChC,cAAO,KAAKD,CAAM,EAAE,QAASE,GAAQ,CACnCD,EAAO,KAAKC,CAAG,EAA0B,EACvCF,EAAOE,CAAwB,CACnC,CAAC,EACMD,CACT,CAPSH,EAAAC,EAAA,kBAST,SAASI,EAAgBC,EAAkC,CACzD,MAAO,CACL,YAAaA,CACf,CACF,CAJSN,EAAAK,EAAA,mBAMT,SAASE,EAAqBC,EAAsC,CAClE,MAAO,CACL,WAAYA,CACd,CACF,CAJSR,EAAAO,EAAA,wBAMT,SAASE,EAAaC,EAA+B,CACnD,MAAO,CACL,iBAAkBA,EAAK,YACzB,CACF,CAJSV,EAAAS,EAAA,gBAMF,SAASE,EAAWC,EAAoC,CACzDA,GAAO,QACTjB,EAAiBM,EAAeW,EAAM,MAAM,CAAC,EAG3CA,GAAO,SACTjB,EAAiBU,EAAgBO,EAAM,OAAO,CAAC,EAG7CA,GAAO,cACTjB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,SAAAD,EACA,WAAAU,EACA,cAAAR,EAAgB,GAChB,MAAAW,EACA,MAAAV,CACF,EAA2C,CACzC,OACEG,EAAA,cAACQ,EAAA,CAAoB,OAAQjB,GAC3BS,EAAA,cAACG,EAAA,CAAmB,WAAYC,GAC9BJ,EAAA,cAACP,EAAA,CACC,cAAeG,EACf,KAAMD,EACN,MAAOE,GAEPG,EAAA,cAACS,EAAA,CAAc,MAAOF,GAAQb,CAAS,CACzC,CACF,CACF,CAEJ,CArBgBQ,EAAAI,EAAA","names":["QueryClient","QueryClientProvider","React","setCssProperties","variables","root","v","propertyVal","__name","mapThemeColors","colors","result","key","mapThemeSpacing","spacing","mapThemeBorderRadius","borderRadius","mapThemeFont","font","applyTheme","theme","React","createContext","useEffect","useMemo","ThemeContext","createContext","ThemeProvider","props","useEffect","applyTheme","value","useMemo","React","__name","ENVIRONMENTS","createClient","useQuery","useRef","isValidUrl","url","__name","useAuth","auth","options","session","useRef","refetch","useQuery","baseUrl","ENVIRONMENTS","clientConfig","client","npmPackageVersion","isValidProxy","createClient","hasTokenExpired","expiresAt","data","queryClient","QueryClient","RemoteFlowContextWrapper","children","auth","isTestingMode","proxy","remoteApiClient","useAuth","React","RemoteFlowContext","__name","FormFieldsProvider","components","FormFieldsContext","RemoteFlows","theme","QueryClientProvider","ThemeProvider"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { ControllerRenderProps, FieldValues, ControllerFieldState } from 'react-hook-form';
|
|
3
3
|
import { AnySchema } from 'yup';
|
|
4
|
+
import { S as SupportedTypes } from './types-pzyQqNc8.js';
|
|
4
5
|
|
|
5
6
|
type ThemeProviderProps = PropsWithChildren<{
|
|
6
7
|
theme?: Partial<{
|
|
@@ -24,8 +25,6 @@ type ThemeFont = {
|
|
|
24
25
|
fontSizeBase: string;
|
|
25
26
|
};
|
|
26
27
|
|
|
27
|
-
type SupportedTypes = 'text' | 'number' | 'email' | 'select' | 'radio' | 'fieldset' | 'date' | 'checkbox' | 'textarea' | 'money' | 'file' | 'countries';
|
|
28
|
-
|
|
29
28
|
type StatementProps = {
|
|
30
29
|
title?: string;
|
|
31
30
|
description: string;
|
|
@@ -30,6 +30,14 @@ type TerminationOffboarding = {
|
|
|
30
30
|
will_challenge_termination: boolean;
|
|
31
31
|
will_challenge_termination_description?: string;
|
|
32
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* Upsert benefit offers request. As its properties may vary depending on the employment,
|
|
35
|
+
* you must query the [Show benefit offers schema](#tag/benefits/operation/get_show_benefit_offer) endpoint
|
|
36
|
+
* passing the employment id
|
|
37
|
+
*/
|
|
38
|
+
type UnifiedEmploymentUpsertBenefitOffersRequest = {
|
|
39
|
+
[key: string]: unknown;
|
|
40
|
+
};
|
|
33
41
|
type MinimalCountry = {
|
|
34
42
|
alpha_2_code: string;
|
|
35
43
|
code: string;
|
|
@@ -297,6 +305,113 @@ type ShortId = string;
|
|
|
297
305
|
*
|
|
298
306
|
*/
|
|
299
307
|
type NullableApproverId = string | null;
|
|
308
|
+
/**
|
|
309
|
+
* Description of the basic required and onboarding tasks params to create an employment.
|
|
310
|
+
* You do not need to include all onboarding tasks when creating or updating an employment.
|
|
311
|
+
*
|
|
312
|
+
*/
|
|
313
|
+
type EmploymentFullParams = {
|
|
314
|
+
/**
|
|
315
|
+
* Home address information. As its properties may vary depending on the country,
|
|
316
|
+
* you must query the [Show form schema](#tag/Countries/operation/get_show_form_country) endpoint
|
|
317
|
+
* passing the country code and `address_details` as path parameters.
|
|
318
|
+
*/
|
|
319
|
+
address_details?: {
|
|
320
|
+
[key: string]: unknown;
|
|
321
|
+
};
|
|
322
|
+
/**
|
|
323
|
+
* Administrative information. As its properties may vary depending on the country,
|
|
324
|
+
* you must query the [Show form schema](#tag/Countries/operation/get_show_form_country) endpoint
|
|
325
|
+
* passing the country code and `administrative_details` as path parameters.
|
|
326
|
+
*/
|
|
327
|
+
administrative_details?: {
|
|
328
|
+
[key: string]: unknown;
|
|
329
|
+
};
|
|
330
|
+
/**
|
|
331
|
+
* Bank account information. As its properties may vary depending on the country,
|
|
332
|
+
* you must query the [Show form schema](#tag/Countries/operation/get_show_form_country) endpoint
|
|
333
|
+
* passing the country code and `bank_account_details` as path parameters.
|
|
334
|
+
*/
|
|
335
|
+
bank_account_details?: {
|
|
336
|
+
[key: string]: unknown;
|
|
337
|
+
};
|
|
338
|
+
/**
|
|
339
|
+
* Employment basic information. As its properties may vary depending on the country,
|
|
340
|
+
* you must query the [Show form schema](#tag/Countries/operation/get_show_form_country) endpoint
|
|
341
|
+
* passing the country code and `employment_basic_information` as path parameters.
|
|
342
|
+
*/
|
|
343
|
+
basic_information?: {
|
|
344
|
+
[key: string]: unknown;
|
|
345
|
+
};
|
|
346
|
+
/**
|
|
347
|
+
* Billing address information. As its properties may vary depending on the country,
|
|
348
|
+
* you must query the [Show form schema](#tag/Countries/operation/get_show_form_country) endpoint
|
|
349
|
+
* passing the country code and `billing_address_details` as path parameters.
|
|
350
|
+
*/
|
|
351
|
+
billing_address_details?: {
|
|
352
|
+
[key: string]: unknown;
|
|
353
|
+
};
|
|
354
|
+
company_id?: string;
|
|
355
|
+
/**
|
|
356
|
+
* Contract information. As its properties may vary depending on the country,
|
|
357
|
+
* you must query the [Show form schema](#tag/Countries/operation/get_show_form_country) endpoint
|
|
358
|
+
* passing the country code and `contract_details` as path parameters.
|
|
359
|
+
*/
|
|
360
|
+
contract_details?: {
|
|
361
|
+
[key: string]: unknown;
|
|
362
|
+
};
|
|
363
|
+
country?: Country;
|
|
364
|
+
country_code?: string;
|
|
365
|
+
/**
|
|
366
|
+
* The department of the employment. The department must belong to the same company as the employment.
|
|
367
|
+
* When set to `null`, the employment will be unassigned from a department.
|
|
368
|
+
*
|
|
369
|
+
*/
|
|
370
|
+
department_id?: string | null;
|
|
371
|
+
/**
|
|
372
|
+
* Emergency contact information. As its properties may vary depending on the country,
|
|
373
|
+
* you must query the [Show form schema](#tag/Countries/operation/get_show_form_country) endpoint
|
|
374
|
+
* passing the country code and `emergency_contact_details` as path parameters.
|
|
375
|
+
*/
|
|
376
|
+
emergency_contact_details?: {
|
|
377
|
+
[key: string]: unknown;
|
|
378
|
+
};
|
|
379
|
+
/**
|
|
380
|
+
* A unique reference code for the employment record in a non-Remote system. This optional field links to external data sources. If not provided, it defaults to `null`. While uniqueness is recommended, it is not strictly enforced within Remote's system.
|
|
381
|
+
*/
|
|
382
|
+
external_id?: string;
|
|
383
|
+
/**
|
|
384
|
+
* The user id of the manager, who should have an `admin`, `owner` or `people_manager` role.
|
|
385
|
+
* You can find these users by querying the [Company Managers endpoint](#operation/get_index_company_manager).
|
|
386
|
+
* **Update of this field is only available for active employments.**
|
|
387
|
+
*
|
|
388
|
+
*/
|
|
389
|
+
manager_id?: string;
|
|
390
|
+
/**
|
|
391
|
+
* Personal details information. As its properties may vary depending on the country,
|
|
392
|
+
* you must query the [Show form schema](#tag/Countries/operation/get_show_form_country) endpoint
|
|
393
|
+
* passing the country code and `personal_details` as path parameters.
|
|
394
|
+
*/
|
|
395
|
+
personal_details?: {
|
|
396
|
+
[key: string]: unknown;
|
|
397
|
+
};
|
|
398
|
+
/**
|
|
399
|
+
* Pricing plan details information. As its properties may vary depending on the country,
|
|
400
|
+
* you must query the [Show form schema](#tag/Countries/operation/get_show_form_country) endpoint
|
|
401
|
+
* passing the country code and `pricing_plan_details` as path parameters.
|
|
402
|
+
*/
|
|
403
|
+
pricing_plan_details?: {
|
|
404
|
+
[key: string]: unknown;
|
|
405
|
+
};
|
|
406
|
+
/**
|
|
407
|
+
* If not provided, it will default to `employee`.
|
|
408
|
+
*/
|
|
409
|
+
type?: 'employee' | 'contractor';
|
|
410
|
+
/**
|
|
411
|
+
* The work email of the employment.
|
|
412
|
+
*/
|
|
413
|
+
work_email?: string;
|
|
414
|
+
};
|
|
300
415
|
type OffboardingFile = {
|
|
301
416
|
/**
|
|
302
417
|
* The content in base64 encoding
|
|
@@ -485,6 +600,11 @@ type ListTimeoffResponse = {
|
|
|
485
600
|
total_pages?: number;
|
|
486
601
|
};
|
|
487
602
|
};
|
|
603
|
+
type MagicLinkResponse = {
|
|
604
|
+
data: {
|
|
605
|
+
url: string;
|
|
606
|
+
};
|
|
607
|
+
};
|
|
488
608
|
/**
|
|
489
609
|
* The stage of employment lifecycle. When it's `onboarded` means the employee is ready to commence or has already commenced.
|
|
490
610
|
*/
|
|
@@ -540,11 +660,142 @@ type SuccessResponse = {
|
|
|
540
660
|
status?: string;
|
|
541
661
|
};
|
|
542
662
|
};
|
|
663
|
+
/**
|
|
664
|
+
* Magic link params
|
|
665
|
+
*/
|
|
666
|
+
type MagicLinkParams = {
|
|
667
|
+
/**
|
|
668
|
+
* The path to which the user will be redirected to after login. This field has a max length of 2000 characters.
|
|
669
|
+
*
|
|
670
|
+
* If not specified, `/dashboard` will be used by default.
|
|
671
|
+
*
|
|
672
|
+
* Must begin with a forward slash (`/`) and, at least one path segment is required (`/dashboard` e.g.).
|
|
673
|
+
* An ending forward slash (`/`) is not allowed and path segments can only include alphanumeric characters, underscore (`_`) and hyphen (`-`).
|
|
674
|
+
*
|
|
675
|
+
* An optional query string can be specified too. If present, the query string must start with a question mark (`?`)
|
|
676
|
+
* and must include at least one key value pair. Both, keys and values, can only include
|
|
677
|
+
* alphanumeric characters, underscore (`_`), hyphen (`-`) or percent encoded values such as `%20` (space character).
|
|
678
|
+
* Additional key value pairs are allowed using ampersand (`&`).
|
|
679
|
+
*
|
|
680
|
+
* Query keys require at least one alphanumeric, underscore (`_`), hyphen (`-`) or valid percent encoded.
|
|
681
|
+
* Query values are optional, the actual value may be empty and the equals sign (`=`) may be missing too.
|
|
682
|
+
*
|
|
683
|
+
* Some **Valid** examples for `path`:
|
|
684
|
+
* - o `/dashboard`
|
|
685
|
+
* - o `/dashboard/people/new/full_time/663e0b79-c893-45ff-a1b2-f6dcabc098b5`
|
|
686
|
+
* - o `/dashboard/people/hiring?filters%5B0%5D%5Bid%5D=exclude_linked_drafts&filters%5B0%5D%5Bvalue%5D=true`
|
|
687
|
+
* - o `/dashboard?key=value&foo=bar`
|
|
688
|
+
*
|
|
689
|
+
* Some **Invalid** examples for `path`:
|
|
690
|
+
* - x `missing_forward_slash`
|
|
691
|
+
* - x `/invalid//path`
|
|
692
|
+
* - x `//some`
|
|
693
|
+
* - x `/?key=value`
|
|
694
|
+
* - x `/some/i.n:valid*`
|
|
695
|
+
* - x `/invalid/end/slash/`
|
|
696
|
+
* - x `/some?malformed_percent_encoded_key%1=value`
|
|
697
|
+
*
|
|
698
|
+
*/
|
|
699
|
+
path?: string;
|
|
700
|
+
user_id: UuidSlug;
|
|
701
|
+
} | {
|
|
702
|
+
employment_id: UuidSlug;
|
|
703
|
+
/**
|
|
704
|
+
* The path to which the user will be redirected to after login. This field has a max length of 2000 characters.
|
|
705
|
+
*
|
|
706
|
+
* If not specified, `/dashboard` will be used by default.
|
|
707
|
+
*
|
|
708
|
+
* Must begin with a forward slash (`/`) and, at least one path segment is required (`/dashboard` e.g.).
|
|
709
|
+
* An ending forward slash (`/`) is not allowed and path segments can only include alphanumeric characters, underscore (`_`) and hyphen (`-`).
|
|
710
|
+
*
|
|
711
|
+
* An optional query string can be specified too. If present, the query string must start with a question mark (`?`)
|
|
712
|
+
* and must include at least one key value pair. Both, keys and values, can only include
|
|
713
|
+
* alphanumeric characters, underscore (`_`), hyphen (`-`) or percent encoded values such as `%20` (space character).
|
|
714
|
+
* Additional key value pairs are allowed using ampersand (`&`).
|
|
715
|
+
*
|
|
716
|
+
* Query keys require at least one alphanumeric, underscore (`_`), hyphen (`-`) or valid percent encoded.
|
|
717
|
+
* Query values are optional, the actual value may be empty and the equals sign (`=`) may be missing too.
|
|
718
|
+
*
|
|
719
|
+
* Some **Valid** examples for `path`:
|
|
720
|
+
* - o `/dashboard`
|
|
721
|
+
* - o `/dashboard/people/new/full_time/663e0b79-c893-45ff-a1b2-f6dcabc098b5`
|
|
722
|
+
* - o `/dashboard/people/hiring?filters%5B0%5D%5Bid%5D=exclude_linked_drafts&filters%5B0%5D%5Bvalue%5D=true`
|
|
723
|
+
* - o `/dashboard?key=value&foo=bar`
|
|
724
|
+
*
|
|
725
|
+
* Some **Invalid** examples for `path`:
|
|
726
|
+
* - x `missing_forward_slash`
|
|
727
|
+
* - x `/invalid//path`
|
|
728
|
+
* - x `//some`
|
|
729
|
+
* - x `/?key=value`
|
|
730
|
+
* - x `/some/i.n:valid*`
|
|
731
|
+
* - x `/invalid/end/slash/`
|
|
732
|
+
* - x `/some?malformed_percent_encoded_key%1=value`
|
|
733
|
+
*
|
|
734
|
+
*/
|
|
735
|
+
path?: string;
|
|
736
|
+
};
|
|
543
737
|
type LeavePolicy = {
|
|
544
738
|
leave_policy_variant_slug: string;
|
|
545
739
|
leave_type: TimeoffType;
|
|
546
740
|
name: string;
|
|
547
741
|
};
|
|
742
|
+
type Company = {
|
|
743
|
+
/**
|
|
744
|
+
* Fields can vary depending on the country. Please, check the required fields structure using the [Show form schema endpoint](#operation/get_show_form_country).
|
|
745
|
+
* Use the desired country and `address_details` as the form name for the placeholders.
|
|
746
|
+
* The response complies with the [JSON Schema](https://remote.com/resources/api/how-json-schemas-work) specification.
|
|
747
|
+
*
|
|
748
|
+
*/
|
|
749
|
+
address_details: {
|
|
750
|
+
[key: string]: unknown;
|
|
751
|
+
};
|
|
752
|
+
/**
|
|
753
|
+
* Fields can vary depending on the country. Please, check the required fields structure using the [Show form schema endpoint](#operation/get_show_form_country).
|
|
754
|
+
* Use the desired country and `bank_account_details` as the form name for the placeholders.
|
|
755
|
+
* The response complies with the [JSON Schema](https://remote.com/resources/api/how-json-schemas-work) specification.
|
|
756
|
+
*
|
|
757
|
+
*/
|
|
758
|
+
bank_account_details?: {
|
|
759
|
+
[key: string]: unknown;
|
|
760
|
+
};
|
|
761
|
+
company_owner_email: string;
|
|
762
|
+
company_owner_name?: string;
|
|
763
|
+
company_owner_user_id: string;
|
|
764
|
+
country_code: string;
|
|
765
|
+
created_at: string;
|
|
766
|
+
/**
|
|
767
|
+
* The credit risk status of the company default legal entity.
|
|
768
|
+
* - `not_started`: The credit risk assessment has not started yet.
|
|
769
|
+
* - `ready`: The credit risk assessment is ready to be started.
|
|
770
|
+
* - `in_progress`: The automated credit risk assessment is in progress.
|
|
771
|
+
* - `referred`: The credit risk assessment has been referred to a human reviewer.
|
|
772
|
+
* - `fail`: The credit risk assessment has failed and the company will be archived.
|
|
773
|
+
* - `deposit_required`: The company default legal entity requires a deposit before onboarding new employees.
|
|
774
|
+
* - `no_deposit_required`: The company default legal entity does not require a deposit before onboarding new employees.
|
|
775
|
+
*
|
|
776
|
+
*/
|
|
777
|
+
default_legal_entity_credit_risk_status: 'not_started' | 'ready' | 'in_progress' | 'referred' | 'fail' | 'deposit_required' | 'no_deposit_required';
|
|
778
|
+
desired_currency: string;
|
|
779
|
+
external_id?: string | null;
|
|
780
|
+
id: string;
|
|
781
|
+
name: string;
|
|
782
|
+
phone_number?: string;
|
|
783
|
+
registration_number?: string | null;
|
|
784
|
+
/**
|
|
785
|
+
* The company status determines what a company is allowed to do:
|
|
786
|
+
* - `pending`: The company has been created and the company owner invited. Remote is waiting for the company owner to complete onboarding.
|
|
787
|
+
* - `review`: The company is under review. In rare occasions, a company may not automatically get created in `active` status because Remote needs to
|
|
788
|
+
* manually review the company that was created. The company will become `active` once the review is completed and no further action is necessary
|
|
789
|
+
* through the Remote API.
|
|
790
|
+
* - `active`: The company owner has completed onboarding and the company is ready to employ.
|
|
791
|
+
* - `archived`: The company is no longer active on the Remote platform and no changes can be made to the company.
|
|
792
|
+
*
|
|
793
|
+
*/
|
|
794
|
+
status: 'pending' | 'review' | 'active' | 'archived';
|
|
795
|
+
tax_number?: string | null;
|
|
796
|
+
terms_of_service_accepted_at: string;
|
|
797
|
+
updated_at: string;
|
|
798
|
+
};
|
|
548
799
|
type TooManyRequestsResponse = {
|
|
549
800
|
message?: string;
|
|
550
801
|
};
|
|
@@ -689,7 +940,7 @@ type ParameterError = {
|
|
|
689
940
|
param: string;
|
|
690
941
|
};
|
|
691
942
|
type GenericFile = Blob | File;
|
|
692
|
-
type TimeoffType = '
|
|
943
|
+
type TimeoffType = 'time_off' | 'sick_leave' | 'public_holiday' | 'unpaid_leave' | 'extended_leave' | 'in_lieu_time' | 'maternity_leave' | 'paternity_leave' | 'parental_leave' | 'bereavement' | 'military_leave' | 'other' | 'paid_time_off' | 'custom_company_leave' | 'rtt' | 'casual_leave' | 'rol' | 'ex_festivita';
|
|
693
944
|
/**
|
|
694
945
|
* The details of the salary decrease request if there is one
|
|
695
946
|
*/
|
|
@@ -867,6 +1118,21 @@ type PostCreateEstimationPdfErrors = {
|
|
|
867
1118
|
422: UnprocessableEntityResponse;
|
|
868
1119
|
};
|
|
869
1120
|
type PostCreateEstimationPdfError = PostCreateEstimationPdfErrors[keyof PostCreateEstimationPdfErrors];
|
|
1121
|
+
type PostCreateRiskReserveErrors = {
|
|
1122
|
+
/**
|
|
1123
|
+
* Unauthorized
|
|
1124
|
+
*/
|
|
1125
|
+
401: UnauthorizedResponse;
|
|
1126
|
+
/**
|
|
1127
|
+
* Not Found
|
|
1128
|
+
*/
|
|
1129
|
+
404: NotFoundResponse;
|
|
1130
|
+
/**
|
|
1131
|
+
* Unprocessable Entity
|
|
1132
|
+
*/
|
|
1133
|
+
422: UnprocessableEntityResponse;
|
|
1134
|
+
};
|
|
1135
|
+
type PostCreateRiskReserveError = PostCreateRiskReserveErrors[keyof PostCreateRiskReserveErrors];
|
|
870
1136
|
type PostCreateContractAmendmentErrors = {
|
|
871
1137
|
/**
|
|
872
1138
|
* Unauthorized
|
|
@@ -944,4 +1210,4 @@ type PostInviteEmploymentInvitationErrors = {
|
|
|
944
1210
|
};
|
|
945
1211
|
type PostInviteEmploymentInvitationError = PostInviteEmploymentInvitationErrors[keyof PostInviteEmploymentInvitationErrors];
|
|
946
1212
|
|
|
947
|
-
export type { ContractAmendmentAutomatableResponse as C, EmploymentShowResponse as E, ListTimeoffResponse as L, OffboardingResponse as O, PostAutomatableContractAmendmentError as P, SuccessResponse as S, TerminationDetailsParams as T, ContractAmendmentResponse as a, PostCreateContractAmendmentError as b, CostCalculatorEstimateResponse as c, PostCreateEstimationError as d, CostCalculatorEstimatePdfResponse as e, PostCreateEstimationPdfError as f, CostCalculatorEstimateParams as g, EmploymentCreateParams as h, EmploymentTermType as i, PostCreateOffboardingError as j, EmploymentCreationResponse as k, PostCreateEmployment2Error as l, EmploymentResponse as m, PatchUpdateEmployment2Error as n, PutUpdateBenefitOfferError as o,
|
|
1213
|
+
export type { ContractAmendmentAutomatableResponse as C, EmploymentShowResponse as E, ListTimeoffResponse as L, MagicLinkResponse as M, OffboardingResponse as O, PostAutomatableContractAmendmentError as P, SuccessResponse as S, TerminationDetailsParams as T, UnifiedEmploymentUpsertBenefitOffersRequest as U, ContractAmendmentResponse as a, PostCreateContractAmendmentError as b, CostCalculatorEstimateResponse as c, PostCreateEstimationError as d, CostCalculatorEstimatePdfResponse as e, PostCreateEstimationPdfError as f, CostCalculatorEstimateParams as g, EmploymentCreateParams as h, EmploymentTermType as i, PostCreateOffboardingError as j, EmploymentCreationResponse as k, PostCreateEmployment2Error as l, EmploymentResponse as m, PatchUpdateEmployment2Error as n, PutUpdateBenefitOfferError as o, Company as p, PostInviteEmploymentInvitationError as q, PostCreateRiskReserveError as r, EmploymentFullParams as s, UnprocessableEntityResponse as t, MagicLinkParams as u, TimeoffStatus as v, CostCalculatorEmployment as w, Currency as x };
|
package/package.json
CHANGED
package/dist/chunk-2PXGLWCY.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flows/Onboarding/utils.ts"],"sourcesContent":["import { Step } from '@/src/flows/useStepState';\n\ntype StepKeys =\n | 'basic_information'\n | 'contract_details'\n | 'benefits'\n | 'review';\n\nexport const STEPS: Record<StepKeys, Step> = {\n basic_information: { index: 0, name: 'basic_information' },\n contract_details: { index: 1, name: 'contract_details' },\n benefits: { index: 2, name: 'benefits' },\n review: { index: 3, name: 'review' },\n} as const;\n"],"mappings":"AAQO,IAAMA,EAAgC,CAC3C,kBAAmB,CAAE,MAAO,EAAG,KAAM,mBAAoB,EACzD,iBAAkB,CAAE,MAAO,EAAG,KAAM,kBAAmB,EACvD,SAAU,CAAE,MAAO,EAAG,KAAM,UAAW,EACvC,OAAQ,CAAE,MAAO,EAAG,KAAM,QAAS,CACrC","names":["STEPS"]}
|
package/dist/chunk-2YWRQJ7P.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as m}from"./chunk-LCZQVL4U.js";import{b as a}from"./chunk-WS3C3WIJ.js";import{a as s}from"./chunk-JRQSZHUU.js";import{b as i}from"./chunk-56BNVYTD.js";import{a as o}from"./chunk-AYDF3IFZ.js";import y from"react";function w({onSubmit:u,onSuccess:c,onError:n,...e}){let{onboardingBag:r}=a(),d=m(),{mutateAsync:p}=s(d),l=o(async()=>{try{if(await u?.(),!r.employmentId)throw new Error("Employment ID is required");let t=await p({employment_id:r.employmentId});if(t.data){await c?.(t.data);return}t.error&&n?.(t.error)}catch(t){n?.(t)}},"handleSubmit");return y.createElement(i,{...e,onClick:()=>{l()}},e.children)}o(w,"OnboardingInvite");export{w as a};
|
|
2
|
-
//# sourceMappingURL=chunk-2YWRQJ7P.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flows/Onboarding/OnboardingInvite.tsx"],"sourcesContent":["import React, { ButtonHTMLAttributes, PropsWithChildren } from 'react';\nimport { useEmploymentInvite } from './hooks';\nimport { Button } from '@/src/components/ui/button';\nimport { mutationToPromise } from '@/src/lib/mutations';\nimport { SuccessResponse } from '@/src/client';\nimport { useOnboardingContext } from './context';\n\ntype OnboardingInviteProps = PropsWithChildren<\n ButtonHTMLAttributes<HTMLButtonElement> & {\n onSuccess?: (data: SuccessResponse) => void | Promise<void>;\n onError?: (error: unknown) => void;\n onSubmit?: () => void | Promise<void>;\n }\n>;\n\nexport function OnboardingInvite({\n onSubmit,\n onSuccess,\n onError,\n ...props\n}: OnboardingInviteProps) {\n const { onboardingBag } = useOnboardingContext();\n const employmentInviteMutation = useEmploymentInvite();\n\n const { mutateAsync: employmentInviteMutationAsync } = mutationToPromise(\n employmentInviteMutation,\n );\n\n const handleSubmit = async () => {\n try {\n await onSubmit?.();\n\n if (!onboardingBag.employmentId) {\n throw new Error('Employment ID is required');\n }\n\n const response = await employmentInviteMutationAsync({\n employment_id: onboardingBag.employmentId,\n });\n if (response.data) {\n await onSuccess?.(response.data as SuccessResponse);\n return;\n }\n if (response.error) {\n onError?.(response.error);\n }\n } catch (error) {\n onError?.(error);\n }\n };\n\n return (\n <Button\n {...props}\n onClick={() => {\n handleSubmit();\n }}\n >\n {props.children}\n </Button>\n );\n}\n"],"mappings":"wMAAA,OAAOA,MAAwD,QAexD,SAASC,EAAiB,CAC/B,SAAAC,EACA,UAAAC,EACA,QAAAC,EACA,GAAGC,CACL,EAA0B,CACxB,GAAM,CAAE,cAAAC,CAAc,EAAIC,EAAqB,EACzCC,EAA2BC,EAAoB,EAE/C,CAAE,YAAaC,CAA8B,EAAIC,EACrDH,CACF,EAEMI,EAAeC,EAAA,SAAY,CAC/B,GAAI,CAGF,GAFA,MAAMX,IAAW,EAEb,CAACI,EAAc,aACjB,MAAM,IAAI,MAAM,2BAA2B,EAG7C,IAAMQ,EAAW,MAAMJ,EAA8B,CACnD,cAAeJ,EAAc,YAC/B,CAAC,EACD,GAAIQ,EAAS,KAAM,CACjB,MAAMX,IAAYW,EAAS,IAAuB,EAClD,MACF,CACIA,EAAS,OACXV,IAAUU,EAAS,KAAK,CAE5B,OAASC,EAAO,CACdX,IAAUW,CAAK,CACjB,CACF,EArBqB,gBAuBrB,OACEC,EAAA,cAACC,EAAA,CACE,GAAGZ,EACJ,QAAS,IAAM,CACbO,EAAa,CACf,GAECP,EAAM,QACT,CAEJ,CA9CgBQ,EAAAZ,EAAA","names":["React","OnboardingInvite","onSubmit","onSuccess","onError","props","onboardingBag","useOnboardingContext","employmentInviteMutation","useEmploymentInvite","employmentInviteMutationAsync","mutationToPromise","handleSubmit","__name","response","error","React","Button"]}
|
package/dist/chunk-36UPHOJS.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as o}from"./chunk-AYDF3IFZ.js";import{object as c}from"yup";function d(n){let t=n.reduce((e,r)=>(e[r.name]=r.schema,e),{});return c(t)}o(d,"buildValidationSchema");function u(n,t){return Object.entries(n).reduce((e,[r,a])=>(e[r]=t.includes(r)?a==="yes":a,e),{})}o(u,"parseFormRadioValues");export{d as a,u as b};
|
|
2
|
-
//# sourceMappingURL=chunk-36UPHOJS.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flows/utils.ts"],"sourcesContent":["import { AnyObjectSchema, object } from 'yup';\nimport { Field } from './types';\n\n/**\n * Build the validation schema for the form.\n * @returns\n */\nexport function buildValidationSchema(fields: Field[]) {\n const fieldsSchema = fields.reduce<Record<string, AnyObjectSchema>>(\n (fieldsSchemaAcc, field) => {\n fieldsSchemaAcc[field.name] = field.schema as AnyObjectSchema;\n return fieldsSchemaAcc;\n },\n {},\n );\n return object(fieldsSchema) as AnyObjectSchema;\n}\n\ntype ParsedRadioValues = Record<string, unknown>;\n\n/**\n * Parses the form values to convert radio button values from 'yes'/'no' to boolean.\n *\n * @param values - The form values as a record of key-value pairs.\n * @param fieldKeys - An array of field keys that represent radio button fields.\n * @returns A new object with the parsed values, where radio button fields are converted to boolean.\n *\n * @example\n * const values = {\n * ack: 'yes',\n * confidential: 'no',\n * username: 'john_doe',\n * };\n * const fieldKeys = ['ack', 'confidential'];\n * const parsedValues = parseFormRadioValues(values, fieldKeys);\n * // Output: { ack: true, confidential: false, username: 'john_doe' }\n */\nexport function parseFormRadioValues(\n values: Record<string, unknown>,\n fieldKeys: string[],\n) {\n return Object.entries(values).reduce<ParsedRadioValues>(\n (acc, [key, value]) => {\n acc[key] = fieldKeys.includes(key) ? value === 'yes' : value;\n return acc;\n },\n {},\n );\n}\n"],"mappings":"wCAAA,OAA0B,UAAAA,MAAc,MAOjC,SAASC,EAAsBC,EAAiB,CACrD,IAAMC,EAAeD,EAAO,OAC1B,CAACE,EAAiBC,KAChBD,EAAgBC,EAAM,IAAI,EAAIA,EAAM,OAC7BD,GAET,CAAC,CACH,EACA,OAAOE,EAAOH,CAAY,CAC5B,CATgBI,EAAAN,EAAA,yBA8BT,SAASO,EACdC,EACAC,EACA,CACA,OAAO,OAAO,QAAQD,CAAM,EAAE,OAC5B,CAACE,EAAK,CAACC,EAAKC,CAAK,KACfF,EAAIC,CAAG,EAAIF,EAAU,SAASE,CAAG,EAAIC,IAAU,MAAQA,EAChDF,GAET,CAAC,CACH,CACF,CAXgBJ,EAAAC,EAAA","names":["object","buildValidationSchema","fields","fieldsSchema","fieldsSchemaAcc","field","object","__name","parseFormRadioValues","values","fieldKeys","acc","key","value"]}
|
package/dist/chunk-DHRIURRT.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as t}from"./chunk-AYDF3IFZ.js";import{formDataBodySerializer as i}from"@hey-api/client-fetch";import{createClient as o,createConfig as n}from"@hey-api/client-fetch";var r=o(n({baseUrl:"https://gateway.remote.com/"}));var c=t(e=>(e?.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/v1/offboardings",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postCreateOffboarding");var h=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/contract-amendments/schema",...e}),"getShowContractAmendmentSchema");var d=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/v1/employments",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postCreateEmployment2");var m=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/v1/cost-calculator/estimation",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postCreateEstimation");var u=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}/benefit-offers",...e}),"getIndexBenefitOffer"),E=t(e=>(e.client??r).put({security:[{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}/benefit-offers",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"putUpdateBenefitOffer");var y=t(e=>(e?.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/v1/cost-calculator/estimation-pdf",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postCreateEstimationPdf");var w=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/v1/contract-amendments",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postCreateContractAmendment");var C=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/countries/{country_code}/{form}",...e}),"getShowFormCountry");var O=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/cost-calculator/countries",...e}),"getIndexCountry");var T=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}/benefit-offers/schema",...e}),"getShowSchema");var x=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}",...e}),"getShowEmployment"),f=t(e=>(e.client??r).patch({security:[{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"patchUpdateEmployment2");var R=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/cost-calculator/regions/{slug}/fields",...e}),"getShowRegionField");var P=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/v1/contract-amendments/automatable",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postAutomatableContractAmendment");var b=t(e=>(e?.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/company-currencies",...e}),"getIndexCompanyCurrency");var G=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}/invite",...e}),"postInviteEmploymentInvitation");var D=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/timeoff",...e}),"getIndexTimeoff");export{r as a,c as b,h as c,d,m as e,u as f,E as g,y as h,w as i,C as j,O as k,T as l,x as m,f as n,R as o,P as p,b as q,G as r,D as s};
|
|
2
|
-
//# sourceMappingURL=chunk-DHRIURRT.js.map
|