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

View File

@@ -0,0 +1,7 @@
# pieces-microsoft-power-bi
This library was generated with [Nx](https://nx.dev).
## Building
Run `nx build pieces-microsoft-power-bi` to build the library.

View File

@@ -0,0 +1,6 @@
{
"name": "@activepieces/piece-microsoft-power-bi",
"version": "0.0.13",
"icon": "https://raw.githubusercontent.com/microsoft/PowerBI-Icons/main/SVG/Power-BI.svg",
"author": "calladodan"
}

View File

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

View File

@@ -0,0 +1,42 @@
{
"Create and manage Power BI datasets and push data to them": "Erstellen und verwalten von Power BI-Datensätzen und Push-Daten",
"\n1. Sign in to [Microsoft Azure Portal](https://portal.azure.com/).\n2. From the left sidebar, go to **Microsoft Enfra ID**.\n3. Under **Manage**, click on **App registrations**.\n4. Click the **New registration** button.\n5. Enter a **Name** for your app.\n6. For **Supported account types**, choose:\n - **Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts**\n - Or select based on your requirement.\n7. In **Redirect URI**, select **Web** and ad": "\n1. Melden Sie sich bei [Microsoft Azure Portal](https://portal.azure.com/).\n. Von der linken Seitenleiste gehen Sie zur **Microsoft Enfra ID**.\n3. Unter **Verwalten** klicken Sie auf **App-Registrierungen**.\n4. Klicken Sie auf die **Neue Registrierung** Schaltfläche.\n5. Geben Sie einen **Name** für Ihre App ein.\n6. Für **unterstützte Kontotypen**, auswählen:\n - **Konten in jedem Organisationsverzeichnis (jeder Microsoft-Entra-ID-Mieter - Multitenant) und persönlichen Microsoft-Konten**\n - Oder wählen Sie nach Ihren Anforderungen aus.\n7. In **Umleitungs-URI** wählen Sie **Web** und fügen Sie die angegebene URL hinzu.\n8. Klicken Sie auf **Registrieren**.\n9. Nach der Registrierung werden Sie zur Übersichtsseite der App weitergeleitet. Kopieren Sie die **Application (Client) ID**.\n10. Vom linken Menü gehen Sie zu **Zertifikate & Geheimnisse**.\n - Unter **Kundengeheimnis**, klicke **Neues Kundengeheimnis**.\n - Geben Sie eine Beschreibung an, setzen Sie ein Ablaufdatum und klicken Sie auf **Hinzufügen**.\n - Kopieren Sie den **Wert** des Client-Geheimnisses (dies wird nicht wieder angezeigt).\n11. Gehe zu **API-Berechtigungen** vom linken Menü.\n - Klicke auf **Berechtigung hinzufügen**.\n - Wähle **Power BI Service** → **Delegierte Berechtigungen**.\n - Fügen Sie folgende Bereiche hinzu:\n\t - Dataset. eadWrite.All\n\t - offline_access \n - Klicken Sie auf **Berechtigungen hinzufügen**.\n12. Kopieren Sie Ihre **Client-ID** und **Client-Geheimnis**.\n",
"Create Dataset": "Datensatz erstellen",
"Push Rows to Dataset Table": "Zeilen an Datensatztabelle schieben",
"Custom API Call": "Eigener API-Aufruf",
"Create a new dataset in Power BI with custom schema (Push, Streaming, or PushStreaming mode).": "Erstellen Sie einen neuen Datensatz im Power BI mit benutzerdefiniertem Schema (Push, Streaming oder PushStreaming).",
"Add rows to a table in a Power BI dataset (supports Push, Streaming, and PushStreaming modes)": "Fügen Sie Zeilen in einem Power BI-Datensatz zu einer Tabelle hinzu (unterstützt Push, Streaming und PushStreaming)",
"Make a custom API call to a specific endpoint": "Einen benutzerdefinierten API-Aufruf an einen bestimmten Endpunkt machen",
"Dataset Name": "Datensatzname",
"Dataset Mode": "Dataset-Modus",
"Tables": "Tabellen",
"Dataset": "Dataset",
"Table": "Tisch",
"Rows": "Zeilen",
"Skip Dataset Refresh": "Daten-Aktualisierung überspringen",
"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)",
"Name of the dataset to create": "Name des zu erstellenden Datensatzes",
"The mode of the dataset": "Der Modus des Datensatzes",
"Define the tables and their columns for the dataset (JSON format)": "Definieren Sie die Tabellen und ihre Spalten für den Datensatz (JSON-Format)",
"Select a dataset.": "Wählen Sie einen Datensatz.",
"Select a table": "Tabelle auswählen",
"JSON object containing the rows to add to the table. Each row must match your table schema.": "JSON-Objekt, das die Zeilen enthält, die zur Tabelle hinzugefügt werden sollen. Jede Zeile muss Ihrem Tabellenschema entsprechen.",
"Skip refreshing the dataset after pushing data (only applies to Push and PushStreaming modes)": "Aktualisieren des Datensatzes nach dem Hochladen der Daten überspringen (gilt nur für PushStreaming- und PushStreaming-Modus)",
"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..",
"Push": "Push",
"Streaming": "Streaming",
"PushStreaming": "PushStreaming",
"GET": "ERHALTEN",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "LÖSCHEN",
"HEAD": "HEAD"
}

View File

@@ -0,0 +1,42 @@
{
"Create and manage Power BI datasets and push data to them": "Crear y administrar conjuntos de datos Power BI y enviarles datos",
"\n1. Sign in to [Microsoft Azure Portal](https://portal.azure.com/).\n2. From the left sidebar, go to **Microsoft Enfra ID**.\n3. Under **Manage**, click on **App registrations**.\n4. Click the **New registration** button.\n5. Enter a **Name** for your app.\n6. For **Supported account types**, choose:\n - **Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts**\n - Or select based on your requirement.\n7. In **Redirect URI**, select **Web** and ad": "\n1. Sign in to [Microsoft Azure Portal](https://portal.azure.com/).\n2. From the left sidebar, go to **Microsoft Enfra ID**.\n3. Under **Manage**, click on **App registrations**.\n4. Click the **New registration** button.\n5. Enter a **Name** for your app.\n6. For **Supported account types**, choose:\n - **Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts**\n - Or select based on your requirement.\n7. In **Redirect URI**, select **Web** and add the given URL.\n8. Click **Register**.\n9. After registration, youll be redirected to the apps overview page. Copy the **Application (client) ID**.\n10. From the left menu, go to **Certificates & secrets**.\n - Under **Client secrets**, click **New client secret**.\n - Provide a description, set an expiry, and click **Add**.\n - Copy the **Value** of the client secret (this will not be shown again).\n11. Go to **API permissions** from the left menu.\n - Click **Add a permission**.\n - Select **Power BI Service** → **Delegated permissions**.\n - Add the following scopes:\n\t - Dataset.ReadWrite.All\n\t - offline_access\n - Click **Add permissions**.\n12. Copy your **Client ID** and **Client Secret**.\n",
"Create Dataset": "Crear conjunto de datos",
"Push Rows to Dataset Table": "Enviar filas a tabla de datos",
"Custom API Call": "Llamada API personalizada",
"Create a new dataset in Power BI with custom schema (Push, Streaming, or PushStreaming mode).": "Crear un nuevo conjunto de datos en Power BI con esquema personalizado (modo Push, Streaming o PushStreaming).",
"Add rows to a table in a Power BI dataset (supports Push, Streaming, and PushStreaming modes)": "Añadir registros a una tabla en un conjunto de datos de BI Power (soporta modos Push, Streaming y PushStreaming)",
"Make a custom API call to a specific endpoint": "Hacer una llamada API personalizada a un extremo específico",
"Dataset Name": "Nombre de Dataset",
"Dataset Mode": "Modo de datos",
"Tables": "Tablas",
"Dataset": "Dataset",
"Table": "Tabla",
"Rows": "Filas",
"Skip Dataset Refresh": "Omitir actualización de datos",
"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)",
"Name of the dataset to create": "Nombre del conjunto de datos a crear",
"The mode of the dataset": "El modo del conjunto de datos",
"Define the tables and their columns for the dataset (JSON format)": "Definir las tablas y sus columnas para el conjunto de datos (formato JSON)",
"Select a dataset.": "Seleccione un conjunto de datos.",
"Select a table": "Seleccione una tabla",
"JSON object containing the rows to add to the table. Each row must match your table schema.": "Objeto JSON que contiene los registros a añadir a la tabla. Cada registro debe coincidir con su esquema de tabla.",
"Skip refreshing the dataset after pushing data (only applies to Push and PushStreaming modes)": "Omitir la actualización del conjunto de datos después de enviar datos (sólo se aplica a los modos Push y PushStreaming)",
"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.",
"Push": "Empujar",
"Streaming": "Transmisión",
"PushStreaming": "Streaming PushI",
"GET": "RECOGER",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "BORRAR",
"HEAD": "LIMPIO"
}

View File

@@ -0,0 +1,42 @@
{
"Create and manage Power BI datasets and push data to them": "Créez et gérez des jeux de données Power BI et envoyez des données vers eux",
"\n1. Sign in to [Microsoft Azure Portal](https://portal.azure.com/).\n2. From the left sidebar, go to **Microsoft Enfra ID**.\n3. Under **Manage**, click on **App registrations**.\n4. Click the **New registration** button.\n5. Enter a **Name** for your app.\n6. For **Supported account types**, choose:\n - **Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts**\n - Or select based on your requirement.\n7. In **Redirect URI**, select **Web** and ad": "\n1. Sign in to [Microsoft Azure Portal](https://portal.azure.com/).\n2. From the left sidebar, go to **Microsoft Enfra ID**.\n3. Under **Manage**, click on **App registrations**.\n4. Click the **New registration** button.\n5. Enter a **Name** for your app.\n6. For **Supported account types**, choose:\n - **Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts**\n - Or select based on your requirement.\n7. In **Redirect URI**, select **Web** and add the given URL.\n8. Click **Register**.\n9. After registration, youll be redirected to the apps overview page. Copy the **Application (client) ID**.\n10. From the left menu, go to **Certificates & secrets**.\n - Under **Client secrets**, click **New client secret**.\n - Provide a description, set an expiry, and click **Add**.\n - Copy the **Value** of the client secret (this will not be shown again).\n11. Go to **API permissions** from the left menu.\n - Click **Add a permission**.\n - Select **Power BI Service** → **Delegated permissions**.\n - Add the following scopes:\n\t - Dataset.ReadWrite.All\n\t - offline_access\n - Click **Add permissions**.\n12. Copy your **Client ID** and **Client Secret**.\n",
"Create Dataset": "Créer un jeu de données",
"Push Rows to Dataset Table": "Pousser les lignes vers la table des jeux de données",
"Custom API Call": "Appel API personnalisé",
"Create a new dataset in Power BI with custom schema (Push, Streaming, or PushStreaming mode).": "Créez un nouveau jeu de données en Power BI avec un schéma personnalisé (Push, Streaming, ou PushStreaming).",
"Add rows to a table in a Power BI dataset (supports Push, Streaming, and PushStreaming modes)": "Ajoute des lignes à une table dans un jeu de données Power BI (prend en charge les modes Push, Streaming et PushStreaming)",
"Make a custom API call to a specific endpoint": "Passez un appel API personnalisé à un point de terminaison spécifique",
"Dataset Name": "Nom du jeu de données",
"Dataset Mode": "Mode jeu de données",
"Tables": "Tables",
"Dataset": "Dataset",
"Table": "Tableau",
"Rows": "Lignes",
"Skip Dataset Refresh": "Ignorer l'actualisation du jeu de donné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)",
"Name of the dataset to create": "Nom du jeu de données à créer",
"The mode of the dataset": "Le mode du jeu de données",
"Define the tables and their columns for the dataset (JSON format)": "Définir les tables et leurs colonnes pour le jeu de données (format JSON)",
"Select a dataset.": "Sélectionnez un jeu de données.",
"Select a table": "Sélectionnez une table",
"JSON object containing the rows to add to the table. Each row must match your table schema.": "Objet JSON contenant les lignes à ajouter à la table. Chaque ligne doit correspondre au schéma de votre table.",
"Skip refreshing the dataset after pushing data (only applies to Push and PushStreaming modes)": "Ignorer l'actualisation du jeu de données après l'envoi des données (s'applique uniquement aux modes Push et PushStreaming)",
"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.",
"Push": "Pousser",
"Streaming": "Streaming en cours",
"PushStreaming": "PushStreaming",
"GET": "OBTENIR",
"POST": "POSTER",
"PATCH": "PATCH",
"PUT": "EFFACER",
"DELETE": "SUPPRIMER",
"HEAD": "HEAD"
}

View File

@@ -0,0 +1,42 @@
{
"Create and manage Power BI datasets and push data to them": "Power BI データセットを作成・管理し、データをプッシュします",
"\n1. Sign in to [Microsoft Azure Portal](https://portal.azure.com/).\n2. From the left sidebar, go to **Microsoft Enfra ID**.\n3. Under **Manage**, click on **App registrations**.\n4. Click the **New registration** button.\n5. Enter a **Name** for your app.\n6. For **Supported account types**, choose:\n - **Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts**\n - Or select based on your requirement.\n7. In **Redirect URI**, select **Web** and ad": "\n1. Sign in to [Microsoft Azure Portal](https://portal.azure.com/).\n2. From the left sidebar, go to **Microsoft Enfra ID**.\n3. Under **Manage**, click on **App registrations**.\n4. Click the **New registration** button.\n5. Enter a **Name** for your app.\n6. For **Supported account types**, choose:\n - **Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts**\n - Or select based on your requirement.\n7. In **Redirect URI**, select **Web** and add the given URL.\n8. Click **Register**.\n9. After registration, youll be redirected to the apps overview page. Copy the **Application (client) ID**.\n10. From the left menu, go to **Certificates & secrets**.\n - Under **Client secrets**, click **New client secret**.\n - Provide a description, set an expiry, and click **Add**.\n - Copy the **Value** of the client secret (this will not be shown again).\n11. Go to **API permissions** from the left menu.\n - Click **Add a permission**.\n - Select **Power BI Service** → **Delegated permissions**.\n - Add the following scopes:\n\t - Dataset.ReadWrite.All\n\t - offline_access\n - Click **Add permissions**.\n12. Copy your **Client ID** and **Client Secret**.\n",
"Create Dataset": "データセットを作成",
"Push Rows to Dataset Table": "データセットテーブルに行をプッシュする",
"Custom API Call": "カスタムAPI通話",
"Create a new dataset in Power BI with custom schema (Push, Streaming, or PushStreaming mode).": "カスタムスキーマ(Push、Streaming、PushStreamingモード)を使用して、Power BI に新しいデータセットを作成します。",
"Add rows to a table in a Power BI dataset (supports Push, Streaming, and PushStreaming modes)": "Power BI データセット内のテーブルに行を追加 (Push、Streaming、PushStreaming モードをサポート)",
"Make a custom API call to a specific endpoint": "特定のエンドポイントへのカスタム API コールを実行します。",
"Dataset Name": "データセット名",
"Dataset Mode": "データセットモード",
"Tables": "テーブル",
"Dataset": "Dataset",
"Table": "表",
"Rows": "行",
"Skip Dataset Refresh": "データセットの更新をスキップ",
"Method": "方法",
"Headers": "ヘッダー",
"Query Parameters": "クエリパラメータ",
"Body": "本文",
"Response is Binary ?": "応答はバイナリですか?",
"No Error on Failure": "失敗時にエラーはありません",
"Timeout (in seconds)": "タイムアウト(秒)",
"Name of the dataset to create": "作成するデータセットの名前",
"The mode of the dataset": "データセットのモード",
"Define the tables and their columns for the dataset (JSON format)": "データセットの表と列を定義します (JSON 形式)",
"Select a dataset.": "データセットを選択",
"Select a table": "テーブルを選択",
"JSON object containing the rows to add to the table. Each row must match your table schema.": "テーブルに追加する行を含む JSON オブジェクト。各行はテーブルスキーマと一致する必要があります。",
"Skip refreshing the dataset after pushing data (only applies to Push and PushStreaming modes)": "データをプッシュした後のデータセットの更新をスキップします(Pushストリーミングモードにのみ適用されます)",
"Authorization headers are injected automatically from your connection.": "認証ヘッダは接続から自動的に注入されます。",
"Enable for files like PDFs, images, etc..": "PDF、画像などのファイルを有効にします。",
"Push": "Push",
"Streaming": "ストリーミング",
"PushStreaming": "プッシュストリーミング",
"GET": "取得",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "削除",
"HEAD": "頭"
}

View File

@@ -0,0 +1,42 @@
{
"Create and manage Power BI datasets and push data to them": "Maken en beheren van Power BI datasets en push-gegevens naar hen",
"\n1. Sign in to [Microsoft Azure Portal](https://portal.azure.com/).\n2. From the left sidebar, go to **Microsoft Enfra ID**.\n3. Under **Manage**, click on **App registrations**.\n4. Click the **New registration** button.\n5. Enter a **Name** for your app.\n6. For **Supported account types**, choose:\n - **Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts**\n - Or select based on your requirement.\n7. In **Redirect URI**, select **Web** and ad": "\n1. Log in bij [Microsoft Azure Portal](https://portal.azure.com/).\n. Ga naar **Microsoft Enfra ID**.\n3. Onder **Beheren**, klik op **App registraties**.\n4. Klik op de **Nieuwe registratie** knop.\n5. Voer een **Naam** in voor uw app.\n6. Voor **Ondersteunde accounttypen**, kies keuze:\n - **Accounts in elke map van de organisatie (Any Microsoft Entra ID-tenant - Multitenant) en persoonlijke Microsoft accounts**\n - Of selecteer gebaseerd op uw vereiste.\n7. In **Redirect URI** selecteer **Web** en voeg de opgegeven URL toe.\n8. Klik op **Register**.\n9. Na registratie wordt u doorverwezen naar de overzichtspagina. Kopieer de **Applicatie (client) ID**.\n10. Vanuit het linkermenu ga naar **Certificaten & geheimen**.\n - Klik onder **Client geheimen** op **Nieuwe client geheim**.\n - Geef een beschrijving, verloop, en klik **Toevoegen**.\n - Kopieer de **waarde** van de client secret (dit zal niet meer worden weergegeven).\n11. Ga naar **API permissies** in het linkermenu.\n - Klik **Een permissie toevoegen**.\n - Selecteer **Power BI Service** → **Toegewezen machtigingen**.\n - Voeg de volgende toepassingsgebieden toe:\n\t - Dataset. eadWrite.Alle\n\t - offline_access \n - Klik **Permissies toevoegen**.\n12. Kopieer uw **Client ID** en **Client Secret**.\n",
"Create Dataset": "Dataset aanmaken",
"Push Rows to Dataset Table": "Duw rijen naar Dataset Tabel",
"Custom API Call": "Custom API Call",
"Create a new dataset in Power BI with custom schema (Push, Streaming, or PushStreaming mode).": "Maak een nieuw dataset in Power BI met aangepast schema (Push, Streaming, of PushStreaming modus).",
"Add rows to a table in a Power BI dataset (supports Push, Streaming, and PushStreaming modes)": "Rijen toevoegen aan een tabel in een Power BI dataset (ondersteunt Push, Streaming, en PushStreaming modus)",
"Make a custom API call to a specific endpoint": "Maak een aangepaste API call naar een specifiek eindpunt",
"Dataset Name": "Dataset naam",
"Dataset Mode": "Dataset modus",
"Tables": "Tabellen",
"Dataset": "Dataset",
"Table": "Tabel",
"Rows": "Rijen",
"Skip Dataset Refresh": "Skip Dataset vernieuwen",
"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)",
"Name of the dataset to create": "Naam van het te maken dataset",
"The mode of the dataset": "De modus van de dataset",
"Define the tables and their columns for the dataset (JSON format)": "Definieer de tabellen en hun kolommen voor het dataset (JSON formaat)",
"Select a dataset.": "Selecteer een dataset.",
"Select a table": "Selecteer een tabel",
"JSON object containing the rows to add to the table. Each row must match your table schema.": "JSON object met de rijen om toe te voegen aan de tabel. Elke rij moet overeenkomen met uw tabelschema.",
"Skip refreshing the dataset after pushing data (only applies to Push and PushStreaming modes)": "Sla het vernieuwen van de data over (is alleen van toepassing op Push en PushStreaming Modus)",
"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..",
"Push": "Push",
"Streaming": "Streamen",
"PushStreaming": "PushStreaming",
"GET": "KRIJG",
"POST": "POSTE",
"PATCH": "BEKIJK",
"PUT": "PUT",
"DELETE": "VERWIJDEREN",
"HEAD": "HOOFD"
}

View File

@@ -0,0 +1,42 @@
{
"Create and manage Power BI datasets and push data to them": "Criar e gerenciar conjuntos de dados Power BI e enviar dados para eles",
"\n1. Sign in to [Microsoft Azure Portal](https://portal.azure.com/).\n2. From the left sidebar, go to **Microsoft Enfra ID**.\n3. Under **Manage**, click on **App registrations**.\n4. Click the **New registration** button.\n5. Enter a **Name** for your app.\n6. For **Supported account types**, choose:\n - **Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts**\n - Or select based on your requirement.\n7. In **Redirect URI**, select **Web** and ad": "\n1. Entre no [Microsoft Azure Portal](https://portal.azure.com/).\n. Na barra lateral esquerda, vá até **Microsoft Enfra ID**.\n3. Sob **Gerenciar**, clique em **Aplicativos registrados**.\n4. Clique no botão **Novo registro**.\n5. Digite um **Nome** para o seu aplicativo.\n6. Para **Tipos de conta suportados**, escolha:\n - **Contas em qualquer diretório organizacional (qualquer inquilino de ID da Microsoft Entra - Multitenant) e contas pessoais da Microsoft**\n - Ou selecione com base nos seus requisitos.\n7. Em **URI de redirecionamento**, selecione **Web** e adicione a URL fornecida.\n8. Clique em **Registrar**.\n9. Após o registro, você será redirecionado para a página de visão geral do aplicativo. Copie o **aplicativo (cliente) ID**.\n10. Do menu à esquerda, vá para **Certificados e segredos**.\n - Em **Segredos do Cliente**, clique em **Novo segredo do Cliente**.\n - Fornece uma descrição, define um vencimento e clique em **Adicionar**.\n - Copiar o **Valor** do segredo do cliente (isso não será exibido novamente).\n11. Vá para **permissões de API** no menu à esquerda.\n - Clique **Adicionar uma permissão**.\n - Selecione **Serviço de Energia BI** → **Permissões delegadas**.\n - Adicione os seguintes escopos:\n\t - Dataset. eadWrite.All\n\t - offline_access \n - Clique em **Adicionar permissões**.\n12. Copie seu **ID do Cliente** e **Segredo do Cliente**.\n",
"Create Dataset": "Criar dados",
"Push Rows to Dataset Table": "Empurrar Linhas para a Tabela de Conjunto de Dados",
"Custom API Call": "Chamada de API personalizada",
"Create a new dataset in Power BI with custom schema (Push, Streaming, or PushStreaming mode).": "Crie um novo conjunto de dados no Power BI com o esquema personalizado (Push, Streaming ou PushStreaming).",
"Add rows to a table in a Power BI dataset (supports Push, Streaming, and PushStreaming modes)": "Adicione linhas a uma tabela em um conjunto de dados Power BI (suporta modos Push, Streaming e PushStreaming)",
"Make a custom API call to a specific endpoint": "Faça uma chamada de API personalizada para um ponto de extremidade específico",
"Dataset Name": "Nome do dataset",
"Dataset Mode": "Modo de Dataset",
"Tables": "Tabelas",
"Dataset": "Dataset",
"Table": "Classificações",
"Rows": "Linhas",
"Skip Dataset Refresh": "Pular Atualização de Dados",
"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)",
"Name of the dataset to create": "Nome do conjunto de dados a criar",
"The mode of the dataset": "O modo do conjunto de dados",
"Define the tables and their columns for the dataset (JSON format)": "Define as tabelas e suas colunas para o conjunto de dados (formato JSON)",
"Select a dataset.": "Selecione um conjunto de dados.",
"Select a table": "Selecione uma tabela",
"JSON object containing the rows to add to the table. Each row must match your table schema.": "Objeto JSON contendo as linhas para adicionar à tabela. Cada linha deve corresponder ao esquema da tabela.",
"Skip refreshing the dataset after pushing data (only applies to Push and PushStreaming modes)": "Pular atualização do conjunto de dados após enviar dados (aplica-se somente aos modos Push e PushStreaming)",
"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..",
"Push": "Enviar",
"Streaming": "Transmitindo",
"PushStreaming": "Transmissão",
"GET": "OBTER",
"POST": "POSTAR",
"PATCH": "COMPRAR",
"PUT": "COLOCAR",
"DELETE": "EXCLUIR",
"HEAD": "CABEÇA"
}

View File

@@ -0,0 +1,41 @@
{
"Microsoft Power BI": "Microsoft Power BI",
"Create and manage Power BI datasets and push data to them": "Создание и управление наборами данных Power BI и push-данные к ним",
"Authentication for Microsoft Power BI": "Аутентификация для Microsoft Power BI",
"Create Dataset": "Создать набор данных",
"Push Rows to Dataset Table": "Передать строки к таблице набора данных",
"Custom API Call": "Пользовательский вызов API",
"Create a new dataset in Power BI with custom schema (Push, Streaming, or PushStreaming mode).": "Создайте новый набор данных в Power BI с пользовательской схемой (Push, Streaming, или PushStreaming режим).",
"Add rows to a table in a Power BI dataset (supports Push, Streaming, and PushStreaming modes)": "Добавить строки к таблице в наборе данных Power BI (поддерживает Push, Streaming, и PushStreaming режимы)",
"Make a custom API call to a specific endpoint": "Сделать пользовательский API вызов к определенной конечной точке",
"Dataset Name": "Имя набора данных",
"Dataset Mode": "Режим набора данных",
"Tables": "Таблицы",
"Dataset": "Dataset",
"Table": "Таблица",
"Rows": "Строки",
"Skip Dataset Refresh": "Пропустить обновление набора данных",
"Method": "Метод",
"Headers": "Заголовки",
"Query Parameters": "Параметры запроса",
"Body": "Тело",
"No Error on Failure": "Нет ошибок при ошибке",
"Timeout (in seconds)": "Таймаут (в секундах)",
"Name of the dataset to create": "Имя создаваемого набора данных",
"The mode of the dataset": "Режим набора данных",
"Define the tables and their columns for the dataset (JSON format)": "Определите таблицы и их столбцы для набора данных (формат JSON)",
"Select a dataset.": "Выберите набор данных.",
"Select a table": "Выберите таблицу",
"JSON object containing the rows to add to the table. Each row must match your table schema.": "JSON объект, содержащий строки, чтобы добавить к таблице. Каждая строка должна соответствовать схеме таблицы.",
"Skip refreshing the dataset after pushing data (only applies to Push and PushStreaming modes)": "Пропустить обновление набора данных после нажатия данных (применяется только к режимам PushStreaming и PushStream)",
"Authorization headers are injected automatically from your connection.": "Заголовки авторизации включаются автоматически из вашего соединения.",
"Push": "Нагрузка",
"Streaming": "Вещание",
"PushStreaming": "PushStreaming",
"GET": "ПОЛУЧИТЬ",
"POST": "ПОСТ",
"PATCH": "ПАТЧ",
"PUT": "ПОКУПИТЬ",
"DELETE": "УДАЛИТЬ",
"HEAD": "HEAD"
}

View File

@@ -0,0 +1,42 @@
{
"Create and manage Power BI datasets and push data to them": "Create and manage Power BI datasets and push data to them",
"\n1. Sign in to [Microsoft Azure Portal](https://portal.azure.com/).\n2. From the left sidebar, go to **Microsoft Enfra ID**.\n3. Under **Manage**, click on **App registrations**.\n4. Click the **New registration** button.\n5. Enter a **Name** for your app.\n6. For **Supported account types**, choose:\n - **Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts**\n - Or select based on your requirement.\n7. In **Redirect URI**, select **Web** and ad": "\n1. Sign in to [Microsoft Azure Portal](https://portal.azure.com/).\n2. From the left sidebar, go to **Microsoft Enfra ID**.\n3. Under **Manage**, click on **App registrations**.\n4. Click the **New registration** button.\n5. Enter a **Name** for your app.\n6. For **Supported account types**, choose:\n - **Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts**\n - Or select based on your requirement.\n7. In **Redirect URI**, select **Web** and add the given URL.\n8. Click **Register**.\n9. After registration, youll be redirected to the apps overview page. Copy the **Application (client) ID**.\n10. From the left menu, go to **Certificates & secrets**.\n - Under **Client secrets**, click **New client secret**.\n - Provide a description, set an expiry, and click **Add**.\n - Copy the **Value** of the client secret (this will not be shown again).\n11. Go to **API permissions** from the left menu.\n - Click **Add a permission**.\n - Select **Power BI Service** → **Delegated permissions**.\n - Add the following scopes:\n\t - Dataset.ReadWrite.All\n\t - offline_access\n - Click **Add permissions**.\n12. Copy your **Client ID** and **Client Secret**.\n",
"Create Dataset": "Create Dataset",
"Push Rows to Dataset Table": "Push Rows to Dataset Table",
"Custom API Call": "Custom API Call",
"Create a new dataset in Power BI with custom schema (Push, Streaming, or PushStreaming mode).": "Create a new dataset in Power BI with custom schema (Push, Streaming, or PushStreaming mode).",
"Add rows to a table in a Power BI dataset (supports Push, Streaming, and PushStreaming modes)": "Add rows to a table in a Power BI dataset (supports Push, Streaming, and PushStreaming modes)",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"Dataset Name": "Dataset Name",
"Dataset Mode": "Dataset Mode",
"Tables": "Tables",
"Dataset": "Dataset",
"Table": "Table",
"Rows": "Rows",
"Skip Dataset Refresh": "Skip Dataset Refresh",
"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)",
"Name of the dataset to create": "Name of the dataset to create",
"The mode of the dataset": "The mode of the dataset",
"Define the tables and their columns for the dataset (JSON format)": "Define the tables and their columns for the dataset (JSON format)",
"Select a dataset.": "Select a dataset.",
"Select a table": "Select a table",
"JSON object containing the rows to add to the table. Each row must match your table schema.": "JSON object containing the rows to add to the table. Each row must match your table schema.",
"Skip refreshing the dataset after pushing data (only applies to Push and PushStreaming modes)": "Skip refreshing the dataset after pushing data (only applies to Push and PushStreaming modes)",
"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..",
"Push": "Push",
"Streaming": "Streaming",
"PushStreaming": "PushStreaming",
"GET": "GET",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "DELETE",
"HEAD": "HEAD"
}

View File

@@ -0,0 +1,41 @@
{
"Microsoft Power BI": "Microsoft Power BI",
"Create and manage Power BI datasets and push data to them": "Create and manage Power BI datasets and push data to them",
"Authentication for Microsoft Power BI": "Authentication for Microsoft Power BI",
"Create Dataset": "Create Dataset",
"Push Rows to Dataset Table": "Push Rows to Dataset Table",
"Custom API Call": "Custom API Call",
"Create a new dataset in Power BI with custom schema (Push, Streaming, or PushStreaming mode).": "Create a new dataset in Power BI with custom schema (Push, Streaming, or PushStreaming mode).",
"Add rows to a table in a Power BI dataset (supports Push, Streaming, and PushStreaming modes)": "Add rows to a table in a Power BI dataset (supports Push, Streaming, and PushStreaming modes)",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"Dataset Name": "Dataset Name",
"Dataset Mode": "Dataset Mode",
"Tables": "Tables",
"Dataset": "Dataset",
"Table": "Table",
"Rows": "Rows",
"Skip Dataset Refresh": "Skip Dataset Refresh",
"Method": "Method",
"Headers": "Headers",
"Query Parameters": "Query Parameters",
"Body": "Body",
"No Error on Failure": "No Error on Failure",
"Timeout (in seconds)": "Timeout (in seconds)",
"Name of the dataset to create": "Name of the dataset to create",
"The mode of the dataset": "The mode of the dataset",
"Define the tables and their columns for the dataset (JSON format)": "Define the tables and their columns for the dataset (JSON format)",
"Select a dataset.": "Select a dataset.",
"Select a table": "Select a table",
"JSON object containing the rows to add to the table. Each row must match your table schema.": "JSON object containing the rows to add to the table. Each row must match your table schema.",
"Skip refreshing the dataset after pushing data (only applies to Push and PushStreaming modes)": "Skip refreshing the dataset after pushing data (only applies to Push and PushStreaming modes)",
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
"Push": "Push",
"Streaming": "Streaming",
"PushStreaming": "PushStreaming",
"GET": "GET",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "DELETE",
"HEAD": "HEAD"
}

View File

@@ -0,0 +1,42 @@
{
"Create and manage Power BI datasets and push data to them": "Create and manage Power BI datasets and push data to them",
"\n1. Sign in to [Microsoft Azure Portal](https://portal.azure.com/).\n2. From the left sidebar, go to **Microsoft Enfra ID**.\n3. Under **Manage**, click on **App registrations**.\n4. Click the **New registration** button.\n5. Enter a **Name** for your app.\n6. For **Supported account types**, choose:\n - **Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts**\n - Or select based on your requirement.\n7. In **Redirect URI**, select **Web** and ad": "\n1. Sign in to [Microsoft Azure Portal](https://portal.azure.com/).\n2. From the left sidebar, go to **Microsoft Enfra ID**.\n3. Under **Manage**, click on **App registrations**.\n4. Click the **New registration** button.\n5. Enter a **Name** for your app.\n6. For **Supported account types**, choose:\n - **Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts**\n - Or select based on your requirement.\n7. In **Redirect URI**, select **Web** and add the given URL.\n8. Click **Register**.\n9. After registration, youll be redirected to the apps overview page. Copy the **Application (client) ID**.\n10. From the left menu, go to **Certificates & secrets**.\n - Under **Client secrets**, click **New client secret**.\n - Provide a description, set an expiry, and click **Add**.\n - Copy the **Value** of the client secret (this will not be shown again).\n11. Go to **API permissions** from the left menu.\n - Click **Add a permission**.\n - Select **Power BI Service** → **Delegated permissions**.\n - Add the following scopes:\n\t - Dataset.ReadWrite.All\n\t - offline_access\n - Click **Add permissions**.\n12. Copy your **Client ID** and **Client Secret**.\n",
"Create Dataset": "Create Dataset",
"Push Rows to Dataset Table": "Push Rows to Dataset Table",
"Custom API Call": "自定义 API 呼叫",
"Create a new dataset in Power BI with custom schema (Push, Streaming, or PushStreaming mode).": "Create a new dataset in Power BI with custom schema (Push, Streaming, or PushStreaming mode).",
"Add rows to a table in a Power BI dataset (supports Push, Streaming, and PushStreaming modes)": "Add rows to a table in a Power BI dataset (supports Push, Streaming, and PushStreaming modes)",
"Make a custom API call to a specific endpoint": "将一个自定义 API 调用到一个特定的终点",
"Dataset Name": "Dataset Name",
"Dataset Mode": "Dataset Mode",
"Tables": "表",
"Dataset": "Dataset",
"Table": "表",
"Rows": "Rows",
"Skip Dataset Refresh": "Skip Dataset Refresh",
"Method": "方法",
"Headers": "信头",
"Query Parameters": "查询参数",
"Body": "正文内容",
"Response is Binary ?": "Response is Binary ?",
"No Error on Failure": "失败时没有错误",
"Timeout (in seconds)": "超时(秒)",
"Name of the dataset to create": "Name of the dataset to create",
"The mode of the dataset": "The mode of the dataset",
"Define the tables and their columns for the dataset (JSON format)": "Define the tables and their columns for the dataset (JSON format)",
"Select a dataset.": "Select a dataset.",
"Select a table": "Select a table",
"JSON object containing the rows to add to the table. Each row must match your table schema.": "JSON object containing the rows to add to the table. Each row must match your table schema.",
"Skip refreshing the dataset after pushing data (only applies to Push and PushStreaming modes)": "Skip refreshing the dataset after pushing data (only applies to Push and PushStreaming modes)",
"Authorization headers are injected automatically from your connection.": "授权头自动从您的连接中注入。",
"Enable for files like PDFs, images, etc..": "Enable for files like PDFs, images, etc..",
"Push": "推送",
"Streaming": "Streaming",
"PushStreaming": "PushStreaming",
"GET": "获取",
"POST": "帖子",
"PATCH": "PATCH",
"PUT": "弹出",
"DELETE": "删除",
"HEAD": "黑色"
}

View File

@@ -0,0 +1,71 @@
import {
createPiece,
OAuth2PropertyValue,
PieceAuth,
} from '@activepieces/pieces-framework';
import { pushRowsToDatasetTableAction } from './lib/actions/push-rows-to-table';
import { createDatasetAction } from './lib/actions/create-dataset';
import { PieceCategory } from '@activepieces/shared';
import { createCustomApiCallAction } from '@activepieces/pieces-common';
const authDesc = `
1. Sign in to [Microsoft Azure Portal](https://portal.azure.com/).
2. From the left sidebar, go to **Microsoft Enfra ID**.
3. Under **Manage**, click on **App registrations**.
4. Click the **New registration** button.
5. Enter a **Name** for your app.
6. For **Supported account types**, choose:
- **Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts**
- Or select based on your requirement.
7. In **Redirect URI**, select **Web** and add the given URL.
8. Click **Register**.
9. After registration, youll be redirected to the apps overview page. Copy the **Application (client) ID**.
10. From the left menu, go to **Certificates & secrets**.
- Under **Client secrets**, click **New client secret**.
- Provide a description, set an expiry, and click **Add**.
- Copy the **Value** of the client secret (this will not be shown again).
11. Go to **API permissions** from the left menu.
- Click **Add a permission**.
- Select **Power BI Service** → **Delegated permissions**.
- Add the following scopes:
- Dataset.ReadWrite.All
- offline_access
- Click **Add permissions**.
12. Copy your **Client ID** and **Client Secret**.
`
export const microsoftPowerBiAuth = PieceAuth.OAuth2({
description: authDesc,
authUrl: 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize',
tokenUrl: 'https://login.microsoftonline.com/common/oauth2/v2.0/token',
required: true,
scope: [
'https://analysis.windows.net/powerbi/api/Dataset.ReadWrite.All',
'offline_access',
],
prompt: 'omit'
});
export const microsoftPowerBi = createPiece({
displayName: 'Microsoft Power BI',
description: 'Create and manage Power BI datasets and push data to them',
minimumSupportedRelease: '0.36.1',
logoUrl: 'https://cdn.activepieces.com/pieces/microsoft-power-bi.png',
categories: [PieceCategory.BUSINESS_INTELLIGENCE],
auth: microsoftPowerBiAuth,
authors: ['calladodan'],
actions: [
createDatasetAction,
pushRowsToDatasetTableAction,
createCustomApiCallAction({
auth: microsoftPowerBiAuth,
baseUrl: () => 'https://api.powerbi.com/v1.0/myorg/datasets',
authMapping: async (auth) => {
return {
Authorization: `Bearer ${(auth as OAuth2PropertyValue).access_token}`,
};
},
}),
],
triggers: [],
});

View File

@@ -0,0 +1,132 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { httpClient, HttpMethod } from '@activepieces/pieces-common';
import { microsoftPowerBiAuth } from '../../index';
type ColumnDefinition = {
name: string;
dataType: 'String' | 'Int64' | 'Double' | 'DateTime' | 'Boolean';
};
type TableDefinition = {
name: string;
columns: ColumnDefinition[];
};
type DatasetMode = 'Push' | 'Streaming' | 'PushStreaming';
export const createDatasetAction = createAction({
auth:microsoftPowerBiAuth,
name: 'create_dataset',
displayName: 'Create Dataset',
description: 'Create a new dataset in Power BI with custom schema (Push, Streaming, or PushStreaming mode).',
props: {
dataset_name: Property.ShortText({
displayName: 'Dataset Name',
description: 'Name of the dataset to create',
required: true,
defaultValue: 'ActivepiecesDataset'
}),
mode: Property.StaticDropdown({
displayName: 'Dataset Mode',
description: 'The mode of the dataset',
required: true,
defaultValue: 'Push',
options: {
options: [
{ label: 'Push', value: 'Push' },
{ label: 'Streaming', value: 'Streaming' },
{ label: 'PushStreaming', value: 'PushStreaming' }
]
}
}),
tables: Property.Json({
displayName: 'Tables',
description: 'Define the tables and their columns for the dataset (JSON format)',
required: true,
defaultValue: [
{
name: 'Data',
columns: [
{ name: 'Id', dataType: 'Int64' },
{ name: 'Name', dataType: 'String' },
{ name: 'Value', dataType: 'Double' },
{ name: 'Timestamp', dataType: 'DateTime' }
]
}
]
})
},
async run(context) {
const auth = context.auth;
const datasetName = context.propsValue.dataset_name;
const mode = context.propsValue.mode as DatasetMode;
let tables: TableDefinition[];
try {
// Parse the tables JSON
const parsedTables = typeof context.propsValue.tables === 'string'
? JSON.parse(context.propsValue.tables)
: context.propsValue.tables;
// Expect tables to be an array directly
if (Array.isArray(parsedTables)) {
tables = parsedTables;
} else {
throw new Error('Tables must be an array of table definitions');
}
} catch (e) {
console.error('Error parsing tables:', e);
throw new Error(`Invalid tables JSON format. Received value: ${JSON.stringify(context.propsValue.tables)}`);
}
// Always use My Workspace URL
const baseUrl = 'https://api.powerbi.com/v1.0/myorg';
// Define the dataset schema
const datasetDefinition = {
name: datasetName,
defaultMode: mode,
tables: tables.map(table => ({
name: table.name,
columns: table.columns.map(column => ({
name: column.name,
dataType: column.dataType.toLowerCase()
}))
}))
};
try {
// Create the dataset
const requestBody = {
name: datasetName,
defaultMode: mode,
tables: datasetDefinition.tables
};
const response = await httpClient.sendRequest({
method: HttpMethod.POST,
url: `${baseUrl}/datasets`,
headers: {
'Authorization': `Bearer ${auth.access_token}`,
'Content-Type': 'application/json'
},
body: requestBody
});
if (response.status >= 400) {
throw new Error(`Failed to create dataset: ${response.status} - ${JSON.stringify(response.body)}`);
}
return {
success: true,
statusCode: response.status,
datasetInfo: response.body,
schema: datasetDefinition
};
} catch (error) {
console.error('Error creating dataset:', error);
throw error;
}
}
});

View File

@@ -0,0 +1,220 @@
import { createAction, OAuth2PropertyValue, Property } from '@activepieces/pieces-framework';
import { httpClient, HttpMethod } from '@activepieces/pieces-common';
import { microsoftPowerBiAuth } from '../../index';
type PowerBIRow = {
[key: string]: string | number | boolean | null | undefined;
};
export const pushRowsToDatasetTableAction = createAction({
auth:microsoftPowerBiAuth,
name: 'push_rows_to_dataset_table',
displayName: 'Push Rows to Dataset Table',
description: 'Add rows to a table in a Power BI dataset (supports Push, Streaming, and PushStreaming modes)',
props: {
dataset_id: Property.Dropdown({
auth: microsoftPowerBiAuth,
displayName: 'Dataset',
description: 'Select a dataset.',
required: true,
refreshers: ['auth'],
options: async (propsValue) => {
const auth = propsValue['auth'] as OAuth2PropertyValue;
if (!auth) {
return {
disabled: true,
options: [],
placeholder: 'Please authenticate first.'
};
}
try {
const response = await httpClient.sendRequest<{value:{name:string,id:string}[]}>({
method: HttpMethod.GET,
url: 'https://api.powerbi.com/v1.0/myorg/datasets',
headers: {
'Authorization': `Bearer ${auth.access_token}`
}
});
return {
options: response.body.value.map((dataset) => ({
label: dataset.name,
value: dataset.id
}))
};
} catch (error) {
console.error('Error fetching datasets:', error);
return {
disabled: true,
options: [],
placeholder: 'Error loading datasets'
};
}
}
}),
table_name: Property.Dropdown({
auth: microsoftPowerBiAuth,
displayName: 'Table',
description: 'Select a table',
required: true,
refreshers: ['auth', 'dataset_id'],
options: async (propsValue) => {
const auth = propsValue['auth'] as OAuth2PropertyValue;
const datasetId = propsValue['dataset_id'] as string;
if (!auth || !datasetId) {
return {
disabled: true,
options: [],
placeholder: 'Please select a dataset first'
};
}
try {
const response = await httpClient.sendRequest<{value:{name:string}[]}>({
method: HttpMethod.GET,
url: `https://api.powerbi.com/v1.0/myorg/datasets/${datasetId}/tables`,
headers: {
'Authorization': `Bearer ${auth.access_token}`
}
});
return {
options: response.body.value.map((table) => ({
label: table.name,
value: table.name
}))
};
} catch (error) {
console.error('Error fetching tables:', error);
return {
disabled: true,
options: [],
placeholder: 'Error loading tables'
};
}
}
}),
rows: Property.Json({
displayName: 'Rows',
description: 'JSON object containing the rows to add to the table. Each row must match your table schema.',
required: true,
defaultValue: {
rows: [
{
Id: 1,
Name: "Example",
Value: 42.5,
Timestamp: new Date().toISOString()
}
]
}
}),
skip_refresh: Property.Checkbox({
displayName: 'Skip Dataset Refresh',
description: 'Skip refreshing the dataset after pushing data (only applies to Push and PushStreaming modes)',
required: false,
defaultValue: false
})
},
async run(context) {
const auth = context.auth;
const datasetId = context.propsValue.dataset_id;
const tableName = context.propsValue.table_name;
let rows: PowerBIRow[];
try {
// Parse rows if it's a string
const rowsInput = context.propsValue.rows;
const parsedInput = typeof rowsInput === 'string' ? JSON.parse(rowsInput) : rowsInput;
// Handle both direct array and object with rows property
if (Array.isArray(parsedInput)) {
rows = parsedInput;
} else if (parsedInput && parsedInput.rows && Array.isArray(parsedInput.rows)) {
rows = parsedInput.rows;
} else {
throw new Error('Rows must be either an array or an object with a rows array property');
}
} catch (e) {
console.error('Error parsing rows:', e);
throw new Error('Invalid rows format');
}
const skipRefresh = context.propsValue.skip_refresh;
const baseUrl = 'https://api.powerbi.com/v1.0/myorg';
try {
// 1. Get dataset info
const datasetResponse = await httpClient.sendRequest({
method: HttpMethod.GET,
url: `${baseUrl}/datasets/${datasetId}`,
headers: {
'Authorization': `Bearer ${auth.access_token}`
}
});
// 2. Get table info
const tableResponse = await httpClient.sendRequest({
method: HttpMethod.GET,
url: `${baseUrl}/datasets/${datasetId}/tables`,
headers: {
'Authorization': `Bearer ${auth.access_token}`
}
});
// 3. Validate table exists and is in the dataset
const tables = tableResponse.body.value;
const targetTable = tables.find((t: any) => t.name === tableName);
if (!targetTable) {
throw new Error(`Table '${tableName}' not found in dataset. Available tables: ${tables.map((t: any) => t.name).join(', ')}`);
}
// 4. Prepare and send data
const url = `${baseUrl}/datasets/${datasetId}/tables/${tableName}/rows`;
const response = await httpClient.sendRequest({
method: HttpMethod.POST,
url: url,
headers: {
'Authorization': `Bearer ${auth.access_token}`,
'Content-Type': 'application/json'
},
body: {
rows
}
});
if (response.status >= 400) {
const errorMessage = response.body?.error?.message || JSON.stringify(response.body);
throw new Error(`Power BI API Error: ${response.status} - ${errorMessage}`);
}
// 5. Refresh dataset if not skipped
let refreshResponse = null;
if (!skipRefresh) {
refreshResponse = await httpClient.sendRequest({
method: HttpMethod.POST,
url: `${baseUrl}/datasets/${datasetId}/refreshes`,
headers: {
'Authorization': `Bearer ${auth.access_token}`
}
}).catch(e => ({ status: e.response?.status, body: e.response?.body }));
}
return {
success: true,
statusCode: response.status,
body: response.body,
url: url,
sentData: rows,
datasetInfo: datasetResponse.body,
tables: tableResponse.body,
refreshAttempt: refreshResponse?.body
};
} catch (error) {
console.error('Error pushing data to Power BI:', error);
throw error;
}
}
});

View File

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

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"]
}