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.8 KB
Raw Blame
import {
  createTrigger,
  Property,
  TriggerStrategy,
} from '@activepieces/pieces-framework';
import { greipAuth } from '../common/auth';

export const proxyConnectionDetectedTrigger = createTrigger({
  name: 'proxy_connection_detected',
  classification: 'READ',
  displayName: 'Proxy Connection Detected',
  description: 'Triggers when a new proxy connection is detected',
  aiMetadata: {
    description: 'Fires when Greip detects an incoming connection from a proxy, Tor, relay, bot, or hosting IP. Delivered via a Greip webhook (proxy_detected event) that must be configured manually in the Greip dashboard.',
  },
  auth: greipAuth,
  props: {
    webhookInstructions: Property.MarkDown({
      value: `
To use this trigger, you need to manually set up a webhook in your Greip account:

1. Login to your Greip dashboard.
2. Go to Settings > Integrations > Webhooks.
3. Click on "Add Webhook" or "Create New Webhook".
4. Add the following URL in the **Webhook URL** field:
\`\`\`text
{{webhookUrl}}
\`\`\`
5. Select **proxy_detected** from the event types.
6. Click Save to create the webhook.

**Note:** Webhooks are only available for paid subscriptions.
      `,
    }),
  },
  type: TriggerStrategy.WEBHOOK,
  sampleData: {
    event: 'proxy_detected',
    ip: '1.1.1.1',
    ipType: 'IPv4',
    IPNumber: 16843009,
    countryCode: 'US',
    countryGeoNameID: 6252001,
    countryName: 'United States',
    security: {
      isProxy: false,
      proxyType: null,
      isTor: false,
      isBot: false,
      isRelay: false,
      isHosting: false,
    },
  },
  async onEnable(context) {
    // Webhooks are set up manually in Greip dashboard
  },
  async onDisable(context) {
    // Webhooks are removed manually in Greip dashboard
  },
  async run(context) {
    return [context.payload.body];
  },
});