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

View File

@@ -0,0 +1 @@
# pieces-zuora

View File

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

View File

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

View File

@@ -0,0 +1,40 @@
{
"Cloud-based subscription management platform that enables businesses to launch and monetize subscription services.": "Cloud-basierte Abonnement-Management-Plattform, die es Unternehmen ermöglicht, Abonnement-Dienste zu starten und zu monetarisieren.",
"Client ID": "Kunden-ID",
"Client Secret": "Kundengeheimnis",
"Environment": "Umgebung",
"US Cloud 1 Production": "US-Cloud-1-Produktion",
"US Cloud 1 API Sandbox": "US Cloud 1 API Sandbox",
"US Cloud 2 Production": "US-Cloud-2-Produktion",
"US Cloud 2 API Sandbox": "US Cloud 2 API Sandbox",
"US Central Sandbox": "US-Zentral-Sandbox",
"EU Production": "EU-Produktion",
"EU API Sandbox": "EU API Sandbox",
"EU Developer & Central Sandbox": "EU Entwickler & Zentrale Sandbox",
"\n - **Establish a Dedicated API User** : Zuora recommends creating a distinct API user specifically for OAuth authentication with write permissions. Refer to the [API User Creation Guide](https://knowledgecenter.zuora.com/Zuora_Central_Platform/Tenant_Management/A_Administrator_Settings/Manage_Users/Create_an_API_User) for detailed instructions on setting up this user.\n - **Create OAuth Client** : After setting up the API user, it's essential to create an OAuth client tailored for this user.Detailed instr": "\n - **Einen dedizierten API Benutzer einrichten** : Zuora empfiehlt, einen eigenen API-Benutzer speziell für OAuth Authentifizierung mit Schreibrechten zu erstellen. Weitere Informationen zur Einrichtung dieses Benutzers finden Sie im [API User Creation Guide](https://knowledgecenter.zuora.com/Zuora_Central_Platform/Tenant_Management/A_Administrator_Settings/Manage_Users/Create_an_API_User).\n - **OAuth Client erstellen** : Nach dem Einrichten des API-Benutzers muss ein OAuth Client erstellt werden, der auf diesen Benutzer zugeschnitten ist. etailed instructions can be found in the [OAuth Client Creation Guide](https://knowledgecenter.zuora.com/Zuora_Central_Platform/Tenant_Management/A_Administrator_Settings/Manage_Users).\n - **Beziehen Sie sich auf die Basis-API-URL** : Benutzen Sie die [Basis-API-URL](https://developer.zuora.com/v1-api-reference/introduction/#section/Introduction/Access-to-the-API), die von Zuora für Ihre Umgebung bereitgestellt werden. Diese URL dient als Einstiegspunkt für den Zugriff auf die Zuora-API.",
"Create Invoice": "Rechnung erstellen",
"Find Customer Account": "Kundenkonto finden",
"Find Product Rate Plan": "Produktpreis finden",
"Find Product": "Produkt finden",
"Create a standalone invoice.": "Erstelle eine eigenständige Rechnung.",
"Retrieves account based on name.": "Ruft ein Konto basierend auf dem Namen ab.",
"Retrieves product rate plan with charges.": "Ruft den Produktplan mit Gebühren ab.",
"Retrieves product based on sku.": "Ruft Produkt basierend auf Sku ab.",
"Customer Account Number": "Kundenkontonummer",
"Auto Pay?": "Auto bezahlen?",
"Comments": "Kommentare",
"Due Date": "Fälligkeitsdatum",
"Invoice Date": "Rechnungsdatum",
"Invoice Items": "Rechnungsartikel",
"Status": "Status",
"Account Name": "Kontoname",
"Product Rate Plan Name": "Name des Produktpreises",
"Product ID": "Produkt-ID",
"Product SKU": "Produkt-SKU",
"The number of the customer account associated with the invoice.": "Die Nummer des mit der Rechnung verbundenen Kundenkontos.",
"Whether invoices are automatically picked up for processing in the corresponding payment run.": "Ob Rechnungen automatisch zur Bearbeitung im entsprechenden Zahlungsablauf abgeholt werden.",
"Provide YYYY-MM-DD format.": "Geben Sie das Format JJJJ-MM-TT an.",
"i.e. StealthCo Premium": "z.B. StealthCo Premium",
"Draft": "Entwurf",
"Posted": "Gepostet"
}

View File

@@ -0,0 +1,40 @@
{
"Cloud-based subscription management platform that enables businesses to launch and monetize subscription services.": "Plataforma de gestión de suscripciones basada en la nube que permite a las empresas lanzar y monetizar los servicios de suscripción.",
"Client ID": "ID de cliente",
"Client Secret": "Cliente secreto",
"Environment": "Entorno",
"US Cloud 1 Production": "Producción de US Cloud 1",
"US Cloud 1 API Sandbox": "Sandbox API de US Cloud 1",
"US Cloud 2 Production": "Producción de US Cloud 2",
"US Cloud 2 API Sandbox": "Sandbox API de US Cloud 2",
"US Central Sandbox": "Sandbox central de EE.UU.",
"EU Production": "Producción de la UE",
"EU API Sandbox": "Sandbox API EU",
"EU Developer & Central Sandbox": "Desarrollador de la UE y Sandbox central",
"\n - **Establish a Dedicated API User** : Zuora recommends creating a distinct API user specifically for OAuth authentication with write permissions. Refer to the [API User Creation Guide](https://knowledgecenter.zuora.com/Zuora_Central_Platform/Tenant_Management/A_Administrator_Settings/Manage_Users/Create_an_API_User) for detailed instructions on setting up this user.\n - **Create OAuth Client** : After setting up the API user, it's essential to create an OAuth client tailored for this user.Detailed instr": "\n - **Establish a Dedicated API User** : Zuora recommends creating a distinct API user specifically for OAuth authentication with write permissions. Refer to the [API User Creation Guide](https://knowledgecenter.zuora.com/Zuora_Central_Platform/Tenant_Management/A_Administrator_Settings/Manage_Users/Create_an_API_User) for detailed instructions on setting up this user.\n - **Create OAuth Client** : After setting up the API user, it's essential to create an OAuth client tailored for this user.Detailed instructions can be found in the [OAuth Client Creation Guide](https://knowledgecenter.zuora.com/Zuora_Central_Platform/Tenant_Management/A_Administrator_Settings/Manage_Users).\n - **Refer to Base API URL** : Utilize the [Base API URL](https://developer.zuora.com/v1-api-reference/introduction/#section/Introduction/Access-to-the-API) provided by Zuora for your environment. This URL serves as the entry point for accessing the Zuora API.",
"Create Invoice": "Crear factura",
"Find Customer Account": "Encontrar cuenta de cliente",
"Find Product Rate Plan": "Encontrar plan de tarifa de producto",
"Find Product": "Buscar producto",
"Create a standalone invoice.": "Crea una factura independiente.",
"Retrieves account based on name.": "Recuperar cuenta basada en el nombre.",
"Retrieves product rate plan with charges.": "Recuperar plan de tarifa de producto con cargos.",
"Retrieves product based on sku.": "Recuperar producto basado en sku.",
"Customer Account Number": "Número de cuenta de cliente",
"Auto Pay?": "¿Auto pagar?",
"Comments": "Comentarios",
"Due Date": "Fecha de fin",
"Invoice Date": "Fecha Factura",
"Invoice Items": "Objetos de factura",
"Status": "Estado",
"Account Name": "Nombre de cuenta",
"Product Rate Plan Name": "Nombre del plan de tarifa de producto",
"Product ID": "ID producto",
"Product SKU": "SKU del producto",
"The number of the customer account associated with the invoice.": "El número de la cuenta de cliente asociada con la factura.",
"Whether invoices are automatically picked up for processing in the corresponding payment run.": "Si las facturas se recogen automáticamente para su procesamiento en el plazo de pago correspondiente.",
"Provide YYYY-MM-DD format.": "Proporcionar formato AAA-MM-DD.",
"i.e. StealthCo Premium": "ej. StealthCo Premium",
"Draft": "Borrador",
"Posted": "Publicado"
}

