Add Activepieces integration for workflow automation

- Add Activepieces fork with SmoothSchedule custom piece
- Create integrations app with Activepieces service layer
- Add embed token endpoint for iframe integration
- Create Automations page with embedded workflow builder
- Add sidebar visibility fix for embed mode
- Add list inactive customers endpoint to Public API
- Include SmoothSchedule triggers: event created/updated/cancelled
- Include SmoothSchedule actions: create/update/cancel events, list resources/services/customers

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
poduck
2025-12-18 22:59:37 -05:00
parent 9848268d34
commit 3aa7199503
16292 changed files with 1284892 additions and 4708 deletions

View File

@@ -0,0 +1,35 @@
{
"Automate image generation": "Bildgenerierung automatisieren",
"Bannerbear API Key": "Bannerbear API Key",
"Create Image": "Bild erstellen",
"Custom API Call": "Eigener API-Aufruf",
"Create image from Bannerbear template": "Bild aus Bannerbear Vorlage erstellen",
"Make a custom API call to a specific endpoint": "Einen benutzerdefinierten API-Aufruf an einen bestimmten Endpunkt machen",
"Template": "Vorlage",
"Template version": "Vorlagenversion",
"Template modifications": "Änderungen der Vorlage",
"Transparent background": "Transparenter Hintergrund",
"Render a PDF": "PDF anzeigen",
"Metadata": "Metadaten",
"Method": "Methode",
"Headers": "Kopfzeilen",
"Query Parameters": "Abfrageparameter",
"Body": "Körper",
"Response is Binary ?": "Antwort ist binär?",
"No Error on Failure": "Kein Fehler bei Fehler",
"Timeout (in seconds)": "Timeout (in Sekunden)",
"The template to use in image creation.": "Die Vorlage, die bei der Erstellung von Bildern verwendet wird.",
"Create image based on a specific version of the template.": "Erstellen Sie ein Bild basierend auf einer bestimmten Version der Vorlage.",
"A list of modifications you want to make on the template.": "Eine Liste der Änderungen, die Sie im Template vornehmen möchten.",
"Render a PNG with a transparent background. Default is false.": "Rendern Sie ein PNG mit einem transparenten Hintergrund. Standard ist falsch.",
"Render a PDF instead of a PNG. Default is false.": "PDF anstelle eines PNGs ausgeben. Standard ist falsch.",
"Any metadata that you need to store e.g. ID of a record in your DB.": "Alle Metadaten, die Sie benötigen, um z.B. die ID eines Datensatzes in Ihrer Datenbank zu speichern.",
"Authorization headers are injected automatically from your connection.": "Autorisierungs-Header werden automatisch von Ihrer Verbindung injiziert.",
"Enable for files like PDFs, images, etc..": "Aktivieren für Dateien wie PDFs, Bilder, etc..",
"GET": "ERHALTEN",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "LÖSCHEN",
"HEAD": "HEAD"
}

View File

@@ -0,0 +1,35 @@
{
"Automate image generation": "Automatizar la generación de imágenes",
"Bannerbear API Key": "Bannerbear API Key",
"Create Image": "Crear imagen",
"Custom API Call": "Llamada API personalizada",
"Create image from Bannerbear template": "Crear imagen a partir de la plantilla Bannerbear",
"Make a custom API call to a specific endpoint": "Hacer una llamada API personalizada a un extremo específico",
"Template": "Plantilla",
"Template version": "Versión de plantilla",
"Template modifications": "Modificaciones de plantillas",
"Transparent background": "Fondo transparente",
"Render a PDF": "Procesar un PDF",
"Metadata": "Metadatos",
"Method": "Método",
"Headers": "Encabezados",
"Query Parameters": "Parámetros de consulta",
"Body": "Cuerpo",
"Response is Binary ?": "¿Respuesta es binaria?",
"No Error on Failure": "No hay ningún error en fallo",
"Timeout (in seconds)": "Tiempo de espera (en segundos)",
"The template to use in image creation.": "La plantilla a usar en la creación de imágenes.",
"Create image based on a specific version of the template.": "Crear una imagen basada en una versión específica de la plantilla.",
"A list of modifications you want to make on the template.": "Una lista de modificaciones que desea hacer en la plantilla.",
"Render a PNG with a transparent background. Default is false.": "Procesa un PNG con un fondo transparente. Por defecto es falso.",
"Render a PDF instead of a PNG. Default is false.": "Procesar un PDF en lugar de un PNG. Por defecto es falso.",
"Any metadata that you need to store e.g. ID of a record in your DB.": "Cualquier metadata que necesite almacenar por ejemplo el ID de un registro en su DB.",
"Authorization headers are injected automatically from your connection.": "Las cabeceras de autorización se inyectan automáticamente desde tu conexión.",
"Enable for files like PDFs, images, etc..": "Activar para archivos como PDFs, imágenes, etc.",
"GET": "RECOGER",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "BORRAR",
"HEAD": "LIMPIO"
}

