@remoteoss/remote-flows 0.7.5 → 0.8.0
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 +8 -7
- package/dist/{chunk-2AOR4YZS.js → chunk-2OYKWBJY.js} +2 -2
- package/dist/{chunk-PCGJH2EO.js → chunk-2VGEHBMK.js} +2 -2
- package/dist/{chunk-V5ENHJL2.js → chunk-3GCWEV4G.js} +2 -2
- package/dist/{chunk-XZ5IR7N3.js → chunk-3KQWGXAR.js} +2 -2
- package/dist/{chunk-WT3QZR6I.js → chunk-3LGFQNYW.js} +2 -2
- package/dist/chunk-466M4PK7.js +2 -0
- package/dist/chunk-466M4PK7.js.map +1 -0
- package/dist/chunk-4F4I7F2P.js +2 -0
- package/dist/chunk-4F4I7F2P.js.map +1 -0
- package/dist/{chunk-7DM7LDK3.js → chunk-5IREEZLM.js} +2 -2
- package/dist/chunk-5PVQUO5Q.js +2 -0
- package/dist/chunk-5PVQUO5Q.js.map +1 -0
- package/dist/{chunk-HCFC46A6.js → chunk-6CU63ESU.js} +2 -2
- package/dist/{chunk-JTC54RNC.js → chunk-6P4XGSZ6.js} +2 -2
- package/dist/chunk-7LZQJ5CL.js +2 -0
- package/dist/chunk-7LZQJ5CL.js.map +1 -0
- package/dist/{chunk-K7CLAEMU.js → chunk-7N2NUY3F.js} +2 -2
- package/dist/{chunk-77WJVEKH.js → chunk-A27ASO7K.js} +2 -2
- package/dist/{chunk-VZB5LUZK.js → chunk-ADE22XT7.js} +2 -2
- package/dist/chunk-AEVZ7GEK.js +2 -0
- package/dist/chunk-AEVZ7GEK.js.map +1 -0
- package/dist/{chunk-SXVOPWRB.js → chunk-AHZSNZSG.js} +2 -2
- package/dist/chunk-AYAQLXJH.js +2 -0
- package/dist/{chunk-NJPNR4DK.js.map → chunk-AYAQLXJH.js.map} +1 -1
- package/dist/{chunk-ONH3EBJZ.js → chunk-BJFZBI3O.js} +2 -2
- package/dist/{chunk-MC6FNME3.js → chunk-C3KZEPUZ.js} +2 -2
- package/dist/{chunk-ZERPSH7S.js → chunk-CQ2QAZBG.js} +2 -2
- package/dist/chunk-DPLXEXMO.js +2 -0
- package/dist/{chunk-RPEWAKDI.js.map → chunk-DPLXEXMO.js.map} +1 -1
- package/dist/chunk-FQNVKX3N.js +2 -0
- package/dist/chunk-FQNVKX3N.js.map +1 -0
- package/dist/{chunk-ZVMBZK3H.js → chunk-G4NBJTHB.js} +2 -2
- package/dist/{chunk-SJVHKOCT.js → chunk-GLOSUWTH.js} +2 -2
- package/dist/{chunk-NVAWIT33.js → chunk-GPS62RDR.js} +2 -2
- package/dist/chunk-HGLI6PUM.js +2 -0
- package/dist/chunk-HGLI6PUM.js.map +1 -0
- package/dist/{chunk-TIHZZ6IF.js → chunk-HQMY3X2R.js} +2 -2
- package/dist/{chunk-Y7P3FLOM.js → chunk-IKYBTQKV.js} +2 -2
- package/dist/{chunk-CEFYPG7Z.js → chunk-IXVV7KPW.js} +2 -2
- package/dist/{chunk-6ZNJ5WMX.js → chunk-IXZAHZ7B.js} +2 -2
- package/dist/{chunk-5HFXSPZZ.js → chunk-KZ6QGSRA.js} +2 -2
- package/dist/{chunk-K6GSGFOD.js → chunk-NXZRK6KL.js} +2 -2
- package/dist/{chunk-J3ZV4EJ5.js → chunk-OGAVWGSY.js} +2 -2
- package/dist/{chunk-SYEPIESJ.js → chunk-OTTIURMN.js} +2 -2
- package/dist/{chunk-4JZ7V73S.js → chunk-PAC52YON.js} +2 -2
- package/dist/{chunk-55OFDAIV.js → chunk-Q5ZUVH3U.js} +2 -2
- package/dist/{chunk-MCWVVCIK.js → chunk-QBV4XS4Z.js} +2 -2
- package/dist/{chunk-HNMDLN2I.js → chunk-QYNAZIHD.js} +2 -2
- package/dist/{chunk-4UKKNARJ.js → chunk-R6OW77R6.js} +2 -2
- package/dist/{chunk-HP4SYBET.js → chunk-S62STPBT.js} +2 -2
- package/dist/{chunk-CAM6PYKR.js → chunk-SHFIZENN.js} +2 -2
- package/dist/chunk-SRZGBJVA.js +2 -0
- package/dist/chunk-SRZGBJVA.js.map +1 -0
- package/dist/{chunk-3QLTEH2U.js → chunk-TMUPJJDK.js} +2 -2
- package/dist/{chunk-VTNGEN34.js → chunk-UNTCBVHB.js} +2 -2
- package/dist/chunk-V6W2SJ4Z.js +2 -0
- package/dist/{chunk-7KQT4QR4.js.map → chunk-V6W2SJ4Z.js.map} +1 -1
- package/dist/{chunk-7NN4M5P2.js → chunk-WFET4MKU.js} +2 -2
- package/dist/{chunk-JQOEHEGL.js → chunk-WJA7PQ2J.js} +2 -2
- package/dist/{chunk-LVACJZSJ.js → chunk-WOUZK5DW.js} +2 -2
- package/dist/chunk-XFY4VAAJ.js +2 -0
- package/dist/chunk-XFY4VAAJ.js.map +1 -0
- package/dist/{chunk-5ZWCZYSA.js → chunk-XQPYSB6Y.js} +2 -2
- package/dist/{chunk-H32UX3PE.js → chunk-YAV236LM.js} +2 -2
- package/dist/chunk-YHSNK7WB.js +2 -0
- package/dist/chunk-YHSNK7WB.js.map +1 -0
- package/dist/{chunk-RUZWAFIN.js → chunk-ZBGBLTFN.js} +2 -2
- package/dist/{chunk-WRZ6WHH7.js → chunk-ZPUELAQZ.js} +2 -2
- package/dist/{chunk-TQYHW6QK.js → chunk-ZVXX43AL.js} +2 -2
- package/dist/flows/ContractAmendment/ContractAmendmentBack.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.js +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/ContractAmendmentSubmit.js +1 -1
- package/dist/flows/ContractAmendment/context.d.ts +2 -2
- package/dist/flows/ContractAmendment/hooks.d.ts +1 -1
- 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/utils.d.ts +1 -1
- package/dist/flows/CostCalculator/CostCalculatorDisclaimer.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/CostCalculatorResetButton.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorSubmitButton.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorBenefitsBreakdown.d.ts +2 -0
- package/dist/flows/CostCalculator/Results/CostCalculatorBenefitsBreakdown.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.d.ts +1 -0
- package/dist/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorExtraStatutoryPaymentsBreakdown.d.ts +2 -0
- package/dist/flows/CostCalculator/Results/CostCalculatorExtraStatutoryPaymentsBreakdown.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorGrossSalary.d.ts +2 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorGrossSalary.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorIndirectTax.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/Results/CostCalculatorResultsChart.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorTotalCost.js +1 -1
- package/dist/flows/CostCalculator/api.d.ts +1 -1
- package/dist/flows/CostCalculator/api.js +1 -1
- package/dist/flows/CostCalculator/components/SalaryField.d.ts +1 -1
- package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
- package/dist/flows/CostCalculator/context.d.ts +2 -2
- package/dist/flows/CostCalculator/hooks.d.ts +1 -1
- package/dist/flows/CostCalculator/hooks.js +1 -1
- package/dist/flows/CostCalculator/index.d.ts +2 -2
- package/dist/flows/CostCalculator/index.js +1 -1
- package/dist/flows/CostCalculator/types.d.ts +1 -1
- package/dist/flows/CostCalculator/utils.d.ts +2 -2
- package/dist/flows/CostCalculator/utils.js +1 -1
- package/dist/flows/Onboarding/OnboardingFlow.d.ts +2 -2
- package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
- package/dist/flows/Onboarding/api.d.ts +2 -2
- package/dist/flows/Onboarding/api.js +1 -1
- package/dist/flows/Onboarding/components/AnnualGrossSalary.d.ts +1 -1
- package/dist/flows/Onboarding/components/AnnualGrossSalary.js +1 -1
- package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +1 -1
- package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
- package/dist/flows/Onboarding/components/BenefitsStep.d.ts +2 -2
- package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
- package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +1 -1
- package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingBack.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingForm.d.ts +2 -2
- package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingInvite.d.ts +1 -1
- package/dist/flows/Onboarding/components/OnboardingInvite.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingSubmit.js +1 -1
- package/dist/flows/Onboarding/components/ReviewStep.d.ts +1 -1
- package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +1 -1
- package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
- package/dist/flows/Onboarding/context.d.ts +2 -2
- package/dist/flows/Onboarding/hooks.d.ts +2 -2
- package/dist/flows/Onboarding/hooks.js +1 -1
- package/dist/flows/Onboarding/index.d.ts +2 -2
- package/dist/flows/Onboarding/index.js +1 -1
- package/dist/flows/Onboarding/types.d.ts +1 -1
- package/dist/flows/Onboarding/utils.d.ts +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/TerminationBack.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 +1 -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/TerminationSubmit.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 +2 -2
- package/dist/flows/Termination/hooks.d.ts +1 -1
- package/dist/flows/Termination/hooks.js +1 -1
- package/dist/flows/Termination/index.d.ts +1 -1
- package/dist/flows/Termination/index.js +1 -1
- package/dist/flows/Termination/types.d.ts +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/{remoteFlows-B-p1H61n.d.ts → remoteFlows-Zmw9pCN3.d.ts} +6 -0
- package/dist/{types.gen-DSJsKiNm.d.ts → types.gen-BqCe1GRY.d.ts} +49 -5
- package/package.json +1 -1
- package/dist/chunk-276MJCIE.js +0 -2
- package/dist/chunk-276MJCIE.js.map +0 -1
- package/dist/chunk-7KQT4QR4.js +0 -2
- package/dist/chunk-E3RHKRLZ.js +0 -2
- package/dist/chunk-E3RHKRLZ.js.map +0 -1
- package/dist/chunk-FBBUL6AE.js +0 -2
- package/dist/chunk-FBBUL6AE.js.map +0 -1
- package/dist/chunk-FL5V45BK.js +0 -2
- package/dist/chunk-FL5V45BK.js.map +0 -1
- package/dist/chunk-FUIAABQ6.js +0 -2
- package/dist/chunk-FUIAABQ6.js.map +0 -1
- package/dist/chunk-ILMVHOL2.js +0 -2
- package/dist/chunk-ILMVHOL2.js.map +0 -1
- package/dist/chunk-INS7FVGA.js +0 -2
- package/dist/chunk-INS7FVGA.js.map +0 -1
- package/dist/chunk-NJPNR4DK.js +0 -2
- package/dist/chunk-QM2ADK6C.js +0 -2
- package/dist/chunk-QM2ADK6C.js.map +0 -1
- package/dist/chunk-RPEWAKDI.js +0 -2
- package/dist/chunk-XJDGWTCQ.js +0 -2
- package/dist/chunk-XJDGWTCQ.js.map +0 -1
- /package/dist/{chunk-2AOR4YZS.js.map → chunk-2OYKWBJY.js.map} +0 -0
- /package/dist/{chunk-PCGJH2EO.js.map → chunk-2VGEHBMK.js.map} +0 -0
- /package/dist/{chunk-V5ENHJL2.js.map → chunk-3GCWEV4G.js.map} +0 -0
- /package/dist/{chunk-XZ5IR7N3.js.map → chunk-3KQWGXAR.js.map} +0 -0
- /package/dist/{chunk-WT3QZR6I.js.map → chunk-3LGFQNYW.js.map} +0 -0
- /package/dist/{chunk-7DM7LDK3.js.map → chunk-5IREEZLM.js.map} +0 -0
- /package/dist/{chunk-HCFC46A6.js.map → chunk-6CU63ESU.js.map} +0 -0
- /package/dist/{chunk-JTC54RNC.js.map → chunk-6P4XGSZ6.js.map} +0 -0
- /package/dist/{chunk-K7CLAEMU.js.map → chunk-7N2NUY3F.js.map} +0 -0
- /package/dist/{chunk-77WJVEKH.js.map → chunk-A27ASO7K.js.map} +0 -0
- /package/dist/{chunk-VZB5LUZK.js.map → chunk-ADE22XT7.js.map} +0 -0
- /package/dist/{chunk-SXVOPWRB.js.map → chunk-AHZSNZSG.js.map} +0 -0
- /package/dist/{chunk-ONH3EBJZ.js.map → chunk-BJFZBI3O.js.map} +0 -0
- /package/dist/{chunk-MC6FNME3.js.map → chunk-C3KZEPUZ.js.map} +0 -0
- /package/dist/{chunk-ZERPSH7S.js.map → chunk-CQ2QAZBG.js.map} +0 -0
- /package/dist/{chunk-ZVMBZK3H.js.map → chunk-G4NBJTHB.js.map} +0 -0
- /package/dist/{chunk-SJVHKOCT.js.map → chunk-GLOSUWTH.js.map} +0 -0
- /package/dist/{chunk-NVAWIT33.js.map → chunk-GPS62RDR.js.map} +0 -0
- /package/dist/{chunk-TIHZZ6IF.js.map → chunk-HQMY3X2R.js.map} +0 -0
- /package/dist/{chunk-Y7P3FLOM.js.map → chunk-IKYBTQKV.js.map} +0 -0
- /package/dist/{chunk-CEFYPG7Z.js.map → chunk-IXVV7KPW.js.map} +0 -0
- /package/dist/{chunk-6ZNJ5WMX.js.map → chunk-IXZAHZ7B.js.map} +0 -0
- /package/dist/{chunk-5HFXSPZZ.js.map → chunk-KZ6QGSRA.js.map} +0 -0
- /package/dist/{chunk-K6GSGFOD.js.map → chunk-NXZRK6KL.js.map} +0 -0
- /package/dist/{chunk-J3ZV4EJ5.js.map → chunk-OGAVWGSY.js.map} +0 -0
- /package/dist/{chunk-SYEPIESJ.js.map → chunk-OTTIURMN.js.map} +0 -0
- /package/dist/{chunk-4JZ7V73S.js.map → chunk-PAC52YON.js.map} +0 -0
- /package/dist/{chunk-55OFDAIV.js.map → chunk-Q5ZUVH3U.js.map} +0 -0
- /package/dist/{chunk-MCWVVCIK.js.map → chunk-QBV4XS4Z.js.map} +0 -0
- /package/dist/{chunk-HNMDLN2I.js.map → chunk-QYNAZIHD.js.map} +0 -0
- /package/dist/{chunk-4UKKNARJ.js.map → chunk-R6OW77R6.js.map} +0 -0
- /package/dist/{chunk-HP4SYBET.js.map → chunk-S62STPBT.js.map} +0 -0
- /package/dist/{chunk-CAM6PYKR.js.map → chunk-SHFIZENN.js.map} +0 -0
- /package/dist/{chunk-3QLTEH2U.js.map → chunk-TMUPJJDK.js.map} +0 -0
- /package/dist/{chunk-VTNGEN34.js.map → chunk-UNTCBVHB.js.map} +0 -0
- /package/dist/{chunk-7NN4M5P2.js.map → chunk-WFET4MKU.js.map} +0 -0
- /package/dist/{chunk-JQOEHEGL.js.map → chunk-WJA7PQ2J.js.map} +0 -0
- /package/dist/{chunk-LVACJZSJ.js.map → chunk-WOUZK5DW.js.map} +0 -0
- /package/dist/{chunk-5ZWCZYSA.js.map → chunk-XQPYSB6Y.js.map} +0 -0
- /package/dist/{chunk-H32UX3PE.js.map → chunk-YAV236LM.js.map} +0 -0
- /package/dist/{chunk-RUZWAFIN.js.map → chunk-ZBGBLTFN.js.map} +0 -0
- /package/dist/{chunk-WRZ6WHH7.js.map → chunk-ZPUELAQZ.js.map} +0 -0
- /package/dist/{chunk-TQYHW6QK.js.map → chunk-ZVXX43AL.js.map} +0 -0
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 environment?: RemoteFlowsSDKProps['environment'];\n proxy?: RemoteFlowsSDKProps['proxy'];\n};\n\nfunction RemoteFlowContextWrapper({\n children,\n auth,\n proxy,\n environment,\n}: RemoteFlowContextWrapperProps) {\n const remoteApiClient = useAuth({\n auth,\n options: {\n proxy,\n environment,\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 theme,\n proxy,\n environment,\n}: PropsWithChildren<RemoteFlowsSDKProps>) {\n return (\n <QueryClientProvider client={queryClient}>\n <FormFieldsProvider components={components}>\n <RemoteFlowContextWrapper\n auth={auth}\n proxy={proxy}\n environment={environment}\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 partners: 'https://gateway.partners.remote-sandbox.com',\n production: 'https://gateway.remote.com',\n sandbox: 'https://gateway.remote-sandbox.com',\n staging: 'https://gateway.niceremote.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';\nimport { debug } from './lib/utils';\n\ntype AuthResponse = {\n accessToken: string;\n expiresIn: number;\n};\n\ntype Options = Partial<{\n environment: keyof typeof ENVIRONMENTS;\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?.environment\n ? ENVIRONMENTS[options?.environment]\n : process.env.REMOTE_GATEWAY_URL;\n\n const clientConfig = client.getConfig();\n const npmPackageVersion = process.env.VERSION || 'unknown';\n\n if (options?.environment && options?.environment !== 'production') {\n debug(npmPackageVersion);\n }\n\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":"soFAAA,OAAS,eAAAA,EAAa,uBAAAC,MAA2B,wBCUjD,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,WA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MAAAC,EACA,YAAAC,CACF,CACF,CAAC,EACD,OACEP,EAACU,EAAkB,SAAlB,CAA2B,MAAO,CAAE,OAAQF,EAAgB,OAAQ,EAClE,SAAAJ,EACH,CAEJ,CAlBSO,EAAAR,EAAA,4BAoBF,SAASS,EAAmB,CACjC,SAAAR,EACA,WAAAS,CACF,EAEI,CACF,OACEb,EAACc,EAAkB,SAAlB,CACC,MAAOD,EAAa,CAAE,WAAAA,CAAW,EAAI,CAAE,WAAY,CAAC,CAAE,EAErD,SAAAT,EACH,CAEJ,CAbgBO,EAAAC,EAAA,sBAeT,SAASG,EAAY,CAC1B,KAAAV,EACA,SAAAD,EACA,WAAAS,EACA,MAAAG,EACA,MAAAV,EACA,YAAAC,CACF,EAA2C,CACzC,OACEP,EAACiB,EAAA,CAAoB,OAAQhB,EAC3B,SAAAD,EAACY,EAAA,CAAmB,WAAYC,EAC9B,SAAAb,EAACG,EAAA,CACC,KAAME,EACN,MAAOC,EACP,YAAaC,EAEb,SAAAP,EAACkB,EAAA,CAAc,MAAOF,EAAQ,SAAAZ,EAAS,EACzC,EACF,EACF,CAEJ,CArBgBO,EAAAI,EAAA","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","debug","isValidProxy","createClient","hasTokenExpired","expiresAt","data","jsx","queryClient","QueryClient","RemoteFlowContextWrapper","children","auth","proxy","environment","remoteApiClient","useAuth","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 environment?: RemoteFlowsSDKProps['environment'];\n proxy?: RemoteFlowsSDKProps['proxy'];\n authId?: RemoteFlowsSDKProps['authId'];\n};\n\nfunction RemoteFlowContextWrapper({\n children,\n auth,\n authId,\n proxy,\n environment,\n}: RemoteFlowContextWrapperProps) {\n const remoteApiClient = useAuth({\n auth,\n authId,\n options: {\n proxy,\n environment,\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 authId,\n children,\n components,\n theme,\n proxy,\n environment,\n}: PropsWithChildren<RemoteFlowsSDKProps>) {\n return (\n <QueryClientProvider client={queryClient}>\n <FormFieldsProvider components={components}>\n <RemoteFlowContextWrapper\n auth={auth}\n authId={authId}\n proxy={proxy}\n environment={environment}\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 partners: 'https://gateway.partners.remote-sandbox.com',\n production: 'https://gateway.remote.com',\n sandbox: 'https://gateway.remote-sandbox.com',\n staging: 'https://gateway.niceremote.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';\nimport { debug } from './lib/utils';\n\ntype AuthResponse = {\n accessToken: string;\n expiresIn: number;\n};\n\ntype Options = Partial<{\n environment: keyof typeof ENVIRONMENTS;\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 authId = 'default',\n}: {\n auth: () => Promise<AuthResponse>;\n options?: Options;\n authId?: 'default' | 'client';\n}) => {\n const session = useRef<{ accessToken: string; expiresAt: number } | null>(\n null,\n );\n const { refetch } = useQuery({\n queryKey: ['auth', authId],\n queryFn: auth,\n enabled: false,\n });\n\n const baseUrl = options?.environment\n ? ENVIRONMENTS[options?.environment]\n : process.env.REMOTE_GATEWAY_URL;\n\n const clientConfig = client.getConfig();\n const npmPackageVersion = process.env.VERSION || 'unknown';\n\n if (options?.environment && options?.environment !== 'production') {\n debug(npmPackageVersion);\n }\n\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 };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EAAA,CAAmB,WAAYC,EAC9B,SAAAd,EAACG,EAAA,CACC,KAAME,EACN,OAAQC,EACR,MAAOC,EACP,YAAaC,EAEb,SAAAR,EAACmB,EAAA,CAAc,MAAOF,EAAQ,SAAAb,EAAS,EACzC,EACF,EACF,CAEJ,CAvBgBQ,EAAAI,EAAA","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","authId","session","useRef","refetch","useQuery","baseUrl","ENVIRONMENTS","clientConfig","client","npmPackageVersion","debug","isValidProxy","createClient","hasTokenExpired","expiresAt","data","jsx","queryClient","QueryClient","RemoteFlowContextWrapper","children","auth","authId","proxy","environment","remoteApiClient","useAuth","RemoteFlowContext","__name","FormFieldsProvider","components","FormFieldsContext","RemoteFlows","theme","QueryClientProvider","ThemeProvider"]}
|
|
@@ -151,6 +151,12 @@ type RemoteFlowsSDKProps = Omit<ThemeProviderProps, 'children'> & {
|
|
|
151
151
|
[key: string]: string;
|
|
152
152
|
};
|
|
153
153
|
};
|
|
154
|
+
/**
|
|
155
|
+
* ID to use for the auth query.
|
|
156
|
+
* If we navigate from one page to another with a different authentication method,
|
|
157
|
+
* we need to use a different authId.
|
|
158
|
+
*/
|
|
159
|
+
authId?: 'default' | 'client';
|
|
154
160
|
};
|
|
155
161
|
type $TSFixMe = any;
|
|
156
162
|
declare global {
|
|
@@ -6,8 +6,8 @@ type MinimalRegion = {
|
|
|
6
6
|
status?: RegionStatus;
|
|
7
7
|
};
|
|
8
8
|
type TerminationOffboarding = {
|
|
9
|
-
additional_comments: string;
|
|
10
|
-
agrees_to_pto_amount?:
|
|
9
|
+
additional_comments: string | null;
|
|
10
|
+
agrees_to_pto_amount?: boolean;
|
|
11
11
|
confidential: boolean;
|
|
12
12
|
employee_awareness?: {
|
|
13
13
|
date?: string | null;
|
|
@@ -15,6 +15,12 @@ type TerminationOffboarding = {
|
|
|
15
15
|
};
|
|
16
16
|
employment_id: string;
|
|
17
17
|
id: string;
|
|
18
|
+
/**
|
|
19
|
+
* Remote will use this email address for post-termination communication.
|
|
20
|
+
* If it is not provided, this field will be derived from the employment record. Therefore, it is important to ensure that it is not a company email.
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
personal_email?: string;
|
|
18
24
|
proposed_termination_date: string;
|
|
19
25
|
reason_description: string;
|
|
20
26
|
requested_by: string;
|
|
@@ -57,6 +63,7 @@ type ConvertCurrency = {
|
|
|
57
63
|
target_amount: number;
|
|
58
64
|
target_currency: CurrencyDefinition;
|
|
59
65
|
};
|
|
66
|
+
type ResignationOrTerminationOffboarding = ResignationOffboarding | TerminationOffboarding;
|
|
60
67
|
type MinimalCountry = {
|
|
61
68
|
alpha_2_code: string;
|
|
62
69
|
code: string;
|
|
@@ -189,6 +196,12 @@ type EmploymentShowResponse = {
|
|
|
189
196
|
};
|
|
190
197
|
};
|
|
191
198
|
};
|
|
199
|
+
type CostCalculatorDiscountResponse = {
|
|
200
|
+
annual_amount: number;
|
|
201
|
+
monthly_amount: number;
|
|
202
|
+
months: number;
|
|
203
|
+
text: string;
|
|
204
|
+
};
|
|
192
205
|
/**
|
|
193
206
|
* Complete information of an employment
|
|
194
207
|
*/
|
|
@@ -224,7 +237,10 @@ type CostCalculatorEmploymentParam = {
|
|
|
224
237
|
age?: number;
|
|
225
238
|
annual_gross_salary?: number;
|
|
226
239
|
annual_gross_salary_in_employer_currency?: number;
|
|
240
|
+
annual_total_cost?: number;
|
|
241
|
+
annual_total_cost_in_employer_currency?: number;
|
|
227
242
|
benefits?: Array<CostCalculatorBenefitParam>;
|
|
243
|
+
discount?: CostCalculatorDiscount;
|
|
228
244
|
employment_term?: EmploymentTermType;
|
|
229
245
|
region_slug: string;
|
|
230
246
|
regional_to_employer_exchange_rate?: string;
|
|
@@ -249,20 +265,26 @@ type Country = {
|
|
|
249
265
|
*/
|
|
250
266
|
type UserStatus = 'active' | 'created' | 'initiated' | 'cancelled' | 'inactive' | 'deleted';
|
|
251
267
|
type CostCalculatorEstimateParams = {
|
|
268
|
+
/**
|
|
269
|
+
* Company name
|
|
270
|
+
*/
|
|
271
|
+
company_name?: string;
|
|
252
272
|
/**
|
|
253
273
|
* Currency Slug
|
|
254
274
|
*/
|
|
255
275
|
employer_currency_slug: string;
|
|
256
276
|
employments: Array<CostCalculatorEmploymentParam>;
|
|
277
|
+
global_discount?: CostCalculatorDiscount;
|
|
257
278
|
include_benefits?: boolean;
|
|
258
279
|
include_cost_breakdowns?: boolean;
|
|
280
|
+
include_management_fee?: boolean;
|
|
259
281
|
include_premium_benefits?: boolean;
|
|
260
282
|
};
|
|
261
283
|
/**
|
|
262
284
|
* Offboarding
|
|
263
285
|
*/
|
|
264
286
|
type Offboarding = {
|
|
265
|
-
offboarding?:
|
|
287
|
+
offboarding?: ResignationOrTerminationOffboarding;
|
|
266
288
|
};
|
|
267
289
|
type NotFoundResponse = {
|
|
268
290
|
message?: string;
|
|
@@ -277,7 +299,8 @@ type CostCalculatorEstimateResponse = {
|
|
|
277
299
|
*/
|
|
278
300
|
type Timezone = string;
|
|
279
301
|
type ResignationOffboarding = {
|
|
280
|
-
additional_comments?: string;
|
|
302
|
+
additional_comments?: string | null;
|
|
303
|
+
agrees_to_pto_amount?: boolean;
|
|
281
304
|
employer_awareness?: string;
|
|
282
305
|
employment_id: string;
|
|
283
306
|
id: string;
|
|
@@ -473,6 +496,7 @@ type CostCalculatorCost = {
|
|
|
473
496
|
amount: number;
|
|
474
497
|
description: string | null;
|
|
475
498
|
name: string;
|
|
499
|
+
zendesk_article_id: string | null;
|
|
476
500
|
zendesk_article_url: string | null;
|
|
477
501
|
};
|
|
478
502
|
type CostCalculatorCosts = {
|
|
@@ -496,12 +520,16 @@ type CostCalculatorCosts = {
|
|
|
496
520
|
* The annual gross salary that the employee is going to earn
|
|
497
521
|
*/
|
|
498
522
|
annual_gross_salary: number;
|
|
523
|
+
/**
|
|
524
|
+
* The annual indirect tax that a company must pay for this employment
|
|
525
|
+
*/
|
|
499
526
|
annual_indirect_tax?: number;
|
|
500
527
|
/**
|
|
501
528
|
* The annual gross salary + annual contributions + annual fee (monthly fee * 12) + extra statutory payments if applicable
|
|
502
529
|
*/
|
|
503
530
|
annual_total: number;
|
|
504
531
|
currency: Currency;
|
|
532
|
+
discount?: CostCalculatorDiscountResponse;
|
|
505
533
|
/**
|
|
506
534
|
* The list of all annual extra statutory payment costs
|
|
507
535
|
*/
|
|
@@ -530,6 +558,9 @@ type CostCalculatorCosts = {
|
|
|
530
558
|
* The gross monthly salary for the Employee
|
|
531
559
|
*/
|
|
532
560
|
monthly_gross_salary: number;
|
|
561
|
+
/**
|
|
562
|
+
* The monthly indirect tax that a company must pay for this employment
|
|
563
|
+
*/
|
|
533
564
|
monthly_indirect_tax?: number;
|
|
534
565
|
/**
|
|
535
566
|
* Monthly gross salary + monthly contributions (doesn't include fee)
|
|
@@ -685,8 +716,11 @@ type EmploymentCreationResponse = {
|
|
|
685
716
|
type EmploymentStatus = 'active' | 'created' | 'created_awaiting_reserve' | 'created_reserve_paid' | 'initiated' | 'invited' | 'pending' | 'review' | 'archived' | 'deleted';
|
|
686
717
|
type CostCalculatorEmployment = {
|
|
687
718
|
country: MinimalCountry;
|
|
719
|
+
country_benefits_details_url: string | null;
|
|
720
|
+
country_guide_url: string | null;
|
|
688
721
|
employer_currency_costs: CostCalculatorCosts;
|
|
689
722
|
has_extra_statutory_payment: boolean;
|
|
723
|
+
minimum_onboarding_time: number | null;
|
|
690
724
|
region: MinimalRegion;
|
|
691
725
|
regional_currency_costs: CostCalculatorCosts;
|
|
692
726
|
};
|
|
@@ -770,6 +804,16 @@ type MagicLinkParams = {
|
|
|
770
804
|
*/
|
|
771
805
|
path?: string;
|
|
772
806
|
};
|
|
807
|
+
/**
|
|
808
|
+
* Allows to apply discounts to estimates
|
|
809
|
+
*/
|
|
810
|
+
type CostCalculatorDiscount = {
|
|
811
|
+
amount?: number;
|
|
812
|
+
months?: number;
|
|
813
|
+
percent?: number;
|
|
814
|
+
quoted_amount?: number;
|
|
815
|
+
text: string;
|
|
816
|
+
};
|
|
773
817
|
type LeavePolicy = {
|
|
774
818
|
leave_policy_variant_slug: string;
|
|
775
819
|
leave_type: TimeoffType;
|
|
@@ -893,7 +937,7 @@ type TerminationDetailsParams = {
|
|
|
893
937
|
/**
|
|
894
938
|
* Additional details regarding the termination process.
|
|
895
939
|
*/
|
|
896
|
-
additional_comments?: string;
|
|
940
|
+
additional_comments?: string | null;
|
|
897
941
|
agrees_to_pto_amount?: boolean | null;
|
|
898
942
|
agrees_to_pto_amount_notes?: string | null;
|
|
899
943
|
/**
|
package/package.json
CHANGED
package/dist/chunk-276MJCIE.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as t}from"./chunk-P37U34EQ.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"},{scheme:"bearer",type:"http"}],url:"/v1/contract-amendments/schema",...e}),"getShowContractAmendmentSchema");var m=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/v1/employments",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postCreateEmployment2");var d=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/cost-calculator/estimation",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postCreateEstimation");var y=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"},{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 u=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/v1/magic-link",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postGenerateMagicLink");var w=t(e=>(e?.client??r).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/cost-calculator/estimation-pdf",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postCreateEstimationPdf");var C=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/risk-reserve",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postCreateRiskReserve"),T=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/companies/{company_id}",...e}),"getShowCompany");var O=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/contract-amendments",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postCreateContractAmendment");var x=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/countries/{country_code}/{form}",...e}),"getShowFormCountry");var f=t(e=>(e?.client??r).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/cost-calculator/countries",...e}),"getIndexCountry");var b=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}/benefit-offers/schema",...e}),"getShowSchema");var P=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}",...e}),"getShowEmployment"),R=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 D=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/cost-calculator/regions/{slug}/fields",...e}),"getShowRegionField");var G=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}/contract-eligibility",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postCreateContractEligibility"),g=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/countries",...e}),"getSupportedCountry");var I=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/contract-amendments/automatable",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postAutomatableContractAmendment");var v=t(e=>(e?.client??r).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/company-currencies",...e}),"getIndexCompanyCurrency");var S=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}/invite",...e}),"postInviteEmploymentInvitation");var U=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/timeoff",...e}),"getIndexTimeoff");var k=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/v1/currency-converter",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postConvertCurrencyConverter");export{r as a,c as b,h as c,m as d,d as e,y as f,E as g,u as h,w as i,C as j,T as k,O as l,x as m,f as n,b as o,P as p,R as q,D as r,G as s,g as t,I as u,v,S as w,U as x,k as y};
|
|
2
|
-
//# sourceMappingURL=chunk-276MJCIE.js.map
|