View File

@@ -0,0 +1,40 @@
{
"Cloud-based subscription management platform that enables businesses to launch and monetize subscription services.": "Plateforme de gestion des abonnements basée sur le cloud qui permet aux entreprises de lancer et de monétiser les services d'abonnement.",
"Client ID": "ID client",
"Client Secret": "Clé secrète du client",
"Environment": "Environnement",
"US Cloud 1 Production": "Production du nuage américain 1",
"US Cloud 1 API Sandbox": "Bac à sable de l'API US Cloud 1",
"US Cloud 2 Production": "Production du Cloud 2 US",
"US Cloud 2 API Sandbox": "Bac à sable de l'API US Cloud 2",
"US Central Sandbox": "Bac à sable central des États-Unis",
"EU Production": "Production de l'UE",
"EU API Sandbox": "Bac à sable de l'API de l'UE",
"EU Developer & Central Sandbox": "Développeur de l'UE et Sandbox central",
"\n - **Establish a Dedicated API User** : Zuora recommends creating a distinct API user specifically for OAuth authentication with write permissions. Refer to the [API User Creation Guide](https://knowledgecenter.zuora.com/Zuora_Central_Platform/Tenant_Management/A_Administrator_Settings/Manage_Users/Create_an_API_User) for detailed instructions on setting up this user.\n - **Create OAuth Client** : After setting up the API user, it's essential to create an OAuth client tailored for this user.Detailed instr": "\n - **Establish a Dedicated API User** : Zuora recommends creating a distinct API user specifically for OAuth authentication with write permissions. Refer to the [API User Creation Guide](https://knowledgecenter.zuora.com/Zuora_Central_Platform/Tenant_Management/A_Administrator_Settings/Manage_Users/Create_an_API_User) for detailed instructions on setting up this user.\n - **Create OAuth Client** : After setting up the API user, it's essential to create an OAuth client tailored for this user.Detailed instructions can be found in the [OAuth Client Creation Guide](https://knowledgecenter.zuora.com/Zuora_Central_Platform/Tenant_Management/A_Administrator_Settings/Manage_Users).\n - **Refer to Base API URL** : Utilize the [Base API URL](https://developer.zuora.com/v1-api-reference/introduction/#section/Introduction/Access-to-the-API) provided by Zuora for your environment. This URL serves as the entry point for accessing the Zuora API.",
"Create Invoice": "Créer une facture",
"Find Customer Account": "Trouver le compte client",
"Find Product Rate Plan": "Trouver un plan de tarification de produit",
"Find Product": "Trouver un produit",
"Create a standalone invoice.": "Créer une facture autonome.",
"Retrieves account based on name.": "Récupère le compte basé sur le nom.",
"Retrieves product rate plan with charges.": "Récupère le tarif des produits avec des frais.",
"Retrieves product based on sku.": "Récupère le produit basé sur l'UGS.",
"Customer Account Number": "Numéro de compte client",
"Auto Pay?": "Paiement automatique ?",
"Comments": "Commentaires",
"Due Date": "Date de fin",
"Invoice Date": "Date de la facture",
"Invoice Items": "Éléments de facture",
"Status": "Statut",
"Account Name": "Nom du compte",
"Product Rate Plan Name": "Nom du plan tarifaire du produit",
"Product ID": "ID du produit",
"Product SKU": "REF du produit",
"The number of the customer account associated with the invoice.": "Le numéro du compte client associé à la facture.",
"Whether invoices are automatically picked up for processing in the corresponding payment run.": "Si les factures sont automatiquement ramassées pour être traitées dans le mode de paiement correspondant.",
"Provide YYYY-MM-DD format.": "Fournir le format AAAA-MM-JJ.",
"i.e. StealthCo Premium": "ex: StealthCo Premium",
"Draft": "Brouillon",
"Posted": "Publié"
}

View File