View File

@@ -0,0 +1,35 @@
{
"Automate image generation": "Automatiser la génération d'image",
"Bannerbear API Key": "Bannerbear API Key",
"Create Image": "Créer une image",
"Custom API Call": "Appel API personnalisé",
"Create image from Bannerbear template": "Créer une image à partir du modèle Bannerbear",
"Make a custom API call to a specific endpoint": "Passez un appel API personnalisé à un point de terminaison spécifique",
"Template": "Gabarit",
"Template version": "Version du modèle",
"Template modifications": "Modifications du modèle",
"Transparent background": "Arrière-plan transparent",
"Render a PDF": "Afficher un PDF",
"Metadata": "Métadonnées",
"Method": "Méthode",
"Headers": "En-têtes",
"Query Parameters": "Paramètres de requête",
"Body": "Corps",
"Response is Binary ?": "La réponse est Binaire ?",
"No Error on Failure": "Aucune erreur en cas d'échec",
"Timeout (in seconds)": "Délai d'attente (en secondes)",
"The template to use in image creation.": "Le modèle à utiliser dans la création d'image.",
"Create image based on a specific version of the template.": "Créer une image basée sur une version spécifique du modèle.",
"A list of modifications you want to make on the template.": "Une liste de modifications que vous voulez faire sur le modèle.",
"Render a PNG with a transparent background. Default is false.": "Renvoie un PNG avec un arrière-plan transparent. La valeur par défaut est faux.",
"Render a PDF instead of a PNG. Default is false.": "Renvoie un PDF au lieu d'un PNG. La valeur par défaut est false.",
"Any metadata that you need to store e.g. ID of a record in your DB.": "Toutes les métadonnées dont vous avez besoin pour stocker par exemple l'ID d'un enregistrement dans votre base de données.",
"Authorization headers are injected automatically from your connection.": "Les en-têtes d'autorisation sont injectés automatiquement à partir de votre connexion.",
"Enable for files like PDFs, images, etc..": "Activer pour les fichiers comme les PDFs, les images, etc.",
"GET": "OBTENIR",
"POST": "POSTER",
"PATCH": "PATCH",
"PUT": "EFFACER",
"DELETE": "SUPPRIMER",
"HEAD": "TÊTE"
}

View File

@@ -0,0 +1,35 @@
{
"Automate image generation": "画像生成の自動化",
"Bannerbear API Key": "Bannerbear API Key",
"Create Image": "画像を作成",
"Custom API Call": "カスタムAPI通話",
"Create image from Bannerbear template": "Bannerbearテンプレートから画像を作成",
"Make a custom API call to a specific endpoint": "特定のエンドポイントへのカスタム API コールを実行します。",
"Template": "テンプレート",
"Template version": "テンプレートバージョン",
"Template modifications": "テンプレートの変更",
"Transparent background": "透明な背景",
"Render a PDF": "PDFをレンダリング",
"Metadata": "メタデータ",
"Method": "方法",
"Headers": "ヘッダー",
"Query Parameters": "クエリパラメータ",
"Body": "本文",
"Response is Binary ?": "応答はバイナリですか?",
"No Error on Failure": "失敗時にエラーはありません",
"Timeout (in seconds)": "タイムアウト(秒)",
"The template to use in image creation.": "イメージ作成で使用するテンプレート。",
"Create image based on a specific version of the template.": "テンプレートの特定のバージョンに基づいて画像を作成します。",
"A list of modifications you want to make on the template.": "テンプレート上で行う変更のリスト。",
"Render a PNG with a transparent background. Default is false.": "透明な背景のPNGをレンダリングします。デフォルトはfalseです。",
"Render a PDF instead of a PNG. Default is false.": "PNGの代わりにPDFをレンダリングします。デフォルトはfalseです。",
"Any metadata that you need to store e.g. ID of a record in your DB.": "たとえば、DBにレコードのIDなどを保存する必要があるメタデータ。",
"Authorization headers are injected automatically from your connection.": "認証ヘッダは接続から自動的に注入されます。",
"Enable for files like PDFs, images, etc..": "PDF、画像などのファイルを有効にします。",
"GET": "取得",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "削除",
"HEAD": "頭"
}

