Add kamelet definition: telegram-source
This commit is contained in:
parent
d77e5063f2
commit
2f8e685296
97
kamelet.json
Normal file
97
kamelet.json
Normal file
@ -0,0 +1,97 @@
|
||||
{
|
||||
"apiVersion": "camel.apache.org/v1",
|
||||
"kind": "Kamelet",
|
||||
"metadata": {
|
||||
"name": "telegram-source",
|
||||
"annotations": {
|
||||
"camel.apache.org/kamelet.support.level": "Stable",
|
||||
"camel.apache.org/catalog.version": "4.22.1",
|
||||
"camel.apache.org/kamelet.icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNDAgMjQwIj48ZGVmcz48bGluZWFyR3JhZGllbnQgaWQ9ImEiIHgxPSIuNjY3IiB4Mj0iLjQxNyIgeTE9Ii4xNjciIHkyPSIuNzUiPjxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iIzM3YWVlMiIvPjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzFlOTZjOCIvPjwvbGluZWFyR3JhZGllbnQ+PGxpbmVhckdyYWRpZW50IGlkPSJiIiB4MT0iLjY2IiB4Mj0iLjg1MSIgeTE9Ii40MzciIHkyPSIuODAyIj48c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiNlZmY3ZmMiLz48c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNmZmYiLz48L2xpbmVhckdyYWRpZW50PjwvZGVmcz48Y2lyY2xlIGN4PSIxMjAiIGN5PSIxMjAiIHI9IjEyMCIgZmlsbD0idXJsKCNhKSIvPjxwYXRoIGZpbGw9IiNjOGRhZWEiIGQ9Ik05OCAxNzVjLTMuODg4IDAtMy4yMjctMS40NjgtNC41NjgtNS4xN0w4MiAxMzIuMjA3IDE3MCA4MCIvPjxwYXRoIGZpbGw9IiNhOWM5ZGQiIGQ9Ik05OCAxNzVjMyAwIDQuMzI1LTEuMzcyIDYtM2wxNi0xNS41NTgtMTkuOTU4LTEyLjAzNSIvPjxwYXRoIGZpbGw9InVybCgjYikiIGQ9Ik0xMDAuMDQgMTQ0LjQxbDQ4LjM2IDM1LjcyOWM1LjUxOSAzLjA0NSA5LjUwMSAxLjQ2OCAxMC44NzYtNS4xMjNsMTkuNjg1LTkyLjc2M2MyLjAxNS04LjA4LTMuMDgtMTEuNzQ2LTguMzYtOS4zNDlsLTExNS41OSA0NC41NzFjLTcuODkgMy4xNjUtNy44NDMgNy41NjctMS40MzggOS41MjhsMjkuNjYzIDkuMjU5IDY4LjY3My00My4zMjVjMy4yNDItMS45NjYgNi4yMTgtLjkxIDMuNzc2IDEuMjU4Ii8+PC9zdmc+",
|
||||
"camel.apache.org/provider": "Apache Software Foundation",
|
||||
"camel.apache.org/kamelet.group": "Telegram",
|
||||
"camel.apache.org/kamelet.namespace": "Social"
|
||||
},
|
||||
"labels": {
|
||||
"camel.apache.org/kamelet.type": "source"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"definition": {
|
||||
"title": "Telegram Source",
|
||||
"description": "Receive all messages that people send to your Telegram bot.",
|
||||
"required": [
|
||||
"authorizationToken"
|
||||
],
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"authorizationToken": {
|
||||
"title": "Token",
|
||||
"description": "The token to access your bot on Telegram. You can obtain it from the Telegram @botfather.",
|
||||
"type": "string",
|
||||
"format": "password",
|
||||
"x-descriptors": [
|
||||
"urn:camel:group:credentials"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"types": {
|
||||
"out": {
|
||||
"mediaType": "application/json"
|
||||
}
|
||||
},
|
||||
"dependencies": [
|
||||
"camel:jackson",
|
||||
"camel:kamelet",
|
||||
"camel:telegram",
|
||||
"camel:core"
|
||||
],
|
||||
"template": {
|
||||
"from": {
|
||||
"uri": "telegram:bots",
|
||||
"parameters": {
|
||||
"authorizationToken": "{{authorizationToken}}"
|
||||
},
|
||||
"steps": [
|
||||
{
|
||||
"setHeader": {
|
||||
"name": "chat-id",
|
||||
"simple": "${header[CamelTelegramChatId]}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"setHeader": {
|
||||
"name": "ce-chatid",
|
||||
"simple": "${header[CamelTelegramChatId]}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"marshal": {
|
||||
"json": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"to": "kamelet:sink"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"propertiesSchema": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"type": "object",
|
||||
"title": "Telegram Source",
|
||||
"description": "Receive all messages that people send to your Telegram bot.",
|
||||
"required": [
|
||||
"authorizationToken"
|
||||
],
|
||||
"properties": {
|
||||
"authorizationToken": {
|
||||
"type": "string",
|
||||
"title": "Token",
|
||||
"description": "The token to access your bot on Telegram. You can obtain it from the Telegram @botfather.",
|
||||
"format": "password"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user