@@ -0,0 +1,40 @@
{
"Cloud-based subscription management platform that enables businesses to launch and monetize subscription services.": "企業がサブスクリプションサービスを立ち上げ収益化できるクラウドベースのサブスクリプション管理プラットフォーム。",
"Client ID": "クライアント ID",
"Client Secret": "Client Secret",
"Environment": "環境",
"US Cloud 1 Production": "US Cloud 1 Production",
"US Cloud 1 API Sandbox": "US Cloud 1 API Sandbox",
"US Cloud 2 Production": "US Cloud 2 Production",
"US Cloud 2 API Sandbox": "US Cloud 2 API Sandbox",
"US Central Sandbox": "米国中央サンドボックス",
"EU Production": "EU生産",
"EU API Sandbox": "EU API Sandbox",
"EU Developer & Central Sandbox": "EU 開発者&中央サンドボックス",
"\n - **Establish a Dedicated API User** : Zuora recommends creating a distinct API user specifically for OAuth authentication with write permissions. Refer to the [API User Creation Guide](https://knowledgecenter.zuora.com/Zuora_Central_Platform/Tenant_Management/A_Administrator_Settings/Manage_Users/Create_an_API_User) for detailed instructions on setting up this user.\n - **Create OAuth Client** : After setting up the API user, it's essential to create an OAuth client tailored for this user.Detailed instr": "\n - **Establish a Dedicated API User** : Zuora recommends creating a distinct API user specifically for OAuth authentication with write permissions. Refer to the [API User Creation Guide](https://knowledgecenter.zuora.com/Zuora_Central_Platform/Tenant_Management/A_Administrator_Settings/Manage_Users/Create_an_API_User) for detailed instructions on setting up this user.\n - **Create OAuth Client** : After setting up the API user, it's essential to create an OAuth client tailored for this user.Detailed instructions can be found in the [OAuth Client Creation Guide](https://knowledgecenter.zuora.com/Zuora_Central_Platform/Tenant_Management/A_Administrator_Settings/Manage_Users).\n - **Refer to Base API URL** : Utilize the [Base API URL](https://developer.zuora.com/v1-api-reference/introduction/#section/Introduction/Access-to-the-API) provided by Zuora for your environment. This URL serves as the entry point for accessing the Zuora API.",
"Create Invoice": "請求書を作成",
"Find Customer Account": "顧客アカウントを検索",
"Find Product Rate Plan": "商品レートプランを探す",
"Find Product": "商品を検索",
"Create a standalone invoice.": "スタンドアロンの請求書を作成します。",
"Retrieves account based on name.": "名前に基づいてアカウントを取得します。",
"Retrieves product rate plan with charges.": "料金で製品レートプランを取得します。",
"Retrieves product based on sku.": "skuに基づいて製品を取得します。",
"Customer Account Number": "顧客口座番号",
"Auto Pay?": "自動支払いしますか?",
"Comments": "コメント",
"Due Date": "締切日",
"Invoice Date": "請求日",
"Invoice Items": "請求書商品",
"Status": "Status",
"Account Name": "口座名",
"Product Rate Plan Name": "商品レートプラン名",
"Product ID": "商品ID",
"Product SKU": "商品SKU",
"The number of the customer account associated with the invoice.": "請求書に関連付けられている顧客アカウントの数",
"Whether invoices are automatically picked up for processing in the corresponding payment run.": "対応する支払い実行で請求書を自動的にピックアップするかどうか。",
"Provide YYYY-MM-DD format.": "YYYY-MM-DD フォーマットを提供します。",
"i.e. StealthCo Premium": "例: StealthCoプレミアム",
"Draft": "下書き",
"Posted": "投稿済み"
}

View File

@@ -0,0 +1,40 @@
{
"Cloud-based subscription management platform that enables businesses to launch and monetize subscription services.": "Abonnementenbeheerplatform dat bedrijven in staat stelt abonnementsdiensten te lanceren en geld te verdienen.",
"Client ID": "Klant ID",
"Client Secret": "Client Secret",
"Environment": "Milieu",
"US Cloud 1 Production": "Amerikaanse Cloud 1 productie",
"US Cloud 1 API Sandbox": "Cloud 1 API Sandbox",
"US Cloud 2 Production": "Amerikaanse Cloud 2 productie",
"US Cloud 2 API Sandbox": "Cloud 2 API Sandbox",
"US Central Sandbox": "Centrale Sandbox van de VS",
"EU Production": "EU productie",
"EU API Sandbox": "EU API Sandbox",
"EU Developer & Central Sandbox": "EU Ontwikkelaar & Centrale Sandbox",
"\n - **Establish a Dedicated API User** : Zuora recommends creating a distinct API user specifically for OAuth authentication with write permissions. Refer to the [API User Creation Guide](https://knowledgecenter.zuora.com/Zuora_Central_Platform/Tenant_Management/A_Administrator_Settings/Manage_Users/Create_an_API_User) for detailed instructions on setting up this user.\n - **Create OAuth Client** : After setting up the API user, it's essential to create an OAuth client tailored for this user.Detailed instr": "\n - **Maak een eigen API gebruiker** : Zuora raadt het maken van een specifieke API gebruiker aan met schrijfrechten. Raadpleeg de [API User Creation Guide] (https://knowledgecenter.zuora.com/Zuora_Central_Platform/Tenant_Management/A_Administrator_Settings/Manage_Users/Create_an_API_User) voor gedetailleerde instructies over het opzetten van deze gebruiker.\n - **Maak OAuth Client** : Na het opzetten van de API-gebruiker is het essentieel om een OAuth client op maat voor deze gebruiker te maken. etarieerde instructies zijn te vinden in de [OAuth Client Creation Guide](https://knowledgecenter.zuora.com/Zuora_Central_Platform/Tenant_Management/A_Administrator_Settings/Manage_Users).\n - **Raadpleeg de Basis API URL** : Gebruik de [Base API URL](https://developer.zuora.com/v1-api-reference/introduction/#section/Introduction/Access-to-the-API) geleverd door Zuora voor jouw omgeving. Deze URL dient als toegangspunt voor toegang tot de Zuora API.",
"Create Invoice": "Factuur aanmaken",
"Find Customer Account": "Klantaccount zoeken",
"Find Product Rate Plan": "Zoek een producttarief",
"Find Product": "Zoek product",
"Create a standalone invoice.": "Maak een zelfstandige factuur.",
"Retrieves account based on name.": "Ophalen van account op basis van naam.",
"Retrieves product rate plan with charges.": "Haal een producttarief op met kosten.",
"Retrieves product based on sku.": "Ophalen product gebaseerd op sku.",
"Customer Account Number": "Klant Rekeningnummer",
"Auto Pay?": "Automatisch betalen?",
"Comments": "Opmerkingen",
"Due Date": "Inleverdatum",
"Invoice Date": "Factuur datum",
"Invoice Items": "Factuur artikelen",
"Status": "status",
"Account Name": "Klant naam",
"Product Rate Plan Name": "Naam productbeoordeling",
"Product ID": "Product ID",
"Product SKU": "Product Art.nr.",
"The number of the customer account associated with the invoice.": "Het nummer van het klantaccount dat is gekoppeld aan de factuur.",
"Whether invoices are automatically picked up for processing in the corresponding payment run.": "Of facturen automatisch worden opgehaald voor verwerking in de overeenkomstige betaling wordt uitgevoerd.",
"Provide YYYY-MM-DD format.": "Geef JJJJ-MM-DD formaat.",
"i.e. StealthCo Premium": "d.w.z. StealthCo Premium",
"Draft": "Concept",
"Posted": "Geplaatst"
}

