feat($): add flow.setRemoteWebhookId

This commit is contained in:
Ali BARIN
2022-12-14 20:50:33 +01:00
parent 0970db3295
commit f30ac46672

View File

@@ -37,6 +37,7 @@ const globalVariable = async (
testRun = false,
} = options;
const isTrigger = step?.isTrigger;
const lastInternalId = testRun ? undefined : await flow?.lastInternalId();
const nextStep = await step?.getNextStep();
@@ -123,6 +124,18 @@ const globalVariable = async (
$.webhookUrl = webhookUrl;
}
if (isTrigger && (await step.getTriggerCommand()).type === 'webhook') {
$.flow.setRemoteWebhookId = async (remoteWebhookId) => {
await flow.$query().patchAndFetch({
remoteWebhookId,
});
$.flow.remoteWebhookId = remoteWebhookId;
};
$.flow.remoteWebhookId = flow.remoteWebhookId;
}
const lastInternalIds =
testRun || (flow && step.isAction) ? [] : await flow?.lastInternalIds(2000);