diff --git a/packages/core/bin/generate-ui-types b/packages/core/bin/generate-ui-types index 76ceae31fc..f320dea390 100755 --- a/packages/core/bin/generate-ui-types +++ b/packages/core/bin/generate-ui-types @@ -29,6 +29,21 @@ function findReferencedMethods(obj, refs = {}, latestName = '') { return refs; } +function addWebhookLifecycle(nodeType) { + if (nodeType.description.webhooks) { + nodeType.description.webhooks = nodeType.description.webhooks.map((webhook) => { + const webhookMethods = + nodeType?.webhookMethods?.[webhook.name] ?? nodeType?.webhookMethods?.default; + webhook.hasLifecycleMethods = Boolean( + webhookMethods?.checkExists && webhookMethods?.create && webhookMethods?.delete, + ); + return webhook; + }); + } + + return nodeType; +} + (async () => { const loader = new PackageDirectoryLoader(packageDir); await loader.loadAll(); @@ -60,6 +75,7 @@ function findReferencedMethods(obj, refs = {}, latestName = '') { .map((data) => { const nodeType = NodeHelpers.getVersionedNodeType(data.type); NodeHelpers.applySpecialNodeParameters(nodeType); + addWebhookLifecycle(nodeType); return data.type; }) .flatMap((nodeData) => { diff --git a/packages/editor-ui/src/components/NodeWebhooks.vue b/packages/editor-ui/src/components/NodeWebhooks.vue index 0b2ef78282..0fec295a7f 100644 --- a/packages/editor-ui/src/components/NodeWebhooks.vue +++ b/packages/editor-ui/src/components/NodeWebhooks.vue @@ -61,12 +61,12 @@