@remoteoss/remote-flows 0.4.0-alpha.0 → 0.4.0-alpha.10
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/README.md +63 -1
- package/dist/chunk-2Y22JKVE.js +2 -0
- package/dist/{chunk-NFEY2YL6.js → chunk-3PH5E6CZ.js} +2 -2
- package/dist/chunk-4A6ZQNMB.js +2 -0
- package/dist/chunk-4A6ZQNMB.js.map +1 -0
- package/dist/chunk-4YNOSVYQ.js +2 -0
- package/dist/chunk-4YNOSVYQ.js.map +1 -0
- package/dist/chunk-55SA3TEF.js +2 -0
- package/dist/chunk-55SA3TEF.js.map +1 -0
- package/dist/chunk-6I6RMJXC.js +2 -0
- package/dist/chunk-6I6RMJXC.js.map +1 -0
- package/dist/chunk-6T3A6GWH.js +2 -0
- package/dist/chunk-6T3A6GWH.js.map +1 -0
- package/dist/chunk-7KUKFRKC.js +2 -0
- package/dist/chunk-7KUKFRKC.js.map +1 -0
- package/dist/chunk-B4SVITZI.js +2 -0
- package/dist/chunk-B4SVITZI.js.map +1 -0
- package/dist/chunk-DBIPVIBO.js +2 -0
- package/dist/{chunk-M5VZBMLC.js.map → chunk-DBIPVIBO.js.map} +1 -1
- package/dist/chunk-DP4SIYAC.js +2 -0
- package/dist/chunk-DP4SIYAC.js.map +1 -0
- package/dist/chunk-EGDD73PU.js +2 -0
- package/dist/chunk-EGDD73PU.js.map +1 -0
- package/dist/chunk-EMVYCKDC.js +2 -0
- package/dist/{chunk-56BNVYTD.js.map → chunk-EMVYCKDC.js.map} +1 -1
- package/dist/chunk-FB4QOGWE.js +2 -0
- package/dist/chunk-FB4QOGWE.js.map +1 -0
- package/dist/chunk-G7BISHWK.js +2 -0
- package/dist/chunk-G7BISHWK.js.map +1 -0
- package/dist/chunk-GFWQG4ZT.js +2 -0
- package/dist/chunk-GFWQG4ZT.js.map +1 -0
- package/dist/chunk-GMU3QGAR.js +2 -0
- package/dist/chunk-GMU3QGAR.js.map +1 -0
- package/dist/chunk-HBH2PSYQ.js +2 -0
- package/dist/chunk-HBH2PSYQ.js.map +1 -0
- package/dist/chunk-HJBXUPHM.js +2 -0
- package/dist/chunk-HJBXUPHM.js.map +1 -0
- package/dist/chunk-HSY5OO7D.js +2 -0
- package/dist/chunk-HSY5OO7D.js.map +1 -0
- package/dist/chunk-IAHI4OUM.js +2 -0
- package/dist/chunk-IAHI4OUM.js.map +1 -0
- package/dist/chunk-IKQ25VV5.js +2 -0
- package/dist/chunk-IKQ25VV5.js.map +1 -0
- package/dist/chunk-INAXCFVC.js +2 -0
- package/dist/chunk-INAXCFVC.js.map +1 -0
- package/dist/chunk-JJPI2YDM.js +2 -0
- package/dist/chunk-JJPI2YDM.js.map +1 -0
- package/dist/chunk-L5OIK2ZJ.js +2 -0
- package/dist/chunk-L5OIK2ZJ.js.map +1 -0
- package/dist/chunk-LJRUD43L.js +2 -0
- package/dist/chunk-LJRUD43L.js.map +1 -0
- package/dist/chunk-LTDDSH45.js +2 -0
- package/dist/chunk-LTDDSH45.js.map +1 -0
- package/dist/chunk-MGUDZTTV.js +2 -0
- package/dist/chunk-MGUDZTTV.js.map +1 -0
- package/dist/chunk-NEFNFYRS.js +2 -0
- package/dist/{chunk-GFBF55NR.js.map → chunk-NEFNFYRS.js.map} +1 -1
- package/dist/chunk-NF5IMQEW.js +2 -0
- package/dist/chunk-NF5IMQEW.js.map +1 -0
- package/dist/{chunk-D3XENMEM.js → chunk-O3QLBSMV.js} +2 -2
- package/dist/chunk-O3QLBSMV.js.map +1 -0
- package/dist/chunk-O562EWKG.js +2 -0
- package/dist/chunk-O562EWKG.js.map +1 -0
- package/dist/chunk-OIXUBXFU.js +2 -0
- package/dist/{chunk-GMGKIQLI.js.map → chunk-OIXUBXFU.js.map} +1 -1
- package/dist/chunk-OKAOH4ER.js +2 -0
- package/dist/chunk-OKAOH4ER.js.map +1 -0
- package/dist/chunk-ONZPO4GN.js +2 -0
- package/dist/{chunk-IDSJI7KQ.js.map → chunk-ONZPO4GN.js.map} +1 -1
- package/dist/chunk-P5VTRXW3.js +2 -0
- package/dist/chunk-P5VTRXW3.js.map +1 -0
- package/dist/chunk-PH5CQN7X.js +2 -0
- package/dist/{chunk-MESREYTZ.js.map → chunk-PH5CQN7X.js.map} +1 -1
- package/dist/chunk-PJMKZ3HR.js +2 -0
- package/dist/chunk-PJMKZ3HR.js.map +1 -0
- package/dist/chunk-PMLMQNSO.js +2 -0
- package/dist/chunk-PMLMQNSO.js.map +1 -0
- package/dist/chunk-QHN4PPHD.js +2 -0
- package/dist/{chunk-3FVI5JIC.js.map → chunk-QHN4PPHD.js.map} +1 -1
- package/dist/chunk-RYEOLQIL.js +2 -0
- package/dist/chunk-RYEOLQIL.js.map +1 -0
- package/dist/{chunk-FZ2HS6G7.js → chunk-S4XU4SE7.js} +1 -1
- package/dist/chunk-S4XU4SE7.js.map +1 -0
- package/dist/chunk-SIJ5SUY6.js +2 -0
- package/dist/chunk-SIJ5SUY6.js.map +1 -0
- package/dist/chunk-SJPBIRXM.js +2 -0
- package/dist/chunk-SJPBIRXM.js.map +1 -0
- package/dist/chunk-T5NPHXFC.js +2 -0
- package/dist/chunk-T5NPHXFC.js.map +1 -0
- package/dist/chunk-TPRGCMIZ.js +2 -0
- package/dist/chunk-TPRGCMIZ.js.map +1 -0
- package/dist/chunk-TZFGLE7X.js +2 -0
- package/dist/chunk-TZFGLE7X.js.map +1 -0
- package/dist/chunk-U4M5QBBG.js +2 -0
- package/dist/chunk-U4M5QBBG.js.map +1 -0
- package/dist/chunk-UEKXODGJ.js +2 -0
- package/dist/chunk-UEKXODGJ.js.map +1 -0
- package/dist/chunk-V2NCE4LO.js +2 -0
- package/dist/chunk-V2NCE4LO.js.map +1 -0
- package/dist/chunk-VI7WS34A.js +2 -0
- package/dist/chunk-VI7WS34A.js.map +1 -0
- package/dist/chunk-W5DS5Q4J.js +2 -0
- package/dist/chunk-W5DS5Q4J.js.map +1 -0
- package/dist/{chunk-2KK5HDYP.js → chunk-WEIRXEXU.js} +2 -2
- package/dist/chunk-WU77JQYU.js +2 -0
- package/dist/chunk-WU77JQYU.js.map +1 -0
- package/dist/chunk-WVJDCDGZ.js +2 -0
- package/dist/chunk-WVJDCDGZ.js.map +1 -0
- package/dist/{chunk-OLJ2S6A6.js → chunk-YG5FFTC4.js} +1 -1
- package/dist/chunk-YG5FFTC4.js.map +1 -0
- package/dist/{chunk-SSIHUUZY.js → chunk-YSIEXMDD.js} +2 -2
- package/dist/chunk-YSIEXMDD.js.map +1 -0
- package/dist/chunk-YXVLPPO2.js +2 -0
- package/dist/{chunk-XQ6WWP6K.js.map → chunk-YXVLPPO2.js.map} +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentBack.d.ts +3 -2
- package/dist/flows/ContractAmendment/ContractAmendmentBack.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +5 -5
- package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +5 -4
- package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentForm.d.ts +5 -5
- package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentSubmit.d.ts +3 -2
- package/dist/flows/ContractAmendment/ContractAmendmentSubmit.js +1 -1
- package/dist/flows/ContractAmendment/context.d.ts +5 -5
- package/dist/flows/ContractAmendment/hooks.d.ts +4 -4
- package/dist/flows/ContractAmendment/hooks.js +1 -1
- package/dist/flows/ContractAmendment/index.d.ts +3 -2
- 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/CostCalculatorDisclaimer.d.ts +2 -2
- package/dist/flows/CostCalculator/CostCalculatorDisclaimer.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +5 -4
- package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +9 -5
- package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorResetButton.d.ts +3 -2
- package/dist/flows/CostCalculator/CostCalculatorResetButton.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorSubmitButton.d.ts +3 -2
- package/dist/flows/CostCalculator/CostCalculatorSubmitButton.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorBenefitsBreakdown.d.ts +2 -2
- package/dist/flows/CostCalculator/Results/CostCalculatorBenefitsBreakdown.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.d.ts +2 -2
- package/dist/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorGrossSalary.d.ts +2 -2
- package/dist/flows/CostCalculator/Results/CostCalculatorGrossSalary.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorResults.d.ts +3 -3
- package/dist/flows/CostCalculator/Results/CostCalculatorResults.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorResultsChart.d.ts +2 -2
- package/dist/flows/CostCalculator/Results/CostCalculatorResultsChart.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorResultsChart.js.map +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorTotalCost.d.ts +2 -2
- package/dist/flows/CostCalculator/Results/CostCalculatorTotalCost.js +1 -1
- package/dist/flows/CostCalculator/context.d.ts +9 -6
- package/dist/flows/CostCalculator/context.js +1 -1
- package/dist/flows/CostCalculator/hooks.d.ts +4 -3
- package/dist/flows/CostCalculator/hooks.js +1 -1
- package/dist/flows/CostCalculator/index.d.ts +5 -1
- package/dist/flows/CostCalculator/index.js +1 -1
- package/dist/flows/CostCalculator/types.d.ts +12 -2
- package/dist/flows/CostCalculator/utils.d.ts +8 -4
- package/dist/flows/CostCalculator/utils.js +1 -1
- package/dist/flows/Onboarding/BasicInformationStep.d.ts +5 -5
- package/dist/flows/Onboarding/BasicInformationStep.js +1 -1
- package/dist/flows/Onboarding/BenefitsStep.d.ts +14 -9
- package/dist/flows/Onboarding/BenefitsStep.js +1 -1
- package/dist/flows/Onboarding/ContractDetailsStep.d.ts +9 -6
- package/dist/flows/Onboarding/ContractDetailsStep.js +1 -1
- package/dist/flows/Onboarding/OnboardingBack.d.ts +4 -2
- package/dist/flows/Onboarding/OnboardingBack.js +1 -1
- package/dist/flows/Onboarding/OnboardingFlow.d.ts +17 -6
- package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
- package/dist/flows/Onboarding/OnboardingForm.d.ts +8 -6
- package/dist/flows/Onboarding/OnboardingForm.js +1 -1
- package/dist/flows/Onboarding/OnboardingInvite.d.ts +15 -8
- package/dist/flows/Onboarding/OnboardingInvite.js +1 -1
- package/dist/flows/Onboarding/OnboardingSubmit.d.ts +3 -2
- package/dist/flows/Onboarding/OnboardingSubmit.js +1 -1
- package/dist/flows/Onboarding/ReviewStep.d.ts +38 -0
- package/dist/flows/Onboarding/ReviewStep.js +2 -0
- package/dist/flows/Onboarding/ReviewStep.js.map +1 -0
- 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 +113 -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 +48 -15
- package/dist/flows/Onboarding/context.js +1 -1
- package/dist/flows/Onboarding/hooks.d.ts +62 -31
- package/dist/flows/Onboarding/hooks.js +1 -1
- package/dist/flows/Onboarding/index.d.ts +10 -5
- 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 +23 -3
- package/dist/flows/Onboarding/utils.d.ts +23 -3
- package/dist/flows/Onboarding/utils.js +1 -1
- package/dist/flows/Termination/AdditionalDetailsForm.d.ts +4 -4
- package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
- package/dist/flows/Termination/EmployeeComunicationForm.d.ts +3 -3
- package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
- package/dist/flows/Termination/PaidTimeOffForm.d.ts +3 -3
- package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
- package/dist/flows/Termination/TerminationBack.d.ts +3 -2
- package/dist/flows/Termination/TerminationBack.js +1 -1
- package/dist/flows/Termination/TerminationDetailsForm.d.ts +3 -3
- package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
- package/dist/flows/Termination/TerminationFlow.d.ts +6 -4
- package/dist/flows/Termination/TerminationFlow.js +1 -1
- package/dist/flows/Termination/TerminationForm.d.ts +3 -3
- package/dist/flows/Termination/TerminationForm.js +1 -1
- package/dist/flows/Termination/TerminationSubmit.d.ts +3 -2
- package/dist/flows/Termination/TerminationSubmit.js +1 -1
- package/dist/flows/Termination/TimeOff.d.ts +4 -4
- package/dist/flows/Termination/TimeOff.js +1 -1
- package/dist/flows/Termination/context.d.ts +5 -4
- package/dist/flows/Termination/hooks.d.ts +3 -2
- package/dist/flows/Termination/hooks.js +1 -1
- package/dist/flows/Termination/index.d.ts +3 -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 +19 -6
- 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.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +16 -8
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/{remoteFlows-CswYencu.d.ts → remoteFlows-D0i6pVe5.d.ts} +49 -25
- package/dist/types-CxSFjQw5.d.ts +3 -0
- package/dist/{types.gen-HC04kr7n.d.ts → types.gen-Ctv2nomK.d.ts} +268 -2
- package/package.json +18 -3
- package/dist/chunk-2PXGLWCY.js +0 -2
- package/dist/chunk-2PXGLWCY.js.map +0 -1
- package/dist/chunk-344TN4EG.js +0 -2
- package/dist/chunk-344TN4EG.js.map +0 -1
- package/dist/chunk-36UPHOJS.js +0 -2
- package/dist/chunk-36UPHOJS.js.map +0 -1
- package/dist/chunk-3FVI5JIC.js +0 -2
- package/dist/chunk-4HAR3Z2C.js +0 -2
- package/dist/chunk-4HAR3Z2C.js.map +0 -1
- package/dist/chunk-56BNVYTD.js +0 -2
- package/dist/chunk-6A3F6JG6.js +0 -2
- package/dist/chunk-6A3F6JG6.js.map +0 -1
- package/dist/chunk-6CT35VQR.js +0 -2
- package/dist/chunk-6CT35VQR.js.map +0 -1
- package/dist/chunk-7CYG2RHP.js +0 -2
- package/dist/chunk-7CYG2RHP.js.map +0 -1
- package/dist/chunk-BKBIALOU.js +0 -2
- package/dist/chunk-BKBIALOU.js.map +0 -1
- package/dist/chunk-BKROCZRD.js +0 -2
- package/dist/chunk-BKROCZRD.js.map +0 -1
- package/dist/chunk-BL2HRBUQ.js +0 -2
- package/dist/chunk-BL2HRBUQ.js.map +0 -1
- package/dist/chunk-D3XENMEM.js.map +0 -1
- package/dist/chunk-DGPRFQYK.js +0 -2
- package/dist/chunk-DGPRFQYK.js.map +0 -1
- package/dist/chunk-DPKJX4NS.js +0 -2
- package/dist/chunk-DPKJX4NS.js.map +0 -1
- package/dist/chunk-EAAIAMTY.js +0 -2
- package/dist/chunk-EAAIAMTY.js.map +0 -1
- package/dist/chunk-FMT2OTOL.js +0 -2
- package/dist/chunk-FMT2OTOL.js.map +0 -1
- package/dist/chunk-FNMWKUNJ.js +0 -2
- package/dist/chunk-FNMWKUNJ.js.map +0 -1
- package/dist/chunk-FZ2HS6G7.js.map +0 -1
- package/dist/chunk-GFBF55NR.js +0 -2
- package/dist/chunk-GMGKIQLI.js +0 -2
- package/dist/chunk-GPICG72A.js +0 -2
- package/dist/chunk-GPICG72A.js.map +0 -1
- package/dist/chunk-GYSK6CY5.js +0 -2
- package/dist/chunk-GYSK6CY5.js.map +0 -1
- package/dist/chunk-HSW5HMHH.js +0 -2
- package/dist/chunk-IDSJI7KQ.js +0 -2
- package/dist/chunk-J55S4SEH.js +0 -2
- package/dist/chunk-J55S4SEH.js.map +0 -1
- package/dist/chunk-J6LUE5K7.js +0 -2
- package/dist/chunk-J6LUE5K7.js.map +0 -1
- package/dist/chunk-JIBRNWD2.js +0 -2
- package/dist/chunk-JIBRNWD2.js.map +0 -1
- package/dist/chunk-JWIYUQ5X.js +0 -2
- package/dist/chunk-JWIYUQ5X.js.map +0 -1
- package/dist/chunk-KH6QS5OU.js +0 -2
- package/dist/chunk-KH6QS5OU.js.map +0 -1
- package/dist/chunk-KSGPQCSG.js +0 -2
- package/dist/chunk-KSGPQCSG.js.map +0 -1
- package/dist/chunk-M5VZBMLC.js +0 -2
- package/dist/chunk-M7WCW7WD.js +0 -2
- package/dist/chunk-M7WCW7WD.js.map +0 -1
- package/dist/chunk-MESREYTZ.js +0 -2
- package/dist/chunk-MHKNAQLP.js +0 -2
- package/dist/chunk-MHKNAQLP.js.map +0 -1
- package/dist/chunk-OLJ2S6A6.js.map +0 -1
- package/dist/chunk-QEMICBEY.js +0 -2
- package/dist/chunk-QEMICBEY.js.map +0 -1
- package/dist/chunk-RIAYBN32.js +0 -2
- package/dist/chunk-RIAYBN32.js.map +0 -1
- package/dist/chunk-RLS4PMWA.js +0 -2
- package/dist/chunk-RLS4PMWA.js.map +0 -1
- package/dist/chunk-RRFSGYAC.js +0 -2
- package/dist/chunk-RRFSGYAC.js.map +0 -1
- package/dist/chunk-S4FKLPBB.js +0 -2
- package/dist/chunk-S4FKLPBB.js.map +0 -1
- package/dist/chunk-S56EWAS4.js +0 -2
- package/dist/chunk-S56EWAS4.js.map +0 -1
- package/dist/chunk-SSIHUUZY.js.map +0 -1
- package/dist/chunk-WQHKB5T7.js +0 -2
- package/dist/chunk-WQHKB5T7.js.map +0 -1
- package/dist/chunk-WS3C3WIJ.js +0 -2
- package/dist/chunk-WS3C3WIJ.js.map +0 -1
- package/dist/chunk-XJMVWJZ4.js +0 -2
- package/dist/chunk-XJMVWJZ4.js.map +0 -1
- package/dist/chunk-XLFHHYVS.js +0 -2
- package/dist/chunk-XLFHHYVS.js.map +0 -1
- package/dist/chunk-XQ6WWP6K.js +0 -2
- package/dist/chunk-XVOJ4RMC.js +0 -2
- package/dist/chunk-XVOJ4RMC.js.map +0 -1
- package/dist/chunk-YDUUQU4R.js +0 -2
- package/dist/chunk-YDUUQU4R.js.map +0 -1
- package/dist/chunk-YH5F6MGK.js +0 -2
- package/dist/chunk-YH5F6MGK.js.map +0 -1
- package/dist/chunk-YOC3VDC7.js +0 -2
- package/dist/chunk-YOC3VDC7.js.map +0 -1
- /package/dist/{chunk-HSW5HMHH.js.map → chunk-2Y22JKVE.js.map} +0 -0
- /package/dist/{chunk-NFEY2YL6.js.map → chunk-3PH5E6CZ.js.map} +0 -0
- /package/dist/{chunk-2KK5HDYP.js.map → chunk-WEIRXEXU.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./chunk-M22FKNEY.js";import{a as tr}from"./chunk-
|
|
1
|
+
import"./chunk-M22FKNEY.js";import{a as tr}from"./chunk-YXVLPPO2.js";import"./chunk-55SA3TEF.js";import"./chunk-WEIRXEXU.js";import"./chunk-DP4SIYAC.js";import"./chunk-XFD3ULUF.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-S4XU4SE7.js";import"./chunk-V2NCE4LO.js";import"./chunk-OKAOH4ER.js";import"./chunk-7KUKFRKC.js";import"./chunk-UEKXODGJ.js";import"./chunk-B4SVITZI.js";import"./chunk-T5NPHXFC.js";import"./chunk-DZYFSFZ7.js";import"./chunk-GULCZWSK.js";import{a as or}from"./chunk-PMLMQNSO.js";import"./chunk-4A6ZQNMB.js";import"./chunk-JJPI2YDM.js";import"./chunk-6I6RMJXC.js";import"./chunk-RYEOLQIL.js";import"./chunk-TZFGLE7X.js";import"./chunk-LJRUD43L.js";import"./chunk-VI7WS34A.js";import"./chunk-WVJDCDGZ.js";import"./chunk-SIJ5SUY6.js";import"./chunk-HJBXUPHM.js";import"./chunk-MGUDZTTV.js";import"./chunk-SJPBIRXM.js";import"./chunk-PJMKZ3HR.js";import"./chunk-O562EWKG.js";import"./chunk-FGBEOUQK.js";import{a as E}from"./chunk-HBH2PSYQ.js";import"./chunk-P5VTRXW3.js";import"./chunk-4YNOSVYQ.js";import"./chunk-QHN4PPHD.js";import"./chunk-HSY5OO7D.js";import"./chunk-PH5CQN7X.js";import"./chunk-OIXUBXFU.js";import"./chunk-IAHI4OUM.js";import{a as R}from"./chunk-LTDDSH45.js";import{a as z}from"./chunk-IKQ25VV5.js";import{a as F}from"./chunk-FB4QOGWE.js";import"./chunk-A7ZJQCNU.js";import{a as B}from"./chunk-U4M5QBBG.js";import{a as _}from"./chunk-DYB3RWP7.js";import{a as T}from"./chunk-DBIPVIBO.js";import"./chunk-YG5FFTC4.js";import{b as y,c as k,e as C}from"./chunk-WU77JQYU.js";import"./chunk-UPRUP24B.js";import"./chunk-G7BISHWK.js";import{a as er}from"./chunk-W5DS5Q4J.js";import{a as H}from"./chunk-NF5IMQEW.js";import{a as ar}from"./chunk-YSIEXMDD.js";import{a as J,b as rr}from"./chunk-3PH5E6CZ.js";import"./chunk-JRQSZHUU.js";import"./chunk-O3QLBSMV.js";import{a as p}from"./chunk-GMU3QGAR.js";import"./chunk-INAXCFVC.js";import"./chunk-GFWQG4ZT.js";import{a as G}from"./chunk-6T3A6GWH.js";import{a as Z}from"./chunk-L5OIK2ZJ.js";import"./chunk-EGDD73PU.js";import"./chunk-NEFNFYRS.js";import"./chunk-A4RX3KRZ.js";import"./chunk-EMVYCKDC.js";import{a as g,c as v}from"./chunk-WRDKLT4N.js";import"./chunk-ONZPO4GN.js";import"./chunk-TPRGCMIZ.js";import"./chunk-6HGUGIYJ.js";import{c as P}from"./chunk-5ETXP2QF.js";import{a as e}from"./chunk-AYDF3IFZ.js";import{QueryClient as L,QueryClientProvider as q}from"@tanstack/react-query";function l(r){let a=document.documentElement;Object.keys(r).forEach(t=>{let o=r[t];o&&a.style.setProperty(t,o)})}e(l,"setCssProperties");function S(r){let a={};return Object.keys(r).forEach(t=>{a[`--${t}`]=r[t]}),a}e(S,"mapThemeColors");function j(r){return{"--spacing":r}}e(j,"mapThemeSpacing");function M(r){return{"--radius":r}}e(M,"mapThemeBorderRadius");function O(r){return{"--fontSizeBase":r.fontSizeBase}}e(O,"mapThemeFont");function h(r){r?.colors&&l(S(r.colors)),r?.spacing&&l(j(r.spacing)),r?.borderRadius&&l(M(r.borderRadius)),r?.font&&l(O(r.font))}e(h,"applyTheme");import{createContext as A,useEffect as D,useMemo as I}from"react";import{jsx as K}from"react/jsx-runtime";var N=A({theme:{}});function u(r){D(()=>{r.theme&&Object.keys(r.theme).length>0&&h(r.theme)},[r.theme]);let a=I(()=>({theme:r.theme}),[r.theme]);return K(N.Provider,{value:a,children:r.children})}e(u,"ThemeProvider");var w={staging:"https://gateway.niceremote.com",partners:"https://gateway.partners.remote-sandbox.com",production:"https://gateway.remote.com"};import{createClient as U}from"@hey-api/client-fetch";import{useQuery as V}from"@tanstack/react-query";import{useRef as m}from"react";function W(r){try{return new URL(r),!0}catch{return!1}}e(W,"isValidUrl");var f=e(({auth:r,options:a})=>{let t=m(null),{refetch:o}=V({queryKey:["auth"],queryFn:r,enabled:!1}),c=a.isTestingMode?w.partners:"https://gateway.remote.com",s=p.getConfig(),x="0.4.0-alpha.10",d=!!a.proxy&&W(a.proxy.url);return a.proxy&&!d&&console.error("Invalid proxy URL provided. Using default base URL."),m(U({...s,headers:{...s.headers,...d?a.proxy?.headers:{},"X-Client-Name":"remote-flows-sdk","X-Client-Version":x},baseUrl:d?a.proxy?.url:c,auth:e(async()=>{function b(i){return!i||Date.now()+6e4>i}if(e(b,"hasTokenExpired"),!t.current||b(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");import{jsx as n}from"react/jsx-runtime";var Q=new L;function X({children:r,auth:a,isTestingMode:t,proxy:o}){let c=f({auth:a,options:{isTestingMode:!!t,proxy:o}});return n(v.Provider,{value:{client:c.current},children:r})}e(X,"RemoteFlowContextWrapper");function Y({children:r,components:a}){return n(g.Provider,{value:a?{components:a}:{components:{}},children:r})}e(Y,"FormFieldsProvider");function $({auth:r,children:a,components:t,isTestingMode:o=!1,theme:c,proxy:s}){return n(q,{client:Q,children:n(Y,{components:t,children:n(X,{isTestingMode:o,auth:r,proxy:s,children:n(u,{theme:c,children:a})})})})}e($,"RemoteFlows");export{G as ContractAmendmentConfirmationForm,er as ContractAmendmentFlow,Z as ContractAmendmentForm,H as ContractAmendmentSubmit,B as CostCalculatorDisclaimer,T as CostCalculatorFlow,R as CostCalculatorForm,z as CostCalculatorResetButton,E as CostCalculatorResults,F as CostCalculatorSubmitButton,or as OnboardingFlow,$ as RemoteFlows,tr as TerminationFlow,y as buildCostCalculatorEstimationPayload,_ as disclaimerData,P as transformYupErrorsIntoObject,ar as useContractAmendment,C as useCostCalculator,k as useCostCalculatorEstimationPdf,J as useEmploymentQuery,rr 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":"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","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 { 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":"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","names":["QueryClient","QueryClientProvider","setCssProperties","variables","root","v","propertyVal","__name","mapThemeColors","colors","result","key","mapThemeSpacing","spacing","mapThemeBorderRadius","borderRadius","mapThemeFont","font","applyTheme","theme","createContext","useEffect","useMemo","jsx","ThemeContext","createContext","ThemeProvider","props","useEffect","applyTheme","value","useMemo","__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","jsx","queryClient","QueryClient","RemoteFlowContextWrapper","children","auth","isTestingMode","proxy","remoteApiClient","useAuth","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-CxSFjQw5.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;
|
|
@@ -59,30 +58,54 @@ type JSFField = {
|
|
|
59
58
|
maxLength?: number;
|
|
60
59
|
multiple?: boolean;
|
|
61
60
|
};
|
|
61
|
+
/**
|
|
62
|
+
* Props for custom field components.
|
|
63
|
+
* All custom field components receive these three props from React Hook Form's Controller.
|
|
64
|
+
*/
|
|
65
|
+
type FieldComponentProps = {
|
|
66
|
+
/**
|
|
67
|
+
* Field prop from React Hook Form's Controller component.
|
|
68
|
+
* Contains field state and methods for registration.
|
|
69
|
+
* You must bind these props to your HTML elements to ensure proper form state management.
|
|
70
|
+
* @see https://react-hook-form.com/docs/usecontroller/controller
|
|
71
|
+
*/
|
|
72
|
+
field: ControllerRenderProps<FieldValues, string>;
|
|
73
|
+
/**
|
|
74
|
+
* Field state prop from React Hook Form's Controller component.
|
|
75
|
+
* Contains information about the field's state, such as errors, touched status, etc.
|
|
76
|
+
* @see https://react-hook-form.com/docs/usecontroller/controller
|
|
77
|
+
*/
|
|
78
|
+
fieldState: ControllerFieldState;
|
|
79
|
+
/**
|
|
80
|
+
* Metadata derived from JSON schema parsing that provides additional context and validation rules for the field.
|
|
81
|
+
* Contains properties defined in the original JSON schema such as type, format, constraints, etc.
|
|
82
|
+
*/
|
|
83
|
+
fieldData: Partial<JSFField>;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Props for custom button components.
|
|
87
|
+
*/
|
|
88
|
+
type ButtonComponentProps = {
|
|
89
|
+
/**
|
|
90
|
+
* The form ID that the button should be associated with.
|
|
91
|
+
*/
|
|
92
|
+
form?: string;
|
|
93
|
+
/**
|
|
94
|
+
* The children content of the button.
|
|
95
|
+
*/
|
|
96
|
+
children?: React.ReactNode;
|
|
97
|
+
} & React.ButtonHTMLAttributes<HTMLButtonElement> & Record<string, unknown>;
|
|
98
|
+
/**
|
|
99
|
+
* Props for custom statement components.
|
|
100
|
+
*/
|
|
101
|
+
type StatementComponentProps = {
|
|
102
|
+
data: StatementProps;
|
|
103
|
+
};
|
|
62
104
|
type Components = {
|
|
63
|
-
[K in SupportedTypes]?: React.ComponentType<
|
|
64
|
-
/**
|
|
65
|
-
* Field prop from React Hook Form's Controller component.
|
|
66
|
-
* Contains field state and methods for registration.
|
|
67
|
-
* @see https://react-hook-form.com/docs/usecontroller/controller
|
|
68
|
-
*/
|
|
69
|
-
field: ControllerRenderProps<FieldValues, string>;
|
|
70
|
-
/**
|
|
71
|
-
* Field state prop from React Hook Form's Controller component.
|
|
72
|
-
* Contains information about the field's state, such as errors, touched status, etc.
|
|
73
|
-
* @see https://react-hook-form.com/docs/usecontroller/controller
|
|
74
|
-
*/
|
|
75
|
-
fieldState: ControllerFieldState;
|
|
76
|
-
/**
|
|
77
|
-
* Metadata derived from JSON schema parsing that provides additional context and validation rules for the field.
|
|
78
|
-
* Contains properties defined in the original JSON schema such as type, format, constraints, etc.
|
|
79
|
-
*/
|
|
80
|
-
fieldData: JSFField;
|
|
81
|
-
}>;
|
|
105
|
+
[K in SupportedTypes]?: React.ComponentType<FieldComponentProps>;
|
|
82
106
|
} & {
|
|
83
|
-
statement?: React.ComponentType<
|
|
84
|
-
|
|
85
|
-
}>;
|
|
107
|
+
statement?: React.ComponentType<StatementComponentProps>;
|
|
108
|
+
button?: React.ComponentType<ButtonComponentProps>;
|
|
86
109
|
};
|
|
87
110
|
type RemoteFlowsSDKProps = Omit<ThemeProviderProps, 'children'> & {
|
|
88
111
|
/**
|
|
@@ -112,5 +135,6 @@ type RemoteFlowsSDKProps = Omit<ThemeProviderProps, 'children'> & {
|
|
|
112
135
|
};
|
|
113
136
|
};
|
|
114
137
|
};
|
|
138
|
+
type $TSFixMe = any;
|
|
115
139
|
|
|
116
|
-
export type { Components as C, RemoteFlowsSDKProps as R };
|
|
140
|
+
export type { $TSFixMe as $, ButtonComponentProps as B, Components as C, FieldComponentProps as F, RemoteFlowsSDKProps as R, StatementComponentProps as S };
|
|
@@ -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,
|
|
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, Employment as i, EmploymentTermType as j, PostCreateOffboardingError as k, EmploymentCreationResponse as l, PostCreateEmployment2Error as m, EmploymentResponse as n, PatchUpdateEmployment2Error as o, PutUpdateBenefitOfferError as p, Company as q, PostInviteEmploymentInvitationError as r, PostCreateRiskReserveError as s, EmploymentFullParams as t, UnprocessableEntityResponse as u, MagicLinkParams as v, TimeoffStatus as w, CostCalculatorEmployment as x, Currency as y };
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remoteoss/remote-flows",
|
|
3
|
-
"version": "0.4.0-alpha.
|
|
3
|
+
"version": "0.4.0-alpha.10",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "NODE_ENV=production tsup",
|
|
6
6
|
"ci": "npm run build && npm run check-format && npm run check-exports && npm run lint && npm run test",
|
|
7
7
|
"check-exports": "attw --pack . --ignore-rules=cjs-resolves-to-esm --exclude-entrypoints index.css",
|
|
8
8
|
"check-format": "prettier --check .",
|
|
9
9
|
"dev": "NODE_ENV=development tsup --watch",
|
|
10
|
+
"build:reset": "postcss src/styles/reset.css -o ./example/src/css/reset.css",
|
|
10
11
|
"lint": "eslint .",
|
|
11
12
|
"format": "prettier --write .",
|
|
12
13
|
"openapi-ts": "openapi-ts",
|
|
@@ -16,7 +17,8 @@
|
|
|
16
17
|
"changeset:version": "changeset version",
|
|
17
18
|
"prepare": "npm run build",
|
|
18
19
|
"prerelease": "npm run ci",
|
|
19
|
-
"release": "changeset publish"
|
|
20
|
+
"release": "changeset publish",
|
|
21
|
+
"type-check": "tsc --noEmit"
|
|
20
22
|
},
|
|
21
23
|
"type": "module",
|
|
22
24
|
"main": "dist/index.js",
|
|
@@ -72,7 +74,13 @@
|
|
|
72
74
|
"cmdk": "^1.1.1",
|
|
73
75
|
"date-fns": "^3.6.0",
|
|
74
76
|
"dompurify": "^3.2.5",
|
|
75
|
-
"lodash": "^4.
|
|
77
|
+
"lodash.capitalize": "^4.2.1",
|
|
78
|
+
"lodash.get": "^4.4.2",
|
|
79
|
+
"lodash.groupby": "^4.6.0",
|
|
80
|
+
"lodash.isnull": "^3.0.0",
|
|
81
|
+
"lodash.mergewith": "^4.6.2",
|
|
82
|
+
"lodash.omit": "^4.5.0",
|
|
83
|
+
"lodash.omitby": "^4.6.0",
|
|
76
84
|
"lucide-react": "0.477.0",
|
|
77
85
|
"postcss": "^8.5.3",
|
|
78
86
|
"react-day-picker": "^8.10.1",
|
|
@@ -94,6 +102,13 @@
|
|
|
94
102
|
"@testing-library/react": "^16.2.0",
|
|
95
103
|
"@testing-library/user-event": "^14.6.1",
|
|
96
104
|
"@types/jsdom": "^21.1.7",
|
|
105
|
+
"@types/lodash.capitalize": "^4.2.9",
|
|
106
|
+
"@types/lodash.get": "^4.4.9",
|
|
107
|
+
"@types/lodash.groupby": "^4.6.9",
|
|
108
|
+
"@types/lodash.isnull": "^3.0.9",
|
|
109
|
+
"@types/lodash.mergewith": "^4.6.9",
|
|
110
|
+
"@types/lodash.omit": "^4.5.9",
|
|
111
|
+
"@types/lodash.omitby": "^4.6.9",
|
|
97
112
|
"@types/node": "^22.13.4",
|
|
98
113
|
"@types/react": "^19.0.10",
|
|
99
114
|
"@vitest/coverage-istanbul": "^3.0.8",
|
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-344TN4EG.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as x}from"./chunk-UPRUP24B.js";import{e as j,g as M,j as w,n as B,p as O}from"./chunk-FNMWKUNJ.js";import{a as V}from"./chunk-A4RX3KRZ.js";import{d as f}from"./chunk-WRDKLT4N.js";import{a as y,c as A}from"./chunk-XVOJ4RMC.js";import{a as r}from"./chunk-AYDF3IFZ.js";import{object as se}from"yup";import{createHeadlessForm as k,modify as I}from"@remoteoss/json-schema-form";import{useMutation as K,useQuery as p}from"@tanstack/react-query";import{useState as q}from"react";import{string as L,ValidationError as J}from"yup";var oe=r(({includePremiumBenefits:e})=>{let{client:o}=f();return p({queryKey:["cost-calculator-countries",e],queryFn:r(()=>w({client:o,headers:{Authorization:""},query:{include_premium_benefits:e}}),"queryFn"),select:r(n=>n.data?.data.map(a=>({value:a.region_slug,label:a.name,childRegions:a.child_regions,hasAdditionalFields:a.has_additional_fields,regionSlug:a.region_slug})),"select")})},"useCostCalculatorCountries"),ie=r(()=>{let{client:e}=f();return p({queryKey:["company-currencies"],queryFn:r(()=>O({client:e,headers:{Authorization:""}}),"queryFn"),select:r(o=>o.data?.data?.company_currencies.map(n=>({value:n.slug,label:n.code})),"select")})},"useCompanyCurrencies"),ne=r(()=>{let{client:e}=f();return K({mutationFn:r(o=>j({client:e,headers:{Authorization:""},body:o}),"mutationFn")})},"useCostCalculatorEstimation"),Fe=r(()=>{let{client:e}=f();return K({mutationFn:r(o=>M({client:e,headers:{Authorization:""},body:o}),"mutationFn")})},"useCostCalculatorEstimationPdf"),ae=r((e,{includePremiumBenefits:o,options:n})=>{let{client:a}=f();return p({queryKey:["cost-calculator-region-fields",e,o],queryFn:r(()=>B({client:a,headers:{Authorization:""},path:{slug:e},query:{include_premium_benefits:o}}),"queryFn"),enabled:!!e,select:r(({data:s})=>{let u=s?.data?.schema||{};if(n&&n.jsfModify){let{schema:c}=I(u,n.jsfModify);u=c}return k(u)},"select")})},"useRegionFields"),E={title:"Estimation",includeBenefits:!1,includeCostBreakdowns:!1,includePremiumBenefits:!1},Pe=r(({defaultRegion:e,estimationOptions:o,options:n}={estimationOptions:E})=>{let{schema:a}=I(x.data.schema,n?.jsfModify||{}),s=k(a),[u,c]=q(e),[h,b]=q(),{data:g,isLoading:G}=oe({includePremiumBenefits:o.includePremiumBenefits}),{data:_,isLoading:U}=ie(),$=u||h?.value,{data:S,isLoading:H}=ae($,{includePremiumBenefits:o.includePremiumBenefits,options:n}),F=ne();async function N(i){try{await C.validate(i,{abortEarly:!1})}catch(t){return{data:null,error:t}}return new Promise((t,d)=>{F.mutate(T(i,o),{onSuccess:r(l=>{l.data?t({data:l.data,error:null}):t({data:null,error:new Error("Something went wrong. Please try again later.")})},"onSuccess"),onError:r(l=>{d({data:null,error:l})},"onError")})})}r(N,"onSubmit");function Q(i){let t=g?.find(({value:d})=>d===i);t&&t.childRegions.length===0&&t.hasAdditionalFields?c(t.regionSlug):c(void 0),b(t)}r(Q,"onCountryChange");function D(i){c(i)}r(D,"onRegionChange");let m=s.fields.find(i=>i.name==="region");if(m){let i=h?.childRegions.map(t=>({value:t.slug,label:t.name}))??[];m.options=i,m.isVisible=i.length>0,m.required=i.length>0,m.onChange=D,m.schema=i.length>0?L().transform(t=>typeof t=="string"?t:"").required("Region is required"):L()}if(_){let i=s.fields.find(t=>t.name==="currency");i&&(i.options=_)}if(g){let i=s.fields.find(t=>t.name==="country");i&&(i.options=g,i.onChange=Q)}let W=r(()=>{b(void 0),c(e)},"resetForm"),P=[...s.fields,...S?.fields||[]],C=z(s.fields);async function X(i){let t=null,d=A(i,P);try{await C.validate(d,{abortEarly:!1}),t={formErrors:{},yupError:new J([],i)}}catch(R){let v=V(R);t={formErrors:Object.entries(v).reduce((ee,[te,re])=>({...ee,[te]:re.message}),{}),yupError:R}}let l=S?.handleValidation(d),Y=[...t?.yupError.inner||[],...l?.yupError?.inner||[]],Z={...t?.yupError?.value||{},...l?.yupError?.value||{}};return{formErrors:{...t?.formErrors||{},...l?.formErrors||{}},yupError:new J(Y,Z)}}return r(X,"handleValidation"),{stepState:{current:0,total:1,isLastStep:!0},fields:P,validationSchema:C,handleValidation:X,isSubmitting:F.isPending,isLoading:G&&U&&H,onSubmit:N,resetForm:W}},"useCostCalculator");function z(e){let o=e.reduce((n,a)=>(n[a.name]=a.schema,n),{});return se(o)}r(z,"buildValidationSchema");function le(e){let o="benefit-";return Object.keys(e).reduce((n,a)=>{let u={benefit_group_slug:a.replace(o,""),benefit_tier_slug:e[a]};return[...n,u]},[])}r(le,"formatBenefits");function T(e,o=E){return{employer_currency_slug:e.currency,include_benefits:o.includeBenefits,include_cost_breakdowns:o.includeCostBreakdowns,include_premium_benefits:o.includePremiumBenefits,employments:[{region_slug:e.region||e.country,annual_gross_salary:y(e.salary),annual_gross_salary_in_employer_currency:y(e.salary),employment_term:e.contract_duration_type??"fixed",title:o.title,regional_to_employer_exchange_rate:"1",age:e.age??void 0,...e.benefits&&{benefits:le(e.benefits)}}]}}r(T,"buildPayload");export{z as a,T as b,Fe as c,E as d,Pe as e};
|
|
2
|
-
//# sourceMappingURL=chunk-344TN4EG.js.map
|