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

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

import { confluenceAuth } from './lib/auth';
import { confluenceClient } from './lib/common/client';

import { getPageContent } from './lib/actions/get-page-content';
import { createPageFromTemplateAction } from './lib/actions/create-page-from-template';
import { createPageAction } from './lib/actions/create-page';
import { updatePageAction } from './lib/actions/update-page';
import { deletePageAction } from './lib/actions/delete-page';
import { movePageAction } from './lib/actions/move-page';
import { publishDraftAction } from './lib/actions/publish-draft';
import { searchPagesAction } from './lib/actions/search-pages';
import { findPageByTitleAction } from './lib/actions/find-page-by-title';
import { getPageByUrlAction } from './lib/actions/get-page-by-url';
import { addCommentAction } from './lib/actions/add-comment';
import { replyToCommentAction } from './lib/actions/reply-to-comment';
import { listCommentsAction } from './lib/actions/list-comments';
import { uploadAttachmentAction } from './lib/actions/upload-attachment';
import { downloadAttachmentAction } from './lib/actions/download-attachment';
import { listAttachmentsAction } from './lib/actions/list-attachments';
import { addLabelAction } from './lib/actions/add-label';
import { removeLabelAction } from './lib/actions/remove-label';
import { findUserAction } from './lib/actions/find-user';
import { listSpacesAction } from './lib/actions/list-spaces';

import { confluenceAiActions } from './lib/actions/ai';

import { newPageTrigger } from './lib/triggers/new-page';
import { updatedPageTrigger } from './lib/triggers/updated-page';
import { newCommentTrigger } from './lib/triggers/new-comment';
import { newAttachmentTrigger } from './lib/triggers/new-attachment';
import { newBlogPostTrigger } from './lib/triggers/new-blog-post';

export const confluence = createPiece({
  displayName: 'Confluence',
  auth: confluenceAuth,
  minimumSupportedRelease: '0.88.2',
  logoUrl: 'https://cdn.activepieces.com/pieces/confluence.png',
  authors: ['geekyme', 'sanket-a11y'],
  categories: [PieceCategory.CONTENT_AND_FILES],
  actions: [
    getPageContent,
    getPageByUrlAction,
    findPageByTitleAction,
    searchPagesAction,
    createPageAction,
    createPageFromTemplateAction,
    updatePageAction,
    deletePageAction,
    movePageAction,
    publishDraftAction,
    addCommentAction,
    replyToCommentAction,
    listCommentsAction,
    uploadAttachmentAction,
    downloadAttachmentAction,
    listAttachmentsAction,
    addLabelAction,
    removeLabelAction,
    findUserAction,
    listSpacesAction,
    ...confluenceAiActions,
    createCustomApiCallAction({
      baseUrl: (auth) => (auth ? confluenceClient.baseUrl({ auth }) : ''),
      auth: confluenceAuth,
      authMapping: async (auth) => {
        const authValue = auth.props;
        return {
          Authorization: `Basic ${Buffer.from(
            `${authValue.username}:${authValue.password}`
          ).toString('base64')}`,
        };
      },
    }),
  ],
  triggers: [
    newPageTrigger,
    updatedPageTrigger,
    newCommentTrigger,
    newAttachmentTrigger,
    newBlogPostTrigger,
  ],
});