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,109 @@
|
||||
{
|
||||
"Enterprise IT service management platform for incident, change, and service request management": "Enterprise IT Service Management-Plattform für Incident, Change und Service Request Management",
|
||||
"Instance URL": "Instanz URL",
|
||||
"Username": "Benutzername",
|
||||
"Password": "Kennwort",
|
||||
"Your ServiceNow instance URL without trailing slash (e.g., https://dev12345.service-now.com)": "Deine URL der ServiceNow-Instanz ohne abschließenden Schrägstrich (z.B. https://dev12345.service-now.com)",
|
||||
"Your ServiceNow username (not email)": "Ihr ServiceNow-Benutzername (nicht E-Mail)",
|
||||
"Your ServiceNow password (not API token)": "Ihr ServiceNow-Passwort (nicht API-Token)",
|
||||
"Create Record": "Datensatz erstellen",
|
||||
"Update Record": "Datensatz aktualisieren",
|
||||
"Get Record": "Datensatz abrufen",
|
||||
"Find Records": "Datensätze finden",
|
||||
"Attach File to Record": "Datei an Datensatz anhängen",
|
||||
"Find File": "Datei suchen",
|
||||
"Create a new record in a specified table": "Neuen Datensatz in einer angegebenen Tabelle erstellen",
|
||||
"Update an existing record in a specified table": "Aktualisiere einen vorhandenen Datensatz in einer angegebenen Tabelle",
|
||||
"Retrieve a specific record by its ID": "Abrufen eines bestimmten Datensatzes durch seine ID",
|
||||
"Search for records in a table using a query": "Nach Datensätzen in einer Tabelle mit einer Abfrage suchen",
|
||||
"Upload and attach a file to a record": "Datei hochladen und an Datensatz anhängen",
|
||||
"List or download file attachments from a record": "Dateianhänge von einem Datensatz auflisten oder herunterladen",
|
||||
"Table": "Tisch",
|
||||
"Record Fields": "Datensatzfelder",
|
||||
"Return Display Values": "Rückgabewerte anzeigen",
|
||||
"Fields to Return": "Felder zum Zurückgeben",
|
||||
"Use Display Values for Input": "Anzeigewerte für Eingabe verwenden",
|
||||
"UI View": "UI-Ansicht",
|
||||
"Record": "Datensatz",
|
||||
"Or Enter Sys ID Manually": "Oder Sys-ID manuell eingeben",
|
||||
"Fields to Update": "Zu aktualisierende Felder",
|
||||
"Exclude Reference Links": "Referenz-Links ausschließen",
|
||||
"Query No Domain": "Abfrage ohne Domain",
|
||||
"Query": "Abfrage",
|
||||
"Limit": "Limit",
|
||||
"File Name": "Dateiname",
|
||||
"Content Type": "Inhaltstyp",
|
||||
"File Base64": "Datei Base64",
|
||||
"File Path": "Dateipfad",
|
||||
"Encryption Context": "Verschlüsselungskontext",
|
||||
"Action Type": "Aktionstyp",
|
||||
"Or Enter Record Sys ID Manually": "Oder manuell Datensatz-Sys-ID eingeben",
|
||||
"Filename Filter": "Dateinamen-Filter",
|
||||
"Attachment Sys ID": "Anhang-Sys-ID",
|
||||
"Accept Type": "Typ akzeptieren",
|
||||
"Return Format": "Rückgabeformat",
|
||||
"ServiceNow table to work with": "ServiceNow-Tabelle zum Arbeiten",
|
||||
"Field names and values for the new record": "Feldnamen und Werte für den neuen Datensatz",
|
||||
"How to format the response data": "Wie man die Antwortdaten formatiert",
|
||||
"Specific fields to include in response (optional)": "Spezifische Felder die in Antwort enthalten werden sollen (optional)",
|
||||
"Treat input values as display names instead of IDs": "Eingabewerte als Anzeigenamen anstelle von IDs behandeln",
|
||||
"View context for returned fields": "Kontext für zurückgegebene Felder anzeigen",
|
||||
"Select a record from the table": "Wählen Sie einen Datensatz aus der Tabelle",
|
||||
"Enter the sys_id directly if not found in dropdown": "Geben Sie die sys_id direkt ein, wenn sie nicht im Dropdown gefunden werden",
|
||||
"Field names and new values to update": "Feldnamen und neue zu aktualisierende Werte",
|
||||
"Exclude API links for reference fields": "API-Links für Referenzfelder ausschließen",
|
||||
"Include records from all domains": "Einträge aus allen Domänen einbeziehen",
|
||||
"Encoded query string (e.g., state=1^priority=1)": "Kodierter Query-String (z. B. state=1^priority=1)",
|
||||
"Maximum records to return": "Maximale Anzahl an Rücksendungen",
|
||||
"Name for the attachment": "Name für den Anhang",
|
||||
"File content type": "Datei-Inhaltstyp",
|
||||
"Base64 encoded file content (use this OR file path)": "Base64 verschlüsselter Dateiinhalt (verwenden Sie diesen ODER Dateipfad)",
|
||||
"Path to file on local system (use this OR base64)": "Pfad zur Datei auf dem lokalen System (verwenden Sie diesen OR base64)",
|
||||
"Encryption context sys_id to restrict file access": "Kontext sys_id verschlüsseln, um den Dateizugriff zu beschränken",
|
||||
"List attachments or download a file": "Anhänge auflisten oder eine Datei herunterladen",
|
||||
"Record sys_id (for listing attachments)": "sys_id aufzeichnen (für Anhänge auflisten)",
|
||||
"Filter attachments by filename (optional)": "Anhänge nach Dateinamen filtern (optional)",
|
||||
"Attachment sys_id to download": "Anhang sys_id zum Herunterladen",
|
||||
"File type to accept when downloading": "Dateityp, der beim Herunterladen akzeptiert wird",
|
||||
"Format for returned file data": "Format für zurückgegebene Dateidaten",
|
||||
"Actual values": "Aktuelle Werte",
|
||||
"Display values": "Werte anzeigen",
|
||||
"Both": "Beides",
|
||||
"Desktop": "Desktop",
|
||||
"Mobile": "Mobil",
|
||||
"PDF Document": "PDF-Dokument",
|
||||
"Word Document (.docx)": "Word-Dokument (.docx)",
|
||||
"Word Document (.doc)": "Word-Dokument (.doc)",
|
||||
"Excel Spreadsheet (.xlsx)": "Excel-Tabelle (.xlsx)",
|
||||
"Excel Spreadsheet (.xls)": "Excel-Tabelle (.xls)",
|
||||
"PowerPoint (.pptx)": "PowerPoint (.pptx)",
|
||||
"PowerPoint (.ppt)": "PowerPoint (.ppt)",
|
||||
"Text File": "Textdatei",
|
||||
"CSV File": "CSV-Datei",
|
||||
"JSON File": "JSON-Datei",
|
||||
"XML File": "XML-Datei",
|
||||
"ZIP Archive": "ZIP-Archiv",
|
||||
"PNG Image": "PNG Bild",
|
||||
"JPEG Image": "JPEG-Bild",
|
||||
"GIF Image": "GIF-Bild",
|
||||
"SVG Image": "SVG Image",
|
||||
"BMP Image": "BMP-Bild",
|
||||
"TIFF Image": "TIFF-Bild",
|
||||
"Any File Type": "Jeder Dateityp",
|
||||
"Binary/Other": "Binär/Andere",
|
||||
"List Attachments": "Anhänge auflisten",
|
||||
"Download File": "Datei herunterladen",
|
||||
"Any file type (*/*)": "Jeder Dateityp (*/*)",
|
||||
"Any image (image/*)": "Jedes Bild (Bild/*)",
|
||||
"Word Document": "Word-Dokument",
|
||||
"Excel Spreadsheet": "Excel-Tabelle",
|
||||
"Base64 encoded string": "Base64-kodierter String",
|
||||
"Buffer object": "Pufferobjekt",
|
||||
"File metadata only": "Nur Metadaten",
|
||||
"New Record": "Neuer Datensatz",
|
||||
"Updated Record": "Aktualisierte Datensatz",
|
||||
"Triggers when a new record is created in a table": "Löst aus, wenn ein neuer Datensatz in einer Tabelle erstellt wird",
|
||||
"Triggers when a record is updated in a table": "Wird ausgelöst, wenn ein Datensatz in einer Tabelle aktualisiert wird",
|
||||
"Filter Query": "Filterabfrage",
|
||||
"Encoded query to filter records (e.g., priority=1^state=1)": "Encodierte Abfrage zum Filtern von Datensätzen (z.B. priority=1^state=1)"
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
{
|
||||
"Enterprise IT service management platform for incident, change, and service request management": "Plataforma de administración de servicios de IT para incidentes, cambios y gestión de solicitudes de servicio",
|
||||
"Instance URL": "URL de instancia",
|
||||
"Username": "Usuario",
|
||||
"Password": "Contraseña",
|
||||
"Your ServiceNow instance URL without trailing slash (e.g., https://dev12345.service-now.com)": "URL de su instancia de ServiceNow sin barra final (por ejemplo, https://dev12345.service-now.com)",
|
||||
"Your ServiceNow username (not email)": "Su nombre de usuario ServiceNow (no correo electrónico)",
|
||||
"Your ServiceNow password (not API token)": "Su contraseña ServiceNow (no el token API)",
|
||||
"Create Record": "Crear registro",
|
||||
"Update Record": "Actualizar registro",
|
||||
"Get Record": "Obtener registro",
|
||||
"Find Records": "Buscar registros",
|
||||
"Attach File to Record": "Adjuntar archivo al registro",
|
||||
"Find File": "Buscar archivo",
|
||||
"Create a new record in a specified table": "Crear un nuevo registro en una tabla especificada",
|
||||
"Update an existing record in a specified table": "Actualizar un registro existente en una tabla especificada",
|
||||
"Retrieve a specific record by its ID": "Recuperar un registro específico por su ID",
|
||||
"Search for records in a table using a query": "Buscar registros en una tabla usando una consulta",
|
||||
"Upload and attach a file to a record": "Subir y adjuntar un archivo a un registro",
|
||||
"List or download file attachments from a record": "Listar o descargar archivos adjuntos de un registro",
|
||||
"Table": "Tabla",
|
||||
"Record Fields": "Campos de registro",
|
||||
"Return Display Values": "Mostrar valores de retorno",
|
||||
"Fields to Return": "Campos a devolver",
|
||||
"Use Display Values for Input": "Usar valores de visualización para la entrada",
|
||||
"UI View": "Vista de IU",
|
||||
"Record": "Grabar",
|
||||
"Or Enter Sys ID Manually": "O introduzca manualmente Sys ID",
|
||||
"Fields to Update": "Campos a actualizar",
|
||||
"Exclude Reference Links": "Excluir enlaces de referencia",
|
||||
"Query No Domain": "Consulta Sin Dominio",
|
||||
"Query": "Consulta",
|
||||
"Limit": "Límite",
|
||||
"File Name": "Nombre del archivo",
|
||||
"Content Type": "Tipo de contenido",
|
||||
"File Base64": "Archivo Base64",
|
||||
"File Path": "Ruta del archivo",
|
||||
"Encryption Context": "Contexto del cifrado",
|
||||
"Action Type": "Tipo de acción",
|
||||
"Or Enter Record Sys ID Manually": "O introduzca manualmente el ID de registro Sys",
|
||||
"Filename Filter": "Filtro de nombre",
|
||||
"Attachment Sys ID": "ID de Sys adjunto",
|
||||
"Accept Type": "Aceptar tipo",
|
||||
"Return Format": "Formato de retorno",
|
||||
"ServiceNow table to work with": "Tabla ServiceNow con la que trabajar",
|
||||
"Field names and values for the new record": "Nombres de campos y valores para el nuevo registro",
|
||||
"How to format the response data": "Cómo formatear los datos de respuesta",
|
||||
"Specific fields to include in response (optional)": "Campos específicos a incluir en respuesta (opcional)",
|
||||
"Treat input values as display names instead of IDs": "Tratar valores de entrada como nombres de pantalla en lugar de IDs",
|
||||
"View context for returned fields": "Ver contexto para los campos devueltos",
|
||||
"Select a record from the table": "Seleccione un registro de la tabla",
|
||||
"Enter the sys_id directly if not found in dropdown": "Introduzca el sys_id directamente si no se encuentra en el menú desplegable",
|
||||
"Field names and new values to update": "Nombres de campos y nuevos valores a actualizar",
|
||||
"Exclude API links for reference fields": "Excluir enlaces API para campos de referencia",
|
||||
"Include records from all domains": "Incluye registros de todos los dominios",
|
||||
"Encoded query string (e.g., state=1^priority=1)": "Cadena de consulta codificada (por ejemplo, estado=1^prioridad=1)",
|
||||
"Maximum records to return": "Máximo de registros a devolver",
|
||||
"Name for the attachment": "Nombre del archivo adjunto",
|
||||
"File content type": "Tipo de contenido de archivo",
|
||||
"Base64 encoded file content (use this OR file path)": "Contenido de archivo codificado en Base64 (utilice esta ruta de archivos OR)",
|
||||
"Path to file on local system (use this OR base64)": "Ruta al archivo en el sistema local (use este OR base64)",
|
||||
"Encryption context sys_id to restrict file access": "Contexto de cifrado sys_id para restringir el acceso a archivos",
|
||||
"List attachments or download a file": "Listar archivos adjuntos o descargar un archivo",
|
||||
"Record sys_id (for listing attachments)": "Registrar sys_id (para listar archivos adjuntos)",
|
||||
"Filter attachments by filename (optional)": "Filtrar archivos adjuntos por nombre de archivo (opcional)",
|
||||
"Attachment sys_id to download": "Adjuntar sys_id para descargar",
|
||||
"File type to accept when downloading": "Tipo de archivo a aceptar al descargar",
|
||||
"Format for returned file data": "Formato para los datos de archivo devueltos",
|
||||
"Actual values": "Valores reales",
|
||||
"Display values": "Mostrar valores",
|
||||
"Both": "Ambos",
|
||||
"Desktop": "Escritorio",
|
||||
"Mobile": "Móvil",
|
||||
"PDF Document": "Documento PDF",
|
||||
"Word Document (.docx)": "Documento Word (.docx)",
|
||||
"Word Document (.doc)": "Documento Word (.doc)",
|
||||
"Excel Spreadsheet (.xlsx)": "Hoja de cálculo de Excel (.xlsx)",
|
||||
"Excel Spreadsheet (.xls)": "Hoja de cálculo de Excel (.xls)",
|
||||
"PowerPoint (.pptx)": "PowerPoint (.pptx)",
|
||||
"PowerPoint (.ppt)": "PowerPoint (.ppt)",
|
||||
"Text File": "Archivo de texto",
|
||||
"CSV File": "Archivo CSV",
|
||||
"JSON File": "Archivo JSON",
|
||||
"XML File": "Archivo XML",
|
||||
"ZIP Archive": "Archivo ZIP",
|
||||
"PNG Image": "Imagen PNG",
|
||||
"JPEG Image": "Imagen JPEG",
|
||||
"GIF Image": "Imagen GIF",
|
||||
"SVG Image": "SVG Image",
|
||||
"BMP Image": "Imagen BMP",
|
||||
"TIFF Image": "Imagen TIFF",
|
||||
"Any File Type": "Cualquier tipo de archivo",
|
||||
"Binary/Other": "Binario/Otros",
|
||||
"List Attachments": "Lista de adjuntos",
|
||||
"Download File": "Descargar archivo",
|
||||
"Any file type (*/*)": "Cualquier tipo de archivo (*/*)",
|
||||
"Any image (image/*)": "Cualquier imagen (imagen/*)",
|
||||
"Word Document": "Documento Word",
|
||||
"Excel Spreadsheet": "Hoja de cálculo de Excel",
|
||||
"Base64 encoded string": "Cadena codificada en base64",
|
||||
"Buffer object": "Objeto de búfer",
|
||||
"File metadata only": "Solo metadatos de archivo",
|
||||
"New Record": "Nuevo registro",
|
||||
"Updated Record": "Registro actualizado",
|
||||
"Triggers when a new record is created in a table": "Dispara cuando se crea un nuevo registro en una tabla",
|
||||
"Triggers when a record is updated in a table": "Dispara cuando un registro se actualiza en una tabla",
|
||||
"Filter Query": "Filtrar consulta",
|
||||
"Encoded query to filter records (e.g., priority=1^state=1)": "Consulta codificada para filtrar registros (por ejemplo, prioridad=1^estado=1)"
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
{
|
||||
"Enterprise IT service management platform for incident, change, and service request management": "Plateforme de gestion des services informatiques d'entreprise pour la gestion des incidents, des changements et des demandes de service",
|
||||
"Instance URL": "URL de l'instance",
|
||||
"Username": "Nom d'utilisateur",
|
||||
"Password": "Password",
|
||||
"Your ServiceNow instance URL without trailing slash (e.g., https://dev12345.service-now.com)": "L'URL de votre instance ServiceNow sans slash final (par exemple, https://dev12345.service-now.com)",
|
||||
"Your ServiceNow username (not email)": "Votre nom d'utilisateur ServiceNow (pas d'e-mail)",
|
||||
"Your ServiceNow password (not API token)": "Votre mot de passe ServiceNow (pas de jeton API)",
|
||||
"Create Record": "Créer un enregistrement",
|
||||
"Update Record": "Mettre à jour l'enregistrement",
|
||||
"Get Record": "Obtenir un enregistrement",
|
||||
"Find Records": "Trouver des enregistrements",
|
||||
"Attach File to Record": "Joindre le fichier à l'enregistrement",
|
||||
"Find File": "Rechercher un fichier",
|
||||
"Create a new record in a specified table": "Créer un nouvel enregistrement dans une table spécifiée",
|
||||
"Update an existing record in a specified table": "Mettre à jour un enregistrement existant dans une table spécifiée",
|
||||
"Retrieve a specific record by its ID": "Récupérer un enregistrement spécifique par son ID",
|
||||
"Search for records in a table using a query": "Rechercher des enregistrements dans une table en utilisant une requête",
|
||||
"Upload and attach a file to a record": "Télécharger et attacher un fichier à un enregistrement",
|
||||
"List or download file attachments from a record": "Lister ou télécharger les pièces jointes d'un dossier",
|
||||
"Table": "Tableau",
|
||||
"Record Fields": "Champs d'enregistrement",
|
||||
"Return Display Values": "Valeurs d'affichage du retour",
|
||||
"Fields to Return": "Champs à retourner",
|
||||
"Use Display Values for Input": "Utiliser les valeurs d'affichage pour la saisie",
|
||||
"UI View": "Vue de l'interface utilisateur",
|
||||
"Record": "Enregistrements",
|
||||
"Or Enter Sys ID Manually": "Ou entrez manuellement l'ID Sys",
|
||||
"Fields to Update": "Champs à mettre à jour",
|
||||
"Exclude Reference Links": "Exclure les liens de référence",
|
||||
"Query No Domain": "Requête sans domaine",
|
||||
"Query": "Requête",
|
||||
"Limit": "Limite",
|
||||
"File Name": "Nom du fichier",
|
||||
"Content Type": "Type de contenu",
|
||||
"File Base64": "Fichier Base64",
|
||||
"File Path": "Chemin du fichier",
|
||||
"Encryption Context": "Contexte du cryptage",
|
||||
"Action Type": "Type d'action",
|
||||
"Or Enter Record Sys ID Manually": "Ou entrez l'ID de l'enregistrement sys manuellement",
|
||||
"Filename Filter": "Filtre de nom de fichier",
|
||||
"Attachment Sys ID": "ID Sys de la pièce jointe",
|
||||
"Accept Type": "Accepter le type",
|
||||
"Return Format": "Format de retour",
|
||||
"ServiceNow table to work with": "Table ServiceNow avec laquelle travailler",
|
||||
"Field names and values for the new record": "Noms des champs et valeurs pour le nouvel enregistrement",
|
||||
"How to format the response data": "Comment formater les données de réponse",
|
||||
"Specific fields to include in response (optional)": "Champs spécifiques à inclure dans la réponse (facultatif)",
|
||||
"Treat input values as display names instead of IDs": "Traiter les valeurs d'entrée comme des noms d'affichage au lieu des IDs",
|
||||
"View context for returned fields": "Afficher le contexte pour les champs retournés",
|
||||
"Select a record from the table": "Sélectionnez un enregistrement dans la table",
|
||||
"Enter the sys_id directly if not found in dropdown": "Entrez directement le sys_id si non trouvé dans la liste déroulante",
|
||||
"Field names and new values to update": "Noms des champs et nouvelles valeurs à mettre à jour",
|
||||
"Exclude API links for reference fields": "Exclure les liens API pour les champs de référence",
|
||||
"Include records from all domains": "Inclure les enregistrements de tous les domaines",
|
||||
"Encoded query string (e.g., state=1^priority=1)": "Chaîne de requête encodée (par exemple, state=1^priority=1)",
|
||||
"Maximum records to return": "Nombre maximum d'enregistrements à retourner",
|
||||
"Name for the attachment": "Nom de la pièce jointe",
|
||||
"File content type": "Type de contenu du fichier",
|
||||
"Base64 encoded file content (use this OR file path)": "Contenu du fichier encodé en Base64 (utilisez ce chemin OU ce chemin de fichier)",
|
||||
"Path to file on local system (use this OR base64)": "Chemin vers le fichier sur le système local (utiliser ceci OU base64)",
|
||||
"Encryption context sys_id to restrict file access": "Contexte de cryptage sys_id pour restreindre l'accès aux fichiers",
|
||||
"List attachments or download a file": "Lister les pièces jointes ou télécharger un fichier",
|
||||
"Record sys_id (for listing attachments)": "Enregistrer sys_id (pour lister les pièces jointes)",
|
||||
"Filter attachments by filename (optional)": "Filtrer les pièces jointes par nom de fichier (facultatif)",
|
||||
"Attachment sys_id to download": "Pièce jointe sys_id à télécharger",
|
||||
"File type to accept when downloading": "Type de fichier à accepter lors du téléchargement",
|
||||
"Format for returned file data": "Format pour les données de fichier retournées",
|
||||
"Actual values": "Valeurs réelles",
|
||||
"Display values": "Valeurs d'affichage",
|
||||
"Both": "Les deux",
|
||||
"Desktop": "Bureau",
|
||||
"Mobile": "Téléphone mobile",
|
||||
"PDF Document": "Document PDF",
|
||||
"Word Document (.docx)": "Document Word (.docx)",
|
||||
"Word Document (.doc)": "Document Word (.doc)",
|
||||
"Excel Spreadsheet (.xlsx)": "Tableur Excel (.xlsx)",
|
||||
"Excel Spreadsheet (.xls)": "Feuille de calcul Excel (.xls)",
|
||||
"PowerPoint (.pptx)": "PowerPoint (.pptx)",
|
||||
"PowerPoint (.ppt)": "PowerPoint (.ppt)",
|
||||
"Text File": "Fichier texte",
|
||||
"CSV File": "Fichier CSV",
|
||||
"JSON File": "Fichier JSON",
|
||||
"XML File": "Fichier XML",
|
||||
"ZIP Archive": "Archive ZIP",
|
||||
"PNG Image": "Image PNG",
|
||||
"JPEG Image": "Image JPEG",
|
||||
"GIF Image": "Image GIF",
|
||||
"SVG Image": "SVG Image",
|
||||
"BMP Image": "Image BMP",
|
||||
"TIFF Image": "Image TIFF",
|
||||
"Any File Type": "N'importe quel type de fichier",
|
||||
"Binary/Other": "Binaire/Autre",
|
||||
"List Attachments": "Lister les pièces jointes",
|
||||
"Download File": "Download File",
|
||||
"Any file type (*/*)": "N'importe quel type de fichier (*/*)",
|
||||
"Any image (image/*)": "N'importe quelle image (image/*)",
|
||||
"Word Document": "Document Word",
|
||||
"Excel Spreadsheet": "Tableur Excel",
|
||||
"Base64 encoded string": "Chaîne encodée en Base64",
|
||||
"Buffer object": "Objet tampon",
|
||||
"File metadata only": "Métadonnées du fichier uniquement",
|
||||
"New Record": "Nouvel enregistrement",
|
||||
"Updated Record": "Enregistrement mis à jour",
|
||||
"Triggers when a new record is created in a table": "Déclenche lorsqu'un nouvel enregistrement est créé dans une table",
|
||||
"Triggers when a record is updated in a table": "Déclenche lorsqu'un enregistrement est mis à jour dans un tableau",
|
||||
"Filter Query": "Requête de filtre",
|
||||
"Encoded query to filter records (e.g., priority=1^state=1)": "Requête encodée pour filtrer les enregistrements (par exemple, priorité=1^state=1)"
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
{
|
||||
"Enterprise IT service management platform for incident, change, and service request management": "インシデント、変更、サービスリクエスト管理のためのエンタープライズITサービス管理プラットフォーム",
|
||||
"Instance URL": "インスタンス URL",
|
||||
"Username": "ユーザー名",
|
||||
"Password": "パスワード",
|
||||
"Your ServiceNow instance URL without trailing slash (e.g., https://dev12345.service-now.com)": "スラッシュが付いていないServiceNowインスタンスURL(例:https://dev12345.service-now.com)",
|
||||
"Your ServiceNow username (not email)": "ServiceNowユーザー名 (メールではありません)",
|
||||
"Your ServiceNow password (not API token)": "ServiceNowパスワード (API トークンではありません)",
|
||||
"Create Record": "レコードを作成",
|
||||
"Update Record": "更新記録",
|
||||
"Get Record": "レコードを取得",
|
||||
"Find Records": "レコードを検索",
|
||||
"Attach File to Record": "ファイルを録音に添付",
|
||||
"Find File": "ファイルを検索",
|
||||
"Create a new record in a specified table": "指定したテーブルに新しいレコードを作成",
|
||||
"Update an existing record in a specified table": "指定したテーブル内の既存のレコードを更新します",
|
||||
"Retrieve a specific record by its ID": "ID で特定のレコードを取得します",
|
||||
"Search for records in a table using a query": "クエリを使用してテーブル内のレコードを検索",
|
||||
"Upload and attach a file to a record": "ファイルをアップロードし、レコードに添付する",
|
||||
"List or download file attachments from a record": "レコードから添付ファイルを一覧表示またはダウンロード",
|
||||
"Table": "表",
|
||||
"Record Fields": "レコードフィールド",
|
||||
"Return Display Values": "返品表示値",
|
||||
"Fields to Return": "Fields to Return",
|
||||
"Use Display Values for Input": "入力に表示値を使用",
|
||||
"UI View": "UI ビュー",
|
||||
"Record": "レコード",
|
||||
"Or Enter Sys ID Manually": "またはSys IDを手動で入力",
|
||||
"Fields to Update": "更新するフィールド",
|
||||
"Exclude Reference Links": "参照リンクを除外",
|
||||
"Query No Domain": "クエリのドメインなし",
|
||||
"Query": "クエリ",
|
||||
"Limit": "制限",
|
||||
"File Name": "ファイル名",
|
||||
"Content Type": "コンテンツタイプ",
|
||||
"File Base64": "File Base64",
|
||||
"File Path": "ファイルパス",
|
||||
"Encryption Context": "暗号化のコンテキスト",
|
||||
"Action Type": "アクションタイプ",
|
||||
"Or Enter Record Sys ID Manually": "または、レコードの Sys ID を手動で入力してください",
|
||||
"Filename Filter": "ファイル名フィルタ",
|
||||
"Attachment Sys ID": "添付ファイルシステムID",
|
||||
"Accept Type": "種類を承認する",
|
||||
"Return Format": "戻り値の形式",
|
||||
"ServiceNow table to work with": "作業するServiceNowテーブル",
|
||||
"Field names and values for the new record": "新しいレコードのフィールド名と値",
|
||||
"How to format the response data": "応答データのフォーマット方法",
|
||||
"Specific fields to include in response (optional)": "応答に含める特定のフィールド (任意)",
|
||||
"Treat input values as display names instead of IDs": "入力値を ID の代わりに表示名として扱います",
|
||||
"View context for returned fields": "返されたフィールドのコンテキストを表示",
|
||||
"Select a record from the table": "テーブルからレコードを選択",
|
||||
"Enter the sys_id directly if not found in dropdown": "ドロップダウンに見つからない場合は sys_id を直接入力してください",
|
||||
"Field names and new values to update": "更新するフィールド名と新しい値",
|
||||
"Exclude API links for reference fields": "参照項目のAPIリンクを除外",
|
||||
"Include records from all domains": "すべてのドメインからレコードを含める",
|
||||
"Encoded query string (e.g., state=1^priority=1)": "エンコードされたクエリ文字列(例:state=1^priority=1)",
|
||||
"Maximum records to return": "Maximum records to return",
|
||||
"Name for the attachment": "添付ファイルの名前",
|
||||
"File content type": "ファイルのコンテンツタイプ",
|
||||
"Base64 encoded file content (use this OR file path)": "Base64 エンコードされたファイルコンテンツ (この OR ファイルパスを使用)",
|
||||
"Path to file on local system (use this OR base64)": "ローカル システム上のファイルへのパス(この OR base64 を使用)",
|
||||
"Encryption context sys_id to restrict file access": "ファイルへのアクセスを制限する暗号化コンテキストsys_id",
|
||||
"List attachments or download a file": "添付ファイルを一覧表示またはファイルをダウンロード",
|
||||
"Record sys_id (for listing attachments)": "レコードの sys_id (添付ファイルの一覧)",
|
||||
"Filter attachments by filename (optional)": "ファイル名で添付ファイルをフィルター (オプション)",
|
||||
"Attachment sys_id to download": "ダウンロードする添付ファイル sys_id",
|
||||
"File type to accept when downloading": "ダウンロード時に受け入れるファイルの種類",
|
||||
"Format for returned file data": "返されるファイルデータのフォーマット",
|
||||
"Actual values": "実際の値",
|
||||
"Display values": "値を表示",
|
||||
"Both": "両方とも",
|
||||
"Desktop": "デスクトップ",
|
||||
"Mobile": "モバイル",
|
||||
"PDF Document": "PDF ドキュメント",
|
||||
"Word Document (.docx)": "Word ドキュメント (.docx)",
|
||||
"Word Document (.doc)": "Word Document (.doc)",
|
||||
"Excel Spreadsheet (.xlsx)": "Excel スプレッドシート (.xlsx)",
|
||||
"Excel Spreadsheet (.xls)": "Excel スプレッドシート (.xls)",
|
||||
"PowerPoint (.pptx)": "PowerPoint (.pptx)",
|
||||
"PowerPoint (.ppt)": "PowerPoint (.ppt)",
|
||||
"Text File": "テキスト ファイル",
|
||||
"CSV File": "CSVファイル",
|
||||
"JSON File": "JSON ファイル",
|
||||
"XML File": "XML ファイル",
|
||||
"ZIP Archive": "ZIP アーカイブ",
|
||||
"PNG Image": "PNG画像",
|
||||
"JPEG Image": "JPEG 画像",
|
||||
"GIF Image": "GIF 画像",
|
||||
"SVG Image": "SVG Image",
|
||||
"BMP Image": "BMP画像",
|
||||
"TIFF Image": "TIFF画像",
|
||||
"Any File Type": "任意のファイルタイプ",
|
||||
"Binary/Other": "バイナリ/その他",
|
||||
"List Attachments": "添付ファイル一覧",
|
||||
"Download File": "ファイルをダウンロード",
|
||||
"Any file type (*/*)": "任意のファイルタイプ (*/*)",
|
||||
"Any image (image/*)": "任意の画像 (image/*)",
|
||||
"Word Document": "Word ドキュメント",
|
||||
"Excel Spreadsheet": "Excel の表計算ドキュメント",
|
||||
"Base64 encoded string": "Base64 エンコードされた文字列",
|
||||
"Buffer object": "バッファオブジェクト",
|
||||
"File metadata only": "ファイルメタデータのみ",
|
||||
"New Record": "新しいレコード",
|
||||
"Updated Record": "更新されたレコード",
|
||||
"Triggers when a new record is created in a table": "テーブルに新しいレコードが作成されたときにトリガーします",
|
||||
"Triggers when a record is updated in a table": "テーブル内でレコードが更新されたときにトリガーします",
|
||||
"Filter Query": "フィルタクエリ",
|
||||
"Encoded query to filter records (e.g., priority=1^state=1)": "レコードをフィルタするためのエンコードされたクエリ (例: priority=1^state=1)"
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
{
|
||||
"Enterprise IT service management platform for incident, change, and service request management": "Enterprise IT-servicemanagementsplatform voor incident, verandering en beheer van serviceverzoeken",
|
||||
"Instance URL": "Aanleg URL",
|
||||
"Username": "Gebruikersnaam",
|
||||
"Password": "Wachtwoord",
|
||||
"Your ServiceNow instance URL without trailing slash (e.g., https://dev12345.service-now.com)": "Uw ServiceNow instap-URL zonder slash te volgen (bijv. https://dev12345.service-now.com)",
|
||||
"Your ServiceNow username (not email)": "Uw ServiceNow gebruikersnaam (geen e-mail)",
|
||||
"Your ServiceNow password (not API token)": "Uw ServiceNow wachtwoord (geen API token)",
|
||||
"Create Record": "Record Maken",
|
||||
"Update Record": "Update Record",
|
||||
"Get Record": "Krijg Record",
|
||||
"Find Records": "Records zoeken",
|
||||
"Attach File to Record": "Bestand toevoegen aan record",
|
||||
"Find File": "Bestand zoeken",
|
||||
"Create a new record in a specified table": "Maak een nieuwe record in een opgegeven tabel",
|
||||
"Update an existing record in a specified table": "Update een bestaand record in een opgegeven tabel",
|
||||
"Retrieve a specific record by its ID": "Ophalen van een specifiek record met zijn ID",
|
||||
"Search for records in a table using a query": "Zoeken naar records in een tabel met behulp van een zoekopdracht",
|
||||
"Upload and attach a file to a record": "Upload en voeg een bestand toe aan een record",
|
||||
"List or download file attachments from a record": "Lijst of download bestandsbijlagen van een record",
|
||||
"Table": "Tabel",
|
||||
"Record Fields": "Record velden",
|
||||
"Return Display Values": "Retour weergavewaarden",
|
||||
"Fields to Return": "Velden om te retourneren",
|
||||
"Use Display Values for Input": "Gebruik weergavewaarden voor invoer",
|
||||
"UI View": "UI weergave",
|
||||
"Record": "Opnemen",
|
||||
"Or Enter Sys ID Manually": "Of Voer Sys ID handmatig in",
|
||||
"Fields to Update": "Velden om te updaten",
|
||||
"Exclude Reference Links": "Referentiekoppelingen uitsluiten",
|
||||
"Query No Domain": "Query Geen domein",
|
||||
"Query": "Zoekopdracht",
|
||||
"Limit": "Limiet",
|
||||
"File Name": "File Name",
|
||||
"Content Type": "Type inhoud",
|
||||
"File Base64": "Bestand Base64",
|
||||
"File Path": "Bestandspad",
|
||||
"Encryption Context": "Encryptie context",
|
||||
"Action Type": "Actie Type",
|
||||
"Or Enter Record Sys ID Manually": "Of voer Record Sys ID handmatig in",
|
||||
"Filename Filter": "Bestandsnaam Filter",
|
||||
"Attachment Sys ID": "Bijlage Sys ID",
|
||||
"Accept Type": "Accepteer Type",
|
||||
"Return Format": "Retour formaat",
|
||||
"ServiceNow table to work with": "ServiceNow tabel om mee te werken",
|
||||
"Field names and values for the new record": "Veldnamen en waarden voor het nieuwe record",
|
||||
"How to format the response data": "Hoe de responsgegevens te formatteren",
|
||||
"Specific fields to include in response (optional)": "Specifieke velden om op te nemen in reactie (optioneel)",
|
||||
"Treat input values as display names instead of IDs": "Behandel invoerwaarden als weergavenamen in plaats van IDs",
|
||||
"View context for returned fields": "Bekijk context voor geretourneerde velden",
|
||||
"Select a record from the table": "Selecteer een record uit de tabel",
|
||||
"Enter the sys_id directly if not found in dropdown": "Voer de sys_id direct in indien niet gevonden in de dropdown",
|
||||
"Field names and new values to update": "Veldnamen en nieuwe waarden bij te werken",
|
||||
"Exclude API links for reference fields": "API links uitsluiten voor referentie velden",
|
||||
"Include records from all domains": "Records van alle domeinen opnemen",
|
||||
"Encoded query string (e.g., state=1^priority=1)": "Gecodeerde query string (bijv. state=1^priority=1)",
|
||||
"Maximum records to return": "Maximum aantal records om terug te keren",
|
||||
"Name for the attachment": "Naam voor de bijlage",
|
||||
"File content type": "Bestand inhoudstype",
|
||||
"Base64 encoded file content (use this OR file path)": "Base64 gecodeerde bestandsinhoud (gebruik dit OF bestandspad)",
|
||||
"Path to file on local system (use this OR base64)": "Pad naar bestand op lokaal systeem (gebruik dit OF base64)",
|
||||
"Encryption context sys_id to restrict file access": "Encryptie context sys_id om bestandstoegang te beperken",
|
||||
"List attachments or download a file": "Bijlagen weergeven of een bestand downloaden",
|
||||
"Record sys_id (for listing attachments)": "Neem sys_id op (voor het vermelden van bijlagen)",
|
||||
"Filter attachments by filename (optional)": "Filter bijlagen op bestandsnaam (optioneel)",
|
||||
"Attachment sys_id to download": "Te downloaden bijlage sys_id",
|
||||
"File type to accept when downloading": "Bestandstype om te accepteren bij downloaden",
|
||||
"Format for returned file data": "Formaat voor geretourneerde bestandsgegevens",
|
||||
"Actual values": "Werkelijke waarden",
|
||||
"Display values": "Toon waarden",
|
||||
"Both": "Allebei",
|
||||
"Desktop": "Startscherm",
|
||||
"Mobile": "Mobiel",
|
||||
"PDF Document": "PDF Document",
|
||||
"Word Document (.docx)": "Woorddocument (.docx)",
|
||||
"Word Document (.doc)": "Woorddocument (.doc)",
|
||||
"Excel Spreadsheet (.xlsx)": "Excel spreadsheet (.xlsx)",
|
||||
"Excel Spreadsheet (.xls)": "Excel spreadsheet (.xls)",
|
||||
"PowerPoint (.pptx)": "PowerPoint (.pptx)",
|
||||
"PowerPoint (.ppt)": "PowerPoint (.ppt)",
|
||||
"Text File": "Tekst bestand",
|
||||
"CSV File": "CSV-bestand",
|
||||
"JSON File": "JSON bestand",
|
||||
"XML File": "XML bestand",
|
||||
"ZIP Archive": "ZIP archief",
|
||||
"PNG Image": "PNG afbeelding",
|
||||
"JPEG Image": "JPEG afbeelding",
|
||||
"GIF Image": "GIF afbeelding",
|
||||
"SVG Image": "SVG Image",
|
||||
"BMP Image": "BMP afbeelding",
|
||||
"TIFF Image": "TIFF afbeelding",
|
||||
"Any File Type": "Elk bestandstype",
|
||||
"Binary/Other": "Binair/Overig",
|
||||
"List Attachments": "Bijlagen weergeven",
|
||||
"Download File": "Bestand downloaden",
|
||||
"Any file type (*/*)": "Elk bestandstype (*/*)",
|
||||
"Any image (image/*)": "Elke afbeelding (afbeelding/*)",
|
||||
"Word Document": "Woord Document",
|
||||
"Excel Spreadsheet": "Excel spreadsheet",
|
||||
"Base64 encoded string": "Base64 gecodeerde tekenreeks",
|
||||
"Buffer object": "Buffer object",
|
||||
"File metadata only": "Alleen bestandsmetagegevens",
|
||||
"New Record": "Nieuwe Record",
|
||||
"Updated Record": "Bijgewerkt Record",
|
||||
"Triggers when a new record is created in a table": "Triggert wanneer een nieuw record wordt aangemaakt in een tabel",
|
||||
"Triggers when a record is updated in a table": "Triggert wanneer een record wordt bijgewerkt in een tabel",
|
||||
"Filter Query": "Query filteren",
|
||||
"Encoded query to filter records (e.g., priority=1^state=1)": "Gecodeerde query om records te filteren (bijv. prioriteit=1^state=1)"
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
{
|
||||
"Enterprise IT service management platform for incident, change, and service request management": "Plataforma de gerenciamento de serviços de TI para incidente, mudança e gerenciamento de pedidos de serviço",
|
||||
"Instance URL": "Instância URL",
|
||||
"Username": "Usuário:",
|
||||
"Password": "Senha",
|
||||
"Your ServiceNow instance URL without trailing slash (e.g., https://dev12345.service-now.com)": "Seu ServiceNow URL sem barra no final (por exemplo, https://dev12345.service-now.com)",
|
||||
"Your ServiceNow username (not email)": "Seu nome de usuário (não e-mail)",
|
||||
"Your ServiceNow password (not API token)": "Seu ServiceNow senha (não token API)",
|
||||
"Create Record": "Criar Registro",
|
||||
"Update Record": "Atualizar Registro",
|
||||
"Get Record": "Obter Registro",
|
||||
"Find Records": "Encontrar registros",
|
||||
"Attach File to Record": "Anexar Arquivo para Registrar",
|
||||
"Find File": "Localizar arquivo",
|
||||
"Create a new record in a specified table": "Criar um novo registro em uma tabela especificada",
|
||||
"Update an existing record in a specified table": "Atualizar um registro existente em uma tabela especificada",
|
||||
"Retrieve a specific record by its ID": "Recuperar um registro específico por sua ID",
|
||||
"Search for records in a table using a query": "Pesquisa por registros em uma tabela usando uma consulta",
|
||||
"Upload and attach a file to a record": "Fazer upload e anexar um arquivo a um registro",
|
||||
"List or download file attachments from a record": "Listar ou baixar anexos de arquivos de um registro",
|
||||
"Table": "Classificações",
|
||||
"Record Fields": "Recorde Campos",
|
||||
"Return Display Values": "Valores de exibição da devolução",
|
||||
"Fields to Return": "Campos para Devolver",
|
||||
"Use Display Values for Input": "Usar Valores de Exibição para Entrada",
|
||||
"UI View": "Visão de UI",
|
||||
"Record": "Gravar",
|
||||
"Or Enter Sys ID Manually": "Ou Insira o Sys ID Manualmente",
|
||||
"Fields to Update": "Campos para Atualização",
|
||||
"Exclude Reference Links": "Excluir links de referência",
|
||||
"Query No Domain": "Consultar Nenhum Domínio",
|
||||
"Query": "Requisição",
|
||||
"Limit": "Limitar",
|
||||
"File Name": "Nome do arquivo",
|
||||
"Content Type": "Tipo de Conteúdo",
|
||||
"File Base64": "Arquivo Base64",
|
||||
"File Path": "Caminho do Arquivo",
|
||||
"Encryption Context": "Contexto de criptografia",
|
||||
"Action Type": "Tipo de acao",
|
||||
"Or Enter Record Sys ID Manually": "Ou Insira o Record Sys ID Manualmente",
|
||||
"Filename Filter": "Filtro de Arquivos",
|
||||
"Attachment Sys ID": "ID Sys de Anexo",
|
||||
"Accept Type": "Aceitar Tipo",
|
||||
"Return Format": "Formato da Devolução",
|
||||
"ServiceNow table to work with": "Tabela de serviço com",
|
||||
"Field names and values for the new record": "Nomes e valores de campos para o novo registro",
|
||||
"How to format the response data": "Como formatar os dados da resposta",
|
||||
"Specific fields to include in response (optional)": "Campos específicos a incluir na resposta (opcional)",
|
||||
"Treat input values as display names instead of IDs": "Tratar os valores de entrada como nomes de exibição em vez de IDs",
|
||||
"View context for returned fields": "Exibir o contexto para os campos retornados",
|
||||
"Select a record from the table": "Selecione um registro da tabela",
|
||||
"Enter the sys_id directly if not found in dropdown": "Digite o sys_id diretamente se não for encontrado no menu suspenso",
|
||||
"Field names and new values to update": "Nomes de campos e novos valores para atualizar",
|
||||
"Exclude API links for reference fields": "Excluir links da API para campos de referência",
|
||||
"Include records from all domains": "Incluir registros de todos os domínios",
|
||||
"Encoded query string (e.g., state=1^priority=1)": "String de consulta codificada (por exemplo, state=1^priority=1)",
|
||||
"Maximum records to return": "Registros máximos a retornar",
|
||||
"Name for the attachment": "Nome para o anexo",
|
||||
"File content type": "Tipo de conteúdo",
|
||||
"Base64 encoded file content (use this OR file path)": "Conteúdo do arquivo codificado em Base64 (use este caminho do arquivo OR)",
|
||||
"Path to file on local system (use this OR base64)": "Caminho para o arquivo no sistema local (usar este OU base64)",
|
||||
"Encryption context sys_id to restrict file access": "Contexto de criptografia sys_id para restringir o acesso ao arquivo",
|
||||
"List attachments or download a file": "Listar anexos ou baixar um arquivo",
|
||||
"Record sys_id (for listing attachments)": "Registrar sys_id (para anexos de listagem)",
|
||||
"Filter attachments by filename (optional)": "Filtrar anexos por nome de arquivo (opcional)",
|
||||
"Attachment sys_id to download": "Anexo sys_id para download",
|
||||
"File type to accept when downloading": "Tipo de arquivo a ser aceito ao baixar",
|
||||
"Format for returned file data": "Formato para dados do arquivo retornado",
|
||||
"Actual values": "Valores reais",
|
||||
"Display values": "Valores de exibição",
|
||||
"Both": "Ambos",
|
||||
"Desktop": "Computadores",
|
||||
"Mobile": "Celular",
|
||||
"PDF Document": "Documento PDF",
|
||||
"Word Document (.docx)": "Documento de Palavra (.docx)",
|
||||
"Word Document (.doc)": "Documento Word (.doc)",
|
||||
"Excel Spreadsheet (.xlsx)": "Planilha do Excel (.xlsx)",
|
||||
"Excel Spreadsheet (.xls)": "Planilha do Excel (.xls)",
|
||||
"PowerPoint (.pptx)": "PowerPoint (.pptx)",
|
||||
"PowerPoint (.ppt)": "PowerPoint (.ppt)",
|
||||
"Text File": "Arquivo de texto",
|
||||
"CSV File": "Arquivo CSV",
|
||||
"JSON File": "Arquivo JSON",
|
||||
"XML File": "Arquivo XML",
|
||||
"ZIP Archive": "Arquivo ZIP",
|
||||
"PNG Image": "Imagem PNG",
|
||||
"JPEG Image": "Imagem JPEG",
|
||||
"GIF Image": "Imagem GIF",
|
||||
"SVG Image": "SVG Image",
|
||||
"BMP Image": "Imagem BMP",
|
||||
"TIFF Image": "Imagem TIFF",
|
||||
"Any File Type": "Qualquer Tipo de Arquivo",
|
||||
"Binary/Other": "Binário/Outro",
|
||||
"List Attachments": "Lista de Anexos",
|
||||
"Download File": "Baixar Arquivo",
|
||||
"Any file type (*/*)": "Qualquer tipo de arquivo (*/*)",
|
||||
"Any image (image/*)": "Qualquer imagem (imagem/*)",
|
||||
"Word Document": "Documento do Word",
|
||||
"Excel Spreadsheet": "Planilha do Excel",
|
||||
"Base64 encoded string": "String codificada em Base64",
|
||||
"Buffer object": "Objeto buffer",
|
||||
"File metadata only": "Apenas metadados do arquivo",
|
||||
"New Record": "Novo Registro",
|
||||
"Updated Record": "Registro atualizado",
|
||||
"Triggers when a new record is created in a table": "Dispara quando um novo registro é criado em uma tabela",
|
||||
"Triggers when a record is updated in a table": "Dispara quando um registro é atualizado em uma tabela",
|
||||
"Filter Query": "Consulta de Filtro",
|
||||
"Encoded query to filter records (e.g., priority=1^state=1)": "Consulta codificada para filtrar registros (por exemplo, priority=1^state=1)"
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
{
|
||||
"Enterprise IT service management platform for incident, change, and service request management": "Enterprise IT service management platform for incident, change, and service request management",
|
||||
"Instance URL": "Instance URL",
|
||||
"Username": "Username",
|
||||
"Password": "Password",
|
||||
"Your ServiceNow instance URL without trailing slash (e.g., https://dev12345.service-now.com)": "Your ServiceNow instance URL without trailing slash (e.g., https://dev12345.service-now.com)",
|
||||
"Your ServiceNow username (not email)": "Your ServiceNow username (not email)",
|
||||
"Your ServiceNow password (not API token)": "Your ServiceNow password (not API token)",
|
||||
"Create Record": "Create Record",
|
||||
"Update Record": "Update Record",
|
||||
"Get Record": "Get Record",
|
||||
"Find Records": "Find Records",
|
||||
"Attach File to Record": "Attach File to Record",
|
||||
"Find File": "Find File",
|
||||
"Create a new record in a specified table": "Create a new record in a specified table",
|
||||
"Update an existing record in a specified table": "Update an existing record in a specified table",
|
||||
"Retrieve a specific record by its ID": "Retrieve a specific record by its ID",
|
||||
"Search for records in a table using a query": "Search for records in a table using a query",
|
||||
"Upload and attach a file to a record": "Upload and attach a file to a record",
|
||||
"List or download file attachments from a record": "List or download file attachments from a record",
|
||||
"Table": "Table",
|
||||
"Record Fields": "Record Fields",
|
||||
"Return Display Values": "Return Display Values",
|
||||
"Fields to Return": "Fields to Return",
|
||||
"Use Display Values for Input": "Use Display Values for Input",
|
||||
"UI View": "UI View",
|
||||
"Record": "Record",
|
||||
"Or Enter Sys ID Manually": "Or Enter Sys ID Manually",
|
||||
"Fields to Update": "Fields to Update",
|
||||
"Exclude Reference Links": "Exclude Reference Links",
|
||||
"Query No Domain": "Query No Domain",
|
||||
"Query": "Query",
|
||||
"Limit": "Limit",
|
||||
"File Name": "File Name",
|
||||
"Content Type": "Content Type",
|
||||
"File Base64": "File Base64",
|
||||
"File Path": "File Path",
|
||||
"Encryption Context": "Encryption Context",
|
||||
"Action Type": "Action Type",
|
||||
"Or Enter Record Sys ID Manually": "Or Enter Record Sys ID Manually",
|
||||
"Filename Filter": "Filename Filter",
|
||||
"Attachment Sys ID": "Attachment Sys ID",
|
||||
"Accept Type": "Accept Type",
|
||||
"Return Format": "Return Format",
|
||||
"ServiceNow table to work with": "ServiceNow table to work with",
|
||||
"Field names and values for the new record": "Field names and values for the new record",
|
||||
"How to format the response data": "How to format the response data",
|
||||
"Specific fields to include in response (optional)": "Specific fields to include in response (optional)",
|
||||
"Treat input values as display names instead of IDs": "Treat input values as display names instead of IDs",
|
||||
"View context for returned fields": "View context for returned fields",
|
||||
"Select a record from the table": "Select a record from the table",
|
||||
"Enter the sys_id directly if not found in dropdown": "Enter the sys_id directly if not found in dropdown",
|
||||
"Field names and new values to update": "Field names and new values to update",
|
||||
"Exclude API links for reference fields": "Exclude API links for reference fields",
|
||||
"Include records from all domains": "Include records from all domains",
|
||||
"Encoded query string (e.g., state=1^priority=1)": "Encoded query string (e.g., state=1^priority=1)",
|
||||
"Maximum records to return": "Maximum records to return",
|
||||
"Name for the attachment": "Name for the attachment",
|
||||
"File content type": "File content type",
|
||||
"Base64 encoded file content (use this OR file path)": "Base64 encoded file content (use this OR file path)",
|
||||
"Path to file on local system (use this OR base64)": "Path to file on local system (use this OR base64)",
|
||||
"Encryption context sys_id to restrict file access": "Encryption context sys_id to restrict file access",
|
||||
"List attachments or download a file": "List attachments or download a file",
|
||||
"Record sys_id (for listing attachments)": "Record sys_id (for listing attachments)",
|
||||
"Filter attachments by filename (optional)": "Filter attachments by filename (optional)",
|
||||
"Attachment sys_id to download": "Attachment sys_id to download",
|
||||
"File type to accept when downloading": "File type to accept when downloading",
|
||||
"Format for returned file data": "Format for returned file data",
|
||||
"Actual values": "Actual values",
|
||||
"Display values": "Display values",
|
||||
"Both": "Both",
|
||||
"Desktop": "Desktop",
|
||||
"Mobile": "Mobile",
|
||||
"PDF Document": "PDF Document",
|
||||
"Word Document (.docx)": "Word Document (.docx)",
|
||||
"Word Document (.doc)": "Word Document (.doc)",
|
||||
"Excel Spreadsheet (.xlsx)": "Excel Spreadsheet (.xlsx)",
|
||||
"Excel Spreadsheet (.xls)": "Excel Spreadsheet (.xls)",
|
||||
"PowerPoint (.pptx)": "PowerPoint (.pptx)",
|
||||
"PowerPoint (.ppt)": "PowerPoint (.ppt)",
|
||||
"Text File": "Text File",
|
||||
"CSV File": "CSV File",
|
||||
"JSON File": "JSON File",
|
||||
"XML File": "XML File",
|
||||
"ZIP Archive": "ZIP Archive",
|
||||
"PNG Image": "PNG Image",
|
||||
"JPEG Image": "JPEG Image",
|
||||
"GIF Image": "GIF Image",
|
||||
"SVG Image": "SVG Image",
|
||||
"BMP Image": "BMP Image",
|
||||
"TIFF Image": "TIFF Image",
|
||||
"Any File Type": "Any File Type",
|
||||
"Binary/Other": "Binary/Other",
|
||||
"List Attachments": "List Attachments",
|
||||
"Download File": "Download File",
|
||||
"Any file type (*/*)": "Any file type (*/*)",
|
||||
"Any image (image/*)": "Any image (image/*)",
|
||||
"Word Document": "Word Document",
|
||||
"Excel Spreadsheet": "Excel Spreadsheet",
|
||||
"Base64 encoded string": "Base64 encoded string",
|
||||
"Buffer object": "Buffer object",
|
||||
"File metadata only": "File metadata only",
|
||||
"New Record": "New Record",
|
||||
"Updated Record": "Updated Record",
|
||||
"Triggers when a new record is created in a table": "Triggers when a new record is created in a table",
|
||||
"Triggers when a record is updated in a table": "Triggers when a record is updated in a table",
|
||||
"Filter Query": "Filter Query",
|
||||
"Encoded query to filter records (e.g., priority=1^state=1)": "Encoded query to filter records (e.g., priority=1^state=1)"
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
{
|
||||
"Enterprise IT service management platform for incident, change, and service request management": "Enterprise IT service management platform for incident, change, and service request management",
|
||||
"Instance URL": "Instance URL",
|
||||
"Username": "用户名",
|
||||
"Password": "密码",
|
||||
"Your ServiceNow instance URL without trailing slash (e.g., https://dev12345.service-now.com)": "Your ServiceNow instance URL without trailing slash (e.g., https://dev12345.service-now.com)",
|
||||
"Your ServiceNow username (not email)": "Your ServiceNow username (not email)",
|
||||
"Your ServiceNow password (not API token)": "Your ServiceNow password (not API token)",
|
||||
"Create Record": "Create Record",
|
||||
"Update Record": "Update Record",
|
||||
"Get Record": "Get Record",
|
||||
"Find Records": "Find Records",
|
||||
"Attach File to Record": "Attach File to Record",
|
||||
"Find File": "Find File",
|
||||
"Create a new record in a specified table": "Create a new record in a specified table",
|
||||
"Update an existing record in a specified table": "Update an existing record in a specified table",
|
||||
"Retrieve a specific record by its ID": "Retrieve a specific record by its ID",
|
||||
"Search for records in a table using a query": "Search for records in a table using a query",
|
||||
"Upload and attach a file to a record": "Upload and attach a file to a record",
|
||||
"List or download file attachments from a record": "List or download file attachments from a record",
|
||||
"Table": "表",
|
||||
"Record Fields": "Record Fields",
|
||||
"Return Display Values": "Return Display Values",
|
||||
"Fields to Return": "Fields to Return",
|
||||
"Use Display Values for Input": "Use Display Values for Input",
|
||||
"UI View": "UI View",
|
||||
"Record": "Record",
|
||||
"Or Enter Sys ID Manually": "Or Enter Sys ID Manually",
|
||||
"Fields to Update": "Fields to Update",
|
||||
"Exclude Reference Links": "Exclude Reference Links",
|
||||
"Query No Domain": "Query No Domain",
|
||||
"Query": "Query",
|
||||
"Limit": "Limit",
|
||||
"File Name": "File Name",
|
||||
"Content Type": "Content Type",
|
||||
"File Base64": "File Base64",
|
||||
"File Path": "File Path",
|
||||
"Encryption Context": "Encryption Context",
|
||||
"Action Type": "Action Type",
|
||||
"Or Enter Record Sys ID Manually": "Or Enter Record Sys ID Manually",
|
||||
"Filename Filter": "Filename Filter",
|
||||
"Attachment Sys ID": "Attachment Sys ID",
|
||||
"Accept Type": "Accept Type",
|
||||
"Return Format": "Return Format",
|
||||
"ServiceNow table to work with": "ServiceNow table to work with",
|
||||
"Field names and values for the new record": "Field names and values for the new record",
|
||||
"How to format the response data": "How to format the response data",
|
||||
"Specific fields to include in response (optional)": "Specific fields to include in response (optional)",
|
||||
"Treat input values as display names instead of IDs": "Treat input values as display names instead of IDs",
|
||||
"View context for returned fields": "View context for returned fields",
|
||||
"Select a record from the table": "Select a record from the table",
|
||||
"Enter the sys_id directly if not found in dropdown": "Enter the sys_id directly if not found in dropdown",
|
||||
"Field names and new values to update": "Field names and new values to update",
|
||||
"Exclude API links for reference fields": "Exclude API links for reference fields",
|
||||
"Include records from all domains": "Include records from all domains",
|
||||
"Encoded query string (e.g., state=1^priority=1)": "Encoded query string (e.g., state=1^priority=1)",
|
||||
"Maximum records to return": "Maximum records to return",
|
||||
"Name for the attachment": "Name for the attachment",
|
||||
"File content type": "File content type",
|
||||
"Base64 encoded file content (use this OR file path)": "Base64 encoded file content (use this OR file path)",
|
||||
"Path to file on local system (use this OR base64)": "Path to file on local system (use this OR base64)",
|
||||
"Encryption context sys_id to restrict file access": "Encryption context sys_id to restrict file access",
|
||||
"List attachments or download a file": "List attachments or download a file",
|
||||
"Record sys_id (for listing attachments)": "Record sys_id (for listing attachments)",
|
||||
"Filter attachments by filename (optional)": "Filter attachments by filename (optional)",
|
||||
"Attachment sys_id to download": "Attachment sys_id to download",
|
||||
"File type to accept when downloading": "File type to accept when downloading",
|
||||
"Format for returned file data": "Format for returned file data",
|
||||
"Actual values": "Actual values",
|
||||
"Display values": "Display values",
|
||||
"Both": "Both",
|
||||
"Desktop": "Desktop",
|
||||
"Mobile": "Mobile",
|
||||
"PDF Document": "PDF Document",
|
||||
"Word Document (.docx)": "Word Document (.docx)",
|
||||
"Word Document (.doc)": "Word Document (.doc)",
|
||||
"Excel Spreadsheet (.xlsx)": "Excel Spreadsheet (.xlsx)",
|
||||
"Excel Spreadsheet (.xls)": "Excel Spreadsheet (.xls)",
|
||||
"PowerPoint (.pptx)": "PowerPoint (.pptx)",
|
||||
"PowerPoint (.ppt)": "PowerPoint (.ppt)",
|
||||
"Text File": "Text File",
|
||||
"CSV File": "CSV 文件",
|
||||
"JSON File": "JSON File",
|
||||
"XML File": "XML File",
|
||||
"ZIP Archive": "ZIP Archive",
|
||||
"PNG Image": "PNG Image",
|
||||
"JPEG Image": "JPEG Image",
|
||||
"GIF Image": "GIF Image",
|
||||
"SVG Image": "SVG Image",
|
||||
"BMP Image": "BMP Image",
|
||||
"TIFF Image": "TIFF Image",
|
||||
"Any File Type": "Any File Type",
|
||||
"Binary/Other": "Binary/Other",
|
||||
"List Attachments": "List Attachments",
|
||||
"Download File": "下载文件",
|
||||
"Any file type (*/*)": "Any file type (*/*)",
|
||||
"Any image (image/*)": "Any image (image/*)",
|
||||
"Word Document": "Word Document",
|
||||
"Excel Spreadsheet": "Excel Spreadsheet",
|
||||
"Base64 encoded string": "Base64 encoded string",
|
||||
"Buffer object": "Buffer object",
|
||||
"File metadata only": "File metadata only",
|
||||
"New Record": "New Record",
|
||||
"Updated Record": "Updated Record",
|
||||
"Triggers when a new record is created in a table": "Triggers when a new record is created in a table",
|
||||
"Triggers when a record is updated in a table": "Triggers when a record is updated in a table",
|
||||
"Filter Query": "Filter Query",
|
||||
"Encoded query to filter records (e.g., priority=1^state=1)": "Encoded query to filter records (e.g., priority=1^state=1)"
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
|
||||
import { createPiece } from "@activepieces/pieces-framework";
|
||||
import { PieceCategory } from '@activepieces/shared';
|
||||
import { servicenowAuth } from './lib/common/props';
|
||||
import { createRecordAction } from './lib/actions/create-record';
|
||||
import { updateRecordAction } from './lib/actions/update-record';
|
||||
import { getRecordAction } from './lib/actions/get-record';
|
||||
import { findRecordAction } from './lib/actions/find-record';
|
||||
import { attachFileToRecordAction } from './lib/actions/attach-file-to-record';
|
||||
import { findFileAction } from './lib/actions/find-file';
|
||||
import { newRecordTrigger } from './lib/triggers/new-record';
|
||||
import { updatedRecordTrigger } from './lib/triggers/updated-record';
|
||||
|
||||
export const serviceNow = createPiece({
|
||||
displayName: "ServiceNow",
|
||||
description: "Enterprise IT service management platform for incident, change, and service request management",
|
||||
auth: servicenowAuth,
|
||||
minimumSupportedRelease: '0.36.1',
|
||||
logoUrl: "https://cdn.activepieces.com/pieces/service-now.png",
|
||||
authors: ["sparkybug"],
|
||||
categories: [PieceCategory.PRODUCTIVITY],
|
||||
actions: [
|
||||
createRecordAction,
|
||||
updateRecordAction,
|
||||
getRecordAction,
|
||||
findRecordAction,
|
||||
attachFileToRecordAction,
|
||||
findFileAction,
|
||||
],
|
||||
triggers: [
|
||||
newRecordTrigger,
|
||||
updatedRecordTrigger,
|
||||
],
|
||||
});
|
||||
@@ -0,0 +1,150 @@
|
||||
import { createAction, Property } from '@activepieces/pieces-framework';
|
||||
import { z } from 'zod';
|
||||
import { AttachmentMetaSchema } from '../common/types';
|
||||
import {
|
||||
tableDropdown,
|
||||
recordDropdown,
|
||||
createServiceNowClient,
|
||||
servicenowAuth,
|
||||
} from '../common/props';
|
||||
|
||||
const AttachFileInputSchema = z
|
||||
.object({
|
||||
table_name: z.string().min(1),
|
||||
table_sys_id: z.string().min(1),
|
||||
file_name: z.string().min(1),
|
||||
content_type: z.string().min(1),
|
||||
fileBase64: z.string().optional(),
|
||||
filePath: z.string().optional(),
|
||||
encryption_context: z.string().optional(),
|
||||
})
|
||||
.refine((data) => data.fileBase64 || data.filePath, {
|
||||
message: 'Either fileBase64 or filePath must be provided',
|
||||
});
|
||||
|
||||
export const attachFileToRecordAction = createAction({
|
||||
name: 'attach_file_to_record',
|
||||
displayName: 'Attach File to Record',
|
||||
description: 'Upload and attach a file to a record',
|
||||
auth: servicenowAuth,
|
||||
props: {
|
||||
table: tableDropdown,
|
||||
record: recordDropdown,
|
||||
manual_sys_id: Property.ShortText({
|
||||
displayName: 'Or Enter Sys ID Manually',
|
||||
description: 'Enter the sys_id directly if not found in dropdown',
|
||||
required: false,
|
||||
}),
|
||||
file_name: Property.ShortText({
|
||||
displayName: 'File Name',
|
||||
description: 'Name for the attachment',
|
||||
required: true,
|
||||
}),
|
||||
content_type: Property.StaticDropdown({
|
||||
displayName: 'Content Type',
|
||||
description: 'File content type',
|
||||
required: true,
|
||||
options: {
|
||||
disabled: false,
|
||||
options: [
|
||||
{ label: 'PDF Document', value: 'application/pdf' },
|
||||
{
|
||||
label: 'Word Document (.docx)',
|
||||
value:
|
||||
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||
},
|
||||
{ label: 'Word Document (.doc)', value: 'application/msword' },
|
||||
{
|
||||
label: 'Excel Spreadsheet (.xlsx)',
|
||||
value:
|
||||
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||
},
|
||||
{
|
||||
label: 'Excel Spreadsheet (.xls)',
|
||||
value: 'application/vnd.ms-excel',
|
||||
},
|
||||
{
|
||||
label: 'PowerPoint (.pptx)',
|
||||
value:
|
||||
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
||||
},
|
||||
{
|
||||
label: 'PowerPoint (.ppt)',
|
||||
value: 'application/vnd.ms-powerpoint',
|
||||
},
|
||||
{ label: 'Text File', value: 'text/plain' },
|
||||
{ label: 'CSV File', value: 'text/csv' },
|
||||
{ label: 'JSON File', value: 'application/json' },
|
||||
{ label: 'XML File', value: 'application/xml' },
|
||||
{ label: 'ZIP Archive', value: 'application/zip' },
|
||||
{ label: 'PNG Image', value: 'image/png' },
|
||||
{ label: 'JPEG Image', value: 'image/jpeg' },
|
||||
{ label: 'GIF Image', value: 'image/gif' },
|
||||
{ label: 'SVG Image', value: 'image/svg+xml' },
|
||||
{ label: 'BMP Image', value: 'image/bmp' },
|
||||
{ label: 'TIFF Image', value: 'image/tiff' },
|
||||
{ label: 'Any File Type', value: '*/*' },
|
||||
{ label: 'Binary/Other', value: 'application/octet-stream' },
|
||||
],
|
||||
},
|
||||
}),
|
||||
fileBase64: Property.LongText({
|
||||
displayName: 'File Base64',
|
||||
description: 'Base64 encoded file content (use this OR file path)',
|
||||
required: false,
|
||||
}),
|
||||
filePath: Property.ShortText({
|
||||
displayName: 'File Path',
|
||||
description: 'Path to file on local system (use this OR base64)',
|
||||
required: false,
|
||||
}),
|
||||
encryption_context: Property.ShortText({
|
||||
displayName: 'Encryption Context',
|
||||
description: 'Encryption context sys_id to restrict file access',
|
||||
required: false,
|
||||
}),
|
||||
},
|
||||
async run(context) {
|
||||
const {
|
||||
table,
|
||||
record,
|
||||
manual_sys_id,
|
||||
file_name,
|
||||
content_type,
|
||||
fileBase64,
|
||||
filePath,
|
||||
encryption_context,
|
||||
} = context.propsValue;
|
||||
|
||||
const recordId = record || manual_sys_id;
|
||||
if (!recordId) {
|
||||
throw new Error(
|
||||
'Either record selection or manual sys_id must be provided'
|
||||
);
|
||||
}
|
||||
|
||||
const input = AttachFileInputSchema.parse({
|
||||
table_name: table,
|
||||
table_sys_id: recordId,
|
||||
file_name,
|
||||
content_type,
|
||||
fileBase64,
|
||||
filePath,
|
||||
encryption_context,
|
||||
});
|
||||
|
||||
const client = createServiceNowClient(context.auth);
|
||||
|
||||
const result = await client.attachFile(
|
||||
input.table_name,
|
||||
input.table_sys_id,
|
||||
input.file_name,
|
||||
input.content_type,
|
||||
input.filePath,
|
||||
input.fileBase64,
|
||||
input.encryption_context
|
||||
);
|
||||
|
||||
return AttachmentMetaSchema.parse(result);
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,97 @@
|
||||
import { createAction, Property } from '@activepieces/pieces-framework';
|
||||
import { z } from 'zod';
|
||||
import { ServiceNowRecordSchema } from '../common/types';
|
||||
import { tableDropdown, createServiceNowClient, servicenowAuth } from '../common/props';
|
||||
|
||||
const CreateRecordInputSchema = z.object({
|
||||
table: z.string().min(1),
|
||||
fields: z.record(z.any()),
|
||||
sysparm_display_value: z.enum(['true', 'false', 'all']).optional(),
|
||||
sysparm_fields: z.array(z.string()).optional(),
|
||||
sysparm_input_display_value: z.boolean().optional(),
|
||||
sysparm_view: z.enum(['desktop', 'mobile', 'both']).optional(),
|
||||
});
|
||||
|
||||
export const createRecordAction = createAction({
|
||||
auth: servicenowAuth,
|
||||
name: 'create_record',
|
||||
displayName: 'Create Record',
|
||||
description: 'Create a new record in a specified table',
|
||||
props: {
|
||||
table: tableDropdown,
|
||||
fields: Property.Object({
|
||||
displayName: 'Record Fields',
|
||||
description: 'Field names and values for the new record',
|
||||
required: true,
|
||||
}),
|
||||
sysparm_display_value: Property.StaticDropdown({
|
||||
displayName: 'Return Display Values',
|
||||
description: 'How to format the response data',
|
||||
required: false,
|
||||
defaultValue: 'false',
|
||||
options: {
|
||||
disabled: false,
|
||||
options: [
|
||||
{ label: 'Actual values', value: 'false' },
|
||||
{ label: 'Display values', value: 'true' },
|
||||
{ label: 'Both', value: 'all' },
|
||||
],
|
||||
},
|
||||
}),
|
||||
sysparm_fields: Property.Array({
|
||||
displayName: 'Fields to Return',
|
||||
description: 'Specific fields to include in response (optional)',
|
||||
required: false,
|
||||
}),
|
||||
sysparm_input_display_value: Property.Checkbox({
|
||||
displayName: 'Use Display Values for Input',
|
||||
description: 'Treat input values as display names instead of IDs',
|
||||
required: false,
|
||||
defaultValue: false,
|
||||
}),
|
||||
sysparm_view: Property.StaticDropdown({
|
||||
displayName: 'UI View',
|
||||
description: 'View context for returned fields',
|
||||
required: false,
|
||||
options: {
|
||||
disabled: false,
|
||||
options: [
|
||||
{ label: 'Desktop', value: 'desktop' },
|
||||
{ label: 'Mobile', value: 'mobile' },
|
||||
{ label: 'Both', value: 'both' },
|
||||
],
|
||||
},
|
||||
}),
|
||||
},
|
||||
async run(context) {
|
||||
const {
|
||||
table,
|
||||
fields,
|
||||
sysparm_display_value,
|
||||
sysparm_fields,
|
||||
sysparm_input_display_value,
|
||||
sysparm_view
|
||||
} = context.propsValue;
|
||||
|
||||
const input = CreateRecordInputSchema.parse({
|
||||
table,
|
||||
fields,
|
||||
sysparm_display_value,
|
||||
sysparm_fields,
|
||||
sysparm_input_display_value,
|
||||
sysparm_view
|
||||
});
|
||||
|
||||
const client = createServiceNowClient(context.auth);
|
||||
|
||||
const options = {
|
||||
sysparm_display_value: input.sysparm_display_value,
|
||||
sysparm_fields: input.sysparm_fields,
|
||||
sysparm_input_display_value: input.sysparm_input_display_value,
|
||||
sysparm_view: input.sysparm_view,
|
||||
};
|
||||
|
||||
const result = await client.createRecord(input.table, input.fields, options);
|
||||
return ServiceNowRecordSchema.parse(result);
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,219 @@
|
||||
import { createAction, Property } from '@activepieces/pieces-framework';
|
||||
import { z } from 'zod';
|
||||
import { AttachmentMetaSchema } from '../common/types';
|
||||
import {
|
||||
tableDropdown,
|
||||
recordDropdown,
|
||||
createServiceNowClient,
|
||||
servicenowAuth,
|
||||
} from '../common/props';
|
||||
|
||||
const FindFileInputSchema = z
|
||||
.object({
|
||||
action_type: z.enum(['list', 'download']),
|
||||
table: z.string().min(1).optional(),
|
||||
sys_id: z.string().min(1).optional(),
|
||||
filename: z.string().optional(),
|
||||
attachment_sys_id: z.string().min(1).optional(),
|
||||
accept_type: z.string().optional(),
|
||||
return_format: z.enum(['base64', 'buffer', 'metadata']).optional(),
|
||||
})
|
||||
.refine(
|
||||
(data) => {
|
||||
if (data.action_type === 'list') {
|
||||
return data.table && data.sys_id;
|
||||
} else if (data.action_type === 'download') {
|
||||
return data.attachment_sys_id;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
{
|
||||
message:
|
||||
'For list action: table and sys_id are required. For download action: attachment_sys_id is required.',
|
||||
}
|
||||
);
|
||||
|
||||
export const findFileAction = createAction({
|
||||
name: 'find_file',
|
||||
displayName: 'Find File',
|
||||
auth: servicenowAuth,
|
||||
description: 'List or download file attachments from a record',
|
||||
props: {
|
||||
action_type: Property.StaticDropdown({
|
||||
displayName: 'Action Type',
|
||||
description: 'List attachments or download a file',
|
||||
required: true,
|
||||
options: {
|
||||
disabled: false,
|
||||
options: [
|
||||
{ label: 'List Attachments', value: 'list' },
|
||||
{ label: 'Download File', value: 'download' },
|
||||
],
|
||||
},
|
||||
}),
|
||||
table: tableDropdown,
|
||||
record: recordDropdown,
|
||||
manual_sys_id: Property.ShortText({
|
||||
displayName: 'Or Enter Record Sys ID Manually',
|
||||
description: 'Record sys_id (for listing attachments)',
|
||||
required: false,
|
||||
}),
|
||||
filename: Property.ShortText({
|
||||
displayName: 'Filename Filter',
|
||||
description: 'Filter attachments by filename (optional)',
|
||||
required: false,
|
||||
}),
|
||||
attachment_sys_id: Property.ShortText({
|
||||
displayName: 'Attachment Sys ID',
|
||||
description: 'Attachment sys_id to download',
|
||||
required: false,
|
||||
}),
|
||||
accept_type: Property.StaticDropdown({
|
||||
displayName: 'Accept Type',
|
||||
description: 'File type to accept when downloading',
|
||||
required: false,
|
||||
defaultValue: '*/*',
|
||||
options: {
|
||||
disabled: false,
|
||||
options: [
|
||||
{ label: 'Any file type (*/*)', value: '*/*' },
|
||||
{ label: 'Any image (image/*)', value: 'image/*' },
|
||||
{ label: 'JPEG Image', value: 'image/jpeg' },
|
||||
{ label: 'PNG Image', value: 'image/png' },
|
||||
{ label: 'GIF Image', value: 'image/gif' },
|
||||
{ label: 'SVG Image', value: 'image/svg+xml' },
|
||||
{ label: 'PDF Document', value: 'application/pdf' },
|
||||
{
|
||||
label: 'Word Document',
|
||||
value:
|
||||
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||
},
|
||||
{
|
||||
label: 'Excel Spreadsheet',
|
||||
value:
|
||||
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||
},
|
||||
{ label: 'Text File', value: 'text/plain' },
|
||||
{ label: 'JSON File', value: 'application/json' },
|
||||
{ label: 'ZIP Archive', value: 'application/zip' },
|
||||
],
|
||||
},
|
||||
}),
|
||||
return_format: Property.StaticDropdown({
|
||||
displayName: 'Return Format',
|
||||
description: 'Format for returned file data',
|
||||
required: false,
|
||||
defaultValue: 'base64',
|
||||
options: {
|
||||
disabled: false,
|
||||
options: [
|
||||
{ label: 'Base64 encoded string', value: 'base64' },
|
||||
{ label: 'Buffer object', value: 'buffer' },
|
||||
{ label: 'File metadata only', value: 'metadata' },
|
||||
],
|
||||
},
|
||||
}),
|
||||
},
|
||||
async run(context) {
|
||||
const {
|
||||
action_type,
|
||||
table,
|
||||
record,
|
||||
manual_sys_id,
|
||||
filename,
|
||||
attachment_sys_id,
|
||||
accept_type,
|
||||
return_format,
|
||||
} = context.propsValue;
|
||||
|
||||
const client = createServiceNowClient(context.auth);
|
||||
|
||||
if (action_type === 'list') {
|
||||
const recordId = record || manual_sys_id;
|
||||
if (!recordId || !table) {
|
||||
throw new Error(
|
||||
'Table and record selection are required for listing attachments'
|
||||
);
|
||||
}
|
||||
|
||||
const input = FindFileInputSchema.parse({
|
||||
action_type,
|
||||
table,
|
||||
sys_id: recordId,
|
||||
filename,
|
||||
});
|
||||
|
||||
const attachments = await client.listAttachments(
|
||||
input.table!,
|
||||
input.sys_id!
|
||||
);
|
||||
|
||||
let filteredAttachments = attachments;
|
||||
if (input.filename) {
|
||||
filteredAttachments = attachments.filter((att) =>
|
||||
att.file_name.toLowerCase().includes(input.filename!.toLowerCase())
|
||||
);
|
||||
}
|
||||
|
||||
return {
|
||||
action: 'list',
|
||||
attachments: filteredAttachments.map((attachment) =>
|
||||
AttachmentMetaSchema.parse(attachment)
|
||||
),
|
||||
count: filteredAttachments.length,
|
||||
};
|
||||
} else if (action_type === 'download') {
|
||||
if (!attachment_sys_id) {
|
||||
throw new Error('Attachment sys_id is required for downloading files');
|
||||
}
|
||||
|
||||
const input = FindFileInputSchema.parse({
|
||||
action_type,
|
||||
attachment_sys_id,
|
||||
accept_type: accept_type || '*/*',
|
||||
return_format: return_format || 'base64',
|
||||
});
|
||||
|
||||
const result = await client.getAttachment(
|
||||
input.attachment_sys_id!,
|
||||
input.accept_type
|
||||
);
|
||||
|
||||
switch (input.return_format) {
|
||||
case 'base64':
|
||||
return {
|
||||
action: 'download',
|
||||
file_data: result.data.toString('base64'),
|
||||
metadata: result.metadata,
|
||||
size_bytes: result.data.length,
|
||||
format: 'base64',
|
||||
};
|
||||
case 'buffer':
|
||||
return {
|
||||
action: 'download',
|
||||
file_data: result.data,
|
||||
metadata: result.metadata,
|
||||
size_bytes: result.data.length,
|
||||
format: 'buffer',
|
||||
};
|
||||
case 'metadata':
|
||||
return {
|
||||
action: 'download',
|
||||
metadata: result.metadata,
|
||||
size_bytes: result.data.length,
|
||||
format: 'metadata_only',
|
||||
};
|
||||
default:
|
||||
return {
|
||||
action: 'download',
|
||||
file_data: result.data.toString('base64'),
|
||||
metadata: result.metadata,
|
||||
size_bytes: result.data.length,
|
||||
format: 'base64',
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
throw new Error('Invalid action type');
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,122 @@
|
||||
import { createAction, Property } from '@activepieces/pieces-framework';
|
||||
import { z } from 'zod';
|
||||
import { ServiceNowRecordSchema } from '../common/types';
|
||||
import {
|
||||
tableDropdown,
|
||||
createServiceNowClient,
|
||||
servicenowAuth,
|
||||
} from '../common/props';
|
||||
|
||||
const FindRecordInputSchema = z.object({
|
||||
table: z.string().min(1),
|
||||
query: z.string().min(1),
|
||||
limit: z.number().optional(),
|
||||
fields: z.array(z.string()).optional(),
|
||||
sysparm_display_value: z.enum(['true', 'false', 'all']).optional(),
|
||||
sysparm_exclude_reference_link: z.boolean().optional(),
|
||||
sysparm_query_no_domain: z.boolean().optional(),
|
||||
sysparm_view: z.enum(['desktop', 'mobile', 'both']).optional(),
|
||||
});
|
||||
|
||||
export const findRecordAction = createAction({
|
||||
auth: servicenowAuth,
|
||||
name: 'find_record',
|
||||
displayName: 'Find Records',
|
||||
description: 'Search for records in a table using a query',
|
||||
props: {
|
||||
table: tableDropdown,
|
||||
query: Property.LongText({
|
||||
displayName: 'Query',
|
||||
description: 'Encoded query string (e.g., state=1^priority=1)',
|
||||
required: true,
|
||||
}),
|
||||
limit: Property.Number({
|
||||
displayName: 'Limit',
|
||||
description: 'Maximum records to return',
|
||||
required: false,
|
||||
defaultValue: 100,
|
||||
}),
|
||||
fields: Property.Array({
|
||||
displayName: 'Fields to Return',
|
||||
description: 'Specific fields to include in response (optional)',
|
||||
required: false,
|
||||
}),
|
||||
sysparm_display_value: Property.StaticDropdown({
|
||||
displayName: 'Return Display Values',
|
||||
description: 'How to format the response data',
|
||||
required: false,
|
||||
defaultValue: 'false',
|
||||
options: {
|
||||
disabled: false,
|
||||
options: [
|
||||
{ label: 'Actual values', value: 'false' },
|
||||
{ label: 'Display values', value: 'true' },
|
||||
{ label: 'Both', value: 'all' },
|
||||
],
|
||||
},
|
||||
}),
|
||||
sysparm_exclude_reference_link: Property.Checkbox({
|
||||
displayName: 'Exclude Reference Links',
|
||||
description: 'Exclude API links for reference fields',
|
||||
required: false,
|
||||
defaultValue: false,
|
||||
}),
|
||||
sysparm_query_no_domain: Property.Checkbox({
|
||||
displayName: 'Query No Domain',
|
||||
description: 'Include records from all domains',
|
||||
required: false,
|
||||
defaultValue: false,
|
||||
}),
|
||||
sysparm_view: Property.StaticDropdown({
|
||||
displayName: 'UI View',
|
||||
description: 'View context for returned fields',
|
||||
required: false,
|
||||
options: {
|
||||
disabled: false,
|
||||
options: [
|
||||
{ label: 'Desktop', value: 'desktop' },
|
||||
{ label: 'Mobile', value: 'mobile' },
|
||||
{ label: 'Both', value: 'both' },
|
||||
],
|
||||
},
|
||||
}),
|
||||
},
|
||||
async run(context) {
|
||||
const {
|
||||
table,
|
||||
query,
|
||||
limit,
|
||||
fields,
|
||||
sysparm_display_value,
|
||||
sysparm_exclude_reference_link,
|
||||
sysparm_query_no_domain,
|
||||
sysparm_view,
|
||||
} = context.propsValue;
|
||||
|
||||
const input = FindRecordInputSchema.parse({
|
||||
table,
|
||||
query,
|
||||
limit,
|
||||
fields,
|
||||
sysparm_display_value,
|
||||
sysparm_exclude_reference_link,
|
||||
sysparm_query_no_domain,
|
||||
sysparm_view,
|
||||
});
|
||||
|
||||
const client = createServiceNowClient(context.auth);
|
||||
|
||||
const options = {
|
||||
limit: input.limit,
|
||||
fields: input.fields,
|
||||
sysparm_display_value: input.sysparm_display_value,
|
||||
sysparm_exclude_reference_link: input.sysparm_exclude_reference_link,
|
||||
sysparm_query_no_domain: input.sysparm_query_no_domain,
|
||||
sysparm_view: input.sysparm_view,
|
||||
};
|
||||
|
||||
const result = await client.findRecord(input.table, input.query, options);
|
||||
|
||||
return result.map((record) => ServiceNowRecordSchema.parse(record));
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,114 @@
|
||||
import { createAction, Property } from '@activepieces/pieces-framework';
|
||||
import { z } from 'zod';
|
||||
import { ServiceNowRecordSchema } from '../common/types';
|
||||
import { tableDropdown, recordDropdown, createServiceNowClient, servicenowAuth } from '../common/props';
|
||||
|
||||
const GetRecordInputSchema = z.object({
|
||||
table: z.string().min(1),
|
||||
sys_id: z.string().min(1),
|
||||
sysparm_display_value: z.enum(['true', 'false', 'all']).optional(),
|
||||
sysparm_exclude_reference_link: z.boolean().optional(),
|
||||
sysparm_fields: z.array(z.string()).optional(),
|
||||
sysparm_query_no_domain: z.boolean().optional(),
|
||||
sysparm_view: z.enum(['desktop', 'mobile', 'both']).optional(),
|
||||
});
|
||||
|
||||
export const getRecordAction = createAction({
|
||||
auth: servicenowAuth,
|
||||
name: 'get_record',
|
||||
displayName: 'Get Record',
|
||||
description: 'Retrieve a specific record by its ID',
|
||||
props: {
|
||||
table: tableDropdown,
|
||||
record: recordDropdown,
|
||||
manual_sys_id: Property.ShortText({
|
||||
displayName: 'Or Enter Sys ID Manually',
|
||||
description: 'Enter the sys_id directly if not found in dropdown',
|
||||
required: false,
|
||||
}),
|
||||
sysparm_display_value: Property.StaticDropdown({
|
||||
displayName: 'Return Display Values',
|
||||
description: 'How to format the response data',
|
||||
required: false,
|
||||
defaultValue: 'false',
|
||||
options: {
|
||||
disabled: false,
|
||||
options: [
|
||||
{ label: 'Actual values', value: 'false' },
|
||||
{ label: 'Display values', value: 'true' },
|
||||
{ label: 'Both', value: 'all' },
|
||||
],
|
||||
},
|
||||
}),
|
||||
sysparm_exclude_reference_link: Property.Checkbox({
|
||||
displayName: 'Exclude Reference Links',
|
||||
description: 'Exclude API links for reference fields',
|
||||
required: false,
|
||||
defaultValue: false,
|
||||
}),
|
||||
sysparm_fields: Property.Array({
|
||||
displayName: 'Fields to Return',
|
||||
description: 'Specific fields to include in response (optional)',
|
||||
required: false,
|
||||
}),
|
||||
sysparm_query_no_domain: Property.Checkbox({
|
||||
displayName: 'Query No Domain',
|
||||
description: 'Include records from all domains',
|
||||
required: false,
|
||||
defaultValue: false,
|
||||
}),
|
||||
sysparm_view: Property.StaticDropdown({
|
||||
displayName: 'UI View',
|
||||
description: 'View context for returned fields',
|
||||
required: false,
|
||||
options: {
|
||||
disabled: false,
|
||||
options: [
|
||||
{ label: 'Desktop', value: 'desktop' },
|
||||
{ label: 'Mobile', value: 'mobile' },
|
||||
{ label: 'Both', value: 'both' },
|
||||
],
|
||||
},
|
||||
}),
|
||||
},
|
||||
async run(context) {
|
||||
const {
|
||||
table,
|
||||
record,
|
||||
manual_sys_id,
|
||||
sysparm_display_value,
|
||||
sysparm_exclude_reference_link,
|
||||
sysparm_fields,
|
||||
sysparm_query_no_domain,
|
||||
sysparm_view
|
||||
} = context.propsValue;
|
||||
|
||||
const recordId = record || manual_sys_id;
|
||||
if (!recordId) {
|
||||
throw new Error('Either record selection or manual sys_id must be provided');
|
||||
}
|
||||
|
||||
const input = GetRecordInputSchema.parse({
|
||||
table,
|
||||
sys_id: recordId,
|
||||
sysparm_display_value,
|
||||
sysparm_exclude_reference_link,
|
||||
sysparm_fields,
|
||||
sysparm_query_no_domain,
|
||||
sysparm_view
|
||||
});
|
||||
|
||||
const client = createServiceNowClient(context.auth);
|
||||
|
||||
const options = {
|
||||
sysparm_display_value: input.sysparm_display_value,
|
||||
sysparm_exclude_reference_link: input.sysparm_exclude_reference_link,
|
||||
sysparm_fields: input.sysparm_fields,
|
||||
sysparm_query_no_domain: input.sysparm_query_no_domain,
|
||||
sysparm_view: input.sysparm_view,
|
||||
};
|
||||
|
||||
const result = await client.getRecord(input.table, input.sys_id, options);
|
||||
return ServiceNowRecordSchema.parse(result);
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,124 @@
|
||||
import { createAction, Property } from '@activepieces/pieces-framework';
|
||||
import { z } from 'zod';
|
||||
import { ServiceNowRecordSchema } from '../common/types';
|
||||
import {
|
||||
tableDropdown,
|
||||
recordDropdown,
|
||||
createServiceNowClient,
|
||||
servicenowAuth,
|
||||
} from '../common/props';
|
||||
|
||||
const UpdateRecordInputSchema = z.object({
|
||||
table: z.string().min(1),
|
||||
sys_id: z.string().min(1),
|
||||
fields: z.record(z.any()),
|
||||
sysparm_display_value: z.enum(['true', 'false', 'all']).optional(),
|
||||
sysparm_fields: z.array(z.string()).optional(),
|
||||
sysparm_input_display_value: z.boolean().optional(),
|
||||
sysparm_view: z.enum(['desktop', 'mobile', 'both']).optional(),
|
||||
});
|
||||
|
||||
export const updateRecordAction = createAction({
|
||||
auth: servicenowAuth,
|
||||
name: 'update_record',
|
||||
displayName: 'Update Record',
|
||||
description: 'Update an existing record in a specified table',
|
||||
props: {
|
||||
table: tableDropdown,
|
||||
record: recordDropdown,
|
||||
manual_sys_id: Property.ShortText({
|
||||
displayName: 'Or Enter Sys ID Manually',
|
||||
description: 'Enter the sys_id directly if not found in dropdown',
|
||||
required: false,
|
||||
}),
|
||||
fields: Property.Object({
|
||||
displayName: 'Fields to Update',
|
||||
description: 'Field names and new values to update',
|
||||
required: true,
|
||||
}),
|
||||
sysparm_display_value: Property.StaticDropdown({
|
||||
displayName: 'Return Display Values',
|
||||
description: 'How to format the response data',
|
||||
required: false,
|
||||
defaultValue: 'false',
|
||||
options: {
|
||||
disabled: false,
|
||||
options: [
|
||||
{ label: 'Actual values', value: 'false' },
|
||||
{ label: 'Display values', value: 'true' },
|
||||
{ label: 'Both', value: 'all' },
|
||||
],
|
||||
},
|
||||
}),
|
||||
sysparm_fields: Property.Array({
|
||||
displayName: 'Fields to Return',
|
||||
description: 'Specific fields to include in response (optional)',
|
||||
required: false,
|
||||
}),
|
||||
sysparm_input_display_value: Property.Checkbox({
|
||||
displayName: 'Use Display Values for Input',
|
||||
description: 'Treat input values as display names instead of IDs',
|
||||
required: false,
|
||||
defaultValue: false,
|
||||
}),
|
||||
sysparm_view: Property.StaticDropdown({
|
||||
displayName: 'UI View',
|
||||
description: 'View context for returned fields',
|
||||
required: false,
|
||||
options: {
|
||||
disabled: false,
|
||||
options: [
|
||||
{ label: 'Desktop', value: 'desktop' },
|
||||
{ label: 'Mobile', value: 'mobile' },
|
||||
{ label: 'Both', value: 'both' },
|
||||
],
|
||||
},
|
||||
}),
|
||||
},
|
||||
async run(context) {
|
||||
const {
|
||||
table,
|
||||
record,
|
||||
manual_sys_id,
|
||||
fields,
|
||||
sysparm_display_value,
|
||||
sysparm_fields,
|
||||
sysparm_input_display_value,
|
||||
sysparm_view,
|
||||
} = context.propsValue;
|
||||
|
||||
const recordId = record || manual_sys_id;
|
||||
if (!recordId) {
|
||||
throw new Error(
|
||||
'Either record selection or manual sys_id must be provided'
|
||||
);
|
||||
}
|
||||
|
||||
const input = UpdateRecordInputSchema.parse({
|
||||
table,
|
||||
sys_id: recordId,
|
||||
fields,
|
||||
sysparm_display_value,
|
||||
sysparm_fields,
|
||||
sysparm_input_display_value,
|
||||
sysparm_view,
|
||||
});
|
||||
|
||||
const client = createServiceNowClient(context.auth);
|
||||
|
||||
const options = {
|
||||
sysparm_display_value: input.sysparm_display_value,
|
||||
sysparm_fields: input.sysparm_fields,
|
||||
sysparm_input_display_value: input.sysparm_input_display_value,
|
||||
sysparm_view: input.sysparm_view,
|
||||
};
|
||||
|
||||
const result = await client.updateRecord(
|
||||
input.table,
|
||||
input.sys_id,
|
||||
input.fields,
|
||||
options
|
||||
);
|
||||
return ServiceNowRecordSchema.parse(result);
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,530 @@
|
||||
import { httpClient, HttpMethod } from '@activepieces/pieces-common';
|
||||
import * as fs from 'fs';
|
||||
import FormData from 'form-data';
|
||||
import {
|
||||
ServiceNowRecord,
|
||||
AttachmentMeta,
|
||||
EventList,
|
||||
WebhookSubscription,
|
||||
NotSupported,
|
||||
ServiceNowClientOptions,
|
||||
TriggerEvent,
|
||||
} from './types';
|
||||
|
||||
export class ServiceNowClient {
|
||||
private baseURL: string;
|
||||
private auth: { type: 'basic' | 'bearer'; username?: string; password?: string; token?: string };
|
||||
|
||||
constructor(options: ServiceNowClientOptions) {
|
||||
this.baseURL = options.instanceUrl.replace(/\/$/, '');
|
||||
this.auth = options.auth;
|
||||
|
||||
if (this.auth.type === 'basic' && (!this.auth.username || !this.auth.password)) {
|
||||
throw new Error('Username and password are required for basic authentication');
|
||||
}
|
||||
if (this.auth.type === 'bearer' && !this.auth.token) {
|
||||
throw new Error('Token is required for bearer authentication');
|
||||
}
|
||||
}
|
||||
|
||||
private getHeaders(): Record<string, string> {
|
||||
const headers: Record<string, string> = {
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'application/json',
|
||||
};
|
||||
|
||||
if (this.auth.type === 'basic') {
|
||||
const credentials = Buffer.from(`${this.auth.username}:${this.auth.password}`).toString('base64');
|
||||
headers['Authorization'] = `Basic ${credentials}`;
|
||||
} else if (this.auth.type === 'bearer') {
|
||||
headers['Authorization'] = `Bearer ${this.auth.token}`;
|
||||
}
|
||||
|
||||
return headers;
|
||||
}
|
||||
|
||||
private async makeRequest<T>(
|
||||
method: HttpMethod,
|
||||
endpoint: string,
|
||||
body?: any,
|
||||
customHeaders?: Record<string, string>
|
||||
): Promise<T> {
|
||||
const url = `${this.baseURL}${endpoint}`;
|
||||
const headers = { ...this.getHeaders(), ...customHeaders };
|
||||
|
||||
let attempt = 0;
|
||||
const maxAttempts = 3;
|
||||
const baseDelay = 500;
|
||||
|
||||
while (attempt < maxAttempts) {
|
||||
try {
|
||||
const response = await httpClient.sendRequest({
|
||||
method,
|
||||
url,
|
||||
headers,
|
||||
body,
|
||||
timeout: 30000,
|
||||
retries: 0,
|
||||
});
|
||||
|
||||
return response.body as T;
|
||||
} catch (error: any) {
|
||||
attempt++;
|
||||
|
||||
if (error.response?.status === 429) {
|
||||
const retryAfter = error.response.headers?.['retry-after'];
|
||||
const delay = retryAfter ? parseInt(retryAfter) * 1000 : Math.pow(2, attempt) * baseDelay;
|
||||
|
||||
if (attempt < maxAttempts) {
|
||||
await new Promise(resolve => setTimeout(resolve, delay));
|
||||
continue;
|
||||
}
|
||||
throw new Error(`Rate-limited, retry after ${retryAfter || 'unknown'} seconds`);
|
||||
}
|
||||
|
||||
if (attempt < maxAttempts && (error.response?.status >= 500 || !error.response)) {
|
||||
const delay = Math.pow(2, attempt) * baseDelay;
|
||||
await new Promise(resolve => setTimeout(resolve, delay));
|
||||
continue;
|
||||
}
|
||||
|
||||
throw this.mapError(error);
|
||||
}
|
||||
}
|
||||
|
||||
throw new Error('Max retry attempts exceeded');
|
||||
}
|
||||
|
||||
private mapError(error: any): Error {
|
||||
if (!error.response) {
|
||||
return new Error('Network error occurred');
|
||||
}
|
||||
|
||||
const status = error.response.status;
|
||||
const data = error.response.body || error.response.data;
|
||||
|
||||
switch (status) {
|
||||
case 401:
|
||||
return new Error('Invalid credentials');
|
||||
case 403:
|
||||
return new Error('Forbidden: insufficient permissions');
|
||||
case 404:
|
||||
return new Error('Not found');
|
||||
case 422:
|
||||
case 400: {
|
||||
const details = data?.error?.message || data?.message || 'Invalid request data';
|
||||
return new Error(`Validation error: ${details}`);
|
||||
}
|
||||
case 429: {
|
||||
const retryAfter = error.response.headers?.['retry-after'];
|
||||
const retryMsg = retryAfter ? ` retry after ${retryAfter} seconds` : '';
|
||||
return new Error(`Rate-limited,${retryMsg}`);
|
||||
}
|
||||
default:
|
||||
return new Error(data?.error?.message || data?.message || `ServiceNow server error (${status})`);
|
||||
}
|
||||
}
|
||||
|
||||
async getRecord(
|
||||
table: string,
|
||||
sys_id: string,
|
||||
options?: {
|
||||
sysparm_display_value?: 'true' | 'false' | 'all';
|
||||
sysparm_exclude_reference_link?: boolean;
|
||||
sysparm_fields?: string[];
|
||||
sysparm_query_no_domain?: boolean;
|
||||
sysparm_view?: 'desktop' | 'mobile' | 'both';
|
||||
}
|
||||
): Promise<ServiceNowRecord> {
|
||||
const endpoint = `/api/now/table/${table}/${sys_id}`;
|
||||
const queryParams: Record<string, string> = {};
|
||||
|
||||
if (options?.sysparm_display_value) {
|
||||
queryParams['sysparm_display_value'] = options.sysparm_display_value;
|
||||
}
|
||||
if (options?.sysparm_exclude_reference_link !== undefined) {
|
||||
queryParams['sysparm_exclude_reference_link'] = options.sysparm_exclude_reference_link.toString();
|
||||
}
|
||||
if (options?.sysparm_fields) {
|
||||
queryParams['sysparm_fields'] = options.sysparm_fields.join(',');
|
||||
}
|
||||
if (options?.sysparm_query_no_domain !== undefined) {
|
||||
queryParams['sysparm_query_no_domain'] = options.sysparm_query_no_domain.toString();
|
||||
}
|
||||
if (options?.sysparm_view) {
|
||||
queryParams['sysparm_view'] = options.sysparm_view;
|
||||
}
|
||||
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.GET,
|
||||
url: `${this.baseURL}${endpoint}`,
|
||||
headers: this.getHeaders(),
|
||||
queryParams: Object.keys(queryParams).length > 0 ? queryParams : undefined,
|
||||
timeout: 30000,
|
||||
retries: 3,
|
||||
});
|
||||
|
||||
const data = response.body as { result: ServiceNowRecord };
|
||||
return data.result;
|
||||
}
|
||||
|
||||
async createRecord(
|
||||
table: string,
|
||||
fields: Record<string, any>,
|
||||
options?: {
|
||||
sysparm_display_value?: 'true' | 'false' | 'all';
|
||||
sysparm_fields?: string[];
|
||||
sysparm_input_display_value?: boolean;
|
||||
sysparm_view?: 'desktop' | 'mobile' | 'both';
|
||||
}
|
||||
): Promise<ServiceNowRecord> {
|
||||
const endpoint = `/api/now/table/${table}`;
|
||||
const queryParams: Record<string, string> = {};
|
||||
|
||||
if (options?.sysparm_display_value) {
|
||||
queryParams['sysparm_display_value'] = options.sysparm_display_value;
|
||||
}
|
||||
if (options?.sysparm_fields) {
|
||||
queryParams['sysparm_fields'] = options.sysparm_fields.join(',');
|
||||
}
|
||||
if (options?.sysparm_input_display_value !== undefined) {
|
||||
queryParams['sysparm_input_display_value'] = options.sysparm_input_display_value.toString();
|
||||
}
|
||||
if (options?.sysparm_view) {
|
||||
queryParams['sysparm_view'] = options.sysparm_view;
|
||||
}
|
||||
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.POST,
|
||||
url: `${this.baseURL}${endpoint}`,
|
||||
headers: this.getHeaders(),
|
||||
body: fields,
|
||||
queryParams: Object.keys(queryParams).length > 0 ? queryParams : undefined,
|
||||
timeout: 30000,
|
||||
retries: 3,
|
||||
});
|
||||
|
||||
const data = response.body as { result: ServiceNowRecord };
|
||||
return data.result;
|
||||
}
|
||||
|
||||
async updateRecord(
|
||||
table: string,
|
||||
sys_id: string,
|
||||
fields: Record<string, any>,
|
||||
options?: {
|
||||
sysparm_display_value?: 'true' | 'false' | 'all';
|
||||
sysparm_fields?: string[];
|
||||
sysparm_input_display_value?: boolean;
|
||||
sysparm_view?: 'desktop' | 'mobile' | 'both';
|
||||
}
|
||||
): Promise<ServiceNowRecord> {
|
||||
const endpoint = `/api/now/table/${table}/${sys_id}`;
|
||||
const queryParams: Record<string, string> = {};
|
||||
|
||||
if (options?.sysparm_display_value) {
|
||||
queryParams['sysparm_display_value'] = options.sysparm_display_value;
|
||||
}
|
||||
if (options?.sysparm_fields) {
|
||||
queryParams['sysparm_fields'] = options.sysparm_fields.join(',');
|
||||
}
|
||||
if (options?.sysparm_input_display_value !== undefined) {
|
||||
queryParams['sysparm_input_display_value'] = options.sysparm_input_display_value.toString();
|
||||
}
|
||||
if (options?.sysparm_view) {
|
||||
queryParams['sysparm_view'] = options.sysparm_view;
|
||||
}
|
||||
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.PATCH,
|
||||
url: `${this.baseURL}${endpoint}`,
|
||||
headers: this.getHeaders(),
|
||||
body: fields,
|
||||
queryParams: Object.keys(queryParams).length > 0 ? queryParams : undefined,
|
||||
timeout: 30000,
|
||||
retries: 3,
|
||||
});
|
||||
|
||||
const data = response.body as { result: ServiceNowRecord };
|
||||
return data.result;
|
||||
}
|
||||
|
||||
async deleteRecord(table: string, sys_id: string): Promise<void> {
|
||||
const endpoint = `/api/now/table/${table}/${sys_id}`;
|
||||
await this.makeRequest<void>(HttpMethod.DELETE, endpoint);
|
||||
}
|
||||
|
||||
async findRecord(
|
||||
table: string,
|
||||
query: string,
|
||||
options?: {
|
||||
limit?: number;
|
||||
fields?: string[];
|
||||
sysparm_display_value?: 'true' | 'false' | 'all';
|
||||
sysparm_exclude_reference_link?: boolean;
|
||||
sysparm_query_no_domain?: boolean;
|
||||
sysparm_view?: 'desktop' | 'mobile' | 'both';
|
||||
}
|
||||
): Promise<ServiceNowRecord[]> {
|
||||
const endpoint = `/api/now/table/${table}`;
|
||||
const queryParams: Record<string, string> = {
|
||||
sysparm_query: query,
|
||||
};
|
||||
|
||||
if (options?.limit) {
|
||||
queryParams['sysparm_limit'] = options.limit.toString();
|
||||
}
|
||||
if (options?.fields) {
|
||||
queryParams['sysparm_fields'] = options.fields.join(',');
|
||||
}
|
||||
if (options?.sysparm_display_value) {
|
||||
queryParams['sysparm_display_value'] = options.sysparm_display_value;
|
||||
}
|
||||
if (options?.sysparm_exclude_reference_link !== undefined) {
|
||||
queryParams['sysparm_exclude_reference_link'] = options.sysparm_exclude_reference_link.toString();
|
||||
}
|
||||
if (options?.sysparm_query_no_domain !== undefined) {
|
||||
queryParams['sysparm_query_no_domain'] = options.sysparm_query_no_domain.toString();
|
||||
}
|
||||
if (options?.sysparm_view) {
|
||||
queryParams['sysparm_view'] = options.sysparm_view;
|
||||
}
|
||||
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.GET,
|
||||
url: `${this.baseURL}${endpoint}`,
|
||||
headers: this.getHeaders(),
|
||||
queryParams,
|
||||
timeout: 30000,
|
||||
retries: 3,
|
||||
});
|
||||
|
||||
const data = response.body as { result: ServiceNowRecord[] };
|
||||
return data.result;
|
||||
}
|
||||
|
||||
async attachFile(
|
||||
table_name: string,
|
||||
table_sys_id: string,
|
||||
file_name: string,
|
||||
content_type: string,
|
||||
filePath?: string,
|
||||
fileBase64?: string,
|
||||
encryption_context?: string
|
||||
): Promise<AttachmentMeta> {
|
||||
if (!filePath && !fileBase64) {
|
||||
throw new Error('Either filePath or fileBase64 must be provided');
|
||||
}
|
||||
|
||||
const queryParams: Record<string, string> = {
|
||||
table_name,
|
||||
table_sys_id,
|
||||
file_name,
|
||||
};
|
||||
|
||||
if (encryption_context) {
|
||||
queryParams['encryption_context'] = encryption_context;
|
||||
}
|
||||
|
||||
let fileData: Buffer | fs.ReadStream;
|
||||
if (filePath) {
|
||||
fileData = fs.createReadStream(filePath);
|
||||
} else {
|
||||
fileData = Buffer.from(fileBase64!.replace(/^data:[^;]+;base64,/, ''), 'base64');
|
||||
}
|
||||
|
||||
const headers = {
|
||||
'Authorization': this.getHeaders()['Authorization'],
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': content_type,
|
||||
};
|
||||
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.POST,
|
||||
url: `${this.baseURL}/api/now/attachment/file`,
|
||||
headers,
|
||||
body: fileData,
|
||||
queryParams,
|
||||
timeout: 120000, // Increased timeout for file uploads
|
||||
retries: 2, // Reduced retries for file uploads
|
||||
});
|
||||
|
||||
const data = response.body as { result: AttachmentMeta };
|
||||
return data.result;
|
||||
}
|
||||
|
||||
async listAttachments(table: string, sys_id: string): Promise<AttachmentMeta[]> {
|
||||
const endpoint = `/api/now/attachment`;
|
||||
const queryParams = {
|
||||
sysparm_query: `table_name=${table}^table_sys_id=${sys_id}`,
|
||||
};
|
||||
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.GET,
|
||||
url: `${this.baseURL}${endpoint}`,
|
||||
headers: this.getHeaders(),
|
||||
queryParams,
|
||||
timeout: 30000,
|
||||
retries: 3,
|
||||
});
|
||||
|
||||
const data = response.body as { result: AttachmentMeta[] };
|
||||
return data.result;
|
||||
}
|
||||
|
||||
async getAttachment(
|
||||
attachment_sys_id: string,
|
||||
accept_type = '*/*'
|
||||
): Promise<{ data: Buffer; metadata?: string }> {
|
||||
const endpoint = `/api/now/attachment/${attachment_sys_id}/file`;
|
||||
|
||||
const headers = {
|
||||
...this.getHeaders(),
|
||||
'Accept': accept_type,
|
||||
};
|
||||
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.GET,
|
||||
url: `${this.baseURL}${endpoint}`,
|
||||
headers,
|
||||
responseType: 'arraybuffer',
|
||||
timeout: 120000, // Increased timeout for large file downloads
|
||||
retries: 2,
|
||||
});
|
||||
|
||||
const metadata = response.headers?.['x-attachment-metadata'] as string;
|
||||
|
||||
return {
|
||||
data: Buffer.from(response.body as ArrayBuffer),
|
||||
metadata,
|
||||
};
|
||||
}
|
||||
|
||||
async pollTableEvents(
|
||||
table: string,
|
||||
since?: string,
|
||||
limit?: number,
|
||||
params?: Record<string, any>
|
||||
): Promise<EventList> {
|
||||
const endpoint = `/api/now/table/${table}`;
|
||||
const queryParams: Record<string, string> = {};
|
||||
|
||||
if (since) {
|
||||
queryParams['sysparm_query'] = `sys_updated_on>${since}`;
|
||||
}
|
||||
if (limit) {
|
||||
queryParams['sysparm_limit'] = limit.toString();
|
||||
}
|
||||
if (params) {
|
||||
Object.entries(params).forEach(([key, value]) => {
|
||||
queryParams[key] = String(value);
|
||||
});
|
||||
}
|
||||
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.GET,
|
||||
url: `${this.baseURL}${endpoint}`,
|
||||
headers: this.getHeaders(),
|
||||
queryParams,
|
||||
timeout: 30000,
|
||||
retries: 3,
|
||||
});
|
||||
|
||||
const data = response.body as { result: ServiceNowRecord[] };
|
||||
|
||||
const events: TriggerEvent[] = data.result.map(record => ({
|
||||
eventId: `${record['sys_id']}_${record['sys_updated_on']}`,
|
||||
table,
|
||||
sys_id: record['sys_id'],
|
||||
operation: since ? 'update' : 'create',
|
||||
fields: record,
|
||||
timestamp: record['sys_updated_on'] || new Date().toISOString(),
|
||||
raw: record,
|
||||
}));
|
||||
|
||||
return {
|
||||
events,
|
||||
hasMore: data.result.length === (limit || 100),
|
||||
nextCursor: events.length > 0 ? events[events.length - 1].timestamp : undefined,
|
||||
};
|
||||
}
|
||||
|
||||
async subscribeWebhook(
|
||||
_table: string,
|
||||
_callbackUrl: string,
|
||||
_events: string[]
|
||||
): Promise<WebhookSubscription | NotSupported> {
|
||||
throw new NotSupported('Webhook subscriptions require manual configuration in ServiceNow Business Rules or IntegrationHub');
|
||||
}
|
||||
|
||||
async unsubscribeWebhook(_subscriptionId: string): Promise<void | NotSupported> {
|
||||
throw new NotSupported('Webhook unsubscription requires manual configuration in ServiceNow Business Rules or IntegrationHub');
|
||||
}
|
||||
|
||||
async getTables(): Promise<Array<{ label: string; value: string }>> {
|
||||
const endpoint = '/api/now/table/sys_db_object';
|
||||
const queryParams = {
|
||||
sysparm_query: 'nameNOT LIKEts_^nameNOT LIKEv_^nameNOT LIKEpa_^super_class.nameISEMPTY',
|
||||
sysparm_fields: 'name,label',
|
||||
sysparm_limit: '1000',
|
||||
};
|
||||
|
||||
try {
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.GET,
|
||||
url: `${this.baseURL}${endpoint}`,
|
||||
headers: this.getHeaders(),
|
||||
queryParams,
|
||||
timeout: 30000,
|
||||
retries: 3,
|
||||
});
|
||||
|
||||
const data = response.body as { result: Array<{ name: string; label: string }> };
|
||||
return data.result.map(table => ({
|
||||
label: `${table.label} (${table.name})`,
|
||||
value: table.name,
|
||||
}));
|
||||
} catch {
|
||||
return [
|
||||
{ label: 'Incident (incident)', value: 'incident' },
|
||||
{ label: 'Change Request (change_request)', value: 'change_request' },
|
||||
{ label: 'Problem (problem)', value: 'problem' },
|
||||
{ label: 'Service Request (sc_request)', value: 'sc_request' },
|
||||
{ label: 'Task (task)', value: 'task' },
|
||||
{ label: 'User (sys_user)', value: 'sys_user' },
|
||||
{ label: 'Group (sys_user_group)', value: 'sys_user_group' },
|
||||
{ label: 'Configuration Item (cmdb_ci)', value: 'cmdb_ci' },
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
async getRecordsForDropdown(table: string, limit = 50): Promise<Array<{ label: string; value: string }>> {
|
||||
const endpoint = `/api/now/table/${table}`;
|
||||
const queryParams = {
|
||||
sysparm_limit: limit.toString(),
|
||||
sysparm_fields: 'sys_id,number,name,short_description,title',
|
||||
};
|
||||
|
||||
try {
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.GET,
|
||||
url: `${this.baseURL}${endpoint}`,
|
||||
headers: this.getHeaders(),
|
||||
queryParams,
|
||||
timeout: 30000,
|
||||
retries: 3,
|
||||
});
|
||||
|
||||
const data = response.body as { result: ServiceNowRecord[] };
|
||||
return data.result.map(record => {
|
||||
const displayName = record['number'] || record['name'] || record['short_description'] || record['title'] || record['sys_id'];
|
||||
return {
|
||||
label: `${displayName} (${record['sys_id']})`,
|
||||
value: record['sys_id'],
|
||||
};
|
||||
});
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
import { Property, DynamicPropsValue, PieceAuth, AppConnectionValueForAuthProperty } from '@activepieces/pieces-framework';
|
||||
import { ServiceNowClient } from './client';
|
||||
|
||||
export const servicenowAuth = PieceAuth.CustomAuth({
|
||||
required: true,
|
||||
props: {
|
||||
instanceUrl: Property.ShortText({
|
||||
displayName: 'Instance URL',
|
||||
description: 'Your ServiceNow instance URL without trailing slash (e.g., https://dev12345.service-now.com)',
|
||||
required: true,
|
||||
}),
|
||||
username: Property.ShortText({
|
||||
displayName: 'Username',
|
||||
description: 'Your ServiceNow username (not email)',
|
||||
required: true,
|
||||
}),
|
||||
password: Property.ShortText({
|
||||
displayName: 'Password',
|
||||
description: 'Your ServiceNow password (not API token)',
|
||||
required: true,
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
export const tableDropdown = Property.Dropdown({
|
||||
auth: servicenowAuth,
|
||||
displayName: 'Table',
|
||||
description: 'ServiceNow table to work with',
|
||||
required: true,
|
||||
refreshers: [],
|
||||
options: async ({ auth }) => {
|
||||
if (!auth) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: 'Please connect your ServiceNow account first',
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
|
||||
try {
|
||||
const client = new ServiceNowClient({
|
||||
instanceUrl: (auth as any).instanceUrl,
|
||||
auth: {
|
||||
type: 'basic',
|
||||
username: (auth as any).username,
|
||||
password: (auth as any).password,
|
||||
},
|
||||
});
|
||||
|
||||
const tables = await client.getTables();
|
||||
return {
|
||||
disabled: false,
|
||||
options: tables,
|
||||
};
|
||||
} catch {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: 'Failed to load tables. Check your credentials.',
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
export const recordDropdown = Property.Dropdown({
|
||||
auth: servicenowAuth,
|
||||
displayName: 'Record',
|
||||
description: 'Select a record from the table',
|
||||
required: true,
|
||||
refreshers: ['table'],
|
||||
options: async ({ auth, table }) => {
|
||||
if (!auth || !table) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: 'Please select a table first',
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
|
||||
try {
|
||||
const client = new ServiceNowClient({
|
||||
instanceUrl: (auth as any).instanceUrl,
|
||||
auth: {
|
||||
type: 'basic',
|
||||
username: (auth as any).username,
|
||||
password: (auth as any).password,
|
||||
},
|
||||
});
|
||||
|
||||
const records = await client.getRecordsForDropdown(table as string);
|
||||
return {
|
||||
disabled: false,
|
||||
options: records,
|
||||
};
|
||||
} catch {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: 'Failed to load records. Check your credentials and table selection.',
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
export function createServiceNowClient(auth: AppConnectionValueForAuthProperty<typeof servicenowAuth>): ServiceNowClient {
|
||||
return new ServiceNowClient({
|
||||
instanceUrl: auth.props.instanceUrl,
|
||||
auth: {
|
||||
type: 'basic',
|
||||
username: auth.props.username,
|
||||
password: auth.props.password,
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const ServiceNowRecordSchema = z.record(z.any());
|
||||
export type ServiceNowRecord = z.infer<typeof ServiceNowRecordSchema>;
|
||||
|
||||
export const AttachmentMetaSchema = z.object({
|
||||
sys_id: z.string(),
|
||||
file_name: z.string(),
|
||||
content_type: z.string(),
|
||||
size_bytes: z.string(),
|
||||
table_name: z.string(),
|
||||
table_sys_id: z.string(),
|
||||
download_link: z.string(),
|
||||
average_image_color: z.string().optional(),
|
||||
compressed: z.string().optional(),
|
||||
created_by_name: z.string().optional(),
|
||||
image_height: z.string().optional(),
|
||||
image_width: z.string().optional(),
|
||||
size_compressed: z.string().optional(),
|
||||
sys_created_by: z.string().optional(),
|
||||
sys_created_on: z.string().optional(),
|
||||
sys_mod_count: z.string().optional(),
|
||||
sys_tags: z.string().optional(),
|
||||
sys_updated_by: z.string().optional(),
|
||||
sys_updated_on: z.string().optional(),
|
||||
updated_by_name: z.string().optional(),
|
||||
});
|
||||
export type AttachmentMeta = z.infer<typeof AttachmentMetaSchema>;
|
||||
|
||||
export const TriggerEventSchema = z.object({
|
||||
eventId: z.string(),
|
||||
table: z.string(),
|
||||
sys_id: z.string(),
|
||||
operation: z.enum(['create', 'update', 'delete']),
|
||||
fields: z.record(z.any()),
|
||||
timestamp: z.string(),
|
||||
raw: z.record(z.any()),
|
||||
});
|
||||
export type TriggerEvent = z.infer<typeof TriggerEventSchema>;
|
||||
|
||||
export const EventListSchema = z.object({
|
||||
events: z.array(TriggerEventSchema),
|
||||
hasMore: z.boolean(),
|
||||
nextCursor: z.string().optional(),
|
||||
});
|
||||
export type EventList = z.infer<typeof EventListSchema>;
|
||||
|
||||
export const WebhookSubscriptionSchema = z.object({
|
||||
id: z.string(),
|
||||
table: z.string(),
|
||||
callbackUrl: z.string(),
|
||||
events: z.array(z.string()),
|
||||
active: z.boolean(),
|
||||
});
|
||||
export type WebhookSubscription = z.infer<typeof WebhookSubscriptionSchema>;
|
||||
|
||||
export class NotSupported extends Error {
|
||||
constructor(message: string) {
|
||||
super(message);
|
||||
this.name = 'NotSupported';
|
||||
}
|
||||
}
|
||||
|
||||
export interface AuthConfig {
|
||||
type: 'basic' | 'bearer';
|
||||
username?: string;
|
||||
password?: string;
|
||||
token?: string;
|
||||
}
|
||||
|
||||
export interface ServiceNowClientOptions {
|
||||
instanceUrl: string;
|
||||
auth: AuthConfig;
|
||||
apiVersion?: string;
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
import {
|
||||
createTrigger,
|
||||
TriggerStrategy,
|
||||
Property,
|
||||
PiecePropValueSchema,
|
||||
AppConnectionValueForAuthProperty,
|
||||
} from '@activepieces/pieces-framework';
|
||||
import {
|
||||
DedupeStrategy,
|
||||
Polling,
|
||||
pollingHelper,
|
||||
} from '@activepieces/pieces-common';
|
||||
import dayjs from 'dayjs';
|
||||
import { servicenowAuth } from '../common/props';
|
||||
import { tableDropdown, createServiceNowClient } from '../common/props';
|
||||
|
||||
const polling: Polling<
|
||||
AppConnectionValueForAuthProperty<typeof servicenowAuth>,
|
||||
{ table: string; filter?: string }
|
||||
> = {
|
||||
strategy: DedupeStrategy.TIMEBASED,
|
||||
items: async ({ auth, propsValue, lastFetchEpochMS }) => {
|
||||
const client = createServiceNowClient(auth);
|
||||
const { table, filter } = propsValue;
|
||||
|
||||
let query = `sys_created_on>${dayjs(lastFetchEpochMS).format(
|
||||
'YYYY-MM-DD HH:mm:ss'
|
||||
)}`;
|
||||
if (filter) {
|
||||
query += `^${filter}`;
|
||||
}
|
||||
|
||||
const records = await client.findRecord(table, query, { limit: 100 });
|
||||
|
||||
return records.map((record) => ({
|
||||
epochMilliSeconds: dayjs(record['sys_created_on']).valueOf(),
|
||||
data: record,
|
||||
}));
|
||||
},
|
||||
};
|
||||
|
||||
export const newRecordTrigger = createTrigger({
|
||||
name: 'new_record',
|
||||
displayName: 'New Record',
|
||||
description: 'Triggers when a new record is created in a table',
|
||||
type: TriggerStrategy.POLLING,
|
||||
props: {
|
||||
table: tableDropdown,
|
||||
filter: Property.LongText({
|
||||
displayName: 'Filter Query',
|
||||
description: 'Encoded query to filter records (e.g., priority=1^state=1)',
|
||||
required: false,
|
||||
}),
|
||||
},
|
||||
sampleData: {
|
||||
sys_id: 'sample_sys_id',
|
||||
number: 'INC0000001',
|
||||
short_description: 'Sample incident',
|
||||
state: '1',
|
||||
priority: '3',
|
||||
sys_created_on: '2023-01-01 00:00:00',
|
||||
sys_updated_on: '2023-01-01 00:00:00',
|
||||
},
|
||||
async onEnable(context) {
|
||||
await pollingHelper.onEnable(polling, {
|
||||
auth: context.auth as any,
|
||||
store: context.store,
|
||||
propsValue: context.propsValue,
|
||||
});
|
||||
},
|
||||
async onDisable(context) {
|
||||
await pollingHelper.onDisable(polling, {
|
||||
auth: context.auth as any,
|
||||
store: context.store,
|
||||
propsValue: context.propsValue,
|
||||
});
|
||||
},
|
||||
async run(context) {
|
||||
return await pollingHelper.poll(polling, {
|
||||
auth: context.auth as any,
|
||||
store: context.store,
|
||||
propsValue: context.propsValue,
|
||||
files: context.files,
|
||||
});
|
||||
},
|
||||
async test(context) {
|
||||
return await pollingHelper.test(polling, {
|
||||
auth: context.auth as any,
|
||||
store: context.store,
|
||||
propsValue: context.propsValue,
|
||||
files: context.files,
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,92 @@
|
||||
import {
|
||||
createTrigger,
|
||||
TriggerStrategy,
|
||||
Property,
|
||||
PiecePropValueSchema,
|
||||
AppConnectionValueForAuthProperty,
|
||||
} from '@activepieces/pieces-framework';
|
||||
import {
|
||||
DedupeStrategy,
|
||||
Polling,
|
||||
pollingHelper,
|
||||
} from '@activepieces/pieces-common';
|
||||
import dayjs from 'dayjs';
|
||||
import { servicenowAuth, tableDropdown, createServiceNowClient } from '../common/props';
|
||||
|
||||
const polling: Polling<
|
||||
AppConnectionValueForAuthProperty<typeof servicenowAuth>,
|
||||
{ table: string; filter?: string }
|
||||
> = {
|
||||
strategy: DedupeStrategy.TIMEBASED,
|
||||
items: async ({ auth, propsValue, lastFetchEpochMS }) => {
|
||||
const client = createServiceNowClient(auth);
|
||||
const { table, filter } = propsValue;
|
||||
|
||||
const lastFetchTime = dayjs(lastFetchEpochMS).format('YYYY-MM-DD HH:mm:ss');
|
||||
let query = `sys_updated_on>${lastFetchTime}^sys_created_on<${lastFetchTime}`;
|
||||
if (filter) {
|
||||
query += `^${filter}`;
|
||||
}
|
||||
|
||||
const records = await client.findRecord(table, query, { limit: 100 });
|
||||
|
||||
return records.map((record) => ({
|
||||
epochMilliSeconds: dayjs(record['sys_updated_on']).valueOf(),
|
||||
data: record,
|
||||
}));
|
||||
},
|
||||
};
|
||||
|
||||
export const updatedRecordTrigger = createTrigger({
|
||||
name: 'updated_record',
|
||||
displayName: 'Updated Record',
|
||||
description: 'Triggers when a record is updated in a table',
|
||||
type: TriggerStrategy.POLLING,
|
||||
props: {
|
||||
table: tableDropdown,
|
||||
filter: Property.LongText({
|
||||
displayName: 'Filter Query',
|
||||
description: 'Encoded query to filter records (e.g., priority=1^state=1)',
|
||||
required: false,
|
||||
}),
|
||||
},
|
||||
sampleData: {
|
||||
sys_id: 'sample_sys_id',
|
||||
number: 'INC0000001',
|
||||
short_description: 'Updated incident description',
|
||||
state: '2',
|
||||
priority: '2',
|
||||
sys_created_on: '2023-01-01 00:00:00',
|
||||
sys_updated_on: '2023-01-01 01:00:00',
|
||||
},
|
||||
async onEnable(context) {
|
||||
await pollingHelper.onEnable(polling, {
|
||||
auth: context.auth as any,
|
||||
store: context.store,
|
||||
propsValue: context.propsValue,
|
||||
});
|
||||
},
|
||||
async onDisable(context) {
|
||||
await pollingHelper.onDisable(polling, {
|
||||
auth: context.auth as any,
|
||||
store: context.store,
|
||||
propsValue: context.propsValue,
|
||||
});
|
||||
},
|
||||
async run(context) {
|
||||
return await pollingHelper.poll(polling, {
|
||||
auth: context.auth as any,
|
||||
store: context.store,
|
||||
propsValue: context.propsValue,
|
||||
files: context.files,
|
||||
});
|
||||
},
|
||||
async test(context) {
|
||||
return await pollingHelper.test(polling, {
|
||||
auth: context.auth as any,
|
||||
store: context.store,
|
||||
propsValue: context.propsValue,
|
||||
files: context.files,
|
||||
});
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user