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.5 KB
Raw Blame
import { createPiece } from '@activepieces/pieces-framework';
import { createCustomApiCallAction } from '@activepieces/pieces-common';
import { PieceCategory } from '@activepieces/pieces-framework';
import { getEmployeeSystemId } from './lib/actions/get-employee-system-id';
import { getEmployeeInfo } from './lib/actions/get-employee-info';
import { getEmployeeOrganizationalChart } from './lib/actions/get-employee-organizational-chart';
import { getDirectReports } from './lib/actions/get-direct-reports';
import { generateReport } from './lib/actions/generate-report';
import { omnihrAuth } from './lib/auth';

export const omnihr = createPiece({
  displayName: 'Omni HR',
  description:
    'Smart, all-in-one HR platform for managing employees, time tracking, and HR workflows',
  auth: omnihrAuth,
  minimumSupportedRelease: '0.86.0',
  logoUrl: 'https://cdn.activepieces.com/pieces/omnihr.png',
  authors: ['arinmak', 'danielpoonwj'],
  categories: [PieceCategory.HUMAN_RESOURCES],
  actions: [
    getEmployeeSystemId,
    getEmployeeInfo,
    getEmployeeOrganizationalChart,
    getDirectReports,
    generateReport,
    createCustomApiCallAction({
      baseUrl: () => 'https://api.omnihr.co/api/',
      auth: omnihrAuth,
      authMapping: async (auth) => {
        const headers: Record<string, string> = {
          Authorization: `Bearer ${auth.access_token}`,
          'Content-Type': 'application/json',
          Origin: auth.props.origin,
        };

        return headers;
      },
    }),
  ],
  triggers: [],
});