Skip to content
6 changes: 6 additions & 0 deletions example/api/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ function setupRoutes(app) {
app.get('/api/fetch-refresh-token', getToken);
app.get('/api/fetch-company-manager', getCompanyManagerToken);
app.use('/v1', createProxyMiddleware());

// To make proxy requests work in local
app.use('/api/eor/v1', (req, res, next) => {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove as this was caused by the openapi-ts change

req.originalUrl = req.originalUrl.replace('/api/eor', '');
createProxyMiddleware()(req, res, next);
});
}

module.exports = { setupRoutes };
30 changes: 30 additions & 0 deletions example/src/Onboarding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
SelectCountrySuccess,
SelectCountryFormPayload,
NormalizedFieldError,
$TSFixMe,
} from '@remoteoss/remote-flows';
import React, { useState } from 'react';
import { ReviewOnboardingStep } from './ReviewOnboardingStep';
Expand Down Expand Up @@ -49,6 +50,7 @@ const MultiStepForm = ({ components, onboardingBag }: MultiStepFormProps) => {
SubmitButton,
BackButton,
SelectCountryStep,
EngagementAgreementDetailsStep,
} = components;
const [errors, setErrors] = useState<{
apiError: string;
Expand Down Expand Up @@ -118,6 +120,34 @@ const MultiStepForm = ({ components, onboardingBag }: MultiStepFormProps) => {
</div>
</>
);
case 'engagement_agreement_details':
return (
<>
{/* TODO: Add type later... => EngagementAgreementDetailsFormPayload */}
<EngagementAgreementDetailsStep
onSubmit={(payload: $TSFixMe) => console.log('payload', payload)}
onSuccess={(data: EmploymentResponse) => console.log('data', data)}
onError={({ error, fieldErrors }) =>
setErrors({ apiError: error.message, fieldErrors })
}
/>
<AlertError errors={errors} />
<div className='buttons-container'>
<BackButton
className='back-button'
onClick={() => setErrors({ apiError: '', fieldErrors: [] })}
>
Previous Step
</BackButton>
<SubmitButton
className='submit-button'
onClick={() => setErrors({ apiError: '', fieldErrors: [] })}
>
Continue
</SubmitButton>
</div>
</>
);
case 'contract_details':
return (
<>
Expand Down
2 changes: 1 addition & 1 deletion openapi-ts.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig, defaultPlugins } from '@hey-api/openapi-ts';

export default defineConfig({
input: 'https://gateway.remote.com/v1/docs/openapi.json',
input: 'http://localhost:4000/api/eor/v1/docs/openapi.json',
output: 'src/client',
plugins: defaultPlugins,
});
2 changes: 1 addition & 1 deletion src/client/client.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (
) => Config<Required<ClientOptions> & T>;

export const client = createClient(
createConfig<ClientOptions2>({ baseUrl: 'https://gateway.remote.com/' }),
createConfig<ClientOptions2>({ baseUrl: 'http://localhost:4000' }),
);
61 changes: 61 additions & 0 deletions src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ export {
getIndexWorkAuthorizationRequest,
getListGroupsScim,
getListUsersScim,
getPayDetailDataGph,
getPayDetailGph,
getPayProcessingFeatureGph,
getPayProgressGph,
getPaySummaryGph,
getPayVarianceGph,
getPendingChangesEmploymentContract,
getSchemaBenefitRenewalRequest,
getShowAdministrativeDetails,
Expand All @@ -92,6 +98,7 @@ export {
getShowEmployment,
getShowEmploymentCustomFieldValue,
getShowEmploymentOnboardingSteps,
getShowEngagementAgreementDetailsCountry,
getShowExpense,
getShowFile,
getShowFormCountry,
Expand Down Expand Up @@ -141,6 +148,7 @@ export {
patchUpdateWorkAuthorizationRequest,
patchUpdateWorkAuthorizationRequest2,
postApproveCancellationRequest,
postApproveReservePaymentRiskReserve,
postApproveTimesheet,
postAutomatableContractAmendment,
postBulkCreatePayItems,
Expand Down Expand Up @@ -183,6 +191,7 @@ export {
postCreateRiskReserve,
postCreateSsoConfiguration,
postCreateTimeoff,
postCreateTimesheet,
postCreateTokenCompanyToken,
postCreateWebhookCallback,
postDeclineCancellationRequest,
Expand All @@ -197,6 +206,7 @@ export {
postSignContractDocument,
postTerminateContractorOfRecordEmploymentSubscription,
postTokenOAuth2Token,
postTokenOAuth2Token2,
postTriggerWebhookCallback,
postUpdateBenefitRenewalRequest,
postUpdateCancelOnboarding,
Expand Down Expand Up @@ -481,6 +491,7 @@ export type {
EmploymentStatus,
EmploymentTermType,
EmploymentUpdateParams,
EngagementAgreementDetailsResponse,
ErrorResponse,
Expense,
ExpenseCategoryNode,
Expand Down Expand Up @@ -803,6 +814,36 @@ export type {
GetListUsersScimErrors,
GetListUsersScimResponse,
GetListUsersScimResponses,
GetPayDetailDataGphData,
GetPayDetailDataGphError,
GetPayDetailDataGphErrors,
GetPayDetailDataGphResponse,
GetPayDetailDataGphResponses,
GetPayDetailGphData,
GetPayDetailGphError,
GetPayDetailGphErrors,
GetPayDetailGphResponse,
GetPayDetailGphResponses,
GetPayProcessingFeatureGphData,
GetPayProcessingFeatureGphError,
GetPayProcessingFeatureGphErrors,
GetPayProcessingFeatureGphResponse,
GetPayProcessingFeatureGphResponses,
GetPayProgressGphData,
GetPayProgressGphError,
GetPayProgressGphErrors,
GetPayProgressGphResponse,
GetPayProgressGphResponses,
GetPaySummaryGphData,
GetPaySummaryGphError,
GetPaySummaryGphErrors,
GetPaySummaryGphResponse,
GetPaySummaryGphResponses,
GetPayVarianceGphData,
GetPayVarianceGphError,
GetPayVarianceGphErrors,
GetPayVarianceGphResponse,
GetPayVarianceGphResponses,
GetPendingChangesEmploymentContractData,
GetPendingChangesEmploymentContractError,
GetPendingChangesEmploymentContractErrors,
Expand Down Expand Up @@ -918,6 +959,11 @@ export type {
GetShowEmploymentOnboardingStepsResponses,
GetShowEmploymentResponse,
GetShowEmploymentResponses,
GetShowEngagementAgreementDetailsCountryData,
GetShowEngagementAgreementDetailsCountryError,
GetShowEngagementAgreementDetailsCountryErrors,
GetShowEngagementAgreementDetailsCountryResponse,
GetShowEngagementAgreementDetailsCountryResponses,
GetShowExpenseData,
GetShowExpenseError,
GetShowExpenseErrors,
Expand Down Expand Up @@ -1298,6 +1344,11 @@ export type {
PostApproveCancellationRequestErrors,
PostApproveCancellationRequestResponse,
PostApproveCancellationRequestResponses,
PostApproveReservePaymentRiskReserveData,
PostApproveReservePaymentRiskReserveError,
PostApproveReservePaymentRiskReserveErrors,
PostApproveReservePaymentRiskReserveResponse,
PostApproveReservePaymentRiskReserveResponses,
PostApproveTimesheetData,
PostApproveTimesheetError,
PostApproveTimesheetErrors,
Expand Down Expand Up @@ -1507,6 +1558,11 @@ export type {
PostCreateTimeoffErrors,
PostCreateTimeoffResponse,
PostCreateTimeoffResponses,
PostCreateTimesheetData,
PostCreateTimesheetError,
PostCreateTimesheetErrors,
PostCreateTimesheetResponse,
PostCreateTimesheetResponses,
PostCreateTokenCompanyTokenData,
PostCreateTokenCompanyTokenError,
PostCreateTokenCompanyTokenErrors,
Expand Down Expand Up @@ -1571,6 +1627,11 @@ export type {
PostTerminateContractorOfRecordEmploymentSubscriptionErrors,
PostTerminateContractorOfRecordEmploymentSubscriptionResponse,
PostTerminateContractorOfRecordEmploymentSubscriptionResponses,
PostTokenOAuth2Token2Data,
PostTokenOAuth2Token2Error,
PostTokenOAuth2Token2Errors,
PostTokenOAuth2Token2Response,
PostTokenOAuth2Token2Responses,
PostTokenOAuth2TokenData,
PostTokenOAuth2TokenError,
PostTokenOAuth2TokenErrors,
Expand Down
Loading
Loading