diff --git a/src/integrations/salesforce/workflows/syncRecordsFromSalesforce.ts b/src/integrations/salesforce/workflows/syncRecordsFromSalesforce.ts deleted file mode 100644 index c656fa5..0000000 --- a/src/integrations/salesforce/workflows/syncRecordsFromSalesforce.ts +++ /dev/null @@ -1,105 +0,0 @@ -import { RequestStep, Workflow } from '@useparagon/core'; -import { IContext } from '@useparagon/core/execution'; -import { IPersona } from '@useparagon/core/persona'; -import { ConditionalInput } from '@useparagon/core/steps/library/conditional'; -import { IConnectUser, IPermissionContext } from '@useparagon/core/user'; -import { - ISalesforceIntegration, - InputResultMap, - createInputs, -} from '@useparagon/types/salesforce'; - -import personaMeta from '../../../persona.meta'; - -/** - * Sync records from Salesforce Workflow implementation - */ -export default class extends Workflow< - ISalesforceIntegration, - IPersona, - InputResultMap -> { - /** - * Define workflow steps and orchestration. - */ - define( - integration: ISalesforceIntegration, - context: IContext, - connectUser: IConnectUser>, - ) { - const triggerStep = integration.triggers.recordCreated({ - recordType: 'Contact', - }); - - const sendtomyapiStep = new RequestStep({ - autoRetry: false, - continueWorkflowOnError: false, - description: 'Send to my API', - url: `https://api.myapp.io/api/contacts`, - method: 'POST', - params: {}, - headers: {}, - authorization: { - type: 'bearer', - token: `${context.getEnvironmentSecret('API_SECRET')}`, - }, - body: { user_id: connectUser.userId, contact: triggerStep.output.result }, - bodyType: 'json', - }); - - triggerStep.nextStep(sendtomyapiStep); - - /** - * Pass all steps used in the workflow to the `.register()` - * function. The keys used in this function must remain stable. - */ - return this.register({ triggerStep, sendtomyapiStep }); - } - - /** - * The name of the workflow, used in the Dashboard and Connect Portal. - */ - name: string = 'Sync records from Salesforce'; - - /** - * A user-facing description of the workflow shown in the Connect Portal. - */ - description: string = 'Add a user-facing description of this workflow'; - - /** - * Define workflow-level User Settings. For integration-level User - * Settings, see ../config.ts. - * https://docs.useparagon.com/connect-portal/workflow-user-settings - */ - inputs = createInputs({}); - - /** - * If set to true, the workflow will appear as enabled by default once - * a user connects their account to the integration. - * https://docs.useparagon.com/connect-portal/displaying-workflows#default-to-enabled - */ - defaultEnabled: boolean = false; - - /** - * If set to true, the workflow will be hidden from all users from the - * Connect Portal. - * https://docs.useparagon.com/connect-portal/displaying-workflows#hide-workflow-from-portal-for-all-users - */ - hidden: boolean = false; - - /** - * You can restrict the visibility of this workflow to specific users - * with Workflow Permissions. - * https://docs.useparagon.com/connect-portal/workflow-permissions - */ - definePermissions( - connectUser: IPermissionContext>, - ): ConditionalInput | undefined { - return undefined; - } - - /** - * This property is maintained by Paragon. Do not edit this property. - */ - readonly id: string = 'd82119e3-ede9-4aa5-8883-a8ae0b846450'; -}