From beedcd4ac10c2e151fa26db8714b5b52680ed464 Mon Sep 17 00:00:00 2001 From: gitea_admin Date: Mon, 12 Oct 2026 02:33:48 +0000 Subject: [PATCH] Add kamelet definition: google-mail-source --- kamelet.json | 286 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 286 insertions(+) create mode 100644 kamelet.json diff --git a/kamelet.json b/kamelet.json new file mode 100644 index 0000000..2265fda --- /dev/null +++ b/kamelet.json @@ -0,0 +1,286 @@ +{ + "apiVersion": "camel.apache.org/v1", + "kind": "Kamelet", + "metadata": { + "name": "google-mail-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,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjUyIDQyIDg4IDY2Ij4KPHBhdGggZmlsbD0iIzQyODVmNCIgZD0iTTU4IDEwOGgxNFY3NEw1MiA1OXY0M2MwIDMuMzIgMi42OSA2IDYgNiIvPgo8cGF0aCBmaWxsPSIjMzRhODUzIiBkPSJNMTIwIDEwOGgxNGMzLjMyIDAgNi0yLjY5IDYtNlY1OWwtMjAgMTUiLz4KPHBhdGggZmlsbD0iI2ZiYmMwNCIgZD0iTTEyMCA0OHYyNmwyMC0xNXYtOGMwLTcuNDItOC40Ny0xMS42NS0xNC40LTcuMiIvPgo8cGF0aCBmaWxsPSIjZWE0MzM1IiBkPSJNNzIgNzRWNDhsMjQgMTggMjQtMTh2MjZMOTYgOTIiLz4KPHBhdGggZmlsbD0iI2M1MjIxZiIgZD0iTTUyIDUxdjhsMjAgMTVWNDhsLTUuNi00LjJjLTUuOTQtNC40NS0xNC40LS4yMi0xNC40IDcuMiIvPgo8L3N2Zz4=", + "camel.apache.org/provider": "Apache Software Foundation", + "camel.apache.org/kamelet.group": "Google Mail", + "camel.apache.org/kamelet.namespace": "GCP" + }, + "labels": { + "camel.apache.org/kamelet.type": "source" + } + }, + "spec": { + "definition": { + "title": "Google Mail Source", + "description": "Receive data from Google Mail.", + "required": [ + "index", + "clientId", + "accessToken", + "refreshToken", + "clientSecret", + "applicationName" + ], + "type": "object", + "properties": { + "index": { + "title": "Index", + "description": "An index for the google mail endpoint.", + "type": "string" + }, + "clientId": { + "title": "Client ID", + "description": "Client ID of the gmail application.", + "type": "string", + "format": "password", + "x-descriptors": [ + "urn:camel:group:credentials" + ] + }, + "clientSecret": { + "title": "Client Secret", + "description": "Client Secret of the gmail application.", + "type": "string", + "format": "password", + "x-descriptors": [ + "urn:camel:group:credentials" + ] + }, + "accessToken": { + "title": "Access Token", + "description": "OAuth 2 access token for google mail application. This typically expires after an hour so refreshToken is recommended for long term usage.", + "type": "string", + "format": "password", + "x-descriptors": [ + "urn:camel:group:credentials" + ] + }, + "refreshToken": { + "title": "Refresh Token", + "description": "OAuth 2 refresh token for google mail application. Using this, the Google Calendar component can obtain a new accessToken whenever the current one expires - a necessity if the application is long-lived.", + "type": "string", + "format": "password", + "x-descriptors": [ + "urn:camel:group:credentials" + ] + }, + "delay": { + "title": "Delay", + "description": "The number of milliseconds before the next poll", + "type": "integer", + "default": 500 + }, + "applicationName": { + "title": "Application name", + "description": "Google Mail application name", + "type": "string" + }, + "markAsRead": { + "title": "Mark as Read", + "description": "Mark the message as read once it has been consumed", + "type": "boolean", + "default": true + }, + "labels": { + "title": "Gmail Labels", + "description": "Comma separated list of labels to take into account", + "type": "string", + "example": "inbox" + }, + "query": { + "title": "Gmail Query", + "description": "The query to execute on gmail box", + "type": "string", + "example": "is:unread -category:(promotions OR social)", + "default": "is:unread" + } + } + }, + "dataTypes": { + "out": { + "default": "json", + "headers": { + "CamelGoogleMailId": { + "title": "Camel Google Mail Id", + "description": "The ID of the message", + "type": "string" + }, + "CamelGoogleMailStreamTo": { + "title": "Camel Google Mail To Address", + "description": "The recipient of the message", + "type": "string" + }, + "CamelGoogleMailStreamFrom": { + "title": "Camel Google Mail From Address", + "description": "The emitter of the message", + "type": "string" + }, + "CamelGoogleMailStreamCc": { + "title": "Camel Google Mail Cc", + "description": "The carbon copy of the message", + "type": "string" + }, + "CamelGoogleMailStreamBcc": { + "title": "Camel Google Mail Bcc", + "description": "The blind carbon cpoy of the message", + "type": "string" + }, + "CamelGoogleMailStreamSubject": { + "title": "Camel Google Mail Subject", + "description": "The subject of the message", + "type": "string" + } + }, + "types": { + "json": { + "format": "application-json", + "description": "Json representation of a Google Mail event object.", + "mediaType": "application/json" + }, + "cloudevents": { + "format": "google-mail-stream:application-cloudevents", + "description": "Output data type represents Google Mail Streams response as CloudEvent V1. The data type sets Camel specific CloudEvent headers on the exchange with respective data from the Mail and its derived object.", + "headers": { + "CamelCloudEventID": { + "title": "CloudEvent ID", + "description": "The Camel exchange id set as event id", + "type": "string" + }, + "CamelCloudEventType": { + "title": "CloudEvent Type", + "description": "The event type", + "default": "org.apache.camel.event.google.mail.stream.consume", + "type": "string" + }, + "CamelCloudEventSource": { + "title": "CloudEvent Source", + "description": "The event source. By default, the Mail From with prefix \"google.mail.stream.\".", + "type": "string" + }, + "CamelCloudEventSubject": { + "title": "CloudEvent Subject", + "description": "The event subject. The Calendar event type.", + "type": "string" + }, + "CamelCloudEventTime": { + "title": "CloudEvent Time", + "description": "The exchange creation timestamp as event time.", + "type": "string" + } + } + } + } + } + }, + "dependencies": [ + "camel:jackson", + "camel:kamelet", + "camel:google-mail" + ], + "template": { + "from": { + "uri": "google-mail-stream://{{index}}", + "parameters": { + "clientId": "{{clientId}}", + "accessToken": "{{accessToken}}", + "refreshToken": "{{refreshToken}}", + "clientSecret": "{{clientSecret}}", + "delay": "{{delay}}", + "applicationName": "{{applicationName}}", + "markAsRead": "{{markAsRead}}", + "labels": "{{labels}}", + "query": "{{query}}" + }, + "steps": [ + { + "marshal": { + "json": {} + } + }, + { + "to": "kamelet:sink" + } + ] + } + } + }, + "propertiesSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "title": "Google Mail Source", + "description": "Receive data from Google Mail.", + "required": [ + "index", + "clientId", + "accessToken", + "refreshToken", + "clientSecret", + "applicationName" + ], + "properties": { + "index": { + "type": "string", + "title": "Index", + "description": "An index for the google mail endpoint." + }, + "clientId": { + "type": "string", + "title": "Client ID", + "description": "Client ID of the gmail application.", + "format": "password" + }, + "clientSecret": { + "type": "string", + "title": "Client Secret", + "description": "Client Secret of the gmail application.", + "format": "password" + }, + "accessToken": { + "type": "string", + "title": "Access Token", + "description": "OAuth 2 access token for google mail application. This typically expires after an hour so refreshToken is recommended for long term usage.", + "format": "password" + }, + "refreshToken": { + "type": "string", + "title": "Refresh Token", + "description": "OAuth 2 refresh token for google mail application. Using this, the Google Calendar component can obtain a new accessToken whenever the current one expires - a necessity if the application is long-lived.", + "format": "password" + }, + "delay": { + "type": "integer", + "title": "Delay", + "description": "The number of milliseconds before the next poll", + "default": 500 + }, + "applicationName": { + "type": "string", + "title": "Application name", + "description": "Google Mail application name" + }, + "markAsRead": { + "type": "boolean", + "title": "Mark as Read", + "description": "Mark the message as read once it has been consumed", + "default": true + }, + "labels": { + "type": "string", + "title": "Gmail Labels", + "description": "Comma separated list of labels to take into account" + }, + "query": { + "type": "string", + "title": "Gmail Query", + "description": "The query to execute on gmail box", + "default": "is:unread" + } + } + } +} \ No newline at end of file