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,18 @@
{
"extends": ["../../../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
}

View File

@@ -0,0 +1,7 @@
# pieces-asana
This library was generated with [Nx](https://nx.dev).
## Running lint
Run `nx lint pieces-asana` to execute the lint via [ESLint](https://eslint.org/).

View File

@@ -0,0 +1,4 @@
{
"name": "@activepieces/piece-asana",
"version": "0.3.11"
}

View File

@@ -0,0 +1,51 @@
{
"name": "pieces-asana",
"$schema": "../../../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "packages/pieces/community/asana/src",
"projectType": "library",
"targets": {
"build": {
"executor": "@nx/js:tsc",
"outputs": [
"{options.outputPath}"
],
"options": {
"outputPath": "dist/packages/pieces/community/asana",
"tsConfig": "packages/pieces/community/asana/tsconfig.lib.json",
"packageJson": "packages/pieces/community/asana/package.json",
"main": "packages/pieces/community/asana/src/index.ts",
"assets": [
"packages/pieces/community/asana/*.md",
{
"input": "packages/pieces/community/asana/src/i18n",
"output": "./src/i18n",
"glob": "**/!(i18n.json)"
}
],
"buildableProjectDepsInPackageJsonType": "dependencies",
"updateBuildableProjectDepsInPackageJson": true
},
"dependsOn": [
"^build",
"prebuild"
]
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": [
"{options.outputFile}"
]
},
"prebuild": {
"executor": "nx:run-commands",
"options": {
"cwd": "packages/pieces/community/asana",
"command": "bun install --no-save --silent"
},
"dependsOn": [
"^build"
]
}
},
"tags": []
}

View File

@@ -0,0 +1,35 @@
{
"Asana": "Asana",
"Work management platform designed to help teams organize, track, and manage their work.": "Work management platform designed to help teams organize, track, and manage their work.",
"Create Task": "Create Task",
"Custom API Call": "Custom API Call",
"Create a new task": "Create a new task",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"Workspace": "Workspace",
"Project": "Project",
"Task Name": "Task Name",
"Task Description": "Task Description",
"Due Date": "Due Date",
"Tags": "Tags",
"Assignee": "Assignee",
"Method": "Method",
"Headers": "Headers",
"Query Parameters": "Query Parameters",
"Body": "Body",
"No Error on Failure": "No Error on Failure",
"Timeout (in seconds)": "Timeout (in seconds)",
"Asana workspace to create the task in": "Asana workspace to create the task in",
"Asana Project to create the task in": "Asana Project to create the task in",
"The name of the task to create": "The name of the task to create",
"Free-form textual information associated with the task (i.e. its description).": "Free-form textual information associated with the task (i.e. its description).",
"The date on which this task is due in any format.": "The date on which this task is due in any format.",
"Tags to add to the task": "Tags to add to the task",
"Assignee for the task": "Assignee for the task",
"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,36 @@
{
"Work management platform designed to help teams organize, track, and manage their work.": "Work-Management-Plattform entwickelt, um Teams zu helfen, ihre Arbeit zu organisieren, zu verfolgen und zu verwalten.",
"Create Task": "Aufgabe erstellen",
"Custom API Call": "Eigener API-Aufruf",
"Create a new task": "Neue Aufgabe erstellen",
"Make a custom API call to a specific endpoint": "Einen benutzerdefinierten API-Aufruf an einen bestimmten Endpunkt machen",
"Workspace": "Arbeitsbereich",
"Project": "Projekt",
"Task Name": "Aufgabenname",
"Task Description": "Aufgabenbeschreibung",
"Due Date": "Fälligkeitsdatum",
"Tags": "Tags",
"Assignee": "Assignee",
"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)",
"Asana workspace to create the task in": "Asana Arbeitsbereich zum Erstellen der Aufgabe in",
"Asana Project to create the task in": "Asana Projekt zum Erstellen der Aufgabe in",
"The name of the task to create": "Der Name der zu erstellenden Aufgabe",
"Free-form textual information associated with the task (i.e. its description).": "Free-form textuelle Informationen, die mit der Aufgabe verbunden sind (d.h. deren Beschreibung).",
"The date on which this task is due in any format.": "Das Datum, an dem diese Aufgabe in jedem Format fällig ist.",
"Tags to add to the task": "Tags zum Hinzufügen der Aufgabe",
"Assignee for the task": "Beauftragter für die Aufgabe",
"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,36 @@
{
"Work management platform designed to help teams organize, track, and manage their work.": "Plataforma de gestión de trabajo diseñada para ayudar a los equipos a organizar, rastrear y gestionar su trabajo.",
"Create Task": "Crear tarea",
"Custom API Call": "Llamada API personalizada",
"Create a new task": "Crear una nueva tarea",
"Make a custom API call to a specific endpoint": "Hacer una llamada API personalizada a un extremo específico",
"Workspace": "Espacio de trabajo",
"Project": "Projekt",
"Task Name": "Nombre de tarea",
"Task Description": "Descripción de la tarea",
"Due Date": "Fecha de fin",
"Tags": "Etiquetas",
"Assignee": "Assignee",
"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)",
"Asana workspace to create the task in": "Área de trabajo de Asana en la que crear la tarea",
"Asana Project to create the task in": "Proyecto Asana para crear la tarea en",
"The name of the task to create": "El nombre de la tarea a crear",
"Free-form textual information associated with the task (i.e. its description).": "Información textual de forma libre asociada a la tarea (es decir, su descripción).",
"The date on which this task is due in any format.": "La fecha en la que esta tarea se debe en cualquier formato.",
"Tags to add to the task": "Etiquetas a añadir a la tarea",
"Assignee for the task": "Asignado para la tarea",
"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,36 @@
{
"Work management platform designed to help teams organize, track, and manage their work.": "Plateforme de gestion du travail conçue pour aider les équipes à organiser, suivre et gérer leur travail.",
"Create Task": "Créer une tâche",
"Custom API Call": "Appel d'API personnalisé",
"Create a new task": "Créer une nouvelle tâche",
"Make a custom API call to a specific endpoint": "Passer un appel API personnalisé à un endpoint spécifique",
"Workspace": "Espace de travail",
"Project": "Projet",
"Task Name": "Nom de la tâche",
"Task Description": "Description de tâche",
"Due Date": "Date de fin",
"Tags": "Tags",
"Assignee": "Assignee",
"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)",
"Asana workspace to create the task in": "Espace de travail Asana pour créer la tâche dans",
"Asana Project to create the task in": "Asana Projet pour créer la tâche dans",
"The name of the task to create": "Le nom de la tâche à créer",
"Free-form textual information associated with the task (i.e. its description).": "Information textuelle libre associée à la tâche (c'est-à-dire sa description).",
"The date on which this task is due in any format.": "La date à laquelle cette tâche est due dans n'importe quel format.",
"Tags to add to the task": "Tags à ajouter à la tâche",
"Assignee for the task": "Responsable de la tâche",
"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 @@
{
"Asana": "Asana",
"Work management platform designed to help teams organize, track, and manage their work.": "Work management platform designed to help teams organize, track, and manage their work.",
"Create Task": "Create Task",
"Custom API Call": "Custom API Call",
"Create a new task": "Create a new task",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"Workspace": "Workspace",
"Project": "Project",
"Task Name": "Task Name",
"Task Description": "Task Description",
"Due Date": "Due Date",
"Tags": "Tags",
"Assignee": "Assignee",
"Method": "Method",
"Headers": "Headers",
"Query Parameters": "Query Parameters",
"Body": "Body",
"No Error on Failure": "No Error on Failure",
"Timeout (in seconds)": "Timeout (in seconds)",
"Asana workspace to create the task in": "Asana workspace to create the task in",
"Asana Project to create the task in": "Asana Project to create the task in",
"The name of the task to create": "The name of the task to create",
"Free-form textual information associated with the task (i.e. its description).": "Free-form textual information associated with the task (i.e. its description).",
"The date on which this task is due in any format.": "The date on which this task is due in any format.",
"Tags to add to the task": "Tags to add to the task",
"Assignee for the task": "Assignee for the task",
"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 @@
{
"Asana": "Asana",
"Work management platform designed to help teams organize, track, and manage their work.": "Work management platform designed to help teams organize, track, and manage their work.",
"Create Task": "Create Task",
"Custom API Call": "Custom API Call",
"Create a new task": "Create a new task",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"Workspace": "Workspace",
"Project": "Project",
"Task Name": "Task Name",
"Task Description": "Task Description",
"Due Date": "Due Date",
"Tags": "Tags",
"Assignee": "Assignee",
"Method": "Method",
"Headers": "Headers",
"Query Parameters": "Query Parameters",
"Body": "Body",
"No Error on Failure": "No Error on Failure",
"Timeout (in seconds)": "Timeout (in seconds)",
"Asana workspace to create the task in": "Asana workspace to create the task in",
"Asana Project to create the task in": "Asana Project to create the task in",
"The name of the task to create": "The name of the task to create",
"Free-form textual information associated with the task (i.e. its description).": "Free-form textual information associated with the task (i.e. its description).",
"The date on which this task is due in any format.": "The date on which this task is due in any format.",
"Tags to add to the task": "Tags to add to the task",
"Assignee for the task": "Assignee for the task",
"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,36 @@
{
"Work management platform designed to help teams organize, track, and manage their work.": "チームが作業を整理、追跡、管理できるように設計された作業管理プラットフォームです。",
"Create Task": "タスクを作成",
"Custom API Call": "カスタムAPI通話",
"Create a new task": "新しいタスクを作成",
"Make a custom API call to a specific endpoint": "特定のエンドポイントへのカスタム API コールを実行します。",
"Workspace": "ワークスペース",
"Project": "プロジェクト",
"Task Name": "タスク名",
"Task Description": "タスクの説明",
"Due Date": "締切日",
"Tags": "タグ",
"Assignee": "Assignee",
"Method": "方法",
"Headers": "ヘッダー",
"Query Parameters": "クエリパラメータ",
"Body": "本文",
"Response is Binary ?": "応答はバイナリですか?",
"No Error on Failure": "失敗時にエラーはありません",
"Timeout (in seconds)": "タイムアウト(秒)",
"Asana workspace to create the task in": "タスクを作成するAsana ワークスペース",
"Asana Project to create the task in": "タスクを作成するAsana プロジェクト",
"The name of the task to create": "作成するタスクの名前",
"Free-form textual information associated with the task (i.e. its description).": "タスクに関連付けられたフリーフォームのテキスト情報(すなわち、その説明)。",
"The date on which this task is due in any format.": "このタスクが期日を任意の形式で指定します。",
"Tags to add to the task": "タスクに追加するタグ",
"Assignee for the task": "タスクの担当者",
"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,36 @@
{
"Work management platform designed to help teams organize, track, and manage their work.": "Werken platform ontworpen om teams te helpen hun werk te organiseren, te volgen en te beheren.",
"Create Task": "Taak maken",
"Custom API Call": "Custom API Call",
"Create a new task": "Een nieuwe taak aanmaken",
"Make a custom API call to a specific endpoint": "Maak een aangepaste API call naar een specifiek eindpunt",
"Workspace": "werkruimte",
"Project": "Project",
"Task Name": "Taak naam",
"Task Description": "Beschrijving taak",
"Due Date": "Inleverdatum",
"Tags": "Labels",
"Assignee": "Assignee",
"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)",
"Asana workspace to create the task in": "Asana workspace om een taak aan te maken in",
"Asana Project to create the task in": "Asana project om de taak aan te maken in",
"The name of the task to create": "De naam van de taak te maken",
"Free-form textual information associated with the task (i.e. its description).": "Vrije tekstuele informatie die is gekoppeld aan de taak (d.w.z. de beschrijving).",
"The date on which this task is due in any format.": "De datum waarop deze taak in elke notatie vervalt",
"Tags to add to the task": "Tags om toe te voegen aan de taak",
"Assignee for the task": "Toegewezen voor de taak",
"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,36 @@
{
"Work management platform designed to help teams organize, track, and manage their work.": "Plataforma de gestão de trabalho projetada para ajudar as equipes a organizar, acompanhar e gerenciar seu trabalho.",
"Create Task": "Criar tarefa",
"Custom API Call": "Chamada de API personalizada",
"Create a new task": "Criar uma nova tarefa",
"Make a custom API call to a specific endpoint": "Faça uma chamada de API personalizada para um ponto de extremidade específico",
"Workspace": "Workspace",
"Project": "Projecto",
"Task Name": "Nome da tarefa",
"Task Description": "Descrição da tarefa",
"Due Date": "Data de vencimento",
"Tags": "Etiquetas",
"Assignee": "Assignee",
"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)",
"Asana workspace to create the task in": "Espaço de trabalho de Asana para criar a tarefa",
"Asana Project to create the task in": "Projeto Asana para criar a tarefa em",
"The name of the task to create": "O nome da tarefa a criar",
"Free-form textual information associated with the task (i.e. its description).": "Informações de texto de forma livre associadas à tarefa (por exemplo, sua descrição).",
"The date on which this task is due in any format.": "A data em que esta tarefa expira em qualquer formato.",
"Tags to add to the task": "Tags a serem adicionadas à tarefa",
"Assignee for the task": "Atribuído para a tarefa",
"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,35 @@
{
"Asana": "Asana",
"Work management platform designed to help teams organize, track, and manage their work.": "Платформа управления работой, предназначенная для того, чтобы помочь командам организовать, отслеживать и управлять своей работой.",
"Create Task": "Создать задачу",
"Custom API Call": "Пользовательский вызов API",
"Create a new task": "Создать новую задачу",
"Make a custom API call to a specific endpoint": "Сделать пользовательский API вызов к определенной конечной точке",
"Workspace": "Рабочая область",
"Project": "Проект",
"Task Name": "Название задачи",
"Task Description": "Описание задачи",
"Due Date": "Срок сдачи",
"Tags": "Теги",
"Assignee": "Assignee",
"Method": "Метод",
"Headers": "Заголовки",
"Query Parameters": "Параметры запроса",
"Body": "Тело",
"No Error on Failure": "Нет ошибок при ошибке",
"Timeout (in seconds)": "Таймаут (в секундах)",
"Asana workspace to create the task in": "Асана рабочая область для создания задачи в",
"Asana Project to create the task in": "Асана Проект для создания задачи в",
"The name of the task to create": "Имя создаваемой задачи",
"Free-form textual information associated with the task (i.e. its description).": "Текстовая информация, связанная с задачей (т. е. ее описание).",
"The date on which this task is due in any format.": "Дата выполнения этой задачи в любом формате.",
"Tags to add to the task": "Теги для добавления к задаче",
"Assignee for the task": "Назначен для задачи",
"Authorization headers are injected automatically from your connection.": "Заголовки авторизации включаются автоматически из вашего соединения.",
"GET": "ПОЛУЧИТЬ",
"POST": "ПОСТ",
"PATCH": "ПАТЧ",
"PUT": "ПОКУПИТЬ",
"DELETE": "УДАЛИТЬ",
"HEAD": "HEAD"
}

View File

@@ -0,0 +1,36 @@
{
"Work management platform designed to help teams organize, track, and manage their work.": "Work management platform designed to help teams organize, track, and manage their work.",
"Create Task": "Create Task",
"Custom API Call": "Custom API Call",
"Create a new task": "Create a new task",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"Workspace": "Workspace",
"Project": "Project",
"Task Name": "Task Name",
"Task Description": "Task Description",
"Due Date": "Due Date",
"Tags": "Tags",
"Assignee": "Assignee",
"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)",
"Asana workspace to create the task in": "Asana workspace to create the task in",
"Asana Project to create the task in": "Asana Project to create the task in",
"The name of the task to create": "The name of the task to create",
"Free-form textual information associated with the task (i.e. its description).": "Free-form textual information associated with the task (i.e. its description).",
"The date on which this task is due in any format.": "The date on which this task is due in any format.",
"Tags to add to the task": "Tags to add to the task",
"Assignee for the task": "Assignee for the task",
"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,35 @@
{
"Asana": "Asana",
"Work management platform designed to help teams organize, track, and manage their work.": "Work management platform designed to help teams organize, track, and manage their work.",
"Create Task": "Create Task",
"Custom API Call": "Custom API Call",
"Create a new task": "Create a new task",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"Workspace": "Workspace",
"Project": "Project",
"Task Name": "Task Name",
"Task Description": "Task Description",
"Due Date": "Due Date",
"Tags": "Tags",
"Assignee": "Assignee",
"Method": "Method",
"Headers": "Headers",
"Query Parameters": "Query Parameters",
"Body": "Body",
"No Error on Failure": "No Error on Failure",
"Timeout (in seconds)": "Timeout (in seconds)",
"Asana workspace to create the task in": "Asana workspace to create the task in",
"Asana Project to create the task in": "Asana Project to create the task in",
"The name of the task to create": "The name of the task to create",
"Free-form textual information associated with the task (i.e. its description).": "Free-form textual information associated with the task (i.e. its description).",
"The date on which this task is due in any format.": "The date on which this task is due in any format.",
"Tags to add to the task": "Tags to add to the task",
"Assignee for the task": "Assignee for the task",
"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,36 @@
{
"Work management platform designed to help teams organize, track, and manage their work.": "Work management platform designed to help teams organize, track, and manage their work.",
"Create Task": "Create Task",
"Custom API Call": "自定义 API 呼叫",
"Create a new task": "Create a new task",
"Make a custom API call to a specific endpoint": "将一个自定义 API 调用到一个特定的终点",
"Workspace": "Workspace",
"Project": "项目",
"Task Name": "Task Name",
"Task Description": "Task Description",
"Due Date": "Due Date",
"Tags": "标签",
"Assignee": "Assignee",
"Method": "方法",
"Headers": "信头",
"Query Parameters": "查询参数",
"Body": "正文内容",
"Response is Binary ?": "Response is Binary ?",
"No Error on Failure": "失败时没有错误",
"Timeout (in seconds)": "超时(秒)",
"Asana workspace to create the task in": "Asana workspace to create the task in",
"Asana Project to create the task in": "Asana Project to create the task in",
"The name of the task to create": "The name of the task to create",
"Free-form textual information associated with the task (i.e. its description).": "Free-form textual information associated with the task (i.e. its description).",
"The date on which this task is due in any format.": "The date on which this task is due in any format.",
"Tags to add to the task": "Tags to add to the task",
"Assignee for the task": "Assignee for the task",
"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,37 @@
import { createCustomApiCallAction } from '@activepieces/pieces-common';
import {
OAuth2PropertyValue,
PieceAuth,
createPiece,
} from '@activepieces/pieces-framework';
import { PieceCategory } from '@activepieces/shared';
import { asanaCreateTaskAction } from './lib/actions/create-task';
export const asanaAuth = PieceAuth.OAuth2({
description: '',
authUrl: 'https://app.asana.com/-/oauth_authorize',
tokenUrl: 'https://app.asana.com/-/oauth_token',
required: true,
scope: ['default'],
});
export const asana = createPiece({
displayName: 'Asana',
description: "Work management platform designed to help teams organize, track, and manage their work.",
minimumSupportedRelease: '0.30.0',
logoUrl: 'https://cdn.activepieces.com/pieces/asana.png',
categories: [PieceCategory.PRODUCTIVITY],
authors: ["ShayPunter","kishanprmr","MoShizzle","khaledmashaly","abuaboud"],
auth: asanaAuth,
actions: [
asanaCreateTaskAction,
createCustomApiCallAction({
baseUrl: () => `https://app.asana.com/api/1.0`,
auth: asanaAuth,
authMapping: async (auth) => ({
Authorization: `Bearer ${(auth as OAuth2PropertyValue).access_token}`,
}),
}),
],
triggers: [],
});

View File

@@ -0,0 +1,82 @@
import { asanaCommon, callAsanaApi, getTags } from '../common';
import { getAccessTokenOrThrow, HttpMethod } from '@activepieces/pieces-common';
import dayjs from 'dayjs';
import { asanaAuth } from '../../';
import { Property, createAction } from '@activepieces/pieces-framework';
export const asanaCreateTaskAction = createAction({
auth: asanaAuth,
name: 'create_task',
description: 'Create a new task',
displayName: 'Create Task',
props: {
workspace: asanaCommon.workspace,
project: asanaCommon.project,
name: Property.ShortText({
description: 'The name of the task to create',
displayName: 'Task Name',
required: true,
}),
notes: Property.LongText({
description:
'Free-form textual information associated with the task (i.e. its description).',
displayName: 'Task Description',
required: true,
}),
//Should be due_at in future minor version bump
due_on: Property.ShortText({
description: 'The date on which this task is due in any format.',
displayName: 'Due Date',
required: false,
}),
tags: asanaCommon.tags,
assignee: asanaCommon.assignee,
},
async run(configValue) {
const { auth } = configValue;
const { project, name, notes, tags, workspace, due_on, assignee } =
configValue.propsValue;
const convertedDueAt = due_on ? dayjs(due_on).toISOString() : undefined;
// User can provide tags name as dynamic value, we need to convert them to tags gids
const userTags = tags ?? [];
const convertedTags = await getTags(auth.access_token, workspace);
const tagsGids = userTags
.map((tag: string) => {
const foundTagById = convertedTags.find(
(convertedTag) => convertedTag.gid === tag
);
if (foundTagById) {
return foundTagById.gid;
}
const foundTag = convertedTags.find(
(convertedTag) =>
convertedTag.name?.toLowerCase() === tag.toLowerCase()
);
if (foundTag) {
return foundTag.gid;
}
return null;
})
.filter((tag) => tag !== null);
return (
await callAsanaApi(
HttpMethod.POST,
`tasks`,
getAccessTokenOrThrow(auth),
{
data: {
name,
projects: [project],
notes,
assignee,
due_at: convertedDueAt,
tags: tagsGids,
},
}
)
).body['data'];
},
});

View File

@@ -0,0 +1,223 @@
import { Property, OAuth2PropertyValue } from '@activepieces/pieces-framework';
import {
getAccessTokenOrThrow,
HttpMethod,
HttpMessageBody,
HttpResponse,
httpClient,
AuthenticationType,
} from '@activepieces/pieces-common';
import { asanaAuth } from '../..';
export const asanaCommon = {
workspace: Property.Dropdown({
auth: asanaAuth,
description: 'Asana workspace to create the task in',
displayName: 'Workspace',
required: true,
refreshers: [],
options: async ({ auth }) => {
if (!auth) {
return {
disabled: true,
placeholder: 'connect your account first',
options: [],
};
}
const accessToken = getAccessTokenOrThrow(auth as OAuth2PropertyValue);
const response = (
await callAsanaApi<{
data: {
gid: string;
name: string;
}[];
}>(HttpMethod.GET, 'workspaces', accessToken, undefined)
).body;
return {
disabled: false,
options: response.data.map((workspace) => {
return {
label: workspace.name,
value: workspace.gid,
};
}),
};
},
}),
project: Property.Dropdown({
auth: asanaAuth,
description: 'Asana Project to create the task in',
displayName: 'Project',
required: true,
refreshers: ['workspace'],
options: async ({ auth, workspace }) => {
if (!auth) {
return {
disabled: true,
placeholder: 'connect your account first',
options: [],
};
}
if (!workspace) {
return {
disabled: true,
placeholder: 'Select workspace first',
options: [],
};
}
const accessToken = getAccessTokenOrThrow(auth as OAuth2PropertyValue);
const response = (
await callAsanaApi<{
data: {
gid: string;
name: string;
}[];
}>(
HttpMethod.GET,
'projects?workspace=' + workspace,
accessToken,
undefined
)
).body;
return {
disabled: false,
options: response.data.map((project) => {
return {
label: project.name,
value: project.gid,
};
}),
};
},
}),
assignee: Property.Dropdown<string,false,typeof asanaAuth>({
auth: asanaAuth,
description: 'Assignee for the task',
displayName: 'Assignee',
required: false,
refreshers: ['workspace'],
options: async ({ auth, workspace }) => {
if (!auth) {
return {
disabled: true,
placeholder: 'connect your account first',
options: [],
};
}
if (!workspace) {
return {
disabled: true,
placeholder: 'Select workspace first',
options: [],
};
}
const accessToken = getAccessTokenOrThrow(auth as OAuth2PropertyValue);
const users = await getUsers(accessToken, workspace as string);
return {
disabled: false,
options: users.map((user) => {
return {
label: user.name,
value: user.gid,
};
}),
};
},
}),
tags: Property.MultiSelectDropdown<string,false,typeof asanaAuth>({
auth: asanaAuth,
description: 'Tags to add to the task',
displayName: 'Tags',
required: false,
refreshers: ['workspace'],
options: async ({ auth, workspace }) => {
if (!auth) {
return {
disabled: true,
placeholder: 'connect your account first',
options: [],
};
}
if (!workspace) {
return {
disabled: true,
placeholder: 'Select workspace first',
options: [],
};
}
const accessToken = getAccessTokenOrThrow(auth as OAuth2PropertyValue);
const response = await getTags(accessToken, workspace as string);
return {
disabled: false,
options: response.map((project) => {
return {
label: project.name,
value: project.gid,
};
}),
};
},
}),
};
export async function getUsers(
accessToken: string,
workspace: string
): Promise<
{
gid: string;
name: string;
}[]
> {
const response = (
await callAsanaApi<{
data: {
gid: string;
name: string;
}[];
}>(HttpMethod.GET, 'users?workspace=' + workspace, accessToken, undefined)
).body;
return response.data;
}
export async function getTags(
accessToken: string,
workspace: string
): Promise<
{
gid: string;
name: string;
}[]
> {
const response = (
await callAsanaApi<{
data: {
gid: string;
name: string;
}[];
}>(
HttpMethod.GET,
'workspaces/' + workspace + '/tags',
accessToken,
undefined
)
).body;
return response.data;
}
export async function callAsanaApi<T extends HttpMessageBody = any>(
method: HttpMethod,
apiUrl: string,
accessToken: string,
body: any | undefined
): Promise<HttpResponse<T>> {
return await httpClient.sendRequest<T>({
method: method,
url: `https://app.asana.com/api/1.0/${apiUrl}`,
authentication: {
type: AuthenticationType.BEARER_TOKEN,
token: accessToken,
},
body: body,
});
}

View File

@@ -0,0 +1,16 @@
{
"extends": "../../../../tsconfig.base.json",
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
}
],
"compilerOptions": {
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
}
}

View File

@@ -0,0 +1,11 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"outDir": "../../../../dist/out-tsc",
"declaration": true,
"types": ["node"]
},
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"],
"include": ["src/**/*.ts"]
}