View File

@@ -0,0 +1,40 @@
{
"Cloud-based subscription management platform that enables businesses to launch and monetize subscription services.": "Plataforma de gerenciamento de assinatura baseada na nuvem que permite às empresas lançar e monetizar serviços de assinatura.",
"Client ID": "ID do Cliente",
"Client Secret": "Chave secreta",
"Environment": "Seguros",
"US Cloud 1 Production": "Produção de 1 Nuvem dos EUA",
"US Cloud 1 API Sandbox": "US Cloud 1 API Sandbox",
"US Cloud 2 Production": "Produção dos EUA Cloud 2",
"US Cloud 2 API Sandbox": "US Cloud 2 API Sandbox",
"US Central Sandbox": "Sandbox Central dos EUA",
"EU Production": "Produção da UE",
"EU API Sandbox": "API Sandbox da UE",
"EU Developer & Central Sandbox": "Desenvolvedor da UE e Sandbox Central",
"\n - **Establish a Dedicated API User** : Zuora recommends creating a distinct API user specifically for OAuth authentication with write permissions. Refer to the [API User Creation Guide](https://knowledgecenter.zuora.com/Zuora_Central_Platform/Tenant_Management/A_Administrator_Settings/Manage_Users/Create_an_API_User) for detailed instructions on setting up this user.\n - **Create OAuth Client** : After setting up the API user, it's essential to create an OAuth client tailored for this user.Detailed instr": "\n - **Estabeleça um usuário dedicado da API** : o Zuora recomenda a criação de um usuário de API distinto, especificamente para autenticação OAuth com permissões de escrita. Consulte o [Guia de Criação de Usuário da API](https://knowledgecenter.zuora.com/Zuora_Central_Platform/Tenant_Management/A_Administrator_Settings/Manage_Users/Create_an_API_User) para instruções detalhadas sobre a configuração deste usuário.\n - **Criar cliente OAuth** : depois de configurar o usuário da API, é essencial criar um cliente OAuth adaptado a este usuário. instruções etaled podem ser encontradas no [Guia de Criação de Cliente OAuth](https://knowledgecenter.zuora.com/Zuora_Central_Platform/Tenant_Management/A_Administrator_Settings/Manage_Users).\n - **Consulte a URL da API base**: utilize a [URL Base da API](https://developer.zuora.com/v1-api-reference/introduction/#section/Introduction/Access-to-the-API) fornecida pelo Zuora para seu ambiente. Esta URL serve como o ponto de entrada para acessar a API do Zuora.",
"Create Invoice": "Criar fatura",
"Find Customer Account": "Encontrar conta de cliente",
"Find Product Rate Plan": "Encontrar plano de taxa de produto",
"Find Product": "Encontrar produto",
"Create a standalone invoice.": "Criar uma fatura independente.",
"Retrieves account based on name.": "Recupera conta baseada no nome.",
"Retrieves product rate plan with charges.": "Recupera o plano de taxa de produto com cobranças.",
"Retrieves product based on sku.": "Recupera produto baseado no sku.",
"Customer Account Number": "Número da conta do cliente",
"Auto Pay?": "Pagamento automático?",
"Comments": "comentários",
"Due Date": "Data de vencimento",
"Invoice Date": "Data da Fatura",
"Invoice Items": "Itens da Fatura",
"Status": "Estado",
"Account Name": "Nome da Conta",
"Product Rate Plan Name": "Taxa do Produto Plano Nome",
"Product ID": "ID do Produto",
"Product SKU": "SKU do produto",
"The number of the customer account associated with the invoice.": "O número da conta do cliente associada à fatura.",
"Whether invoices are automatically picked up for processing in the corresponding payment run.": "Se as faturas são automaticamente selecionadas para processamento na execução do pagamento correspondente.",
"Provide YYYY-MM-DD format.": "Forneça o formato AAAA-MM-DD.",
"i.e. StealthCo Premium": "ex: StealthCo Premium",
"Draft": "Rascunho",
"Posted": "Postado"
}

View File