View File

@@ -0,0 +1,35 @@
{
"Automate image generation": "Automatiseer afbeeldingen genereren",
"Bannerbear API Key": "Bannerbear API Key",
"Create Image": "Afbeelding aanmaken",
"Custom API Call": "Custom API Call",
"Create image from Bannerbear template": "Afbeelding maken van Bannerbeer sjabloon",
"Make a custom API call to a specific endpoint": "Maak een aangepaste API call naar een specifiek eindpunt",
"Template": "Sjabloon",
"Template version": "Template versie",
"Template modifications": "Sjabloon wijzigingen",
"Transparent background": "Transparante achtergrond",
"Render a PDF": "Een PDF weergeven",
"Metadata": "Metagegevens",
"Method": "Methode",
"Headers": "Kopteksten",
"Query Parameters": "Query parameters",
"Body": "Lichaam",
"Response is Binary ?": "Antwoord is binair?",
"No Error on Failure": "Geen fout bij fout",
"Timeout (in seconds)": "Time-out (in seconden)",
"The template to use in image creation.": "Het sjabloon dat gebruikt moet worden bij het maken van afbeeldingen.",
"Create image based on a specific version of the template.": "Maak afbeelding aan op basis van een specifieke versie van de template.",
"A list of modifications you want to make on the template.": "Een lijst van wijzigingen die je wilt aanbrengen op de template.",
"Render a PNG with a transparent background. Default is false.": "Geef een PNG met een transparante achtergrond op. Standaard is onwaar.",
"Render a PDF instead of a PNG. Default is false.": "Geef een PDF weer in plaats van een PNG. Standaard is onwaar.",
"Any metadata that you need to store e.g. ID of a record in your DB.": "Elke metagegevens die u moet opslaan, bijv. ID van een record in uw database.",
"Authorization headers are injected automatically from your connection.": "Autorisatie headers worden automatisch geïnjecteerd vanuit uw verbinding.",
"Enable for files like PDFs, images, etc..": "Inschakelen voor bestanden zoals PDF's, afbeeldingen etc..",
"GET": "KRIJG",
"POST": "POSTE",
"PATCH": "BEKIJK",
"PUT": "PUT",
"DELETE": "VERWIJDEREN",
"HEAD": "HOOFD"
}

View File

@@ -0,0 +1,35 @@
{
"Automate image generation": "Automatizar geração de imagem",
"Bannerbear API Key": "Bannerbear API Key",
"Create Image": "Criar imagem",
"Custom API Call": "Chamada de API personalizada",
"Create image from Bannerbear template": "Criar imagem a partir do modelo Bannerbear",
"Make a custom API call to a specific endpoint": "Faça uma chamada de API personalizada para um ponto de extremidade específico",
"Template": "Modelo",
"Template version": "Versão do modelo",
"Template modifications": "Modificações de modelos",
"Transparent background": "Fundo transparente",
"Render a PDF": "Renderizar um PDF",
"Metadata": "Metadados",
"Method": "Método",
"Headers": "Cabeçalhos",
"Query Parameters": "Parâmetros da consulta",
"Body": "Conteúdo",
"Response is Binary ?": "A resposta é binária ?",
"No Error on Failure": "Nenhum erro no Failure",
"Timeout (in seconds)": "Tempo limite (em segundos)",
"The template to use in image creation.": "O modelo a ser usado na criação de imagem.",
"Create image based on a specific version of the template.": "Criar imagem com base em uma versão específica do modelo.",
"A list of modifications you want to make on the template.": "Uma lista de modificações que você quer fazer no modelo.",
"Render a PNG with a transparent background. Default is false.": "Renderizar um PNG com um fundo transparente. O padrão é falso.",
"Render a PDF instead of a PNG. Default is false.": "Renderizar um PDF em vez de um PNG. O padrão é falso.",
"Any metadata that you need to store e.g. ID of a record in your DB.": "Quaisquer metadados que você precise armazenar por exemplo a identificação de um registro em seu banco de dados.",
"Authorization headers are injected automatically from your connection.": "Os cabeçalhos de autorização são inseridos automaticamente a partir da sua conexão.",
"Enable for files like PDFs, images, etc..": "Habilitar para arquivos como PDFs, imagens, etc..",
"GET": "OBTER",
"POST": "POSTAR",
"PATCH": "COMPRAR",
"PUT": "COLOCAR",
"DELETE": "EXCLUIR",
"HEAD": "CABEÇA"
}

