feat($): add flow.setRemoteWebhookId
This commit is contained in:
@@ -37,6 +37,7 @@ const globalVariable = async (
|
|||||||
testRun = false,
|
testRun = false,
|
||||||
} = options;
|
} = options;
|
||||||
|
|
||||||
|
const isTrigger = step?.isTrigger;
|
||||||
const lastInternalId = testRun ? undefined : await flow?.lastInternalId();
|
const lastInternalId = testRun ? undefined : await flow?.lastInternalId();
|
||||||
const nextStep = await step?.getNextStep();
|
const nextStep = await step?.getNextStep();
|
||||||
|
|
||||||
@@ -123,6 +124,18 @@ const globalVariable = async (
|
|||||||
$.webhookUrl = webhookUrl;
|
$.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 =
|
const lastInternalIds =
|
||||||
testRun || (flow && step.isAction) ? [] : await flow?.lastInternalIds(2000);
|
testRun || (flow && step.isAction) ? [] : await flow?.lastInternalIds(2000);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user