@@ -0,0 +1,41 @@
{
"Zuora": "Zuora",
"Cloud-based subscription management platform that enables businesses to launch and monetize subscription services.": "Облачная платформа управления подписками, позволяющая предприятиям запускать и монетизировать абонентские услуги.",
"Client ID": "ID клиента",
"Client Secret": "Секрет клиента",
"Environment": "Среда",
"US Cloud 1 Production": "Производство Облака 1 США",
"US Cloud 1 API Sandbox": "Облако США 1 песочница API",
"US Cloud 2 Production": "Производство Облака 2",
"US Cloud 2 API Sandbox": "Облак США 2 песочницы API",
"US Central Sandbox": "Центральная песочница США",
"EU Production": "Производство ЕС",
"EU API Sandbox": "Песочница EU API",
"EU Developer & Central Sandbox": "EU Developer & Central Sandbox",
"\n - **Establish a Dedicated API User** : Zuora recommends creating a distinct API user specifically for OAuth authentication with write permissions. Refer to the [API User Creation Guide](https://knowledgecenter.zuora.com/Zuora_Central_Platform/Tenant_Management/A_Administrator_Settings/Manage_Users/Create_an_API_User) for detailed instructions on setting up this user.\n - **Create OAuth Client** : After setting up the API user, it's essential to create an OAuth client tailored for this user.Detailed instr": "\n - **Установить выделенного пользователя API** : Zuora рекомендует создать отдельного пользователя API для аутентификации OAuth с правами на запись. Подробную инструкцию по настройке пользователя можно найти в [Руководстве по созданию пользователей API](https://knowledgecenter.zuora.com/Zuora_Central_Platform/Tenant_Management/A_Administrator_Settings/Manage_Users/Create_an_API_User).\n - **Создать клиента OAuth** : После настройки пользователя API, необходимо создать OAuth клиент для этого пользователя. подробные инструкции можно найти в [Руководстве по созданию клиентов OAuth ](https://knowledgecenter.zuora.com/Zuora_Central_Platform/Tenant_Management/A_Administrator_Settings/Manage_Users).\n - **Обратитесь к базовому API URL** : Используйте [Base API URL](https://developer.zuora.com/v1-api-reference/introduction/#section/Introduction/Access-to-the-API) предоставляемый Zuora для вашей среды. Этот URL служит отправной точкой для доступа к API Zuora.",
"Create Invoice": "Создать счет",
"Find Customer Account": "Найти аккаунт клиента",
"Find Product Rate Plan": "Найти тарифный план",
"Find Product": "Найти продукт",
"Create a standalone invoice.": "Создать отдельный счет-фактуру.",
"Retrieves account based on name.": "Возвращает аккаунт на основе имени.",
"Retrieves product rate plan with charges.": "Получает тарифный план с оплатами.",
"Retrieves product based on sku.": "Возвращает продукт на основе sku.",
"Customer Account Number": "Номер клиента",
"Auto Pay?": "Автоматическая оплата?",
"Comments": "Комментарии",
"Due Date": "Срок сдачи",
"Invoice Date": "Дата Счета",
"Invoice Items": "Элементы счета",
"Status": "Status",
"Account Name": "Имя аккаунта",
"Product Rate Plan Name": "Название плана тарифа продукта",
"Product ID": "ID товара",
"Product SKU": "Артикул товара",
"The number of the customer account associated with the invoice.": "Номер учетной записи клиента, связанной с выставлением счета.",
"Whether invoices are automatically picked up for processing in the corresponding payment run.": "Подбираются ли счета автоматически для обработки в соответствующем режиме оплаты.",
"Provide YYYY-MM-DD format.": "Предоставьте формат YYYY-MM-DD.",
"i.e. StealthCo Premium": "напр. StealthCo Premium",
"Draft": "Черновик",
"Posted": "Опубликовано"
}

View File

@@ -0,0 +1,40 @@
{
"Cloud-based subscription management platform that enables businesses to launch and monetize subscription services.": "Cloud-based subscription management platform that enables businesses to launch and monetize subscription services.",
"Client ID": "Client ID",
"Client Secret": "Client Secret",
"Environment": "Environment",
"US Cloud 1 Production": "US Cloud 1 Production",
"US Cloud 1 API Sandbox": "US Cloud 1 API Sandbox",
"US Cloud 2 Production": "US Cloud 2 Production",
"US Cloud 2 API Sandbox": "US Cloud 2 API Sandbox",
"US Central Sandbox": "US Central Sandbox",
"EU Production": "EU Production",
"EU API Sandbox": "EU API Sandbox",
"EU Developer & Central Sandbox": "EU Developer & Central Sandbox",
"\n - **Establish a Dedicated API User** : Zuora recommends creating a distinct API user specifically for OAuth authentication with write permissions. Refer to the [API User Creation Guide](https://knowledgecenter.zuora.com/Zuora_Central_Platform/Tenant_Management/A_Administrator_Settings/Manage_Users/Create_an_API_User) for detailed instructions on setting up this user.\n - **Create OAuth Client** : After setting up the API user, it's essential to create an OAuth client tailored for this user.Detailed instr": "\n - **Establish a Dedicated API User** : Zuora recommends creating a distinct API user specifically for OAuth authentication with write permissions. Refer to the [API User Creation Guide](https://knowledgecenter.zuora.com/Zuora_Central_Platform/Tenant_Management/A_Administrator_Settings/Manage_Users/Create_an_API_User) for detailed instructions on setting up this user.\n - **Create OAuth Client** : After setting up the API user, it's essential to create an OAuth client tailored for this user.Detailed instructions can be found in the [OAuth Client Creation Guide](https://knowledgecenter.zuora.com/Zuora_Central_Platform/Tenant_Management/A_Administrator_Settings/Manage_Users).\n - **Refer to Base API URL** : Utilize the [Base API URL](https://developer.zuora.com/v1-api-reference/introduction/#section/Introduction/Access-to-the-API) provided by Zuora for your environment. This URL serves as the entry point for accessing the Zuora API.",
"Create Invoice": "Create Invoice",
"Find Customer Account": "Find Customer Account",
"Find Product Rate Plan": "Find Product Rate Plan",
"Find Product": "Find Product",
"Create a standalone invoice.": "Create a standalone invoice.",
"Retrieves account based on name.": "Retrieves account based on name.",
"Retrieves product rate plan with charges.": "Retrieves product rate plan with charges.",
"Retrieves product based on sku.": "Retrieves product based on sku.",
"Customer Account Number": "Customer Account Number",
"Auto Pay?": "Auto Pay?",
"Comments": "Comments",
"Due Date": "Due Date",
"Invoice Date": "Invoice Date",
"Invoice Items": "Invoice Items",
"Status": "Status",
"Account Name": "Account Name",
"Product Rate Plan Name": "Product Rate Plan Name",
"Product ID": "Product ID",
"Product SKU": "Product SKU",
"The number of the customer account associated with the invoice.": "The number of the customer account associated with the invoice.",
"Whether invoices are automatically picked up for processing in the corresponding payment run.": "Whether invoices are automatically picked up for processing in the corresponding payment run.",
"Provide YYYY-MM-DD format.": "Provide YYYY-MM-DD format.",
"i.e. StealthCo Premium": "i.e. StealthCo Premium",
"Draft": "Draft",
"Posted": "Posted"
}

View File

