Skip to content

Commit

Permalink
chore(slack): migrate slack inbound to generator (#2279)
Browse files Browse the repository at this point in the history
  • Loading branch information
igpetrov committed Apr 2, 2024
1 parent 3ae7d9e commit b3a776f
Show file tree
Hide file tree
Showing 7 changed files with 692 additions and 659 deletions.
330 changes: 160 additions & 170 deletions connectors/slack/element-templates/slack-inbound-boundary.json
Original file line number Diff line number Diff line change
@@ -1,174 +1,164 @@
{
"$schema": "https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json",
"name": "Slack Webhook Boundary Event Connector",
"id": "io.camunda.connectors.inbound.Slack.BoundaryEvent.v1",
"description": "Receive events from Slack",
"version": 2,
"documentationRef": "https://docs.camunda.io/docs/components/connectors/out-of-the-box-connectors/slack/?slack=inbound",
"category": {
"id": "connectors",
"name": "Connectors"
"$schema" : "https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json",
"name" : "Slack Webhook Boundary Event Connector",
"id" : "io.camunda.connectors.inbound.Slack.BoundaryEvent.v1",
"description" : "Receive events from Slack",
"documentationRef" : "https://docs.camunda.io/docs/components/connectors/out-of-the-box-connectors/slack/?slack=inbound",
"version" : 5,
"category" : {
"id" : "connectors",
"name" : "Connectors"
},
"appliesTo": [
"bpmn:BoundaryEvent"
],
"elementType": {
"value": "bpmn:BoundaryEvent",
"eventDefinition": "bpmn:MessageEventDefinition"
"appliesTo" : [ "bpmn:BoundaryEvent" ],
"elementType" : {
"value" : "bpmn:BoundaryEvent",
"eventDefinition" : "bpmn:MessageEventDefinition"
},
"groups": [
{
"id": "endpoint",
"label": "Webhook configuration"
},
{
"id": "activation",
"label": "Activation"
},
{
"id": "variable-mapping",
"label": "Variable mapping"
}
],
"properties": [
{
"type": "Hidden",
"value": "io.camunda:slack-webhook:1",
"binding": {
"type": "zeebe:property",
"name": "inbound.type"
}
},
{
"type": "Hidden",
"value": "SlackEventsWebhook",
"binding": {
"type": "zeebe:property",
"name": "inbound.subtype"
}
},
{
"type": "Hidden",
"generatedValue": {
"type": "uuid"
},
"binding": {
"type": "bpmn:Message#property",
"name": "name"
}
},
{
"label": "Webhook ID",
"type": "String",
"group": "endpoint",
"binding": {
"type": "zeebe:property",
"name": "inbound.context"
},
"description": "The webhook ID is a part of the URL endpoint",
"constraints": {
"notEmpty": true
}
},
{
"label": "Slack signing secret",
"description": "Slack signing secret. <a href='https://api.slack.com/authentication/verifying-requests-from-slack' target='_blank'>See documentation</a> regarding the Slack signing secret",
"type": "String",
"group": "endpoint",
"feel": "optional",
"binding": {
"type": "zeebe:property",
"name": "inbound.slackSigningSecret"
},
"constraints": {
"notEmpty": true
}
},
{
"type": "Hidden",
"value": "=if (body.type != null and body.type = \"url_verification\") then {body:{\"challenge\":body.challenge}, statusCode: 200} else null",
"binding": {
"type": "zeebe:property",
"name": "inbound.verificationExpression"
}
},
{
"label": "Correlation key (process)",
"type": "String",
"group": "activation",
"feel": "required",
"description": "Sets up the correlation key from process variables",
"binding": {
"type": "bpmn:Message#zeebe:subscription#property",
"name": "correlationKey"
},
"constraints": {
"notEmpty": true
}
},
{
"label": "Correlation key (payload)",
"type": "String",
"group": "activation",
"feel": "required",
"binding": {
"type": "zeebe:property",
"name": "correlationKeyExpression"
},
"description": "Extracts the correlation key from the incoming message payload",
"constraints": {
"notEmpty": true
}
},
{
"label": "Message ID expression",
"feel": "required",
"type": "String",
"optional": true,
"group": "activation",
"binding": {
"type": "zeebe:property",
"name": "messageIdExpression"
},
"description": "Expression to extract unique identifier of a message"
},
{
"label": "Condition",
"type": "String",
"group": "activation",
"feel": "required",
"optional": true,
"binding": {
"type": "zeebe:property",
"name": "activationCondition"
},
"description": "Condition under which the connector triggers. Leave empty to catch all events."
},
{
"label": "Result variable",
"type": "String",
"group": "variable-mapping",
"optional": true,
"binding": {
"type": "zeebe:property",
"name": "resultVariable"
},
"description": "Name of variable to store the result of the connector in"
},
{
"label": "Result expression",
"type": "String",
"group": "variable-mapping",
"feel": "required",
"optional": true,
"binding": {
"type": "zeebe:property",
"name": "resultExpression"
},
"description": "Expression to map the inbound payload to process variables"
}
],
"icon": {
"contents": "data:image/svg+xml;utf8,%3Csvg%20width%3D%2218%22%20height%3D%2218%22%20%20viewBox%3D%220%200%20127%20127%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Cpath%20d%3D%22M27.2%2080c0%207.3-5.9%2013.2-13.2%2013.2C6.7%2093.2.8%2087.3.8%2080c0-7.3%205.9-13.2%2013.2-13.2h13.2V80zm6.6%200c0-7.3%205.9-13.2%2013.2-13.2%207.3%200%2013.2%205.9%2013.2%2013.2v33c0%207.3-5.9%2013.2-13.2%2013.2-7.3%200-13.2-5.9-13.2-13.2V80z%22%20fill%3D%22%23E01E5A%22%2F%3E%0A%20%20%3Cpath%20d%3D%22M47%2027c-7.3%200-13.2-5.9-13.2-13.2C33.8%206.5%2039.7.6%2047%20.6c7.3%200%2013.2%205.9%2013.2%2013.2V27H47zm0%206.7c7.3%200%2013.2%205.9%2013.2%2013.2%200%207.3-5.9%2013.2-13.2%2013.2H13.9C6.6%2060.1.7%2054.2.7%2046.9c0-7.3%205.9-13.2%2013.2-13.2H47z%22%20fill%3D%22%2336C5F0%22%2F%3E%0A%20%20%3Cpath%20d%3D%22M99.9%2046.9c0-7.3%205.9-13.2%2013.2-13.2%207.3%200%2013.2%205.9%2013.2%2013.2%200%207.3-5.9%2013.2-13.2%2013.2H99.9V46.9zm-6.6%200c0%207.3-5.9%2013.2-13.2%2013.2-7.3%200-13.2-5.9-13.2-13.2V13.8C66.9%206.5%2072.8.6%2080.1.6c7.3%200%2013.2%205.9%2013.2%2013.2v33.1z%22%20fill%3D%22%232EB67D%22%2F%3E%0A%20%20%3Cpath%20d%3D%22M80.1%2099.8c7.3%200%2013.2%205.9%2013.2%2013.2%200%207.3-5.9%2013.2-13.2%2013.2-7.3%200-13.2-5.9-13.2-13.2V99.8h13.2zm0-6.6c-7.3%200-13.2-5.9-13.2-13.2%200-7.3%205.9-13.2%2013.2-13.2h33.1c7.3%200%2013.2%205.9%2013.2%2013.2%200%207.3-5.9%2013.2-13.2%2013.2H80.1z%22%20fill%3D%22%23ECB22E%22%2F%3E%0A%3C%2Fsvg%3E%0A"
"groups" : [ {
"id" : "endpoint",
"label" : "Webhook configuration"
}, {
"id" : "activation",
"label" : "Activation"
}, {
"id" : "correlation",
"label" : "Correlation"
}, {
"id" : "output",
"label" : "Output mapping"
} ],
"properties" : [ {
"value" : "io.camunda:slack-webhook:1",
"binding" : {
"name" : "inbound.type",
"type" : "zeebe:property"
},
"type" : "Hidden"
}, {
"id" : "inbound.context",
"label" : "Webhook ID",
"description" : "The webhook ID is a part of the URL endpoint",
"optional" : false,
"constraints" : {
"notEmpty" : true
},
"group" : "endpoint",
"binding" : {
"name" : "inbound.context",
"type" : "zeebe:property"
},
"type" : "String"
}, {
"id" : "inbound.slackSigningSecret",
"label" : "Slack signing secret",
"description" : "Slack signing secret. <a href='https://api.slack.com/authentication/verifying-requests-from-slack' target='_blank'>See documentation</a> regarding the Slack signing secret",
"optional" : false,
"constraints" : {
"notEmpty" : true
},
"group" : "endpoint",
"binding" : {
"name" : "inbound.slackSigningSecret",
"type" : "zeebe:property"
},
"type" : "String"
}, {
"id" : "inbound.verificationExpression",
"label" : "Verification expression",
"optional" : true,
"value" : "=if (body.type != null and body.type = \"url_verification\") then {body:{\"challenge\":body.challenge}, statusCode: 200} else null",
"group" : "endpoint",
"binding" : {
"name" : "inbound.verificationExpression",
"type" : "zeebe:property"
},
"type" : "Hidden"
}, {
"id" : "activationCondition",
"label" : "Activation condition",
"description" : "Condition under which the Connector triggers. Leave empty to catch all events",
"optional" : true,
"feel" : "required",
"group" : "activation",
"binding" : {
"name" : "activationCondition",
"type" : "zeebe:property"
},
"type" : "String"
}, {
"id" : "correlationKeyProcess",
"label" : "Correlation key (process)",
"description" : "Sets up the correlation key from process variables",
"constraints" : {
"notEmpty" : true
},
"feel" : "required",
"group" : "correlation",
"binding" : {
"name" : "correlationKey",
"type" : "bpmn:Message#zeebe:subscription#property"
},
"type" : "String"
}, {
"id" : "correlationKeyPayload",
"label" : "Correlation key (payload)",
"description" : "Extracts the correlation key from the incoming message payload",
"constraints" : {
"notEmpty" : true
},
"feel" : "required",
"group" : "correlation",
"binding" : {
"name" : "correlationKeyExpression",
"type" : "zeebe:property"
},
"type" : "String"
}, {
"id" : "messageIdExpression",
"label" : "Message ID expression",
"description" : "Expression to extract unique identifier of a message",
"optional" : true,
"feel" : "required",
"group" : "correlation",
"binding" : {
"name" : "messageIdExpression",
"type" : "zeebe:property"
},
"type" : "String"
}, {
"id" : "messageNameUuid",
"generatedValue" : {
"type" : "uuid"
},
"group" : "correlation",
"binding" : {
"name" : "name",
"type" : "bpmn:Message#property"
},
"type" : "Hidden"
}, {
"id" : "resultVariable",
"label" : "Result variable",
"description" : "Name of variable to store the response in",
"group" : "output",
"binding" : {
"name" : "resultVariable",
"type" : "zeebe:property"
},
"type" : "String"
}, {
"id" : "resultExpression",
"label" : "Result expression",
"description" : "Expression to map the response into process variables",
"feel" : "required",
"group" : "output",
"binding" : {
"name" : "resultExpression",
"type" : "zeebe:property"
},
"type" : "Text"
} ],
"icon" : {
"contents" : "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTI3IiBoZWlnaHQ9IjEyNyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjcuMiA4MGMwIDcuMy01LjkgMTMuMi0xMy4yIDEzLjJDNi43IDkzLjIuOCA4Ny4zLjggODBjMC03LjMgNS45LTEzLjIgMTMuMi0xMy4yaDEzLjJWODB6bTYuNiAwYzAtNy4zIDUuOS0xMy4yIDEzLjItMTMuMiA3LjMgMCAxMy4yIDUuOSAxMy4yIDEzLjJ2MzNjMCA3LjMtNS45IDEzLjItMTMuMiAxMy4yLTcuMyAwLTEzLjItNS45LTEzLjItMTMuMlY4MHoiIGZpbGw9IiNFMDFFNUEiLz4KICA8cGF0aCBkPSJNNDcg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