@remoteoss/remote-flows 0.4.0-alpha.22 → 0.4.0-alpha.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-276MJCIE.js +2 -0
- package/dist/chunk-276MJCIE.js.map +1 -0
- package/dist/{chunk-EPLIVM3Y.js → chunk-3F2RSIAI.js} +2 -2
- package/dist/{chunk-7ZH23EMZ.js → chunk-6FUTHZBX.js} +2 -2
- package/dist/{chunk-ARYI3WUN.js → chunk-7ORG2D7Q.js} +2 -2
- package/dist/{chunk-LFLO2IJA.js → chunk-B5XJZREX.js} +2 -2
- package/dist/chunk-FA22YPJ4.js +2 -0
- package/dist/chunk-FA22YPJ4.js.map +1 -0
- package/dist/{chunk-YNQVZYFG.js → chunk-GRK5LUBM.js} +2 -2
- package/dist/{chunk-WASEFJAE.js → chunk-GUDE6UZG.js} +2 -2
- package/dist/{chunk-7NBID3JL.js → chunk-J2Y3OXRR.js} +2 -2
- package/dist/{chunk-Q23DM4O3.js → chunk-MC6FNME3.js} +2 -2
- package/dist/{chunk-XMDNHTKE.js → chunk-MEIQ6TJG.js} +2 -2
- package/dist/{chunk-JXCJLQRA.js → chunk-SYEPIESJ.js} +2 -2
- package/dist/{chunk-MO7KC4HE.js → chunk-TNN2CUZ5.js} +2 -2
- package/dist/{chunk-AIEAUPO6.js → chunk-VNKOWY72.js} +2 -2
- package/dist/{chunk-LX7QBDSF.js → chunk-VTNGEN34.js} +2 -2
- package/dist/{chunk-ETMTVNOU.js → chunk-WZWDJQGI.js} +2 -2
- package/dist/chunk-Y4BVRS3T.js +2 -0
- package/dist/chunk-Y4BVRS3T.js.map +1 -0
- package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentForm.d.ts +1 -1
- package/dist/flows/ContractAmendment/context.d.ts +1 -1
- 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/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/Results/CostCalculatorResults.d.ts +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.js +1 -1
- package/dist/flows/CostCalculator/context.d.ts +1 -1
- package/dist/flows/CostCalculator/hooks.d.ts +1 -1
- package/dist/flows/CostCalculator/hooks.js +1 -1
- package/dist/flows/CostCalculator/index.d.ts +1 -1
- package/dist/flows/CostCalculator/index.js +1 -1
- package/dist/flows/CostCalculator/types.d.ts +1 -1
- package/dist/flows/CostCalculator/utils.d.ts +1 -1
- package/dist/flows/CostCalculator/utils.js +1 -1
- package/dist/flows/Onboarding/OnboardingFlow.d.ts +1 -1
- package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
- package/dist/flows/Onboarding/api.d.ts +14 -2
- package/dist/flows/Onboarding/api.js +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/BenefitsStep.d.ts +1 -1
- package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +1 -1
- package/dist/flows/Onboarding/components/OnboardingForm.d.ts +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/ReviewStep.d.ts +1 -1
- package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +1 -1
- package/dist/flows/Onboarding/context.d.ts +1 -1
- package/dist/flows/Onboarding/hooks.d.ts +1 -1
- package/dist/flows/Onboarding/hooks.js +1 -1
- package/dist/flows/Onboarding/index.d.ts +1 -1
- 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/EmployeeComunicationForm.d.ts +1 -1
- package/dist/flows/Termination/PaidTimeOffForm.d.ts +1 -1
- package/dist/flows/Termination/TerminationDetailsForm.d.ts +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/TimeOff.d.ts +1 -1
- package/dist/flows/Termination/TimeOff.js +1 -1
- package/dist/flows/Termination/context.d.ts +1 -1
- 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.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/{types.gen-DL1ycXOS.d.ts → types.gen-DSJsKiNm.d.ts} +26 -1
- package/package.json +1 -1
- package/dist/chunk-MNFM2TNK.js +0 -2
- package/dist/chunk-MNFM2TNK.js.map +0 -1
- package/dist/chunk-WKK63LAY.js +0 -2
- package/dist/chunk-WKK63LAY.js.map +0 -1
- package/dist/chunk-XKSOWDLS.js +0 -2
- package/dist/chunk-XKSOWDLS.js.map +0 -1
- /package/dist/{chunk-EPLIVM3Y.js.map → chunk-3F2RSIAI.js.map} +0 -0
- /package/dist/{chunk-7ZH23EMZ.js.map → chunk-6FUTHZBX.js.map} +0 -0
- /package/dist/{chunk-ARYI3WUN.js.map → chunk-7ORG2D7Q.js.map} +0 -0
- /package/dist/{chunk-LFLO2IJA.js.map → chunk-B5XJZREX.js.map} +0 -0
- /package/dist/{chunk-YNQVZYFG.js.map → chunk-GRK5LUBM.js.map} +0 -0
- /package/dist/{chunk-WASEFJAE.js.map → chunk-GUDE6UZG.js.map} +0 -0
- /package/dist/{chunk-7NBID3JL.js.map → chunk-J2Y3OXRR.js.map} +0 -0
- /package/dist/{chunk-Q23DM4O3.js.map → chunk-MC6FNME3.js.map} +0 -0
- /package/dist/{chunk-XMDNHTKE.js.map → chunk-MEIQ6TJG.js.map} +0 -0
- /package/dist/{chunk-JXCJLQRA.js.map → chunk-SYEPIESJ.js.map} +0 -0
- /package/dist/{chunk-MO7KC4HE.js.map → chunk-TNN2CUZ5.js.map} +0 -0
- /package/dist/{chunk-AIEAUPO6.js.map → chunk-VNKOWY72.js.map} +0 -0
- /package/dist/{chunk-LX7QBDSF.js.map → chunk-VTNGEN34.js.map} +0 -0
- /package/dist/{chunk-ETMTVNOU.js.map → chunk-WZWDJQGI.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
2
2
|
import { Meta } from './types.js';
|
|
3
3
|
import { STEPS } from './utils.js';
|
|
4
|
-
import { m as EmploymentCreationResponse, n as PostCreateEmployment2Error, p as EmploymentResponse, q as PatchUpdateEmployment2Error, S as SuccessResponse$1, s as PutUpdateBenefitOfferError, i as Employment } from '../../types.gen-
|
|
4
|
+
import { m as EmploymentCreationResponse, n as PostCreateEmployment2Error, p as EmploymentResponse, q as PatchUpdateEmployment2Error, S as SuccessResponse$1, s as PutUpdateBenefitOfferError, i as Employment } from '../../types.gen-DSJsKiNm.js';
|
|
5
5
|
import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
|
|
6
6
|
import * as react from 'react';
|
|
7
7
|
import * as react_hook_form from 'react-hook-form';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
2
|
-
import { m as EmploymentCreationResponse, n as PostCreateEmployment2Error, p as EmploymentResponse, q as PatchUpdateEmployment2Error, S as SuccessResponse$1, s as PutUpdateBenefitOfferError, i as Employment } from '../../types.gen-
|
|
2
|
+
import { m as EmploymentCreationResponse, n as PostCreateEmployment2Error, p as EmploymentResponse, q as PatchUpdateEmployment2Error, S as SuccessResponse$1, s as PutUpdateBenefitOfferError, i as Employment } from '../../types.gen-DSJsKiNm.js';
|
|
3
3
|
import { E as ErrorResponse, S as SuccessResponse } from '../../mutations-B6HWH-rZ.js';
|
|
4
4
|
import * as react from 'react';
|
|
5
5
|
import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-FA22YPJ4.js";import"../../chunk-TNN2CUZ5.js";import"../../chunk-XIPPSRO6.js";import"../../chunk-MEIQ6TJG.js";import"../../chunk-Y4BVRS3T.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-PWUYHFON.js";import"../../chunk-QW4JPW6J.js";import"../../chunk-276MJCIE.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-N6NYXAXH.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-VNSF5IOL.js";import"../../chunk-MH6KKP6K.js";import"../../chunk-KPHSEIR3.js";import"../../chunk-P37U34EQ.js";export{a as useOnboarding};
|
|
2
2
|
//# sourceMappingURL=hooks.js.map
|
|
@@ -5,7 +5,7 @@ import 'react/jsx-runtime';
|
|
|
5
5
|
import 'react';
|
|
6
6
|
import './hooks.js';
|
|
7
7
|
import '@tanstack/query-core';
|
|
8
|
-
import '../../types.gen-
|
|
8
|
+
import '../../types.gen-DSJsKiNm.js';
|
|
9
9
|
import '../../mutations-B6HWH-rZ.js';
|
|
10
10
|
import '@remoteoss/json-schema-form';
|
|
11
11
|
import '../useStepState.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../chunk-GULCZWSK.js";import{a}from"../../chunk-
|
|
1
|
+
import"../../chunk-GULCZWSK.js";import{a}from"../../chunk-GRK5LUBM.js";import"../../chunk-7TOZZQQJ.js";import"../../chunk-CEIK7DGY.js";import"../../chunk-3R33SVSF.js";import"../../chunk-ISOKYXYN.js";import"../../chunk-LPR2D3EY.js";import"../../chunk-MSBG52WO.js";import"../../chunk-63BYEK44.js";import"../../chunk-6FUTHZBX.js";import"../../chunk-FUIQ7D6L.js";import"../../chunk-KFVOK5X5.js";import"../../chunk-PGWKJ6FK.js";import"../../chunk-FA22YPJ4.js";import"../../chunk-TNN2CUZ5.js";import"../../chunk-XIPPSRO6.js";import"../../chunk-MEIQ6TJG.js";import"../../chunk-Y4BVRS3T.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-PWUYHFON.js";import"../../chunk-QW4JPW6J.js";import"../../chunk-276MJCIE.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-3BIRQAED.js";import"../../chunk-XO3JWN33.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-N6NYXAXH.js";import"../../chunk-GEYFQVQI.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-VNSF5IOL.js";import"../../chunk-MH6KKP6K.js";import"../../chunk-KPHSEIR3.js";import"../../chunk-P37U34EQ.js";export{a as OnboardingFlow};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as EmploymentCreateParams, i as Employment$1 } from '../../types.gen-
|
|
1
|
+
import { o as EmploymentCreateParams, i as Employment$1 } from '../../types.gen-DSJsKiNm.js';
|
|
2
2
|
import { FlowOptions, JSFModify } from '../types.js';
|
|
3
3
|
import '@remoteoss/json-schema-form';
|
|
4
4
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Employment } from './types.js';
|
|
2
2
|
import { Step } from '../useStepState.js';
|
|
3
3
|
import { Fields } from '@remoteoss/json-schema-form';
|
|
4
|
-
import '../../types.gen-
|
|
4
|
+
import '../../types.gen-DSJsKiNm.js';
|
|
5
5
|
import '../types.js';
|
|
6
6
|
import 'react';
|
|
7
7
|
import 'react-hook-form';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { TerminationFormValues } from './types.js';
|
|
3
|
-
import { O as OffboardingResponse } from '../../types.gen-
|
|
3
|
+
import { O as OffboardingResponse } from '../../types.gen-DSJsKiNm.js';
|
|
4
4
|
|
|
5
5
|
type AdditionalDetailsFormProps = {
|
|
6
6
|
requesterName: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { TerminationFormValues } from './types.js';
|
|
3
|
-
import '../../types.gen-
|
|
3
|
+
import '../../types.gen-DSJsKiNm.js';
|
|
4
4
|
|
|
5
5
|
type EmployeeComunicationProps = {
|
|
6
6
|
onSubmit?: (payload: TerminationFormValues) => void | Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { TerminationFormValues } from './types.js';
|
|
3
|
-
import '../../types.gen-
|
|
3
|
+
import '../../types.gen-DSJsKiNm.js';
|
|
4
4
|
|
|
5
5
|
type PaidTimeOffFormProps = {
|
|
6
6
|
onSubmit?: (payload: TerminationFormValues) => void | Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { TerminationFormValues } from './types.js';
|
|
3
|
-
import '../../types.gen-
|
|
3
|
+
import '../../types.gen-DSJsKiNm.js';
|
|
4
4
|
|
|
5
5
|
type TerminationDetailsFormProps = {
|
|
6
6
|
onSubmit?: (payload: TerminationFormValues) => void | Promise<void>;
|
|
@@ -10,7 +10,7 @@ import { PaidTimeOffForm } from './PaidTimeOffForm.js';
|
|
|
10
10
|
import { AdditionalDetailsForm } from './AdditionalDetailsForm.js';
|
|
11
11
|
import { JSFModify } from '../types.js';
|
|
12
12
|
import './types.js';
|
|
13
|
-
import '../../types.gen-
|
|
13
|
+
import '../../types.gen-DSJsKiNm.js';
|
|
14
14
|
import '../../mutations-B6HWH-rZ.js';
|
|
15
15
|
import '@remoteoss/json-schema-form';
|
|
16
16
|
import '../useStepState.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-WZWDJQGI.js";import"../../chunk-LLIGZSYY.js";import"../../chunk-SYEPIESJ.js";import"../../chunk-GUDE6UZG.js";import"../../chunk-HSW5HMHH.js";import"../../chunk-VX2UC3HG.js";import"../../chunk-XSHHMBMT.js";import"../../chunk-XFD3ULUF.js";import"../../chunk-JODJFARP.js";import"../../chunk-WWANHPT7.js";import"../../chunk-W5DG5WWJ.js";import"../../chunk-S4XU4SE7.js";import"../../chunk-LFIQVLFK.js";import"../../chunk-TNF6DNGM.js";import"../../chunk-FCHRSRS6.js";import"../../chunk-BF7QENCN.js";import"../../chunk-O53436KO.js";import"../../chunk-SIC7BRJ2.js";import"../../chunk-MRYRNB7Y.js";import"../../chunk-PWUYHFON.js";import"../../chunk-VTNGEN34.js";import"../../chunk-QW4JPW6J.js";import"../../chunk-276MJCIE.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-3BIRQAED.js";import"../../chunk-XO3JWN33.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-N6NYXAXH.js";import"../../chunk-GEYFQVQI.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-VNSF5IOL.js";import"../../chunk-MH6KKP6K.js";import"../../chunk-KPHSEIR3.js";import"../../chunk-P37U34EQ.js";export{a as TerminationFlow};
|
|
2
2
|
//# sourceMappingURL=TerminationFlow.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { TerminationFormValues } from './types.js';
|
|
3
3
|
import { Fields } from '@remoteoss/json-schema-form';
|
|
4
|
-
import '../../types.gen-
|
|
4
|
+
import '../../types.gen-DSJsKiNm.js';
|
|
5
5
|
|
|
6
6
|
type TerminationFormProps = {
|
|
7
7
|
onSubmit: (payload: TerminationFormValues) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as EmploymentShowResponse, L as ListTimeoffResponse } from '../../types.gen-
|
|
1
|
+
import { E as EmploymentShowResponse, L as ListTimeoffResponse } from '../../types.gen-DSJsKiNm.js';
|
|
2
2
|
import react__default from 'react';
|
|
3
3
|
|
|
4
4
|
declare const TimeOff: ({ render, }: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-SYEPIESJ.js";import"../../chunk-MRYRNB7Y.js";import"../../chunk-VTNGEN34.js";import"../../chunk-276MJCIE.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-P37U34EQ.js";export{a as TimeOff};
|
|
2
2
|
//# sourceMappingURL=TimeOff.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as OffboardingResponse,
|
|
1
|
+
import { O as OffboardingResponse, B as PostCreateOffboardingError } from '../../types.gen-DSJsKiNm.js';
|
|
2
2
|
import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { E as ErrorResponse, S as SuccessResponse } from '../../mutations-B6HWH-rZ.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as OffboardingResponse,
|
|
1
|
+
import { O as OffboardingResponse, B as PostCreateOffboardingError } from '../../types.gen-DSJsKiNm.js';
|
|
2
2
|
import { E as ErrorResponse, S as SuccessResponse } from '../../mutations-B6HWH-rZ.js';
|
|
3
3
|
import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
|
|
4
4
|
import { Step } from '../useStepState.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-GUDE6UZG.js";import"../../chunk-HSW5HMHH.js";import"../../chunk-VX2UC3HG.js";import"../../chunk-XSHHMBMT.js";import"../../chunk-XFD3ULUF.js";import"../../chunk-JODJFARP.js";import"../../chunk-WWANHPT7.js";import"../../chunk-W5DG5WWJ.js";import"../../chunk-S4XU4SE7.js";import"../../chunk-PWUYHFON.js";import"../../chunk-QW4JPW6J.js";import"../../chunk-276MJCIE.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-MH6KKP6K.js";import"../../chunk-P37U34EQ.js";export{a as useTermination};
|
|
2
2
|
//# sourceMappingURL=hooks.js.map
|
|
@@ -3,7 +3,7 @@ export { TerminationFormValues } from './types.js';
|
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
|
5
5
|
import './hooks.js';
|
|
6
|
-
import '../../types.gen-
|
|
6
|
+
import '../../types.gen-DSJsKiNm.js';
|
|
7
7
|
import '../../mutations-B6HWH-rZ.js';
|
|
8
8
|
import '@remoteoss/json-schema-form';
|
|
9
9
|
import '../useStepState.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../chunk-M22FKNEY.js";import{a}from"../../chunk-
|
|
1
|
+
import"../../chunk-M22FKNEY.js";import{a}from"../../chunk-WZWDJQGI.js";import"../../chunk-LLIGZSYY.js";import"../../chunk-SYEPIESJ.js";import"../../chunk-GUDE6UZG.js";import"../../chunk-HSW5HMHH.js";import"../../chunk-VX2UC3HG.js";import"../../chunk-XSHHMBMT.js";import"../../chunk-XFD3ULUF.js";import"../../chunk-JODJFARP.js";import"../../chunk-WWANHPT7.js";import"../../chunk-W5DG5WWJ.js";import"../../chunk-S4XU4SE7.js";import"../../chunk-LFIQVLFK.js";import"../../chunk-TNF6DNGM.js";import"../../chunk-FCHRSRS6.js";import"../../chunk-BF7QENCN.js";import"../../chunk-O53436KO.js";import"../../chunk-SIC7BRJ2.js";import"../../chunk-MRYRNB7Y.js";import"../../chunk-PWUYHFON.js";import"../../chunk-VTNGEN34.js";import"../../chunk-QW4JPW6J.js";import"../../chunk-276MJCIE.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-3BIRQAED.js";import"../../chunk-XO3JWN33.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-N6NYXAXH.js";import"../../chunk-GEYFQVQI.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-VNSF5IOL.js";import"../../chunk-MH6KKP6K.js";import"../../chunk-KPHSEIR3.js";import"../../chunk-P37U34EQ.js";export{a as TerminationFlow};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -20,8 +20,8 @@ export { OnboardingInviteProps } from './flows/Onboarding/components/OnboardingI
|
|
|
20
20
|
export { BasicInformationFormPayload, BenefitsFormPayload, ContractDetailsFormPayload, CreditRiskState, CreditRiskStatus, Employment, Meta, SelectCountryFormPayload, SelectCountrySuccess } from './flows/Onboarding/types.js';
|
|
21
21
|
export { CostCalculatorEstimationFormValues, CostCalculatorEstimationOptions, CostCalculatorEstimationSubmitValues } from './flows/CostCalculator/types.js';
|
|
22
22
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
23
|
-
import { E as EmploymentShowResponse,
|
|
24
|
-
export { j as Company, C as ContractAmendmentAutomatableResponse,
|
|
23
|
+
import { E as EmploymentShowResponse, D as TimeoffStatus, L as ListTimeoffResponse } from './types.gen-DSJsKiNm.js';
|
|
24
|
+
export { j as Company, C as ContractAmendmentAutomatableResponse, F as CostCalculatorEmployment, c as CostCalculatorEstimateResponse, G as Currency, m as EmploymentCreationResponse, p as EmploymentResponse, O as OffboardingResponse, S as SuccessResponse } from './types.gen-DSJsKiNm.js';
|
|
25
25
|
import { ContractAmendmentParams } from './flows/ContractAmendment/types.js';
|
|
26
26
|
import { ValidationError } from 'yup';
|
|
27
27
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
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-WZWDJQGI.js";import"./chunk-LLIGZSYY.js";import"./chunk-SYEPIESJ.js";import"./chunk-GUDE6UZG.js";import"./chunk-HSW5HMHH.js";import"./chunk-VX2UC3HG.js";import"./chunk-XSHHMBMT.js";import"./chunk-XFD3ULUF.js";import"./chunk-JODJFARP.js";import"./chunk-WWANHPT7.js";import"./chunk-W5DG5WWJ.js";import"./chunk-S4XU4SE7.js";import"./chunk-LFIQVLFK.js";import"./chunk-TNF6DNGM.js";import"./chunk-FCHRSRS6.js";import"./chunk-BF7QENCN.js";import"./chunk-O53436KO.js";import"./chunk-SIC7BRJ2.js";import"./chunk-MRYRNB7Y.js";import"./chunk-GULCZWSK.js";import{a as or}from"./chunk-GRK5LUBM.js";import"./chunk-7TOZZQQJ.js";import"./chunk-CEIK7DGY.js";import"./chunk-3R33SVSF.js";import"./chunk-ISOKYXYN.js";import"./chunk-LPR2D3EY.js";import"./chunk-MSBG52WO.js";import"./chunk-63BYEK44.js";import"./chunk-6FUTHZBX.js";import"./chunk-FUIQ7D6L.js";import"./chunk-KFVOK5X5.js";import"./chunk-PGWKJ6FK.js";import"./chunk-FA22YPJ4.js";import"./chunk-TNN2CUZ5.js";import"./chunk-XIPPSRO6.js";import"./chunk-YJXRJTOH.js";import{a as E}from"./chunk-MNO47WC2.js";import"./chunk-WIRFNWEU.js";import"./chunk-3NZ6PO4D.js";import"./chunk-YO4OQIFP.js";import"./chunk-32RYPLZK.js";import"./chunk-PJCUSCO4.js";import"./chunk-EEAMZPP6.js";import"./chunk-FB5J7SRP.js";import{a as R}from"./chunk-DOLJU76M.js";import{a as z}from"./chunk-3HPG2L62.js";import{a as T}from"./chunk-KM4XVL2X.js";import"./chunk-A7ZJQCNU.js";import{a as B}from"./chunk-EV5YPN4F.js";import{a as _}from"./chunk-DYB3RWP7.js";import{a as F}from"./chunk-B5XJZREX.js";import"./chunk-KSHK3ZPX.js";import{b as y,d as P}from"./chunk-J2Y3OXRR.js";import"./chunk-7ORG2D7Q.js";import"./chunk-UPRUP24B.js";import"./chunk-MEIQ6TJG.js";import"./chunk-Y4BVRS3T.js";import"./chunk-WVJDCDGZ.js";import{d as k}from"./chunk-MC6FNME3.js";import"./chunk-PWUYHFON.js";import{a as er}from"./chunk-3F2RSIAI.js";import{a as H}from"./chunk-RXK4RLF6.js";import{a as ar}from"./chunk-VNKOWY72.js";import{a as J,b as rr}from"./chunk-VTNGEN34.js";import"./chunk-QW4JPW6J.js";import"./chunk-5SMMQQXP.js";import{a as p}from"./chunk-276MJCIE.js";import"./chunk-PJBAQZ6G.js";import"./chunk-CTTXXEWI.js";import{a as G}from"./chunk-CSU6IQX3.js";import{a as Z}from"./chunk-3QGKRPQ6.js";import"./chunk-3BIRQAED.js";import"./chunk-XO3JWN33.js";import"./chunk-CFIJKJXD.js";import"./chunk-N6NYXAXH.js";import"./chunk-GEYFQVQI.js";import{a as g,c as v}from"./chunk-3ZWDIEEM.js";import"./chunk-VNSF5IOL.js";import"./chunk-MH6KKP6K.js";import"./chunk-TVZAFTPT.js";import{c as C}from"./chunk-KPHSEIR3.js";import{a as e}from"./chunk-P37U34EQ.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 N(r){return{"--spacing":r}}e(N,"mapThemeSpacing");function O(r){return{"--radius":r}}e(O,"mapThemeBorderRadius");function j(r){return{"--fontSizeBase":r.fontSizeBase}}e(j,"mapThemeFont");function h(r){r?.colors&&l(S(r.colors)),r?.spacing&&l(N(r.spacing)),r?.borderRadius&&l(O(r.borderRadius)),r?.font&&l(j(r.font))}e(h,"applyTheme");import{createContext as D,useEffect as I,useMemo as A}from"react";import{jsx as V}from"react/jsx-runtime";var K=D({theme:{}});function u(r){I(()=>{r.theme&&Object.keys(r.theme).length>0&&h(r.theme)},[r.theme]);let a=A(()=>({theme:r.theme}),[r.theme]);return V(K.Provider,{value:a,children:r.children})}e(u,"ThemeProvider");var m={partners:"https://gateway.partners.remote-sandbox.com",production:"https://gateway.remote.com",sandbox:"https://gateway.remote-sandbox.com",staging:"https://gateway.niceremote.com"};import{createClient as U}from"@hey-api/client-fetch";import{useQuery as W}from"@tanstack/react-query";import{useRef as w}from"react";function M(r){try{return new URL(r),!0}catch{return!1}}e(M,"isValidUrl");var f=e(({auth:r,options:a})=>{let t=w(null),{refetch:o}=W({queryKey:["auth"],queryFn:r,enabled:!1}),c=a?.environment?m[a?.environment]:"https://gateway.remote.com",s=p.getConfig(),x="0.4.0-alpha.23",d=!!a?.proxy&&M(a.proxy.url);return a?.proxy&&!d&&console.error("Invalid proxy URL provided. Using default base URL."),w(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,proxy:t,environment:o}){let c=f({auth:a,options:{proxy:t,environment: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,theme:o,proxy:c,environment:s}){return n(q,{client:Q,children:n(Y,{components:t,children:n(X,{auth:r,proxy:c,environment:s,children:n(u,{theme:o,children:a})})})})}e($,"RemoteFlows");export{G as ContractAmendmentConfirmationForm,er as ContractAmendmentFlow,Z as ContractAmendmentForm,H as ContractAmendmentSubmit,B as CostCalculatorDisclaimer,F as CostCalculatorFlow,R as CostCalculatorForm,z as CostCalculatorResetButton,E as CostCalculatorResults,T as CostCalculatorSubmitButton,or as OnboardingFlow,$ as RemoteFlows,tr as TerminationFlow,y as buildCostCalculatorEstimationPayload,_ as disclaimerData,C as transformYupErrorsIntoObject,ar as useContractAmendment,P as useCostCalculator,k as useCostCalculatorEstimationPdf,J as useEmploymentQuery,rr as useTimeOffQuery};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -984,6 +984,16 @@ type ParameterError = {
|
|
|
984
984
|
param: string;
|
|
985
985
|
};
|
|
986
986
|
type GenericFile = Blob | File;
|
|
987
|
+
type CreateContractEligibilityParams = {
|
|
988
|
+
/**
|
|
989
|
+
* type of employment eligibility to work in residing country
|
|
990
|
+
*/
|
|
991
|
+
eligible_to_work_in_residing_country: 'citizen' | 'permanent_resident' | 'temporary_resident';
|
|
992
|
+
/**
|
|
993
|
+
* whether the employer or work restrictions apply
|
|
994
|
+
*/
|
|
995
|
+
employer_or_work_restrictions: boolean;
|
|
996
|
+
};
|
|
987
997
|
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';
|
|
988
998
|
/**
|
|
989
999
|
* The details of the salary decrease request if there is one
|
|
@@ -1227,6 +1237,21 @@ type PatchUpdateEmployment2Errors = {
|
|
|
1227
1237
|
429: TooManyRequestsResponse;
|
|
1228
1238
|
};
|
|
1229
1239
|
type PatchUpdateEmployment2Error = PatchUpdateEmployment2Errors[keyof PatchUpdateEmployment2Errors];
|
|
1240
|
+
type PostCreateContractEligibilityErrors = {
|
|
1241
|
+
/**
|
|
1242
|
+
* Bad Request
|
|
1243
|
+
*/
|
|
1244
|
+
400: BadRequestResponse;
|
|
1245
|
+
/**
|
|
1246
|
+
* Unprocessable Entity
|
|
1247
|
+
*/
|
|
1248
|
+
422: UnprocessableEntityResponse;
|
|
1249
|
+
/**
|
|
1250
|
+
* Unprocessable Entity
|
|
1251
|
+
*/
|
|
1252
|
+
429: TooManyRequestsResponse;
|
|
1253
|
+
};
|
|
1254
|
+
type PostCreateContractEligibilityError = PostCreateContractEligibilityErrors[keyof PostCreateContractEligibilityErrors];
|
|
1230
1255
|
type PostAutomatableContractAmendmentErrors = {
|
|
1231
1256
|
/**
|
|
1232
1257
|
* Unauthorized
|
|
@@ -1277,4 +1302,4 @@ type PostConvertCurrencyConverterErrors = {
|
|
|
1277
1302
|
};
|
|
1278
1303
|
type PostConvertCurrencyConverterError = PostConvertCurrencyConverterErrors[keyof PostConvertCurrencyConverterErrors];
|
|
1279
1304
|
|
|
1280
|
-
export type {
|
|
1305
|
+
export type { CreateContractEligibilityParams as A, PostCreateOffboardingError as B, ContractAmendmentAutomatableResponse as C, TimeoffStatus as D, EmploymentShowResponse as E, CostCalculatorEmployment as F, Currency as G, ListTimeoffResponse as L, MinimalRegion 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, CostCalculatorEstimatePdfResponse as d, PostCreateEstimationPdfError as e, CostCalculatorEstimateParams as f, PostCreateEstimationError as g, EmploymentTermType as h, Employment as i, Company as j, PostInviteEmploymentInvitationError as k, PostCreateRiskReserveError as l, EmploymentCreationResponse as m, PostCreateEmployment2Error as n, EmploymentCreateParams as o, EmploymentResponse as p, PatchUpdateEmployment2Error as q, EmploymentFullParams as r, PutUpdateBenefitOfferError as s, MagicLinkResponse as t, UnprocessableEntityResponse as u, MagicLinkParams as v, ConvertCurrencyResponse as w, PostConvertCurrencyConverterError as x, ConvertCurrencyParams as y, PostCreateContractEligibilityError as z };
|
package/package.json
CHANGED
package/dist/chunk-MNFM2TNK.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as Fe}from"./chunk-MO7KC4HE.js";import{a as Se,b as be,c as b,d as ge}from"./chunk-XIPPSRO6.js";import{a as re,b as ce,c as le,f as me,g as de,h as fe,i as ue,j as ye,l as pe}from"./chunk-XKSOWDLS.js";import{a as w}from"./chunk-QW4JPW6J.js";import{a as _e}from"./chunk-PJBAQZ6G.js";import{c as S,d as T}from"./chunk-MH6KKP6K.js";import{a as r}from"./chunk-P37U34EQ.js";import{useEffect as xe,useMemo as l,useRef as Ge,useState as Ee}from"react";import We from"lodash.mergewith";import{jsx as Qe}from"react/jsx-runtime";var Ke={employment_basic_information:"basic_information",contract_details:"contract_details"},Ye={select_country:null,basic_information:"employment_basic_information",contract_details:"contract_details",benefits:null,review:null},ze=r(({isLoadingBasicInformationForm:m,isLoadingContractDetailsForm:R,isLoadingEmployment:N,isLoadingBenefitsOffersSchema:v,isLoadingBenefitOffers:a,isLoadingCompany:j,isLoadingCountries:u,employmentStatus:o,employmentId:J,currentStepName:i,basicInformationFields:P,contractDetailsFields:c})=>{let g=m||R||N||v||a||j||u,B=o&&ge.includes(o),F=!!(J&&B&&i!=="review"),I=g||F,y=!!(F&&!g&&P.length>0&&c.length>0);return{isLoading:I,isNavigatingToReview:y,isEmploymentReadOnly:B}},"getLoadingStates"),st=r(({employmentId:m,companyId:R,countryCode:N,type:v,options:a,skipSteps:j})=>{let u=Ge({select_country:{},basic_information:{},contract_details:{},benefits:{}}),[o,J]=Ee(m),[i,P]=Ee(N||null),{data:c,isLoading:g,refetch:B}=re(o);c?.country?.code&&i!==c.country.code&&P(c.country.code);let{data:F,isLoading:I}=le(o),{data:y,isLoading:A,refetch:he}=ce(R),Oe=j?.includes("select_country")?be:Se,{fieldValues:p,stepState:e,setFieldValues:Ve,previousStep:Ce,nextStep:Le,goToStep:D,setStepValues:U}=_e(Oe),{selectCountryForm:k,isLoading:H}=pe({jsfModify:a?.jsfModify?.select_country,jsonSchemaVersion:a?.jsonSchemaVersion,queryOptions:{enabled:e.currentStep.name==="select_country"}}),x=fe(a),G=ue(a),W=ye(a),{mutateAsync:Me}=w(x),{mutateAsync:K}=w(G),{mutateAsync:Te}=w(W),Pe=Ye[e.currentStep.name]||"employment_basic_information",Be=Ke[Pe],Ie=c?.[Be]||{},Y=r(({form:n,options:s={}})=>me({countryCode:i,form:n,fieldValues:Object.keys(p).length>0?{...e.values?.[e.currentStep.name],...p}:Ie,options:{...s,queryOptions:{enabled:s.queryOptions?.enabled??!0}}}),"useJSONSchema"),ke=!!(i&&(e.currentStep.name==="basic_information"||m)),we=!!(i&&(e.currentStep.name==="contract_details"||m)),{data:d,isLoading:z}=Y({form:"employment_basic_information",options:{jsfModify:a?.jsfModify?.basic_information,queryOptions:{enabled:ke}}}),_=a?.jsfModify?.contract_details?.fields?.annual_gross_salary,q=_&&typeof _=="object"&&"presentation"in _?_.presentation:void 0,Re=l(()=>({fields:{annual_gross_salary:{..._,presentation:{annual_gross_salary_conversion_properties:{label:q?.annual_gross_salary_conversion_properties?.label,description:q?.annual_gross_salary_conversion_properties?.description},desiredCurrency:y?.desired_currency,Component:r(n=>Qe(Fe,{desiredCurrency:y?.desired_currency||"",...n}),"Component")}}}}),[y?.desired_currency,q,_]),{data:f,isLoading:Q}=Y({form:"contract_details",options:{jsfModify:{...a?.jsfModify?.contract_details,fields:{...a?.jsfModify?.contract_details?.fields,...Re.fields}},queryOptions:{enabled:we}}}),{data:E,isLoading:X}=de(o,p,a),Z=l(()=>{if(e.currentStep.name==="benefits"){let n={...e.values?.[e.currentStep.name],...p};return We({},F,n)}return{}},[e.currentStep.name,F,e.values,p]),t=l(()=>({select_country:k?.fields||[],basic_information:d?.fields||[],contract_details:f?.fields||[],benefits:E?.fields||[],review:[]}),[k?.fields,d?.fields,f?.fields,E?.fields]),{country:{code:$}={},basic_information:ee={},contract_details:te={},status:ne}=c||{},oe=e.currentStep.name,h=l(()=>T(t.select_country,{country:i||$||""}),[t.select_country,i,$]),O=l(()=>T(t.basic_information,ee||{}),[t.basic_information,ee]),V=l(()=>T(t.contract_details,te||{}),[t.contract_details,te]),C=l(()=>T(t.benefits,Z),[t.benefits,Z]),Ne=l(()=>({select_country:h,basic_information:O,contract_details:V,benefits:C}),[h,O,V,C]),{isLoading:ve,isNavigatingToReview:ae,isEmploymentReadOnly:je}=l(()=>ze({isLoadingBasicInformationForm:z,isLoadingContractDetailsForm:Q,isLoadingEmployment:g,isLoadingBenefitsOffersSchema:X,isLoadingBenefitOffers:I,isLoadingCompany:A,isLoadingCountries:H,employmentId:m,employmentStatus:ne,basicInformationFields:t.basic_information,contractDetailsFields:t.contract_details,currentStepName:oe}),[z,Q,g,X,I,A,H,m,ne,t.basic_information,t.contract_details,oe]);xe(()=>{ae&&(u.current={select_country:b(h,t.select_country),basic_information:b(O,t.basic_information),contract_details:b(V,t.contract_details),benefits:b(C,t.benefits)},U({select_country:h,basic_information:O,contract_details:V,benefits:C,review:{}}),D("review"))},[O,C,V,D,ae,h,U,t.basic_information,t.benefits,t.contract_details,t.select_country]);let ie=r(n=>k&&e.currentStep.name==="select_country"?n:d&&e.currentStep.name==="basic_information"?S(n,d?.fields,{isPartialValidation:!0}):f&&e.currentStep.name==="contract_details"?S(n,f?.fields,{isPartialValidation:!0}):{},"parseFormValues");async function Je(n){let s=e.currentStep.name;s in u.current&&(u.current[s]=b(n,t[s]));let L=ie(n);switch(he(),e.currentStep.name){case"select_country":return P(L.country),Promise.resolve({data:{countryCode:L.country}});case"basic_information":{let se=!o&&i,Ue=o&&i&&c?.country&&c?.country.code!==i;if(se||Ue){let He={basic_information:L,type:v,country_code:i};try{let M=await Me(He);return J(M.data?.data?.employment?.id),M}catch(M){throw console.error("Error creating onboarding:",M),M}}else if(o)return K({employmentId:o,basic_information:L,pricing_plan_details:{frequency:"monthly"}});return}case"contract_details":return K({employmentId:o,...{contract_details:L,pricing_plan_details:{frequency:"monthly"}}});case"benefits":return Te({employmentId:o,...n})}}r(Je,"onSubmit");function De(){Ce()}r(De,"back");function qe(){Le()}r(qe,"next");function Ae(n){D(n)}return r(Ae,"goTo"),{employmentId:o,creditRiskStatus:y?.default_legal_entity_credit_risk_status,fieldValues:p,stepState:e,fields:t[e.currentStep.name],isLoading:ve,isSubmitting:x.isPending||G.isPending||W.isPending,initialValues:Ne,handleValidation:r(n=>{if(e.currentStep.name==="select_country")return k.handleValidation(n);if(e.currentStep.name==="benefits"&&E){let s=S(n,E?.fields);return E?.handleValidation(s)}if(d&&e.currentStep.name==="basic_information"){let s=S(n,d?.fields);return d?.handleValidation(s)}if(f&&e.currentStep.name==="contract_details"){let s=S(n,f?.fields);return f?.handleValidation(s)}return null},"handleValidation"),checkFieldUpdates:Ve,parseFormValues:ie,onSubmit:Je,back:De,next:qe,goTo:Ae,meta:{fields:u.current},refetchEmployment:B,employment:c,isEmploymentReadOnly:je}},"useOnboarding");export{st as a};
|
|
2
|
-
//# sourceMappingURL=chunk-MNFM2TNK.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flows/Onboarding/hooks.tsx"],"sourcesContent":["import {\n Employment,\n EmploymentCreateParams,\n EmploymentFullParams,\n} from '@/src/client';\nimport { Fields } from '@remoteoss/json-schema-form';\n\nimport { useStepState, Step } from '@/src/flows/useStepState';\nimport {\n prettifyFormValues,\n reviewStepAllowedEmploymentStatus,\n STEPS,\n STEPS_WITHOUT_SELECT_COUNTRY,\n} from '@/src/flows/Onboarding/utils';\nimport {\n getInitialValues,\n parseJSFToValidate,\n} from '@/src/components/form/utils';\nimport { mutationToPromise } from '@/src/lib/mutations';\nimport { FieldValues } from 'react-hook-form';\nimport { Meta, OnboardingFlowParams } from '@/src/flows/Onboarding/types';\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport mergeWith from 'lodash.mergewith';\nimport {\n useBenefitOffers,\n useBenefitOffersSchema,\n useCompany,\n useCountriesSchemaField,\n useCreateEmployment,\n useEmployment,\n useJSONSchemaForm,\n useUpdateBenefitsOffers,\n useUpdateEmployment,\n} from '@/src/flows/Onboarding/api';\nimport { JSFModify, JSONSchemaFormType } from '@/src/flows/types';\nimport { AnnualGrossSalary } from '@/src/flows/Onboarding/components/AnnualGrossSalary';\nimport { JSFField } from '@/src/types/remoteFlows';\n\ntype OnboardingHookProps = OnboardingFlowParams;\n\nconst jsonSchemaToEmployment: Partial<\n Record<JSONSchemaFormType, keyof Employment>\n> = {\n employment_basic_information: 'basic_information',\n contract_details: 'contract_details',\n};\n\nconst stepToFormSchemaMap: Record<\n keyof typeof STEPS,\n JSONSchemaFormType | null\n> = {\n select_country: null,\n basic_information: 'employment_basic_information',\n contract_details: 'contract_details',\n benefits: null,\n review: null,\n};\n\nconst getLoadingStates = ({\n isLoadingBasicInformationForm,\n isLoadingContractDetailsForm,\n isLoadingEmployment,\n isLoadingBenefitsOffersSchema,\n isLoadingBenefitOffers,\n isLoadingCompany,\n isLoadingCountries,\n employmentStatus,\n employmentId,\n currentStepName,\n basicInformationFields,\n contractDetailsFields,\n}: {\n isLoadingBasicInformationForm: boolean;\n isLoadingContractDetailsForm: boolean;\n isLoadingEmployment: boolean;\n isLoadingBenefitsOffersSchema: boolean;\n isLoadingBenefitOffers: boolean;\n isLoadingCompany: boolean;\n isLoadingCountries: boolean;\n employmentStatus?: Employment['status'];\n employmentId?: string;\n currentStepName: string;\n basicInformationFields: Fields;\n contractDetailsFields: Fields;\n}) => {\n const initialLoading =\n isLoadingBasicInformationForm ||\n isLoadingContractDetailsForm ||\n isLoadingEmployment ||\n isLoadingBenefitsOffersSchema ||\n isLoadingBenefitOffers ||\n isLoadingCompany ||\n isLoadingCountries;\n\n const isEmploymentReadOnly =\n employmentStatus &&\n reviewStepAllowedEmploymentStatus.includes(employmentStatus);\n\n const shouldHandleReadOnlyEmployment = Boolean(\n employmentId && isEmploymentReadOnly && currentStepName !== 'review',\n );\n\n const isLoading = initialLoading || shouldHandleReadOnlyEmployment;\n\n const isNavigatingToReview = Boolean(\n shouldHandleReadOnlyEmployment &&\n !initialLoading &&\n basicInformationFields.length > 0 &&\n contractDetailsFields.length > 0,\n );\n\n return { isLoading, isNavigatingToReview, isEmploymentReadOnly };\n};\n\nexport const useOnboarding = ({\n employmentId,\n companyId,\n countryCode,\n type,\n options,\n skipSteps,\n}: OnboardingHookProps) => {\n const fieldsMetaRef = useRef<{\n select_country: Meta;\n basic_information: Meta;\n contract_details: Meta;\n benefits: Meta;\n }>({\n select_country: {},\n basic_information: {},\n contract_details: {},\n benefits: {},\n });\n const [internalEmploymentId, setInternalEmploymentId] = useState<\n string | undefined\n >(employmentId);\n const [internalCountryCode, setInternalCountryCode] = useState<string | null>(\n countryCode || null,\n );\n const {\n data: employment,\n isLoading: isLoadingEmployment,\n refetch: refetchEmployment,\n } = useEmployment(internalEmploymentId);\n\n // if the employment is loaded, country code has not been set yet\n // we set the internal country code with the employment country code\n if (\n employment?.country?.code &&\n internalCountryCode !== employment.country.code\n ) {\n setInternalCountryCode(employment.country.code);\n }\n\n const { data: benefitOffers, isLoading: isLoadingBenefitOffers } =\n useBenefitOffers(internalEmploymentId);\n const {\n data: company,\n isLoading: isLoadingCompany,\n refetch: refetchCompany,\n } = useCompany(companyId);\n const stepsToUse = skipSteps?.includes('select_country')\n ? STEPS_WITHOUT_SELECT_COUNTRY\n : STEPS;\n\n const {\n fieldValues,\n stepState,\n setFieldValues,\n previousStep,\n nextStep,\n goToStep,\n setStepValues,\n } = useStepState(\n stepsToUse as Record<keyof typeof STEPS, Step<keyof typeof STEPS>>,\n );\n\n const { selectCountryForm, isLoading: isLoadingCountries } =\n useCountriesSchemaField({\n jsfModify: options?.jsfModify?.select_country,\n jsonSchemaVersion: options?.jsonSchemaVersion,\n queryOptions: {\n enabled: stepState.currentStep.name === 'select_country',\n },\n });\n\n const createEmploymentMutation = useCreateEmployment(options);\n const updateEmploymentMutation = useUpdateEmployment(options);\n const updateBenefitsOffersMutation = useUpdateBenefitsOffers(options);\n const { mutateAsync: createEmploymentMutationAsync } = mutationToPromise(\n createEmploymentMutation,\n );\n const { mutateAsync: updateEmploymentMutationAsync } = mutationToPromise(\n updateEmploymentMutation,\n );\n const { mutateAsync: updateBenefitsOffersMutationAsync } = mutationToPromise(\n updateBenefitsOffersMutation,\n );\n\n const formType =\n stepToFormSchemaMap[stepState.currentStep.name] ||\n 'employment_basic_information';\n const employmentKey = jsonSchemaToEmployment[formType] as keyof Employment;\n const serverEmploymentData = (employment?.[employmentKey] || {}) as Record<\n string,\n unknown\n >;\n\n const useJSONSchema = ({\n form,\n options: jsonSchemaOptions = {},\n }: {\n form: JSONSchemaFormType;\n options?: {\n jsfModify?: JSFModify;\n queryOptions?: { enabled?: boolean };\n };\n }) => {\n return useJSONSchemaForm({\n countryCode: internalCountryCode as string,\n form: form,\n fieldValues:\n Object.keys(fieldValues).length > 0\n ? {\n ...stepState.values?.[stepState.currentStep.name], // Restore values for the current step\n ...fieldValues,\n }\n : serverEmploymentData,\n options: {\n ...jsonSchemaOptions,\n queryOptions: {\n enabled: jsonSchemaOptions.queryOptions?.enabled ?? true,\n },\n },\n });\n };\n\n const isBasicInformationDetailsEnabled = Boolean(\n internalCountryCode &&\n (stepState.currentStep.name === 'basic_information' ||\n Boolean(employmentId)),\n );\n\n const isContractDetailsEnabled = Boolean(\n internalCountryCode &&\n (stepState.currentStep.name === 'contract_details' ||\n Boolean(employmentId)),\n );\n\n const {\n data: basicInformationForm,\n isLoading: isLoadingBasicInformationForm,\n } = useJSONSchema({\n form: 'employment_basic_information',\n options: {\n jsfModify: options?.jsfModify?.basic_information,\n queryOptions: {\n enabled: isBasicInformationDetailsEnabled,\n },\n },\n });\n\n const annualGrossSalaryField =\n options?.jsfModify?.contract_details?.fields?.annual_gross_salary;\n const annualSalaryFieldPresentation =\n annualGrossSalaryField &&\n typeof annualGrossSalaryField === 'object' &&\n 'presentation' in annualGrossSalaryField\n ? (\n annualGrossSalaryField as {\n presentation?: {\n annual_gross_salary_conversion_properties?: {\n label?: string;\n description?: string;\n };\n };\n }\n ).presentation\n : undefined;\n\n const customFields = useMemo(\n () => ({\n fields: {\n annual_gross_salary: {\n ...annualGrossSalaryField,\n presentation: {\n annual_gross_salary_conversion_properties: {\n label:\n annualSalaryFieldPresentation\n ?.annual_gross_salary_conversion_properties?.label,\n description:\n annualSalaryFieldPresentation\n ?.annual_gross_salary_conversion_properties?.description,\n },\n desiredCurrency: company?.desired_currency,\n Component: (props: JSFField & { currency: string }) => (\n <AnnualGrossSalary\n desiredCurrency={company?.desired_currency || ''}\n {...props}\n />\n ),\n },\n },\n },\n }),\n [\n company?.desired_currency,\n annualSalaryFieldPresentation,\n annualGrossSalaryField,\n ],\n );\n\n const { data: contractDetailsForm, isLoading: isLoadingContractDetailsForm } =\n useJSONSchema({\n form: 'contract_details',\n options: {\n jsfModify: {\n ...options?.jsfModify?.contract_details,\n fields: {\n ...options?.jsfModify?.contract_details?.fields,\n ...customFields.fields,\n },\n },\n queryOptions: {\n enabled: isContractDetailsEnabled,\n },\n },\n });\n\n const {\n data: benefitOffersSchema,\n isLoading: isLoadingBenefitsOffersSchema,\n } = useBenefitOffersSchema(\n internalEmploymentId as string,\n fieldValues,\n options,\n );\n\n const initialValuesBenefitOffers = useMemo(() => {\n if (stepState.currentStep.name === 'benefits') {\n const benefitsFormValues = {\n ...stepState.values?.[stepState.currentStep.name as keyof typeof STEPS], // Restore values for the current step\n ...fieldValues,\n };\n return mergeWith({}, benefitOffers, benefitsFormValues);\n }\n return {};\n }, [\n stepState.currentStep.name,\n benefitOffers,\n stepState.values,\n fieldValues,\n ]);\n\n const stepFields: Record<keyof typeof STEPS, Fields> = useMemo(\n () => ({\n select_country: selectCountryForm?.fields || [],\n basic_information: basicInformationForm?.fields || [],\n contract_details: contractDetailsForm?.fields || [],\n benefits: benefitOffersSchema?.fields || [],\n review: [],\n }),\n [\n selectCountryForm?.fields,\n basicInformationForm?.fields,\n contractDetailsForm?.fields,\n benefitOffersSchema?.fields,\n ],\n );\n\n const {\n country: { code: employmentCountryCode } = {},\n basic_information: employmentBasicInformation = {},\n contract_details: employmentContractDetails = {},\n status: employmentStatus,\n } = employment || {};\n const currentStepName = stepState.currentStep.name;\n\n const selectCountryInitialValues = useMemo(\n () =>\n getInitialValues(stepFields.select_country, {\n country: internalCountryCode || employmentCountryCode || '',\n }),\n [stepFields.select_country, internalCountryCode, employmentCountryCode],\n );\n\n const basicInformationInitialValues = useMemo(\n () =>\n getInitialValues(\n stepFields.basic_information,\n employmentBasicInformation || {},\n ),\n [stepFields.basic_information, employmentBasicInformation],\n );\n\n const contractDetailsInitialValues = useMemo(\n () =>\n getInitialValues(\n stepFields.contract_details,\n employmentContractDetails || {},\n ),\n [stepFields.contract_details, employmentContractDetails],\n );\n\n const benefitsInitialValues = useMemo(\n () => getInitialValues(stepFields.benefits, initialValuesBenefitOffers),\n [stepFields.benefits, initialValuesBenefitOffers],\n );\n\n const initialValues = useMemo(\n () => ({\n select_country: selectCountryInitialValues,\n basic_information: basicInformationInitialValues,\n contract_details: contractDetailsInitialValues,\n benefits: benefitsInitialValues,\n }),\n [\n selectCountryInitialValues,\n basicInformationInitialValues,\n contractDetailsInitialValues,\n benefitsInitialValues,\n ],\n );\n\n const { isLoading, isNavigatingToReview, isEmploymentReadOnly } = useMemo(\n () =>\n getLoadingStates({\n isLoadingBasicInformationForm,\n isLoadingContractDetailsForm,\n isLoadingEmployment,\n isLoadingBenefitsOffersSchema,\n isLoadingBenefitOffers,\n isLoadingCompany,\n isLoadingCountries,\n employmentId,\n employmentStatus: employmentStatus,\n basicInformationFields: stepFields.basic_information,\n contractDetailsFields: stepFields.contract_details,\n currentStepName: currentStepName,\n }),\n [\n isLoadingBasicInformationForm,\n isLoadingContractDetailsForm,\n isLoadingEmployment,\n isLoadingBenefitsOffersSchema,\n isLoadingBenefitOffers,\n isLoadingCompany,\n isLoadingCountries,\n employmentId,\n employmentStatus,\n stepFields.basic_information,\n stepFields.contract_details,\n currentStepName,\n ],\n );\n\n useEffect(() => {\n if (isNavigatingToReview) {\n fieldsMetaRef.current = {\n select_country: prettifyFormValues(\n selectCountryInitialValues,\n stepFields.select_country,\n ),\n basic_information: prettifyFormValues(\n basicInformationInitialValues,\n stepFields.basic_information,\n ),\n contract_details: prettifyFormValues(\n contractDetailsInitialValues,\n stepFields.contract_details,\n ),\n benefits: prettifyFormValues(\n benefitsInitialValues,\n stepFields.benefits,\n ),\n };\n\n setStepValues({\n select_country: selectCountryInitialValues,\n basic_information: basicInformationInitialValues,\n contract_details: contractDetailsInitialValues,\n benefits: benefitsInitialValues,\n review: {},\n });\n\n goToStep('review');\n }\n }, [\n basicInformationInitialValues,\n benefitsInitialValues,\n contractDetailsInitialValues,\n goToStep,\n isNavigatingToReview,\n selectCountryInitialValues,\n setStepValues,\n stepFields.basic_information,\n stepFields.benefits,\n stepFields.contract_details,\n stepFields.select_country,\n ]);\n\n const parseFormValues = (values: FieldValues) => {\n if (selectCountryForm && stepState.currentStep.name === 'select_country') {\n return values;\n }\n if (\n basicInformationForm &&\n stepState.currentStep.name === 'basic_information'\n ) {\n return parseJSFToValidate(values, basicInformationForm?.fields, {\n isPartialValidation: true,\n });\n }\n\n if (\n contractDetailsForm &&\n stepState.currentStep.name === 'contract_details'\n ) {\n return parseJSFToValidate(values, contractDetailsForm?.fields, {\n isPartialValidation: true,\n });\n }\n\n return {};\n };\n\n async function onSubmit(values: FieldValues) {\n // Prettify values for the current step\n const currentStepName = stepState.currentStep.name;\n if (currentStepName in fieldsMetaRef.current) {\n fieldsMetaRef.current[\n currentStepName as keyof typeof fieldsMetaRef.current\n ] = prettifyFormValues(values, stepFields[currentStepName]);\n }\n\n const parsedValues = parseFormValues(values);\n refetchCompany();\n switch (stepState.currentStep.name) {\n case 'select_country': {\n setInternalCountryCode(parsedValues.country);\n return Promise.resolve({ data: { countryCode: parsedValues.country } });\n }\n case 'basic_information': {\n const isEmploymentNotLoaded =\n !internalEmploymentId && internalCountryCode;\n const hasChangedCountry =\n internalEmploymentId &&\n internalCountryCode &&\n employment?.country &&\n employment?.country.code !== internalCountryCode;\n if (isEmploymentNotLoaded || hasChangedCountry) {\n const payload: EmploymentCreateParams = {\n basic_information: parsedValues,\n type: type,\n country_code: internalCountryCode,\n };\n try {\n const response = await createEmploymentMutationAsync(payload);\n setInternalEmploymentId(\n // @ts-expect-error the types from the response are not matching\n response.data?.data?.employment?.id,\n );\n return response;\n } catch (error) {\n console.error('Error creating onboarding:', error);\n throw error;\n }\n } else if (internalEmploymentId) {\n return updateEmploymentMutationAsync({\n employmentId: internalEmploymentId,\n basic_information: parsedValues,\n pricing_plan_details: {\n frequency: 'monthly',\n },\n });\n }\n\n return;\n }\n case 'contract_details': {\n const payload: EmploymentFullParams = {\n contract_details: parsedValues,\n pricing_plan_details: {\n frequency: 'monthly',\n },\n };\n return updateEmploymentMutationAsync({\n employmentId: internalEmploymentId as string,\n ...payload,\n });\n }\n\n case 'benefits': {\n return updateBenefitsOffersMutationAsync({\n employmentId: internalEmploymentId as string,\n ...values,\n });\n }\n }\n return;\n }\n\n function back() {\n previousStep();\n }\n\n function next() {\n nextStep();\n }\n\n function goTo(step: keyof typeof STEPS) {\n goToStep(step);\n }\n\n return {\n /**\n * Employment id passed useful to be used between components\n */\n employmentId: internalEmploymentId,\n\n /**\n * Credit risk status of the company, useful to know what to to show in the review step\n * The possible values are:\n * - not_started\n * - ready\n * - in_progress\n * - referred\n * - fail\n * - deposit_required\n * - no_deposit_required\n */\n\n creditRiskStatus: company?.default_legal_entity_credit_risk_status,\n /**\n * Current state of the form fields for the current step.\n */\n fieldValues,\n /**\n * Current step state containing the current step and total number of steps\n */\n stepState,\n /**\n * Array of form fields from the onboarding schema\n */\n fields: stepFields[stepState.currentStep.name],\n /**\n * Loading state indicating if the onboarding schema is being fetched\n */\n isLoading: isLoading,\n /**\n * Loading state indicating if the onboarding mutation is in progress\n */\n isSubmitting:\n createEmploymentMutation.isPending ||\n updateEmploymentMutation.isPending ||\n updateBenefitsOffersMutation.isPending,\n /**\n * Initial form values\n */\n initialValues,\n /**\n * Function to validate form values against the onboarding schema\n * @param values - Form values to validate\n * @returns Validation result or null if no schema is available\n */\n handleValidation: (values: FieldValues) => {\n if (stepState.currentStep.name === 'select_country') {\n return selectCountryForm.handleValidation(values);\n }\n if (stepState.currentStep.name === 'benefits' && benefitOffersSchema) {\n const parsedValues = parseJSFToValidate(\n values,\n benefitOffersSchema?.fields,\n );\n\n return benefitOffersSchema?.handleValidation(parsedValues);\n }\n if (\n basicInformationForm &&\n stepState.currentStep.name === 'basic_information'\n ) {\n const parsedValues = parseJSFToValidate(\n values,\n basicInformationForm?.fields,\n );\n return basicInformationForm?.handleValidation(parsedValues);\n }\n\n if (\n contractDetailsForm &&\n stepState.currentStep.name === 'contract_details'\n ) {\n const parsedValues = parseJSFToValidate(\n values,\n contractDetailsForm?.fields,\n );\n return contractDetailsForm?.handleValidation(parsedValues);\n }\n\n return null;\n },\n /**\n * Function to update the current form field values\n * @param values - New form values to set\n */\n checkFieldUpdates: setFieldValues,\n\n /**\n * Function to parse form values before submission\n * @param values - Form values to parse\n * @returns Parsed form values\n */\n parseFormValues,\n\n /**\n * Function to handle form submission\n * @param values - Form values to submit\n * @returns Promise resolving to the mutation result\n */\n onSubmit,\n\n /**\n * Function to handle going back to the previous step\n * @returns {void}\n */\n back,\n\n /**\n * Function to handle going to the next step\n * @returns {void}\n */\n next,\n\n /**\n * Function to handle going to a specific step\n * @param step The step to go to.\n * @returns {void}\n */\n goTo,\n\n /**\n * Fields metadata for each step\n */\n meta: {\n fields: fieldsMetaRef.current,\n },\n\n /**\n * Function to refetch the employment data\n * @returns {void}\n */\n refetchEmployment,\n /**\n * Employment data\n */\n employment,\n\n /**\n * let's the user know that the employment cannot be edited, happens when employment.status is invited, created_awaiting_reserve or created_reserve_paid\n * @returns {boolean}\n */\n isEmplo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,GAIX,aACEoC,EAAyB,WACzBE,EAAyB,WACzBE,EAA6B,UAI/B,cAAAqC,GAMA,iBAAkB9F,EAACkG,GAAwB,CACzC,GAAItD,EAAU,YAAY,OAAS,iBACjC,OAAOO,EAAkB,iBAAiB+C,CAAM,EAElD,GAAItD,EAAU,YAAY,OAAS,YAAcoC,EAAqB,CACpE,IAAMqB,EAAeF,EACnBD,EACAlB,GAAqB,MACvB,EAEA,OAAOA,GAAqB,iBAAiBqB,CAAY,CAC3D,CACA,GACE7B,GACA5B,EAAU,YAAY,OAAS,oBAC/B,CACA,IAAMyD,EAAeF,EACnBD,EACA1B,GAAsB,MACxB,EACA,OAAOA,GAAsB,iBAAiB6B,CAAY,CAC5D,CAEA,GACEtB,GACAnC,EAAU,YAAY,OAAS,mBAC/B,CACA,IAAMyD,EAAeF,EACnBD,EACAnB,GAAqB,MACvB,EACA,OAAOA,GAAqB,iBAAiBsB,CAAY,CAC3D,CAEA,OAAO,IACT,EAnCkB,oBAwClB,kBAAmBxD,GAOnB,gBAAAoD,GAOA,SAAAG,GAMA,KAAAO,GAMA,KAAAC,GAOA,KAAAC,GAKA,KAAM,CACJ,OAAQpF,EAAc,OACxB,EAMA,kBAAAQ,EAIA,WAAAD,EAMA,qBAAAlB,EACF,CACF,EAzoB6B","names":["useEffect","useMemo","useRef","useState","mergeWith","jsx","jsonSchemaToEmployment","stepToFormSchemaMap","getLoadingStates","__name","isLoadingBasicInformationForm","isLoadingContractDetailsForm","isLoadingEmployment","isLoadingBenefitsOffersSchema","isLoadingBenefitOffers","isLoadingCompany","isLoadingCountries","employmentStatus","employmentId","currentStepName","basicInformationFields","contractDetailsFields","initialLoading","isEmploymentReadOnly","reviewStepAllowedEmploymentStatus","shouldHandleReadOnlyEmployment","isLoading","isNavigatingToReview","useOnboarding","companyId","countryCode","type","options","skipSteps","fieldsMetaRef","useRef","internalEmploymentId","setInternalEmploymentId","useState","internalCountryCode","setInternalCountryCode","employment","refetchEmployment","useEmployment","benefitOffers","useBenefitOffers","company","refetchCompany","useCompany","stepsToUse","STEPS_WITHOUT_SELECT_COUNTRY","STEPS","fieldValues","stepState","setFieldValues","previousStep","nextStep","goToStep","setStepValues","useStepState","selectCountryForm","useCountriesSchemaField","createEmploymentMutation","useCreateEmployment","updateEmploymentMutation","useUpdateEmployment","updateBenefitsOffersMutation","useUpdateBenefitsOffers","createEmploymentMutationAsync","mutationToPromise","updateEmploymentMutationAsync","updateBenefitsOffersMutationAsync","formType","employmentKey","serverEmploymentData","useJSONSchema","form","jsonSchemaOptions","useJSONSchemaForm","isBasicInformationDetailsEnabled","isContractDetailsEnabled","basicInformationForm","annualGrossSalaryField","annualSalaryFieldPresentation","customFields","useMemo","props","AnnualGrossSalary","contractDetailsForm","benefitOffersSchema","useBenefitOffersSchema","initialValuesBenefitOffers","benefitsFormValues","mergeWith","stepFields","employmentCountryCode","employmentBasicInformation","employmentContractDetails","selectCountryInitialValues","getInitialValues","basicInformationInitialValues","contractDetailsInitialValues","benefitsInitialValues","initialValues","useEffect","prettifyFormValues","parseFormValues","values","parseJSFToValidate","onSubmit","parsedValues","isEmploymentNotLoaded","hasChangedCountry","payload","response","error","back","next","goTo","step"]}
|
package/dist/chunk-WKK63LAY.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"}],url:"/v1/contract-amendments/schema",...e}),"getShowContractAmendmentSchema");var d=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/v1/employments",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postCreateEmployment2");var m=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"},{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 E=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}/benefit-offers",...e}),"getIndexBenefitOffer"),u=t(e=>(e.client??r).put({security:[{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}/benefit-offers",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"putUpdateBenefitOffer");var y=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/v1/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"}],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"}],url:"/v1/contract-amendments",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postCreateContractAmendment");var f=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/countries/{country_code}/{form}",...e}),"getShowFormCountry");var x=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 P=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}/benefit-offers/schema",...e}),"getShowSchema");var R=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}",...e}),"getShowEmployment"),b=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).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/countries",...e}),"getSupportedCountry");var g=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/v1/contract-amendments/automatable",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postAutomatableContractAmendment");var I=t(e=>(e?.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/company-currencies",...e}),"getIndexCompanyCurrency");var v=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}/invite",...e}),"postInviteEmploymentInvitation");var S=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/timeoff",...e}),"getIndexTimeoff");var U=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,d,m as e,E as f,u as g,y as h,w as i,C as j,T as k,O as l,f as m,x as n,P as o,R as p,b as q,D as r,G as s,g as t,I as u,v,S as w,U as x};
|
|
2
|
-
//# sourceMappingURL=chunk-WKK63LAY.js.map
|