@@ -0,0 +1,41 @@
{
"Zuora": "Zuora",
"Cloud-based subscription management platform that enables businesses to launch and monetize subscription services.": "Cloud-based subscription management platform that enables businesses to launch and monetize subscription services.",
"Client ID": "Client ID",
"Client Secret": "Client Secret",
"Environment": "Environment",
"US Cloud 1 Production": "US Cloud 1 Production",
"US Cloud 1 API Sandbox": "US Cloud 1 API Sandbox",
"US Cloud 2 Production": "US Cloud 2 Production",
"US Cloud 2 API Sandbox": "US Cloud 2 API Sandbox",
"US Central Sandbox": "US Central Sandbox",
"EU Production": "EU Production",
"EU API Sandbox": "EU API Sandbox",
"EU Developer & Central Sandbox": "EU Developer & Central Sandbox",
"\n - **Establish a Dedicated API User** : Zuora recommends creating a distinct API user specifically for OAuth authentication with write permissions. Refer to the [API User Creation Guide](https://knowledgecenter.zuora.com/Zuora_Central_Platform/Tenant_Management/A_Administrator_Settings/Manage_Users/Create_an_API_User) for detailed instructions on setting up this user.\n - **Create OAuth Client** : After setting up the API user, it's essential to create an OAuth client tailored for this user.Detailed instr": "\n - **Establish a Dedicated API User** : Zuora recommends creating a distinct API user specifically for OAuth authentication with write permissions. Refer to the [API User Creation Guide](https://knowledgecenter.zuora.com/Zuora_Central_Platform/Tenant_Management/A_Administrator_Settings/Manage_Users/Create_an_API_User) for detailed instructions on setting up this user.\n - **Create OAuth Client** : After setting up the API user, it's essential to create an OAuth client tailored for this user.Detailed instructions can be found in the [OAuth Client Creation Guide](https://knowledgecenter.zuora.com/Zuora_Central_Platform/Tenant_Management/A_Administrator_Settings/Manage_Users).\n - **Refer to Base API URL** : Utilize the [Base API URL](https://developer.zuora.com/v1-api-reference/introduction/#section/Introduction/Access-to-the-API) provided by Zuora for your environment. This URL serves as the entry point for accessing the Zuora API.",
"Create Invoice": "Create Invoice",
"Find Customer Account": "Find Customer Account",
"Find Product Rate Plan": "Find Product Rate Plan",
"Find Product": "Find Product",
"Create a standalone invoice.": "Create a standalone invoice.",
"Retrieves account based on name.": "Retrieves account based on name.",
"Retrieves product rate plan with charges.": "Retrieves product rate plan with charges.",
"Retrieves product based on sku.": "Retrieves product based on sku.",
"Customer Account Number": "Customer Account Number",
"Auto Pay?": "Auto Pay?",
"Comments": "Comments",
"Due Date": "Due Date",
"Invoice Date": "Invoice Date",
"Invoice Items": "Invoice Items",
"Status": "Status",
"Account Name": "Account Name",
"Product Rate Plan Name": "Product Rate Plan Name",
"Product ID": "Product ID",
"Product SKU": "Product SKU",
"The number of the customer account associated with the invoice.": "The number of the customer account associated with the invoice.",
"Whether invoices are automatically picked up for processing in the corresponding payment run.": "Whether invoices are automatically picked up for processing in the corresponding payment run.",
"Provide YYYY-MM-DD format.": "Provide YYYY-MM-DD format.",
"i.e. StealthCo Premium": "i.e. StealthCo Premium",
"Draft": "Bản nháp",
"Posted": "Posted"
}

View File

@@ -0,0 +1,40 @@
{
"Cloud-based subscription management platform that enables businesses to launch and monetize subscription services.": "Cloud-based subscription management platform that enables businesses to launch and monetize subscription services.",
"Client ID": "客户端ID",
"Client Secret": "客户端密钥",
"Environment": "Environment",
"US Cloud 1 Production": "US Cloud 1 Production",
"US Cloud 1 API Sandbox": "US Cloud 1 API Sandbox",
"US Cloud 2 Production": "US Cloud 2 Production",
"US Cloud 2 API Sandbox": "US Cloud 2 API Sandbox",
"US Central Sandbox": "US Central Sandbox",
"EU Production": "EU Production",
"EU API Sandbox": "EU API Sandbox",
"EU Developer & Central Sandbox": "EU Developer & Central Sandbox",
"\n - **Establish a Dedicated API User** : Zuora recommends creating a distinct API user specifically for OAuth authentication with write permissions. Refer to the [API User Creation Guide](https://knowledgecenter.zuora.com/Zuora_Central_Platform/Tenant_Management/A_Administrator_Settings/Manage_Users/Create_an_API_User) for detailed instructions on setting up this user.\n - **Create OAuth Client** : After setting up the API user, it's essential to create an OAuth client tailored for this user.Detailed instr": "\n - **Establish a Dedicated API User** : Zuora recommends creating a distinct API user specifically for OAuth authentication with write permissions. Refer to the [API User Creation Guide](https://knowledgecenter.zuora.com/Zuora_Central_Platform/Tenant_Management/A_Administrator_Settings/Manage_Users/Create_an_API_User) for detailed instructions on setting up this user.\n - **Create OAuth Client** : After setting up the API user, it's essential to create an OAuth client tailored for this user.Detailed instructions can be found in the [OAuth Client Creation Guide](https://knowledgecenter.zuora.com/Zuora_Central_Platform/Tenant_Management/A_Administrator_Settings/Manage_Users).\n - **Refer to Base API URL** : Utilize the [Base API URL](https://developer.zuora.com/v1-api-reference/introduction/#section/Introduction/Access-to-the-API) provided by Zuora for your environment. This URL serves as the entry point for accessing the Zuora API.",
"Create Invoice": "Create Invoice",
"Find Customer Account": "Find Customer Account",
"Find Product Rate Plan": "Find Product Rate Plan",
"Find Product": "Find Product",
"Create a standalone invoice.": "Create a standalone invoice.",
"Retrieves account based on name.": "Retrieves account based on name.",
"Retrieves product rate plan with charges.": "Retrieves product rate plan with charges.",
"Retrieves product based on sku.": "Retrieves product based on sku.",
"Customer Account Number": "Customer Account Number",
"Auto Pay?": "Auto Pay?",
"Comments": "Comments",
"Due Date": "Due Date",
"Invoice Date": "Invoice Date",
"Invoice Items": "Invoice Items",
"Status": "状态",
"Account Name": "Account Name",
"Product Rate Plan Name": "Product Rate Plan Name",
"Product ID": "Product ID",
"Product SKU": "Product SKU",
"The number of the customer account associated with the invoice.": "The number of the customer account associated with the invoice.",
"Whether invoices are automatically picked up for processing in the corresponding payment run.": "Whether invoices are automatically picked up for processing in the corresponding payment run.",
"Provide YYYY-MM-DD format.": "Provide YYYY-MM-DD format.",
"i.e. StealthCo Premium": "i.e. StealthCo Premium",
"Draft": "草稿",
"Posted": "Posted"
}

