2
0

feat(integration): Add Make.com block

This commit is contained in:
Baptiste Arnaud
2022-04-10 17:02:01 -05:00
parent a5491dc7a8
commit 38c53fbbbc
12 changed files with 156 additions and 18 deletions

View File

@@ -16,6 +16,7 @@ import {
ResultValues,
Block,
VariableWithValue,
MakeComStep,
} from 'models'
import { stringify } from 'qs'
import { byId, sendRequest } from 'utils'
@@ -49,6 +50,7 @@ export const executeIntegration = ({
case IntegrationStepType.GOOGLE_ANALYTICS:
return executeGoogleAnalyticsIntegration(step, context)
case IntegrationStepType.ZAPIER:
case IntegrationStepType.MAKE_COM:
case IntegrationStepType.WEBHOOK:
return executeWebhook(step, context)
case IntegrationStepType.EMAIL:
@@ -207,7 +209,7 @@ const parseCellValues = (
}, {})
const executeWebhook = async (
step: WebhookStep | ZapierStep,
step: WebhookStep | ZapierStep | MakeComStep,
{
blockId,
stepId,

View File

@@ -6,6 +6,7 @@ export type IntegrationStep =
| WebhookStep
| SendEmailStep
| ZapierStep
| MakeComStep
export type IntegrationStepOptions =
| GoogleSheetsOptions
@@ -19,6 +20,7 @@ export enum IntegrationStepType {
WEBHOOK = 'Webhook',
EMAIL = 'Email',
ZAPIER = 'Zapier',
MAKE_COM = 'Make.com',
}
export type GoogleSheetsStep = StepBase & {
@@ -41,6 +43,10 @@ export type ZapierStep = Omit<WebhookStep, 'type'> & {
type: IntegrationStepType.ZAPIER
}
export type MakeComStep = Omit<WebhookStep, 'type'> & {
type: IntegrationStepType.MAKE_COM
}
export type SendEmailStep = StepBase & {
type: IntegrationStepType.EMAIL
options: SendEmailOptions

View File

@@ -115,6 +115,7 @@ export const stepTypeHasWebhook = (
Object.values([
IntegrationStepType.WEBHOOK,
IntegrationStepType.ZAPIER,
IntegrationStepType.MAKE_COM,
] as string[]).includes(type)
export const stepTypeHasItems = (