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:
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"presets": [["@nx/js/babel", { "useBuiltIns": "usage" }]]
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"extends": ["../../../../.eslintrc.json"],
|
||||
"ignorePatterns": ["!**/*"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
||||
"rules": {}
|
||||
},
|
||||
{
|
||||
"files": ["*.ts", "*.tsx"],
|
||||
"rules": {}
|
||||
},
|
||||
{
|
||||
"files": ["*.js", "*.jsx"],
|
||||
"rules": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
# pieces-wordpress
|
||||
|
||||
This library was generated with [Nx](https://nx.dev).
|
||||
|
||||
## Running lint
|
||||
|
||||
Run `nx lint pieces-wordpress` to execute the lint via [ESLint](https://eslint.org/).
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "@activepieces/piece-wordpress",
|
||||
"version": "0.3.21"
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"name": "pieces-wordpress",
|
||||
"$schema": "../../../../node_modules/nx/schemas/project-schema.json",
|
||||
"sourceRoot": "packages/pieces/community/wordpress/src",
|
||||
"projectType": "library",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@nx/js:tsc",
|
||||
"outputs": [
|
||||
"{options.outputPath}"
|
||||
],
|
||||
"options": {
|
||||
"outputPath": "dist/packages/pieces/community/wordpress",
|
||||
"tsConfig": "packages/pieces/community/wordpress/tsconfig.lib.json",
|
||||
"packageJson": "packages/pieces/community/wordpress/package.json",
|
||||
"main": "packages/pieces/community/wordpress/src/index.ts",
|
||||
"assets": [
|
||||
"packages/pieces/community/wordpress/*.md",
|
||||
{
|
||||
"input": "packages/pieces/community/wordpress/src/i18n",
|
||||
"output": "./src/i18n",
|
||||
"glob": "**/!(i18n.json)"
|
||||
}
|
||||
],
|
||||
"buildableProjectDepsInPackageJsonType": "dependencies",
|
||||
"updateBuildableProjectDepsInPackageJson": true
|
||||
},
|
||||
"dependsOn": [
|
||||
"^build",
|
||||
"prebuild"
|
||||
]
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nx/eslint:lint",
|
||||
"outputs": [
|
||||
"{options.outputFile}"
|
||||
]
|
||||
},
|
||||
"prebuild": {
|
||||
"executor": "nx:run-commands",
|
||||
"options": {
|
||||
"cwd": "packages/pieces/community/wordpress",
|
||||
"command": "bun install --no-save --silent"
|
||||
},
|
||||
"dependsOn": [
|
||||
"^build"
|
||||
]
|
||||
}
|
||||
},
|
||||
"tags": []
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"WordPress": "WordPress",
|
||||
"Open-source website creation software": "Open-source website creation software",
|
||||
"Username": "Username",
|
||||
"Password": "Password",
|
||||
"Website URL": "Website URL",
|
||||
"URL of the wordpress url i.e https://www.example-website.com": "URL of the wordpress url i.e https://www.example-website.com",
|
||||
"\n**Enable Basic Authentication:**\n\n1. Download the plugin from: https://github.com/WP-API/Basic-Auth (Click on Code -> Download Zip)\n2. Log in to your WordPress dashboard.\n3. Go to \"Plugins\" and click \"Add New.\"\n4. Choose \"Upload Plugin\" and select the downloaded file.\n5. Install and activate the plugin.\n\n": "\n**Enable Basic Authentication:**\n\n1. Download the plugin from: https://github.com/WP-API/Basic-Auth (Click on Code -> Download Zip)\n2. Log in to your WordPress dashboard.\n3. Go to \"Plugins\" and click \"Add New.\"\n4. Choose \"Upload Plugin\" and select the downloaded file.\n5. Install and activate the plugin.\n\n",
|
||||
"Create Post": "Create Post",
|
||||
"Create Page": "Create Page",
|
||||
"Update Post": "Update Post",
|
||||
"Get Post Details": "Get Post Details",
|
||||
"Custom API Call": "Custom API Call",
|
||||
"Create new post on WordPress": "Create new post on WordPress",
|
||||
"Create new page on WordPress": "Create new page on WordPress",
|
||||
"Update an existing post on WordPress.": "Update an existing post on WordPress.",
|
||||
"Get a post from WordPress": "Get a post from WordPress",
|
||||
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
|
||||
"Title": "Title",
|
||||
"Content": "Content",
|
||||
"Slug": "Slug",
|
||||
"Date": "Date",
|
||||
"Featured Media (URL)": "Featured Media (URL)",
|
||||
"Tags": "Tags",
|
||||
"Custom ACF fields": "Custom ACF fields",
|
||||
"Categories": "Categories",
|
||||
"Featured Media (image)": "Featured Media (image)",
|
||||
"Status": "Status",
|
||||
"Excerpt": "Excerpt",
|
||||
"Enable Comments": "Enable Comments",
|
||||
"Open to Pinging": "Open to Pinging",
|
||||
"Post": "Post",
|
||||
"Post ID": "Post ID",
|
||||
"Method": "Method",
|
||||
"Headers": "Headers",
|
||||
"Query Parameters": "Query Parameters",
|
||||
"Body": "Body",
|
||||
"No Error on Failure": "No Error on Failure",
|
||||
"Timeout (in seconds)": "Timeout (in seconds)",
|
||||
"Title of the post about to be added": "Title of the post about to be added",
|
||||
"Uses the WordPress Text Editor which supports HTML": "Uses the WordPress Text Editor which supports HTML",
|
||||
"Post publish date (ISO-8601)": "Post publish date (ISO-8601)",
|
||||
"URL of featured media": "URL of featured media",
|
||||
"Post tags": "Post tags",
|
||||
"Provide field name with value.You can find out field name from ACF plugin menu.": "Provide field name with value.You can find out field name from ACF plugin menu.",
|
||||
"Post categories": "Post categories",
|
||||
"Choose from one of your uploaded media files": "Choose from one of your uploaded media files",
|
||||
"Choose post status": "Choose post status",
|
||||
"Title of the page about to be added": "Title of the page about to be added",
|
||||
"Page publish date (ISO-8601)": "Page publish date (ISO-8601)",
|
||||
"Choose status": "Choose status",
|
||||
"The ID of the post to get": "The ID of the post to get",
|
||||
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
|
||||
"Published": "Published",
|
||||
"Scheduled": "Scheduled",
|
||||
"Draft": "Draft",
|
||||
"Pending": "Pending",
|
||||
"Private": "Private",
|
||||
"Trash": "Trash",
|
||||
"GET": "GET",
|
||||
"POST": "POST",
|
||||
"PATCH": "PATCH",
|
||||
"PUT": "PUT",
|
||||
"DELETE": "DELETE",
|
||||
"HEAD": "HEAD",
|
||||
"New Post": "New Post",
|
||||
"Triggers when a new post is published": "Triggers when a new post is published",
|
||||
"Authors": "Authors"
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"Open-source website creation software": "Open-Source-Website-Erstellungssoftware",
|
||||
"Username": "Benutzername",
|
||||
"Password": "Kennwort",
|
||||
"Website URL": "Website-URL",
|
||||
"URL of the wordpress url i.e https://www.example-website.com": "URL des Wordpress url i.e https://www.example-website.com",
|
||||
"\n**Enable Basic Authentication:**\n\n1. Download the plugin from: https://github.com/WP-API/Basic-Auth (Click on Code -> Download Zip)\n2. Log in to your WordPress dashboard.\n3. Go to \"Plugins\" and click \"Add New.\"\n4. Choose \"Upload Plugin\" and select the downloaded file.\n5. Install and activate the plugin.\n\n": "\n**Basic Authentication:**\n\n1. Laden Sie das Plugin herunter von: https://github. om/WP-API/Basic-Auth (Click on Code -> Download Zip)\n2. Melden Sie sich bei Ihrem WordPress-Dashboard an.\n3. Gehen Sie zu \"Plugins\" und klicken Sie auf \"Neu hinzufügen\"\n4. Wähle \"Plugin hochladen\" und wähle die heruntergeladene Datei.\n5. Installiere und aktiviere das Plugin.\n\n",
|
||||
"Create Post": "Beitrag erstellen",
|
||||
"Create Page": "Seite erstellen",
|
||||
"Update Post": "Beitrag aktualisieren",
|
||||
"Get Post Details": "Beitragsdetails abrufen",
|
||||
"Custom API Call": "Eigener API-Aufruf",
|
||||
"Create new post on WordPress": "Neuen Beitrag auf WordPress erstellen",
|
||||
"Create new page on WordPress": "Neue Seite auf WordPress erstellen",
|
||||
"Update an existing post on WordPress.": "Aktualisieren Sie einen vorhandenen Beitrag auf WordPress.",
|
||||
"Get a post from WordPress": "Einen Beitrag von WordPress erhalten",
|
||||
"Make a custom API call to a specific endpoint": "Einen benutzerdefinierten API-Aufruf an einen bestimmten Endpunkt machen",
|
||||
"Title": "Titel",
|
||||
"Content": "Inhalt",
|
||||
"Slug": "Slug",
|
||||
"Date": "Datum",
|
||||
"Featured Media (URL)": "Empfohlene Medien (URL)",
|
||||
"Tags": "Tags",
|
||||
"Custom ACF fields": "Eigene ACF-Felder",
|
||||
"Categories": "Kategorien",
|
||||
"Featured Media (image)": "Empfohlene Medien (Bild)",
|
||||
"Status": "Status",
|
||||
"Excerpt": "Auszug",
|
||||
"Enable Comments": "Kommentare aktivieren",
|
||||
"Open to Pinging": "Zum Pingen öffnen",
|
||||
"Post": "Posten",
|
||||
"Post ID": "Post-ID",
|
||||
"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)",
|
||||
"Title of the post about to be added": "Titel des Beitrags, der hinzugefügt werden soll",
|
||||
"Uses the WordPress Text Editor which supports HTML": "Verwendet den WordPress-Texteditor, der HTML unterstützt",
|
||||
"Post publish date (ISO-8601)": "Veröffentlichungsdatum (ISO-8601)",
|
||||
"URL of featured media": "URL der vorgestellten Medien",
|
||||
"Post tags": "Tags posten",
|
||||
"Provide field name with value.You can find out field name from ACF plugin menu.": "Geben Sie den Feldnamen mit Wert an. Sie können den Feldnamen im ACF-Plugin-Menü finden.",
|
||||
"Post categories": "Post-Kategorien",
|
||||
"Choose from one of your uploaded media files": "Wählen Sie aus einer Ihrer hochgeladenen Mediendateien",
|
||||
"Choose post status": "Post-Status auswählen",
|
||||
"Title of the page about to be added": "Titel der Seite, die hinzugefügt werden soll",
|
||||
"Page publish date (ISO-8601)": "Veröffentlichungsdatum der Seite (ISO-8601)",
|
||||
"Choose status": "Status auswählen",
|
||||
"The ID of the post to get": "Die ID des zu erhaltenden Beitrags",
|
||||
"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..",
|
||||
"Published": "Veröffentlicht",
|
||||
"Scheduled": "Geplant",
|
||||
"Draft": "Entwurf",
|
||||
"Pending": "Ausstehend",
|
||||
"Private": "Privat",
|
||||
"Trash": "Papierkorb",
|
||||
"GET": "ERHALTEN",
|
||||
"POST": "POST",
|
||||
"PATCH": "PATCH",
|
||||
"PUT": "PUT",
|
||||
"DELETE": "LÖSCHEN",
|
||||
"HEAD": "HEAD",
|
||||
"New Post": "Neuer Beitrag",
|
||||
"Triggers when a new post is published": "Wird ausgelöst, wenn ein neuer Beitrag veröffentlicht wird",
|
||||
"Authors": "Autoren"
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"Open-source website creation software": "Software de creación de sitios web de código abierto",
|
||||
"Username": "Usuario",
|
||||
"Password": "Contraseña",
|
||||
"Website URL": "URL del sitio web",
|
||||
"URL of the wordpress url i.e https://www.example-website.com": "URL de la url de wordpress i.e https://www.example-website.com",
|
||||
"\n**Enable Basic Authentication:**\n\n1. Download the plugin from: https://github.com/WP-API/Basic-Auth (Click on Code -> Download Zip)\n2. Log in to your WordPress dashboard.\n3. Go to \"Plugins\" and click \"Add New.\"\n4. Choose \"Upload Plugin\" and select the downloaded file.\n5. Install and activate the plugin.\n\n": "\n**Enable Basic Authentication:**\n\n1. Download the plugin from: https://github.com/WP-API/Basic-Auth (Click on Code -> Download Zip)\n2. Log in to your WordPress dashboard.\n3. Go to \"Plugins\" and click \"Add New.\"\n4. Choose \"Upload Plugin\" and select the downloaded file.\n5. Install and activate the plugin.\n\n",
|
||||
"Create Post": "Crear publicación",
|
||||
"Create Page": "Crear página",
|
||||
"Update Post": "Actualizar Post",
|
||||
"Get Post Details": "Obtener detalles del post",
|
||||
"Custom API Call": "Llamada API personalizada",
|
||||
"Create new post on WordPress": "Crear nuevo post en WordPress",
|
||||
"Create new page on WordPress": "Crear nueva página en WordPress",
|
||||
"Update an existing post on WordPress.": "Actualizar un post existente en WordPress.",
|
||||
"Get a post from WordPress": "Obtén una publicación de WordPress",
|
||||
"Make a custom API call to a specific endpoint": "Hacer una llamada API personalizada a un extremo específico",
|
||||
"Title": "Título",
|
||||
"Content": "Contenido",
|
||||
"Slug": "Slug",
|
||||
"Date": "Fecha",
|
||||
"Featured Media (URL)": "Medios destacados (URL)",
|
||||
"Tags": "Etiquetas",
|
||||
"Custom ACF fields": "Campos ACF personalizados",
|
||||
"Categories": "Categorías",
|
||||
"Featured Media (image)": "Medios destacados (imagen)",
|
||||
"Status": "Estado",
|
||||
"Excerpt": "Fragmento",
|
||||
"Enable Comments": "Habilitar comentarios",
|
||||
"Open to Pinging": "Abrir a ping",
|
||||
"Post": "Publicar",
|
||||
"Post ID": "ID del post",
|
||||
"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)",
|
||||
"Title of the post about to be added": "Título del mensaje a punto de ser añadido",
|
||||
"Uses the WordPress Text Editor which supports HTML": "Utiliza el editor de texto de WordPress que soporta HTML",
|
||||
"Post publish date (ISO-8601)": "Fecha de publicación (ISO-8601)",
|
||||
"URL of featured media": "URL de los medios destacados",
|
||||
"Post tags": "Publicar etiquetas",
|
||||
"Provide field name with value.You can find out field name from ACF plugin menu.": "Proporcione el nombre del campo con value.Puede encontrar el nombre del campo en el menú del plugin ACF.",
|
||||
"Post categories": "Categorías de mensajes",
|
||||
"Choose from one of your uploaded media files": "Elige uno de tus archivos de medios subidos",
|
||||
"Choose post status": "Elegir estado del post",
|
||||
"Title of the page about to be added": "Título de la página a punto de ser añadida",
|
||||
"Page publish date (ISO-8601)": "Fecha de publicación de página (ISO-8601)",
|
||||
"Choose status": "Elegir estado",
|
||||
"The ID of the post to get": "El ID de la publicación para obtener",
|
||||
"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.",
|
||||
"Published": "Publicado",
|
||||
"Scheduled": "Programado",
|
||||
"Draft": "Borrador",
|
||||
"Pending": "Pendiente",
|
||||
"Private": "Privado",
|
||||
"Trash": "Basura",
|
||||
"GET": "RECOGER",
|
||||
"POST": "POST",
|
||||
"PATCH": "PATCH",
|
||||
"PUT": "PUT",
|
||||
"DELETE": "BORRAR",
|
||||
"HEAD": "LIMPIO",
|
||||
"New Post": "Nuevo post",
|
||||
"Triggers when a new post is published": "Dispara cuando se publica una nueva publicación",
|
||||
"Authors": "Autores"
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"Open-source website creation software": "Logiciel de création de site web Open-source",
|
||||
"Username": "Nom d'utilisateur",
|
||||
"Password": "Password",
|
||||
"Website URL": "URL du site web",
|
||||
"URL of the wordpress url i.e https://www.example-website.com": "URL de l'URL wordpress i.e https://www.example-website.com",
|
||||
"\n**Enable Basic Authentication:**\n\n1. Download the plugin from: https://github.com/WP-API/Basic-Auth (Click on Code -> Download Zip)\n2. Log in to your WordPress dashboard.\n3. Go to \"Plugins\" and click \"Add New.\"\n4. Choose \"Upload Plugin\" and select the downloaded file.\n5. Install and activate the plugin.\n\n": "\n**Enable Basic Authentication:**\n\n1. Download the plugin from: https://github.com/WP-API/Basic-Auth (Click on Code -> Download Zip)\n2. Log in to your WordPress dashboard.\n3. Go to \"Plugins\" and click \"Add New.\"\n4. Choose \"Upload Plugin\" and select the downloaded file.\n5. Install and activate the plugin.\n\n",
|
||||
"Create Post": "Créer un message",
|
||||
"Create Page": "Créer une page",
|
||||
"Update Post": "Mettre à jour le message",
|
||||
"Get Post Details": "Obtenir les détails de la publication",
|
||||
"Custom API Call": "Appel d'API personnalisé",
|
||||
"Create new post on WordPress": "Créer un nouveau message sur WordPress",
|
||||
"Create new page on WordPress": "Créer une nouvelle page sur WordPress",
|
||||
"Update an existing post on WordPress.": "Mettre à jour un message existant sur WordPress.",
|
||||
"Get a post from WordPress": "Recevoir un message de WordPress",
|
||||
"Make a custom API call to a specific endpoint": "Passer un appel API personnalisé à un endpoint spécifique",
|
||||
"Title": "Titre de la page",
|
||||
"Content": "Contenus",
|
||||
"Slug": "Limace",
|
||||
"Date": "Date",
|
||||
"Featured Media (URL)": "Média en vedette (URL)",
|
||||
"Tags": "Tags",
|
||||
"Custom ACF fields": "Champs ACF personnalisés",
|
||||
"Categories": "Catégories",
|
||||
"Featured Media (image)": "Médias en vedette (image)",
|
||||
"Status": "Statut",
|
||||
"Excerpt": "Extrait",
|
||||
"Enable Comments": "Activer les commentaires",
|
||||
"Open to Pinging": "Ouvert au Ping",
|
||||
"Post": "Poster",
|
||||
"Post ID": "ID de la publication",
|
||||
"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'expiration (en secondes)",
|
||||
"Title of the post about to be added": "Titre du message sur le point d'être ajouté",
|
||||
"Uses the WordPress Text Editor which supports HTML": "Utilise l'éditeur de texte WordPress qui supporte le HTML",
|
||||
"Post publish date (ISO-8601)": "Date de publication du post (ISO-8601)",
|
||||
"URL of featured media": "URL des médias en vedette",
|
||||
"Post tags": "Étiquettes de publication",
|
||||
"Provide field name with value.You can find out field name from ACF plugin menu.": "Indiquez le nom du champ avec la valeur. Vous pouvez trouver le nom du champ dans le menu du plugin ACF.",
|
||||
"Post categories": "Catégories de publication",
|
||||
"Choose from one of your uploaded media files": "Choisissez parmi l'un de vos fichiers multimédias téléchargés",
|
||||
"Choose post status": "Choisissez le statut de la publication",
|
||||
"Title of the page about to be added": "Titre de la page à ajouter",
|
||||
"Page publish date (ISO-8601)": "Date de publication de la page (ISO-8601)",
|
||||
"Choose status": "Choisir le statut",
|
||||
"The ID of the post to get": "L'ID du message à obtenir",
|
||||
"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.",
|
||||
"Published": "Publié",
|
||||
"Scheduled": "Planifié",
|
||||
"Draft": "Brouillon",
|
||||
"Pending": "En attente",
|
||||
"Private": "Privé",
|
||||
"Trash": "Corbeille",
|
||||
"GET": "GET",
|
||||
"POST": "POST",
|
||||
"PATCH": "PATCH",
|
||||
"PUT": "PUT",
|
||||
"DELETE": "DELETE",
|
||||
"HEAD": "HEAD",
|
||||
"New Post": "Nouveau message",
|
||||
"Triggers when a new post is published": "Déclenche quand un nouveau message est publié",
|
||||
"Authors": "Auteurs"
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"WordPress": "WordPress",
|
||||
"Open-source website creation software": "Open-source website creation software",
|
||||
"Username": "Username",
|
||||
"Password": "Password",
|
||||
"Website URL": "Website URL",
|
||||
"URL of the wordpress url i.e https://www.example-website.com": "URL of the wordpress url i.e https://www.example-website.com",
|
||||
"\n**Enable Basic Authentication:**\n\n1. Download the plugin from: https://github.com/WP-API/Basic-Auth (Click on Code -> Download Zip)\n2. Log in to your WordPress dashboard.\n3. Go to \"Plugins\" and click \"Add New.\"\n4. Choose \"Upload Plugin\" and select the downloaded file.\n5. Install and activate the plugin.\n\n": "\n**Enable Basic Authentication:**\n\n1. Download the plugin from: https://github.com/WP-API/Basic-Auth (Click on Code -> Download Zip)\n2. Log in to your WordPress dashboard.\n3. Go to \"Plugins\" and click \"Add New.\"\n4. Choose \"Upload Plugin\" and select the downloaded file.\n5. Install and activate the plugin.\n\n",
|
||||
"Create Post": "Create Post",
|
||||
"Create Page": "Create Page",
|
||||
"Update Post": "Update Post",
|
||||
"Get Post Details": "Get Post Details",
|
||||
"Custom API Call": "Custom API Call",
|
||||
"Create new post on WordPress": "Create new post on WordPress",
|
||||
"Create new page on WordPress": "Create new page on WordPress",
|
||||
"Update an existing post on WordPress.": "Update an existing post on WordPress.",
|
||||
"Get a post from WordPress": "Get a post from WordPress",
|
||||
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
|
||||
"Title": "Title",
|
||||
"Content": "Content",
|
||||
"Slug": "Slug",
|
||||
"Date": "Date",
|
||||
"Featured Media (URL)": "Featured Media (URL)",
|
||||
"Tags": "Tags",
|
||||
"Custom ACF fields": "Custom ACF fields",
|
||||
"Categories": "Categories",
|
||||
"Featured Media (image)": "Featured Media (image)",
|
||||
"Status": "Status",
|
||||
"Excerpt": "Excerpt",
|
||||
"Enable Comments": "Enable Comments",
|
||||
"Open to Pinging": "Open to Pinging",
|
||||
"Post": "Post",
|
||||
"Post ID": "Post ID",
|
||||
"Method": "Method",
|
||||
"Headers": "Headers",
|
||||
"Query Parameters": "Query Parameters",
|
||||
"Body": "Body",
|
||||
"No Error on Failure": "No Error on Failure",
|
||||
"Timeout (in seconds)": "Timeout (in seconds)",
|
||||
"Title of the post about to be added": "Title of the post about to be added",
|
||||
"Uses the WordPress Text Editor which supports HTML": "Uses the WordPress Text Editor which supports HTML",
|
||||
"Post publish date (ISO-8601)": "Post publish date (ISO-8601)",
|
||||
"URL of featured media": "URL of featured media",
|
||||
"Post tags": "Post tags",
|
||||
"Provide field name with value.You can find out field name from ACF plugin menu.": "Provide field name with value.You can find out field name from ACF plugin menu.",
|
||||
"Post categories": "Post categories",
|
||||
"Choose from one of your uploaded media files": "Choose from one of your uploaded media files",
|
||||
"Choose post status": "Choose post status",
|
||||
"Title of the page about to be added": "Title of the page about to be added",
|
||||
"Page publish date (ISO-8601)": "Page publish date (ISO-8601)",
|
||||
"Choose status": "Choose status",
|
||||
"The ID of the post to get": "The ID of the post to get",
|
||||
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
|
||||
"Published": "Published",
|
||||
"Scheduled": "Scheduled",
|
||||
"Draft": "Draft",
|
||||
"Pending": "Pending",
|
||||
"Private": "Private",
|
||||
"Trash": "Trash",
|
||||
"GET": "GET",
|
||||
"POST": "POST",
|
||||
"PATCH": "PATCH",
|
||||
"PUT": "PUT",
|
||||
"DELETE": "DELETE",
|
||||
"HEAD": "HEAD",
|
||||
"New Post": "New Post",
|
||||
"Triggers when a new post is published": "Triggers when a new post is published",
|
||||
"Authors": "Authors"
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"WordPress": "WordPress",
|
||||
"Open-source website creation software": "Open-source website creation software",
|
||||
"Username": "Username",
|
||||
"Password": "Password",
|
||||
"Website URL": "Website URL",
|
||||
"URL of the wordpress url i.e https://www.example-website.com": "URL of the wordpress url i.e https://www.example-website.com",
|
||||
"\n**Enable Basic Authentication:**\n\n1. Download the plugin from: https://github.com/WP-API/Basic-Auth (Click on Code -> Download Zip)\n2. Log in to your WordPress dashboard.\n3. Go to \"Plugins\" and click \"Add New.\"\n4. Choose \"Upload Plugin\" and select the downloaded file.\n5. Install and activate the plugin.\n\n": "\n**Enable Basic Authentication:**\n\n1. Download the plugin from: https://github.com/WP-API/Basic-Auth (Click on Code -> Download Zip)\n2. Log in to your WordPress dashboard.\n3. Go to \"Plugins\" and click \"Add New.\"\n4. Choose \"Upload Plugin\" and select the downloaded file.\n5. Install and activate the plugin.\n\n",
|
||||
"Create Post": "Create Post",
|
||||
"Create Page": "Create Page",
|
||||
"Update Post": "Update Post",
|
||||
"Get Post Details": "Get Post Details",
|
||||
"Custom API Call": "Custom API Call",
|
||||
"Create new post on WordPress": "Create new post on WordPress",
|
||||
"Create new page on WordPress": "Create new page on WordPress",
|
||||
"Update an existing post on WordPress.": "Update an existing post on WordPress.",
|
||||
"Get a post from WordPress": "Get a post from WordPress",
|
||||
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
|
||||
"Title": "Title",
|
||||
"Content": "Content",
|
||||
"Slug": "Slug",
|
||||
"Date": "Date",
|
||||
"Featured Media (URL)": "Featured Media (URL)",
|
||||
"Tags": "Tags",
|
||||
"Custom ACF fields": "Custom ACF fields",
|
||||
"Categories": "Categories",
|
||||
"Featured Media (image)": "Featured Media (image)",
|
||||
"Status": "Status",
|
||||
"Excerpt": "Excerpt",
|
||||
"Enable Comments": "Enable Comments",
|
||||
"Open to Pinging": "Open to Pinging",
|
||||
"Post": "Post",
|
||||
"Post ID": "Post ID",
|
||||
"Method": "Method",
|
||||
"Headers": "Headers",
|
||||
"Query Parameters": "Query Parameters",
|
||||
"Body": "Body",
|
||||
"No Error on Failure": "No Error on Failure",
|
||||
"Timeout (in seconds)": "Timeout (in seconds)",
|
||||
"Title of the post about to be added": "Title of the post about to be added",
|
||||
"Uses the WordPress Text Editor which supports HTML": "Uses the WordPress Text Editor which supports HTML",
|
||||
"Post publish date (ISO-8601)": "Post publish date (ISO-8601)",
|
||||
"URL of featured media": "URL of featured media",
|
||||
"Post tags": "Post tags",
|
||||
"Provide field name with value.You can find out field name from ACF plugin menu.": "Provide field name with value.You can find out field name from ACF plugin menu.",
|
||||
"Post categories": "Post categories",
|
||||
"Choose from one of your uploaded media files": "Choose from one of your uploaded media files",
|
||||
"Choose post status": "Choose post status",
|
||||
"Title of the page about to be added": "Title of the page about to be added",
|
||||
"Page publish date (ISO-8601)": "Page publish date (ISO-8601)",
|
||||
"Choose status": "Choose status",
|
||||
"The ID of the post to get": "The ID of the post to get",
|
||||
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
|
||||
"Published": "Diterbitkan",
|
||||
"Scheduled": "Scheduled",
|
||||
"Draft": "Draf",
|
||||
"Pending": "Pending",
|
||||
"Private": "Private",
|
||||
"Trash": "Trash",
|
||||
"GET": "GET",
|
||||
"POST": "POST",
|
||||
"PATCH": "PATCH",
|
||||
"PUT": "PUT",
|
||||
"DELETE": "DELETE",
|
||||
"HEAD": "HEAD",
|
||||
"New Post": "New Post",
|
||||
"Triggers when a new post is published": "Triggers when a new post is published",
|
||||
"Authors": "Authors"
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"Open-source website creation software": "オープンソースのウェブサイト作成ソフトウェア",
|
||||
"Username": "ユーザー名",
|
||||
"Password": "Password",
|
||||
"Website URL": "Website URL",
|
||||
"URL of the wordpress url i.e https://www.example-website.com": "ワードプレス URL の URL です。https://www.example-website.com",
|
||||
"\n**Enable Basic Authentication:**\n\n1. Download the plugin from: https://github.com/WP-API/Basic-Auth (Click on Code -> Download Zip)\n2. Log in to your WordPress dashboard.\n3. Go to \"Plugins\" and click \"Add New.\"\n4. Choose \"Upload Plugin\" and select the downloaded file.\n5. Install and activate the plugin.\n\n": "\n**Enable Basic Authentication:**\n\n1. Download the plugin from: https://github.com/WP-API/Basic-Auth (Click on Code -> Download Zip)\n2. Log in to your WordPress dashboard.\n3. Go to \"Plugins\" and click \"Add New.\"\n4. Choose \"Upload Plugin\" and select the downloaded file.\n5. Install and activate the plugin.\n\n",
|
||||
"Create Post": "投稿を作成",
|
||||
"Create Page": "ページを作成",
|
||||
"Update Post": "投稿を更新",
|
||||
"Get Post Details": "投稿の詳細を取得",
|
||||
"Custom API Call": "カスタムAPI通話",
|
||||
"Create new post on WordPress": "WordPress で新規投稿を作成",
|
||||
"Create new page on WordPress": "WordPress で新しいページを作成",
|
||||
"Update an existing post on WordPress.": "WordPress上の既存の投稿を更新します。",
|
||||
"Get a post from WordPress": "WordPress から投稿を取得する",
|
||||
"Make a custom API call to a specific endpoint": "特定のエンドポイントへのカスタム API コールを実行します。",
|
||||
"Title": "タイトル",
|
||||
"Content": "コンテンツ",
|
||||
"Slug": "スラグ",
|
||||
"Date": "日付",
|
||||
"Featured Media (URL)": "注目のメディア (URL)",
|
||||
"Tags": "タグ",
|
||||
"Custom ACF fields": "ACFフィールドのカスタマイズ",
|
||||
"Categories": "カテゴリ",
|
||||
"Featured Media (image)": "注目のメディア (画像)",
|
||||
"Status": "Status",
|
||||
"Excerpt": "概要",
|
||||
"Enable Comments": "コメントを有効化",
|
||||
"Open to Pinging": "Pinging で開く",
|
||||
"Post": "投稿",
|
||||
"Post ID": "投稿ID",
|
||||
"Method": "方法",
|
||||
"Headers": "ヘッダー",
|
||||
"Query Parameters": "クエリパラメータ",
|
||||
"Body": "本文",
|
||||
"Response is Binary ?": "応答はバイナリですか?",
|
||||
"No Error on Failure": "失敗時にエラーはありません",
|
||||
"Timeout (in seconds)": "タイムアウト(秒)",
|
||||
"Title of the post about to be added": "追加される投稿のタイトル",
|
||||
"Uses the WordPress Text Editor which supports HTML": "HTMLに対応するWordPressテキストエディタを使用",
|
||||
"Post publish date (ISO-8601)": "公開日 (ISO-8601)",
|
||||
"URL of featured media": "注目メディアの URL",
|
||||
"Post tags": "投稿タグ",
|
||||
"Provide field name with value.You can find out field name from ACF plugin menu.": "ACFプラグインメニューから項目名を確認できます。",
|
||||
"Post categories": "カテゴリを投稿",
|
||||
"Choose from one of your uploaded media files": "アップロードしたメディアファイルから選択してください",
|
||||
"Choose post status": "投稿の状態を選択",
|
||||
"Title of the page about to be added": "追加されるページのタイトル",
|
||||
"Page publish date (ISO-8601)": "Page publish date (ISO-8601)",
|
||||
"Choose status": "ステータスを選択",
|
||||
"The ID of the post to get": "取得する投稿のID",
|
||||
"Authorization headers are injected automatically from your connection.": "認証ヘッダは接続から自動的に注入されます。",
|
||||
"Enable for files like PDFs, images, etc..": "PDF、画像などのファイルを有効にします。",
|
||||
"Published": "公開済み",
|
||||
"Scheduled": "スケジュール済み",
|
||||
"Draft": "下書き",
|
||||
"Pending": "処理待ち",
|
||||
"Private": "非公開",
|
||||
"Trash": "ごみ箱に入れる",
|
||||
"GET": "取得",
|
||||
"POST": "POST",
|
||||
"PATCH": "PATCH",
|
||||
"PUT": "PUT",
|
||||
"DELETE": "削除",
|
||||
"HEAD": "頭",
|
||||
"New Post": "新規投稿",
|
||||
"Triggers when a new post is published": "新しい投稿が公開されたときにトリガーします",
|
||||
"Authors": "著者"
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"Open-source website creation software": "Open-source website creatie software",
|
||||
"Username": "Gebruikersnaam",
|
||||
"Password": "Wachtwoord",
|
||||
"Website URL": "Website URL",
|
||||
"URL of the wordpress url i.e https://www.example-website.com": "URL van de wordpress url vb. https://www.voorbeeld-website.com",
|
||||
"\n**Enable Basic Authentication:**\n\n1. Download the plugin from: https://github.com/WP-API/Basic-Auth (Click on Code -> Download Zip)\n2. Log in to your WordPress dashboard.\n3. Go to \"Plugins\" and click \"Add New.\"\n4. Choose \"Upload Plugin\" and select the downloaded file.\n5. Install and activate the plugin.\n\n": "\n**Activeer Basis Authenticatie:**\n\n1. Download de plugin van: https://github. om/WP-API/Basic-Auth (Klik op Code -> Download Zip)\n2. Log in op uw WordPress dashboard.\n3. Ga naar \"Plug-ins\" en klik op \"Nieuw toevoegen\"\n4. Kies \"Upload Plugin\" en selecteer het gedownloade bestand.\n5. Installeer en activeer de plugin.\n\n",
|
||||
"Create Post": "Post aanmaken",
|
||||
"Create Page": "Pagina maken",
|
||||
"Update Post": "Bericht bijwerken",
|
||||
"Get Post Details": "Krijg berichtdetails",
|
||||
"Custom API Call": "Custom API Call",
|
||||
"Create new post on WordPress": "Maak een nieuw bericht in WordPress",
|
||||
"Create new page on WordPress": "Maak een nieuwe pagina aan in WordPress",
|
||||
"Update an existing post on WordPress.": "Update een bestaand bericht op WordPress.",
|
||||
"Get a post from WordPress": "Haal een bericht van WordPress",
|
||||
"Make a custom API call to a specific endpoint": "Maak een aangepaste API call naar een specifiek eindpunt",
|
||||
"Title": "Aanspreektitel",
|
||||
"Content": "Inhoud",
|
||||
"Slug": "Slak",
|
||||
"Date": "Datum:",
|
||||
"Featured Media (URL)": "Uitgelichte media (URL)",
|
||||
"Tags": "Labels",
|
||||
"Custom ACF fields": "Aangepaste ACF-velden",
|
||||
"Categories": "Categoriechar@@0n",
|
||||
"Featured Media (image)": "Uitgelichte media (afbeelding)",
|
||||
"Status": "status",
|
||||
"Excerpt": "Samenvatting",
|
||||
"Enable Comments": "Reacties inschakelen",
|
||||
"Open to Pinging": "Open om in te gaan",
|
||||
"Post": "Plaatsen",
|
||||
"Post ID": "Post ID",
|
||||
"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)",
|
||||
"Title of the post about to be added": "Titel van het bericht dat toegevoegd zal worden",
|
||||
"Uses the WordPress Text Editor which supports HTML": "Gebruikt de WordPress Text Editor die HTML ondersteunt",
|
||||
"Post publish date (ISO-8601)": "Plaats publicatiedatum (ISO-8601)",
|
||||
"URL of featured media": "URL van aanbevolen media",
|
||||
"Post tags": "Post labels",
|
||||
"Provide field name with value.You can find out field name from ACF plugin menu.": "Geef een veldnaam met waarde op. U kunt de veldnaam vinden in het ACF plugin menu.",
|
||||
"Post categories": "Post categorieën",
|
||||
"Choose from one of your uploaded media files": "Kies uit een van je geüploade mediabestanden",
|
||||
"Choose post status": "Kies post status",
|
||||
"Title of the page about to be added": "Titel van de pagina die toegevoegd zal worden",
|
||||
"Page publish date (ISO-8601)": "Publicatiedatum van de pagina (ISO-8601)",
|
||||
"Choose status": "Status kiezen",
|
||||
"The ID of the post to get": "Het ID van het bericht om te krijgen",
|
||||
"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..",
|
||||
"Published": "Gepubliceerd",
|
||||
"Scheduled": "Gepland",
|
||||
"Draft": "Concept",
|
||||
"Pending": "In behandeling",
|
||||
"Private": "Privé",
|
||||
"Trash": "Prullenbak",
|
||||
"GET": "KRIJG",
|
||||
"POST": "POSTE",
|
||||
"PATCH": "BEKIJK",
|
||||
"PUT": "PUT",
|
||||
"DELETE": "VERWIJDEREN",
|
||||
"HEAD": "HOOFD",
|
||||
"New Post": "Nieuw bericht",
|
||||
"Triggers when a new post is published": "Triggert wanneer een nieuw bericht wordt gepubliceerd",
|
||||
"Authors": "Auteurs"
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"Open-source website creation software": "Software de criação de site de código aberto",
|
||||
"Username": "Usuário:",
|
||||
"Password": "Senha",
|
||||
"Website URL": "URL do site",
|
||||
"URL of the wordpress url i.e https://www.example-website.com": "URL do wordpress i.e https://www.exemplo-website.com",
|
||||
"\n**Enable Basic Authentication:**\n\n1. Download the plugin from: https://github.com/WP-API/Basic-Auth (Click on Code -> Download Zip)\n2. Log in to your WordPress dashboard.\n3. Go to \"Plugins\" and click \"Add New.\"\n4. Choose \"Upload Plugin\" and select the downloaded file.\n5. Install and activate the plugin.\n\n": "\n**Ative a Autenticação Básica:**\n\n1. Baixe o plugin em: https://github. om/WP-API/Basic-Auth (Clique no código -> Baixar Zip)\n2. Faça login no seu painel do WordPress.\n3. Vá para \"Plugins\" e clique em \"Adicionar novo\".\n4. Escolha \"Upload do Plugin\" e selecione o arquivo baixado.\n5. Instale e ative o plugin.\n\n",
|
||||
"Create Post": "Criar publicação",
|
||||
"Create Page": "Criar página",
|
||||
"Update Post": "Atualizar publicação",
|
||||
"Get Post Details": "Obter detalhes do post",
|
||||
"Custom API Call": "Chamada de API personalizada",
|
||||
"Create new post on WordPress": "Criar nova postagem no WordPress",
|
||||
"Create new page on WordPress": "Criar nova página no WordPress",
|
||||
"Update an existing post on WordPress.": "Atualizar uma postagem existente no WordPress.",
|
||||
"Get a post from WordPress": "Obter uma postagem do WordPress",
|
||||
"Make a custom API call to a specific endpoint": "Faça uma chamada de API personalizada para um ponto de extremidade específico",
|
||||
"Title": "Título",
|
||||
"Content": "Conteúdo",
|
||||
"Slug": "Permalink",
|
||||
"Date": "Encontro",
|
||||
"Featured Media (URL)": "Mídia em Destaque (URL)",
|
||||
"Tags": "Etiquetas",
|
||||
"Custom ACF fields": "Campos personalizados ACF",
|
||||
"Categories": "categorias",
|
||||
"Featured Media (image)": "Mídia em destaque (imagem)",
|
||||
"Status": "Estado",
|
||||
"Excerpt": "Resumo",
|
||||
"Enable Comments": "Habilitar comentários",
|
||||
"Open to Pinging": "Abrir ao Pinging",
|
||||
"Post": "Publicar",
|
||||
"Post ID": "ID da postagem",
|
||||
"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)",
|
||||
"Title of the post about to be added": "Título da postagem prestes a ser adicionado",
|
||||
"Uses the WordPress Text Editor which supports HTML": "Usa o Editor de Texto do WordPress que suporta HTML",
|
||||
"Post publish date (ISO-8601)": "Data de publicação da postagem (ISO-8601)",
|
||||
"URL of featured media": "URL da mídia em destaque",
|
||||
"Post tags": "Etiquetas de publicação",
|
||||
"Provide field name with value.You can find out field name from ACF plugin menu.": "Forneça o nome do campo com valor. Você pode encontrar o nome do campo no menu do plugin ACF.",
|
||||
"Post categories": "Categorias de postagem",
|
||||
"Choose from one of your uploaded media files": "Escolha entre um dos seus arquivos de mídia enviados",
|
||||
"Choose post status": "Escolher status da publicação",
|
||||
"Title of the page about to be added": "Título da página prestes a ser adicionado",
|
||||
"Page publish date (ISO-8601)": "Data de publicação da página (ISO-8601)",
|
||||
"Choose status": "Escolha o status",
|
||||
"The ID of the post to get": "O ID da postagem para obter",
|
||||
"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..",
|
||||
"Published": "Publicado",
|
||||
"Scheduled": "Agendado",
|
||||
"Draft": "Rascunho",
|
||||
"Pending": "Pendente",
|
||||
"Private": "Privado",
|
||||
"Trash": "Descartar",
|
||||
"GET": "OBTER",
|
||||
"POST": "POSTAR",
|
||||
"PATCH": "COMPRAR",
|
||||
"PUT": "COLOCAR",
|
||||
"DELETE": "EXCLUIR",
|
||||
"HEAD": "CABEÇA",
|
||||
"New Post": "Nova Postagem",
|
||||
"Triggers when a new post is published": "Dispara quando uma nova postagem é publicada",
|
||||
"Authors": "Autores"
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"WordPress": "WordPress",
|
||||
"Open-source website creation software": "Программное обеспечение для создания веб-сайтов с открытым исходным кодом",
|
||||
"Username": "Имя пользователя",
|
||||
"Password": "Password",
|
||||
"Website URL": "URL сайта",
|
||||
"URL of the wordpress url i.e https://www.example-website.com": "URL URL wordpress, т.е. https://www.example-website.com",
|
||||
"\n**Enable Basic Authentication:**\n\n1. Download the plugin from: https://github.com/WP-API/Basic-Auth (Click on Code -> Download Zip)\n2. Log in to your WordPress dashboard.\n3. Go to \"Plugins\" and click \"Add New.\"\n4. Choose \"Upload Plugin\" and select the downloaded file.\n5. Install and activate the plugin.\n\n": "\n**Включить базовую аутентификацию:**\n\n1. Скачать плагин с: https://github. om/WP-API/Basic-Auth (Щелкните на код -> Скачать Zip)\n2. Войти в панель управления WordPress.\n3. Перейдите в \"Плагины\" и нажмите \"Добавить новое\".\n4. Выберите \"Загрузить плагин\" и выберите загруженный файл.\n5. Установите и активируйте плагин.\n\n",
|
||||
"Create Post": "Создать запись",
|
||||
"Create Page": "Создать страницу",
|
||||
"Update Post": "Обновить пост",
|
||||
"Get Post Details": "Получить информацию о записи",
|
||||
"Custom API Call": "Пользовательский вызов API",
|
||||
"Create new post on WordPress": "Создать новое сообщение на WordPress",
|
||||
"Create new page on WordPress": "Создать новую страницу на WordPress",
|
||||
"Update an existing post on WordPress.": "Обновить существующий пост на WordPress.",
|
||||
"Get a post from WordPress": "Получить сообщение от WordPress",
|
||||
"Make a custom API call to a specific endpoint": "Сделать пользовательский API вызов к определенной конечной точке",
|
||||
"Title": "Заголовок",
|
||||
"Content": "Содержание",
|
||||
"Slug": "Слаг",
|
||||
"Date": "Дата",
|
||||
"Featured Media (URL)": "Рекомендуемые медиа (URL)",
|
||||
"Tags": "Теги",
|
||||
"Custom ACF fields": "Пользовательские поля ACF",
|
||||
"Categories": "Категории",
|
||||
"Featured Media (image)": "Рекомендуемые медиа (изображение)",
|
||||
"Status": "Статус",
|
||||
"Excerpt": "Выдержка",
|
||||
"Enable Comments": "Включить комментарии",
|
||||
"Open to Pinging": "Открыть для пинга",
|
||||
"Post": "Пост",
|
||||
"Post ID": "ID поста",
|
||||
"Method": "Метод",
|
||||
"Headers": "Заголовки",
|
||||
"Query Parameters": "Параметры запроса",
|
||||
"Body": "Тело",
|
||||
"No Error on Failure": "Нет ошибок при ошибке",
|
||||
"Timeout (in seconds)": "Таймаут (в секундах)",
|
||||
"Title of the post about to be added": "Заголовок сообщения будет добавлен",
|
||||
"Uses the WordPress Text Editor which supports HTML": "Использует WordPress текстовый редактор, который поддерживает HTML",
|
||||
"Post publish date (ISO-8601)": "Дата публикации записи (ISO-8601)",
|
||||
"URL of featured media": "URL избранного медиа",
|
||||
"Post tags": "Пост тэги",
|
||||
"Provide field name with value.You can find out field name from ACF plugin menu.": "Предоставьте имя поля со значением. Вы можете найти название поля из ACF плагина меню.",
|
||||
"Post categories": "Категории записей",
|
||||
"Choose from one of your uploaded media files": "Выберите один из загруженных медиа-файлов",
|
||||
"Choose post status": "Выберите статус записи",
|
||||
"Title of the page about to be added": "Заголовок страницы будет добавлен",
|
||||
"Page publish date (ISO-8601)": "Дата публикации страницы (ISO-8601)",
|
||||
"Choose status": "Выберите статус",
|
||||
"The ID of the post to get": "ID сообщения, чтобы получить",
|
||||
"Authorization headers are injected automatically from your connection.": "Заголовки авторизации включаются автоматически из вашего соединения.",
|
||||
"Published": "Опубликовано",
|
||||
"Scheduled": "Запланированный",
|
||||
"Draft": "Черновик",
|
||||
"Pending": "В ожидании",
|
||||
"Private": "Приватный",
|
||||
"Trash": "Корзина",
|
||||
"GET": "ПОЛУЧИТЬ",
|
||||
"POST": "ПОСТ",
|
||||
"PATCH": "ПАТЧ",
|
||||
"PUT": "ПОКУПИТЬ",
|
||||
"DELETE": "УДАЛИТЬ",
|
||||
"HEAD": "HEAD",
|
||||
"New Post": "Новая запись",
|
||||
"Triggers when a new post is published": "Триггеры при публикации нового сообщения",
|
||||
"Authors": "Авторы"
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"Open-source website creation software": "Open-source website creation software",
|
||||
"Username": "Username",
|
||||
"Password": "Password",
|
||||
"Website URL": "Website URL",
|
||||
"URL of the wordpress url i.e https://www.example-website.com": "URL of the wordpress url i.e https://www.example-website.com",
|
||||
"\n**Enable Basic Authentication:**\n\n1. Download the plugin from: https://github.com/WP-API/Basic-Auth (Click on Code -> Download Zip)\n2. Log in to your WordPress dashboard.\n3. Go to \"Plugins\" and click \"Add New.\"\n4. Choose \"Upload Plugin\" and select the downloaded file.\n5. Install and activate the plugin.\n\n": "\n**Enable Basic Authentication:**\n\n1. Download the plugin from: https://github.com/WP-API/Basic-Auth (Click on Code -> Download Zip)\n2. Log in to your WordPress dashboard.\n3. Go to \"Plugins\" and click \"Add New.\"\n4. Choose \"Upload Plugin\" and select the downloaded file.\n5. Install and activate the plugin.\n\n",
|
||||
"Create Post": "Create Post",
|
||||
"Create Page": "Create Page",
|
||||
"Update Post": "Update Post",
|
||||
"Get Post Details": "Get Post Details",
|
||||
"Custom API Call": "Custom API Call",
|
||||
"Create new post on WordPress": "Create new post on WordPress",
|
||||
"Create new page on WordPress": "Create new page on WordPress",
|
||||
"Update an existing post on WordPress.": "Update an existing post on WordPress.",
|
||||
"Get a post from WordPress": "Get a post from WordPress",
|
||||
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
|
||||
"Title": "Title",
|
||||
"Content": "Content",
|
||||
"Slug": "Slug",
|
||||
"Date": "Date",
|
||||
"Featured Media (URL)": "Featured Media (URL)",
|
||||
"Tags": "Tags",
|
||||
"Custom ACF fields": "Custom ACF fields",
|
||||
"Categories": "Categories",
|
||||
"Featured Media (image)": "Featured Media (image)",
|
||||
"Status": "Status",
|
||||
"Excerpt": "Excerpt",
|
||||
"Enable Comments": "Enable Comments",
|
||||
"Open to Pinging": "Open to Pinging",
|
||||
"Post": "Post",
|
||||
"Post ID": "Post ID",
|
||||
"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)",
|
||||
"Title of the post about to be added": "Title of the post about to be added",
|
||||
"Uses the WordPress Text Editor which supports HTML": "Uses the WordPress Text Editor which supports HTML",
|
||||
"Post publish date (ISO-8601)": "Post publish date (ISO-8601)",
|
||||
"URL of featured media": "URL of featured media",
|
||||
"Post tags": "Post tags",
|
||||
"Provide field name with value.You can find out field name from ACF plugin menu.": "Provide field name with value.You can find out field name from ACF plugin menu.",
|
||||
"Post categories": "Post categories",
|
||||
"Choose from one of your uploaded media files": "Choose from one of your uploaded media files",
|
||||
"Choose post status": "Choose post status",
|
||||
"Title of the page about to be added": "Title of the page about to be added",
|
||||
"Page publish date (ISO-8601)": "Page publish date (ISO-8601)",
|
||||
"Choose status": "Choose status",
|
||||
"The ID of the post to get": "The ID of the post to get",
|
||||
"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..",
|
||||
"Published": "Published",
|
||||
"Scheduled": "Scheduled",
|
||||
"Draft": "Draft",
|
||||
"Pending": "Pending",
|
||||
"Private": "Private",
|
||||
"Trash": "Trash",
|
||||
"GET": "GET",
|
||||
"POST": "POST",
|
||||
"PATCH": "PATCH",
|
||||
"PUT": "PUT",
|
||||
"DELETE": "DELETE",
|
||||
"HEAD": "HEAD",
|
||||
"New Post": "New Post",
|
||||
"Triggers when a new post is published": "Triggers when a new post is published",
|
||||
"Authors": "Authors"
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"WordPress": "WordPress",
|
||||
"Open-source website creation software": "Open-source website creation software",
|
||||
"Username": "Username",
|
||||
"Password": "Password",
|
||||
"Website URL": "Website URL",
|
||||
"URL of the wordpress url i.e https://www.example-website.com": "URL of the wordpress url i.e https://www.example-website.com",
|
||||
"\n**Enable Basic Authentication:**\n\n1. Download the plugin from: https://github.com/WP-API/Basic-Auth (Click on Code -> Download Zip)\n2. Log in to your WordPress dashboard.\n3. Go to \"Plugins\" and click \"Add New.\"\n4. Choose \"Upload Plugin\" and select the downloaded file.\n5. Install and activate the plugin.\n\n": "\n**Enable Basic Authentication:**\n\n1. Download the plugin from: https://github.com/WP-API/Basic-Auth (Click on Code -> Download Zip)\n2. Log in to your WordPress dashboard.\n3. Go to \"Plugins\" and click \"Add New.\"\n4. Choose \"Upload Plugin\" and select the downloaded file.\n5. Install and activate the plugin.\n\n",
|
||||
"Create Post": "Create Post",
|
||||
"Create Page": "Create Page",
|
||||
"Update Post": "Update Post",
|
||||
"Get Post Details": "Get Post Details",
|
||||
"Custom API Call": "Custom API Call",
|
||||
"Create new post on WordPress": "Create new post on WordPress",
|
||||
"Create new page on WordPress": "Create new page on WordPress",
|
||||
"Update an existing post on WordPress.": "Update an existing post on WordPress.",
|
||||
"Get a post from WordPress": "Get a post from WordPress",
|
||||
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
|
||||
"Title": "Title",
|
||||
"Content": "Content",
|
||||
"Slug": "Slug",
|
||||
"Date": "Date",
|
||||
"Featured Media (URL)": "Featured Media (URL)",
|
||||
"Tags": "Tags",
|
||||
"Custom ACF fields": "Custom ACF fields",
|
||||
"Categories": "Categories",
|
||||
"Featured Media (image)": "Featured Media (image)",
|
||||
"Status": "Status",
|
||||
"Excerpt": "Excerpt",
|
||||
"Enable Comments": "Enable Comments",
|
||||
"Open to Pinging": "Open to Pinging",
|
||||
"Post": "Post",
|
||||
"Post ID": "Post ID",
|
||||
"Method": "Method",
|
||||
"Headers": "Headers",
|
||||
"Query Parameters": "Query Parameters",
|
||||
"Body": "Body",
|
||||
"No Error on Failure": "No Error on Failure",
|
||||
"Timeout (in seconds)": "Timeout (in seconds)",
|
||||
"Title of the post about to be added": "Title of the post about to be added",
|
||||
"Uses the WordPress Text Editor which supports HTML": "Uses the WordPress Text Editor which supports HTML",
|
||||
"Post publish date (ISO-8601)": "Post publish date (ISO-8601)",
|
||||
"URL of featured media": "URL of featured media",
|
||||
"Post tags": "Post tags",
|
||||
"Provide field name with value.You can find out field name from ACF plugin menu.": "Provide field name with value.You can find out field name from ACF plugin menu.",
|
||||
"Post categories": "Post categories",
|
||||
"Choose from one of your uploaded media files": "Choose from one of your uploaded media files",
|
||||
"Choose post status": "Choose post status",
|
||||
"Title of the page about to be added": "Title of the page about to be added",
|
||||
"Page publish date (ISO-8601)": "Page publish date (ISO-8601)",
|
||||
"Choose status": "Choose status",
|
||||
"The ID of the post to get": "The ID of the post to get",
|
||||
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
|
||||
"Published": "Đã xuất bản",
|
||||
"Scheduled": "Scheduled",
|
||||
"Draft": "Bản nháp",
|
||||
"Pending": "Đang chờ",
|
||||
"Private": "Private",
|
||||
"Trash": "Trash",
|
||||
"GET": "GET",
|
||||
"POST": "POST",
|
||||
"PATCH": "PATCH",
|
||||
"PUT": "PUT",
|
||||
"DELETE": "DELETE",
|
||||
"HEAD": "HEAD",
|
||||
"New Post": "New Post",
|
||||
"Triggers when a new post is published": "Triggers when a new post is published",
|
||||
"Authors": "Authors"
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"Open-source website creation software": "Open-source website creation software",
|
||||
"Username": "用户名",
|
||||
"Password": "Password",
|
||||
"Website URL": "Website URL",
|
||||
"URL of the wordpress url i.e https://www.example-website.com": "URL of the wordpress url i.e https://www.example-website.com",
|
||||
"\n**Enable Basic Authentication:**\n\n1. Download the plugin from: https://github.com/WP-API/Basic-Auth (Click on Code -> Download Zip)\n2. Log in to your WordPress dashboard.\n3. Go to \"Plugins\" and click \"Add New.\"\n4. Choose \"Upload Plugin\" and select the downloaded file.\n5. Install and activate the plugin.\n\n": "\n**Enable Basic Authentication:**\n\n1. Download the plugin from: https://github.com/WP-API/Basic-Auth (Click on Code -> Download Zip)\n2. Log in to your WordPress dashboard.\n3. Go to \"Plugins\" and click \"Add New.\"\n4. Choose \"Upload Plugin\" and select the downloaded file.\n5. Install and activate the plugin.\n\n",
|
||||
"Create Post": "Create Post",
|
||||
"Create Page": "Create Page",
|
||||
"Update Post": "Update Post",
|
||||
"Get Post Details": "Get Post Details",
|
||||
"Custom API Call": "自定义 API 呼叫",
|
||||
"Create new post on WordPress": "Create new post on WordPress",
|
||||
"Create new page on WordPress": "Create new page on WordPress",
|
||||
"Update an existing post on WordPress.": "Update an existing post on WordPress.",
|
||||
"Get a post from WordPress": "Get a post from WordPress",
|
||||
"Make a custom API call to a specific endpoint": "将一个自定义 API 调用到一个特定的终点",
|
||||
"Title": "标题",
|
||||
"Content": "Content",
|
||||
"Slug": "Slug",
|
||||
"Date": "Date",
|
||||
"Featured Media (URL)": "Featured Media (URL)",
|
||||
"Tags": "标签",
|
||||
"Custom ACF fields": "Custom ACF fields",
|
||||
"Categories": "Categories",
|
||||
"Featured Media (image)": "Featured Media (image)",
|
||||
"Status": "状态",
|
||||
"Excerpt": "Excerpt",
|
||||
"Enable Comments": "Enable Comments",
|
||||
"Open to Pinging": "Open to Pinging",
|
||||
"Post": "Post",
|
||||
"Post ID": "Post ID",
|
||||
"Method": "方法",
|
||||
"Headers": "信头",
|
||||
"Query Parameters": "查询参数",
|
||||
"Body": "正文内容",
|
||||
"Response is Binary ?": "Response is Binary ?",
|
||||
"No Error on Failure": "失败时没有错误",
|
||||
"Timeout (in seconds)": "超时(秒)",
|
||||
"Title of the post about to be added": "Title of the post about to be added",
|
||||
"Uses the WordPress Text Editor which supports HTML": "Uses the WordPress Text Editor which supports HTML",
|
||||
"Post publish date (ISO-8601)": "Post publish date (ISO-8601)",
|
||||
"URL of featured media": "URL of featured media",
|
||||
"Post tags": "Post tags",
|
||||
"Provide field name with value.You can find out field name from ACF plugin menu.": "Provide field name with value.You can find out field name from ACF plugin menu.",
|
||||
"Post categories": "Post categories",
|
||||
"Choose from one of your uploaded media files": "Choose from one of your uploaded media files",
|
||||
"Choose post status": "Choose post status",
|
||||
"Title of the page about to be added": "Title of the page about to be added",
|
||||
"Page publish date (ISO-8601)": "Page publish date (ISO-8601)",
|
||||
"Choose status": "Choose status",
|
||||
"The ID of the post to get": "The ID of the post to get",
|
||||
"Authorization headers are injected automatically from your connection.": "授权头自动从您的连接中注入。",
|
||||
"Enable for files like PDFs, images, etc..": "Enable for files like PDFs, images, etc..",
|
||||
"Published": "已发布",
|
||||
"Scheduled": "Scheduled",
|
||||
"Draft": "草稿",
|
||||
"Pending": "待處理",
|
||||
"Private": "Private",
|
||||
"Trash": "Trash",
|
||||
"GET": "获取",
|
||||
"POST": "帖子",
|
||||
"PATCH": "PATCH",
|
||||
"PUT": "弹出",
|
||||
"DELETE": "删除",
|
||||
"HEAD": "黑色",
|
||||
"New Post": "New Post",
|
||||
"Triggers when a new post is published": "Triggers when a new post is published",
|
||||
"Authors": "Authors"
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
import {
|
||||
AuthenticationType,
|
||||
HttpMethod,
|
||||
HttpRequest,
|
||||
createCustomApiCallAction,
|
||||
httpClient,
|
||||
} from '@activepieces/pieces-common';
|
||||
import {
|
||||
PieceAuth,
|
||||
Property,
|
||||
createPiece,
|
||||
} from '@activepieces/pieces-framework';
|
||||
import { PieceCategory } from '@activepieces/shared';
|
||||
import { createWordPressPage } from './lib/actions/create-page.action';
|
||||
import { createWordPressPost } from './lib/actions/create-post.action';
|
||||
import { getWordPressPost } from './lib/actions/get-post.action';
|
||||
import { wordpressCommon } from './lib/common';
|
||||
import { wordpressNewPost } from './lib/trigger/new-post.trigger';
|
||||
import { updateWordPressPost } from './lib/actions/update-post.action';
|
||||
|
||||
const markdownPropertyDescription = `
|
||||
**Enable Basic Authentication:**
|
||||
|
||||
1. Download the plugin from: https://github.com/WP-API/Basic-Auth (Click on Code -> Download Zip)
|
||||
2. Log in to your WordPress dashboard.
|
||||
3. Go to "Plugins" and click "Add New."
|
||||
4. Choose "Upload Plugin" and select the downloaded file.
|
||||
5. Install and activate the plugin.
|
||||
|
||||
`;
|
||||
|
||||
export const wordpressAuth = PieceAuth.CustomAuth({
|
||||
description: markdownPropertyDescription,
|
||||
required: true,
|
||||
props: {
|
||||
username: Property.ShortText({
|
||||
displayName: 'Username',
|
||||
required: true,
|
||||
}),
|
||||
password: PieceAuth.SecretText({
|
||||
displayName: 'Password',
|
||||
required: true,
|
||||
}),
|
||||
website_url: Property.ShortText({
|
||||
displayName: 'Website URL',
|
||||
required: true,
|
||||
description:
|
||||
'URL of the wordpress url i.e https://www.example-website.com',
|
||||
}),
|
||||
},
|
||||
validate: async ({ auth }) => {
|
||||
const { username, password, website_url } = auth;
|
||||
if (!username || !password || !website_url) {
|
||||
return {
|
||||
valid: false,
|
||||
error: 'please fill all the fields [username, password, website_url] ',
|
||||
};
|
||||
}
|
||||
if (!wordpressCommon.isBaseUrl(website_url.trim())) {
|
||||
return {
|
||||
valid: false,
|
||||
error:
|
||||
'Please ensure that the website is valid and does not contain any paths, for example, https://example-website.com.',
|
||||
};
|
||||
}
|
||||
const apiEnabled = await wordpressCommon.urlExists(
|
||||
website_url.trim() + '/wp-json'
|
||||
);
|
||||
if (!apiEnabled) {
|
||||
return {
|
||||
valid: false,
|
||||
error: `REST API is not reachable, visit ${website_url.trim()}/wp-json" \n make sure your settings (Settings -> Permalinks) are set to "Post name" (or any option other than "Plain") and disable any security plugins that might block the REST API `,
|
||||
};
|
||||
}
|
||||
try {
|
||||
const request: HttpRequest = {
|
||||
method: HttpMethod.GET,
|
||||
url: `${website_url}/wp-json/wp/v2/categories`,
|
||||
authentication: {
|
||||
type: AuthenticationType.BASIC,
|
||||
username: username,
|
||||
password: password,
|
||||
},
|
||||
};
|
||||
await httpClient.sendRequest(request);
|
||||
return {
|
||||
valid: true,
|
||||
};
|
||||
} catch (e: any) {
|
||||
return {
|
||||
valid: false,
|
||||
error: 'Credentials are invalid. ' + e?.message,
|
||||
};
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
export const wordpress = createPiece({
|
||||
displayName: 'WordPress',
|
||||
description: 'Open-source website creation software',
|
||||
|
||||
minimumSupportedRelease: '0.30.0',
|
||||
logoUrl: 'https://cdn.activepieces.com/pieces/wordpress.png',
|
||||
categories: [PieceCategory.MARKETING],
|
||||
auth: wordpressAuth,
|
||||
authors: [
|
||||
'pfernandez98',
|
||||
'Salem-Alaa',
|
||||
'kishanprmr',
|
||||
'MoShizzle',
|
||||
'AbdulTheActivePiecer',
|
||||
'khaledmashaly',
|
||||
'abuaboud',
|
||||
],
|
||||
actions: [
|
||||
createWordPressPost,
|
||||
createWordPressPage,
|
||||
updateWordPressPost,
|
||||
getWordPressPost,
|
||||
createCustomApiCallAction({
|
||||
baseUrl: (auth) =>auth ?
|
||||
(auth.props.website_url).trim() + '/wp-json/wp/v2' : '',
|
||||
auth: wordpressAuth,
|
||||
authMapping: async (auth) => ({
|
||||
Authorization: `Basic ${Buffer.from(
|
||||
`${auth.props.username}:${
|
||||
auth.props.password
|
||||
}`
|
||||
).toString('base64')}`,
|
||||
}),
|
||||
}),
|
||||
],
|
||||
triggers: [wordpressNewPost],
|
||||
});
|
||||
@@ -0,0 +1,104 @@
|
||||
import { createAction, Property } from '@activepieces/pieces-framework';
|
||||
import { wordpressCommon } from '../common';
|
||||
import {
|
||||
httpClient,
|
||||
HttpMethod,
|
||||
HttpRequest,
|
||||
AuthenticationType,
|
||||
} from '@activepieces/pieces-common';
|
||||
import { wordpressAuth } from '../..';
|
||||
|
||||
export const createWordPressPage = createAction({
|
||||
auth: wordpressAuth,
|
||||
name: 'create_page',
|
||||
description: 'Create new page on WordPress',
|
||||
displayName: 'Create Page',
|
||||
props: {
|
||||
title: Property.ShortText({
|
||||
description: 'Title of the page about to be added',
|
||||
displayName: 'Title',
|
||||
required: true,
|
||||
}),
|
||||
content: Property.LongText({
|
||||
description: 'Uses the WordPress Text Editor which supports HTML',
|
||||
displayName: 'Content',
|
||||
required: true,
|
||||
}),
|
||||
slug: Property.ShortText({
|
||||
displayName: 'Slug',
|
||||
required: false,
|
||||
}),
|
||||
date: Property.ShortText({
|
||||
description: 'Page publish date (ISO-8601)',
|
||||
displayName: 'Date',
|
||||
required: false,
|
||||
}),
|
||||
status: Property.StaticDropdown({
|
||||
description: 'Choose status',
|
||||
displayName: 'Status',
|
||||
required: false,
|
||||
options: {
|
||||
disabled: false,
|
||||
options: [
|
||||
{ value: 'publish', label: 'Published' },
|
||||
{ value: 'future', label: 'Scheduled' },
|
||||
{ value: 'draft', label: 'Draft' },
|
||||
{ value: 'pending', label: 'Pending' },
|
||||
{ value: 'private', label: 'Private' },
|
||||
],
|
||||
},
|
||||
}),
|
||||
excerpt: Property.LongText({
|
||||
description: 'Uses the WordPress Text Editor which supports HTML',
|
||||
displayName: 'Excerpt',
|
||||
required: false,
|
||||
}),
|
||||
comment_status: Property.Checkbox({
|
||||
displayName: 'Enable Comments',
|
||||
required: false,
|
||||
}),
|
||||
ping_status: Property.Checkbox({
|
||||
displayName: 'Open to Pinging',
|
||||
required: false,
|
||||
}),
|
||||
},
|
||||
async run(context) {
|
||||
if (!(await wordpressCommon.urlExists(context.auth.props.website_url.trim()))) {
|
||||
throw new Error('Website url is invalid: ' + context.auth.props.website_url);
|
||||
}
|
||||
const requestBody: Record<string, unknown> = {};
|
||||
if (context.propsValue.date) {
|
||||
requestBody['date'] = context.propsValue.date;
|
||||
}
|
||||
if (context.propsValue.comment_status) {
|
||||
requestBody['comment_status'] = context.propsValue.comment_status
|
||||
? 'open'
|
||||
: 'closed';
|
||||
}
|
||||
if (context.propsValue.slug) {
|
||||
requestBody['slug'] = context.propsValue.slug;
|
||||
}
|
||||
if (context.propsValue.excerpt) {
|
||||
requestBody['excerpt'] = context.propsValue.excerpt;
|
||||
}
|
||||
if (context.propsValue.status) {
|
||||
requestBody['status'] = context.propsValue.status;
|
||||
}
|
||||
requestBody['content'] = context.propsValue.content;
|
||||
requestBody['title'] = context.propsValue.title;
|
||||
const request: HttpRequest = {
|
||||
method: HttpMethod.POST,
|
||||
url: `${context.auth.props.website_url.trim()}/wp-json/wp/v2/pages`,
|
||||
authentication: {
|
||||
type: AuthenticationType.BASIC,
|
||||
username: context.auth.props.username,
|
||||
password: context.auth.props.password,
|
||||
},
|
||||
body: requestBody,
|
||||
};
|
||||
const response = await httpClient.sendRequest<
|
||||
{ id: string; name: string }[]
|
||||
>(request);
|
||||
return response;
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,141 @@
|
||||
import {
|
||||
createAction,
|
||||
PiecePropValueSchema,
|
||||
Property,
|
||||
} from '@activepieces/pieces-framework';
|
||||
import { wordpressCommon, WordPressMedia } from '../common';
|
||||
import {
|
||||
httpClient,
|
||||
HttpMethod,
|
||||
AuthenticationType,
|
||||
} from '@activepieces/pieces-common';
|
||||
import FormData from 'form-data';
|
||||
import { wordpressAuth } from '../..';
|
||||
|
||||
export const createWordPressPost = createAction({
|
||||
auth: wordpressAuth,
|
||||
name: 'create_post',
|
||||
description: 'Create new post on WordPress',
|
||||
displayName: 'Create Post',
|
||||
props: {
|
||||
title: Property.ShortText({
|
||||
description: 'Title of the post about to be added',
|
||||
displayName: 'Title',
|
||||
required: true,
|
||||
}),
|
||||
content: Property.LongText({
|
||||
description: 'Uses the WordPress Text Editor which supports HTML',
|
||||
displayName: 'Content',
|
||||
required: true,
|
||||
}),
|
||||
slug: Property.ShortText({
|
||||
displayName: 'Slug',
|
||||
required: false,
|
||||
}),
|
||||
date: Property.ShortText({
|
||||
description: 'Post publish date (ISO-8601)',
|
||||
displayName: 'Date',
|
||||
required: false,
|
||||
}),
|
||||
featured_media_file: wordpressCommon.featured_media_file,
|
||||
tags: wordpressCommon.tags,
|
||||
acfFields: Property.Object({
|
||||
displayName: 'Custom ACF fields',
|
||||
description:
|
||||
'Provide field name with value.You can find out field name from ACF plugin menu.',
|
||||
required: false,
|
||||
}),
|
||||
categories: wordpressCommon.categories,
|
||||
featured_media: wordpressCommon.featured_media,
|
||||
status: wordpressCommon.status,
|
||||
excerpt: Property.LongText({
|
||||
description: 'Uses the WordPress Text Editor which supports HTML',
|
||||
displayName: 'Excerpt',
|
||||
required: false,
|
||||
}),
|
||||
comment_status: Property.Checkbox({
|
||||
displayName: 'Enable Comments',
|
||||
required: false,
|
||||
}),
|
||||
ping_status: Property.Checkbox({
|
||||
displayName: 'Open to Pinging',
|
||||
required: false,
|
||||
}),
|
||||
},
|
||||
async run(context) {
|
||||
if (!(await wordpressCommon.urlExists(context.auth.props.website_url.trim()))) {
|
||||
throw new Error('Website url is invalid: ' + context.auth.props.website_url);
|
||||
}
|
||||
const requestBody: Record<string, unknown> = {};
|
||||
if (context.propsValue.date) {
|
||||
requestBody['date'] = context.propsValue.date;
|
||||
}
|
||||
if (context.propsValue.comment_status) {
|
||||
requestBody['comment_status'] = context.propsValue.comment_status
|
||||
? 'open'
|
||||
: 'closed';
|
||||
}
|
||||
if (context.propsValue.categories) {
|
||||
requestBody['categories'] = context.propsValue.categories;
|
||||
}
|
||||
if (context.propsValue.slug) {
|
||||
requestBody['slug'] = context.propsValue.slug;
|
||||
}
|
||||
if (context.propsValue.excerpt) {
|
||||
requestBody['excerpt'] = context.propsValue.excerpt;
|
||||
}
|
||||
if (context.propsValue.tags) {
|
||||
requestBody['tags'] = context.propsValue.tags;
|
||||
}
|
||||
if (context.propsValue.ping_status) {
|
||||
requestBody['ping_status'] = context.propsValue.ping_status
|
||||
? 'open'
|
||||
: 'closed';
|
||||
}
|
||||
if (context.propsValue.status) {
|
||||
requestBody['status'] = context.propsValue.status;
|
||||
}
|
||||
if (context.propsValue.featured_media) {
|
||||
requestBody['featured_media'] = context.propsValue.featured_media;
|
||||
}
|
||||
|
||||
if (
|
||||
context.propsValue.acfFields &&
|
||||
Object.keys(context.propsValue.acfFields).length > 0
|
||||
) {
|
||||
requestBody['acf'] = context.propsValue.acfFields;
|
||||
}
|
||||
|
||||
if (context.propsValue.featured_media_file) {
|
||||
const formData = new FormData();
|
||||
const { filename, base64 } = context.propsValue.featured_media_file;
|
||||
formData.append('file', Buffer.from(base64, 'base64'), filename);
|
||||
const uploadMediaResponse = await httpClient.sendRequest<{ id: string }>({
|
||||
method: HttpMethod.POST,
|
||||
url: `${context.auth.props.website_url.trim()}/wp-json/wp/v2/media`,
|
||||
body: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
authentication: {
|
||||
type: AuthenticationType.BASIC,
|
||||
username: context.auth.props.username,
|
||||
password: context.auth.props.password,
|
||||
},
|
||||
});
|
||||
requestBody['featured_media'] = uploadMediaResponse.body.id;
|
||||
}
|
||||
requestBody['content'] = context.propsValue.content;
|
||||
requestBody['title'] = context.propsValue.title;
|
||||
return await httpClient.sendRequest<{ id: string; name: string }[]>({
|
||||
method: HttpMethod.POST,
|
||||
url: `${context.auth.props.website_url.trim()}/wp-json/wp/v2/posts`,
|
||||
authentication: {
|
||||
type: AuthenticationType.BASIC,
|
||||
username: context.auth.props.username,
|
||||
password: context.auth.props.password,
|
||||
},
|
||||
body: requestBody,
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,44 @@
|
||||
import {
|
||||
createAction,
|
||||
PiecePropValueSchema,
|
||||
Property,
|
||||
} from '@activepieces/pieces-framework';
|
||||
import { wordpressCommon, WordPressMedia } from '../common';
|
||||
import {
|
||||
httpClient,
|
||||
HttpMethod,
|
||||
AuthenticationType,
|
||||
} from '@activepieces/pieces-common';
|
||||
import FormData from 'form-data';
|
||||
import { wordpressAuth } from '../..';
|
||||
|
||||
export const getWordPressPost = createAction({
|
||||
auth: wordpressAuth,
|
||||
name: 'get_post',
|
||||
description: 'Get a post from WordPress',
|
||||
displayName: 'Get Post Details',
|
||||
props: {
|
||||
id: Property.Number({
|
||||
description: 'The ID of the post to get',
|
||||
displayName: 'Post ID',
|
||||
required: true,
|
||||
}),
|
||||
},
|
||||
async run(context) {
|
||||
if (!(await wordpressCommon.urlExists(context.auth.props.website_url.trim()))) {
|
||||
throw new Error('Website url is invalid: ' + context.auth.props.website_url);
|
||||
}
|
||||
|
||||
return await httpClient.sendRequest<{ id: string; name: string }[]>({
|
||||
method: HttpMethod.GET,
|
||||
url: `${context.auth.props.website_url.trim()}/wp-json/wp/v2/posts/${
|
||||
context.propsValue.id
|
||||
}`,
|
||||
authentication: {
|
||||
type: AuthenticationType.BASIC,
|
||||
username: context.auth.props.username,
|
||||
password: context.auth.props.password,
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,150 @@
|
||||
import { createAction, Property } from '@activepieces/pieces-framework';
|
||||
import { wordpressCommon } from '../common';
|
||||
import {
|
||||
httpClient,
|
||||
HttpMethod,
|
||||
AuthenticationType,
|
||||
} from '@activepieces/pieces-common';
|
||||
import FormData from 'form-data';
|
||||
import { wordpressAuth } from '../..';
|
||||
|
||||
export const updateWordPressPost = createAction({
|
||||
auth: wordpressAuth,
|
||||
name: 'update_post',
|
||||
description: 'Update an existing post on WordPress.',
|
||||
displayName: 'Update Post',
|
||||
props: {
|
||||
post: wordpressCommon.post,
|
||||
title: Property.ShortText({
|
||||
description: 'Title of the post about to be added',
|
||||
displayName: 'Title',
|
||||
required: false,
|
||||
}),
|
||||
content: Property.LongText({
|
||||
description: 'Uses the WordPress Text Editor which supports HTML',
|
||||
displayName: 'Content',
|
||||
required: false,
|
||||
}),
|
||||
slug: Property.ShortText({
|
||||
displayName: 'Slug',
|
||||
required: false,
|
||||
}),
|
||||
date: Property.ShortText({
|
||||
description: 'Post publish date (ISO-8601)',
|
||||
displayName: 'Date',
|
||||
required: false,
|
||||
}),
|
||||
featured_media_file: wordpressCommon.featured_media_file,
|
||||
tags: wordpressCommon.tags,
|
||||
acfFields: Property.Object({
|
||||
displayName: 'Custom ACF fields',
|
||||
description:
|
||||
'Provide field name with value.You can find out field name from ACF plugin menu.',
|
||||
required: false,
|
||||
}),
|
||||
categories: wordpressCommon.categories,
|
||||
featured_media: wordpressCommon.featured_media,
|
||||
status: wordpressCommon.status,
|
||||
excerpt: Property.LongText({
|
||||
description: 'Uses the WordPress Text Editor which supports HTML',
|
||||
displayName: 'Excerpt',
|
||||
required: false,
|
||||
}),
|
||||
comment_status: Property.Checkbox({
|
||||
displayName: 'Enable Comments',
|
||||
required: false,
|
||||
}),
|
||||
ping_status: Property.Checkbox({
|
||||
displayName: 'Open to Pinging',
|
||||
required: false,
|
||||
}),
|
||||
},
|
||||
async run(context) {
|
||||
if (!(await wordpressCommon.urlExists(context.auth.props.website_url.trim()))) {
|
||||
throw new Error('Website url is invalid: ' + context.auth.props.website_url);
|
||||
}
|
||||
const requestBody: Record<string, unknown> = {};
|
||||
|
||||
if (context.propsValue.title) {
|
||||
requestBody['title'] = context.propsValue.title;
|
||||
}
|
||||
|
||||
if (context.propsValue.content) {
|
||||
requestBody['content'] = context.propsValue.content;
|
||||
}
|
||||
|
||||
if (context.propsValue.date) {
|
||||
requestBody['date'] = context.propsValue.date;
|
||||
}
|
||||
if (context.propsValue.comment_status) {
|
||||
requestBody['comment_status'] = context.propsValue.comment_status
|
||||
? 'open'
|
||||
: 'closed';
|
||||
}
|
||||
if (context.propsValue.categories) {
|
||||
requestBody['categories'] = context.propsValue.categories;
|
||||
}
|
||||
if (context.propsValue.slug) {
|
||||
requestBody['slug'] = context.propsValue.slug;
|
||||
}
|
||||
if (context.propsValue.excerpt) {
|
||||
requestBody['excerpt'] = context.propsValue.excerpt;
|
||||
}
|
||||
if (context.propsValue.tags) {
|
||||
requestBody['tags'] = context.propsValue.tags;
|
||||
}
|
||||
if (context.propsValue.ping_status) {
|
||||
requestBody['ping_status'] = context.propsValue.ping_status
|
||||
? 'open'
|
||||
: 'closed';
|
||||
}
|
||||
if (context.propsValue.status) {
|
||||
requestBody['status'] = context.propsValue.status;
|
||||
}
|
||||
if (context.propsValue.featured_media) {
|
||||
requestBody['featured_media'] = context.propsValue.featured_media;
|
||||
}
|
||||
|
||||
if (
|
||||
context.propsValue.acfFields &&
|
||||
Object.keys(context.propsValue.acfFields).length > 0
|
||||
) {
|
||||
requestBody['acf'] = context.propsValue.acfFields;
|
||||
}
|
||||
|
||||
if (context.propsValue.featured_media_file) {
|
||||
const formData = new FormData();
|
||||
const { filename, base64 } = context.propsValue.featured_media_file;
|
||||
formData.append('file', Buffer.from(base64, 'base64'), filename);
|
||||
const uploadMediaResponse = await httpClient.sendRequest<{ id: string }>({
|
||||
method: HttpMethod.POST,
|
||||
url: `${context.auth.props.website_url.trim()}/wp-json/wp/v2/media`,
|
||||
body: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
authentication: {
|
||||
type: AuthenticationType.BASIC,
|
||||
username: context.auth.props.username,
|
||||
password: context.auth.props.password,
|
||||
},
|
||||
});
|
||||
requestBody['featured_media'] = uploadMediaResponse.body.id;
|
||||
}
|
||||
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.POST,
|
||||
url: `${context.auth.props.website_url.trim()}/wp-json/wp/v2/posts/${
|
||||
context.propsValue.post
|
||||
}`,
|
||||
authentication: {
|
||||
type: AuthenticationType.BASIC,
|
||||
username: context.auth.props.username,
|
||||
password: context.auth.props.password,
|
||||
},
|
||||
body: requestBody,
|
||||
});
|
||||
|
||||
return response.body;
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,481 @@
|
||||
import {
|
||||
DropdownOption,
|
||||
PiecePropValueSchema,
|
||||
Property,
|
||||
} from '@activepieces/pieces-framework';
|
||||
import {
|
||||
AuthenticationType,
|
||||
httpClient,
|
||||
HttpMethod,
|
||||
HttpRequest,
|
||||
} from '@activepieces/pieces-common';
|
||||
import { wordpressAuth } from '../..';
|
||||
export type WordPressMedia = { id: string; title: { rendered: string } };
|
||||
|
||||
const PAGE_HEADER = 'x-wp-totalpages';
|
||||
|
||||
export const wordpressCommon = {
|
||||
featured_media_file: Property.File({
|
||||
displayName: 'Featured Media (URL)',
|
||||
required: false,
|
||||
description: 'URL of featured media',
|
||||
}),
|
||||
authors: Property.Dropdown({
|
||||
auth: wordpressAuth,
|
||||
displayName: 'Authors',
|
||||
required: false,
|
||||
refreshers: [],
|
||||
options: async ({ auth }) => {
|
||||
if (!auth) {
|
||||
return {
|
||||
disabled: true,
|
||||
options: [],
|
||||
placeholder: 'Please connect your account first',
|
||||
};
|
||||
}
|
||||
const connection = auth.props;
|
||||
const websiteUrl = connection.website_url;
|
||||
if (!connection?.username || !connection?.password || !websiteUrl) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: 'Connect your account first',
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
const request: HttpRequest = {
|
||||
method: HttpMethod.GET,
|
||||
url: `${websiteUrl.trim()}/wp-json/wp/v2/users`,
|
||||
authentication: {
|
||||
type: AuthenticationType.BASIC,
|
||||
username: connection.username,
|
||||
password: connection.password,
|
||||
},
|
||||
};
|
||||
const response = await httpClient.sendRequest<
|
||||
{ id: string; name: string }[]
|
||||
>(request);
|
||||
return {
|
||||
options: response.body.map((usr) => {
|
||||
return { value: usr.id, label: usr.name };
|
||||
}),
|
||||
};
|
||||
},
|
||||
}),
|
||||
tags: Property.MultiSelectDropdown<string, false,typeof wordpressAuth>({
|
||||
auth: wordpressAuth,
|
||||
description: 'Post tags',
|
||||
displayName: 'Tags',
|
||||
required: false,
|
||||
refreshers: [],
|
||||
options: async ({ auth }) => {
|
||||
if (!auth) {
|
||||
return {
|
||||
disabled: true,
|
||||
options: [],
|
||||
placeholder: 'Please connect your account first',
|
||||
};
|
||||
}
|
||||
const connection = auth.props;
|
||||
|
||||
if (!(await wordpressCommon.urlExists(connection.website_url.trim()))) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: 'Incorrect website url',
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
|
||||
let pageCursor = 1;
|
||||
const getTagsParams = {
|
||||
websiteUrl: connection.website_url.trim(),
|
||||
username: connection.username,
|
||||
password: connection.password,
|
||||
page: pageCursor,
|
||||
};
|
||||
const result: { id: string; name: string }[] = [];
|
||||
let hasNext = true;
|
||||
let tags = await wordpressCommon.getTags(getTagsParams);
|
||||
while (hasNext) {
|
||||
result.push(...tags.tags);
|
||||
hasNext = pageCursor <= tags.totalPages;
|
||||
if (hasNext) {
|
||||
pageCursor++;
|
||||
tags = await wordpressCommon.getTags({
|
||||
...getTagsParams,
|
||||
page: pageCursor,
|
||||
});
|
||||
}
|
||||
}
|
||||
if (result.length === 0) {
|
||||
return {
|
||||
disabled: true,
|
||||
options: [],
|
||||
placeholder: 'Please add tags from your admin dashboard',
|
||||
};
|
||||
}
|
||||
const options = result.map((res) => {
|
||||
return {
|
||||
label: res.name,
|
||||
value: res.id,
|
||||
};
|
||||
});
|
||||
return {
|
||||
options: options,
|
||||
disabled: false,
|
||||
};
|
||||
},
|
||||
}),
|
||||
categories: Property.MultiSelectDropdown<string, false,typeof wordpressAuth>({
|
||||
auth: wordpressAuth,
|
||||
description: 'Post categories',
|
||||
displayName: 'Categories',
|
||||
required: false,
|
||||
refreshers: [],
|
||||
options: async ({ auth }) => {
|
||||
if (!auth) {
|
||||
return {
|
||||
disabled: true,
|
||||
options: [],
|
||||
placeholder: 'Please connect your account first',
|
||||
};
|
||||
}
|
||||
const connection = auth.props;
|
||||
if (!(await wordpressCommon.urlExists(connection.website_url.trim()))) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: 'Incorrect website url',
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
|
||||
let pageCursor = 1;
|
||||
const getTagsParams = {
|
||||
websiteUrl: connection.website_url,
|
||||
username: connection.username,
|
||||
password: connection.password,
|
||||
perPage: 10,
|
||||
page: pageCursor,
|
||||
};
|
||||
const result: { id: string; name: string }[] = [];
|
||||
let categories = await wordpressCommon.getCategories(getTagsParams);
|
||||
let hasNext = true;
|
||||
while (hasNext) {
|
||||
result.push(...categories.categories);
|
||||
hasNext = pageCursor <= categories.totalPages;
|
||||
if (hasNext) {
|
||||
pageCursor++;
|
||||
categories = await wordpressCommon.getCategories({
|
||||
...getTagsParams,
|
||||
page: pageCursor,
|
||||
});
|
||||
}
|
||||
}
|
||||
if (result.length === 0) {
|
||||
return {
|
||||
disabled: true,
|
||||
options: [],
|
||||
placeholder: 'Please add categories from your admin dashboard',
|
||||
};
|
||||
}
|
||||
const options = result.map((res) => {
|
||||
return {
|
||||
label: res.name,
|
||||
value: res.id,
|
||||
};
|
||||
});
|
||||
return {
|
||||
options: options,
|
||||
disabled: false,
|
||||
};
|
||||
},
|
||||
}),
|
||||
featured_media: Property.Dropdown({
|
||||
auth: wordpressAuth,
|
||||
description: 'Choose from one of your uploaded media files',
|
||||
displayName: 'Featured Media (image)',
|
||||
required: false,
|
||||
refreshers: [],
|
||||
options: async ({ auth }) => {
|
||||
if (!auth) {
|
||||
return {
|
||||
disabled: true,
|
||||
options: [],
|
||||
placeholder: 'Please connect your account first',
|
||||
};
|
||||
}
|
||||
const connection = auth.props;
|
||||
if (!(await wordpressCommon.urlExists(connection.website_url.trim()))) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: 'Incorrect website url',
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
|
||||
let pageCursor = 1;
|
||||
const getMediaParams = {
|
||||
websiteUrl: connection.website_url,
|
||||
username: connection.username,
|
||||
password: connection.password,
|
||||
page: pageCursor,
|
||||
};
|
||||
const result: WordPressMedia[] = [];
|
||||
let media = await wordpressCommon.getMedia(getMediaParams);
|
||||
if (media.totalPages === 0) {
|
||||
result.push(...media.media);
|
||||
}
|
||||
while (media.media.length > 0 && pageCursor <= media.totalPages) {
|
||||
result.push(...media.media);
|
||||
pageCursor++;
|
||||
media = await wordpressCommon.getMedia(getMediaParams);
|
||||
}
|
||||
if (result.length === 0) {
|
||||
return {
|
||||
disabled: true,
|
||||
options: [],
|
||||
placeholder:
|
||||
'Please add an image to your media from your admin dashboard',
|
||||
};
|
||||
}
|
||||
const options = result.map((res) => {
|
||||
return {
|
||||
label: res.title.rendered,
|
||||
value: res.id,
|
||||
};
|
||||
});
|
||||
return {
|
||||
options: options,
|
||||
disabled: false,
|
||||
};
|
||||
},
|
||||
}),
|
||||
status: Property.StaticDropdown({
|
||||
description: 'Choose post status',
|
||||
displayName: 'Status',
|
||||
required: false,
|
||||
options: {
|
||||
disabled: false,
|
||||
options: [
|
||||
{ value: 'publish', label: 'Published' },
|
||||
{ value: 'future', label: 'Scheduled' },
|
||||
{ value: 'draft', label: 'Draft' },
|
||||
{ value: 'pending', label: 'Pending' },
|
||||
{ value: 'private', label: 'Private' },
|
||||
{ value: 'trash', label: 'Trash' },
|
||||
],
|
||||
},
|
||||
}),
|
||||
post: Property.Dropdown({
|
||||
auth: wordpressAuth,
|
||||
displayName: 'Post',
|
||||
required: true,
|
||||
refreshers: [],
|
||||
options: async ({ auth }) => {
|
||||
if (!auth) {
|
||||
return {
|
||||
disabled: true,
|
||||
options: [],
|
||||
placeholder: 'Please connect your account first',
|
||||
};
|
||||
}
|
||||
const connection = auth.props;
|
||||
const websiteUrl = connection.website_url;
|
||||
if (!connection?.username || !connection?.password || !websiteUrl) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: 'Connect your account first',
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
const postOptions: DropdownOption<number>[] = [];
|
||||
let currentPage = 0;
|
||||
let totalPage = 0;
|
||||
|
||||
do {
|
||||
currentPage += 1;
|
||||
const request: HttpRequest = {
|
||||
method: HttpMethod.GET,
|
||||
url: `${websiteUrl.trim()}/wp-json/wp/v2/posts`,
|
||||
authentication: {
|
||||
type: AuthenticationType.BASIC,
|
||||
username: connection.username,
|
||||
password: connection.password,
|
||||
},
|
||||
queryParams: {
|
||||
orderby: 'date',
|
||||
order: 'desc',
|
||||
per_page: '50',
|
||||
page: currentPage.toString(),
|
||||
},
|
||||
};
|
||||
|
||||
const response = await httpClient.sendRequest(request);
|
||||
totalPage = parseInt(
|
||||
response.headers?.['x-wp-totalpages'] as string,
|
||||
10
|
||||
);
|
||||
|
||||
postOptions.push(
|
||||
...response.body.map(
|
||||
(post: { id: number; title: { rendered: string } }) => {
|
||||
return {
|
||||
label: post.title.rendered
|
||||
? post.title.rendered
|
||||
: post.id.toString(),
|
||||
value: post.id,
|
||||
};
|
||||
}
|
||||
)
|
||||
);
|
||||
} while (totalPage !== currentPage);
|
||||
|
||||
return {
|
||||
disabled: false,
|
||||
options: postOptions,
|
||||
};
|
||||
},
|
||||
}),
|
||||
async getPosts(params: {
|
||||
websiteUrl: string;
|
||||
username: string;
|
||||
password: string;
|
||||
authors: string | undefined;
|
||||
afterDate: string;
|
||||
page: number;
|
||||
}) {
|
||||
const queryParams: Record<string, string> = {
|
||||
orderby: 'date',
|
||||
order: 'desc',
|
||||
before: new Date().toISOString(),
|
||||
after: params.afterDate,
|
||||
page: params.page.toString(),
|
||||
};
|
||||
if (params.authors) {
|
||||
queryParams['author'] = params.authors;
|
||||
}
|
||||
const request: HttpRequest = {
|
||||
method: HttpMethod.GET,
|
||||
url: `${params.websiteUrl}/wp-json/wp/v2/posts`,
|
||||
authentication: {
|
||||
type: AuthenticationType.BASIC,
|
||||
username: params.username,
|
||||
password: params.password,
|
||||
},
|
||||
queryParams: queryParams,
|
||||
};
|
||||
const response = await httpClient.sendRequest<{ date: string }[]>(request);
|
||||
return {
|
||||
posts: response.body,
|
||||
totalPages:
|
||||
response.headers && response.headers[PAGE_HEADER]
|
||||
? Number(response.headers[PAGE_HEADER])
|
||||
: 0,
|
||||
};
|
||||
},
|
||||
async getMedia(params: {
|
||||
websiteUrl: string;
|
||||
username: string;
|
||||
password: string;
|
||||
page: number;
|
||||
}) {
|
||||
const request: HttpRequest = {
|
||||
method: HttpMethod.GET,
|
||||
url: `${params.websiteUrl}/wp-json/wp/v2/media`,
|
||||
queryParams: {
|
||||
page: params.page.toString(),
|
||||
},
|
||||
authentication: {
|
||||
type: AuthenticationType.BASIC,
|
||||
username: params.username,
|
||||
password: params.password,
|
||||
},
|
||||
};
|
||||
const response = await httpClient.sendRequest<WordPressMedia[]>(request);
|
||||
return {
|
||||
media: response.body,
|
||||
totalPages:
|
||||
response.headers && response.headers[PAGE_HEADER]
|
||||
? Number(response.headers[PAGE_HEADER])
|
||||
: 0,
|
||||
};
|
||||
},
|
||||
async getTags(params: {
|
||||
websiteUrl: string;
|
||||
username: string;
|
||||
password: string;
|
||||
page: number;
|
||||
}) {
|
||||
const request: HttpRequest = {
|
||||
method: HttpMethod.GET,
|
||||
url: `${params.websiteUrl}/wp-json/wp/v2/tags`,
|
||||
queryParams: {
|
||||
page: params.page.toString(),
|
||||
},
|
||||
authentication: {
|
||||
type: AuthenticationType.BASIC,
|
||||
username: params.username,
|
||||
password: params.password,
|
||||
},
|
||||
};
|
||||
const response = await httpClient.sendRequest<
|
||||
{ id: string; name: string }[]
|
||||
>(request);
|
||||
return {
|
||||
tags: response.body,
|
||||
totalPages:
|
||||
response.headers && response.headers[PAGE_HEADER]
|
||||
? Number(response.headers[PAGE_HEADER])
|
||||
: 0,
|
||||
};
|
||||
},
|
||||
async getCategories(params: {
|
||||
websiteUrl: string;
|
||||
username: string;
|
||||
password: string;
|
||||
page: number;
|
||||
}) {
|
||||
const request: HttpRequest = {
|
||||
method: HttpMethod.GET,
|
||||
url: `${params.websiteUrl}/wp-json/wp/v2/categories`,
|
||||
authentication: {
|
||||
type: AuthenticationType.BASIC,
|
||||
username: params.username,
|
||||
password: params.password,
|
||||
},
|
||||
queryParams: {
|
||||
page: params.page.toString(),
|
||||
},
|
||||
};
|
||||
const response = await httpClient.sendRequest<
|
||||
{ id: string; name: string }[]
|
||||
>(request);
|
||||
return {
|
||||
categories: response.body,
|
||||
totalPages:
|
||||
response.headers && response.headers[PAGE_HEADER]
|
||||
? Number(response.headers[PAGE_HEADER])
|
||||
: 0,
|
||||
};
|
||||
},
|
||||
async urlExists(url: string) {
|
||||
try {
|
||||
const request: HttpRequest = {
|
||||
method: HttpMethod.GET,
|
||||
url: url,
|
||||
};
|
||||
await httpClient.sendRequest(request);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
async isBaseUrl(urlString: string): Promise<boolean> {
|
||||
try {
|
||||
const url = new URL(urlString);
|
||||
return !url.pathname || url.pathname === '/';
|
||||
} catch (error) {
|
||||
// Handle invalid URLs here, e.g., return false or throw an error
|
||||
return false;
|
||||
}
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,190 @@
|
||||
import {
|
||||
AppConnectionValueForAuthProperty,
|
||||
createTrigger,
|
||||
PiecePropValueSchema,
|
||||
TriggerStrategy,
|
||||
} from '@activepieces/pieces-framework';
|
||||
import {
|
||||
DedupeStrategy,
|
||||
Polling,
|
||||
pollingHelper,
|
||||
} from '@activepieces/pieces-common';
|
||||
import { wordpressCommon } from '../common';
|
||||
import dayjs from 'dayjs';
|
||||
import { wordpressAuth } from '../..';
|
||||
|
||||
export const wordpressNewPost = createTrigger({
|
||||
auth: wordpressAuth,
|
||||
name: 'new_post',
|
||||
displayName: 'New Post',
|
||||
sampleData: {
|
||||
id: 60,
|
||||
date: '2023-02-19T10:08:25',
|
||||
date_gmt: '2023-02-19T10:08:25',
|
||||
guid: {
|
||||
rendered: 'https://yoursite.com/?p=60',
|
||||
},
|
||||
modified: '2023-02-19T10:08:25',
|
||||
modified_gmt: '2023-02-19T10:08:25',
|
||||
slug: 'post-slug',
|
||||
status: 'publish',
|
||||
type: 'post',
|
||||
link: '/post-slug/',
|
||||
title: {
|
||||
rendered: '<h1> post title </h1>',
|
||||
},
|
||||
content: {
|
||||
rendered: '\npost content\n',
|
||||
protected: false,
|
||||
},
|
||||
excerpt: {
|
||||
rendered: 'xxx\n',
|
||||
protected: false,
|
||||
},
|
||||
author: 1,
|
||||
featured_media: 0,
|
||||
comment_status: 'open',
|
||||
ping_status: 'open',
|
||||
sticky: false,
|
||||
template: '',
|
||||
format: 'standard',
|
||||
meta: [],
|
||||
categories: [1],
|
||||
tags: [],
|
||||
_links: {
|
||||
self: [
|
||||
{
|
||||
href: '/wp-json/wp/v2/posts/60',
|
||||
},
|
||||
],
|
||||
collection: [
|
||||
{
|
||||
href: '/wp-json/wp/v2/posts',
|
||||
},
|
||||
],
|
||||
about: [
|
||||
{
|
||||
href: '/wp-json/wp/v2/types/post',
|
||||
},
|
||||
],
|
||||
author: [
|
||||
{
|
||||
embeddable: true,
|
||||
href: '/wp-json/wp/v2/users/1',
|
||||
},
|
||||
],
|
||||
replies: [
|
||||
{
|
||||
embeddable: true,
|
||||
href: '/wp-json/wp/v2/comments?post=60',
|
||||
},
|
||||
],
|
||||
'version-history': [
|
||||
{
|
||||
count: 1,
|
||||
href: '/wp-json/wp/v2/posts/60/revisions',
|
||||
},
|
||||
],
|
||||
'predecessor-version': [
|
||||
{
|
||||
id: 61,
|
||||
href: '/wp-json/wp/v2/posts/60/revisions/61',
|
||||
},
|
||||
],
|
||||
'wp:attachment': [
|
||||
{
|
||||
href: '/wp-json/wp/v2/media?parent=60',
|
||||
},
|
||||
],
|
||||
'wp:term': [
|
||||
{
|
||||
taxonomy: 'category',
|
||||
embeddable: true,
|
||||
href: '/wp-json/wp/v2/categories?post=60',
|
||||
},
|
||||
{
|
||||
taxonomy: 'post_tag',
|
||||
embeddable: true,
|
||||
href: '/wp-json/wp/v2/tags?post=60',
|
||||
},
|
||||
],
|
||||
curies: [
|
||||
{
|
||||
name: 'wp',
|
||||
href: 'https://api.w.org/{rel}',
|
||||
templated: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
description: 'Triggers when a new post is published',
|
||||
props: {
|
||||
authors: wordpressCommon.authors,
|
||||
},
|
||||
type: TriggerStrategy.POLLING,
|
||||
async test(ctx) {
|
||||
return await pollingHelper.test(polling, {
|
||||
auth: ctx.auth,
|
||||
store: ctx.store,
|
||||
propsValue: ctx.propsValue,
|
||||
files: ctx.files,
|
||||
});
|
||||
},
|
||||
async onEnable(ctx) {
|
||||
await pollingHelper.onEnable(polling, {
|
||||
auth: ctx.auth,
|
||||
store: ctx.store,
|
||||
propsValue: ctx.propsValue,
|
||||
});
|
||||
},
|
||||
async onDisable(ctx) {
|
||||
await pollingHelper.onDisable(polling, {
|
||||
auth: ctx.auth,
|
||||
store: ctx.store,
|
||||
propsValue: ctx.propsValue,
|
||||
});
|
||||
},
|
||||
async run(ctx) {
|
||||
return await pollingHelper.poll(polling, {
|
||||
auth: ctx.auth,
|
||||
store: ctx.store,
|
||||
propsValue: ctx.propsValue,
|
||||
files: ctx.files,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
const polling: Polling<
|
||||
AppConnectionValueForAuthProperty<typeof wordpressAuth>,
|
||||
{ authors: string | undefined }
|
||||
> = {
|
||||
strategy: DedupeStrategy.TIMEBASED,
|
||||
items: async ({ auth, propsValue, lastFetchEpochMS }) => {
|
||||
const items = await getPosts(auth.props, propsValue.authors!, lastFetchEpochMS);
|
||||
return items.map((item) => ({
|
||||
epochMilliSeconds: dayjs(item.date).valueOf(),
|
||||
data: item,
|
||||
}));
|
||||
},
|
||||
};
|
||||
|
||||
const getPosts = async (
|
||||
auth: PiecePropValueSchema<typeof wordpressAuth>,
|
||||
authors: string,
|
||||
startDate: number
|
||||
) => {
|
||||
//WordPress accepts date only if they come after the start of the unix time stamp in 1970
|
||||
let afterDate = dayjs(startDate).toISOString();
|
||||
if (startDate === 0) {
|
||||
afterDate = dayjs(startDate).add(1, 'day').toISOString();
|
||||
}
|
||||
const getPostsParams = {
|
||||
websiteUrl: auth.website_url.trim(),
|
||||
username: auth.username,
|
||||
password: auth.password,
|
||||
authors: authors,
|
||||
afterDate: afterDate,
|
||||
page: 1,
|
||||
};
|
||||
return (await wordpressCommon.getPosts(getPostsParams)).posts;
|
||||
};
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"extends": "../../../../tsconfig.base.json",
|
||||
"files": [],
|
||||
"include": [],
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.lib.json"
|
||||
}
|
||||
],
|
||||
"compilerOptions": {
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true,
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true
|
||||
}
|
||||
}
|
||||
@@ -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"]
|
||||
}
|
||||
Reference in New Issue
Block a user