View File

@@ -0,0 +1,90 @@
import {
createPiece,
PieceAuth,
Property,
} from '@activepieces/pieces-framework';
import { createInvoiceAction } from './lib/actions/create-invoice.action';
import { PieceCategory } from '@activepieces/shared';
import { findProductRatePlanAction } from './lib/actions/find-product-rate-plans.action';
import { findAccountAction } from './lib/actions/find-account.action';
import { findProductAction } from './lib/actions/find-product.action';
export const zuoraAuth = PieceAuth.CustomAuth({
description: `
- **Establish a Dedicated API User** : Zuora recommends creating a distinct API user specifically for OAuth authentication with write permissions. Refer to the [API User Creation Guide](https://knowledgecenter.zuora.com/Zuora_Central_Platform/Tenant_Management/A_Administrator_Settings/Manage_Users/Create_an_API_User) for detailed instructions on setting up this user.
- **Create OAuth Client** : After setting up the API user, it's essential to create an OAuth client tailored for this user.Detailed instructions can be found in the [OAuth Client Creation Guide](https://knowledgecenter.zuora.com/Zuora_Central_Platform/Tenant_Management/A_Administrator_Settings/Manage_Users).
- **Refer to Base API URL** : Utilize the [Base API URL](https://developer.zuora.com/v1-api-reference/introduction/#section/Introduction/Access-to-the-API) provided by Zuora for your environment. This URL serves as the entry point for accessing the Zuora API.`,
required: true,
props: {
clientId: Property.ShortText({
displayName: 'Client ID',
required: true,
}),
clientSecret: Property.ShortText({
displayName: 'Client Secret',
required: true,
}),
environment: Property.StaticDropdown({
displayName: 'Environment',
required: true,
options: {
disabled: false,
options: [
{
label: 'US Cloud 1 Production',
value: 'https://rest.na.zuora.com',
},
{
label: 'US Cloud 1 API Sandbox',
value: 'https://rest.sandbox.na.zuora.com',
},
{
label: 'US Cloud 2 Production',
value: 'https://rest.zuora.com',
},
{
label: 'US Cloud 2 API Sandbox',
value: 'https://rest.apisandbox.zuora.com',
},
{
label: 'US Central Sandbox',
value: 'https://rest.test.zuora.com',
},
{
label: 'EU Production',
value: 'https://rest.eu.zuora.com',
},
{
label: 'EU API Sandbox',
value: 'https://rest.sandbox.eu.zuora.com',
},
{
label: 'EU Developer & Central Sandbox',
value: 'https://rest.test.eu.zuora.com',
},
],
},
}),
},
});
export const zuora = createPiece({
displayName: 'Zuora',
auth: zuoraAuth,
minimumSupportedRelease: '0.27.1',
description:
'Cloud-based subscription management platform that enables businesses to launch and monetize subscription services.',
logoUrl: 'https://cdn.activepieces.com/pieces/zuora.png',
categories: [
PieceCategory.SALES_AND_CRM,
PieceCategory.PAYMENT_PROCESSING,
],
authors: ['kishanprmr'],
actions: [
createInvoiceAction,
findAccountAction,
findProductRatePlanAction,
findProductAction,
],
triggers: [],
});

View File

@@ -0,0 +1,132 @@
import { zuoraAuth } from '../../';
import { createAction, Property } from '@activepieces/pieces-framework';
import { getAccessToken } from '../common';
import {
AuthenticationType,
httpClient,
HttpMethod,
HttpRequest,
} from '@activepieces/pieces-common';
export const createInvoiceAction = createAction({
auth: zuoraAuth,
name: 'create-invoice',
displayName: 'Create Invoice',
description: 'Create a standalone invoice.',
props: {
accountNumber: Property.ShortText({
displayName: 'Customer Account Number',
description:
'The number of the customer account associated with the invoice.',
required: true,
}),
autoPay: Property.Checkbox({
displayName: 'Auto Pay?',
description:
'Whether invoices are automatically picked up for processing in the corresponding payment run.',
required: false,
}),
comments: Property.LongText({
displayName: 'Comments',
required: false,
}),
dueDate: Property.DateTime({
displayName: 'Due Date',
description: 'Provide YYYY-MM-DD format.',
required: true,
}),
invoiceDate: Property.DateTime({
displayName: 'Invoice Date',
required: true,
description: 'Provide YYYY-MM-DD format.',
}),
invoiceItems: Property.Array({
displayName: 'Invoice Items',
required: false,
properties: {
productRatePlanChargeId: Property.ShortText({
displayName: 'Product Rate Plan Charge ID',
description:
'The ID of the product rate plan charge that the invoice item is created from.You can use `Find Product Rate Plan` action to search associate rate plan charge.',
required: true,
}),
amount: Property.Number({
displayName: 'Amount',
required: true,
}),
description: Property.LongText({
displayName: 'Description',
required: false,
}),
purchaseOrderNumber: Property.ShortText({
displayName: 'Purchase Order Number',
required: false,
}),
quantity: Property.ShortText({
displayName: 'Quantity',
required: false,
}),
serviceStartDate: Property.ShortText({
displayName: 'Service Start Date',
description: 'Provide YYYY-MM-DD format.',
required: true,
}),
serviceEndDate: Property.ShortText({
displayName: 'Service End Date',
description: 'Provide YYYY-MM-DD format.',
required: false,
}),
},
}),
status: Property.StaticDropdown({
displayName: 'Status',
required: false,
defaultValue: 'Draft',
options: {
disabled: false,
options: [
{ label: 'Draft', value: 'Draft' },
{ label: 'Posted', value: 'Posted' },
],
},
}),
},
async run(context) {
const { accountNumber, autoPay, comments, dueDate, invoiceDate, status } =
context.propsValue;
const invoiceItems = context.propsValue.invoiceItems as InvoiceItemInput[];
const token = await getAccessToken(context.auth);
const body = {
accountNumber,
autoPay,
comments,
dueDate,
invoiceDate,
status,
invoiceItems,
};
const request: HttpRequest = {
method: HttpMethod.POST,
url: `${context.auth.props.environment}/v1/invoices`,
authentication: { type: AuthenticationType.BEARER_TOKEN, token },
body,
};
const response = await httpClient.sendRequest(request);
return response.body;
},
});
type InvoiceItemInput = {
productRatePlanChargeId: string;
amount: string;
description: string;
purchaseOrderNumber: string;
quantity: string;
serviceStartDate: string;
serviceEndDate: string;
};

