Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

1.6 KB
Raw Blame
import { createCustomApiCallAction } from '@activepieces/pieces-common';
import { createPiece } from '@activepieces/pieces-framework';
import { PieceCategory } from '@activepieces/pieces-framework';
import { Buffer } from 'buffer';

import { gorgiasAuth, getGorgiasBaseUrl } from './lib/auth';
import { createTicketAction } from './lib/actions/create-ticket';
import { getTicketAction } from './lib/actions/get-ticket';
import { updateTicketAction } from './lib/actions/update-ticket';
import { listTicketsAction } from './lib/actions/list-tickets';
import { createMessageAction } from './lib/actions/create-message';
import { getCustomerAction } from './lib/actions/get-customer';

export const gorgias = createPiece({
  displayName: 'Gorgias',
  description: 'Helpdesk platform for ecommerce teams to manage tickets, customers, and support conversations.',
  minimumSupportedRelease: '0.36.1',
  logoUrl: 'https://cdn.activepieces.com/pieces/gorgias.png',
  categories: [PieceCategory.CUSTOMER_SUPPORT],
  auth: gorgiasAuth,
  authors: ['Harmatta'],
  actions: [
    createTicketAction,
    getTicketAction,
    updateTicketAction,
    listTicketsAction,
    createMessageAction,
    getCustomerAction,
    createCustomApiCallAction({
      baseUrl: (auth) => getGorgiasBaseUrl(auth?.props.domain ?? ''),
      auth: gorgiasAuth,
      authMapping: async (auth) => {
        const credentials = `${auth.props.email}:${auth.props.api_key}`;
        return {
          Authorization: `Basic ${Buffer.from(credentials).toString('base64')}`,
        };
      },
    }),
  ],
  triggers: [],
});