View File

@@ -0,0 +1,34 @@
{
"Bannerbear": "Bannerbear",
"Automate image generation": "Автоматическое создание изображений",
"Bannerbear API Key": "Bannerbear API Key",
"Create Image": "Создать изображение",
"Custom API Call": "Пользовательский вызов API",
"Create image from Bannerbear template": "Создать изображение из шаблона Bannerbear",
"Make a custom API call to a specific endpoint": "Сделать пользовательский API вызов к определенной конечной точке",
"Template": "Шаблон",
"Template version": "Версия шаблона",
"Template modifications": "Изменение шаблона",
"Transparent background": "Прозрачный фон",
"Render a PDF": "Визуализировать PDF",
"Metadata": "Метаданные",
"Method": "Метод",
"Headers": "Заголовки",
"Query Parameters": "Параметры запроса",
"Body": "Тело",
"No Error on Failure": "Нет ошибок при ошибке",
"Timeout (in seconds)": "Таймаут (в секундах)",
"The template to use in image creation.": "Шаблон для создания изображения.",
"Create image based on a specific version of the template.": "Создать изображение на основе конкретной версии шаблона.",
"A list of modifications you want to make on the template.": "Список модификаций, которые вы хотите сделать по шаблону.",
"Render a PNG with a transparent background. Default is false.": "Отображение PNG с прозрачным фоном. По умолчанию - false.",
"Render a PDF instead of a PNG. Default is false.": "Рендер PDF вместо PNG. По умолчанию это false.",
"Any metadata that you need to store e.g. ID of a record in your DB.": "Любые метаданные, которые необходимо сохранить, например ID записи в БД.",
"Authorization headers are injected automatically from your connection.": "Заголовки авторизации включаются автоматически из вашего соединения.",
"GET": "ПОЛУЧИТЬ",
"POST": "ПОСТ",
"PATCH": "ПАТЧ",
"PUT": "ПОКУПИТЬ",
"DELETE": "УДАЛИТЬ",
"HEAD": "HEAD"
}

View File

@@ -0,0 +1,35 @@
{
"Automate image generation": "Automate image generation",
"Bannerbear API Key": "Bannerbear API Key",
"Create Image": "Create Image",
"Custom API Call": "Custom API Call",
"Create image from Bannerbear template": "Create image from Bannerbear template",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"Template": "Template",
"Template version": "Template version",
"Template modifications": "Template modifications",
"Transparent background": "Transparent background",
"Render a PDF": "Render a PDF",
"Metadata": "Metadata",
"Method": "Method",
"Headers": "Headers",
"Query Parameters": "Query Parameters",
"Body": "Body",
"Response is Binary ?": "Response is Binary ?",
"No Error on Failure": "No Error on Failure",
"Timeout (in seconds)": "Timeout (in seconds)",
"The template to use in image creation.": "The template to use in image creation.",
"Create image based on a specific version of the template.": "Create image based on a specific version of the template.",
"A list of modifications you want to make on the template.": "A list of modifications you want to make on the template.",
"Render a PNG with a transparent background. Default is false.": "Render a PNG with a transparent background. Default is false.",
"Render a PDF instead of a PNG. Default is false.": "Render a PDF instead of a PNG. Default is false.",
"Any metadata that you need to store e.g. ID of a record in your DB.": "Any metadata that you need to store e.g. ID of a record in your DB.",
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
"Enable for files like PDFs, images, etc..": "Enable for files like PDFs, images, etc..",
"GET": "GET",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "DELETE",
"HEAD": "HEAD"
}