View File

@@ -0,0 +1,38 @@
import { zuoraAuth } from '../../';
import { createAction, Property } from '@activepieces/pieces-framework';
import { getAccessToken } from '../common';
import {
AuthenticationType,
httpClient,
HttpMethod,
HttpRequest,
} from '@activepieces/pieces-common';
export const findAccountAction = createAction({
auth: zuoraAuth,
name: 'find-account',
displayName: 'Find Customer Account',
description: 'Retrieves account based on name.',
props: {
name: Property.ShortText({
displayName: 'Account Name',
required: true,
}),
},
async run(context) {
const name = context.propsValue.name;
const token = await getAccessToken(context.auth);
const request: HttpRequest = {
method: HttpMethod.GET,
url: `${context.auth.props.environment}/object-query/accounts`,
authentication: { type: AuthenticationType.BEARER_TOKEN, token },
queryParams: {
'filter[]': `name.EQ:${name}`,
},
};
const response = await httpClient.sendRequest(request);
return response.body;
},
});

View File

@@ -0,0 +1,44 @@
import { zuoraAuth } from '../..';
import { createAction, Property } from '@activepieces/pieces-framework';
import { getAccessToken } from '../common';
import {
AuthenticationType,
httpClient,
HttpMethod,
HttpRequest,
} from '@activepieces/pieces-common';
export const findProductRatePlanAction = createAction({
auth: zuoraAuth,
name: 'find-product-rate-plan',
displayName: 'Find Product Rate Plan',
description: 'Retrieves product rate plan with charges.',
props: {
name: Property.ShortText({
displayName: 'Product Rate Plan Name',
description: 'i.e. StealthCo Premium',
required: true,
}),
productid: Property.ShortText({
displayName: 'Product ID',
required: true,
}),
},
async run(context) {
const name = context.propsValue.name;
const productid = context.propsValue.productid;
const token = await getAccessToken(context.auth);
const request: HttpRequest = {
method: HttpMethod.GET,
url: `${context.auth.props.environment}/object-query/product-rate-plans?filter[]=name.EQ:${name}&filter[]=productid.EQ:${productid}`,
authentication: { type: AuthenticationType.BEARER_TOKEN, token },
queryParams: {
'expand[]': 'productrateplancharges',
},
};
const response = await httpClient.sendRequest(request);
return response.body;
},
});

View File

@@ -0,0 +1,38 @@
import { zuoraAuth } from '../../';
import { createAction, Property } from '@activepieces/pieces-framework';
import { getAccessToken } from '../common';
import {
AuthenticationType,
httpClient,
HttpMethod,
HttpRequest,
} from '@activepieces/pieces-common';
export const findProductAction = createAction({
auth: zuoraAuth,
name: 'find-product',
displayName: 'Find Product',
description: 'Retrieves product based on sku.',
props: {
sku: Property.ShortText({
displayName: 'Product SKU',
required: true,
}),
},
async run(context) {
const sku = context.propsValue.sku;
const token = await getAccessToken(context.auth);
const request: HttpRequest = {
method: HttpMethod.GET,
url: `${context.auth.props.environment}/object-query/products`,
authentication: { type: AuthenticationType.BEARER_TOKEN, token },
queryParams: {
'filter[]': `sku.EQ:${sku}`,
},
};
const response = await httpClient.sendRequest(request);
return response.body;
},
});

View File

@@ -0,0 +1,104 @@
import { zuoraAuth } from '../../';
import {
AppConnectionValueForAuthProperty,
DropdownOption,
PiecePropValueSchema,
Property,
} from '@activepieces/pieces-framework';
import {
AuthenticationType,
httpClient,
HttpMethod,
HttpRequest,
QueryParams,
} from '@activepieces/pieces-common';
export async function queryAccounts(
auth: AppConnectionValueForAuthProperty<typeof zuoraAuth>
) {
const token = await getAccessToken(auth);
const result: Record<string, any>[] = [];
let cursor;
do {
const qs: QueryParams = {
pageSize: '50',
'fields[]': 'id,name',
'sort[]': 'updated_time.desc',
};
if (cursor) {
qs['cursor'] = cursor;
}
const request: HttpRequest = {
method: HttpMethod.GET,
url: `${auth.props.environment}/v2/accounts`,
queryParams: qs,
authentication: {
type: AuthenticationType.BEARER_TOKEN,
token,
},
};
const response = await httpClient.sendRequest(request);
result.push(...response.body['data']);
cursor = response.body['nextPage'];
} while (cursor);
return result;
}
export async function getAccessToken(
auth: AppConnectionValueForAuthProperty<typeof zuoraAuth>
): Promise<string> {
const request: HttpRequest = {
method: HttpMethod.POST,
url: `${auth.props.environment}/oauth/token`,
body: new URLSearchParams({
client_id: auth.props.clientId,
client_secret: auth.props.clientSecret,
grant_type: 'client_credentials',
}),
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
};
const response = await httpClient.sendRequest(request);
return response.body['access_token'];
}
export const zuoraCommonProps = {
account_id: (displayName: string, description: string, required: boolean) =>
Property.Dropdown({
auth: zuoraAuth,
displayName,
description,
required,
refreshers: [],
options: async ({ auth }) => {
if (!auth) {
return {
disabled: true,
options: [],
placeholder: 'Please connect your account first',
};
}
const authValue = auth as AppConnectionValueForAuthProperty<typeof zuoraAuth>;
const accounts = await queryAccounts(authValue);
const options: DropdownOption<string>[] = [];
for (const account of accounts) {
options.push({
label: account['name'] ?? account['id'],
value: account['id'],
});
}
return {
disabled: false,
options,
};
},
}),
};

View File

@@ -0,0 +1,19 @@
{
"extends": "../../../../tsconfig.base.json",
"compilerOptions": {
"module": "commonjs",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": 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"]
}