View File

@@ -0,0 +1,34 @@
{
"Bannerbear": "Bannerbear",
"Automate image generation": "Automate image generation",
"Bannerbear API Key": "Bannerbear API Key",
"Create Image": "Create Image",
"Custom API Call": "Custom API Call",
"Create image from Bannerbear template": "Create image from Bannerbear template",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"Template": "Template",
"Template version": "Template version",
"Template modifications": "Template modifications",
"Transparent background": "Transparent background",
"Render a PDF": "Render a PDF",
"Metadata": "Metadata",
"Method": "Method",
"Headers": "Headers",
"Query Parameters": "Query Parameters",
"Body": "Body",
"No Error on Failure": "No Error on Failure",
"Timeout (in seconds)": "Timeout (in seconds)",
"The template to use in image creation.": "The template to use in image creation.",
"Create image based on a specific version of the template.": "Create image based on a specific version of the template.",
"A list of modifications you want to make on the template.": "A list of modifications you want to make on the template.",
"Render a PNG with a transparent background. Default is false.": "Render a PNG with a transparent background. Default is false.",
"Render a PDF instead of a PNG. Default is false.": "Render a PDF instead of a PNG. Default is false.",
"Any metadata that you need to store e.g. ID of a record in your DB.": "Any metadata that you need to store e.g. ID of a record in your DB.",
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
"GET": "GET",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "DELETE",
"HEAD": "HEAD"
}

View File

@@ -0,0 +1,35 @@
{
"Automate image generation": "Automate image generation",
"Bannerbear API Key": "Bannerbear API Key",
"Create Image": "Create Image",
"Custom API Call": "自定义 API 呼叫",
"Create image from Bannerbear template": "Create image from Bannerbear template",
"Make a custom API call to a specific endpoint": "将一个自定义 API 调用到一个特定的终点",
"Template": "模板",
"Template version": "Template version",
"Template modifications": "Template modifications",
"Transparent background": "Transparent background",
"Render a PDF": "Render a PDF",
"Metadata": "Metadata",
"Method": "方法",
"Headers": "信头",
"Query Parameters": "查询参数",
"Body": "正文内容",
"Response is Binary ?": "Response is Binary ?",
"No Error on Failure": "失败时没有错误",
"Timeout (in seconds)": "超时(秒)",
"The template to use in image creation.": "The template to use in image creation.",
"Create image based on a specific version of the template.": "Create image based on a specific version of the template.",
"A list of modifications you want to make on the template.": "A list of modifications you want to make on the template.",
"Render a PNG with a transparent background. Default is false.": "Render a PNG with a transparent background. Default is false.",
"Render a PDF instead of a PNG. Default is false.": "Render a PDF instead of a PNG. Default is false.",
"Any metadata that you need to store e.g. ID of a record in your DB.": "Any metadata that you need to store e.g. ID of a record in your DB.",
"Authorization headers are injected automatically from your connection.": "授权头自动从您的连接中注入。",
"Enable for files like PDFs, images, etc..": "Enable for files like PDFs, images, etc..",
"GET": "获取",
"POST": "帖子",
"PATCH": "PATCH",
"PUT": "弹出",
"DELETE": "删除",
"HEAD": "黑色"
}

View File

@@ -0,0 +1,32 @@
import { createCustomApiCallAction } from '@activepieces/pieces-common';
import { PieceAuth, createPiece } from '@activepieces/pieces-framework';
import { PieceCategory } from '@activepieces/shared';
import { bannerbearCreateImageAction } from './lib/actions/create-image';
export const bannerbearAuth = PieceAuth.SecretText({
displayName: 'API Key',
description: 'Bannerbear API Key',
required: true,
});
export const bannerbear = createPiece({
displayName: 'Bannerbear',
description: 'Automate image generation',
minimumSupportedRelease: '0.30.0',
logoUrl: 'https://cdn.activepieces.com/pieces/bannerbear.png',
categories: [PieceCategory.MARKETING],
authors: ["kishanprmr","MoShizzle","khaledmashaly","abuaboud"],
auth: bannerbearAuth,
actions: [
bannerbearCreateImageAction,
createCustomApiCallAction({
baseUrl: () => 'https://sync.api.bannerbear.com/v2',
auth: bannerbearAuth,
authMapping: async (auth) => ({
Authorization: `Bearer ${auth.secret_text}`,
}),
}),
],
triggers: [],
});

View File

@@ -0,0 +1,345 @@
import {
Property,
DynamicPropsValue,
createAction,
} from '@activepieces/pieces-framework';
import {
AuthenticationType,
httpClient,
HttpMethod,
HttpRequest,
} from '@activepieces/pieces-common';
import { bannerbearAuth } from '../../';
export const bannerbearCreateImageAction = createAction({
auth: bannerbearAuth,
name: 'bannerbear_create_image', // Must be a unique across the piece, this shouldn't be changed.
displayName: 'Create Image',
description: 'Create image from Bannerbear template',
props: {
template: Property.Dropdown({
auth: bannerbearAuth,
displayName: 'Template',
description: 'The template to use in image creation.',
required: true,
refreshers: [],
options: async ({ auth }) => {
if (!auth) {
return {
disabled: true,
options: [],
placeholder: 'Please enter your API key first.',
};
}
const response = await httpClient.sendRequest<BannerbearTemplate[]>({
method: HttpMethod.GET,
url: `https://api.bannerbear.com/v2/templates`,
authentication: {
type: AuthenticationType.BEARER_TOKEN,
token: auth.secret_text,
},
});
if (response.status === 200) {
return {
disabled: false,
options: response.body.map((template) => {
return {
label: template.name,
value: template,
};
}),
};
}
return {
disabled: true,
options: [],
placeholder: 'Error processing templates',
};
},
}),
template_version: Property.Number({
displayName: 'Template version',
description: 'Create image based on a specific version of the template.',
required: false,
}),
modifications: Property.DynamicProperties({
auth: bannerbearAuth,
displayName: 'Template modifications',
description: 'A list of modifications you want to make on the template.',
required: true,
refreshers: ['template'],
props: async ({ auth, template }) => {
if (!auth) return {};
if (!template) return {};
let fields: DynamicPropsValue = {};
(template as BannerbearTemplate).available_modifications.map(
(modification) => {
if ('text' in modification) {
fields = {
...BannerbearModificationsMapping.main,
...BannerbearModificationsMapping.text,
...BannerbearModificationsMapping.common,
};
} else if ('rating' in modification) {
fields = {
...BannerbearModificationsMapping.main,
...BannerbearModificationsMapping.star_rating,
...BannerbearModificationsMapping.common,
};
} else if ('image_url' in modification) {
fields = {
...BannerbearModificationsMapping.main,
...BannerbearModificationsMapping.image,
...BannerbearModificationsMapping.common,
};
} else if ('chart_data' in modification) {
fields = {
...BannerbearModificationsMapping.main,
...BannerbearModificationsMapping.barline_chart,
...BannerbearModificationsMapping.common,
};
} else if ('bar_code_data' in modification) {
fields = {
...BannerbearModificationsMapping.main,
...BannerbearModificationsMapping.bar_code,
...BannerbearModificationsMapping.common,
};
}
}
);
return fields;
},
}),
transparent: Property.Checkbox({
displayName: 'Transparent background',
description:
'Render a PNG with a transparent background. Default is false.',
required: false,
}),
render_pdf: Property.Checkbox({
displayName: 'Render a PDF',
description: 'Render a PDF instead of a PNG. Default is false.',
required: false,
}),
metadata: Property.LongText({
displayName: 'Metadata',
description:
'Any metadata that you need to store e.g. ID of a record in your DB.',
required: false,
}),
},
async run({ auth, propsValue }) {
const body = {
modifications:
Object.keys(propsValue.modifications).length === 0
? []
: [propsValue.modifications],
template_version: propsValue.template_version,
transparent: propsValue.transparent,
render_pdf: propsValue.render_pdf,
template: propsValue.template.uid,
metadata: propsValue.metadata,
};
const request: HttpRequest = {
method: HttpMethod.POST,
url: `https://sync.api.bannerbear.com/v2/images`,
body,
authentication: {
type: AuthenticationType.BEARER_TOKEN,
token: auth.secret_text,
},
};
const result = await httpClient.sendRequest<BannerbearTemplate>(request);
console.debug('Image creation complete', result);
if (result.status === 200 || result.status === 202) {
return result.body;
} else {
return result;
}
},
});
interface BannerbearTemplate {
created_at: string;
name: string;
self: string;
uid: string;
preview_url: number;
width: number;
height: number;
available_modifications: {
name: string;
image_url?: string;
text?: string;
chart_data: string;
bar_code_data: number;
rating: number;
}[];
tags: string[];
}
const BannerbearModificationsMapping = {
main: {
name: Property.ShortText({
displayName: 'Name',
required: true,
description: 'The name of the layer you want to change.',
}),
color: Property.ShortText({
displayName: 'Color',
required: false,
description: 'Color in hex format e.g. "#FF0000".',
}),
},
common: {
gradient: Property.ShortText({
displayName: 'Gradient',
required: false,
description: 'Fill with gradient e.g. ["#000", "#FFF"]',
}),
border_width: Property.Number({
displayName: 'Border width',
required: false,
description: 'Width of the object border.',
}),
border_color: Property.ShortText({
displayName: 'Border color',
required: false,
description: 'Border color in hex format e.g. "#FF0000".',
}),
shift_x: Property.Number({
displayName: 'Shift x',
required: false,
description: 'Shift layer along the x axis.',
}),
shift_y: Property.Number({
displayName: 'Shift y',
required: false,
description: 'Shift layer along the y axis.',
}),
target: Property.ShortText({
displayName: 'Target',
required: false,
description:
'Add a clickable link to a URL on this object when rendering a PDF.',
}),
hide: Property.Checkbox({
displayName: 'Hide',
required: false,
description: 'Set to true to hide a layer.',
}),
},
text: {
text: Property.ShortText({
displayName: 'Text',
required: false,
description: 'Replacement text you want to use.',
}),
background: Property.ShortText({
displayName: 'Background',
required: false,
description: 'Background color in hex format e.g. "#FF0000".',
}),
font_family: Property.ShortText({
displayName: 'Font family',
required: false,
description: 'Change the font.',
}),
text_align_h: Property.ShortText({
displayName: 'Text align H',
required: false,
description: 'Horizontal alignment (left, center, right)',
}),
text_align_v: Property.ShortText({
displayName: 'Text align V',
required: false,
description: 'Vertical alignment (top, center, bottom)',
}),
font_family_2: Property.ShortText({
displayName: 'Font family 2',
required: false,
description: 'Change the secondary font.',
}),
color_2: Property.ShortText({
displayName: 'Color 2',
required: false,
description: 'Change the secondary font color.',
}),
},
image: {
image_url: Property.ShortText({
displayName: 'Image url',
required: false,
description: 'Change the image.',
}),
effect: Property.ShortText({
displayName: 'Effect',
required: false,
description: 'Change the effect.',
}),
anchor_x: Property.ShortText({
displayName: 'Anchor x',
required: false,
description: 'Change the anchor point (left, center, right)',
}),
anchor_y: Property.ShortText({
displayName: 'Anchor y',
required: false,
description: 'Change the anchor point (top, center, bottom).',
}),
fill_type: Property.ShortText({
displayName: 'Fill type',
required: false,
description: 'Change the fill type (fill, fit).',
}),
disable_face_detect: Property.Checkbox({
displayName: 'Disable face detect',
required: false,
description:
'Set to true to disable face detect for this request (if the image container is using face detect).',
}),
disable_smart_crop: Property.Checkbox({
displayName: 'Disable smart crop',
required: false,
description:
'Set to true to disable smart crop for this request (if the image container is using smart crop)',
}),
},
barline_chart: {
chart_data: Property.ShortText({
displayName: 'Chart data',
required: false,
description: 'Comma-delimited list of numbers to use as data.',
}),
},
star_rating: {
rating: Property.Number({
displayName: 'Rating',
required: false,
description: 'Number from 0 to 100 to use as the rating.',
}),
},
qr_code: {
target: Property.ShortText({
displayName: 'Target',
required: false,
description: 'URL or text to use as the code target.',
}),
},
bar_code: {
bar_code_data: Property.ShortText({
displayName: 'Barcode data',
required: false,
description: 'Text to encode as a bar code.',
}),
},
};